diff --git a/docker-compose.debug.yml b/docker-compose.debug.yml index bdcaa6fff6..a87847d4ed 100644 --- a/docker-compose.debug.yml +++ b/docker-compose.debug.yml @@ -12,6 +12,8 @@ services: - 30360:30360 - 30130:30130 - 30100:30100 + - 30540:30540 + - 30640:30640 # Server Pro - 30070:30070 diff --git a/server-ce/runit/history-v1-sharelatex/run b/server-ce/runit/history-v1-sharelatex/run new file mode 100755 index 0000000000..d818808def --- /dev/null +++ b/server-ce/runit/history-v1-sharelatex/run @@ -0,0 +1,9 @@ +#!/bin/bash + +NODE_PARAMS="" +if [ "$DEBUG_NODE" == "true" ]; then + echo "running debug - history-v1" + NODE_PARAMS="--inspect=0.0.0.0:30640" +fi + +MONGO_CONNECTION_STRING=$SHARELATEX_MONGO_URL NODE_CONFIG_DIR=/overleaf/services/history-v1/config NODE_CONFIG_ENV=overleaf-ce exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/history-v1/app.js >> /var/log/sharelatex/history-v1.log 2>&1 diff --git a/server-ce/runit/project-history-sharelatex/run b/server-ce/runit/project-history-sharelatex/run new file mode 100755 index 0000000000..00f05af6c6 --- /dev/null +++ b/server-ce/runit/project-history-sharelatex/run @@ -0,0 +1,9 @@ +#!/bin/bash + +NODE_PARAMS="" +if [ "$DEBUG_NODE" == "true" ]; then + echo "running debug - project-history" + NODE_PARAMS="--inspect=0.0.0.0:30540" +fi + +exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/project-history/app.js >> /var/log/sharelatex/project-history.log 2>&1 diff --git a/server-ce/services.js b/server-ce/services.js index c47186a159..9426d67adc 100644 --- a/server-ce/services.js +++ b/server-ce/services.js @@ -1,58 +1,42 @@ module.exports = [ { - name: 'web', - repo: 'https://github.com/sharelatex/web-sharelatex.git', - version: 'master', + name: 'web' }, { - name: 'real-time', - repo: 'https://github.com/sharelatex/real-time-sharelatex.git', - version: 'master', + name: 'real-time' }, { - name: 'document-updater', - repo: 'https://github.com/sharelatex/document-updater-sharelatex.git', - version: 'master', + name: 'document-updater' }, { - name: 'clsi', - repo: 'https://github.com/sharelatex/clsi-sharelatex.git', - version: 'master', + name: 'clsi' }, { - name: 'filestore', - repo: 'https://github.com/sharelatex/filestore-sharelatex.git', - version: 'master', + name: 'filestore' }, { - name: 'track-changes', - repo: 'https://github.com/sharelatex/track-changes-sharelatex.git', - version: 'master', + name: 'track-changes' }, { - name: 'docstore', - repo: 'https://github.com/sharelatex/docstore-sharelatex.git', - version: 'master', + name: 'docstore' }, { - name: 'chat', - repo: 'https://github.com/sharelatex/chat-sharelatex.git', - version: 'master', + name: 'chat' }, { - name: 'spelling', - repo: 'https://github.com/sharelatex/spelling-sharelatex.git', - version: 'master', + name: 'spelling' }, { - name: 'contacts', - repo: 'https://github.com/sharelatex/contacts-sharelatex.git', - version: 'master', + name: 'contacts' }, { - name: 'notifications', - repo: 'https://github.com/sharelatex/notifications-sharelatex.git', - version: 'master', + name: 'notifications' + }, + { + name: 'project-history' + }, + { + name: 'history-v1' }, ] diff --git a/server-ce/settings.js b/server-ce/settings.js index b6140f02d8..e33b2be07b 100644 --- a/server-ce/settings.js +++ b/server-ce/settings.js @@ -273,9 +273,6 @@ const settings = { user: httpAuthUser, pass: httpAuthPass, }, - project_history: { - enabled: false, - }, }, references: {}, notifications: undefined, diff --git a/services/history-v1/app.js b/services/history-v1/app.js index 1d7f9b08cd..f8be20328e 100644 --- a/services/history-v1/app.js +++ b/services/history-v1/app.js @@ -20,6 +20,7 @@ const swaggerDoc = require('./api/swagger') const security = require('./api/app/security') const healthChecks = require('./api/controllers/health_checks') const { mongodb, loadGlobalBlobs } = require('./storage') +const path = require('path') const app = express() module.exports = app @@ -64,7 +65,7 @@ function setupSwagger() { app.use(middleware.swaggerValidator()) app.use( middleware.swaggerRouter({ - controllers: './api/controllers', + controllers: path.join(__dirname, 'api/controllers'), useStubs: app.get('env') === 'development', }) ) diff --git a/services/history-v1/config/overleaf-ce.json b/services/history-v1/config/overleaf-ce.json new file mode 100644 index 0000000000..21f17031c3 --- /dev/null +++ b/services/history-v1/config/overleaf-ce.json @@ -0,0 +1,30 @@ +{ + "persistor": { + "s3": { + "endpoint": "http://s3:8080", + "pathStyle": "true" + } + }, + "blobStore": { + "globalBucket": "overleaf-blobs", + "projectBucket": "overleaf-project-blobs" + }, + "chunkStore": { + "bucket": "overleaf-chunks" + }, + "zipStore": { + "bucket": "overleaf-zips" + }, + "analytics": { + "bucket": "overleaf-analytics" + }, + "useDeleteObjects": "false", + "basicHttpAuth": { + "password": "password" + }, + "jwtAuth": { + "key": "secureKey", + "algorithm": "HS256" + }, + "mongo": {} +}