feat: DB_PASS_FILE argument support

This commit is contained in:
Nick 2019-09-21 01:10:45 -04:00
parent f01449a2e4
commit 89754ca7fc

View File

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