From 349f1db7214e266522e3e36302a071fbac8ee616 Mon Sep 17 00:00:00 2001 From: codex_a Date: Sat, 28 Feb 2026 21:54:22 +0000 Subject: [PATCH 1/2] fix: auto-set Wagtail site hostname from ALLOWED_HOSTS on startup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- deploy/entrypoint.prod.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deploy/entrypoint.prod.sh b/deploy/entrypoint.prod.sh index f2d26a7..654805c 100755 --- a/deploy/entrypoint.prod.sh +++ b/deploy/entrypoint.prod.sh @@ -6,6 +6,14 @@ python manage.py tailwind build python manage.py migrate --noinput python manage.py collectstatic --noinput +# Set Wagtail site hostname from first entry in ALLOWED_HOSTS +python manage.py shell -c " +from wagtail.models import Site +import os +hostname = os.environ.get('ALLOWED_HOSTS', 'localhost').split(',')[0].strip() +Site.objects.update(hostname=hostname, port=443, site_name='No Hype AI') +" + exec gunicorn config.wsgi:application \ --workers 3 \ --bind 0.0.0.0:8000 \ From c9dab3e93b753041016f779a05c8c1832d3ad4d0 Mon Sep 17 00:00:00 2001 From: codex_a Date: Sat, 28 Feb 2026 21:55:58 +0000 Subject: [PATCH 2/2] fix: use correct Host header in deploy health check ALLOWED_HOSTS doesn't include localhost, so curl with default Host header always gets a 400 and the health check fails. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- deploy/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 470365a..93bc0c9 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -23,7 +23,7 @@ sudo systemctl restart sum-nohype echo "==> Waiting for health check" for i in $(seq 1 30); do - if curl -fsS http://localhost:8001/ >/dev/null 2>&1; then + if curl -fsS -H "Host: nohypeai.net" http://localhost:8001/ >/dev/null 2>&1; then echo "==> Site is up" exit 0 fi