2017-04-12 17:57:55 +00:00
|
|
|
'use strict'
|
|
|
|
|
2018-03-16 19:36:04 +00:00
|
|
|
const {toBooleanConfig, toArrayConfig, toIntegerConfig} = require('./utils')
|
2017-05-08 12:41:38 +00:00
|
|
|
|
2017-04-12 17:57:55 +00:00
|
|
|
module.exports = {
|
|
|
|
domain: process.env.HMD_DOMAIN,
|
2018-03-07 14:17:35 +00:00
|
|
|
urlPath: process.env.HMD_URL_PATH,
|
2018-03-16 19:36:04 +00:00
|
|
|
port: toIntegerConfig(process.env.HMD_PORT),
|
2018-03-07 14:17:35 +00:00
|
|
|
urlAddPort: toBooleanConfig(process.env.HMD_URL_ADDPORT),
|
|
|
|
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-10-20 10:31:16 +00:00
|
|
|
csp: {
|
2018-03-10 13:34:14 +00:00
|
|
|
enable: toBooleanConfig(process.env.HMD_CSP_ENABLE),
|
|
|
|
reportURI: process.env.HMD_CSP_REPORTURI
|
2017-10-20 10:31:16 +00:00
|
|
|
},
|
2018-03-07 14:17:35 +00:00
|
|
|
protocolUseSSL: toBooleanConfig(process.env.HMD_PROTOCOL_USESSL),
|
|
|
|
allowOrigin: toArrayConfig(process.env.HMD_ALLOW_ORIGIN),
|
|
|
|
useCDN: toBooleanConfig(process.env.HMD_USECDN),
|
|
|
|
allowAnonymous: toBooleanConfig(process.env.HMD_ALLOW_ANONYMOUS),
|
|
|
|
allowAnonymousEdits: toBooleanConfig(process.env.HMD_ALLOW_ANONYMOUS_EDITS),
|
|
|
|
allowFreeURL: toBooleanConfig(process.env.HMD_ALLOW_FREEURL),
|
|
|
|
defaultPermission: process.env.HMD_DEFAULT_PERMISSION,
|
|
|
|
dbURL: process.env.HMD_DB_URL,
|
2018-03-28 10:49:03 +00:00
|
|
|
sessionSecret: process.env.HMD_SESSION_SECRET,
|
|
|
|
sessionLife: toIntegerConfig(process.env.HMD_SESSION_LIFE),
|
2018-03-07 14:17:35 +00:00
|
|
|
imageUploadType: process.env.HMD_IMAGE_UPLOAD_TYPE,
|
2017-04-12 17:57:55 +00:00
|
|
|
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
|
|
|
|
},
|
2017-08-30 16:58:34 +00:00
|
|
|
minio: {
|
|
|
|
accessKey: process.env.HMD_MINIO_ACCESS_KEY,
|
|
|
|
secretKey: process.env.HMD_MINIO_SECRET_KEY,
|
|
|
|
endPoint: process.env.HMD_MINIO_ENDPOINT,
|
|
|
|
secure: toBooleanConfig(process.env.HMD_MINIO_SECURE),
|
2018-03-16 19:36:04 +00:00
|
|
|
port: toIntegerConfig(process.env.HMD_MINIO_PORT)
|
2017-08-30 16:58:34 +00:00
|
|
|
},
|
2017-04-12 17:57:55 +00:00
|
|
|
s3bucket: process.env.HMD_S3_BUCKET,
|
2018-05-31 11:15:41 +00:00
|
|
|
azure: {
|
|
|
|
connectionString: process.env.HMD_AZURE_CONNECTION_STRING,
|
|
|
|
container: process.env.HMD_AZURE_CONTAINER
|
|
|
|
},
|
2017-04-12 17:57:55 +00:00
|
|
|
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-06-27 17:08:05 +00:00
|
|
|
oauth2: {
|
|
|
|
baseURL: process.env.HMD_OAUTH2_BASEURL,
|
|
|
|
userProfileURL: process.env.HMD_OAUTH2_USER_PROFILE_URL,
|
|
|
|
userProfileUsernameAttr: process.env.HMD_OAUTH2_USER_PROFILE_USERNAME_ATTR,
|
|
|
|
userProfileDisplayNameAttr: process.env.HMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR,
|
|
|
|
userProfileEmailAttr: process.env.HMD_OAUTH2_USER_PROFILE_EMAIL_ATTR,
|
|
|
|
tokenURL: process.env.HMD_OAUTH2_TOKEN_URL,
|
|
|
|
authorizationURL: process.env.HMD_OAUTH2_AUTHORIZATION_URL,
|
|
|
|
clientID: process.env.HMD_OAUTH2_CLIENT_ID,
|
|
|
|
clientSecret: process.env.HMD_OAUTH2_CLIENT_SECRET
|
|
|
|
},
|
2017-04-12 17:57:55 +00:00
|
|
|
dropbox: {
|
|
|
|
clientID: process.env.HMD_DROPBOX_CLIENTID,
|
2018-01-18 16:25:08 +00:00
|
|
|
clientSecret: process.env.HMD_DROPBOX_CLIENTSECRET,
|
|
|
|
appKey: process.env.HMD_DROPBOX_APPKEY
|
2017-04-12 17:57:55 +00:00
|
|
|
},
|
|
|
|
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,
|
|
|
|
searchBase: process.env.HMD_LDAP_SEARCHBASE,
|
|
|
|
searchFilter: process.env.HMD_LDAP_SEARCHFILTER,
|
2017-12-09 19:21:50 +00:00
|
|
|
searchAttributes: toArrayConfig(process.env.HMD_LDAP_SEARCHATTRIBUTES),
|
2017-12-09 10:17:06 +00:00
|
|
|
usernameField: process.env.HMD_LDAP_USERNAMEFIELD,
|
2018-03-01 22:51:47 +00:00
|
|
|
useridField: process.env.HMD_LDAP_USERIDFIELD,
|
2017-04-12 17:57:55 +00:00
|
|
|
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,
|
2017-12-09 19:21:50 +00:00
|
|
|
externalGroups: toArrayConfig(process.env.HMD_SAML_EXTERNALGROUPS, '|', []),
|
|
|
|
requiredGroups: toArrayConfig(process.env.HMD_SAML_REQUIREDGROUPS, '|', []),
|
2017-11-29 11:26:28 +00:00
|
|
|
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),
|
2018-03-07 14:17:35 +00:00
|
|
|
allowEmailRegister: toBooleanConfig(process.env.HMD_ALLOW_EMAIL_REGISTER),
|
2018-06-23 21:40:46 +00:00
|
|
|
allowGravatar: toBooleanConfig(process.env.HMD_ALLOW_GRAVATAR),
|
2018-03-07 14:17:35 +00:00
|
|
|
allowPDFExport: toBooleanConfig(process.env.HMD_ALLOW_PDF_EXPORT)
|
2017-04-12 17:57:55 +00:00
|
|
|
}
|