Skip to content

Commit

Permalink
feat: IP mask from env
Browse files Browse the repository at this point in the history
  • Loading branch information
not7cd committed Jul 10, 2024
1 parent 3d0fedd commit d3f310a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
environment:
# you should change secret key
- SECRET_KEY=example123
- APP_IP_MASK=172.18.0.1
- APP_DB_DIALECT=postgresql
- APP_DB_NAME=whohacks
- APP_DB_USER=whohacks
Expand All @@ -19,11 +20,14 @@ services:
ports:
# use 127.0.0.1:8000:8000
- "8000:8000"
# network_mode: "host"
volumes:
- sqlite:/data
- /etc/localtime:/etc/localtime:ro
depends_on:
- postgres
networks:
- default

postgres:
image: postgres:latest
Expand All @@ -36,6 +40,9 @@ services:
- POSTGRES_PASSWORD=S3cret
- POSTGRES_USER=whohacks
- POSTGRES_DB=whohacks
networks:
- default

mock-oauth2-server:
image: ghcr.io/navikt/mock-oauth2-server:2.1.8
hostname: oauth.localhost
Expand All @@ -52,6 +59,8 @@ services:
SERVER_PORT: 8080
# SERVER_HOSTNAME: localhost
JSON_CONFIG_PATH: /app/config.json
networks:
- default

volumes:
sqlite:
Expand Down
5 changes: 2 additions & 3 deletions whois/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@
APP_OAUTH_OPENID = os.environ.get("APP_OAUTH_OPENID")

# production
ip_mask = "192.168.88.1-255"
# TODO: better way for handling dev env
# ip_mask = "127.0.0.1"
# ip_mask = "192.168.88.1-255"
ip_mask = os.environ.get("APP_IP_MASK")

0 comments on commit d3f310a

Please sign in to comment.