3 Commits

Author SHA1 Message Date
poduck
093f6d9a62 fix(traefik): Add env_file to read Cloudflare token
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:53:33 -05:00
poduck
5bf2fc5319 fix(traefik): Use Cloudflare DNS provider instead of DigitalOcean
DNS is hosted on Cloudflare, not DigitalOcean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:50:21 -05:00
poduck
33e4b6b9b5 feat(traefik): Add DNS challenge for wildcard SSL certificates
HostRegexp patterns don't work with HTTP challenge because Traefik
can't request certificates for dynamic subdomains. Switched to DNS
challenge using DigitalOcean provider for *.smoothschedule.com wildcard.

Requires DO_AUTH_TOKEN environment variable to be set.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:48:50 -05:00
2 changed files with 19 additions and 3 deletions

View File

@@ -28,6 +28,17 @@ certificatesResolvers:
httpChallenge:
entryPoint: web
letsencrypt-dns:
# DNS challenge for wildcard certificates (*.smoothschedule.com)
acme:
email: 'admin@smoothschedule.com'
storage: /etc/traefik/acme/acme.json
dnsChallenge:
provider: cloudflare
resolvers:
- "1.1.1.1:53"
- "8.8.8.8:53"
http:
routers:
# Main domain and www
@@ -86,7 +97,7 @@ http:
certResolver: letsencrypt
# Wildcard subdomain router for tenant subdomains
# Each subdomain gets its own certificate via HTTP challenge
# Uses DNS challenge for wildcard certificate (*.smoothschedule.com)
# Routes to nginx which serves the frontend SPA and proxies /api/ to Django
subdomain-router:
rule: 'HostRegexp(`{subdomain:[a-z0-9-]+}.smoothschedule.com`)'
@@ -96,7 +107,11 @@ http:
- csrf
service: nginx
tls:
certResolver: letsencrypt
certResolver: letsencrypt-dns
domains:
- main: "smoothschedule.com"
sans:
- "*.smoothschedule.com"
flower-secure-router:
rule: 'Host(`smoothschedule.com`)'

View File

@@ -40,11 +40,12 @@ services:
- django
volumes:
- production_traefik:/etc/traefik/acme
env_file:
- ./.envs/.production/.django
ports:
- '0.0.0.0:80:80'
- '0.0.0.0:443:443'
- '0.0.0.0:5555:5555'
- '0.0.0.0:5555:5555'
nginx:
build: