From 07dff496eccaf2136c3642ab7f0d9d5f40d39447 Mon Sep 17 00:00:00 2001 From: Aevum Decessus Date: Mon, 11 May 2026 09:29:46 -0400 Subject: [PATCH] Embed IANA timezone database in the binary The dashboard schedule view renders current hour and weekday using time.Now() in the process's local timezone. On minimal container base images (debian:bookworm-slim, distroless, scratch) the IANA zoneinfo files are not present, so Go's runtime falls back to UTC regardless of what the TZ environment variable says. The result is a UTC schedule grid for users in any other zone, and notification timestamps formatted in UTC at serve.go:1006. Importing time/tzdata embeds the IANA zone database into the binary at link time, so the runtime can resolve any zone name without filesystem zoneinfo. Users still need to set TZ in their environment (e.g. TZ=America/New_York) for the binary to know which zone, but with this import the lookup succeeds regardless of base image. Binary size impact is approximately 400 KB on a 22 MB starting binary (about 2%). Native go install users benefit identically to docker users. Verified locally: TZ=America/New_York with the embedded tzdata renders 9:29 EDT for the current moment vs 13:29 UTC, exactly as expected. --- cmd/anantha/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/anantha/main.go b/cmd/anantha/main.go index 3d74895..bceaea9 100644 --- a/cmd/anantha/main.go +++ b/cmd/anantha/main.go @@ -1,6 +1,10 @@ package main -import "github.com/anupcshan/anantha/cmd/anantha/cmd" +import ( + _ "time/tzdata" + + "github.com/anupcshan/anantha/cmd/anantha/cmd" +) func main() { cmd.Execute()