From 83ea69d54bea72e1df9a2647ee101c73deb86d44 Mon Sep 17 00:00:00 2001 From: J0WI Date: Fri, 26 Apr 2019 15:49:59 +0200 Subject: [PATCH] Add Redis session handler Signed-off-by: J0WI --- 14.0/apache/entrypoint.sh | 9 +++++++++ 14.0/fpm-alpine/entrypoint.sh | 9 +++++++++ 14.0/fpm/entrypoint.sh | 9 +++++++++ 15.0/apache/entrypoint.sh | 9 +++++++++ 15.0/fpm-alpine/entrypoint.sh | 9 +++++++++ 15.0/fpm/entrypoint.sh | 9 +++++++++ 16.0/apache/entrypoint.sh | 9 +++++++++ 16.0/fpm-alpine/entrypoint.sh | 9 +++++++++ 16.0/fpm/entrypoint.sh | 9 +++++++++ docker-entrypoint.sh | 9 +++++++++ 10 files changed, 90 insertions(+) diff --git a/14.0/apache/entrypoint.sh b/14.0/apache/entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/14.0/apache/entrypoint.sh +++ b/14.0/apache/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 diff --git a/14.0/fpm-alpine/entrypoint.sh b/14.0/fpm-alpine/entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/14.0/fpm-alpine/entrypoint.sh +++ b/14.0/fpm-alpine/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 diff --git a/14.0/fpm/entrypoint.sh b/14.0/fpm/entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/14.0/fpm/entrypoint.sh +++ b/14.0/fpm/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 diff --git a/15.0/apache/entrypoint.sh b/15.0/apache/entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/15.0/apache/entrypoint.sh +++ b/15.0/apache/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 diff --git a/15.0/fpm-alpine/entrypoint.sh b/15.0/fpm-alpine/entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/15.0/fpm-alpine/entrypoint.sh +++ b/15.0/fpm-alpine/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 diff --git a/15.0/fpm/entrypoint.sh b/15.0/fpm/entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/15.0/fpm/entrypoint.sh +++ b/15.0/fpm/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 diff --git a/16.0/apache/entrypoint.sh b/16.0/apache/entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/16.0/apache/entrypoint.sh +++ b/16.0/apache/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 diff --git a/16.0/fpm-alpine/entrypoint.sh b/16.0/fpm-alpine/entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/16.0/fpm-alpine/entrypoint.sh +++ b/16.0/fpm-alpine/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 diff --git a/16.0/fpm/entrypoint.sh b/16.0/fpm/entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/16.0/fpm/entrypoint.sh +++ b/16.0/fpm/entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 6ef2540..78bd0a8 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -20,6 +20,15 @@ run_as() { } if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then + if [ -n "${REDIS_HOST+x}" ]; then + + echo "Configuring Redis as session handler" + { + echo 'session.save_handler = redis' + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + } > /usr/local/etc/php/conf.d/redis-session.ini + fi + installed_version="0.0.0.0" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016