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.
This commit is contained in:
Lars Kiesow 2023-01-22 00:53:10 +01:00
parent 024d052a7b
commit 4d8ffc5d99
No known key found for this signature in database
GPG Key ID: 5DAFE8D9C823CE73

View File

@ -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)