Hub v0.149.0: a box the household switched off is not an outage for 14 days (R-998)
gates / gates (push) Successful in 6m40s

hosts.deliberate_off_at follows the agent's deliberate_off field (set, then cleared by the first
report of a new boot; one info event each way). While held, every silence alarm is held: host and
node staleness, the 05:00 backup deadlines, off-site and restore-test freshness, the OS alarms and
the kernel notice. After 14 days the usual alarms fire once, naming the power-off. Pages show
KIKAPCSOLVA and the time. Consequence tests with controls; each guard red-proofed.
This commit is contained in:
admin committed 2026-10-13 19:47:02 +02:00
1 parent ed59bf3cbd
commit 50e47e29af
24 files changed
+638 -17

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package osupdates
import (
"time"
"gitea.dooplex.hu/admin/felhom-hub/internal/store"
)
// notDeliberatelyOff drops the hosts the household switched off with „A gép kikapcsolása" (R-998, doc 14) while the
// 14-day hold lasts: a box that is off cannot run its OS leg, take a new agent or bundle, or restart for a kernel —
// alarming about it, or mailing „tonight your box restarts", would be noise. After the hold they count again.
func notDeliberatelyOff(st *store.Store, hosts []store.Host, now time.Time) []store.Host {
out := hosts[:0:0]
for _, h := range hosts {
if store.DeliberateOffHeld(st.HostDeliberateOffAt(h.HostID), now) {
continue
}
out = append(out, h)
}
return out
}
+1
View File
@@ -198,6 +198,7 @@ func (s *Service) KernelNotify() []string {
if err != nil {
return nil
}
hosts = notDeliberatelyOff(s.Store, hosts, now) // R-998: no „tonight your box restarts" mail to a box that is off
var told []string
for _, h := range hosts {
kver, _ := s.KernelDue(h.HostID)
+1
View File
@@ -1059,6 +1059,7 @@ func (s *Service) Alarms() ([]string, error) {
if err != nil {
return nil, err
}
hosts = notDeliberatelyOff(s.Store, hosts, now) // R-998: a switched-off box cannot update — held for the 14 days
var sent []string
for _, h := range hosts {
st := s.Store.GetOSHostSettings(h.HostID)