all-in-one/Containers/nextcloud/config/redis.config.php
Simon L. 2fc2be363a nextcloud: allow to configure redis user
Signed-off-by: Simon L. <szaimen@e.mail.de>
2025-01-13 16:56:33 +01:00

25 lines
677 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' => (string) getenv('REDIS_HOST_PASSWORD'),
),
);
if (getenv('REDIS_HOST_PORT')) {
$CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT');
} elseif (getenv('REDIS_HOST')[0] != '/') {
$CONFIG['redis']['port'] = 6379;
}
if (getenv('REDIS_DB_INDEX')) {
$CONFIG['redis']['dbindex'] = (int) getenv('REDIS_DB_INDEX');
}
if (getenv('REDIS_USER') !== false) {
$CONFIG['redis']['user'] = getenv('REDIS_USER');
}
}