2019-01-22 10:50:34 -05:00
|
|
|
settings =
|
2014-11-07 12:38:12 -05:00
|
|
|
redis:
|
2017-05-02 10:51:17 -04:00
|
|
|
realtime:
|
2018-12-05 09:42:16 -05:00
|
|
|
host: process.env['REAL_TIME_REDIS_HOST'] or process.env['REDIS_HOST'] or "localhost"
|
|
|
|
port: process.env['REAL_TIME_REDIS_PORT'] or process.env['REDIS_PORT'] or "6379"
|
|
|
|
password: process.env["REAL_TIME_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or ""
|
2017-05-02 10:51:17 -04:00
|
|
|
key_schema:
|
|
|
|
clientsInProject: ({project_id}) -> "clients_in_project:#{project_id}"
|
|
|
|
connectedUser: ({project_id, client_id})-> "connected_user:#{project_id}:#{client_id}"
|
2019-01-23 05:11:26 -05:00
|
|
|
cluster: process.env['REDIS_CLUSTER_HOSTS']
|
|
|
|
natMap: process.env['REDIS_CLUSTER_NATMAP']
|
2017-05-02 10:51:17 -04:00
|
|
|
|
|
|
|
documentupdater:
|
2018-12-05 09:42:16 -05:00
|
|
|
host: process.env['DOC_UPDATER_REDIS_HOST'] or process.env['REDIS_HOST'] or "localhost"
|
|
|
|
port: process.env['DOC_UPDATER_REDIS_PORT'] or process.env['REDIS_PORT'] or "6379"
|
|
|
|
password: process.env["DOC_UPDATER_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or ""
|
2017-05-02 10:51:17 -04:00
|
|
|
key_schema:
|
|
|
|
pendingUpdates: ({doc_id}) -> "PendingUpdates:#{doc_id}"
|
2019-01-23 05:11:26 -05:00
|
|
|
cluster: process.env['REDIS_CLUSTER_HOSTS']
|
|
|
|
natMap: process.env['REDIS_CLUSTER_NATMAP']
|
2017-05-10 10:52:35 -04:00
|
|
|
|
2019-01-22 11:44:39 -05:00
|
|
|
websessions:
|
|
|
|
host: process.env['WEB_REDIS_HOST'] or process.env['REDIS_HOST'] or "localhost"
|
|
|
|
port: process.env['WEB_REDIS_PORT'] or process.env['REDIS_PORT'] or "6379"
|
|
|
|
password: process.env["WEB_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or ""
|
2019-01-23 05:11:26 -05:00
|
|
|
cluster: process.env['REDIS_CLUSTER_HOSTS']
|
|
|
|
natMap: process.env['REDIS_CLUSTER_NATMAP']
|
2017-05-10 10:52:35 -04:00
|
|
|
|
2014-11-07 12:38:12 -05:00
|
|
|
internal:
|
|
|
|
realTime:
|
|
|
|
port: 3026
|
2017-12-29 03:15:32 -05:00
|
|
|
host: process.env['LISTEN_ADDRESS'] or "localhost"
|
2015-03-03 12:15:19 -05:00
|
|
|
user: "sharelatex"
|
|
|
|
pass: "password"
|
2014-11-07 12:38:12 -05:00
|
|
|
|
2014-11-10 06:27:08 -05:00
|
|
|
apis:
|
|
|
|
web:
|
2018-10-09 06:53:49 -04:00
|
|
|
url: "http://#{process.env['WEB_HOST'] or "localhost"}:#{process.env['WEB_PORT'] or 3000}"
|
2014-11-17 09:35:07 -05:00
|
|
|
user: "sharelatex"
|
|
|
|
pass: "password"
|
2014-11-12 10:54:55 -05:00
|
|
|
documentupdater:
|
2018-10-19 14:42:33 -04:00
|
|
|
url: "http://#{process.env['DOCUMENT_UPDATER_HOST'] or process.env['DOCUPDATER_HOST'] or "localhost"}:3003"
|
2014-11-10 06:27:08 -05:00
|
|
|
|
2014-11-07 12:38:12 -05:00
|
|
|
security:
|
2018-12-03 09:05:03 -05:00
|
|
|
sessionSecret: process.env['SESSION_SECRET'] or "secret-please-change"
|
2014-11-07 12:38:12 -05:00
|
|
|
|
2018-12-03 09:05:03 -05:00
|
|
|
cookieName: process.env['COOKIE_NAME'] or "sharelatex.sid"
|
2015-12-01 06:05:49 -05:00
|
|
|
|
2018-12-04 09:06:39 -05:00
|
|
|
max_doc_length: 2 * 1024 * 1024 # 2mb
|
|
|
|
|
2019-01-22 10:50:34 -05:00
|
|
|
forceDrainMsDelay: process.env['FORCE_DRAIN_MS_DELAY'] or false
|
|
|
|
|
2019-01-23 05:11:26 -05:00
|
|
|
console.log process.env['REDIS_CLUSTER_HOSTS'], process.env['REDIS_CLUSTER_NATMAP']
|
2019-01-23 05:15:00 -05:00
|
|
|
console.log typeof(process.env['REDIS_CLUSTER_HOSTS'])
|
2019-01-23 05:11:26 -05:00
|
|
|
if process.env['REDIS_CLUSTER_HOSTS']? or process.env['REDIS_CLUSTER_NATMAP']?
|
2019-01-22 11:49:22 -05:00
|
|
|
|
2019-01-23 05:11:26 -05:00
|
|
|
for redisKey in Object.keys(settings.redis)
|
|
|
|
|
|
|
|
if process.env['REDIS_CLUSTER_HOSTS']?
|
|
|
|
settings.redis[redisKey].cluster = JSON.parse(process.env['REDIS_CLUSTER_HOSTS'])
|
|
|
|
|
|
|
|
|
|
|
|
if process.env['REDIS_CLUSTER_NATMAP']?
|
|
|
|
settings.redis[redisKey].natMap = JSON.parse(process.env['REDIS_CLUSTER_NATMAP'])
|
|
|
|
console.log settings
|
2019-01-22 10:50:34 -05:00
|
|
|
module.exports = settings
|