hedgedoc/old_src/lib/config/defaultSSL.ts
David Mehren 7b9f9a487b
Move old backend code to old_src folder
Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:43:05 +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')
}