2017-04-13 01:57:55 +08:00
|
|
|
'use strict'
|
|
|
|
|
2018-09-21 01:23:39 +02:00
|
|
|
const os = require('os')
|
|
|
|
|
2017-04-13 01:57:55 +08:00
|
|
|
module.exports = {
|
|
|
|
domain: '',
|
2018-03-07 15:17:35 +01:00
|
|
|
urlPath: '',
|
2018-07-23 03:27:51 +03:00
|
|
|
host: '0.0.0.0',
|
2017-04-13 01:57:55 +08:00
|
|
|
port: 3000,
|
2018-11-13 23:29:33 +01:00
|
|
|
loglevel: 'info',
|
2018-03-07 15:17:35 +01:00
|
|
|
urlAddPort: false,
|
|
|
|
allowOrigin: ['localhost'],
|
|
|
|
useSSL: false,
|
2017-10-13 01:09:04 +02:00
|
|
|
hsts: {
|
|
|
|
enable: true,
|
2018-11-19 22:01:43 +01:00
|
|
|
maxAgeSeconds: 60 * 60 * 24 * 365,
|
2017-10-13 01:09:04 +02:00
|
|
|
includeSubdomains: true,
|
|
|
|
preload: true
|
|
|
|
},
|
2017-10-18 17:10:23 +02:00
|
|
|
csp: {
|
|
|
|
enable: true,
|
|
|
|
directives: {
|
2017-10-18 17:45:57 +02:00
|
|
|
},
|
2017-10-20 12:31:16 +02:00
|
|
|
addDefaults: true,
|
2018-03-30 16:33:32 +02:00
|
|
|
addDisqus: true,
|
|
|
|
addGoogleAnalytics: true,
|
2018-03-10 14:34:14 +01:00
|
|
|
upgradeInsecureRequests: 'auto',
|
|
|
|
reportURI: undefined
|
2017-10-18 17:10:23 +02:00
|
|
|
},
|
2018-03-07 15:17:35 +01:00
|
|
|
protocolUseSSL: false,
|
|
|
|
useCDN: true,
|
|
|
|
allowAnonymous: true,
|
|
|
|
allowAnonymousEdits: false,
|
|
|
|
allowFreeURL: false,
|
2018-11-13 00:14:25 +01:00
|
|
|
forbiddenNoteIDs: ['robots.txt', 'favicon.ico', 'api'],
|
2018-03-07 15:17:35 +01:00
|
|
|
defaultPermission: 'editable',
|
|
|
|
dbURL: '',
|
2017-04-13 01:57:55 +08:00
|
|
|
db: {},
|
|
|
|
// ssl path
|
2018-03-07 15:17:35 +01:00
|
|
|
sslKeyPath: '',
|
|
|
|
sslCertPath: '',
|
|
|
|
sslCAPath: '',
|
|
|
|
dhParamPath: '',
|
2017-04-13 01:57:55 +08:00
|
|
|
// other path
|
2018-09-10 22:35:38 +02:00
|
|
|
viewPath: './public/views',
|
2018-09-21 01:23:39 +02:00
|
|
|
tmpPath: os.tmpdir(),
|
2018-03-07 15:17:35 +01:00
|
|
|
defaultNotePath: './public/default.md',
|
|
|
|
docsPath: './public/docs',
|
2018-06-23 21:47:22 +02:00
|
|
|
uploadsPath: './public/uploads',
|
2017-04-13 01:57:55 +08:00
|
|
|
// session
|
2018-03-07 15:17:35 +01:00
|
|
|
sessionName: 'connect.sid',
|
|
|
|
sessionSecret: 'secret',
|
2018-03-26 00:30:17 +02:00
|
|
|
sessionSecretLen: 128,
|
2018-03-07 15:17:35 +01:00
|
|
|
sessionLife: 14 * 24 * 60 * 60 * 1000, // 14 days
|
|
|
|
staticCacheTime: 1 * 24 * 60 * 60 * 1000, // 1 day
|
2017-04-13 01:57:55 +08:00
|
|
|
// socket.io
|
2018-03-07 15:17:35 +01:00
|
|
|
heartbeatInterval: 5000,
|
|
|
|
heartbeatTimeout: 10000,
|
2019-07-18 13:48:40 +09:00
|
|
|
// toobusy-js
|
|
|
|
responseMaxLag: 70,
|
2017-04-13 01:57:55 +08:00
|
|
|
// document
|
2018-03-07 15:17:35 +01:00
|
|
|
documentMaxLength: 100000,
|
2018-05-31 13:15:41 +02:00
|
|
|
// image upload setting, available options are imgur/s3/filesystem/azure
|
2018-03-07 15:17:35 +01:00
|
|
|
imageUploadType: 'filesystem',
|
2017-04-13 01:57:55 +08:00
|
|
|
imgur: {
|
|
|
|
clientID: undefined
|
|
|
|
},
|
|
|
|
s3: {
|
|
|
|
accessKeyId: undefined,
|
|
|
|
secretAccessKey: undefined,
|
2019-04-15 14:10:54 +08:00
|
|
|
region: undefined,
|
|
|
|
endpoint: undefined
|
2017-04-13 01:57:55 +08:00
|
|
|
},
|
2017-08-30 18:58:34 +02:00
|
|
|
minio: {
|
|
|
|
accessKey: undefined,
|
|
|
|
secretKey: undefined,
|
|
|
|
endPoint: undefined,
|
|
|
|
secure: true,
|
|
|
|
port: 9000
|
|
|
|
},
|
2017-04-13 01:57:55 +08:00
|
|
|
s3bucket: undefined,
|
2018-05-31 13:15:41 +02:00
|
|
|
azure: {
|
|
|
|
connectionString: undefined,
|
|
|
|
container: undefined
|
|
|
|
},
|
2017-04-13 01:57:55 +08:00
|
|
|
// authentication
|
2017-06-27 19:08:05 +02:00
|
|
|
oauth2: {
|
2018-10-04 20:43:39 +02:00
|
|
|
providerName: undefined,
|
2017-06-27 19:08:05 +02:00
|
|
|
authorizationURL: undefined,
|
|
|
|
tokenURL: undefined,
|
|
|
|
clientID: undefined,
|
|
|
|
clientSecret: undefined
|
|
|
|
},
|
2017-04-13 01:57:55 +08:00
|
|
|
facebook: {
|
|
|
|
clientID: undefined,
|
|
|
|
clientSecret: undefined
|
|
|
|
},
|
|
|
|
twitter: {
|
|
|
|
consumerKey: undefined,
|
|
|
|
consumerSecret: undefined
|
|
|
|
},
|
|
|
|
github: {
|
|
|
|
clientID: undefined,
|
|
|
|
clientSecret: undefined
|
|
|
|
},
|
|
|
|
gitlab: {
|
|
|
|
baseURL: undefined,
|
|
|
|
clientID: undefined,
|
|
|
|
clientSecret: undefined,
|
2018-09-25 14:15:36 +02:00
|
|
|
scope: undefined,
|
|
|
|
version: 'v4'
|
2017-04-13 01:57:55 +08:00
|
|
|
},
|
2017-10-29 11:16:40 +01:00
|
|
|
mattermost: {
|
|
|
|
baseURL: undefined,
|
|
|
|
clientID: undefined,
|
|
|
|
clientSecret: undefined
|
|
|
|
},
|
2017-04-13 01:57:55 +08:00
|
|
|
dropbox: {
|
|
|
|
clientID: undefined,
|
2018-01-19 00:25:08 +08:00
|
|
|
clientSecret: undefined,
|
|
|
|
appKey: undefined
|
2017-04-13 01:57:55 +08:00
|
|
|
},
|
|
|
|
google: {
|
|
|
|
clientID: undefined,
|
|
|
|
clientSecret: undefined
|
|
|
|
},
|
|
|
|
ldap: {
|
|
|
|
providerName: undefined,
|
|
|
|
url: undefined,
|
|
|
|
bindDn: undefined,
|
|
|
|
bindCredentials: undefined,
|
|
|
|
searchBase: undefined,
|
|
|
|
searchFilter: undefined,
|
|
|
|
searchAttributes: undefined,
|
2017-12-09 11:17:06 +01:00
|
|
|
usernameField: undefined,
|
2018-03-01 23:51:47 +01:00
|
|
|
useridField: undefined,
|
2017-04-13 01:57:55 +08:00
|
|
|
tlsca: undefined
|
|
|
|
},
|
2017-11-28 12:46:58 +09:00
|
|
|
saml: {
|
|
|
|
idpSsoUrl: undefined,
|
|
|
|
idpCert: undefined,
|
|
|
|
issuer: undefined,
|
|
|
|
identifierFormat: 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
|
|
|
|
groupAttribute: undefined,
|
|
|
|
externalGroups: [],
|
|
|
|
requiredGroups: [],
|
|
|
|
attribute: {
|
|
|
|
id: undefined,
|
|
|
|
username: undefined,
|
|
|
|
email: undefined
|
|
|
|
}
|
|
|
|
},
|
2017-04-13 01:57:55 +08:00
|
|
|
email: true,
|
2018-03-07 15:17:35 +01:00
|
|
|
allowEmailRegister: true,
|
2018-06-23 23:40:46 +02:00
|
|
|
allowGravatar: true,
|
2017-08-31 23:33:55 +02:00
|
|
|
allowPDFExport: true,
|
2019-01-25 19:30:33 +01:00
|
|
|
openID: false
|
2017-04-13 01:57:55 +08:00
|
|
|
}
|