From 4e885da59752e5566b9732ac79ebbc538344db36 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Fri, 10 Feb 2023 15:57:34 +0000 Subject: [PATCH] Merge pull request #11782 from overleaf/jpa-server-ce-history-s3 [server-ce] s3 settings for history-v1 GitOrigin-RevId: 51d5c6b3a67339b126ccbaa61d78f3cd36377e79 --- server-ce/Dockerfile | 8 +++ .../config/custom-environment-variables.json | 50 +++++++++++++++++++ server-ce/config/production.json | 14 ------ server-ce/config/settings.js | 2 +- 4 files changed, 59 insertions(+), 15 deletions(-) create mode 100644 server-ce/config/custom-environment-variables.json diff --git a/server-ce/Dockerfile b/server-ce/Dockerfile index f7a00a4d6c..3ea289774c 100644 --- a/server-ce/Dockerfile +++ b/server-ce/Dockerfile @@ -64,6 +64,7 @@ COPY server-ce/config/settings.js /etc/sharelatex/settings.js # Copy history-v1 files # ----------------------- COPY server-ce/config/production.json /overleaf/services/history-v1/config/production.json +COPY server-ce/config/custom-environment-variables.json /overleaf/services/history-v1/config/custom-environment-variables.json # Copy grunt thin wrapper # ----------------------- @@ -89,6 +90,13 @@ ENV OPTIMISE_PDF "true" ENV SHARELATEX_FPH_INITIALIZE_NEW_PROJECTS "true" ENV SHARELATEX_FPH_DISPLAY_NEW_PROJECTS "true" +ENV SHARELATEX_HISTORY_BACKEND "fs" +ENV SHARELATEX_HISTORY_BLOBS_BUCKET "/var/lib/sharelatex/data/history/overleaf-blobs" +ENV SHARELATEX_HISTORY_PROJECT_BLOBS_BUCKET "/var/lib/sharelatex/data/history/overleaf-project-blobs" +ENV SHARELATEX_HISTORY_CHUNKS_BUCKET "/var/lib/sharelatex/data/history/overleaf-chunks" +ENV SHARELATEX_HISTORY_ZIPS_BUCKET "/var/lib/sharelatex/data/history/overleaf-zips" +ENV SHARELATEX_HISTORY_ANALYTICS_BUCKET "/var/lib/sharelatex/data/history/overleaf-analytics" + ENV NODE_ENV "production" ENV LOG_LEVEL "info" diff --git a/server-ce/config/custom-environment-variables.json b/server-ce/config/custom-environment-variables.json new file mode 100644 index 0000000000..6a8c97c924 --- /dev/null +++ b/server-ce/config/custom-environment-variables.json @@ -0,0 +1,50 @@ +{ + "databaseUrl": "HISTORY_CONNECTION_STRING", + "herokuDatabaseUrl": "DATABASE_URL", + "databasePoolMin": "DATABASE_POOL_MIN", + "databasePoolMax": "DATABASE_POOL_MAX", + "persistor": { + "backend": "SHARELATEX_HISTORY_BACKEND", + "s3": { + "key": "SHARELATEX_HISTORY_S3_ACCESS_KEY_ID", + "secret": "SHARELATEX_HISTORY_S3_SECRET_ACCESS_KEY", + "maxRetries": "SHARELATEX_HISTORY_S3_MAX_RETRIES", + "endpoint": "SHARELATEX_HISTORY_S3_ENDPOINT", + "pathStyle": "SHARELATEX_HISTORY_S3_PATH_STYLE", + "region": "SHARELATEX_HISTORY_S3_REGION", + "httpOptions": { + "timeout": "SHARELATEX_HISTORY_S3_TIMEOUT" + } + } + }, + "blobStore": { + "globalBucket": "SHARELATEX_HISTORY_BLOBS_BUCKET", + "projectBucket": "SHARELATEX_HISTORY_PROJECT_BLOBS_BUCKET" + }, + "chunkStore": { + "historyStoreConcurrency": "HISTORY_STORE_CONCURRENCY", + "bucket": "SHARELATEX_HISTORY_CHUNKS_BUCKET" + }, + "zipStore": { + "bucket": "SHARELATEX_HISTORY_ZIPS_BUCKET", + "zipTimeoutMs": "ZIP_STORE_ZIP_TIMEOUT_MS" + }, + "analytics": { + "bucket": "SHARELATEX_HISTORY_ANALYTICS_BUCKET" + }, + "mongo": { + "uri": "MONGO_CONNECTION_STRING" + }, + "basicHttpAuth": { + "password": "STAGING_PASSWORD", + "oldPassword": "BASIC_HTTP_AUTH_OLD_PASSWORD" + }, + "jwtAuth": { + "key": "OT_JWT_AUTH_KEY", + "oldKey": "OT_JWT_AUTH_OLD_KEY", + "algorithm": "OT_JWT_AUTH_ALG" + }, + "clusterWorkers": "CLUSTER_WORKERS", + "maxFileUploadSize": "MAX_FILE_UPLOAD_SIZE", + "httpsOnly": "HTTPS_ONLY" +} diff --git a/server-ce/config/production.json b/server-ce/config/production.json index d0d5d97ecf..b66a373d01 100644 --- a/server-ce/config/production.json +++ b/server-ce/config/production.json @@ -1,21 +1,7 @@ { "persistor": { - "backend": "fs", "useSubdirectories": true }, - "blobStore": { - "globalBucket": "/var/lib/sharelatex/data/history/overleaf-blobs", - "projectBucket": "/var/lib/sharelatex/data/history/overleaf-project-blobs" - }, - "chunkStore": { - "bucket": "/var/lib/sharelatex/data/history/overleaf-chunks" - }, - "zipStore": { - "bucket": "/var/lib/sharelatex/data/history/overleaf-zips" - }, - "analytics": { - "bucket": "/var/lib/sharelatex/data/history/overleaf-analytics" - }, "basicHttpAuth": { "password": "password" }, diff --git a/server-ce/config/settings.js b/server-ce/config/settings.js index 68f8ae64c0..6cd043322b 100644 --- a/server-ce/config/settings.js +++ b/server-ce/config/settings.js @@ -755,7 +755,7 @@ switch (process.env.SHARELATEX_FILESTORE_BACKEND) { process.env.AWS_ACCESS_KEY_ID, secret: process.env.SHARELATEX_FILESTORE_S3_SECRET_ACCESS_KEY || - process.env.AWS_ACCESS_KEY_ID, + process.env.AWS_SECRET_ACCESS_KEY, endpoint: process.env.SHARELATEX_FILESTORE_S3_ENDPOINT, pathStyle: process.env.SHARELATEX_FILESTORE_S3_PATH_STYLE === 'true', region: