hedgedoc/lib/config/defaultSSL.ts
David Mehren 37c2cd0731
config/: Cleanups in defaultSSL.ts and dockerSecret.ts
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:08 +02:00

15 lines
395 B
TypeScript

import fs from 'fs'
function getFile (path): string {
if (fs.existsSync(path)) {
return path
}
return ''
}
export const defaultSSL = {
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')
}