diff --git a/32/apache/config/redis.config.php b/32/apache/config/redis.config.php index 2069812f..415339d3 100644 --- a/32/apache/config/redis.config.php +++ b/32/apache/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/32/apache/entrypoint.sh b/32/apache/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/32/apache/entrypoint.sh +++ b/32/apache/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/32/fpm-alpine/config/redis.config.php b/32/fpm-alpine/config/redis.config.php index 2069812f..415339d3 100644 --- a/32/fpm-alpine/config/redis.config.php +++ b/32/fpm-alpine/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/32/fpm-alpine/entrypoint.sh b/32/fpm-alpine/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/32/fpm-alpine/entrypoint.sh +++ b/32/fpm-alpine/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/32/fpm/config/redis.config.php b/32/fpm/config/redis.config.php index 2069812f..415339d3 100644 --- a/32/fpm/config/redis.config.php +++ b/32/fpm/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/32/fpm/entrypoint.sh b/32/fpm/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/32/fpm/entrypoint.sh +++ b/32/fpm/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/33/apache/config/redis.config.php b/33/apache/config/redis.config.php index 2069812f..415339d3 100644 --- a/33/apache/config/redis.config.php +++ b/33/apache/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/33/apache/entrypoint.sh b/33/apache/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/33/apache/entrypoint.sh +++ b/33/apache/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/33/fpm-alpine/config/redis.config.php b/33/fpm-alpine/config/redis.config.php index 2069812f..415339d3 100644 --- a/33/fpm-alpine/config/redis.config.php +++ b/33/fpm-alpine/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/33/fpm-alpine/entrypoint.sh b/33/fpm-alpine/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/33/fpm-alpine/entrypoint.sh +++ b/33/fpm-alpine/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/33/fpm/config/redis.config.php b/33/fpm/config/redis.config.php index 2069812f..415339d3 100644 --- a/33/fpm/config/redis.config.php +++ b/33/fpm/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/33/fpm/entrypoint.sh b/33/fpm/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/33/fpm/entrypoint.sh +++ b/33/fpm/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/34/apache/config/redis.config.php b/34/apache/config/redis.config.php index 2069812f..415339d3 100644 --- a/34/apache/config/redis.config.php +++ b/34/apache/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/34/apache/entrypoint.sh b/34/apache/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/34/apache/entrypoint.sh +++ b/34/apache/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/34/fpm-alpine/config/redis.config.php b/34/fpm-alpine/config/redis.config.php index 2069812f..415339d3 100644 --- a/34/fpm-alpine/config/redis.config.php +++ b/34/fpm-alpine/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/34/fpm-alpine/entrypoint.sh b/34/fpm-alpine/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/34/fpm-alpine/entrypoint.sh +++ b/34/fpm-alpine/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/34/fpm/config/redis.config.php b/34/fpm/config/redis.config.php index 2069812f..415339d3 100644 --- a/34/fpm/config/redis.config.php +++ b/34/fpm/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/34/fpm/entrypoint.sh b/34/fpm/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/34/fpm/entrypoint.sh +++ b/34/fpm/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/35/apache/config/redis.config.php b/35/apache/config/redis.config.php index 2069812f..415339d3 100644 --- a/35/apache/config/redis.config.php +++ b/35/apache/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/35/apache/entrypoint.sh b/35/apache/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/35/apache/entrypoint.sh +++ b/35/apache/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/35/fpm-alpine/config/redis.config.php b/35/fpm-alpine/config/redis.config.php index 2069812f..415339d3 100644 --- a/35/fpm-alpine/config/redis.config.php +++ b/35/fpm-alpine/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/35/fpm-alpine/entrypoint.sh b/35/fpm-alpine/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/35/fpm-alpine/entrypoint.sh +++ b/35/fpm-alpine/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac diff --git a/35/fpm/config/redis.config.php b/35/fpm/config/redis.config.php index 2069812f..415339d3 100644 --- a/35/fpm/config/redis.config.php +++ b/35/fpm/config/redis.config.php @@ -4,14 +4,16 @@ if (getenv('REDIS_HOST')) { 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => getenv('REDIS_HOST'), + 'host' => (getenv('REDIS_HOST')[0] === '/' ? 'unix' : (getenv('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) { + if (getenv('REDIS_HOST')[0] === '/') { + $CONFIG['redis']['port'] = 0; + } elseif (getenv('REDIS_HOST_PORT') !== false) { $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); - } elseif (getenv('REDIS_HOST')[0] != '/') { + } else { $CONFIG['redis']['port'] = 6379; } diff --git a/35/fpm/entrypoint.sh b/35/fpm/entrypoint.sh index d8d21c1f..ccbd4654 100755 --- a/35/fpm/entrypoint.sh +++ b/35/fpm/entrypoint.sh @@ -107,7 +107,7 @@ configure_redis_session() { redis_save_path="unix://${REDIS_HOST}" ;; *) - redis_save_path="tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" + redis_save_path="${REDIS_PROTOCOL:=tcp}://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}" ;; esac