Use TZ environment variable if present; closes pterodactyl/panel#3036

This commit is contained in:
Dane Everitt 2021-01-26 20:36:46 -08:00
parent bc79ce540e
commit aca9ffc122
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -568,6 +568,10 @@ func (sc *SystemConfiguration) GetStatesPath() string {
// //
// This function IS NOT thread-safe. // This function IS NOT thread-safe.
func ConfigureTimezone() error { func ConfigureTimezone() error {
tz := os.Getenv("TZ")
if _config.System.Timezone == "" && tz != "" {
_config.System.Timezone = tz
}
if _config.System.Timezone == "" { if _config.System.Timezone == "" {
b, err := ioutil.ReadFile("/etc/timezone") b, err := ioutil.ReadFile("/etc/timezone")
if err != nil { if err != nil {