Debug and fix Redis URL parsing issue
This commit is contained in:
20
start.sh
20
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
|
||||
|
Reference in New Issue
Block a user