Skip to content

Commit

Permalink
Fix allowed_hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
aequitas committed Nov 21, 2024
1 parent db62d2d commit c48fa8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ services:
ports:
- 8001:8001
environment:
DEBUG: "False"
CTLSSA_SECRET_KEY: '1'
CTLSSA_DJANGO_DATABASE: production
CTLSSA_DB_ENGINE: postgresql_psycopg2
CTLSSA_DB_HOST: db
CTLSSA_CERTSTREAM_SERVER_URL: ws://certstream:4000
- DEBUG="False"
- CTLSSA_SECRET_KEY='1'
- CTLSSA_DJANGO_DATABASE=production
- CTLSSA_DB_ENGINE=postgresql_psycopg2
- CTLSSA_DB_HOST=db
- CTLSSA_CERTSTREAM_SERVER_URL=ws://certstream:4000
- CTLSSA_HOSTNAME
labels:
- "traefik.enable=true"
- "traefik.http.routers.ctlssa.rule='Host(`${CTLSSA_HOSTNAME}`) && PathPrefix(`/ctlssa`)"
- "traefik.http.routers.ctlssa.priority=20"
- "traefik.http.routers.ctlssa.rule=Host(`${CTLSSA_HOSTNAME}`) && PathPrefix(`/ctlssa`)"
- "traefik.http.routers.ctlssa.priority=30"
- "traefik.http.routers.ctlssa.entrypoints=websecure"

# uwsgi reloads on SIGTERM, so use SIGINT instead
Expand All @@ -44,7 +45,7 @@ services:
app-ingest:
condition: service_started
healthcheck:
test: curl --silent --fail http://127.0.0.1:8001
test: curl --silent http://127.0.0.1:8001/
interval: 5m
start_period: 30s
start_interval: 1s
Expand Down
4 changes: 2 additions & 2 deletions src/ctlssa/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get("DEBUG", "False").lower() == "true"

CTLSSA_HOSTNAME = os.environ.get("CTLSSA_HOSTNAME", "localhost:8001")
ALLOWED_HOSTS = os.environ.get("CTLSSA_ALLOWED_HOSTS", f"{CTLSSA_HOSTNAME}").split(",")
CTLSSA_HOSTNAME = os.environ.get("CTLSSA_HOSTNAME", "localhost")
ALLOWED_HOSTS = os.environ.get("CTLSSA_ALLOWED_HOSTS", f"{CTLSSA_HOSTNAME},127.0.0.1").split(",")


# Application definition
Expand Down

0 comments on commit c48fa8a

Please sign in to comment.