feat: Add TZ env variable for settting container timezone

This commit is contained in:
Carlos Álvaro
2021-12-19 19:52:54 +01:00
parent 28724ede49
commit 8a908ed6fb
4 changed files with 11 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ for the list of changes in SaltStack.
- Deprecate `USERMAP_UID` env variable in favor of `PUID`.
- Deprecate `USERMAP_GID` env variable in favor of `PGID`.
- Add `TZ` in addition to `TIMEZONE` to the list of accepted env variables.
Support for the `USERMAP_UID` and `USERMAP_GID` env variables will be removed with Salt 3005.

View File

@@ -509,7 +509,7 @@ Below you can find a list with the available options that can be used to customi
| Parameter | Description |
| :------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DEBUG` | Set this to `true` to enable entrypoint debugging. |
| `TIMEZONE` | Set the container timezone. Defaults to `UTC`. Values are expected to be in Canonical format. Example: `Europe/Madrid`. See the list of [acceptable values](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). |
| `TIMEZONE` / `TZ` | Set the container timezone. Defaults to `UTC`. Values are expected to be in Canonical format. Example: `Europe/Madrid`. See the list of [acceptable values](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). |
| `SALT_RESTART_MASTER_ON_CONFIG_CHANGE` | Set this to `true` to restart `salt-master` service when configuration files change. Default: `false` |
| `SALT_LOG_LEVEL` | The level of messages to send to the console. One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'. Default: `warning` |
| `SALT_LOG_ROTATE_FREQUENCY` | Logrotate frequency for salt logs. Available options are 'daily', 'weekly', 'monthly', and 'yearly'. Default: `weekly` |

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
DEBUG=${DEBUG:-false}
TIMEZONE=${TIMEZONE:-UTC}
TIMEZONE=${TIMEZONE:-${TZ:-UTC}}
SALT_API_SERVICE_ENABLED=${SALT_API_SERVICE_ENABLED:-false}
SALT_API_USER=${SALT_API_USER:-salt_api}

View File

@@ -18,12 +18,12 @@ services:
test: ["CMD", "/usr/local/sbin/healthcheck"]
start_period: 30s
environment:
- DEBUG=false
- TIMEZONE=Europe/Madrid
- PUID=1000
- PGID=1000
- SALT_LOG_LEVEL=info
DEBUG: 'false'
TZ: Europe/Madrid
PUID: 1000
PGID: 1000
SALT_LOG_LEVEL: info
### salt-api settings
# - SALT_API_SERVICE_ENABLED=true
# - SALT_API_USER=salt_api
# - SALT_API_USER_PASS=4wesome-Pass0rd
# SALT_API_SERVICE_ENABLED: 'true'
# SALT_API_USER: salt_api
# SALT_API_USER_PASS: 4wesome-Pass0rd