Migrate config templates to TypeScript

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-04-12 14:23:17 +02:00
parent b6ad2b2625
commit 3340780157
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
10 changed files with 43 additions and 59 deletions

15
lib/config/defaultSSL.ts Normal file
View file

@ -0,0 +1,15 @@
import fs from 'fs'
function getFile (path): string | undefined {
if (fs.existsSync(path)) {
return path
}
return undefined
}
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')
}