2017-04-12 13:57:55 -04:00
|
|
|
'use strict'
|
|
|
|
|
2019-05-30 18:27:56 -04:00
|
|
|
const { toBooleanConfig, toArrayConfig, toIntegerConfig } = require('./utils')
|
2017-05-08 08:41:38 -04:00
|
|
|
|
2017-04-12 13:57:55 -04:00
|
|
|
module.exports = {
|
2018-10-05 13:33:40 -04:00
|
|
|
sourceURL: process.env.CMD_SOURCE_URL,
|
2018-06-24 07:22:51 -04:00
|
|
|
domain: process.env.CMD_DOMAIN,
|
|
|
|
urlPath: process.env.CMD_URL_PATH,
|
2018-07-22 20:27:51 -04:00
|
|
|
host: process.env.CMD_HOST,
|
2018-06-24 07:22:51 -04:00
|
|
|
port: toIntegerConfig(process.env.CMD_PORT),
|
2018-07-22 20:27:51 -04:00
|
|
|
path: process.env.CMD_PATH,
|
2018-11-13 17:29:33 -05:00
|
|
|
loglevel: process.env.CMD_LOGLEVEL,
|
2018-06-24 07:22:51 -04:00
|
|
|
urlAddPort: toBooleanConfig(process.env.CMD_URL_ADDPORT),
|
|
|
|
useSSL: toBooleanConfig(process.env.CMD_USESSL),
|
2017-10-12 19:14:50 -04:00
|
|
|
hsts: {
|
2018-06-24 07:22:51 -04:00
|
|
|
enable: toBooleanConfig(process.env.CMD_HSTS_ENABLE),
|
2019-03-04 11:13:33 -05:00
|
|
|
maxAgeSeconds: toIntegerConfig(process.env.CMD_HSTS_MAX_AGE),
|
2018-06-24 07:22:51 -04:00
|
|
|
includeSubdomains: toBooleanConfig(process.env.CMD_HSTS_INCLUDE_SUBDOMAINS),
|
|
|
|
preload: toBooleanConfig(process.env.CMD_HSTS_PRELOAD)
|
2017-10-12 19:14:50 -04:00
|
|
|
},
|
2017-10-20 06:31:16 -04:00
|
|
|
csp: {
|
2018-06-24 07:22:51 -04:00
|
|
|
enable: toBooleanConfig(process.env.CMD_CSP_ENABLE),
|
2021-06-07 16:20:36 -04:00
|
|
|
reportURI: process.env.CMD_CSP_REPORTURI,
|
|
|
|
addDisqus: toBooleanConfig(process.env.CMD_CSP_ADD_DISQUS),
|
2021-07-18 03:59:14 -04:00
|
|
|
addGoogleAnalytics: toBooleanConfig(process.env.CMD_CSP_ADD_GOOGLE_ANALYTICS),
|
2021-08-06 06:58:22 -04:00
|
|
|
allowFraming: toBooleanConfig(process.env.CMD_CSP_ALLOW_FRAMING),
|
|
|
|
allowPDFEmbed: toBooleanConfig(process.env.CMD_CSP_ALLOW_PDF_EMBED)
|
2018-06-24 07:22:51 -04:00
|
|
|
},
|
2020-08-26 20:04:49 -04:00
|
|
|
cookiePolicy: process.env.CMD_COOKIE_POLICY,
|
2018-06-24 07:22:51 -04:00
|
|
|
protocolUseSSL: toBooleanConfig(process.env.CMD_PROTOCOL_USESSL),
|
|
|
|
allowOrigin: toArrayConfig(process.env.CMD_ALLOW_ORIGIN),
|
|
|
|
allowAnonymous: toBooleanConfig(process.env.CMD_ALLOW_ANONYMOUS),
|
|
|
|
allowAnonymousEdits: toBooleanConfig(process.env.CMD_ALLOW_ANONYMOUS_EDITS),
|
|
|
|
allowFreeURL: toBooleanConfig(process.env.CMD_ALLOW_FREEURL),
|
2021-01-23 08:14:47 -05:00
|
|
|
requireFreeURLAuthentication: toBooleanConfig(process.env.CMD_REQUIRE_FREEURL_AUTHENTICATION),
|
2018-11-12 18:14:25 -05:00
|
|
|
forbiddenNoteIDs: toArrayConfig(process.env.CMD_FORBIDDEN_NOTE_IDS),
|
2018-06-24 07:22:51 -04:00
|
|
|
defaultPermission: process.env.CMD_DEFAULT_PERMISSION,
|
|
|
|
dbURL: process.env.CMD_DB_URL,
|
2021-08-12 19:35:20 -04:00
|
|
|
db: {
|
|
|
|
username: process.env.CMD_DB_USERNAME,
|
|
|
|
password: process.env.CMD_DB_PASSWORD,
|
|
|
|
host: process.env.CMD_DB_HOST,
|
|
|
|
port: process.env.CMD_DB_PORT,
|
|
|
|
database: process.env.CMD_DB_DATABASE,
|
|
|
|
dialect: process.env.CMD_DB_DIALECT
|
|
|
|
},
|
2018-06-24 07:22:51 -04:00
|
|
|
sessionSecret: process.env.CMD_SESSION_SECRET,
|
|
|
|
sessionLife: toIntegerConfig(process.env.CMD_SESSION_LIFE),
|
2018-11-26 18:26:25 -05:00
|
|
|
tooBusyLag: toIntegerConfig(process.env.CMD_TOOBUSY_LAG),
|
2018-06-24 07:22:51 -04:00
|
|
|
imageUploadType: process.env.CMD_IMAGE_UPLOAD_TYPE,
|
2017-04-12 13:57:55 -04:00
|
|
|
imgur: {
|
2018-06-24 07:22:51 -04:00
|
|
|
clientID: process.env.CMD_IMGUR_CLIENTID
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
|
|
|
s3: {
|
2018-06-24 07:22:51 -04:00
|
|
|
accessKeyId: process.env.CMD_S3_ACCESS_KEY_ID,
|
|
|
|
secretAccessKey: process.env.CMD_S3_SECRET_ACCESS_KEY,
|
2019-02-11 11:31:45 -05:00
|
|
|
region: process.env.CMD_S3_REGION,
|
|
|
|
endpoint: process.env.CMD_S3_ENDPOINT
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
2017-08-30 12:58:34 -04:00
|
|
|
minio: {
|
2018-06-24 07:22:51 -04:00
|
|
|
accessKey: process.env.CMD_MINIO_ACCESS_KEY,
|
|
|
|
secretKey: process.env.CMD_MINIO_SECRET_KEY,
|
|
|
|
endPoint: process.env.CMD_MINIO_ENDPOINT,
|
|
|
|
secure: toBooleanConfig(process.env.CMD_MINIO_SECURE),
|
|
|
|
port: toIntegerConfig(process.env.CMD_MINIO_PORT)
|
2017-08-30 12:58:34 -04:00
|
|
|
},
|
2019-02-01 06:33:27 -05:00
|
|
|
lutim: {
|
|
|
|
url: process.env.CMD_LUTIM_URL
|
|
|
|
},
|
2018-06-24 07:22:51 -04:00
|
|
|
s3bucket: process.env.CMD_S3_BUCKET,
|
2018-05-31 07:15:41 -04:00
|
|
|
azure: {
|
2018-06-24 07:22:51 -04:00
|
|
|
connectionString: process.env.CMD_AZURE_CONNECTION_STRING,
|
|
|
|
container: process.env.CMD_AZURE_CONTAINER
|
2018-05-31 07:15:41 -04:00
|
|
|
},
|
2017-04-12 13:57:55 -04:00
|
|
|
facebook: {
|
2018-06-24 07:22:51 -04:00
|
|
|
clientID: process.env.CMD_FACEBOOK_CLIENTID,
|
|
|
|
clientSecret: process.env.CMD_FACEBOOK_CLIENTSECRET
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
|
|
|
twitter: {
|
2018-06-24 07:22:51 -04:00
|
|
|
consumerKey: process.env.CMD_TWITTER_CONSUMERKEY,
|
|
|
|
consumerSecret: process.env.CMD_TWITTER_CONSUMERSECRET
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
|
|
|
github: {
|
2018-06-24 07:22:51 -04:00
|
|
|
clientID: process.env.CMD_GITHUB_CLIENTID,
|
|
|
|
clientSecret: process.env.CMD_GITHUB_CLIENTSECRET
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
|
|
|
gitlab: {
|
2018-06-24 07:22:51 -04:00
|
|
|
baseURL: process.env.CMD_GITLAB_BASEURL,
|
|
|
|
clientID: process.env.CMD_GITLAB_CLIENTID,
|
|
|
|
clientSecret: process.env.CMD_GITLAB_CLIENTSECRET,
|
|
|
|
scope: process.env.CMD_GITLAB_SCOPE
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
2017-10-29 06:16:40 -04:00
|
|
|
mattermost: {
|
2018-06-24 07:22:51 -04:00
|
|
|
baseURL: process.env.CMD_MATTERMOST_BASEURL,
|
|
|
|
clientID: process.env.CMD_MATTERMOST_CLIENTID,
|
|
|
|
clientSecret: process.env.CMD_MATTERMOST_CLIENTSECRET
|
2017-10-29 06:16:40 -04:00
|
|
|
},
|
2017-06-27 13:08:05 -04:00
|
|
|
oauth2: {
|
2018-10-04 14:43:39 -04:00
|
|
|
providerName: process.env.CMD_OAUTH2_PROVIDERNAME,
|
2018-06-24 07:22:51 -04:00
|
|
|
baseURL: process.env.CMD_OAUTH2_BASEURL,
|
|
|
|
userProfileURL: process.env.CMD_OAUTH2_USER_PROFILE_URL,
|
2020-11-21 14:26:12 -05:00
|
|
|
userProfileIdAttr: process.env.CMD_OAUTH2_USER_PROFILE_ID_ATTR,
|
2018-06-24 07:22:51 -04:00
|
|
|
userProfileUsernameAttr: process.env.CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR,
|
|
|
|
userProfileDisplayNameAttr: process.env.CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR,
|
|
|
|
userProfileEmailAttr: process.env.CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR,
|
|
|
|
tokenURL: process.env.CMD_OAUTH2_TOKEN_URL,
|
|
|
|
authorizationURL: process.env.CMD_OAUTH2_AUTHORIZATION_URL,
|
|
|
|
clientID: process.env.CMD_OAUTH2_CLIENT_ID,
|
2020-06-20 10:33:57 -04:00
|
|
|
clientSecret: process.env.CMD_OAUTH2_CLIENT_SECRET,
|
2020-11-21 14:26:12 -05:00
|
|
|
scope: process.env.CMD_OAUTH2_SCOPE,
|
|
|
|
rolesClaim: process.env.CMD_OAUTH2_ROLES_CLAIM,
|
|
|
|
accessRole: process.env.CMD_OAUTH2_ACCESS_ROLE
|
2017-06-27 13:08:05 -04:00
|
|
|
},
|
2017-04-12 13:57:55 -04:00
|
|
|
dropbox: {
|
2018-06-24 07:22:51 -04:00
|
|
|
clientID: process.env.CMD_DROPBOX_CLIENTID,
|
|
|
|
clientSecret: process.env.CMD_DROPBOX_CLIENTSECRET,
|
|
|
|
appKey: process.env.CMD_DROPBOX_APPKEY
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
|
|
|
google: {
|
2018-06-24 07:22:51 -04:00
|
|
|
clientID: process.env.CMD_GOOGLE_CLIENTID,
|
2020-02-06 19:51:58 -05:00
|
|
|
clientSecret: process.env.CMD_GOOGLE_CLIENTSECRET,
|
|
|
|
hostedDomain: process.env.CMD_GOOGLE_HOSTEDDOMAIN
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
|
|
|
ldap: {
|
2018-06-24 07:22:51 -04:00
|
|
|
providerName: process.env.CMD_LDAP_PROVIDERNAME,
|
|
|
|
url: process.env.CMD_LDAP_URL,
|
|
|
|
bindDn: process.env.CMD_LDAP_BINDDN,
|
|
|
|
bindCredentials: process.env.CMD_LDAP_BINDCREDENTIALS,
|
|
|
|
searchBase: process.env.CMD_LDAP_SEARCHBASE,
|
|
|
|
searchFilter: process.env.CMD_LDAP_SEARCHFILTER,
|
|
|
|
searchAttributes: toArrayConfig(process.env.CMD_LDAP_SEARCHATTRIBUTES),
|
|
|
|
usernameField: process.env.CMD_LDAP_USERNAMEFIELD,
|
|
|
|
useridField: process.env.CMD_LDAP_USERIDFIELD,
|
|
|
|
tlsca: process.env.CMD_LDAP_TLS_CA
|
2017-04-12 13:57:55 -04:00
|
|
|
},
|
2017-11-27 22:46:58 -05:00
|
|
|
saml: {
|
2022-03-11 08:32:40 -05:00
|
|
|
providerName: process.env.CMD_SAML_PROVIDERNAME,
|
2018-06-24 07:22:51 -04:00
|
|
|
idpSsoUrl: process.env.CMD_SAML_IDPSSOURL,
|
|
|
|
idpCert: process.env.CMD_SAML_IDPCERT,
|
2020-04-29 12:27:00 -04:00
|
|
|
clientCert: process.env.CMD_SAML_CLIENTCERT,
|
2018-06-24 07:22:51 -04:00
|
|
|
issuer: process.env.CMD_SAML_ISSUER,
|
|
|
|
identifierFormat: process.env.CMD_SAML_IDENTIFIERFORMAT,
|
2018-12-12 04:40:24 -05:00
|
|
|
disableRequestedAuthnContext: toBooleanConfig(process.env.CMD_SAML_DISABLEREQUESTEDAUTHNCONTEXT),
|
2018-06-24 07:22:51 -04:00
|
|
|
groupAttribute: process.env.CMD_SAML_GROUPATTRIBUTE,
|
|
|
|
externalGroups: toArrayConfig(process.env.CMD_SAML_EXTERNALGROUPS, '|', []),
|
|
|
|
requiredGroups: toArrayConfig(process.env.CMD_SAML_REQUIREDGROUPS, '|', []),
|
2017-11-29 06:26:28 -05:00
|
|
|
attribute: {
|
2018-06-24 07:22:51 -04:00
|
|
|
id: process.env.CMD_SAML_ATTRIBUTE_ID,
|
|
|
|
username: process.env.CMD_SAML_ATTRIBUTE_USERNAME,
|
|
|
|
email: process.env.CMD_SAML_ATTRIBUTE_EMAIL
|
2017-11-29 06:26:28 -05:00
|
|
|
}
|
2017-11-27 22:46:58 -05:00
|
|
|
},
|
2018-06-24 07:22:51 -04:00
|
|
|
email: toBooleanConfig(process.env.CMD_EMAIL),
|
|
|
|
allowEmailRegister: toBooleanConfig(process.env.CMD_ALLOW_EMAIL_REGISTER),
|
|
|
|
allowGravatar: toBooleanConfig(process.env.CMD_ALLOW_GRAVATAR),
|
2019-10-29 05:53:20 -04:00
|
|
|
openID: toBooleanConfig(process.env.CMD_OPENID),
|
|
|
|
linkifyHeaderStyle: process.env.CMD_LINKIFY_HEADER_STYLE
|
2017-04-12 13:57:55 -04:00
|
|
|
}
|