pull/2550/merge
Josh 5 days ago committed by GitHub
commit c6bd085d20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -113,6 +113,13 @@ RUN { \
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
echo; \
echo '; Use Redis for PHP sessions when configured by the entrypoint'; \
echo 'session.save_handler=${PHP_REDIS_SESSION_HANDLER}'; \
echo 'session.save_path="${PHP_REDIS_SESSION_SAVE_PATH}"'; \
echo 'redis.session.locking_enabled=${PHP_REDIS_SESSION_LOCKING_ENABLED}'; \
echo 'redis.session.lock_retries=${PHP_REDIS_SESSION_LOCK_RETRIES}'; \
echo 'redis.session.lock_wait_time=${PHP_REDIS_SESSION_LOCK_WAIT_TIME}'; \
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
\
mkdir /var/www/data; \

@ -120,6 +120,13 @@ RUN { \
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
echo; \
echo '; Use Redis for PHP sessions when configured by the entrypoint'; \
echo 'session.save_handler=${PHP_REDIS_SESSION_HANDLER}'; \
echo 'session.save_path="${PHP_REDIS_SESSION_SAVE_PATH}"'; \
echo 'redis.session.locking_enabled=${PHP_REDIS_SESSION_LOCKING_ENABLED}'; \
echo 'redis.session.lock_retries=${PHP_REDIS_SESSION_LOCK_RETRIES}'; \
echo 'redis.session.lock_wait_time=${PHP_REDIS_SESSION_LOCK_WAIT_TIME}'; \
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
\
mkdir /var/www/data; \

@ -88,7 +88,7 @@ get_enabled_apps() {
| sort
}
# Write PHP session config for Redis to /usr/local/etc/php/conf.d/redis-session.ini
# Export PHP session config for Redis via environment variables
configure_redis_session() {
local redis_save_path
local redis_auth=''
@ -96,7 +96,13 @@ configure_redis_session() {
echo "=> Configuring PHP session handler..."
if [ -z "${REDIS_HOST:-}" ]; then
echo "==> Using default PHP session handler"
echo "==> Using default PHP session handler (files)"
# @todo: consider moving to PHP 8.3 missing env variable fallbacks in the ini file itself
export PHP_REDIS_SESSION_HANDLER='files'
export PHP_REDIS_SESSION_SAVE_PATH=''
export PHP_REDIS_SESSION_LOCKING_ENABLED='0'
export PHP_REDIS_SESSION_LOCK_RETRIES='0'
export PHP_REDIS_SESSION_LOCK_WAIT_TIME='0'
return 0
fi
@ -117,16 +123,13 @@ configure_redis_session() {
redis_auth="?auth=${REDIS_HOST_PASSWORD}"
fi
export PHP_REDIS_SESSION_HANDLER='redis'
export PHP_REDIS_SESSION_SAVE_PATH="${redis_save_path}${redis_auth}"
export PHP_REDIS_SESSION_LOCKING_ENABLED='1'
export PHP_REDIS_SESSION_LOCK_RETRIES='-1'
export PHP_REDIS_SESSION_LOCK_WAIT_TIME='10000'
echo "==> Using Redis as PHP session handler..."
{
echo 'session.save_handler = redis'
echo "session.save_path = \"${redis_save_path}${redis_auth}\""
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
}
########################################################################

Loading…
Cancel
Save