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