feat: add timezone configuration support to server settings and Docker image
Build / Build and Push (push) Successful in 45s

This commit is contained in:
2026-06-05 19:57:27 +01:00
parent 07aa8e5ffe
commit 8308950637
4 changed files with 15 additions and 2 deletions
+10
View File
@@ -27,6 +27,7 @@ func getEnvInt(key string, defaultVal int) int {
type ServerConfig struct {
Port int `yaml:"port"`
ListenAddr string `yaml:"listen_addr"`
TimeZone string `yaml:"timezone"`
}
type DatabaseConfig struct {
@@ -95,5 +96,14 @@ func LoadConfig(path string) (*Config, error) {
cfg.Database.Port = 3306
}
if envTZ := os.Getenv("TZ"); envTZ != "" {
cfg.Server.TimeZone = envTZ
}
// Apply timezone if set
if cfg.Server.TimeZone != "" {
os.Setenv("TZ", cfg.Server.TimeZone)
}
return &cfg, nil
}