mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-04-19 00:45:16 +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.
|
# A missconfigured SERVER_ADDRESS will cause the app to have CSRF errors.
|
||||||
SERVER_ADDRESS=my_server_address
|
SERVER_ADDRESS=my_server_address
|
||||||
DEBUG_MODE=False
|
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
|
- SERVER_ADDRESS=127.0.0.1
|
||||||
- DEBUG_MODE=True
|
- DEBUG_MODE=True
|
||||||
- COMPOSE_VERSION=02r
|
- COMPOSE_VERSION=02r
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
volumes:
|
volumes:
|
||||||
- wireguard:/etc/wireguard
|
- wireguard:/etc/wireguard
|
||||||
- static_volume:/app_static_files/
|
- static_volume:/app_static_files/
|
||||||
@ -39,6 +40,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./cron
|
context: ./cron
|
||||||
dockerfile: Dockerfile-cron
|
dockerfile: Dockerfile-cron
|
||||||
|
environment:
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
depends_on:
|
depends_on:
|
||||||
- wireguard-webadmin
|
- wireguard-webadmin
|
||||||
|
|
||||||
@ -51,6 +54,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- app_secrets:/app_secrets/
|
- app_secrets:/app_secrets/
|
||||||
- rrd_data:/rrd_data/
|
- rrd_data:/rrd_data/
|
||||||
|
environment:
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
depends_on:
|
depends_on:
|
||||||
- wireguard-webadmin
|
- wireguard-webadmin
|
||||||
|
|
||||||
@ -60,6 +65,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./containers/dnsmasq
|
context: ./containers/dnsmasq
|
||||||
dockerfile: Dockerfile-dnsmasq
|
dockerfile: Dockerfile-dnsmasq
|
||||||
|
environment:
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
volumes:
|
volumes:
|
||||||
- dnsmasq_conf:/etc/dnsmasq/
|
- dnsmasq_conf:/etc/dnsmasq/
|
||||||
|
|
||||||
|
@ -28,6 +28,11 @@ CSRF_TRUSTED_ORIGINS = ['http://wireguard-webadmin', 'https://$SERVER_ADDRESS']
|
|||||||
SECRET_KEY = '$(openssl rand -base64 32)'
|
SECRET_KEY = '$(openssl rand -base64 32)'
|
||||||
EOL
|
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
|
sed -i "/^ path('admin\/', admin.site.urls),/s/^ / # /" /app/wireguard_webadmin/urls.py
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user