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: