diff --git a/develop/dev.env b/develop/dev.env index 689f278aaf..28716b71fb 100644 --- a/develop/dev.env +++ b/develop/dev.env @@ -5,9 +5,11 @@ DOCSTORE_HOST=docstore DOCUMENT_UPDATER_HOST=document-updater FILESTORE_HOST=filestore GRACEFUL_SHUTDOWN_DELAY=0 +HISTORY_V1_HOST=history-v1 LISTEN_ADDRESS=0.0.0.0 MONGO_HOST=mongo NOTIFICATIONS_HOST=notifications +PROJECT_HISTORY_HOST=project-history REALTIME_HOST=real-time REDIS_HOST=redis SPELLING_HOST=spelling diff --git a/develop/docker-compose.dev.yml b/develop/docker-compose.dev.yml index f38391a660..4cc3f36fe4 100644 --- a/develop/docker-compose.dev.yml +++ b/develop/docker-compose.dev.yml @@ -65,6 +65,20 @@ services: - ../services/filestore/app.js:/overleaf/services/filestore/app.js - ../services/filestore/config:/overleaf/services/filestore/config + history-v1: + command: [ "npm", "run", "nodemon" ] + environment: + - NODE_APP_OPTIONS=--inspect=0.0.0.0:9229 + ports: + - "127.0.0.1:9239:9229" + volumes: + - ../services/history-v1/api:/overleaf/services/history-v1/api + - ../services/history-v1/app.js:/overleaf/services/history-v1/app.js + - ../services/history-v1/config:/overleaf/services/history-v1/config + - ../services/history-v1/storage:/overleaf/services/history-v1/storage + - ../services/history-v1/knexfile.js:/overleaf/services/history-v1/knexfile.js + - ../services/history-v1/migrations:/overleaf/services/history-v1/migrations + notifications: command: ["npm", "run", "nodemon"] environment: @@ -76,6 +90,17 @@ services: - ../services/notifications/app.js:/overleaf/services/notifications/app.js - ../services/notifications/config:/overleaf/services/notifications/config + project-history: + command: [ "npm", "run", "nodemon" ] + environment: + - NODE_APP_OPTIONS=--inspect=0.0.0.0:9229 + ports: + - "127.0.0.1:9240:9229" + volumes: + - ../services/project-history/app:/overleaf/services/project-history/app + - ../services/project-history/app.js:/overleaf/services/project-history/app.js + - ../services/project-history/config:/overleaf/services/project-history/config + real-time: command: ["npm", "run", "nodemon"] environment: diff --git a/develop/docker-compose.yml b/develop/docker-compose.yml index f3d3864bc8..b2f6caaf8b 100644 --- a/develop/docker-compose.yml +++ b/develop/docker-compose.yml @@ -10,6 +10,7 @@ volumes: sharelatex-data: spelling-cache: web-data: + history-v1-buckets: services: chat: @@ -71,6 +72,22 @@ services: - filestore-uploads:/overleaf/services/filestore/uploads - filestore-user-files:/overleaf/services/filestore/user_files + history-v1: + build: + context: .. + dockerfile: services/history-v1/Dockerfile + env_file: + - dev.env + environment: + OVERLEAF_EDITOR_ANALYTICS_BUCKET: "/buckets/analytics" + OVERLEAF_EDITOR_BLOBS_BUCKET: "/buckets/blobs" + OVERLEAF_EDITOR_CHUNKS_BUCKET: "/buckets/chunks" + OVERLEAF_EDITOR_PROJECT_BLOBS_BUCKET: "/buckets/project_blobs" + OVERLEAF_EDITOR_ZIPS_BUCKET: "/buckets/zips" + PERSISTOR_BACKEND: fs + volumes: + - history-v1-buckets:/buckets + mongo: image: mongo:4.4 ports: @@ -85,6 +102,13 @@ services: env_file: - dev.env + project-history: + build: + context: .. + dockerfile: services/project-history/Dockerfile + env_file: + - dev.env + real-time: build: context: .. @@ -141,7 +165,9 @@ services: - docstore - document-updater - filestore + - history-v1 - notifications + - project-history - real-time - spelling diff --git a/services/history-v1/Dockerfile b/services/history-v1/Dockerfile index bd5bcaf3bc..6a89ff890a 100644 --- a/services/history-v1/Dockerfile +++ b/services/history-v1/Dockerfile @@ -10,6 +10,9 @@ WORKDIR /overleaf/services/history-v1 # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config +# fs persistor needs a writable folder as a target for the mounted volume +RUN mkdir /buckets && chown node:node /buckets + FROM base as app COPY package.json package-lock.json /overleaf/ diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index 52c5482554..44849806bc 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -204,6 +204,12 @@ module.exports = { backendGroupName: undefined, defaultBackendClass: process.env.CLSI_DEFAULT_BACKEND_CLASS || 'e2', }, + project_history: { + sendProjectStructureOps: true, + initializeHistoryForNewProjects: true, + displayHistoryForNewProjects: true, + url: `http://${process.env.PROJECT_HISTORY_HOST || 'localhost'}:3054`, + }, realTime: { url: `http://${process.env.REALTIME_HOST || 'localhost'}:3026`, },