mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Move old backend code to old_src folder
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
c42d2223e8
commit
7b9f9a487b
97 changed files with 7 additions and 7 deletions
|
@ -1,57 +0,0 @@
|
|||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
const basePath = path.resolve('/run/secrets/')
|
||||
|
||||
function getSecret (secret): string | undefined {
|
||||
const filePath = path.join(basePath, secret)
|
||||
if (fs.existsSync(filePath)) return fs.readFileSync(filePath, 'utf-8')
|
||||
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 } }
|
||||
|
||||
if (fs.existsSync(basePath)) {
|
||||
dockerSecret = {
|
||||
dbURL: getSecret('dbURL'),
|
||||
sessionSecret: getSecret('sessionsecret'),
|
||||
sslKeyPath: getSecret('sslkeypath'),
|
||||
sslCertPath: getSecret('sslcertpath'),
|
||||
sslCAPath: [getSecret('sslcapath')],
|
||||
dhParamPath: getSecret('dhparampath'),
|
||||
s3: {
|
||||
accessKeyId: getSecret('s3_acccessKeyId'),
|
||||
secretAccessKey: getSecret('s3_secretAccessKey')
|
||||
},
|
||||
azure: {
|
||||
connectionString: getSecret('azure_connectionString')
|
||||
},
|
||||
facebook: {
|
||||
clientID: getSecret('facebook_clientID'),
|
||||
clientSecret: getSecret('facebook_clientSecret')
|
||||
},
|
||||
twitter: {
|
||||
consumerKey: getSecret('twitter_consumerKey'),
|
||||
consumerSecret: getSecret('twitter_consumerSecret')
|
||||
},
|
||||
github: {
|
||||
clientID: getSecret('github_clientID'),
|
||||
clientSecret: getSecret('github_clientSecret')
|
||||
},
|
||||
gitlab: {
|
||||
clientID: getSecret('gitlab_clientID'),
|
||||
clientSecret: getSecret('gitlab_clientSecret')
|
||||
},
|
||||
dropbox: {
|
||||
clientID: getSecret('dropbox_clientID'),
|
||||
clientSecret: getSecret('dropbox_clientSecret'),
|
||||
appKey: getSecret('dropbox_appKey')
|
||||
},
|
||||
google: {
|
||||
clientID: getSecret('google_clientID'),
|
||||
clientSecret: getSecret('google_clientSecret'),
|
||||
hostedDomain: getSecret('google_hostedDomain')
|
||||
},
|
||||
imgur: getSecret('imgur_clientid')
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue