From 97ea8f7a9828d4c214245c234974eb7623a3e9a2 Mon Sep 17 00:00:00 2001 From: lio  Date: Mon, 24 Aug 2020 01:27:56 +0800 Subject: [PATCH] cert/key added in environment variables --- src/server.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server.js b/src/server.js index 44994505..45f88df8 100644 --- a/src/server.js +++ b/src/server.js @@ -157,9 +157,11 @@ const proxy = { } } +const cert = process.env.cert || path.join(__dirname, '..', 'server.crt') +const key = process.env.key || path.join(__dirname, '..', 'server.key') const options = { - key: fs.readFileSync(path.join(__dirname, '..', 'server.key')), - cert: fs.readFileSync(path.join(__dirname, '..', 'server.crt')) + key: fs.readFileSync(key), + cert: fs.readFileSync(cert) } const server = { @@ -171,4 +173,4 @@ server.whitelist = [] server.blacklist = ['://127\\.\\d+\\.\\d+\\.\\d+', '://localhost'] server.authentication = null -module.exports = server \ No newline at end of file +module.exports = server