From 6656311f891d064cfd0c930c74d67e747c0dc2b4 Mon Sep 17 00:00:00 2001 From: Andreas Dueren Date: Tue, 15 Jul 2025 06:51:17 -0600 Subject: [PATCH] Debug and fix Redis URL parsing issue --- start.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/start.sh b/start.sh index b900ef9..7840216 100644 --- a/start.sh +++ b/start.sh @@ -31,9 +31,23 @@ export PORT=3001 # Database configuration export DATABASE_URL="${CLOUDRON_POSTGRESQL_URL}" -# Redis configuration -export REDIS_URL="${CLOUDRON_REDIS_URL}" -echo "=> Redis configured" +# Redis configuration - debug and fix URL format +echo "=> Original Redis URL: ${CLOUDRON_REDIS_URL}" + +# Parse Redis URL components +if [[ "$CLOUDRON_REDIS_URL" =~ redis://([^:]+):([^@]+)@([^:]+):([0-9]+) ]]; then + REDIS_USER="${BASH_REMATCH[1]}" + REDIS_PASSWORD="${BASH_REMATCH[2]}" + REDIS_HOST="${BASH_REMATCH[3]}" + REDIS_PORT="${BASH_REMATCH[4]}" + + # Reconstruct Redis URL in correct format + export REDIS_URL="redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}" + echo "=> Redis configured: ${REDIS_HOST}:${REDIS_PORT}" +else + echo "=> Failed to parse Redis URL, using original: ${CLOUDRON_REDIS_URL}" + export REDIS_URL="${CLOUDRON_REDIS_URL}" +fi # Email configuration export MAIL_DRIVER=smtp