This commit is contained in:
David Schroeder
2026-07-25 18:42:09 -05:00
parent 7a02c50aa9
commit ec57321577
11 changed files with 136 additions and 28 deletions
+8
View File
@@ -7,6 +7,7 @@ import (
"strconv"
"strings"
"time"
_ "time/tzdata"
)
type Config struct {
@@ -28,6 +29,7 @@ type Config struct {
MaxHostLimit int
MaxUploadBytes int64
TrustProxyHeaders bool
DisplayTimeZone *time.Location
}
func LoadConfig() (Config, error) {
@@ -82,6 +84,12 @@ func LoadConfig() (Config, error) {
if err != nil {
return cfg, fmt.Errorf("TAPM_TRUST_PROXY_HEADERS: %w", err)
}
cfg.DisplayTimeZone, err = time.LoadLocation(
envDefault("TAPM_DISPLAY_TIME_ZONE", "America/Chicago"),
)
if err != nil {
return cfg, fmt.Errorf("TAPM_DISPLAY_TIME_ZONE: %w", err)
}
cfg.AllowedGiteaUsers = make(map[string]struct{})
for _, user := range strings.Split(