Skip to content

Commit

Permalink
Merge pull request #11 from internetstandards/docker
Browse files Browse the repository at this point in the history
Fix allowed_hosts
  • Loading branch information
aequitas authored Nov 21, 2024
2 parents e86484c + 876a6ca commit 6a8c38c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
38 changes: 17 additions & 21 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@ 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
labels:
- "traefik.enable=true"
- "traefik.http.routers.ctlssa.rule='Host(`${CTLSSA_HOSTNAME}`) && PathPrefix(`/ctlssa`)"
- "traefik.http.routers.ctlssa.priority=20"
- "traefik.http.routers.ctlssa.entrypoints=websecure"
- DEBUG="False"
- CTLSSA_SECRET_KEY
- CTLSSA_DJANGO_DATABASE=production
- CTLSSA_DB_ENGINE=postgresql_psycopg2
- CTLSSA_DB_HOST=db
- CTLSSA_CERTSTREAM_SERVER_URL=ws://certstream:4000
- CTLSSA_HOSTNAMES

# uwsgi reloads on SIGTERM, so use SIGINT instead
# https://uwsgi-docs.readthedocs.io/en/latest/Management.html#signals-for-controlling-uwsgi
Expand All @@ -54,12 +50,12 @@ services:
develop: *app_develop
image: ghcr.io/internetstandards/ctlssa:latest
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
- CTLSSA_DJANGO_DATABASE=production
- CTLSSA_DB_ENGINE=postgresql_psycopg2
- CTLSSA_DB_HOST=db
- CTLSSA_CERTSTREAM_SERVER_URL=ws://certstream:4000
entrypoint: ctlssa
command: ingest
restart: always
Expand Down Expand Up @@ -125,10 +121,10 @@ services:
build:
target: dev
environment:
CTLSSA_SECRET_KEY: '1'
CTLSSA_DJANGO_DATABASE: production
CTLSSA_DB_ENGINE: postgresql_psycopg2
CTLSSA_DB_HOST: db
- CTLSSA_SECRET_KEY=1
- CTLSSA_DJANGO_DATABASE=production
- CTLSSA_DB_ENGINE=postgresql_psycopg2
- CTLSSA_DB_HOST=db
volumes:
- .:/src
- ./.root:/root
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_HOSTNAMES = os.environ.get("CTLSSA_HOSTNAMES", "localhost")
ALLOWED_HOSTS = os.environ.get("CTLSSA_ALLOWED_HOSTS", f"{CTLSSA_HOSTNAMES},127.0.0.1").split(",")


# Application definition
Expand Down

0 comments on commit 6a8c38c

Please sign in to comment.