From 2687506b08b33d3e970d90156ccaa8a74814a58d Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 19 Feb 2026 18:16:32 +0100 Subject: [PATCH] feat: add controller_url to hub reports (v0.16.1) Controller now includes its external URL in periodic hub reports so the hub can trigger self-updates remotely via the /api/selfupdate/update endpoint. Co-Authored-By: Claude Sonnet 4.6 --- controller/internal/report/builder.go | 6 ++++++ controller/internal/report/types.go | 1 + 2 files changed, 7 insertions(+) diff --git a/controller/internal/report/builder.go b/controller/internal/report/builder.go index 064a63b..8428257 100644 --- a/controller/internal/report/builder.go +++ b/controller/internal/report/builder.go @@ -1,6 +1,7 @@ package report import ( + "fmt" "strconv" "strings" "time" @@ -33,6 +34,11 @@ func BuildReport( Timestamp: time.Now().UTC(), } + // Controller URL for hub callbacks (self-update trigger, etc.) + if cfg.Customer.Domain != "" { + r.ControllerURL = fmt.Sprintf("https://felhom.%s", cfg.Customer.Domain) + } + // System info staticInfo := metrics.GetStaticInfo() hddPath := cfg.Paths.HDDPath diff --git a/controller/internal/report/types.go b/controller/internal/report/types.go index 5ee9185..fd4d13c 100644 --- a/controller/internal/report/types.go +++ b/controller/internal/report/types.go @@ -8,6 +8,7 @@ type Report struct { CustomerID string `json:"customer_id"` CustomerName string `json:"customer_name"` ControllerVersion string `json:"controller_version"` + ControllerURL string `json:"controller_url,omitempty"` Timestamp time.Time `json:"timestamp"` ReportingDisabled bool `json:"reporting_disabled,omitempty"` System SystemReport `json:"system"`