diff --git a/lib/cluster.js b/lib/cluster.js index 4f83ba2..19bafa9 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -20,6 +20,7 @@ const cluster = require("cluster"); const logger = require("./logger"); +const config = require("./config"); const VERSION = require("../package.json").version; @@ -41,8 +42,13 @@ function getConfig() { let conf = []; const keys = Object.keys(process.env); for (let k of keys) - if (k.startsWith("GENIEACS_")) - conf.push(`${k.slice(9)}=${process.env[k]}`); + if (k.startsWith("GENIEACS_")) { + const name = k.slice(9); + const value = process.env[k]; + const def = config.getDefault(name); + if (def == null || value !== `${def}`) + conf.push(`${name}=${value}`); + } return conf.join(","); } diff --git a/lib/config.coffee b/lib/config.coffee index 74b5fc3..6aad77c 100644 --- a/lib/config.coffee +++ b/lib/config.coffee @@ -190,8 +190,18 @@ get = (option, deviceId) -> return allConfig[option] +getDefault = (optionName) -> + option = options[optionName] + return null if not option + val = option.default + if val and option.type == 'path' + val = path.resolve(val) + return val + + # load authentication scripts try exports.auth = require(path.resolve(allConfig.CONFIG_DIR, 'auth')) exports.get = get +exports.getDefault = getDefault