From f46358b50ef2325787ea810cbf3cdfaff5d0f29a Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Mon, 23 Feb 2026 10:25:12 +0100 Subject: [PATCH] redis.config.php: fix some now optional values Signed-off-by: Simon L. --- Containers/nextcloud/config/redis.config.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Containers/nextcloud/config/redis.config.php b/Containers/nextcloud/config/redis.config.php index 7398c9b3..637e1b5f 100644 --- a/Containers/nextcloud/config/redis.config.php +++ b/Containers/nextcloud/config/redis.config.php @@ -3,12 +3,16 @@ if (getenv('REDIS_MODE') !== 'rediscluster') { $CONFIG = array( 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', - 'redis' => array( - 'host' => getenv('REDIS_HOST'), - 'password' => (string) getenv('REDIS_HOST_PASSWORD'), - ), ); + if (getenv('REDIS_HOST')) { + $CONFIG['redis']['host'] = (string) getenv('REDIS_HOST'); + } + + if (getenv('REDIS_HOST_PASSWORD')) { + $CONFIG['redis']['password'] = (string) getenv('REDIS_HOST_PASSWORD'); + } + if (getenv('REDIS_PORT')) { $CONFIG['redis']['port'] = (int) getenv('REDIS_PORT'); } @@ -25,7 +29,6 @@ if (getenv('REDIS_MODE') !== 'rediscluster') { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis.cluster' => array( - 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 'timeout' => 0.0, 'read_timeout' => 0.0, 'failover_mode' => \RedisCluster::FAILOVER_ERROR, @@ -43,6 +46,10 @@ if (getenv('REDIS_MODE') !== 'rediscluster') { ), ); + if (getenv('REDIS_HOST_PASSWORD')) { + $CONFIG['redis.cluster']['password'] = (string) getenv('REDIS_HOST_PASSWORD'); + } + if (getenv('REDIS_USER_AUTH')) { $CONFIG['redis.cluster']['user'] = str_replace("&auth[]=", "", getenv('REDIS_USER_AUTH')); }