2020-02-17 12:36:02 -05:00
|
|
|
const Path = require('path')
|
|
|
|
const TMP_DIR =
|
|
|
|
process.env.TMP_PATH || Path.resolve(Path.join(__dirname, '../../', 'tmp'))
|
2015-08-06 14:46:44 -04:00
|
|
|
|
2020-02-17 12:36:01 -05:00
|
|
|
module.exports = {
|
2020-02-17 12:36:02 -05:00
|
|
|
mongo: {
|
2020-09-10 07:58:06 -04:00
|
|
|
options: {
|
|
|
|
useUnifiedTopology:
|
2021-07-13 07:04:43 -04:00
|
|
|
(process.env.MONGO_USE_UNIFIED_TOPOLOGY || 'true') === 'true',
|
2020-09-10 07:58:06 -04:00
|
|
|
},
|
2020-02-17 12:36:02 -05:00
|
|
|
url:
|
|
|
|
process.env.MONGO_CONNECTION_STRING ||
|
2021-07-13 07:04:43 -04:00
|
|
|
`mongodb://${process.env.MONGO_HOST || 'localhost'}/sharelatex`,
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
2018-10-04 05:34:44 -04:00
|
|
|
|
2020-02-17 12:36:02 -05:00
|
|
|
internal: {
|
|
|
|
trackchanges: {
|
|
|
|
port: 3015,
|
2021-07-13 07:04:43 -04:00
|
|
|
host: process.env.LISTEN_ADDRESS || 'localhost',
|
|
|
|
},
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
|
|
|
apis: {
|
|
|
|
documentupdater: {
|
2020-06-04 04:24:21 -04:00
|
|
|
url: `http://${
|
|
|
|
process.env.DOCUMENT_UPDATER_HOST ||
|
2020-02-17 12:36:02 -05:00
|
|
|
process.env.DOCUPDATER_HOST ||
|
2020-06-04 04:24:21 -04:00
|
|
|
'localhost'
|
2021-07-13 07:04:43 -04:00
|
|
|
}:3003`,
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
|
|
|
docstore: {
|
2021-07-13 07:04:43 -04:00
|
|
|
url: `http://${process.env.DOCSTORE_HOST || 'localhost'}:3016`,
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
|
|
|
web: {
|
2020-06-04 04:24:21 -04:00
|
|
|
url: `http://${
|
|
|
|
process.env.WEB_API_HOST || process.env.WEB_HOST || 'localhost'
|
|
|
|
}:${process.env.WEB_API_PORT || process.env.WEB_PORT || 3000}`,
|
2020-02-17 12:36:02 -05:00
|
|
|
user: process.env.WEB_API_USER || 'sharelatex',
|
2021-07-13 07:04:43 -04:00
|
|
|
pass: process.env.WEB_API_PASSWORD || 'password',
|
|
|
|
},
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
|
|
|
redis: {
|
|
|
|
lock: {
|
|
|
|
host: process.env.REDIS_HOST || 'localhost',
|
|
|
|
port: process.env.REDIS_PORT || 6379,
|
|
|
|
password: process.env.REDIS_PASSWORD || '',
|
|
|
|
key_schema: {
|
2020-06-04 04:37:43 -04:00
|
|
|
historyLock({ doc_id: docId }) {
|
|
|
|
return `HistoryLock:{${docId}}`
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
2020-06-04 04:37:43 -04:00
|
|
|
historyIndexLock({ project_id: projectId }) {
|
|
|
|
return `HistoryIndexLock:{${projectId}}`
|
2021-07-13 07:04:43 -04:00
|
|
|
},
|
|
|
|
},
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
|
|
|
history: {
|
|
|
|
host: process.env.REDIS_HOST || 'localhost',
|
|
|
|
port: process.env.REDIS_PORT || 6379,
|
|
|
|
password: process.env.REDIS_PASSWORD || '',
|
|
|
|
key_schema: {
|
2020-06-04 04:37:43 -04:00
|
|
|
uncompressedHistoryOps({ doc_id: docId }) {
|
|
|
|
return `UncompressedHistoryOps:{${docId}}`
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
2020-06-04 04:37:43 -04:00
|
|
|
docsWithHistoryOps({ project_id: projectId }) {
|
|
|
|
return `DocsWithHistoryOps:{${projectId}}`
|
2021-07-13 07:04:43 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
2015-08-06 09:00:09 -04:00
|
|
|
|
2020-02-17 12:36:02 -05:00
|
|
|
trackchanges: {
|
|
|
|
s3: {
|
|
|
|
key: process.env.AWS_ACCESS_KEY_ID,
|
|
|
|
secret: process.env.AWS_SECRET_ACCESS_KEY,
|
|
|
|
endpoint: process.env.AWS_S3_ENDPOINT,
|
2021-07-13 07:04:43 -04:00
|
|
|
pathStyle: process.env.AWS_S3_PATH_STYLE === 'true',
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
|
|
|
stores: {
|
2021-07-13 07:04:43 -04:00
|
|
|
doc_history: process.env.AWS_BUCKET,
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
2021-07-13 07:04:43 -04:00
|
|
|
continueOnError: process.env.TRACK_CHANGES_CONTINUE_ON_ERROR || false,
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
2019-03-05 12:10:18 -05:00
|
|
|
|
2020-02-17 12:36:02 -05:00
|
|
|
path: {
|
2021-07-13 07:04:43 -04:00
|
|
|
dumpFolder: Path.join(TMP_DIR, 'dumpFolder'),
|
2020-02-17 12:36:02 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
sentry: {
|
2021-07-13 07:04:43 -04:00
|
|
|
dsn: process.env.SENTRY_DSN,
|
|
|
|
},
|
2020-02-17 12:36:02 -05:00
|
|
|
}
|