feat: DB_PASS_FILE argument support

pull/1066/head
Nick 5 years ago
parent f01449a2e4
commit 89754ca7fc

@ -54,6 +54,17 @@ module.exports = {
const packageInfo = require(path.join(WIKI.ROOTPATH, 'package.json'))
// Load DB Password from Docker Secret File
if (process.env.DB_PASS_FILE) {
try {
appconfig.db.pass = fs.readFileSync(process.env.DB_PASS_FILE, 'utf8')
} catch (err) {
console.error(chalk.red.bold(`>>> Failed to read Docker Secret File using path defined in DB_PASS_FILE env variable!`))
console.error(err.message)
process.exit(1)
}
}
WIKI.config = appconfig
WIKI.data = appdata
WIKI.version = packageInfo.version

Loading…
Cancel
Save