summaryrefslogtreecommitdiffstats
path: root/17.0/fpm-alpine/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to '17.0/fpm-alpine/entrypoint.sh')
-rwxr-xr-x17.0/fpm-alpine/entrypoint.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/17.0/fpm-alpine/entrypoint.sh b/17.0/fpm-alpine/entrypoint.sh
index 9514d881..0104bab6 100755
--- a/17.0/fpm-alpine/entrypoint.sh
+++ b/17.0/fpm-alpine/entrypoint.sh
@@ -25,8 +25,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
echo "Configuring Redis as session handler"
{
echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
+ if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
# check if redis password has been set
- if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
+ elif [ -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}\""