Sfoglia il codice sorgente

Provide hosts as environment settings and add npm run start script

James Allen 8 anni fa
parent
commit
dd008e1c7d

+ 8 - 8
services/track-changes/config/settings.defaults.coffee

@@ -3,31 +3,31 @@ TMP_DIR = Path.resolve(Path.join(__dirname, "../../", "tmp"))
 
 
 module.exports =
 module.exports =
 	mongo:
 	mongo:
-		url: 'mongodb://127.0.0.1/sharelatex'
+		url: "mongodb://#{process.env["MONGO_HOST"] or "localhost"}/sharelatex"
 	internal:
 	internal:
 		trackchanges:
 		trackchanges:
 			port: 3015
 			port: 3015
-			host: "localhost"
+			host: process.env["LISTEN_ADDRESS"] or "localhost"
 	apis:
 	apis:
 		documentupdater:
 		documentupdater:
-			url: "http://localhost:3003"
+			url: "http://#{process.env["DOCUPDATER_HOST"] or "localhost"}:3003"
 		docstore:
 		docstore:
-			url: "http://localhost:3016"
+			url: "http://#{process.env["DOCSTORE_HOST"] or "localhost"}:3016"
 		web:
 		web:
-			url: "http://localhost:3000"
+			url: "http://#{process.env["WEB_HOST"] or "localhost"}:3000"
 			user: "sharelatex"
 			user: "sharelatex"
 			pass: "password"
 			pass: "password"
 	redis:
 	redis:
 		lock:
 		lock:
-			host: "localhost"
+			host: process.env["REDIS_HOST"] or "localhost"
 			port: 6379
 			port: 6379
 			pass: ""
 			pass: ""
 			key_schema:
 			key_schema:
 				historyLock: ({doc_id}) -> "HistoryLock:#{doc_id}"
 				historyLock: ({doc_id}) -> "HistoryLock:#{doc_id}"
 				historyIndexLock: ({project_id}) -> "HistoryIndexLock:#{project_id}"
 				historyIndexLock: ({project_id}) -> "HistoryIndexLock:#{project_id}"
 		history:
 		history:
-			port:"6379"
-			host:"localhost"
+			port: "6379"
+			host: process.env["REDIS_HOST"] or "localhost"
 			password:""
 			password:""
 			key_schema:
 			key_schema:
 				uncompressedHistoryOps: ({doc_id}) -> "UncompressedHistoryOps:#{doc_id}"
 				uncompressedHistoryOps: ({doc_id}) -> "UncompressedHistoryOps:#{doc_id}"

+ 4 - 0
services/track-changes/package.json

@@ -6,6 +6,10 @@
     "type": "git",
     "type": "git",
     "url": "https://github.com/sharelatex/track-changes-sharelatex.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": {
   "dependencies": {
     "JSONStream": "^1.0.4",
     "JSONStream": "^1.0.4",
     "async": "~0.2.10",
     "async": "~0.2.10",