mirror of
https://github.com/status-im/codimd.git
synced 2025-02-05 18:03:34 +00:00
8d8d3f4c41
Signed-off-by: Raccoon <raccoon@hackmd.io>
18 lines
425 B
TypeScript
18 lines
425 B
TypeScript
import * as fs from "fs";
|
|
|
|
function getFile(path) {
|
|
if (fs.existsSync(path)) {
|
|
return path
|
|
}
|
|
return undefined
|
|
}
|
|
|
|
const defaultSSLConfig = {
|
|
sslKeyPath: getFile('/run/secrets/key.pem'),
|
|
sslCertPath: getFile('/run/secrets/cert.pem'),
|
|
sslCAPath: getFile('/run/secrets/ca.pem') !== undefined ? [getFile('/run/secrets/ca.pem')] : [],
|
|
dhParamPath: getFile('/run/secrets/dhparam.pem')
|
|
}
|
|
|
|
export = defaultSSLConfig
|