2020-05-06 06:13:10 -04:00
|
|
|
module.exports = {
|
2020-05-06 06:13:11 -04:00
|
|
|
internal: {
|
|
|
|
documentupdater: {
|
|
|
|
host: process.env.LISTEN_ADDRESS || 'localhost',
|
|
|
|
port: 3003
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
apis: {
|
|
|
|
web: {
|
|
|
|
url: `http://${
|
|
|
|
process.env.WEB_API_HOST || process.env.WEB_HOST || 'localhost'
|
|
|
|
}:${process.env.WEB_API_PORT || process.env.WEB_PORT || 3000}`,
|
|
|
|
user: process.env.WEB_API_USER || 'sharelatex',
|
|
|
|
pass: process.env.WEB_API_PASSWORD || 'password'
|
|
|
|
},
|
|
|
|
trackchanges: {
|
|
|
|
url: `http://${process.env.TRACK_CHANGES_HOST || 'localhost'}:3015`
|
|
|
|
},
|
|
|
|
project_history: {
|
|
|
|
enabled: true,
|
|
|
|
url: `http://${process.env.PROJECT_HISTORY_HOST || 'localhost'}:3054`
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
redis: {
|
|
|
|
pubsub: {
|
|
|
|
host:
|
2020-04-28 05:39:45 -04:00
|
|
|
process.env.PUBSUB_REDIS_HOST || process.env.REDIS_HOST || 'localhost',
|
|
|
|
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'
|
|
|
|
)
|
|
|
|
},
|
|
|
|
|
|
|
|
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:
|
2020-04-28 05:39:45 -04:00
|
|
|
process.env.HISTORY_REDIS_HOST || process.env.REDIS_HOST || 'localhost',
|
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'
|
|
|
|
),
|
|
|
|
key_schema: {
|
2020-04-28 05:36:57 -04:00
|
|
|
uncompressedHistoryOps({ doc_id: docId }) {
|
|
|
|
return `UncompressedHistoryOps:{${docId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
},
|
2020-04-28 05:36:57 -04:00
|
|
|
docsWithHistoryOps({ project_id: projectId }) {
|
|
|
|
return `DocsWithHistoryOps:{${projectId}}`
|
2020-05-06 06:13:11 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
project_history: {
|
|
|
|
port:
|
2020-04-28 05:39:45 -04:00
|
|
|
process.env.NEW_HISTORY_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
2020-05-06 06:13:11 -04:00
|
|
|
host:
|
|
|
|
process.env.NEW_HISTORY_REDIS_HOST ||
|
|
|
|
process.env.REDIS_HOST ||
|
|
|
|
'localhost',
|
|
|
|
password:
|
|
|
|
process.env.NEW_HISTORY_REDIS_PASSWORD ||
|
|
|
|
process.env.REDIS_PASSWORD ||
|
|
|
|
'',
|
|
|
|
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}}`
|
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:
|
2020-04-28 05:39:45 -04:00
|
|
|
process.env.LOCK_REDIS_HOST || process.env.REDIS_HOST || 'localhost',
|
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}}`
|
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 ||
|
|
|
|
'localhost',
|
|
|
|
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
|
|
|
projectHistoryType({ doc_id: docId }) {
|
|
|
|
return `ProjectHistoryType:{${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
|
|
|
},
|
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
|
|
|
},
|
|
|
|
flushAndDeleteQueue() {
|
|
|
|
return 'DocUpdaterFlushAndDeleteQueue'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
mongo: {
|
2020-09-10 05:40:05 -04:00
|
|
|
options: {
|
|
|
|
useUnifiedTopology:
|
|
|
|
(process.env.MONGO_USE_UNIFIED_TOPOLOGY || 'true') === 'true'
|
|
|
|
},
|
2020-05-06 06:13:11 -04:00
|
|
|
url:
|
|
|
|
process.env.MONGO_CONNECTION_STRING ||
|
|
|
|
`mongodb://${process.env.MONGO_HOST || '127.0.0.1'}/sharelatex`
|
|
|
|
},
|
|
|
|
|
|
|
|
sentry: {
|
|
|
|
dsn: process.env.SENTRY_DSN
|
|
|
|
},
|
|
|
|
|
|
|
|
publishOnIndividualChannels:
|
|
|
|
process.env.PUBLISH_ON_INDIVIDUAL_CHANNELS || false,
|
|
|
|
|
2020-04-28 05:39:45 -04:00
|
|
|
continuousBackgroundFlush: process.env.CONTINUOUS_BACKGROUND_FLUSH || false,
|
2020-05-06 06:13:11 -04:00
|
|
|
|
|
|
|
smoothingOffset: process.env.SMOOTHING_OFFSET || 1000, // milliseconds
|
|
|
|
|
|
|
|
disableDoubleFlush: process.env.DISABLE_DOUBLE_FLUSH || false // don't flush track-changes for projects using project-history
|
|
|
|
}
|