Browse Source

Merge pull request #2 from ThorpeJosh/patch-1

Trim newlines when reading PASSWORD_FILE
pull/407/head
Paweł Czochański 3 years ago
committed by GitHub
parent
commit
959a63b2ee
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/config.js

2
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');
}

Loading…
Cancel
Save