2017-04-12 13:57:55 -04:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const fs = require('fs')
|
|
|
|
const path = require('path')
|
|
|
|
|
2019-09-02 12:43:18 -04:00
|
|
|
const basePath = path.resolve('/run/secrets/')
|
2017-04-12 13:57:55 -04:00
|
|
|
|
|
|
|
function getSecret (secret) {
|
|
|
|
const filePath = path.join(basePath, secret)
|
2019-09-03 11:58:31 -04:00
|
|
|
if (fs.existsSync(filePath)) return fs.readFileSync(filePath, 'utf-8')
|
2017-04-12 13:57:55 -04:00
|
|
|
return undefined
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fs.existsSync(basePath)) {
|
|
|
|
module.exports = {
|
2019-07-01 13:39:28 -04:00
|
|
|
dbURL: getSecret('dbURL'),
|
2019-08-10 02:52:24 -04:00
|
|
|
sessionSecret: getSecret('sessionsecret'),
|
|
|
|
sslKeyPath: getSecret('sslkeypath'),
|
|
|
|
sslCertPath: getSecret('sslcertpath'),
|
|
|
|
sslCAPath: getSecret('sslcapath'),
|
|
|
|
dhParamPath: getSecret('dhparampath'),
|
2017-04-12 13:57:55 -04:00
|
|
|
s3: {
|
|
|
|
accessKeyId: getSecret('s3_acccessKeyId'),
|
|
|
|
secretAccessKey: getSecret('s3_secretAccessKey')
|
|
|
|
},
|
2018-05-31 07:15:41 -04:00
|
|
|
azure: {
|
|
|
|
connectionString: getSecret('azure_connectionString')
|
|
|
|
},
|
2017-04-12 13:57:55 -04:00
|
|
|
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')
|
|
|
|
},
|
2017-10-29 06:16:40 -04:00
|
|
|
mattermost: {
|
|
|
|
clientID: getSecret('mattermost_clientID'),
|
|
|
|
clientSecret: getSecret('mattermost_clientSecret')
|
|
|
|
},
|
2017-04-12 13:57:55 -04:00
|
|
|
dropbox: {
|
|
|
|
clientID: getSecret('dropbox_clientID'),
|
2018-01-18 11:25:08 -05:00
|
|
|
clientSecret: getSecret('dropbox_clientSecret'),
|
|
|
|
appKey: getSecret('dropbox_appKey')
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
|
|
|
google: {
|
|
|
|
clientID: getSecret('google_clientID'),
|
2020-02-06 19:51:58 -05:00
|
|
|
clientSecret: getSecret('google_clientSecret'),
|
|
|
|
hostedDomain: getSecret('google_hostedDomain')
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
2023-06-09 10:50:57 -04:00
|
|
|
imgur: getSecret('imgur_clientid'),
|
|
|
|
oauth2: {
|
|
|
|
clientID: getSecret('oauth2_clientID'),
|
|
|
|
clientSecret: getSecret('oauth2_clientSecret')
|
|
|
|
}
|
2017-04-12 13:57:55 -04:00
|
|
|
}
|
|
|
|
}
|