From bc6f1c3c2e73396192f0ad7a18099ee2e6c7a7b9 Mon Sep 17 00:00:00 2001 From: bisco Date: Thu, 30 Apr 2026 11:48:50 +0200 Subject: [PATCH] fix: pass site base url to backend container --- docs/deployment.md | 3 ++- infra/docker/compose.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/deployment.md b/docs/deployment.md index edadd5b..87797a3 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -10,7 +10,7 @@ Required production changes: - set a strong random `DJANGO_SECRET_KEY`; - set `DJANGO_ALLOWED_HOSTS` to the real public hostnames only; - set `DJANGO_CSRF_TRUSTED_ORIGINS` to the real public HTTPS origins; -- set `SITE_BASE_URL` to the real public HTTPS base URL used for confirmation emails and QR/check-in links; +- set `SITE_BASE_URL` to one real public HTTPS base URL used for confirmation emails and QR/check-in links; - replace the console email backend with real SMTP settings and a valid sender address; - publish only nginx and terminate HTTPS at nginx or a trusted upstream reverse proxy; - keep `collectstatic --noinput` in the deployment flow before `up -d`; @@ -134,6 +134,7 @@ Local Docker convention: - use nginx as the public entrypoint at `http://localhost`; - set `SITE_BASE_URL=http://localhost`; +- keep `SITE_BASE_URL` as a single URL value, never a comma-separated list; - keep `DJANGO_CSRF_TRUSTED_ORIGINS` and browser-facing `CORS_ALLOWED_ORIGINS` aligned with that public URL; - if you publish nginx on a different port, update `SITE_BASE_URL` and trusted origins to the same host and port. - local/debug reservation email sends also log the confirmation URL so browser testing can continue even if SMTP is missing or fails. diff --git a/infra/docker/compose.yml b/infra/docker/compose.yml index e7a49bb..0b2ef7f 100644 --- a/infra/docker/compose.yml +++ b/infra/docker/compose.yml @@ -10,6 +10,7 @@ services: DJANGO_CSRF_TRUSTED_ORIGINS: ${DJANGO_CSRF_TRUSTED_ORIGINS} DJANGO_DEBUG: ${DJANGO_DEBUG:-false} CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS} + SITE_BASE_URL: ${SITE_BASE_URL} TIME_ZONE: ${TIME_ZONE:-Europe/Rome} DATABASE_URL: ${DATABASE_URL} POSTGRES_DB: ${POSTGRES_DB}