From 276be5a88e661bd3e7b8891a4fcddeb717f38382 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 19 Feb 2026 18:29:41 +0100 Subject: [PATCH] docs: update CHANGELOG.md and CONTEXT.md for v0.16.1 + hub v0.1.8 Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 21 +++++++++++++++++++++ CONTEXT.md | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f2d26b..e332705 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ ## Changelog +### What was just completed (2026-02-19 session 59) +- **v0.16.1 + hub v0.1.8 — Hub Update Trigger + Controller URL Reporting:** + + Controller now includes its external URL (`controller_url`) in periodic hub reports so the hub can trigger self-updates remotely. Hub tracks the URL in a new `controller_url` DB column, checks the Gitea registry for the latest controller image version (VersionChecker goroutine, `web/version.go`), and shows a "Controller Update" card on the customer detail page. + + **Controller (v0.16.1):** + - `internal/report/types.go`: Added `ControllerURL string` field to Report struct. + - `internal/report/builder.go`: Sets `ControllerURL` from `cfg.Customer.Domain` → `https://felhom.`. + - `internal/api/router.go`: **Bug fix** — moved selfupdate routes to before `hasSuffix(path, "/update")` stack case (which was catching `/selfupdate/update` first). + + **Hub (v0.1.8):** + - `cmd/hub/main.go`: Added `Registry` config section + defaults; creates `VersionChecker` goroutine if credentials configured; passes `apiKey` to `web.New()`. + - `internal/store/store.go`: Added `ControllerURL` to `CustomerSummary`; idempotent `ALTER TABLE reports ADD COLUMN controller_url TEXT` migration; updated `SaveReport`, `GetCustomers`, `GetCustomer`, `GetCustomerHistory` queries. + - `internal/web/version.go` (NEW): `VersionChecker` type — polls Gitea Docker Registry V2 API (`/v2///tags/list`) every 6h; parses semver tags; stores latest version thread-safely. + - `internal/web/server.go`: Added `apiKey`, `versionChecker` fields; updated `New()` signature; added `SetVersionChecker()`; added `handleTriggerUpdate` handler that proxies POST to controller's `/api/selfupdate/update`; added trigger-update route (before `/customers/` catch-all); updated `handleCustomerDetail` with `ControllerURL`, `LatestVersion`, `UpdateAvailable` template data; added `compareVersions` helper. + - `internal/web/templates/customer.html`: New "Controller Update" section between Health and Notifications — shows current/latest version with update indicator, controller URL link, and conditional "Trigger Update" button with JS. + - `internal/api/handler.go`: Added `ControllerURL` to `/api/v1/customers` JSON response. + - Hub config (`hub.yaml`): Added `registry:` section with Gitea admin credentials. + + **Files modified/created:** controller: 3 files; hub: 5 modified + 1 created (version.go). + ### What was just completed (2026-02-19 session 58) - **v0.16.0 — Controller Self-Update:** diff --git a/CONTEXT.md b/CONTEXT.md index 4d7c8ef..157a575 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -7,7 +7,7 @@ > > Ask Claude Code: "Please update CONTEXT.md with what we did today" -Last updated: 2026-02-19 (session 54) +Last updated: 2026-02-19 (session 59) --- @@ -20,7 +20,7 @@ Last updated: 2026-02-19 (session 54) - Customer deployments use Docker Compose (not Kubernetes) for simplicity ### felhom-controller (this repo) -- **Version:** v0.15.4 +- **Version:** v0.16.1 - **Phase 1:** ✅ COMPLETE — Stack Manager + Deploy Flow - **Phase 2:** ✅ COMPLETE — Monitoring & Health (scheduler, CPU/temp, healthchecks.io pings) - **Phase 3:** ✅ COMPLETE — Backups (DB dumps, restic integration, manual trigger, **dedicated backup page**)