2022-08-09 08:03:30 -04:00
|
|
|
const Path = require('path')
|
2021-07-12 06:40:06 -04:00
|
|
|
const { merge } = require('@overleaf/settings/merge')
|
|
|
|
|
2021-07-07 05:39:09 -04:00
|
|
|
let defaultFeatures, siteUrl
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
// Make time interval config easier.
|
|
|
|
const seconds = 1000
|
|
|
|
const minutes = 60 * seconds
|
|
|
|
|
|
|
|
// These credentials are used for authenticating api requests
|
|
|
|
// between services that may need to go over public channels
|
|
|
|
const httpAuthUser = process.env.WEB_API_USER
|
|
|
|
const httpAuthPass = process.env.WEB_API_PASSWORD
|
|
|
|
const httpAuthUsers = {}
|
|
|
|
if (httpAuthUser && httpAuthPass) {
|
|
|
|
httpAuthUsers[httpAuthUser] = httpAuthPass
|
|
|
|
}
|
|
|
|
|
|
|
|
const intFromEnv = function (name, defaultValue) {
|
|
|
|
if (
|
|
|
|
[null, undefined].includes(defaultValue) ||
|
|
|
|
typeof defaultValue !== 'number'
|
|
|
|
) {
|
|
|
|
throw new Error(
|
|
|
|
`Bad default integer value for setting: ${name}, ${defaultValue}`
|
|
|
|
)
|
|
|
|
}
|
|
|
|
return parseInt(process.env[name], 10) || defaultValue
|
|
|
|
}
|
|
|
|
|
|
|
|
const defaultTextExtensions = [
|
|
|
|
'tex',
|
|
|
|
'latex',
|
|
|
|
'sty',
|
|
|
|
'cls',
|
|
|
|
'bst',
|
|
|
|
'bib',
|
|
|
|
'bibtex',
|
|
|
|
'txt',
|
|
|
|
'tikz',
|
|
|
|
'mtx',
|
|
|
|
'rtex',
|
|
|
|
'md',
|
|
|
|
'asy',
|
|
|
|
'lbx',
|
|
|
|
'bbx',
|
|
|
|
'cbx',
|
|
|
|
'm',
|
|
|
|
'lco',
|
|
|
|
'dtx',
|
|
|
|
'ins',
|
|
|
|
'ist',
|
|
|
|
'def',
|
|
|
|
'clo',
|
|
|
|
'ldf',
|
|
|
|
'rmd',
|
|
|
|
'lua',
|
|
|
|
'gv',
|
|
|
|
'mf',
|
2021-06-11 04:39:50 -04:00
|
|
|
'yml',
|
|
|
|
'yaml',
|
2023-10-04 13:12:09 -04:00
|
|
|
'lhs',
|
|
|
|
'mk',
|
2023-10-18 12:24:12 -04:00
|
|
|
'xmpdata',
|
2024-01-17 03:47:39 -05:00
|
|
|
'cfg',
|
|
|
|
'rnw',
|
|
|
|
'ltx',
|
|
|
|
'inc',
|
2021-05-19 08:07:10 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
const parseTextExtensions = function (extensions) {
|
|
|
|
if (extensions) {
|
|
|
|
return extensions.split(',').map(ext => ext.trim())
|
|
|
|
} else {
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-05 07:46:41 -04:00
|
|
|
const httpPermissionsPolicy = {
|
|
|
|
blocked: [
|
|
|
|
'accelerometer',
|
|
|
|
'attribution-reporting',
|
|
|
|
'browsing-topics',
|
|
|
|
'camera',
|
|
|
|
'display-capture',
|
|
|
|
'encrypted-media',
|
|
|
|
'gamepad',
|
|
|
|
'geolocation',
|
|
|
|
'gyroscope',
|
|
|
|
'hid',
|
|
|
|
'identity-credentials-get',
|
|
|
|
'idle-detection',
|
|
|
|
'local-fonts',
|
|
|
|
'magnetometer',
|
|
|
|
'microphone',
|
|
|
|
'midi',
|
|
|
|
'otp-credentials',
|
|
|
|
'payment',
|
|
|
|
'picture-in-picture',
|
|
|
|
'screen-wake-lock',
|
|
|
|
'serial',
|
|
|
|
'storage-access',
|
|
|
|
'usb',
|
|
|
|
'window-management',
|
|
|
|
'xr-spatial-tracking',
|
|
|
|
],
|
|
|
|
allowed: {
|
|
|
|
autoplay: 'self "https://videos.ctfassets.net"',
|
2024-06-14 08:14:23 -04:00
|
|
|
fullscreen: 'self',
|
2024-04-05 07:46:41 -04:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
module.exports = {
|
2021-07-20 05:26:03 -04:00
|
|
|
env: 'server-ce',
|
|
|
|
|
2021-07-12 06:40:22 -04:00
|
|
|
limits: {
|
|
|
|
httpGlobalAgentMaxSockets: 300,
|
|
|
|
httpsGlobalAgentMaxSockets: 300,
|
|
|
|
},
|
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
allowAnonymousReadAndWriteSharing:
|
2024-02-13 05:02:09 -05:00
|
|
|
process.env.OVERLEAF_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING === 'true',
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
// Databases
|
|
|
|
// ---------
|
|
|
|
mongo: {
|
|
|
|
options: {
|
|
|
|
appname: 'web',
|
2023-02-28 08:26:18 -05:00
|
|
|
maxPoolSize: parseInt(process.env.MONGO_POOL_SIZE, 10) || 100,
|
2021-05-19 08:07:10 -04:00
|
|
|
serverSelectionTimeoutMS:
|
|
|
|
parseInt(process.env.MONGO_SERVER_SELECTION_TIMEOUT, 10) || 60000,
|
2023-11-06 09:37:32 -05:00
|
|
|
// Setting socketTimeoutMS to 0 means no timeout
|
|
|
|
socketTimeoutMS: parseInt(
|
|
|
|
process.env.MONGO_SOCKET_TIMEOUT ?? '60000',
|
|
|
|
10
|
|
|
|
),
|
2024-02-22 06:03:27 -05:00
|
|
|
monitorCommands: true,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
url:
|
|
|
|
process.env.MONGO_CONNECTION_STRING ||
|
|
|
|
process.env.MONGO_URL ||
|
|
|
|
`mongodb://${process.env.MONGO_HOST || '127.0.0.1'}/sharelatex`,
|
2023-04-18 07:15:34 -04:00
|
|
|
hasSecondaries: process.env.MONGO_HAS_SECONDARIES === 'true',
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
redis: {
|
|
|
|
web: {
|
2024-04-25 08:56:00 -04:00
|
|
|
host: process.env.REDIS_HOST || '127.0.0.1',
|
2021-05-19 08:07:10 -04:00
|
|
|
port: process.env.REDIS_PORT || '6379',
|
|
|
|
password: process.env.REDIS_PASSWORD || '',
|
2022-08-09 08:03:30 -04:00
|
|
|
db: process.env.REDIS_DB,
|
2021-05-19 08:07:10 -04:00
|
|
|
maxRetriesPerRequest: parseInt(
|
|
|
|
process.env.REDIS_MAX_RETRIES_PER_REQUEST || '20'
|
|
|
|
),
|
|
|
|
},
|
|
|
|
|
|
|
|
// websessions:
|
|
|
|
// cluster: [
|
2024-04-25 08:56:00 -04:00
|
|
|
// {host: '127.0.0.1', port: 7000}
|
|
|
|
// {host: '127.0.0.1', port: 7001}
|
|
|
|
// {host: '127.0.0.1', port: 7002}
|
|
|
|
// {host: '127.0.0.1', port: 7003}
|
|
|
|
// {host: '127.0.0.1', port: 7004}
|
|
|
|
// {host: '127.0.0.1', port: 7005}
|
2021-05-19 08:07:10 -04:00
|
|
|
// ]
|
|
|
|
|
|
|
|
// ratelimiter:
|
|
|
|
// cluster: [
|
2024-04-25 08:56:00 -04:00
|
|
|
// {host: '127.0.0.1', port: 7000}
|
|
|
|
// {host: '127.0.0.1', port: 7001}
|
|
|
|
// {host: '127.0.0.1', port: 7002}
|
|
|
|
// {host: '127.0.0.1', port: 7003}
|
|
|
|
// {host: '127.0.0.1', port: 7004}
|
|
|
|
// {host: '127.0.0.1', port: 7005}
|
2021-05-19 08:07:10 -04:00
|
|
|
// ]
|
|
|
|
|
|
|
|
// cooldown:
|
|
|
|
// cluster: [
|
2024-04-25 08:56:00 -04:00
|
|
|
// {host: '127.0.0.1', port: 7000}
|
|
|
|
// {host: '127.0.0.1', port: 7001}
|
|
|
|
// {host: '127.0.0.1', port: 7002}
|
|
|
|
// {host: '127.0.0.1', port: 7003}
|
|
|
|
// {host: '127.0.0.1', port: 7004}
|
|
|
|
// {host: '127.0.0.1', port: 7005}
|
2021-05-19 08:07:10 -04:00
|
|
|
// ]
|
|
|
|
|
|
|
|
api: {
|
2024-04-25 08:56:00 -04:00
|
|
|
host: process.env.REDIS_HOST || '127.0.0.1',
|
2021-05-19 08:07:10 -04:00
|
|
|
port: process.env.REDIS_PORT || '6379',
|
|
|
|
password: process.env.REDIS_PASSWORD || '',
|
|
|
|
maxRetriesPerRequest: parseInt(
|
|
|
|
process.env.REDIS_MAX_RETRIES_PER_REQUEST || '20'
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// Service locations
|
|
|
|
// -----------------
|
|
|
|
|
|
|
|
// Configure which ports to run each service on. Generally you
|
|
|
|
// can leave these as they are unless you have some other services
|
|
|
|
// running which conflict, or want to run the web process on port 80.
|
|
|
|
internal: {
|
|
|
|
web: {
|
|
|
|
port: process.env.WEB_PORT || 3000,
|
2024-04-25 08:56:00 -04:00
|
|
|
host: process.env.LISTEN_ADDRESS || '127.0.0.1',
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// Tell each service where to find the other services. If everything
|
|
|
|
// is running locally then this is easy, but they exist as separate config
|
|
|
|
// options incase you want to run some services on remote hosts.
|
|
|
|
apis: {
|
|
|
|
web: {
|
|
|
|
url: `http://${
|
2024-04-25 08:56:00 -04:00
|
|
|
process.env.WEB_API_HOST || process.env.WEB_HOST || '127.0.0.1'
|
2021-05-19 08:07:10 -04:00
|
|
|
}:${process.env.WEB_API_PORT || process.env.WEB_PORT || 3000}`,
|
|
|
|
user: httpAuthUser,
|
|
|
|
pass: httpAuthPass,
|
|
|
|
},
|
|
|
|
documentupdater: {
|
|
|
|
url: `http://${
|
|
|
|
process.env.DOCUPDATER_HOST ||
|
|
|
|
process.env.DOCUMENT_UPDATER_HOST ||
|
2024-04-25 08:56:00 -04:00
|
|
|
'127.0.0.1'
|
2021-07-07 05:39:09 -04:00
|
|
|
}:3003`,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
spelling: {
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.SPELLING_HOST || '127.0.0.1'}:3005`,
|
2021-05-19 08:07:10 -04:00
|
|
|
host: process.env.SPELLING_HOST,
|
|
|
|
},
|
|
|
|
docstore: {
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.DOCSTORE_HOST || '127.0.0.1'}:3016`,
|
|
|
|
pubUrl: `http://${process.env.DOCSTORE_HOST || '127.0.0.1'}:3016`,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
chat: {
|
2024-04-25 08:56:00 -04:00
|
|
|
internal_url: `http://${process.env.CHAT_HOST || '127.0.0.1'}:3010`,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
filestore: {
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.FILESTORE_HOST || '127.0.0.1'}:3009`,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
clsi: {
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.CLSI_HOST || '127.0.0.1'}:3013`,
|
2021-05-19 08:07:10 -04:00
|
|
|
// url: "http://#{process.env['CLSI_LB_HOST']}:3014"
|
|
|
|
backendGroupName: undefined,
|
2023-10-24 06:44:11 -04:00
|
|
|
submissionBackendClass:
|
|
|
|
process.env.CLSI_SUBMISSION_BACKEND_CLASS || 'n2d',
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
2023-03-06 06:46:09 -05:00
|
|
|
project_history: {
|
|
|
|
sendProjectStructureOps: true,
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.PROJECT_HISTORY_HOST || '127.0.0.1'}:3054`,
|
2023-03-06 06:46:09 -05:00
|
|
|
},
|
2021-05-19 08:07:10 -04:00
|
|
|
realTime: {
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.REALTIME_HOST || '127.0.0.1'}:3026`,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
contacts: {
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.CONTACTS_HOST || '127.0.0.1'}:3036`,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
notifications: {
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.NOTIFICATIONS_HOST || '127.0.0.1'}:3042`,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
2021-09-08 04:24:14 -04:00
|
|
|
webpack: {
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.WEBPACK_HOST || '127.0.0.1'}:3808`,
|
2021-09-08 04:24:14 -04:00
|
|
|
},
|
2023-06-27 07:38:30 -04:00
|
|
|
wiki: {
|
|
|
|
url: process.env.WIKI_URL || 'https://learn.sharelatex.com',
|
|
|
|
maxCacheAge: parseInt(process.env.WIKI_MAX_CACHE_AGE || 5 * minutes, 10),
|
|
|
|
},
|
2021-05-19 08:07:10 -04:00
|
|
|
|
2022-01-19 05:41:24 -05:00
|
|
|
haveIBeenPwned: {
|
|
|
|
enabled: process.env.HAVE_I_BEEN_PWNED_ENABLED === 'true',
|
|
|
|
url:
|
|
|
|
process.env.HAVE_I_BEEN_PWNED_URL || 'https://api.pwnedpasswords.com',
|
|
|
|
timeout: parseInt(process.env.HAVE_I_BEEN_PWNED_TIMEOUT, 10) || 5 * 1000,
|
|
|
|
},
|
|
|
|
|
2021-07-12 06:40:06 -04:00
|
|
|
// For legacy reasons, we need to populate the below objects.
|
|
|
|
v1: {},
|
|
|
|
recurly: {},
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
|
2024-04-05 07:46:41 -04:00
|
|
|
// Defines which features are allowed in the
|
|
|
|
// Permissions-Policy HTTP header
|
|
|
|
httpPermissions: httpPermissionsPolicy,
|
|
|
|
useHttpPermissionsPolicy: true,
|
|
|
|
|
2023-04-03 10:48:23 -04:00
|
|
|
jwt: {
|
|
|
|
key: process.env.OT_JWT_AUTH_KEY,
|
|
|
|
algorithm: process.env.OT_JWT_AUTH_ALG || 'HS256',
|
|
|
|
},
|
|
|
|
|
2024-05-24 04:52:00 -04:00
|
|
|
devToolbar: {
|
|
|
|
enabled: false,
|
2023-11-23 08:55:06 -05:00
|
|
|
},
|
|
|
|
|
2021-07-12 06:40:06 -04:00
|
|
|
splitTests: [],
|
2021-05-19 08:07:10 -04:00
|
|
|
|
2024-02-06 04:34:15 -05:00
|
|
|
// Where your instance of Overleaf Community Edition/Server Pro can be found publicly. Used in emails
|
2021-05-19 08:07:10 -04:00
|
|
|
// that are sent out, generated links, etc.
|
2024-04-25 08:56:00 -04:00
|
|
|
siteUrl: (siteUrl = process.env.PUBLIC_URL || 'http://127.0.0.1:3000'),
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
lockManager: {
|
|
|
|
lockTestInterval: intFromEnv('LOCK_MANAGER_LOCK_TEST_INTERVAL', 50),
|
|
|
|
maxTestInterval: intFromEnv('LOCK_MANAGER_MAX_TEST_INTERVAL', 1000),
|
|
|
|
maxLockWaitTime: intFromEnv('LOCK_MANAGER_MAX_LOCK_WAIT_TIME', 10000),
|
|
|
|
redisLockExpiry: intFromEnv('LOCK_MANAGER_REDIS_LOCK_EXPIRY', 30),
|
|
|
|
slowExecutionThreshold: intFromEnv(
|
|
|
|
'LOCK_MANAGER_SLOW_EXECUTION_THRESHOLD',
|
|
|
|
5000
|
|
|
|
),
|
|
|
|
},
|
|
|
|
|
|
|
|
// Optional separate location for websocket connections, if unset defaults to siteUrl.
|
|
|
|
wsUrl: process.env.WEBSOCKET_URL,
|
|
|
|
wsUrlV2: process.env.WEBSOCKET_URL_V2,
|
|
|
|
wsUrlBeta: process.env.WEBSOCKET_URL_BETA,
|
|
|
|
|
|
|
|
wsUrlV2Percentage: parseInt(
|
|
|
|
process.env.WEBSOCKET_URL_V2_PERCENTAGE || '0',
|
|
|
|
10
|
|
|
|
),
|
|
|
|
wsRetryHandshake: parseInt(process.env.WEBSOCKET_RETRY_HANDSHAKE || '5', 10),
|
|
|
|
|
|
|
|
// cookie domain
|
|
|
|
// use full domain for cookies to only be accessible from that domain,
|
|
|
|
// replace subdomain with dot to have them accessible on all subdomains
|
|
|
|
cookieDomain: process.env.COOKIE_DOMAIN,
|
2024-02-06 04:34:15 -05:00
|
|
|
cookieName: process.env.COOKIE_NAME || 'overleaf.sid',
|
2022-09-01 03:20:16 -04:00
|
|
|
cookieRollingSession: true,
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
// this is only used if cookies are used for clsi backend
|
|
|
|
// clsiCookieKey: "clsiserver"
|
|
|
|
|
|
|
|
robotsNoindex: process.env.ROBOTS_NOINDEX === 'true' || false,
|
|
|
|
|
2024-02-22 06:44:39 -05:00
|
|
|
maxEntitiesPerProject: parseInt(
|
|
|
|
process.env.MAX_ENTITIES_PER_PROJECT || '2000',
|
|
|
|
10
|
|
|
|
),
|
2021-05-19 08:07:10 -04:00
|
|
|
|
2023-10-16 05:38:15 -04:00
|
|
|
projectUploadTimeout: parseInt(
|
|
|
|
process.env.PROJECT_UPLOAD_TIMEOUT || '120000',
|
|
|
|
10
|
|
|
|
),
|
2021-05-19 08:07:10 -04:00
|
|
|
maxUploadSize: 50 * 1024 * 1024, // 50 MB
|
2022-11-30 05:08:45 -05:00
|
|
|
multerOptions: {
|
|
|
|
preservePath: process.env.MULTER_PRESERVE_PATH,
|
|
|
|
},
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
// start failing the health check if active handles exceeds this limit
|
|
|
|
maxActiveHandles: process.env.MAX_ACTIVE_HANDLES
|
|
|
|
? parseInt(process.env.MAX_ACTIVE_HANDLES, 10)
|
|
|
|
: undefined,
|
|
|
|
|
|
|
|
// Security
|
|
|
|
// --------
|
|
|
|
security: {
|
2024-05-23 10:51:27 -04:00
|
|
|
sessionSecret: process.env.SESSION_SECRET,
|
|
|
|
sessionSecretUpcoming: process.env.SESSION_SECRET_UPCOMING,
|
|
|
|
sessionSecretFallback: process.env.SESSION_SECRET_FALLBACK,
|
2021-05-19 08:07:10 -04:00
|
|
|
bcryptRounds: parseInt(process.env.BCRYPT_ROUNDS, 10) || 12,
|
|
|
|
}, // number of rounds used to hash user passwords (raised to power 2)
|
|
|
|
|
2022-03-31 06:34:49 -04:00
|
|
|
adminUrl: process.env.ADMIN_URL,
|
|
|
|
adminOnlyLogin: process.env.ADMIN_ONLY_LOGIN === 'true',
|
|
|
|
adminPrivilegeAvailable: process.env.ADMIN_PRIVILEGE_AVAILABLE === 'true',
|
|
|
|
blockCrossOriginRequests: process.env.BLOCK_CROSS_ORIGIN_REQUESTS === 'true',
|
|
|
|
allowedOrigins: (process.env.ALLOWED_ORIGINS || siteUrl).split(','),
|
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
httpAuthUsers,
|
|
|
|
|
|
|
|
// Default features
|
|
|
|
// ----------------
|
|
|
|
//
|
|
|
|
// You can select the features that are enabled by default for new
|
|
|
|
// new users.
|
|
|
|
defaultFeatures: (defaultFeatures = {
|
|
|
|
collaborators: -1,
|
|
|
|
dropbox: true,
|
|
|
|
github: true,
|
|
|
|
gitBridge: true,
|
|
|
|
versioning: true,
|
|
|
|
compileTimeout: 180,
|
|
|
|
compileGroup: 'standard',
|
|
|
|
references: true,
|
|
|
|
trackChanges: true,
|
|
|
|
}),
|
|
|
|
|
2021-10-26 09:31:24 -04:00
|
|
|
// featuresEpoch: 'YYYY-MM-DD',
|
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
features: {
|
|
|
|
personal: defaultFeatures,
|
|
|
|
},
|
|
|
|
|
2021-09-22 07:13:18 -04:00
|
|
|
groupPlanModalOptions: {
|
|
|
|
plan_codes: [],
|
|
|
|
currencies: [],
|
|
|
|
sizes: [],
|
|
|
|
usages: [],
|
|
|
|
},
|
2021-05-19 08:07:10 -04:00
|
|
|
plans: [
|
|
|
|
{
|
|
|
|
planCode: 'personal',
|
|
|
|
name: 'Personal',
|
2022-01-12 04:39:56 -05:00
|
|
|
price_in_cents: 0,
|
2021-05-19 08:07:10 -04:00
|
|
|
features: defaultFeatures,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
2024-10-09 05:17:12 -04:00
|
|
|
disableChat: process.env.OVERLEAF_DISABLE_CHAT === 'true',
|
2021-05-19 08:07:10 -04:00
|
|
|
enableSubscriptions: false,
|
2023-09-20 10:09:57 -04:00
|
|
|
restrictedCountries: [],
|
2024-01-31 05:47:04 -05:00
|
|
|
enableOnboardingEmails: process.env.ENABLE_ONBOARDING_EMAILS === 'true',
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
enabledLinkedFileTypes: (process.env.ENABLED_LINKED_FILE_TYPES || '').split(
|
|
|
|
','
|
|
|
|
),
|
|
|
|
|
|
|
|
// i18n
|
|
|
|
// ------
|
|
|
|
//
|
|
|
|
i18n: {
|
|
|
|
checkForHTMLInVars: process.env.I18N_CHECK_FOR_HTML_IN_VARS === 'true',
|
|
|
|
escapeHTMLInVars: process.env.I18N_ESCAPE_HTML_IN_VARS === 'true',
|
|
|
|
subdomainLang: {
|
|
|
|
www: { lngCode: 'en', url: siteUrl },
|
|
|
|
},
|
|
|
|
defaultLng: 'en',
|
|
|
|
},
|
|
|
|
|
|
|
|
// Spelling languages
|
2024-10-02 04:25:02 -04:00
|
|
|
// dic = available in client
|
|
|
|
// server: false = not available on server
|
2021-05-19 08:07:10 -04:00
|
|
|
// ------------------
|
|
|
|
languages: [
|
|
|
|
{ code: 'en', name: 'English' },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'en_US', dic: 'en_US', name: 'English (American)' },
|
|
|
|
{ code: 'en_GB', dic: 'en_GB', name: 'English (British)' },
|
|
|
|
{ code: 'en_CA', dic: 'en_CA', name: 'English (Canadian)' },
|
|
|
|
{
|
|
|
|
code: 'en_AU',
|
|
|
|
dic: 'en_AU',
|
|
|
|
name: 'English (Australian)',
|
|
|
|
server: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
code: 'en_ZA',
|
|
|
|
dic: 'en_ZA',
|
|
|
|
name: 'English (South African)',
|
|
|
|
server: false,
|
|
|
|
},
|
|
|
|
{ code: 'af', dic: 'af_ZA', name: 'Afrikaans' },
|
|
|
|
{ code: 'an', dic: 'an_ES', name: 'Aragonese', server: false },
|
|
|
|
{ code: 'ar', dic: 'ar', name: 'Arabic' },
|
|
|
|
{ code: 'be_BY', dic: 'be_BY', name: 'Belarusian', server: false },
|
|
|
|
{ code: 'eu', dic: 'eu', name: 'Basque' },
|
|
|
|
{ code: 'bn_BD', dic: 'bn_BD', name: 'Bengali', server: false },
|
|
|
|
{ code: 'bs_BA', dic: 'bs_BA', name: 'Bosnian', server: false },
|
|
|
|
{ code: 'br', dic: 'br_FR', name: 'Breton' },
|
|
|
|
{ code: 'bg', dic: 'bg_BG', name: 'Bulgarian' },
|
|
|
|
{ code: 'ca', dic: 'ca', name: 'Catalan' },
|
|
|
|
{ code: 'hr', dic: 'hr_HR', name: 'Croatian' },
|
|
|
|
{ code: 'cs', dic: 'cs_CZ', name: 'Czech' },
|
2024-10-17 09:28:26 -04:00
|
|
|
{ code: 'da', dic: 'da_DK', name: 'Danish' },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'nl', dic: 'nl', name: 'Dutch' },
|
|
|
|
{ code: 'dz', dic: 'dz', name: 'Dzongkha', server: false },
|
|
|
|
{ code: 'eo', dic: 'eo', name: 'Esperanto' },
|
|
|
|
{ code: 'et', dic: 'et_EE', name: 'Estonian' },
|
|
|
|
{ code: 'fo', dic: 'fo', name: 'Faroese' },
|
|
|
|
{ code: 'fr', dic: 'fr', name: 'French' },
|
2024-10-22 07:23:16 -04:00
|
|
|
{ code: 'gl', dic: 'gl_ES', name: 'Galician' },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'de', dic: 'de_DE', name: 'German' },
|
|
|
|
{ code: 'de_AT', dic: 'de_AT', name: 'German (Austria)', server: false },
|
|
|
|
{
|
|
|
|
code: 'de_CH',
|
|
|
|
dic: 'de_CH',
|
|
|
|
name: 'German (Switzerland)',
|
|
|
|
server: false,
|
|
|
|
},
|
|
|
|
{ code: 'el', dic: 'el_GR', name: 'Greek' },
|
|
|
|
{ code: 'gug_PY', dic: 'gug_PY', name: 'Guarani', server: false },
|
|
|
|
{ code: 'gu_IN', dic: 'gu_IN', name: 'Gujarati', server: false },
|
|
|
|
{ code: 'he_IL', dic: 'he_IL', name: 'Hebrew', server: false },
|
|
|
|
{ code: 'hi_IN', dic: 'hi_IN', name: 'Hindi', server: false },
|
|
|
|
{ code: 'hu_HU', dic: 'hu_HU', name: 'Hungarian', server: false },
|
|
|
|
{ code: 'is_IS', dic: 'is_IS', name: 'Icelandic', server: false },
|
|
|
|
{ code: 'id', dic: 'id_ID', name: 'Indonesian' },
|
|
|
|
{ code: 'ga', dic: 'ga_IE', name: 'Irish' },
|
|
|
|
{ code: 'it', dic: 'it_IT', name: 'Italian' },
|
|
|
|
{ code: 'kk', dic: 'kk_KZ', name: 'Kazakh' },
|
|
|
|
{ code: 'ko', dic: 'ko', name: 'Korean', server: false },
|
2021-05-19 08:07:10 -04:00
|
|
|
{ code: 'ku', name: 'Kurdish' },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'kmr', dic: 'kmr_Latn', name: 'Kurmanji', server: false },
|
|
|
|
{ code: 'lv', dic: 'lv_LV', name: 'Latvian' },
|
|
|
|
{ code: 'lt', dic: 'lt_LT', name: 'Lithuanian' },
|
|
|
|
{ code: 'lo_LA', dic: 'lo_LA', name: 'Laotian', server: false },
|
|
|
|
{ code: 'ml_IN', dic: 'ml_IN', name: 'Malayalam', server: false },
|
|
|
|
{ code: 'mn_MN', dic: 'mn_MN', name: 'Mongolian', server: false },
|
2021-05-19 08:07:10 -04:00
|
|
|
{ code: 'nr', name: 'Ndebele' },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'ne_NP', dic: 'ne_NP', name: 'Nepali', server: false },
|
2021-05-19 08:07:10 -04:00
|
|
|
{ code: 'ns', name: 'Northern Sotho' },
|
2024-10-15 05:51:51 -04:00
|
|
|
{ code: 'no', name: 'Norwegian' },
|
2024-10-16 04:55:05 -04:00
|
|
|
{ code: 'nb_NO', dic: 'nb_NO', name: 'Norwegian (Bokmål)', server: false },
|
|
|
|
{ code: 'nn_NO', dic: 'nn_NO', name: 'Norwegian (Nynorsk)', server: false },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'oc_FR', dic: 'oc_FR', name: 'Occitan', server: false },
|
|
|
|
{ code: 'fa', dic: 'fa_IR', name: 'Persian' },
|
|
|
|
{ code: 'pl', dic: 'pl_PL', name: 'Polish' },
|
|
|
|
{ code: 'pt_BR', dic: 'pt_BR', name: 'Portuguese (Brazilian)' },
|
|
|
|
{
|
|
|
|
code: 'pt_PT',
|
|
|
|
dic: 'pt_PT',
|
|
|
|
name: 'Portuguese (European)',
|
|
|
|
},
|
2021-05-19 08:07:10 -04:00
|
|
|
{ code: 'pa', name: 'Punjabi' },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'ro', dic: 'ro_RO', name: 'Romanian' },
|
|
|
|
{ code: 'ru', dic: 'ru_RU', name: 'Russian' },
|
|
|
|
{ code: 'gd_GB', dic: 'gd_GB', name: 'Scottish Gaelic', server: false },
|
|
|
|
{ code: 'sr_RS', dic: 'sr_RS', name: 'Serbian', server: false },
|
|
|
|
{ code: 'si_LK', dic: 'si_LK', name: 'Sinhala', server: false },
|
|
|
|
{ code: 'sk', dic: 'sk_SK', name: 'Slovak' },
|
|
|
|
{ code: 'sl', dic: 'sl_SI', name: 'Slovenian' },
|
2021-05-19 08:07:10 -04:00
|
|
|
{ code: 'st', name: 'Southern Sotho' },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'es', dic: 'es_ES', name: 'Spanish' },
|
|
|
|
{ code: 'sw_TZ', dic: 'sw_TZ', name: 'Swahili', server: false },
|
|
|
|
{ code: 'sv', dic: 'sv_SE', name: 'Swedish' },
|
|
|
|
{ code: 'tl', dic: 'tl', name: 'Tagalog' },
|
|
|
|
{ code: 'te_IN', dic: 'te_IN', name: 'Telugu', server: false },
|
|
|
|
{ code: 'th_TH', dic: 'th_TH', name: 'Thai', server: false },
|
|
|
|
{ code: 'bo', dic: 'bo', name: 'Tibetan', server: false },
|
2021-05-19 08:07:10 -04:00
|
|
|
{ code: 'ts', name: 'Tsonga' },
|
|
|
|
{ code: 'tn', name: 'Tswana' },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'tr_TR', dic: 'tr_TR', name: 'Turkish', server: false },
|
2024-10-17 09:28:26 -04:00
|
|
|
{ code: 'uk_UA', dic: 'uk_UA', name: 'Ukrainian', server: false },
|
2021-05-19 08:07:10 -04:00
|
|
|
{ code: 'hsb', name: 'Upper Sorbian' },
|
2024-10-02 04:25:02 -04:00
|
|
|
{ code: 'uz_UZ', dic: 'uz_UZ', name: 'Uzbek', server: false },
|
|
|
|
{ code: 'vi_VN', dic: 'vi_VN', name: 'Vietnamese', server: false },
|
2021-05-19 08:07:10 -04:00
|
|
|
{ code: 'cy', name: 'Welsh' },
|
|
|
|
{ code: 'xh', name: 'Xhosa' },
|
|
|
|
],
|
|
|
|
|
2021-10-06 07:23:58 -04:00
|
|
|
translatedLanguages: {
|
|
|
|
cn: '简体中文',
|
|
|
|
cs: 'Čeština',
|
|
|
|
da: 'Dansk',
|
|
|
|
de: 'Deutsch',
|
|
|
|
en: 'English',
|
|
|
|
es: 'Español',
|
|
|
|
fi: 'Suomi',
|
|
|
|
fr: 'Français',
|
|
|
|
it: 'Italiano',
|
|
|
|
ja: '日本語',
|
|
|
|
ko: '한국어',
|
|
|
|
nl: 'Nederlands',
|
|
|
|
no: 'Norsk',
|
|
|
|
pl: 'Polski',
|
|
|
|
pt: 'Português',
|
|
|
|
ro: 'Română',
|
|
|
|
ru: 'Русский',
|
|
|
|
sv: 'Svenska',
|
|
|
|
tr: 'Türkçe',
|
|
|
|
uk: 'Українська',
|
|
|
|
'zh-CN': '简体中文',
|
|
|
|
},
|
|
|
|
|
2022-02-10 04:52:31 -05:00
|
|
|
maxDictionarySize: 1024 * 1024, // 1 MB
|
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
// Password Settings
|
|
|
|
// -----------
|
|
|
|
// These restrict the passwords users can use when registering
|
|
|
|
// opts are from http://antelle.github.io/passfield
|
2021-10-06 07:24:41 -04:00
|
|
|
passwordStrengthOptions: {
|
|
|
|
length: {
|
2023-02-01 04:34:59 -05:00
|
|
|
min: 8,
|
2021-10-06 07:24:41 -04:00
|
|
|
// Bcrypt does not support longer passwords than that.
|
|
|
|
max: 72,
|
|
|
|
},
|
|
|
|
},
|
2021-05-19 08:07:10 -04:00
|
|
|
|
2022-01-26 06:15:32 -05:00
|
|
|
elevateAccountSecurityAfterFailedLogin:
|
|
|
|
parseInt(process.env.ELEVATED_ACCOUNT_SECURITY_AFTER_FAILED_LOGIN_MS, 10) ||
|
|
|
|
24 * 60 * 60 * 1000,
|
|
|
|
|
2022-01-26 06:15:19 -05:00
|
|
|
deviceHistory: {
|
|
|
|
cookieName: process.env.DEVICE_HISTORY_COOKIE_NAME || 'deviceHistory',
|
|
|
|
entryExpiry:
|
|
|
|
parseInt(process.env.DEVICE_HISTORY_ENTRY_EXPIRY_MS, 10) ||
|
2022-05-30 06:18:52 -04:00
|
|
|
90 * 24 * 60 * 60 * 1000,
|
2022-01-26 06:15:19 -05:00
|
|
|
maxEntries: parseInt(process.env.DEVICE_HISTORY_MAX_ENTRIES, 10) || 10,
|
|
|
|
secret: process.env.DEVICE_HISTORY_SECRET,
|
|
|
|
},
|
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
// Email support
|
|
|
|
// -------------
|
|
|
|
//
|
2024-02-06 04:34:15 -05:00
|
|
|
// Overleaf uses nodemailer (http://www.nodemailer.com/) to send transactional emails.
|
2021-05-19 08:07:10 -04:00
|
|
|
// To see the range of transport and options they support, see http://www.nodemailer.com/docs/transports
|
|
|
|
// email:
|
|
|
|
// fromAddress: ""
|
|
|
|
// replyTo: ""
|
|
|
|
// lifecycle: false
|
|
|
|
// # Example transport and parameter settings for Amazon SES
|
|
|
|
// transport: "SES"
|
|
|
|
// parameters:
|
|
|
|
// AWSAccessKeyID: ""
|
|
|
|
// AWSSecretKey: ""
|
|
|
|
|
2021-07-12 06:40:06 -04:00
|
|
|
// For legacy reasons, we need to populate this object.
|
|
|
|
sentry: {},
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
// Production Settings
|
|
|
|
// -------------------
|
|
|
|
debugPugTemplates: process.env.DEBUG_PUG_TEMPLATES === 'true',
|
|
|
|
precompilePugTemplatesAtBootTime: process.env
|
|
|
|
.PRECOMPILE_PUG_TEMPLATES_AT_BOOT_TIME
|
|
|
|
? process.env.PRECOMPILE_PUG_TEMPLATES_AT_BOOT_TIME === 'true'
|
|
|
|
: process.env.NODE_ENV === 'production',
|
|
|
|
|
2022-09-15 08:09:10 -04:00
|
|
|
// Should javascript assets be served minified or not.
|
2021-05-19 08:07:10 -04:00
|
|
|
useMinifiedJs: process.env.MINIFIED_JS === 'true' || false,
|
|
|
|
|
|
|
|
// Should static assets be sent with a header to tell the browser to cache
|
|
|
|
// them.
|
|
|
|
cacheStaticAssets: false,
|
|
|
|
|
2024-02-06 04:34:15 -05:00
|
|
|
// If you are running Overleaf over https, set this to true to send the
|
2021-05-19 08:07:10 -04:00
|
|
|
// cookie with a secure flag (recommended).
|
|
|
|
secureCookie: false,
|
|
|
|
|
|
|
|
// 'SameSite' cookie setting. Can be set to 'lax', 'none' or 'strict'
|
|
|
|
// 'lax' is recommended, as 'strict' will prevent people linking to projects
|
|
|
|
// https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7
|
|
|
|
sameSiteCookie: 'lax',
|
|
|
|
|
2024-02-06 04:34:15 -05:00
|
|
|
// If you are running Overleaf behind a proxy (like Apache, Nginx, etc)
|
2021-05-19 08:07:10 -04:00
|
|
|
// then set this to true to allow it to correctly detect the forwarded IP
|
|
|
|
// address and http/https protocol information.
|
|
|
|
behindProxy: false,
|
|
|
|
|
2022-08-04 04:16:38 -04:00
|
|
|
// Delay before closing the http server upon receiving a SIGTERM process signal.
|
2023-10-23 08:08:44 -04:00
|
|
|
gracefulShutdownDelayInMs:
|
|
|
|
parseInt(process.env.GRACEFUL_SHUTDOWN_DELAY_SECONDS ?? '5', 10) * seconds,
|
2022-08-04 04:16:38 -04:00
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
// Expose the hostname in the `X-Served-By` response header
|
|
|
|
exposeHostname: process.env.EXPOSE_HOSTNAME === 'true',
|
|
|
|
|
|
|
|
// Cookie max age (in milliseconds). Set to false for a browser session.
|
|
|
|
cookieSessionLength: 5 * 24 * 60 * 60 * 1000, // 5 days
|
|
|
|
|
|
|
|
// When true, only allow invites to be sent to email addresses that
|
|
|
|
// already have user accounts
|
|
|
|
restrictInvitesToExistingAccounts: false,
|
|
|
|
|
|
|
|
// Should we allow access to any page without logging in? This includes
|
|
|
|
// public projects, /learn, /templates, about pages, etc.
|
2024-02-13 05:02:09 -05:00
|
|
|
allowPublicAccess: process.env.OVERLEAF_ALLOW_PUBLIC_ACCESS === 'true',
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
// editor should be open by default
|
|
|
|
editorIsOpen: process.env.EDITOR_OPEN !== 'false',
|
|
|
|
|
|
|
|
// site should be open by default
|
|
|
|
siteIsOpen: process.env.SITE_OPEN !== 'false',
|
2023-02-13 07:35:43 -05:00
|
|
|
// status file for closing/opening the site at run-time, polled every 5s
|
|
|
|
siteMaintenanceFile: process.env.SITE_MAINTENANCE_FILE,
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
// Use a single compile directory for all users in a project
|
|
|
|
// (otherwise each user has their own directory)
|
|
|
|
// disablePerUserCompiles: true
|
|
|
|
|
|
|
|
// Domain the client (pdfjs) should download the compiled pdf from
|
2023-11-16 06:55:24 -05:00
|
|
|
pdfDownloadDomain: process.env.COMPILES_USER_CONTENT_DOMAIN, // "http://clsi-lb:3014"
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
// By default turn on feature flag, can be overridden per request.
|
|
|
|
enablePdfCaching: process.env.ENABLE_PDF_CACHING === 'true',
|
|
|
|
|
|
|
|
// Maximum size of text documents in the real-time editing system.
|
|
|
|
max_doc_length: 2 * 1024 * 1024, // 2mb
|
|
|
|
|
2022-02-03 06:37:34 -05:00
|
|
|
primary_email_check_expiration: 1000 * 60 * 60 * 24 * 90, // 90 days
|
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
// Maximum JSON size in HTTP requests
|
|
|
|
// We should be able to process twice the max doc length, to allow for
|
|
|
|
// - the doc content
|
|
|
|
// - text ranges spanning the whole doc
|
|
|
|
//
|
|
|
|
// There's also overhead required for the JSON encoding and the UTF-8 encoding,
|
|
|
|
// theoretically up to 3 times the max doc length. On the other hand, we don't
|
|
|
|
// want to block the event loop with JSON parsing, so we try to find a
|
|
|
|
// practical compromise.
|
|
|
|
max_json_request_size:
|
|
|
|
parseInt(process.env.MAX_JSON_REQUEST_SIZE) || 6 * 1024 * 1024, // 6 MB
|
|
|
|
|
|
|
|
// Internal configs
|
|
|
|
// ----------------
|
|
|
|
path: {
|
|
|
|
// If we ever need to write something to disk (e.g. incoming requests
|
|
|
|
// that need processing but may be too big for memory, then write
|
|
|
|
// them to disk here).
|
2022-08-09 08:03:30 -04:00
|
|
|
dumpFolder: Path.resolve(__dirname, '../data/dumpFolder'),
|
|
|
|
uploadFolder: Path.resolve(__dirname, '../data/uploads'),
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
// Automatic Snapshots
|
|
|
|
// -------------------
|
|
|
|
automaticSnapshots: {
|
|
|
|
// How long should we wait after the user last edited to
|
|
|
|
// take a snapshot?
|
|
|
|
waitTimeAfterLastEdit: 5 * minutes,
|
|
|
|
// Even if edits are still taking place, this is maximum
|
|
|
|
// time to wait before taking another snapshot.
|
|
|
|
maxTimeBetweenSnapshots: 30 * minutes,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Smoke test
|
|
|
|
// ----------
|
|
|
|
// Provide log in credentials and a project to be able to run
|
|
|
|
// some basic smoke tests to check the core functionality.
|
|
|
|
//
|
|
|
|
smokeTest: {
|
|
|
|
user: process.env.SMOKE_TEST_USER,
|
|
|
|
userId: process.env.SMOKE_TEST_USER_ID,
|
|
|
|
password: process.env.SMOKE_TEST_PASSWORD,
|
|
|
|
projectId: process.env.SMOKE_TEST_PROJECT_ID,
|
|
|
|
rateLimitSubject: process.env.SMOKE_TEST_RATE_LIMIT_SUBJECT || '127.0.0.1',
|
|
|
|
stepTimeout: parseInt(process.env.SMOKE_TEST_STEP_TIMEOUT || '10000', 10),
|
|
|
|
},
|
|
|
|
|
2022-09-01 04:44:04 -04:00
|
|
|
appName: process.env.APP_NAME || 'Overleaf (Community Edition)',
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
adminEmail: process.env.ADMIN_EMAIL || 'placeholder@example.com',
|
2021-07-07 05:39:09 -04:00
|
|
|
adminDomains: process.env.ADMIN_DOMAINS
|
|
|
|
? JSON.parse(process.env.ADMIN_DOMAINS)
|
|
|
|
: undefined,
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
nav: {
|
2022-09-01 04:44:04 -04:00
|
|
|
title: process.env.APP_NAME || 'Overleaf Community Edition',
|
2021-05-19 08:07:10 -04:00
|
|
|
|
2021-10-06 07:23:58 -04:00
|
|
|
hide_powered_by: process.env.NAV_HIDE_POWERED_BY === 'true',
|
|
|
|
left_footer: [],
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
right_footer: [
|
|
|
|
{
|
2022-01-19 06:55:33 -05:00
|
|
|
text: "<i class='fa fa-github-square'></i> Fork on GitHub!",
|
2021-10-06 07:23:58 -04:00
|
|
|
url: 'https://github.com/overleaf/overleaf',
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
showSubscriptionLink: false,
|
|
|
|
|
|
|
|
header_extras: [],
|
|
|
|
},
|
|
|
|
// Example:
|
|
|
|
// header_extras: [{text: "Some Page", url: "http://example.com/some/page", class: "subdued"}]
|
|
|
|
|
|
|
|
recaptcha: {
|
2022-01-26 06:15:19 -05:00
|
|
|
endpoint:
|
|
|
|
process.env.RECAPTCHA_ENDPOINT ||
|
|
|
|
'https://www.google.com/recaptcha/api/siteverify',
|
2023-11-28 10:58:51 -05:00
|
|
|
trustedUsers: (process.env.CAPTCHA_TRUSTED_USERS || '')
|
|
|
|
.split(',')
|
|
|
|
.map(x => x.trim())
|
|
|
|
.filter(x => x !== ''),
|
2021-05-19 08:07:10 -04:00
|
|
|
disabled: {
|
|
|
|
invite: true,
|
2021-05-31 12:28:06 -04:00
|
|
|
login: true,
|
2021-07-21 07:52:24 -04:00
|
|
|
passwordReset: true,
|
2021-05-19 08:07:10 -04:00
|
|
|
register: true,
|
2023-06-26 04:32:49 -04:00
|
|
|
addEmail: true,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
customisation: {},
|
|
|
|
|
|
|
|
redirects: {
|
|
|
|
'/templates/index': '/templates/',
|
|
|
|
},
|
|
|
|
|
|
|
|
reloadModuleViewsOnEachRequest: process.env.NODE_ENV === 'development',
|
|
|
|
|
|
|
|
rateLimit: {
|
2024-10-28 07:37:54 -04:00
|
|
|
subnetRateLimiterDisabled:
|
|
|
|
process.env.SUBNET_RATE_LIMITER_DISABLED === 'true',
|
2021-05-19 08:07:10 -04:00
|
|
|
autoCompile: {
|
|
|
|
everyone: process.env.RATE_LIMIT_AUTO_COMPILE_EVERYONE || 100,
|
|
|
|
standard: process.env.RATE_LIMIT_AUTO_COMPILE_STANDARD || 25,
|
|
|
|
},
|
2024-07-29 04:40:36 -04:00
|
|
|
login: {
|
|
|
|
ip: { points: 20, subnetPoints: 200, duration: 60 },
|
|
|
|
email: { points: 10, duration: 120 },
|
|
|
|
},
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
analytics: {
|
2021-07-12 06:40:06 -04:00
|
|
|
enabled: false,
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
|
2023-04-13 10:17:01 -04:00
|
|
|
compileBodySizeLimitMb: process.env.COMPILE_BODY_SIZE_LIMIT_MB || 7,
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
textExtensions: defaultTextExtensions.concat(
|
|
|
|
parseTextExtensions(process.env.ADDITIONAL_TEXT_EXTENSIONS)
|
|
|
|
),
|
|
|
|
|
2023-10-04 13:12:09 -04:00
|
|
|
// case-insensitive file names that is editable (doc) in the editor
|
|
|
|
editableFilenames: ['latexmkrc', '.latexmkrc', 'makefile', 'gnumakefile'],
|
|
|
|
|
2023-05-15 04:31:23 -04:00
|
|
|
fileIgnorePattern:
|
|
|
|
process.env.FILE_IGNORE_PATTERN ||
|
|
|
|
'**/{{__MACOSX,.git,.texpadtmp,.R}{,/**},.!(latexmkrc),*.{dvi,aux,log,toc,out,pdfsync,synctex,synctex(busy),fdb_latexmk,fls,nlo,ind,glo,gls,glg,bbl,blg,doc,docx,gz,swp}}',
|
|
|
|
|
2023-07-06 08:41:09 -04:00
|
|
|
validRootDocExtensions: ['tex', 'Rtex', 'ltx', 'Rnw'],
|
2021-05-19 08:07:10 -04:00
|
|
|
|
|
|
|
emailConfirmationDisabled:
|
|
|
|
process.env.EMAIL_CONFIRMATION_DISABLED === 'true' || false,
|
|
|
|
|
2023-05-26 06:56:15 -04:00
|
|
|
emailAddressLimit: intFromEnv('EMAIL_ADDRESS_LIMIT', 10),
|
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
enabledServices: (process.env.ENABLED_SERVICES || 'web,api')
|
|
|
|
.split(',')
|
|
|
|
.map(s => s.trim()),
|
|
|
|
|
|
|
|
// module options
|
|
|
|
// ----------
|
|
|
|
modules: {
|
|
|
|
sanitize: {
|
|
|
|
options: {
|
|
|
|
allowedTags: [
|
|
|
|
'h1',
|
|
|
|
'h2',
|
|
|
|
'h3',
|
|
|
|
'h4',
|
|
|
|
'h5',
|
|
|
|
'h6',
|
|
|
|
'blockquote',
|
|
|
|
'p',
|
|
|
|
'a',
|
|
|
|
'ul',
|
|
|
|
'ol',
|
|
|
|
'nl',
|
|
|
|
'li',
|
|
|
|
'b',
|
|
|
|
'i',
|
|
|
|
'strong',
|
|
|
|
'em',
|
|
|
|
'strike',
|
|
|
|
'code',
|
|
|
|
'hr',
|
|
|
|
'br',
|
|
|
|
'div',
|
|
|
|
'table',
|
|
|
|
'thead',
|
|
|
|
'col',
|
|
|
|
'caption',
|
|
|
|
'tbody',
|
|
|
|
'tr',
|
|
|
|
'th',
|
|
|
|
'td',
|
|
|
|
'tfoot',
|
|
|
|
'pre',
|
|
|
|
'iframe',
|
|
|
|
'img',
|
|
|
|
'figure',
|
|
|
|
'figcaption',
|
|
|
|
'span',
|
|
|
|
'source',
|
|
|
|
'video',
|
|
|
|
'del',
|
|
|
|
],
|
|
|
|
allowedAttributes: {
|
|
|
|
a: [
|
|
|
|
'href',
|
|
|
|
'name',
|
|
|
|
'target',
|
|
|
|
'class',
|
|
|
|
'event-tracking',
|
|
|
|
'event-tracking-ga',
|
|
|
|
'event-tracking-label',
|
|
|
|
'event-tracking-trigger',
|
|
|
|
],
|
|
|
|
div: ['class', 'id', 'style'],
|
|
|
|
h1: ['class', 'id'],
|
|
|
|
h2: ['class', 'id'],
|
|
|
|
h3: ['class', 'id'],
|
|
|
|
h4: ['class', 'id'],
|
|
|
|
h5: ['class', 'id'],
|
|
|
|
h6: ['class', 'id'],
|
2024-07-09 09:51:04 -04:00
|
|
|
p: ['class'],
|
2021-05-19 08:07:10 -04:00
|
|
|
col: ['width'],
|
|
|
|
figure: ['class', 'id', 'style'],
|
|
|
|
figcaption: ['class', 'id', 'style'],
|
|
|
|
i: ['aria-hidden', 'aria-label', 'class', 'id'],
|
|
|
|
iframe: [
|
|
|
|
'allowfullscreen',
|
|
|
|
'frameborder',
|
|
|
|
'height',
|
|
|
|
'src',
|
|
|
|
'style',
|
|
|
|
'width',
|
|
|
|
],
|
|
|
|
img: ['alt', 'class', 'src', 'style'],
|
|
|
|
source: ['src', 'type'],
|
|
|
|
span: ['class', 'id', 'style'],
|
|
|
|
strong: ['style'],
|
|
|
|
table: ['border', 'class', 'id', 'style'],
|
|
|
|
td: ['colspan', 'rowspan', 'headers', 'style'],
|
|
|
|
th: [
|
|
|
|
'abbr',
|
|
|
|
'headers',
|
|
|
|
'colspan',
|
|
|
|
'rowspan',
|
|
|
|
'scope',
|
|
|
|
'sorted',
|
|
|
|
'style',
|
|
|
|
],
|
|
|
|
tr: ['class'],
|
|
|
|
video: ['alt', 'class', 'controls', 'height', 'width'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
overleafModuleImports: {
|
|
|
|
// modules to import (an empty array for each set of modules)
|
2024-01-04 07:31:13 -05:00
|
|
|
//
|
|
|
|
// Restart webpack after making changes.
|
|
|
|
//
|
2021-05-19 08:07:10 -04:00
|
|
|
createFileModes: [],
|
2023-11-23 08:55:06 -05:00
|
|
|
devToolbar: [],
|
2021-05-19 08:07:10 -04:00
|
|
|
gitBridge: [],
|
|
|
|
publishModal: [],
|
2023-10-25 14:18:37 -04:00
|
|
|
tprFileViewInfo: [],
|
|
|
|
tprFileViewRefreshError: [],
|
|
|
|
tprFileViewRefreshButton: [],
|
|
|
|
tprFileViewNotOriginalImporter: [],
|
2024-05-23 12:12:23 -04:00
|
|
|
newFilePromotions: [],
|
2021-10-06 04:33:24 -04:00
|
|
|
contactUsModal: [],
|
2021-11-10 05:50:01 -05:00
|
|
|
editorToolbarButtons: [],
|
2021-12-10 05:20:24 -05:00
|
|
|
sourceEditorExtensions: [],
|
|
|
|
sourceEditorComponents: [],
|
2024-05-08 06:36:45 -04:00
|
|
|
pdfLogEntryComponents: [],
|
2024-07-10 07:15:12 -04:00
|
|
|
pdfLogEntriesComponents: [],
|
2024-07-31 04:03:30 -04:00
|
|
|
pdfPreviewPromotions: [],
|
2024-06-17 06:34:09 -04:00
|
|
|
diagnosticActions: [],
|
2022-06-08 08:55:37 -04:00
|
|
|
sourceEditorCompletionSources: [],
|
2023-10-26 04:57:00 -04:00
|
|
|
sourceEditorSymbolPalette: [],
|
2024-01-18 07:52:59 -05:00
|
|
|
sourceEditorToolbarComponents: [],
|
2024-05-23 12:12:23 -04:00
|
|
|
editorPromotions: [],
|
2023-12-07 09:29:45 -05:00
|
|
|
langFeedbackLinkingWidgets: [],
|
2024-06-20 12:59:19 -04:00
|
|
|
labsExperiments: [],
|
2022-04-22 09:49:26 -04:00
|
|
|
integrationLinkingWidgets: [],
|
2022-04-25 07:04:44 -04:00
|
|
|
referenceLinkingWidgets: [],
|
2022-09-13 09:57:47 -04:00
|
|
|
importProjectFromGithubModalWrapper: [],
|
2023-03-01 09:07:53 -05:00
|
|
|
importProjectFromGithubMenu: [],
|
2022-11-10 13:21:56 -05:00
|
|
|
editorLeftMenuSync: [],
|
2023-03-20 09:58:46 -04:00
|
|
|
editorLeftMenuManageTemplate: [],
|
2023-05-17 04:59:51 -04:00
|
|
|
oauth2Server: [],
|
2023-07-10 05:21:49 -04:00
|
|
|
managedGroupSubscriptionEnrollmentNotification: [],
|
2024-07-11 10:55:49 -04:00
|
|
|
userNotifications: [],
|
2023-07-14 05:11:57 -04:00
|
|
|
managedGroupEnrollmentInvite: [],
|
2024-02-23 05:08:03 -05:00
|
|
|
ssoCertificateInfo: [],
|
2024-08-05 08:35:56 -04:00
|
|
|
v1ImportDataScreen: [],
|
2024-08-21 07:28:21 -04:00
|
|
|
snapshotUtils: [],
|
2024-10-03 13:01:32 -04:00
|
|
|
usGovBanner: [],
|
2024-08-21 07:28:21 -04:00
|
|
|
offlineModeToolbarButtons: [],
|
2024-09-25 03:55:13 -04:00
|
|
|
settingsEntries: [],
|
2024-10-08 08:18:49 -04:00
|
|
|
autoCompleteExtensions: [],
|
2024-10-10 06:33:44 -04:00
|
|
|
sectionTitleGenerators: [],
|
2024-11-08 08:01:54 -05:00
|
|
|
toastGenerators: [],
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
|
2023-08-31 04:44:05 -04:00
|
|
|
moduleImportSequence: [
|
|
|
|
'history-v1',
|
|
|
|
'launchpad',
|
|
|
|
'server-ce-scripts',
|
|
|
|
'user-activate',
|
|
|
|
],
|
2024-07-03 04:49:13 -04:00
|
|
|
viewIncludes: {},
|
2021-07-14 06:54:37 -04:00
|
|
|
|
2021-05-19 08:07:10 -04:00
|
|
|
csp: {
|
|
|
|
enabled: process.env.CSP_ENABLED === 'true',
|
|
|
|
reportOnly: process.env.CSP_REPORT_ONLY === 'true',
|
|
|
|
reportPercentage: parseFloat(process.env.CSP_REPORT_PERCENTAGE) || 0,
|
|
|
|
reportUri: process.env.CSP_REPORT_URI,
|
2024-06-05 04:33:11 -04:00
|
|
|
exclude: [],
|
2024-10-03 08:04:46 -04:00
|
|
|
viewDirectives: {
|
|
|
|
'app/views/project/ide-react': [`img-src 'self' data: blob:`],
|
|
|
|
},
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
unsupportedBrowsers: {
|
|
|
|
ie: '<=11',
|
2024-02-22 08:21:00 -05:00
|
|
|
safari: '<=13',
|
2021-05-19 08:07:10 -04:00
|
|
|
},
|
2022-12-06 07:57:47 -05:00
|
|
|
|
|
|
|
// ID of the IEEE brand in the rails app
|
|
|
|
ieeeBrandId: intFromEnv('IEEE_BRAND_ID', 15),
|
2023-06-30 04:30:20 -04:00
|
|
|
|
|
|
|
managedUsers: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
2021-05-19 08:07:10 -04:00
|
|
|
}
|
2021-07-12 06:40:06 -04:00
|
|
|
|
|
|
|
module.exports.mergeWith = function (overrides) {
|
|
|
|
return merge(overrides, module.exports)
|
|
|
|
}
|