From d793e16f336189d38a9d43310713dd13e3b7c438 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 7 Feb 2026 15:42:07 -1000 Subject: Add build version footer, deploy ldflags, template test helper, and logs script - Display build commit hash in unobtrusive footer overlay - Inject buildCommit/buildTime via ldflags in deploy.sh - Add assertTemplateContains test helper, refactor existing template tests - Add scripts/logs for fetching production journalctl via SSH Co-Authored-By: Claude Opus 4.6 --- internal/handlers/handlers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'internal/handlers/handlers.go') diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 650eeaa..226f117 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -29,10 +29,11 @@ type Handler struct { googleTasksClient api.GoogleTasksAPI config *config.Config renderer Renderer + BuildVersion string } // New creates a new Handler instance -func New(s *store.Store, todoist api.TodoistAPI, trello api.TrelloAPI, planToEat api.PlanToEatAPI, googleCalendar api.GoogleCalendarAPI, googleTasks api.GoogleTasksAPI, cfg *config.Config) *Handler { +func New(s *store.Store, todoist api.TodoistAPI, trello api.TrelloAPI, planToEat api.PlanToEatAPI, googleCalendar api.GoogleCalendarAPI, googleTasks api.GoogleTasksAPI, cfg *config.Config, buildVersion string) *Handler { // Template functions funcMap := template.FuncMap{ "subtract": func(a, b int) int { return a - b }, @@ -59,6 +60,7 @@ func New(s *store.Store, todoist api.TodoistAPI, trello api.TrelloAPI, planToEat googleTasksClient: googleTasks, config: cfg, renderer: NewTemplateRenderer(tmpl), + BuildVersion: buildVersion, } } @@ -96,11 +98,13 @@ func (h *Handler) HandleDashboard(w http.ResponseWriter, r *http.Request) { ActiveTab string CSRFToken string BackgroundURL string + BuildVersion string }{ DashboardData: dashboardData, ActiveTab: tab, CSRFToken: auth.GetCSRFTokenFromContext(ctx), BackgroundURL: backgroundURL, + BuildVersion: h.BuildVersion, } if err := h.renderer.Render(w, "index.html", data); err != nil { -- cgit v1.2.3