0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-20 10:56:08 +02:00
nextcloud-docker/28/fpm-alpine/config/redis.config.php
Adam Vest c18d0b1f44
Enable TLS connection for Redis
Signed-off-by: Adam Vest <ziris85@live.com>
2024-11-15 23:52:22 -05:00

17 lines
628 B
PHP

<?php
if (getenv('REDIS_HOST')) {
$CONFIG = array(
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => ($_ENV['REDIS_PROTOCOL'] ?? 'tcp') . "://" . 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;
}
}