diff --git a/entrypoint.sh b/entrypoint.sh index bc83c86..fc68099 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,6 +12,14 @@ echo "DB_NAME: ${DB_NAME:-'Not Set'}" echo "DB_USER: ${DB_USER:-'Not Set'}" # Do NOT print DB_PASS +# Detect and print Public IP (Helpful for Whitelisting) +echo "--------------------------------------------------------" +echo "DETECTING PUBLIC IP FOR DATABASE WHITELISTING:" +PUBLIC_IP=$(curl -s --connect-timeout 5 ifconfig.me || echo "Unavailable") +echo "YOUR VPS PUBLIC IP IS: ${PUBLIC_IP}" +echo "Make sure this IP is allowed in Hostinger -> Databases -> Remote MySQL" +echo "--------------------------------------------------------" + # Wait for database to be ready echo "Checking database connection..." python manage.py wait_for_db @@ -26,4 +34,4 @@ python manage.py collectstatic --noinput # Start Gunicorn echo "Starting Gunicorn..." -exec gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 3 +exec gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 3 \ No newline at end of file