diff options
author | algakzru <algakzru@gmail.com> | 2019-09-10 08:31:16 +0800 |
---|---|---|
committer | J0WI <J0WI@users.noreply.github.com> | 2019-09-10 02:31:16 +0200 |
commit | 73ff5c860d155d46ed65b6ae9caa9ee6e64478de (patch) | |
tree | f2ffb27acfb5e070c93a05f6428fa9485fdb7f92 /17.0-beta | |
parent | 892ac14791fc3ebbb201f23584ca34f83e33e8a1 (diff) |
Set redis password (#856)17.0.0beta4-fpm-alpine17.0.0beta4-fpm17.0.0beta4-apache17.0.0beta417.0.0-beta-fpm-alpine17.0.0-beta-fpm17.0.0-beta-apache17.0.0-beta17.0-beta-fpm-alpine17.0-beta-fpm17.0-beta-apache17.0-beta17-beta-fpm-alpine17-beta-fpm17-beta-apache17-beta16.0.4-fpm-alpine16.0.4-fpm16.0.4-apache16.0.415.0.11-fpm-alpine15.0.11-fpm15.0.11-apache15.0.1114.0.14-fpm-alpine14.0.14-fpm14.0.14-apache14.0.1414.0-fpm-alpine14.0-fpm14.0-apache14.014-fpm-alpine14-fpm14-apache14
Diffstat (limited to '17.0-beta')
-rw-r--r-- | 17.0-beta/apache/config/redis.config.php | 1 | ||||
-rwxr-xr-x | 17.0-beta/apache/entrypoint.sh | 7 | ||||
-rw-r--r-- | 17.0-beta/fpm-alpine/config/redis.config.php | 1 | ||||
-rwxr-xr-x | 17.0-beta/fpm-alpine/entrypoint.sh | 7 | ||||
-rw-r--r-- | 17.0-beta/fpm/config/redis.config.php | 1 | ||||
-rwxr-xr-x | 17.0-beta/fpm/entrypoint.sh | 7 |
6 files changed, 21 insertions, 3 deletions
diff --git a/17.0-beta/apache/config/redis.config.php b/17.0-beta/apache/config/redis.config.php index 5df799f2..19676160 100644 --- a/17.0-beta/apache/config/redis.config.php +++ b/17.0-beta/apache/config/redis.config.php @@ -6,6 +6,7 @@ if (getenv('REDIS_HOST')) { 'redis' => array( 'host' => getenv('REDIS_HOST'), 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + 'password' => getenv('REDIS_HOST_PASSWORD'), ), ); } diff --git a/17.0-beta/apache/entrypoint.sh b/17.0-beta/apache/entrypoint.sh index 0be9d287..9514d881 100755 --- a/17.0-beta/apache/entrypoint.sh +++ b/17.0-beta/apache/entrypoint.sh @@ -25,7 +25,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP echo "Configuring Redis as session handler" { echo 'session.save_handler = redis' - echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + # check if redis password has been set + if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\"" + else + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + fi } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/17.0-beta/fpm-alpine/config/redis.config.php b/17.0-beta/fpm-alpine/config/redis.config.php index 5df799f2..19676160 100644 --- a/17.0-beta/fpm-alpine/config/redis.config.php +++ b/17.0-beta/fpm-alpine/config/redis.config.php @@ -6,6 +6,7 @@ if (getenv('REDIS_HOST')) { 'redis' => array( 'host' => getenv('REDIS_HOST'), 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + 'password' => getenv('REDIS_HOST_PASSWORD'), ), ); } diff --git a/17.0-beta/fpm-alpine/entrypoint.sh b/17.0-beta/fpm-alpine/entrypoint.sh index 0be9d287..9514d881 100755 --- a/17.0-beta/fpm-alpine/entrypoint.sh +++ b/17.0-beta/fpm-alpine/entrypoint.sh @@ -25,7 +25,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP echo "Configuring Redis as session handler" { echo 'session.save_handler = redis' - echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + # check if redis password has been set + if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\"" + else + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + fi } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/17.0-beta/fpm/config/redis.config.php b/17.0-beta/fpm/config/redis.config.php index 5df799f2..19676160 100644 --- a/17.0-beta/fpm/config/redis.config.php +++ b/17.0-beta/fpm/config/redis.config.php @@ -6,6 +6,7 @@ if (getenv('REDIS_HOST')) { 'redis' => array( 'host' => getenv('REDIS_HOST'), 'port' => getenv('REDIS_HOST_PORT') ?: 6379, + 'password' => getenv('REDIS_HOST_PASSWORD'), ), ); } diff --git a/17.0-beta/fpm/entrypoint.sh b/17.0-beta/fpm/entrypoint.sh index 0be9d287..9514d881 100755 --- a/17.0-beta/fpm/entrypoint.sh +++ b/17.0-beta/fpm/entrypoint.sh @@ -25,7 +25,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP echo "Configuring Redis as session handler" { echo 'session.save_handler = redis' - echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + # check if redis password has been set + if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\"" + else + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + fi } > /usr/local/etc/php/conf.d/redis-session.ini fi |