From ad76a12150a6d5caccb5b6cb9a42beb31a27820c Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sat, 31 Jan 2026 04:47:28 +0000 Subject: [PATCH] Update entrypoint to print Public IP for DB whitelisting --- entrypoint.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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