-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Friendica] Fix TZ variable & add redis session cache #11851
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Diff for 37fa501:diff --git a/_bashbrew-cat b/_bashbrew-cat
index 54f3b41..7b99dd0 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -4,45 +4,45 @@ GitFetch: refs/heads/stable
Tags: 2021.09-apache, 2021.09
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 43bc72769649584863f8a90666e3cd1465bd7758
+GitCommit: 6edd78174b1a6de7610146c092c7a316d435f527
Directory: 2021.09/apache
Tags: 2021.09-fpm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 43bc72769649584863f8a90666e3cd1465bd7758
+GitCommit: 6edd78174b1a6de7610146c092c7a316d435f527
Directory: 2021.09/fpm
Tags: 2021.09-fpm-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 43bc72769649584863f8a90666e3cd1465bd7758
+GitCommit: 6edd78174b1a6de7610146c092c7a316d435f527
Directory: 2021.09/fpm-alpine
Tags: 2022.02-apache, apache, stable-apache, 2022.02, latest, stable
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 43bc72769649584863f8a90666e3cd1465bd7758
+GitCommit: 6edd78174b1a6de7610146c092c7a316d435f527
Directory: 2022.02/apache
Tags: 2022.02-fpm, fpm, stable-fpm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 43bc72769649584863f8a90666e3cd1465bd7758
+GitCommit: 6edd78174b1a6de7610146c092c7a316d435f527
Directory: 2022.02/fpm
Tags: 2022.02-fpm-alpine, fpm-alpine, stable-fpm-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 43bc72769649584863f8a90666e3cd1465bd7758
+GitCommit: 6edd78174b1a6de7610146c092c7a316d435f527
Directory: 2022.02/fpm-alpine
Tags: 2022.05-dev-apache, dev-apache, 2022.05-dev, dev
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 43bc72769649584863f8a90666e3cd1465bd7758
+GitCommit: 6edd78174b1a6de7610146c092c7a316d435f527
Directory: 2022.05-dev/apache
Tags: 2022.05-dev-fpm, dev-fpm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 43bc72769649584863f8a90666e3cd1465bd7758
+GitCommit: 6edd78174b1a6de7610146c092c7a316d435f527
Directory: 2022.05-dev/fpm
Tags: 2022.05-dev-fpm-alpine, dev-fpm-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 43bc72769649584863f8a90666e3cd1465bd7758
+GitCommit: 6edd78174b1a6de7610146c092c7a316d435f527
Directory: 2022.05-dev/fpm-alpine
diff --git a/friendica_2021.09-fpm-alpine/entrypoint.sh b/friendica_2021.09-fpm-alpine/entrypoint.sh
index 3d324f2..bb723fb 100755
--- a/friendica_2021.09-fpm-alpine/entrypoint.sh
+++ b/friendica_2021.09-fpm-alpine/entrypoint.sh
@@ -43,6 +43,32 @@ sh /setup_msmtp.sh
# just check if we execute apache or php-fpm
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
+ if [ -n "${REDIS_HOST+x}" ]; then
+ echo "Configuring Redis as session handler"
+ {
+ file_env REDIS_PW
+ echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "${REDIS_HOST:0:1}" = "/" ]; then
+ if [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
+ # check if redis password has been set
+ elif [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}\""
+ fi
+ echo "redis.session.locking_enabled = 1"
+ echo "redis.session.lock_retries = -1"
+ # redis.session.lock_wait_time is specified in microseconds.
+ # Wait 10ms before retrying the lock rather than the default 2ms.
+ echo "redis.session.lock_wait_time = 10000"
+ } > /usr/local/etc/php/conf.d/redis-session.ini
+ fi
+
installed_version="0.0.0.0"
if [ -f /var/www/html/VERSION ]; then
installed_version="$(cat /var/www/html/VERSION)"
@@ -99,7 +125,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${FRIENDICA_ADMIN_MAIL+x}" ] && [ -n "${FRIENDICA_URL+x}" ]; then
echo "Installation with environment variables"
- FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles}
+ FRIENDICA_TZ=${FRIENDICA_TZ:-America/New_York}
FRIENDICA_LANG=${FRIENDICA_LANG:-en}
MYSQL_PORT=${MYSQL_PORT:-3306}
diff --git a/friendica_2021.09-fpm/entrypoint.sh b/friendica_2021.09-fpm/entrypoint.sh
index 3d324f2..bb723fb 100755
--- a/friendica_2021.09-fpm/entrypoint.sh
+++ b/friendica_2021.09-fpm/entrypoint.sh
@@ -43,6 +43,32 @@ sh /setup_msmtp.sh
# just check if we execute apache or php-fpm
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
+ if [ -n "${REDIS_HOST+x}" ]; then
+ echo "Configuring Redis as session handler"
+ {
+ file_env REDIS_PW
+ echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "${REDIS_HOST:0:1}" = "/" ]; then
+ if [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
+ # check if redis password has been set
+ elif [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}\""
+ fi
+ echo "redis.session.locking_enabled = 1"
+ echo "redis.session.lock_retries = -1"
+ # redis.session.lock_wait_time is specified in microseconds.
+ # Wait 10ms before retrying the lock rather than the default 2ms.
+ echo "redis.session.lock_wait_time = 10000"
+ } > /usr/local/etc/php/conf.d/redis-session.ini
+ fi
+
installed_version="0.0.0.0"
if [ -f /var/www/html/VERSION ]; then
installed_version="$(cat /var/www/html/VERSION)"
@@ -99,7 +125,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${FRIENDICA_ADMIN_MAIL+x}" ] && [ -n "${FRIENDICA_URL+x}" ]; then
echo "Installation with environment variables"
- FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles}
+ FRIENDICA_TZ=${FRIENDICA_TZ:-America/New_York}
FRIENDICA_LANG=${FRIENDICA_LANG:-en}
MYSQL_PORT=${MYSQL_PORT:-3306}
diff --git a/friendica_2021.09/entrypoint.sh b/friendica_2021.09/entrypoint.sh
index 3d324f2..bb723fb 100755
--- a/friendica_2021.09/entrypoint.sh
+++ b/friendica_2021.09/entrypoint.sh
@@ -43,6 +43,32 @@ sh /setup_msmtp.sh
# just check if we execute apache or php-fpm
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
+ if [ -n "${REDIS_HOST+x}" ]; then
+ echo "Configuring Redis as session handler"
+ {
+ file_env REDIS_PW
+ echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "${REDIS_HOST:0:1}" = "/" ]; then
+ if [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
+ # check if redis password has been set
+ elif [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}\""
+ fi
+ echo "redis.session.locking_enabled = 1"
+ echo "redis.session.lock_retries = -1"
+ # redis.session.lock_wait_time is specified in microseconds.
+ # Wait 10ms before retrying the lock rather than the default 2ms.
+ echo "redis.session.lock_wait_time = 10000"
+ } > /usr/local/etc/php/conf.d/redis-session.ini
+ fi
+
installed_version="0.0.0.0"
if [ -f /var/www/html/VERSION ]; then
installed_version="$(cat /var/www/html/VERSION)"
@@ -99,7 +125,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${FRIENDICA_ADMIN_MAIL+x}" ] && [ -n "${FRIENDICA_URL+x}" ]; then
echo "Installation with environment variables"
- FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles}
+ FRIENDICA_TZ=${FRIENDICA_TZ:-America/New_York}
FRIENDICA_LANG=${FRIENDICA_LANG:-en}
MYSQL_PORT=${MYSQL_PORT:-3306}
diff --git a/friendica_dev-fpm-alpine/entrypoint.sh b/friendica_dev-fpm-alpine/entrypoint.sh
index 3d324f2..bb723fb 100755
--- a/friendica_dev-fpm-alpine/entrypoint.sh
+++ b/friendica_dev-fpm-alpine/entrypoint.sh
@@ -43,6 +43,32 @@ sh /setup_msmtp.sh
# just check if we execute apache or php-fpm
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
+ if [ -n "${REDIS_HOST+x}" ]; then
+ echo "Configuring Redis as session handler"
+ {
+ file_env REDIS_PW
+ echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "${REDIS_HOST:0:1}" = "/" ]; then
+ if [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
+ # check if redis password has been set
+ elif [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}\""
+ fi
+ echo "redis.session.locking_enabled = 1"
+ echo "redis.session.lock_retries = -1"
+ # redis.session.lock_wait_time is specified in microseconds.
+ # Wait 10ms before retrying the lock rather than the default 2ms.
+ echo "redis.session.lock_wait_time = 10000"
+ } > /usr/local/etc/php/conf.d/redis-session.ini
+ fi
+
installed_version="0.0.0.0"
if [ -f /var/www/html/VERSION ]; then
installed_version="$(cat /var/www/html/VERSION)"
@@ -99,7 +125,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${FRIENDICA_ADMIN_MAIL+x}" ] && [ -n "${FRIENDICA_URL+x}" ]; then
echo "Installation with environment variables"
- FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles}
+ FRIENDICA_TZ=${FRIENDICA_TZ:-America/New_York}
FRIENDICA_LANG=${FRIENDICA_LANG:-en}
MYSQL_PORT=${MYSQL_PORT:-3306}
diff --git a/friendica_dev-fpm/entrypoint.sh b/friendica_dev-fpm/entrypoint.sh
index 3d324f2..bb723fb 100755
--- a/friendica_dev-fpm/entrypoint.sh
+++ b/friendica_dev-fpm/entrypoint.sh
@@ -43,6 +43,32 @@ sh /setup_msmtp.sh
# just check if we execute apache or php-fpm
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
+ if [ -n "${REDIS_HOST+x}" ]; then
+ echo "Configuring Redis as session handler"
+ {
+ file_env REDIS_PW
+ echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "${REDIS_HOST:0:1}" = "/" ]; then
+ if [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
+ # check if redis password has been set
+ elif [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}\""
+ fi
+ echo "redis.session.locking_enabled = 1"
+ echo "redis.session.lock_retries = -1"
+ # redis.session.lock_wait_time is specified in microseconds.
+ # Wait 10ms before retrying the lock rather than the default 2ms.
+ echo "redis.session.lock_wait_time = 10000"
+ } > /usr/local/etc/php/conf.d/redis-session.ini
+ fi
+
installed_version="0.0.0.0"
if [ -f /var/www/html/VERSION ]; then
installed_version="$(cat /var/www/html/VERSION)"
@@ -99,7 +125,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${FRIENDICA_ADMIN_MAIL+x}" ] && [ -n "${FRIENDICA_URL+x}" ]; then
echo "Installation with environment variables"
- FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles}
+ FRIENDICA_TZ=${FRIENDICA_TZ:-America/New_York}
FRIENDICA_LANG=${FRIENDICA_LANG:-en}
MYSQL_PORT=${MYSQL_PORT:-3306}
diff --git a/friendica_dev/entrypoint.sh b/friendica_dev/entrypoint.sh
index 3d324f2..bb723fb 100755
--- a/friendica_dev/entrypoint.sh
+++ b/friendica_dev/entrypoint.sh
@@ -43,6 +43,32 @@ sh /setup_msmtp.sh
# just check if we execute apache or php-fpm
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
+ if [ -n "${REDIS_HOST+x}" ]; then
+ echo "Configuring Redis as session handler"
+ {
+ file_env REDIS_PW
+ echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "${REDIS_HOST:0:1}" = "/" ]; then
+ if [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
+ # check if redis password has been set
+ elif [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}\""
+ fi
+ echo "redis.session.locking_enabled = 1"
+ echo "redis.session.lock_retries = -1"
+ # redis.session.lock_wait_time is specified in microseconds.
+ # Wait 10ms before retrying the lock rather than the default 2ms.
+ echo "redis.session.lock_wait_time = 10000"
+ } > /usr/local/etc/php/conf.d/redis-session.ini
+ fi
+
installed_version="0.0.0.0"
if [ -f /var/www/html/VERSION ]; then
installed_version="$(cat /var/www/html/VERSION)"
@@ -99,7 +125,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${FRIENDICA_ADMIN_MAIL+x}" ] && [ -n "${FRIENDICA_URL+x}" ]; then
echo "Installation with environment variables"
- FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles}
+ FRIENDICA_TZ=${FRIENDICA_TZ:-America/New_York}
FRIENDICA_LANG=${FRIENDICA_LANG:-en}
MYSQL_PORT=${MYSQL_PORT:-3306}
diff --git a/friendica_stable-fpm-alpine/entrypoint.sh b/friendica_stable-fpm-alpine/entrypoint.sh
index 3d324f2..bb723fb 100755
--- a/friendica_stable-fpm-alpine/entrypoint.sh
+++ b/friendica_stable-fpm-alpine/entrypoint.sh
@@ -43,6 +43,32 @@ sh /setup_msmtp.sh
# just check if we execute apache or php-fpm
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
+ if [ -n "${REDIS_HOST+x}" ]; then
+ echo "Configuring Redis as session handler"
+ {
+ file_env REDIS_PW
+ echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "${REDIS_HOST:0:1}" = "/" ]; then
+ if [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
+ # check if redis password has been set
+ elif [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}\""
+ fi
+ echo "redis.session.locking_enabled = 1"
+ echo "redis.session.lock_retries = -1"
+ # redis.session.lock_wait_time is specified in microseconds.
+ # Wait 10ms before retrying the lock rather than the default 2ms.
+ echo "redis.session.lock_wait_time = 10000"
+ } > /usr/local/etc/php/conf.d/redis-session.ini
+ fi
+
installed_version="0.0.0.0"
if [ -f /var/www/html/VERSION ]; then
installed_version="$(cat /var/www/html/VERSION)"
@@ -99,7 +125,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${FRIENDICA_ADMIN_MAIL+x}" ] && [ -n "${FRIENDICA_URL+x}" ]; then
echo "Installation with environment variables"
- FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles}
+ FRIENDICA_TZ=${FRIENDICA_TZ:-America/New_York}
FRIENDICA_LANG=${FRIENDICA_LANG:-en}
MYSQL_PORT=${MYSQL_PORT:-3306}
diff --git a/friendica_stable-fpm/entrypoint.sh b/friendica_stable-fpm/entrypoint.sh
index 3d324f2..bb723fb 100755
--- a/friendica_stable-fpm/entrypoint.sh
+++ b/friendica_stable-fpm/entrypoint.sh
@@ -43,6 +43,32 @@ sh /setup_msmtp.sh
# just check if we execute apache or php-fpm
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
+ if [ -n "${REDIS_HOST+x}" ]; then
+ echo "Configuring Redis as session handler"
+ {
+ file_env REDIS_PW
+ echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "${REDIS_HOST:0:1}" = "/" ]; then
+ if [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
+ # check if redis password has been set
+ elif [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}\""
+ fi
+ echo "redis.session.locking_enabled = 1"
+ echo "redis.session.lock_retries = -1"
+ # redis.session.lock_wait_time is specified in microseconds.
+ # Wait 10ms before retrying the lock rather than the default 2ms.
+ echo "redis.session.lock_wait_time = 10000"
+ } > /usr/local/etc/php/conf.d/redis-session.ini
+ fi
+
installed_version="0.0.0.0"
if [ -f /var/www/html/VERSION ]; then
installed_version="$(cat /var/www/html/VERSION)"
@@ -99,7 +125,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${FRIENDICA_ADMIN_MAIL+x}" ] && [ -n "${FRIENDICA_URL+x}" ]; then
echo "Installation with environment variables"
- FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles}
+ FRIENDICA_TZ=${FRIENDICA_TZ:-America/New_York}
FRIENDICA_LANG=${FRIENDICA_LANG:-en}
MYSQL_PORT=${MYSQL_PORT:-3306}
diff --git a/friendica_stable/entrypoint.sh b/friendica_stable/entrypoint.sh
index 3d324f2..bb723fb 100755
--- a/friendica_stable/entrypoint.sh
+++ b/friendica_stable/entrypoint.sh
@@ -43,6 +43,32 @@ sh /setup_msmtp.sh
# just check if we execute apache or php-fpm
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
+ if [ -n "${REDIS_HOST+x}" ]; then
+ echo "Configuring Redis as session handler"
+ {
+ file_env REDIS_PW
+ echo 'session.save_handler = redis'
+ # check if redis host is an unix socket path
+ if [ "${REDIS_HOST:0:1}" = "/" ]; then
+ if [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"unix://${REDIS_HOST}\""
+ fi
+ # check if redis password has been set
+ elif [ -n "${REDIS_PW+x}" ]; then
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}?auth=${REDIS_PW}\""
+ else
+ echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_PORT:=6379}\""
+ fi
+ echo "redis.session.locking_enabled = 1"
+ echo "redis.session.lock_retries = -1"
+ # redis.session.lock_wait_time is specified in microseconds.
+ # Wait 10ms before retrying the lock rather than the default 2ms.
+ echo "redis.session.lock_wait_time = 10000"
+ } > /usr/local/etc/php/conf.d/redis-session.ini
+ fi
+
installed_version="0.0.0.0"
if [ -f /var/www/html/VERSION ]; then
installed_version="$(cat /var/www/html/VERSION)"
@@ -99,7 +125,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${FRIENDICA_ADMIN_MAIL+x}" ] && [ -n "${FRIENDICA_URL+x}" ]; then
echo "Installation with environment variables"
- FRIENDICA_TZ=${FRIENDICA_TZ:-America/LosAngeles}
+ FRIENDICA_TZ=${FRIENDICA_TZ:-America/New_York}
FRIENDICA_LANG=${FRIENDICA_LANG:-en}
MYSQL_PORT=${MYSQL_PORT:-3306} Relevant Maintainers:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.