controller (unreleased): the report carries the web certificate's end date (felhom.eu R-1379, D77)
gates / gates (push) Successful in 34s
gates / gates (push) Successful in 34s
Names and end dates only, read from Traefik's store; no key material leaves the box. Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
fdc0e29400
commit
7daf3d24a7
6 files changed
+362
-1
No files matched your search
@@ -6,10 +6,12 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/backup"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/config"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/infra"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/metrics"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/monitor"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/scheduler"
|
||||
@@ -200,6 +202,8 @@ func BuildReport(
|
||||
r.Offsite = backupMgr.OffboxReportStatus()
|
||||
}
|
||||
|
||||
r.WebCerts = webCertsForReport(cfg.Paths.StacksDir, logger) // R-1379: the web certificate's end date
|
||||
|
||||
if debug && logger != nil {
|
||||
logger.Printf("[DEBUG] [report] BuildReport: complete — containers=%d, health=%s, deployed=%d, available=%d, app_telemetry=%d",
|
||||
r.Containers.Total, r.Health.Status, len(r.Stacks.Deployed), len(r.Stacks.Available), len(r.AppTelemetry))
|
||||
@@ -339,3 +343,19 @@ func rootStorageEntry(sysInfo system.SystemInfo) StorageReport {
|
||||
ReadFailed: !sysInfo.DiskKnown,
|
||||
}
|
||||
}
|
||||
|
||||
// webCertsForReport reads the end dates of the box's web certificates for the report (felhom.eu R-1379). A store that
|
||||
// cannot be read is a WARN line and an absent field — never a failed report, and never the store's content in a log.
|
||||
func webCertsForReport(stacksDir string, logger *log.Logger) []infra.WebCert {
|
||||
if stacksDir == "" {
|
||||
return nil
|
||||
}
|
||||
certs, err := infra.ReadWebCerts(filepath.Join(stacksDir, "traefik", infra.ACMEStoreFile))
|
||||
if err != nil {
|
||||
if logger != nil {
|
||||
logger.Printf("[WARN] [report] web certificate end date not read: %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return certs
|
||||
}
|
||||
Reference in new issue
Block a user