2020-05-06 06:13:10 -04:00
|
|
|
module.exports = {
|
2020-05-06 06:13:11 -04:00
|
|
|
internal: {
|
|
|
|
documentupdater: {
|
2024-04-25 08:56:00 -04:00
|
|
|
host: process.env.LISTEN_ADDRESS || '127.0.0.1',
|
2021-07-13 07:04:42 -04:00
|
|
|
port: 3003,
|
|
|
|
},
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
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'
|
2020-05-06 06:13:11 -04:00
|
|
|
}:${process.env.WEB_API_PORT || process.env.WEB_PORT || 3000}`,
|
2024-02-06 04:34:15 -05:00
|
|
|
user: process.env.WEB_API_USER || 'overleaf',
|
2021-07-13 07:04:42 -04:00
|
|
|
pass: process.env.WEB_API_PASSWORD || 'password',
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
|
|
|
project_history: {
|
2024-04-25 08:56:00 -04:00
|
|
|
url: `http://${process.env.PROJECT_HISTORY_HOST || '127.0.0.1'}:3054`,
|
2021-07-13 07:04:42 -04:00
|
|
|
},
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
redis: {
|
|
|
|
pubsub: {
|
|
|
|
host:
|
2024-04-25 08:56:00 -04:00
|
|
|
process.env.PUBSUB_REDIS_HOST || process.env.REDIS_HOST || '127.0.0.1',
|
2020-04-28 05:39:45 -04:00
|
|
|
port: process.env.PUBSUB_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
2020-05-06 06:13:11 -04:00
|
|
|
password:
|
2020-04-28 05:39:45 -04:00
|
|
|
process.env.PUBSUB_REDIS_PASSWORD || process.env.REDIS_PASSWORD || '',
|
2020-05-06 06:13:11 -04:00
|
|
|
maxRetriesPerRequest: parseInt(
|
|
|
|
process.env.REDIS_MAX_RETRIES_PER_REQUEST || '20'
|
2021-07-13 07:04:42 -04:00
|
|
|
),
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
history: {
|
2020-04-28 05:39:45 -04:00
|
|
|
port: process.env.HISTORY_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
2020-05-06 06:13:11 -04:00
|
|
|
host:
|
2024-04-25 08:56:00 -04:00
|
|
|
process.env.HISTORY_REDIS_HOST || process.env.REDIS_HOST || '127.0.0.1',
|
2020-05-06 06:13:11 -04:00
|
|
|
password:
|
2020-04-28 05:39:45 -04:00
|
|
|
process.env.HISTORY_REDIS_PASSWORD || process.env.REDIS_PASSWORD || '',
|
2020-05-06 06:13:11 -04:00
|
|
|
maxRetriesPerRequest: parseInt(
|
|
|
|
process.env.REDIS_MAX_RETRIES_PER_REQUEST || '20'
|
|
|
|
),
|
|
|
|
},
|
|
|
|
|
|
|
|
project_history: {
|
2022-01-06 08:34:33 -05:00
|
|
|
port: process.env.HISTORY_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
2020-05-06 06:13:11 -04:00
|
|
|
host:
|
2024-04-25 08:56:00 -04:00
|
|
|
process.env.HISTORY_REDIS_HOST || process.env.REDIS_HOST || '127.0.0.1',
|
2020-05-06 06:13:11 -04:00
|
|
|
password:
|
2022-01-06 08:34:33 -05:00
|
|
|
process.env.HISTORY_REDIS_PASSWORD || process.env.REDIS_PASSWORD || '',
|
2020-05-06 06:13:11 -04:00
|
|
|
maxRetriesPerRequest: parseInt(
|
|
|
|
process.env.REDIS_MAX_RETRIES_PER_REQUEST || '20'
|
|
|
|
),
|
|
|
|
key_schema: {
|
2020-04-28 05:39:45 -04:00
|
|
|
projectHistoryOps({ project_id: projectId }) {
|
|
|
|
return `ProjectHistory:Ops:{${projectId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:39:45 -04:00
|
|
|
projectHistoryFirstOpTimestamp({ project_id: projectId }) {
|
|
|
|
return `ProjectHistory:FirstOpTimestamp:{${projectId}}`
|
2021-07-13 07:04:42 -04:00
|
|
|
},
|
|
|
|
},
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
lock: {
|
2020-04-28 05:39:45 -04:00
|
|
|
port: process.env.LOCK_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
2020-05-06 06:13:11 -04:00
|
|
|
host:
|
2024-04-25 08:56:00 -04:00
|
|
|
process.env.LOCK_REDIS_HOST || process.env.REDIS_HOST || '127.0.0.1',
|
2020-05-06 06:13:11 -04:00
|
|
|
password:
|
2020-04-28 05:39:45 -04:00
|
|
|
process.env.LOCK_REDIS_PASSWORD || process.env.REDIS_PASSWORD || '',
|
2020-05-06 06:13:11 -04:00
|
|
|
maxRetriesPerRequest: parseInt(
|
|
|
|
process.env.REDIS_MAX_RETRIES_PER_REQUEST || '20'
|
|
|
|
),
|
|
|
|
key_schema: {
|
2020-04-28 05:39:45 -04:00
|
|
|
blockingKey({ doc_id: docId }) {
|
|
|
|
return `Blocking:{${docId}}`
|
2021-07-13 07:04:42 -04:00
|
|
|
},
|
|
|
|
},
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
documentupdater: {
|
|
|
|
port:
|
2020-04-28 05:39:45 -04:00
|
|
|
process.env.DOC_UPDATER_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
2020-05-06 06:13:11 -04:00
|
|
|
host:
|
|
|
|
process.env.DOC_UPDATER_REDIS_HOST ||
|
|
|
|
process.env.REDIS_HOST ||
|
2024-04-25 08:56:00 -04:00
|
|
|
'127.0.0.1',
|
2020-05-06 06:13:11 -04:00
|
|
|
password:
|
|
|
|
process.env.DOC_UPDATER_REDIS_PASSWORD ||
|
|
|
|
process.env.REDIS_PASSWORD ||
|
|
|
|
'',
|
|
|
|
maxRetriesPerRequest: parseInt(
|
|
|
|
process.env.REDIS_MAX_RETRIES_PER_REQUEST || '20'
|
|
|
|
),
|
|
|
|
key_schema: {
|
2020-04-28 05:36:57 -04:00
|
|
|
blockingKey({ doc_id: docId }) {
|
|
|
|
return `Blocking:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
docLines({ doc_id: docId }) {
|
|
|
|
return `doclines:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
docOps({ doc_id: docId }) {
|
|
|
|
return `DocOps:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
docVersion({ doc_id: docId }) {
|
|
|
|
return `DocVersion:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
docHash({ doc_id: docId }) {
|
|
|
|
return `DocHash:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
projectKey({ doc_id: docId }) {
|
|
|
|
return `ProjectId:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
docsInProject({ project_id: projectId }) {
|
|
|
|
return `DocsIn:{${projectId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
ranges({ doc_id: docId }) {
|
|
|
|
return `Ranges:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
unflushedTime({ doc_id: docId }) {
|
|
|
|
return `UnflushedTime:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
pathname({ doc_id: docId }) {
|
|
|
|
return `Pathname:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
projectHistoryId({ doc_id: docId }) {
|
|
|
|
return `ProjectHistoryId:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
projectState({ project_id: projectId }) {
|
|
|
|
return `ProjectState:{${projectId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2024-07-02 09:55:35 -04:00
|
|
|
projectBlock({ project_id: projectId }) {
|
|
|
|
return `ProjectBlock:{${projectId}}`
|
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
pendingUpdates({ doc_id: docId }) {
|
|
|
|
return `PendingUpdates:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
lastUpdatedBy({ doc_id: docId }) {
|
|
|
|
return `lastUpdatedBy:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
lastUpdatedAt({ doc_id: docId }) {
|
|
|
|
return `lastUpdatedAt:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2024-05-28 07:24:06 -04:00
|
|
|
resolvedCommentIds({ doc_id: docId }) {
|
|
|
|
return `ResolvedCommentIds:{${docId}}`
|
|
|
|
},
|
2020-05-06 06:13:11 -04:00
|
|
|
flushAndDeleteQueue() {
|
|
|
|
return 'DocUpdaterFlushAndDeleteQueue'
|
2021-07-13 07:04:42 -04:00
|
|
|
},
|
2024-02-09 09:09:40 -05:00
|
|
|
historyRangesSupport() {
|
|
|
|
return 'HistoryRangesSupport'
|
|
|
|
},
|
2021-07-13 07:04:42 -04:00
|
|
|
},
|
|
|
|
},
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
max_doc_length: 2 * 1024 * 1024, // 2mb
|
2020-05-08 11:53:02 -04:00
|
|
|
maxJsonRequestSize:
|
|
|
|
parseInt(process.env.MAX_JSON_REQUEST_SIZE, 10) || 8 * 1024 * 1024,
|
2020-05-06 06:13:11 -04:00
|
|
|
|
2021-02-09 05:32:16 -05:00
|
|
|
dispatcherCount: parseInt(process.env.DISPATCHER_COUNT || 10, 10),
|
2020-05-06 06:13:11 -04:00
|
|
|
|
2024-01-19 03:33:27 -05:00
|
|
|
redisLockTTLSeconds: 30,
|
|
|
|
|
2020-05-06 06:13:11 -04:00
|
|
|
mongo: {
|
|
|
|
url:
|
|
|
|
process.env.MONGO_CONNECTION_STRING ||
|
2021-07-13 07:04:42 -04:00
|
|
|
`mongodb://${process.env.MONGO_HOST || '127.0.0.1'}/sharelatex`,
|
2024-02-22 06:03:27 -05:00
|
|
|
options: {
|
|
|
|
monitorCommands: true,
|
|
|
|
},
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
sentry: {
|
2021-07-13 07:04:42 -04:00
|
|
|
dsn: process.env.SENTRY_DSN,
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
publishOnIndividualChannels:
|
2022-08-05 04:19:12 -04:00
|
|
|
process.env.PUBLISH_ON_INDIVIDUAL_CHANNELS === 'true',
|
2020-05-06 06:13:11 -04:00
|
|
|
|
2022-08-05 04:19:12 -04:00
|
|
|
continuousBackgroundFlush: process.env.CONTINUOUS_BACKGROUND_FLUSH === 'true',
|
2020-05-06 06:13:11 -04:00
|
|
|
|
|
|
|
smoothingOffset: process.env.SMOOTHING_OFFSET || 1000, // milliseconds
|
2024-02-05 05:45:28 -05:00
|
|
|
gracefulShutdownDelayInMs:
|
|
|
|
parseInt(process.env.GRACEFUL_SHUTDOWN_DELAY_SECONDS ?? '10', 10) * 1000,
|
2020-05-06 06:13:11 -04:00
|
|
|
}
|