Debug and fix Redis URL parsing issue
This commit is contained in:
18
start.sh
18
start.sh
@@ -31,9 +31,23 @@ export PORT=3001
|
|||||||
# Database configuration
|
# Database configuration
|
||||||
export DATABASE_URL="${CLOUDRON_POSTGRESQL_URL}"
|
export DATABASE_URL="${CLOUDRON_POSTGRESQL_URL}"
|
||||||
|
|
||||||
# Redis configuration
|
# 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}"
|
export REDIS_URL="${CLOUDRON_REDIS_URL}"
|
||||||
echo "=> Redis configured"
|
fi
|
||||||
|
|
||||||
# Email configuration
|
# Email configuration
|
||||||
export MAIL_DRIVER=smtp
|
export MAIL_DRIVER=smtp
|
||||||
|
Reference in New Issue
Block a user