refactor(config.js): Extract config file
* Separate different config source to each files * Freeze config object
This commit is contained in:
17
lib/config/defaultSSL.js
Normal file
17
lib/config/defaultSSL.js
Normal file
@@ -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')
|
||||
}
|
||||
Reference in New Issue
Block a user