0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-02-05 11:08:27 +01:00
nextcloud-docker/.config/redis.config.php
Hagen 5b932e390e
Add REDIS_HOST_USER variable to specify a redis user (#2359)
Signed-off-by: hagene <hagene@uio.no>
2025-01-11 18:22:09 +00:00

21 lines
700 B
PHP

<?php
if (getenv('REDIS_HOST')) {
$CONFIG = array(
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => getenv('REDIS_HOST'),
'password' => getenv('REDIS_HOST_PASSWORD_FILE') ? trim(file_get_contents(getenv('REDIS_HOST_PASSWORD_FILE'))) : (string) getenv('REDIS_HOST_PASSWORD'),
),
);
if (getenv('REDIS_HOST_PORT') !== false) {
$CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT');
} elseif (getenv('REDIS_HOST')[0] != '/') {
$CONFIG['redis']['port'] = 6379;
}
if (getenv('REDIS_HOST_USER') !== false) {
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
}
}