From 492cc7755c5b3d13b98f77219d0bf701f94cc8e2 Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Thu, 1 Jul 2021 07:56:08 +0930 Subject: [PATCH] fix: generated keys should be 64 chars not 58 --- app/core/api-manager.ts | 4 ++-- app/server.ts | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/core/api-manager.ts b/app/core/api-manager.ts index 8f9b6f762..0768f2e76 100644 --- a/app/core/api-manager.ts +++ b/app/core/api-manager.ts @@ -97,8 +97,8 @@ export class ApiManager extends EventEmitter { this.replace('notifier', notifierApiKey, { userId: '-1' }); } else { // Generate API keys - const UPCFinalKey = upcApiKey ?? `unupc_${crypto.randomBytes(58).toString('hex')}`.substring(0, 58); - const notifierFinalKey = notifierApiKey ?? `unnotify_${crypto.randomBytes(58).toString('hex')}`.substring(0, 58); + const UPCFinalKey = upcApiKey ?? `unupc_${crypto.randomBytes(58).toString('hex')}`.substring(0, 64); + const notifierFinalKey = notifierApiKey ?? `unnotify_${crypto.randomBytes(58).toString('hex')}`.substring(0, 64); // Rebuild config file const data = { diff --git a/app/server.ts b/app/server.ts index 2f2e6c451..5b523852c 100644 --- a/app/server.ts +++ b/app/server.ts @@ -80,10 +80,6 @@ const getAllowedOrigins = (): string[] => { // Get local tld const localTld = varState.data.localTld; - // Get dynamix config file - const filePath = paths.get('myservers-config')!; - const dynamix = loadState<{ remote: { wanport: number } }>(filePath); - // Get server's hostname const serverName = varState.data.name;