diff options
author | BoHong Li | 2017-04-13 01:57:55 +0800 |
---|---|---|
committer | Raccoon Li | 2017-05-08 19:29:07 +0800 |
commit | ecb05336055a37ba8a03c119995cd37d96aad90d (patch) | |
tree | f6815f5ce06befbe3bdb51cfd941d2c6edaf51a0 /lib/config/defaultSSL.js | |
parent | 4738ba7d364111adeb2eb2036d0b24d53a80c0c7 (diff) |
refactor(config.js): Extract config file
* Separate different config source to each files
* Freeze config object
Diffstat (limited to '')
-rw-r--r-- | lib/config/defaultSSL.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/config/defaultSSL.js b/lib/config/defaultSSL.js new file mode 100644 index 00000000..1f1d5590 --- /dev/null +++ b/lib/config/defaultSSL.js @@ -0,0 +1,17 @@ +'use strict' + +const fs = require('fs') + +function getFile (path) { + if (fs.existsSync(path)) { + return path + } + return undefined +} + +module.exports = { + sslkeypath: getFile('/run/secrets/key.pem'), + sslcertpath: getFile('/run/secrets/cert.pem'), + sslcapath: getFile('/run/secrets/ca.pem'), + dhparampath: getFile('/run/secrets/dhparam.pem') +} |