Merge pull request #11346 from overleaf/msm-config-history-v1-sp

Configuration changes for FPH in CE/SP

GitOrigin-RevId: 990eb0fa6158d4815740413da085759d2cc5e231
This commit is contained in:
Miguel Serrano
2023-01-20 12:06:26 +01:00
committed by Copybot
parent 0b986d5625
commit 4a84922a2f
13 changed files with 83 additions and 108 deletions
+5 -1
View File
@@ -53,7 +53,11 @@ COPY server-ce/init_scripts/ /etc/my_init.d/
# Copy app settings files
# -----------------------
COPY server-ce/settings.js /etc/sharelatex/settings.js
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 grunt thin wrapper
# -----------------------
+28
View File
@@ -0,0 +1,28 @@
{
"persistor": {
"backend": "fs",
"useSubdirectories": true
},
"blobStore": {
"globalBucket": "/var/lib/sharelatex/history/overleaf-blobs",
"projectBucket": "/var/lib/sharelatex/history/overleaf-project-blobs"
},
"chunkStore": {
"bucket": "/var/lib/sharelatex/history/overleaf-chunks"
},
"zipStore": {
"bucket": "/var/lib/sharelatex/history/overleaf-zips"
},
"analytics": {
"bucket": "/var/lib/sharelatex/history/overleaf-analytics"
},
"basicHttpAuth": {
"password": "password"
},
"useDeleteObjects": "false",
"jwtAuth": {
"key": "secureKey",
"algorithm": "HS256"
},
"mongo": {}
}
@@ -151,6 +151,20 @@ const settings = {
api: redisConfig,
pubsub: redisConfig,
project_history: redisConfig,
project_history_migration: {
host: redisConfig.host,
port: redisConfig.port,
password: redisConfig.password,
maxRetriesPerRequest: parseInt(
process.env.REDIS_MAX_RETRIES_PER_REQUEST || '20'
),
key_schema: {
projectHistoryOps({ projectId }) {
return `ProjectHistory:Ops:{${projectId}}` // NOTE: the extra braces are intentional
},
},
},
},
// File storage
@@ -273,6 +287,17 @@ const settings = {
user: httpAuthUser,
pass: httpAuthPass,
},
project_history: {
sendProjectStructureOps: true,
initializeHistoryForNewProjects: true,
displayHistoryForNewProjects: true,
url: 'http://localhost:3054',
},
v1_history: {
url: 'http://localhost:3100/api',
user: 'staging',
pass: process.env.STAGING_PASSWORD,
}
},
references: {},
notifications: undefined,
@@ -5,15 +5,21 @@ set -e -o pipefail
# https://github.com/phusion/baseimage-docker#centrally-defining-your-own-environment-variables
WEB_API_PASSWORD_FILE=/etc/container_environment/WEB_API_PASSWORD
STAGING_PASSWORD_FILE=/etc/container_environment/STAGING_PASSWORD # HTTP auth for history-v1
V1_HISTORY_PASSWORD_FILE=/etc/container_environment/V1_HISTORY_PASSWORD
CRYPTO_RANDOM_FILE=/etc/container_environment/CRYPTO_RANDOM
if [ ! -f "$WEB_API_PASSWORD_FILE" ] || [ ! -f "$CRYPTO_RANDOM_FILE" ]; then
if [ ! -f "$WEB_API_PASSWORD_FILE" ] || [ ! -f "$STAGING_PASSWORD_FILE" ] || [ ! -f "$CRYPTO_RANDOM_FILE" ]; then
echo "generating random secrets"
SECRET=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev | tr -d '\n+/')
echo ${SECRET} > ${WEB_API_PASSWORD_FILE}
SECRET=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev | tr -d '\n+/')
echo ${SECRET} > ${STAGING_PASSWORD_FILE}
echo ${SECRET} > ${V1_HISTORY_PASSWORD_FILE}
SECRET=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev | tr -d '\n+/')
echo ${SECRET} > ${CRYPTO_RANDOM_FILE}
fi
+1 -1
View File
@@ -6,4 +6,4 @@ if [ "$DEBUG_NODE" == "true" ]; then
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
MONGO_CONNECTION_STRING=$SHARELATEX_MONGO_URL NODE_CONFIG_DIR=/overleaf/services/history-v1/config exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/history-v1/app.js >> /var/log/sharelatex/history-v1.log 2>&1