From dd008e1c7dd7679448e9e40016d840859507b39b Mon Sep 17 00:00:00 2001 From: James Allen Date: Fri, 29 Dec 2017 08:18:04 +0000 Subject: [PATCH] Provide hosts as environment settings and add npm run start script --- .../config/settings.defaults.coffee | 16 ++++++++-------- services/track-changes/package.json | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/services/track-changes/config/settings.defaults.coffee b/services/track-changes/config/settings.defaults.coffee index 907d3c0033..6cc3b51c35 100755 --- a/services/track-changes/config/settings.defaults.coffee +++ b/services/track-changes/config/settings.defaults.coffee @@ -3,31 +3,31 @@ TMP_DIR = Path.resolve(Path.join(__dirname, "../../", "tmp")) module.exports = mongo: - url: 'mongodb://127.0.0.1/sharelatex' + url: "mongodb://#{process.env["MONGO_HOST"] or "localhost"}/sharelatex" internal: trackchanges: port: 3015 - host: "localhost" + host: process.env["LISTEN_ADDRESS"] or "localhost" apis: documentupdater: - url: "http://localhost:3003" + url: "http://#{process.env["DOCUPDATER_HOST"] or "localhost"}:3003" docstore: - url: "http://localhost:3016" + url: "http://#{process.env["DOCSTORE_HOST"] or "localhost"}:3016" web: - url: "http://localhost:3000" + url: "http://#{process.env["WEB_HOST"] or "localhost"}:3000" user: "sharelatex" pass: "password" redis: lock: - host: "localhost" + host: process.env["REDIS_HOST"] or "localhost" port: 6379 pass: "" key_schema: historyLock: ({doc_id}) -> "HistoryLock:#{doc_id}" historyIndexLock: ({project_id}) -> "HistoryIndexLock:#{project_id}" history: - port:"6379" - host:"localhost" + port: "6379" + host: process.env["REDIS_HOST"] or "localhost" password:"" key_schema: uncompressedHistoryOps: ({doc_id}) -> "UncompressedHistoryOps:#{doc_id}" diff --git a/services/track-changes/package.json b/services/track-changes/package.json index 81363c30f8..ee3ceddd13 100644 --- a/services/track-changes/package.json +++ b/services/track-changes/package.json @@ -6,6 +6,10 @@ "type": "git", "url": "https://github.com/sharelatex/track-changes-sharelatex.git" }, + "scripts": { + "compile:app": "coffee -o app/js -c app/coffee && coffee -c app.coffee", + "start": "npm run compile:app && node app.js" + }, "dependencies": { "JSONStream": "^1.0.4", "async": "~0.2.10",