mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-03-18 18:14:02 +00:00
Set timezone configuration via environment variable
This commit is contained in:
parent
8212446a72
commit
0df6a85bbc
@ -2,3 +2,6 @@
|
||||
# A missconfigured SERVER_ADDRESS will cause the app to have CSRF errors.
|
||||
SERVER_ADDRESS=my_server_address
|
||||
DEBUG_MODE=False
|
||||
|
||||
# Choose a timezone from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
TIMEZONE=America/Sao_Paulo
|
@ -9,6 +9,7 @@ services:
|
||||
- SERVER_ADDRESS=127.0.0.1
|
||||
- DEBUG_MODE=True
|
||||
- COMPOSE_VERSION=02r
|
||||
- TZ=${TIMEZONE}
|
||||
volumes:
|
||||
- wireguard:/etc/wireguard
|
||||
- static_volume:/app_static_files/
|
||||
@ -39,6 +40,8 @@ services:
|
||||
build:
|
||||
context: ./cron
|
||||
dockerfile: Dockerfile-cron
|
||||
environment:
|
||||
- TZ=${TIMEZONE}
|
||||
depends_on:
|
||||
- wireguard-webadmin
|
||||
|
||||
@ -51,6 +54,8 @@ services:
|
||||
volumes:
|
||||
- app_secrets:/app_secrets/
|
||||
- rrd_data:/rrd_data/
|
||||
environment:
|
||||
- TZ=${TIMEZONE}
|
||||
depends_on:
|
||||
- wireguard-webadmin
|
||||
|
||||
@ -60,6 +65,8 @@ services:
|
||||
build:
|
||||
context: ./containers/dnsmasq
|
||||
dockerfile: Dockerfile-dnsmasq
|
||||
environment:
|
||||
- TZ=${TIMEZONE}
|
||||
volumes:
|
||||
- dnsmasq_conf:/etc/dnsmasq/
|
||||
|
||||
|
@ -28,6 +28,11 @@ CSRF_TRUSTED_ORIGINS = ['http://wireguard-webadmin', 'https://$SERVER_ADDRESS']
|
||||
SECRET_KEY = '$(openssl rand -base64 32)'
|
||||
EOL
|
||||
|
||||
if [ -n "$TZ" ]; then
|
||||
echo "TIME_ZONE = '$TZ'" >> /app/wireguard_webadmin/production_settings.py
|
||||
fi
|
||||
|
||||
|
||||
sed -i "/^ path('admin\/', admin.site.urls),/s/^ / # /" /app/wireguard_webadmin/urls.py
|
||||
|
||||
exec "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user