config/: Cleanups in defaultSSL.ts and dockerSecret.ts

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-04-12 17:45:50 +02:00
parent ad0b0834e5
commit 37c2cd0731
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
2 changed files with 4 additions and 4 deletions

View file

@ -1,10 +1,10 @@
import fs from 'fs'
function getFile (path): string | undefined {
function getFile (path): string {
if (fs.existsSync(path)) {
return path
}
return undefined
return ''
}
export const defaultSSL = {

View file

@ -9,7 +9,7 @@ function getSecret (secret): string | undefined {
return undefined
}
export let dockerSecret: { s3: { accessKeyId: string | undefined; secretAccessKey: string | undefined }; github: { clientID: string | undefined; clientSecret: string | undefined }; facebook: { clientID: string | undefined; clientSecret: string | undefined }; google: { clientID: string | undefined; hostedDomain: string | undefined; clientSecret: string | undefined }; sessionSecret: string | undefined; sslKeyPath: string | undefined; twitter: { consumerSecret: string | undefined; consumerKey: string | undefined }; dropbox: { clientID: string | undefined; clientSecret: string | undefined; appKey: string | undefined }; gitlab: { clientID: string | undefined; clientSecret: string | undefined }; imgur: string | undefined; sslCertPath: string | undefined; sslCAPath: string | undefined; dhParamPath: string | undefined; dbURL: string | undefined; azure: { connectionString: string | undefined } }
export let dockerSecret: { s3: { accessKeyId: string | undefined; secretAccessKey: string | undefined }; github: { clientID: string | undefined; clientSecret: string | undefined }; facebook: { clientID: string | undefined; clientSecret: string | undefined }; google: { clientID: string | undefined; hostedDomain: string | undefined; clientSecret: string | undefined }; sessionSecret: string | undefined; sslKeyPath: string | undefined; twitter: { consumerSecret: string | undefined; consumerKey: string | undefined }; dropbox: { clientID: string | undefined; clientSecret: string | undefined; appKey: string | undefined }; gitlab: { clientID: string | undefined; clientSecret: string | undefined }; imgur: string | undefined; sslCertPath: string | undefined; sslCAPath: (string | undefined)[]; dhParamPath: string | undefined; dbURL: string | undefined; azure: { connectionString: string | undefined } }
if (fs.existsSync(basePath)) {
dockerSecret = {
@ -17,7 +17,7 @@ if (fs.existsSync(basePath)) {
sessionSecret: getSecret('sessionsecret'),
sslKeyPath: getSecret('sslkeypath'),
sslCertPath: getSecret('sslcertpath'),
sslCAPath: getSecret('sslcapath'),
sslCAPath: [getSecret('sslcapath')],
dhParamPath: getSecret('dhparampath'),
s3: {
accessKeyId: getSecret('s3_acccessKeyId'),