Эх сурвалжийг харах

Merge pull request #11300 from overleaf/msm-ce-fph

Setup Full Project History services for CE/SP

GitOrigin-RevId: 96e3a5996d1fdc1d396862b6ab430d315dca3320
Miguel Serrano 3 жил өмнө
parent
commit
e5858f53ed

+ 2 - 0
docker-compose.debug.yml

@@ -12,6 +12,8 @@ services:
             - 30360:30360
             - 30130:30130
             - 30100:30100
+            - 30540:30540
+            - 30640:30640
 
             # Server Pro
             - 30070:30070

+ 9 - 0
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

+ 9 - 0
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

+ 17 - 33
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'
   },
 ]
 

+ 0 - 3
server-ce/settings.js

@@ -273,9 +273,6 @@ const settings = {
       user: httpAuthUser,
       pass: httpAuthPass,
     },
-    project_history: {
-      enabled: false,
-    },
   },
   references: {},
   notifications: undefined,

+ 2 - 1
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',
         })
       )

+ 30 - 0
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": {}
+}