Browse Source
Trim newlines when reading PASSWORD_FILE
pull/407/head^2
Josh Thorpe
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/config.js
|
|
|
@ -10,7 +10,7 @@ module.exports.PASSWORD = process.env.PASSWORD; |
|
|
|
// if not, then print the error and proceed
|
|
|
|
if ('PASSWORD_FILE' in process.env && fs.existsSync(process.env.PASSWORD_FILE)) { |
|
|
|
try { |
|
|
|
module.exports.PASSWORD = fs.readFileSync(process.env.PASSWORD_FILE, 'utf8'); |
|
|
|
module.exports.PASSWORD = fs.readFileSync(process.env.PASSWORD_FILE, 'utf8').replace(/[\n\r]/g, ''); |
|
|
|
} catch (err) { |
|
|
|
console.error('Could not load the PASSWORD_FILE, using the contents of the PASSWORD variable instead'); |
|
|
|
} |
|
|
|
|