From fb00990f4202ed05d67d99b483a85fbb20e7f078 Mon Sep 17 00:00:00 2001 From: Josh Thorpe <33478918+ThorpeJosh@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:10:34 +0800 Subject: [PATCH] Trim newlines when reading PASSWORD_FILE --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index d16195ac..65ef978b 100644 --- a/src/config.js +++ b/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'); }