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:
@@ -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
|
||||||
|
|||||||
@@ -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"`
|
||||||
|
|||||||
Reference in New Issue
Block a user