2017-04-12 17:57:55 +00:00
|
|
|
'use strict'
|
|
|
|
|
2017-05-08 12:41:38 +00:00
|
|
|
const {toBooleanConfig} = require('./utils')
|
|
|
|
|
2017-04-12 17:57:55 +00:00
|
|
|
module.exports = {
|
|
|
|
domain: process.env.HMD_DOMAIN,
|
|
|
|
urlpath: process.env.HMD_URL_PATH,
|
|
|
|
port: process.env.HMD_PORT,
|
2017-10-11 21:07:27 +00:00
|
|
|
urladdport: toBooleanConfig(process.env.HMD_URL_ADDPORT),
|
2017-05-08 12:41:38 +00:00
|
|
|
usessl: toBooleanConfig(process.env.HMD_USESSL),
|
2017-10-12 23:14:50 +00:00
|
|
|
hsts: {
|
|
|
|
enable: toBooleanConfig(process.env.HMD_HSTS_ENABLE),
|
2017-10-12 23:15:35 +00:00
|
|
|
maxAgeSeconds: process.env.HMD_HSTS_MAX_AGE,
|
|
|
|
includeSubdomains: toBooleanConfig(process.env.HMD_HSTS_INCLUDE_SUBDOMAINS),
|
|
|
|
preload: toBooleanConfig(process.env.HMD_HSTS_PRELOAD)
|
2017-10-12 23:14:50 +00:00
|
|
|
},
|
2017-05-08 12:41:38 +00:00
|
|
|
protocolusessl: toBooleanConfig(process.env.HMD_PROTOCOL_USESSL),
|
2017-04-12 17:57:55 +00:00
|
|
|
alloworigin: process.env.HMD_ALLOW_ORIGIN ? process.env.HMD_ALLOW_ORIGIN.split(',') : undefined,
|
2017-05-08 12:41:38 +00:00
|
|
|
usecdn: toBooleanConfig(process.env.HMD_USECDN),
|
|
|
|
allowanonymous: toBooleanConfig(process.env.HMD_ALLOW_ANONYMOUS),
|
|
|
|
allowfreeurl: toBooleanConfig(process.env.HMD_ALLOW_FREEURL),
|
2017-04-12 17:57:55 +00:00
|
|
|
defaultpermission: process.env.HMD_DEFAULT_PERMISSION,
|
|
|
|
dburl: process.env.HMD_DB_URL,
|
|
|
|
imageUploadType: process.env.HMD_IMAGE_UPLOAD_TYPE,
|
|
|
|
imgur: {
|
|
|
|
clientID: process.env.HMD_IMGUR_CLIENTID
|
|
|
|
},
|
|
|
|
s3: {
|
|
|
|
accessKeyId: process.env.HMD_S3_ACCESS_KEY_ID,
|
|
|
|
secretAccessKey: process.env.HMD_S3_SECRET_ACCESS_KEY,
|
|
|
|
region: process.env.HMD_S3_REGION
|
|
|
|
},
|
|
|
|
s3bucket: process.env.HMD_S3_BUCKET,
|
|
|
|
facebook: {
|
|
|
|
clientID: process.env.HMD_FACEBOOK_CLIENTID,
|
|
|
|
clientSecret: process.env.HMD_FACEBOOK_CLIENTSECRET
|
|
|
|
},
|
|
|
|
twitter: {
|
|
|
|
consumerKey: process.env.HMD_TWITTER_CONSUMERKEY,
|
|
|
|
consumerSecret: process.env.HMD_TWITTER_CONSUMERSECRET
|
|
|
|
},
|
|
|
|
github: {
|
|
|
|
clientID: process.env.HMD_GITHUB_CLIENTID,
|
|
|
|
clientSecret: process.env.HMD_GITHUB_CLIENTSECRET
|
|
|
|
},
|
|
|
|
gitlab: {
|
|
|
|
baseURL: process.env.HMD_GITLAB_BASEURL,
|
|
|
|
clientID: process.env.HMD_GITLAB_CLIENTID,
|
|
|
|
clientSecret: process.env.HMD_GITLAB_CLIENTSECRET,
|
|
|
|
scope: process.env.HMD_GITLAB_SCOPE
|
|
|
|
},
|
2017-10-29 10:16:40 +00:00
|
|
|
mattermost: {
|
|
|
|
baseURL: process.env.HMD_MATTERMOST_BASEURL,
|
|
|
|
clientID: process.env.HMD_MATTERMOST_CLIENTID,
|
|
|
|
clientSecret: process.env.HMD_MATTERMOST_CLIENTSECRET
|
|
|
|
},
|
2017-04-12 17:57:55 +00:00
|
|
|
dropbox: {
|
|
|
|
clientID: process.env.HMD_DROPBOX_CLIENTID,
|
|
|
|
clientSecret: process.env.HMD_DROPBOX_CLIENTSECRET
|
|
|
|
},
|
|
|
|
google: {
|
|
|
|
clientID: process.env.HMD_GOOGLE_CLIENTID,
|
|
|
|
clientSecret: process.env.HMD_GOOGLE_CLIENTSECRET
|
|
|
|
},
|
|
|
|
ldap: {
|
|
|
|
providerName: process.env.HMD_LDAP_PROVIDERNAME,
|
|
|
|
url: process.env.HMD_LDAP_URL,
|
|
|
|
bindDn: process.env.HMD_LDAP_BINDDN,
|
|
|
|
bindCredentials: process.env.HMD_LDAP_BINDCREDENTIALS,
|
|
|
|
tokenSecret: process.env.HMD_LDAP_TOKENSECRET,
|
|
|
|
searchBase: process.env.HMD_LDAP_SEARCHBASE,
|
|
|
|
searchFilter: process.env.HMD_LDAP_SEARCHFILTER,
|
|
|
|
searchAttributes: process.env.HMD_LDAP_SEARCHATTRIBUTES,
|
|
|
|
tlsca: process.env.HMD_LDAP_TLS_CA
|
|
|
|
},
|
2017-11-28 03:46:58 +00:00
|
|
|
saml: {
|
|
|
|
idpSsoUrl: process.env.HMD_SAML_IDPSSOURL,
|
2017-11-29 11:26:28 +00:00
|
|
|
idpCert: process.env.HMD_SAML_IDPCERT,
|
|
|
|
issuer: process.env.HMD_SAML_ISSUER,
|
|
|
|
identifierFormat: process.env.HMD_SAML_IDENTIFIERFORMAT,
|
|
|
|
groupAttribute: process.env.HMD_SAML_GROUPATTRIBUTE,
|
|
|
|
externalGroups: process.env.HMD_SAML_EXTERNALGROUPS ? process.env.HMD_SAML_EXTERNALGROUPS.split('|') : [],
|
|
|
|
requiredGroups: process.env.HMD_SAML_REQUIREDGROUPS ? process.env.HMD_SAML_REQUIREDGROUPS.split('|') : [],
|
|
|
|
attribute: {
|
|
|
|
id: process.env.HMD_SAML_ATTRIBUTE_ID,
|
|
|
|
username: process.env.HMD_SAML_ATTRIBUTE_USERNAME,
|
|
|
|
email: process.env.HMD_SAML_ATTRIBUTE_EMAIL
|
|
|
|
}
|
2017-11-28 03:46:58 +00:00
|
|
|
},
|
2017-05-08 12:41:38 +00:00
|
|
|
email: toBooleanConfig(process.env.HMD_EMAIL),
|
2017-10-25 13:49:37 +00:00
|
|
|
allowemailregister: toBooleanConfig(process.env.HMD_ALLOW_EMAIL_REGISTER),
|
|
|
|
allowpdfexport: toBooleanConfig(process.env.HMD_ALLOW_PDF_EXPORT)
|
2017-04-12 17:57:55 +00:00
|
|
|
}
|