Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2025-01-14 14:25:17 +01:00
parent 2fc2be363a
commit 4acc9d8f41
4 changed files with 11 additions and 3 deletions

View file

@ -147,7 +147,7 @@ RUN set -ex; \
\
{ \
echo 'session.save_handler = redis'; \
echo 'session.save_path = "tcp://${REDIS_HOST}:6379?database=${REDIS_DB_INDEX}&auth[]=${REDIS_USER}&auth[]=${REDIS_HOST_PASSWORD}"'; \
echo 'session.save_path = "tcp://${REDIS_HOST}:6379?database=${REDIS_DB_INDEX}${REDIS_USER_AUTH}&auth[]=${REDIS_HOST_PASSWORD}"'; \
echo 'redis.session.locking_enabled = 1'; \
echo 'redis.session.lock_retries = -1'; \
echo 'redis.session.lock_wait_time = 10000'; \

View file

@ -19,7 +19,7 @@ if (getenv('REDIS_HOST')) {
$CONFIG['redis']['dbindex'] = (int) getenv('REDIS_DB_INDEX');
}
if (getenv('REDIS_USER') !== false) {
$CONFIG['redis']['user'] = getenv('REDIS_USER');
if (getenv('REDIS_USER_AUTH') !== false) {
$CONFIG['redis']['user'] = str_replace("&auth[]=", "", getenv('REDIS_USER_AUTH'));
}
}

View file

@ -62,6 +62,10 @@ fi
# Set sensitive values as env
export DATABASE_URL="$DATABASE_TYPE://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB"
if [ -n "$REDIS_USER_AUTH" ]; then
# shellcheck disable=SC2001
REDIS_USER="$(echo "$REDIS_USER_AUTH" | sed 's|&auth[]=||')"
fi
export REDIS_URL="redis://$REDIS_USER:$REDIS_HOST_PASSWORD@$REDIS_HOST/$REDIS_DB_INDEX"
# Run it

View file

@ -11,6 +11,10 @@ if [ -z "$REDIS_DB_INDEX" ]; then
REDIS_DB_INDEX=0
fi
if [ -n "$REDIS_USER_AUTH" ]; then
# shellcheck disable=SC2001
REDIS_USER="$(echo "$REDIS_USER_AUTH" | sed 's|&auth[]=||')"
fi
export REDIS_URL="redis://$REDIS_USER:$REDIS_HOST_PASSWORD@$REDIS_HOST/$REDIS_DB_INDEX"
# Run it