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 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 18:16:32 +01:00
parent 1a1ccd85ee
commit 2687506b08
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -1,6 +1,7 @@
package report package report
import ( import (
"fmt"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@@ -33,6 +34,11 @@ func BuildReport(
Timestamp: time.Now().UTC(), 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 // System info
staticInfo := metrics.GetStaticInfo() staticInfo := metrics.GetStaticInfo()
hddPath := cfg.Paths.HDDPath hddPath := cfg.Paths.HDDPath
+1
View File
@@ -8,6 +8,7 @@ type Report struct {
CustomerID string `json:"customer_id"` CustomerID string `json:"customer_id"`
CustomerName string `json:"customer_name"` CustomerName string `json:"customer_name"`
ControllerVersion string `json:"controller_version"` ControllerVersion string `json:"controller_version"`
ControllerURL string `json:"controller_url,omitempty"`
Timestamp time.Time `json:"timestamp"` Timestamp time.Time `json:"timestamp"`
ReportingDisabled bool `json:"reporting_disabled,omitempty"` ReportingDisabled bool `json:"reporting_disabled,omitempty"`
System SystemReport `json:"system"` System SystemReport `json:"system"`