From 2c402d8bc03fda06477344f3362e880952c76372 Mon Sep 17 00:00:00 2001 From: mserranom Date: Tue, 18 Jun 2024 10:39:01 +0200 Subject: [PATCH 1/2] Added REDIS_AOF_PERSISTENCE option to config/overleaf.rc --- CHANGELOG.md | 6 ++++++ bin/docker-compose | 11 +++++++++++ bin/doctor | 3 +++ lib/config-seed/overleaf.rc | 1 + lib/docker-compose.redis.yml | 1 + 5 files changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 097af63..1cd68b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2024-07-27 +### Added +- Added "--appendonly yes" configuration to redis. + + redis persistence documentation: https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/ + ## 2024-07-16 ### Added - Added support for Mongo 6.0. diff --git a/bin/docker-compose b/bin/docker-compose index 629802d..2d256cd 100755 --- a/bin/docker-compose +++ b/bin/docker-compose @@ -109,6 +109,17 @@ function set_redis_vars() { DOCKER_COMPOSE_FLAGS+=(-f "$TOOLKIT_ROOT/lib/docker-compose.redis.yml") export REDIS_IMAGE export REDIS_DATA_PATH + + if [[ -z "${REDIS_AOF_PERSISTENCE:-}" ]]; then + echo "WARNING: the value of REDIS_AOF_PERSISTENCE is not set in config/overleaf.rc" + echo "See https://github.com/overleaf/overleaf/wiki/Release-Notes-5.x.x#server-pro-510" + REDIS_COMMAND="redis-server" + elif [[ $REDIS_AOF_PERSISTENCE == "true" ]]; then + REDIS_COMMAND="redis-server --appendonly yes" + else + REDIS_COMMAND="redis-server" + fi + export REDIS_COMMAND } # Set environment variables for docker-compose.mongo.yml diff --git a/bin/doctor b/bin/doctor index 7b602ed..6d7e90a 100755 --- a/bin/doctor +++ b/bin/doctor @@ -256,6 +256,9 @@ function check_config_files() { if [[ "${REDIS_IMAGE:-null}" != "null" ]]; then print_point 2 "REDIS_IMAGE: $REDIS_IMAGE" fi + if [[ "${REDIS_AOF_PERSISTENCE:-null}" != "null" ]]; then + print_point 2 "REDIS_AOF_PERSISTENCE: $REDIS_AOF_PERSISTENCE" + fi if [[ "${REDIS_DATA_PATH:-null}" != "null" ]]; then print_point 2 "REDIS_DATA_PATH: $REDIS_DATA_PATH" fi diff --git a/lib/config-seed/overleaf.rc b/lib/config-seed/overleaf.rc index 196de54..071ff4d 100644 --- a/lib/config-seed/overleaf.rc +++ b/lib/config-seed/overleaf.rc @@ -23,6 +23,7 @@ MONGO_IMAGE=mongo:5.0 REDIS_ENABLED=true REDIS_DATA_PATH=data/redis REDIS_IMAGE=redis:6.2 +REDIS_AOF_PERSISTENCE=true # Git-bridge configuration (Server Pro only) GIT_BRIDGE_ENABLED=false diff --git a/lib/docker-compose.redis.yml b/lib/docker-compose.redis.yml index 07b81c3..0c70fba 100644 --- a/lib/docker-compose.redis.yml +++ b/lib/docker-compose.redis.yml @@ -8,6 +8,7 @@ services: volumes: - "${REDIS_DATA_PATH}:/data" container_name: redis + command: ${REDIS_COMMAND} expose: - 6379 From 172e79fb201618d2553a8b5b124c1cc17b38ecb0 Mon Sep 17 00:00:00 2001 From: mserranom Date: Wed, 17 Jul 2024 10:42:44 +0200 Subject: [PATCH 2/2] Updated link --- bin/docker-compose | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/docker-compose b/bin/docker-compose index 2d256cd..8f2b8ee 100755 --- a/bin/docker-compose +++ b/bin/docker-compose @@ -112,7 +112,7 @@ function set_redis_vars() { if [[ -z "${REDIS_AOF_PERSISTENCE:-}" ]]; then echo "WARNING: the value of REDIS_AOF_PERSISTENCE is not set in config/overleaf.rc" - echo "See https://github.com/overleaf/overleaf/wiki/Release-Notes-5.x.x#server-pro-510" + echo "See https://github.com/overleaf/overleaf/wiki/Release-Notes-5.x.x/_edit#redis-aof-persistence-enabled-by-default" REDIS_COMMAND="redis-server" elif [[ $REDIS_AOF_PERSISTENCE == "true" ]]; then REDIS_COMMAND="redis-server --appendonly yes"