make config look like chef config

This commit is contained in:
Henry Oswald 2019-02-01 19:40:20 +00:00
parent 3051d7db4b
commit 98de529e42
2 changed files with 46 additions and 51 deletions

View file

@ -20,69 +20,64 @@ module.exports =
url: "http://#{process.env["PROJECT_HISTORY_HOST"] or "localhost"}:3054" url: "http://#{process.env["PROJECT_HISTORY_HOST"] or "localhost"}:3054"
redis: redis:
documentupdater: realtime:
port: process.env["DOC_UPDATER_REDIS_PORT"] or process.env["REDIS_PORT"] or "6379" port: process.env["REAL_TIME_REDIS_PORT"] or process.env["REDIS_PORT"] or "6379"
host: process.env["DOC_UPDATER_REDIS_HOST"] or process.env["REDIS_HOST"] or "localhost" host: process.env["REAL_TIME_REDIS_HOST"] or process.env["REDIS_HOST"] or "localhost"
password: process.env["DOC_UPDATER_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or "" password: process.env["REAL_TIME_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or ""
key_schema: redisOptions:
blockingKey: ({doc_id}) -> "Blocking:#{doc_id}" keepAlive: 100
docLines: ({doc_id}) -> "doclines:#{doc_id}"
docOps: ({doc_id}) -> "DocOps:#{doc_id}"
docVersion: ({doc_id}) -> "DocVersion:#{doc_id}"
docHash: ({doc_id}) -> "DocHash:#{doc_id}"
projectKey: ({doc_id}) -> "ProjectId:#{doc_id}"
docsInProject: ({project_id}) -> "DocsIn:#{project_id}"
ranges: ({doc_id}) -> "Ranges:#{doc_id}"
pathname: ({doc_id}) -> "Pathname:#{doc_id}"
projectHistoryId: ({doc_id}) -> "ProjectHistoryId:#{doc_id}"
projectState: ({project_id}) -> "ProjectState:#{project_id}"
unflushedTime: ({doc_id}) -> "UnflushedTime:#{doc_id}"
pendingUpdates: ({doc_id}) -> "PendingUpdates:#{doc_id}"
# cluster: [{
# port: "7000"
# host: "localhost"
# }]
# key_schema:
# blockingKey: ({doc_id}) -> "Blocking:{#{doc_id}}"
# docLines: ({doc_id}) -> "doclines:{#{doc_id}}"
# docOps: ({doc_id}) -> "DocOps:{#{doc_id}}"
# docVersion: ({doc_id}) -> "DocVersion:{#{doc_id}}"
# docHash: ({doc_id}) -> "DocHash:{#{doc_id}}"
# projectKey: ({doc_id}) -> "ProjectId:{#{doc_id}}"
# docsInProject: ({project_id}) -> "DocsIn:{#{project_id}}"
# ranges: ({doc_id}) -> "Ranges:{#{doc_id}}"
# projectState: ({project_id}) -> "ProjectState:{#{project_id}}"
history: history:
port: process.env["HISTORY_REDIS_PORT"] or process.env["REDIS_PORT"] or "6379" port: process.env["HISTORY_REDIS_PORT"] or process.env["REDIS_PORT"] or "6379"
host: process.env["HISTORY_REDIS_HOST"] or process.env["REDIS_HOST"] or "localhost" host: process.env["HISTORY_REDIS_HOST"] or process.env["REDIS_HOST"] or "localhost"
password: process.env["HISTORY_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or "" password: process.env["HISTORY_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or ""
key_schema: key_schema:
uncompressedHistoryOps: ({doc_id}) -> "UncompressedHistoryOps:#{doc_id}" uncompressedHistoryOps: ({doc_id}) -> "UncompressedHistoryOps:{#{doc_id}}"
docsWithHistoryOps: ({project_id}) -> "DocsWithHistoryOps:#{project_id}" docsWithHistoryOps: ({project_id}) -> "DocsWithHistoryOps:{#{project_id}}"
redisOptions:
keepAlive: 100
project_history: project_history:
port: process.env["HISTORY_REDIS_PORT"] or process.env["REDIS_PORT"] or "6379"
host: process.env["HISTORY_REDIS_HOST"] or process.env["REDIS_HOST"] or "localhost"
password: process.env["HISTORY_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or ""
key_schema: key_schema:
projectHistoryOps: ({project_id}) -> "ProjectHistory:Ops:#{project_id}" projectHistoryOps: ({project_id}) -> "ProjectHistory:Ops:{#{project_id}}"
projectHistoryFirstOpTimestamp: ({project_id}) -> "ProjectHistory:FirstOpTimestamp:#{project_id}" projectHistoryFirstOpTimestamp: ({project_id}) -> "ProjectHistory:FirstOpTimestamp:{#{project_id}}"
# cluster: [{ redisOptions:
# port: "7000" keepAlive: 100
# host: "localhost"
# }]
# key_schema:
# uncompressedHistoryOps: ({doc_id}) -> "UncompressedHistoryOps:{#{doc_id}}"
# docsWithHistoryOps: ({project_id}) -> "DocsWithHistoryOps:{#{project_id}}"
lock: lock:
port: process.env["LOCK_REDIS_PORT"] or process.env["REDIS_PORT"] or "6379" port: process.env["LOCK_REDIS_PORT"] or process.env["REDIS_PORT"] or "6379"
host: process.env["LOCK_REDIS_HOST"] or process.env["REDIS_HOST"] or "localhost" host: process.env["LOCK_REDIS_HOST"] or process.env["REDIS_HOST"] or "localhost"
password: process.env["LOCK_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or "" password: process.env["LOCK_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or ""
key_schema: key_schema:
blockingKey: ({doc_id}) -> "Blocking:#{doc_id}" blockingKey: ({doc_id}) -> "Blocking:{#{doc_id}}"
# cluster: [{ redisOptions:
# port: "7000" keepAlive: 100
# host: "localhost"
# }] documentupdater:
# key_schema: port: process.env["DOC_UPDATER_REDIS_PORT"] or process.env["REDIS_PORT"] or "6379"
# blockingKey: ({doc_id}) -> "Blocking:{#{doc_id}}" host: process.env["DOC_UPDATER_REDIS_HOST"] or process.env["REDIS_HOST"] or "localhost"
password: process.env["DOC_UPDATER_REDIS_PASSWORD"] or process.env["REDIS_PASSWORD"] or ""
redisOptions:
keepAlive: 100
key_schema:
blockingKey: ({doc_id}) -> "Blocking:{#{doc_id}}"
docLines: ({doc_id}) -> "doclines:{#{doc_id}}"
docOps: ({doc_id}) -> "DocOps:{#{doc_id}}"
docVersion: ({doc_id}) -> "DocVersion:{#{doc_id}}"
docHash: ({doc_id}) -> "DocHash:{#{doc_id}}"
projectKey: ({doc_id}) -> "ProjectId:{#{doc_id}}"
docsInProject: ({project_id}) -> "DocsIn:{#{project_id}}"
ranges: ({doc_id}) -> "Ranges:{#{doc_id}}"
unflushedTime: ({doc_id}) -> "UnflushedTime:{#{doc_id}}"
pathname: ({doc_id}) -> "Pathname:{#{doc_id}}"
projectHistoryId: ({doc_id}) -> "ProjectHistoryId:{#{doc_id}}"
projectState: ({project_id}) -> "ProjectState:{#{project_id}}"
pendingUpdates: ({doc_id}) -> "PendingUpdates:{#{doc_id}}"
redisOptions:
keepAlive: 100
max_doc_length: 2 * 1024 * 1024 # 2mb max_doc_length: 2 * 1024 * 1024 # 2mb

View file

@ -26,7 +26,7 @@
"logger-sharelatex": "^1.6.0", "logger-sharelatex": "^1.6.0",
"lynx": "0.0.11", "lynx": "0.0.11",
"metrics-sharelatex": "^2.1.1", "metrics-sharelatex": "^2.1.1",
"redis-sharelatex": "^1.0.5", "redis-sharelatex": "https://registry.npmjs.org/redis-sharelatex/-/redis-sharelatex-1.0.5.tgz",
"request": "2.25.0", "request": "2.25.0",
"requestretry": "^1.12.0", "requestretry": "^1.12.0",
"sandboxed-module": "~0.2.0", "sandboxed-module": "~0.2.0",