From 4d8ffc5d9974f42c9ec1ef12c07d3186ca6ba118 Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Sun, 22 Jan 2023 00:53:10 +0100 Subject: [PATCH] Ensure default are similar in different environments This patch tries to make sure that defaults and options work in the same way regardless of users using Docker or a package deployment. - Commit 10295b0 updated `Host` to be empty by default to better support IPv6. This fixes a missed occurrence of the old default. - This makes sure the `SOURCE` environment variable is honored when installing the packages. The `--source` option will still take precedence though. --- prod.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prod.js b/prod.js index 57417033..fa254d4f 100644 --- a/prod.js +++ b/prod.js @@ -20,12 +20,12 @@ var inputConfig = options.config ? Path.resolve(options.config) : null var inputMetadata = options.metadata ? Path.resolve(options.metadata) : null const PORT = options.port || process.env.PORT || 3333 -const HOST = options.host || process.env.HOST || "0.0.0.0" +const HOST = options.host || process.env.HOST const CONFIG_PATH = inputConfig || process.env.CONFIG_PATH || Path.resolve('config') const METADATA_PATH = inputMetadata || process.env.METADATA_PATH || Path.resolve('metadata') const UID = 99 const GID = 100 -const SOURCE = options.source || 'debian' +const SOURCE = options.source || process.env.SOURCE || 'debian' const ROUTER_BASE_PATH = process.env.ROUTER_BASE_PATH || '' console.log(process.env.NODE_ENV, 'Config', CONFIG_PATH, METADATA_PATH)