From ca9890a69c7e08c4592542f28ea5fe5a64366316 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 14 Nov 2020 15:31:59 +0800 Subject: [PATCH] schema: config: make floodServerProxy and ssl properties optional --- server/bin/web-server.ts | 2 +- shared/schema/Config.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/bin/web-server.ts b/server/bin/web-server.ts index 90d6eed0..3c61dbd4 100755 --- a/server/bin/web-server.ts +++ b/server/bin/web-server.ts @@ -31,7 +31,7 @@ const normalizePort = (val: string | number): string | number => { const startWebServer = () => { const port = normalizePort(config.floodServerPort); const host = config.floodServerHost; - const useSSL = config.ssl; + const useSSL = config.ssl ?? false; app.set('port', port); app.set('host', host); diff --git a/shared/schema/Config.ts b/shared/schema/Config.ts index 677c123e..2ed86f4c 100644 --- a/shared/schema/Config.ts +++ b/shared/schema/Config.ts @@ -76,7 +76,7 @@ export const configSchema = object({ // CLI argument: --proxy // Used for development only. Not used in production. // See the "Local Development" section of README.md for detail. - floodServerProxy: string().url(), + floodServerProxy: string().url().optional(), // CLI argument: --maxhistorystates // Flood keeps a history of torrent download and upload speeds. @@ -107,7 +107,7 @@ export const configSchema = object({ // CLI argument: --ssl // Configuration for SSL, if using SSL with the Flood service directly. [default: false] - ssl: boolean(), + ssl: boolean().optional(), // CLI argument: --sslkey // Path to the SSL private key. [default: '/key.pem']