From a4cc02dbc38a571d9036aaab2a62d058b5afb5a0 Mon Sep 17 00:00:00 2001 From: James Allen Date: Fri, 29 Dec 2017 08:12:31 +0000 Subject: [PATCH 1/2] Provide hosts as environment settings and add npm run start script --- services/docstore/app/coffee/RangeManager.coffee | 2 +- services/docstore/config/settings.defaults.coffee | 4 ++-- services/docstore/package.json | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/services/docstore/app/coffee/RangeManager.coffee b/services/docstore/app/coffee/RangeManager.coffee index 61b0a62246..4867ffbe19 100644 --- a/services/docstore/app/coffee/RangeManager.coffee +++ b/services/docstore/app/coffee/RangeManager.coffee @@ -36,5 +36,5 @@ module.exports = RangeManager = _safeObjectId: (data) -> try return ObjectId(data) - catch + catch error return data \ No newline at end of file diff --git a/services/docstore/config/settings.defaults.coffee b/services/docstore/config/settings.defaults.coffee index e74334d2ad..42356c41db 100644 --- a/services/docstore/config/settings.defaults.coffee +++ b/services/docstore/config/settings.defaults.coffee @@ -5,10 +5,10 @@ module.exports = Settings = internal: docstore: port: 3016 - host: "localhost" + host: process.env['LISTEN_ADDRESS'] or "localhost" mongo: - url: 'mongodb://127.0.0.1/sharelatex' + url: "mongodb://#{process.env['MONGO_HOST'] or '127.0.0.1'}/sharelatex" docstore: healthCheck: diff --git a/services/docstore/package.json b/services/docstore/package.json index 40a866c3cb..0850ea8368 100644 --- a/services/docstore/package.json +++ b/services/docstore/package.json @@ -7,6 +7,10 @@ "type": "git", "url": "https://github.com/sharelatex/docstore-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": { "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0", "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.4.0", From f06bd265729bbfc8e1a9463d04facdefff418381 Mon Sep 17 00:00:00 2001 From: James Allen Date: Fri, 29 Dec 2017 10:35:40 +0000 Subject: [PATCH 2/2] Add coffee script dependency --- services/docstore/package.json | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/services/docstore/package.json b/services/docstore/package.json index 0850ea8368..cdaab61a34 100644 --- a/services/docstore/package.json +++ b/services/docstore/package.json @@ -12,29 +12,31 @@ "start": "npm run compile:app && node app.js" }, "dependencies": { - "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0", + "async": "~0.8.0", + "body-parser": "~1.0.2", + "coffee-script": "^1.7.1", + "express": "~4.1.1", "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.4.0", "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1", "mongojs": "2.4.0", - "express": "~4.1.1", - "underscore": "~1.6.0", - "body-parser": "~1.0.2", - "async": "~0.8.0" + "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0", + "underscore": "~1.6.0" }, "devDependencies": { - "grunt-execute": "~0.2.1", - "grunt-contrib-clean": "~0.5.0", - "grunt-shell": "~0.7.0", - "grunt-contrib-coffee": "~0.10.1", - "grunt-mocha-test": "~0.10.2", - "grunt": "~0.4.4", "bunyan": "~0.22.3", - "grunt-bunyan": "~0.5.0", - "sinon": "~3.2.1", - "sandboxed-module": "~0.3.0", "chai": "~1.9.1", + "grunt": "~0.4.4", + "grunt-bunyan": "~0.5.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-clean": "~0.5.0", + "grunt-contrib-coffee": "~0.10.1", + "grunt-execute": "~0.2.1", "grunt-forever": "~0.4.4", - "request": "~2.34.0" + "grunt-mocha-test": "~0.10.2", + "grunt-shell": "~0.7.0", + "request": "~2.34.0", + "sandboxed-module": "~0.3.0", + "sinon": "~3.2.1" }, "engines": { "node": "~4.2.1"