Skip to content

Commit 70bf279

Browse files
authored
Merge pull request #152 from WeOwnNetwork/feature/nik-billing-domain-aliases
feat(billing-docker): canonical billing.weown.dev + cheap domain aliases
2 parents ee110de + 4d27b50 commit 70bf279

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

billing-docker/sites/billing/app/billing/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
1212
DEBUG = os.environ.get("DJANGO_DEBUG", "") == "1"
13-
ALLOWED_HOSTS = [os.environ.get("DJANGO_ALLOWED_HOST", "localhost")]
13+
# Comma-separated: first entry is the canonical host (used to build absolute
14+
# URLs); extras are aliases so a domain swap/addition is config-only.
15+
ALLOWED_HOSTS = [h.strip() for h in os.environ.get("DJANGO_ALLOWED_HOST", "localhost").split(",") if h.strip()]
1416
CSRF_TRUSTED_ORIGINS = [f"https://{h}" for h in ALLOWED_HOSTS if h != "localhost"]
1517

1618
INSTALLED_APPS = [

billing-docker/sites/billing/docker/Caddyfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# No `tls` block: automatic HTTPS via Let's Encrypt is Caddy's default
44
# (an empty tls block does not even parse — proven on sso.weown.id 2026-07-22).
55

6+
# To serve additional aliases, list them space-separated on the site
7+
# line below (e.g. "billing.weown.dev billing.weown.chat {") AND append them
8+
# comma-separated to DJANGO_ALLOWED_HOST in compose.
69
billing.weown.dev {
710
reverse_proxy web:8000
811

billing-docker/template/app/billing/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
1212
DEBUG = os.environ.get("DJANGO_DEBUG", "") == "1"
13-
ALLOWED_HOSTS = [os.environ.get("DJANGO_ALLOWED_HOST", "localhost")]
13+
# Comma-separated: first entry is the canonical host (used to build absolute
14+
# URLs); extras are aliases so a domain swap/addition is config-only.
15+
ALLOWED_HOSTS = [h.strip() for h in os.environ.get("DJANGO_ALLOWED_HOST", "localhost").split(",") if h.strip()]
1416
CSRF_TRUSTED_ORIGINS = [f"https://{h}" for h in ALLOWED_HOSTS if h != "localhost"]
1517

1618
INSTALLED_APPS = [

billing-docker/template/docker/Caddyfile.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# No `tls` block: automatic HTTPS via Let's Encrypt is Caddy's default
44
# (an empty tls block does not even parse — proven on sso.weown.id 2026-07-22).
55

6+
# To serve additional aliases, list them space-separated on the site
7+
# line below (e.g. "{{ domain }} billing.weown.chat {") AND append them
8+
# comma-separated to DJANGO_ALLOWED_HOST in compose.
69
{{ domain }} {
710
reverse_proxy web:8000
811

0 commit comments

Comments
 (0)