The off-site copies of a removed app end 30 days after „delete backup data” — the box's half (felhom.eu R-1374 part 1; D72, D84)
gates / gates (push) Successful in 41s

Built, not released; no box has run it. felhom.eu `07-backup-architecture.md` §8.2f.
It does nothing without a hub that knows it: an older hub agrees to no id.

- The record: settings `offsite_ends` {app, removed_at, ends_at}. One writer
  (backup.StartOffsiteEnd), called by a removal only with „delete backup data”
  and by „Törlés 30 nap múlva” on the restore page. A second press changes
  nothing. No record, no deletion. Only on the hub-provisioned tier.
- The date is on the remove dialog before the press; the restore page shows
  „Törlésre kijelölve …” with „Mégis megtartom”, and one history line per
  carried-out end. An install of the same app deletes the record.
- The weekly window: after the guard has passed the policy's plan under the cap
  as before, it adds the snapshots whose app tags are ALL due records, that the
  hub agreed to and the box named in the same request; the result names them
  apart (removed_for_ended_apps). `_shares`, the box's own stacks and an
  installed app are never due.
- The report carries the pending records; the household gets one mail per
  press (offsite_end_scheduled), in both languages.

MinAgent unchanged (0.158.1). 143 parity fixtures gained the dialog's one new
script line (patched, not regenerated); one new parity case.
Tests TestD72_*, TestD84_*; 56 mutations seen red
(felhom.eu documentation/audits/build-release-4-2026-11-15/A/redproof-ctrl-*.txt).

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-15 14:09:47 +01:00
1 parent 591195fadd
commit f628cb5082
177 files changed
+3705 -164

No files matched your search

+18
View File
@@ -16,6 +16,7 @@ import (
"gitea.dooplex.hu/admin/felhom-controller/internal/backup"
cf "gitea.dooplex.hu/admin/felhom-controller/internal/cloudflare"
"gitea.dooplex.hu/admin/felhom-controller/internal/config"
"gitea.dooplex.hu/admin/felhom-controller/internal/i18n"
"gitea.dooplex.hu/admin/felhom-controller/internal/integrations"
"gitea.dooplex.hu/admin/felhom-controller/internal/metrics"
"gitea.dooplex.hu/admin/felhom-controller/internal/notify"
@@ -963,6 +964,10 @@ func (r *Router) getStackBackupData(w http.ResponseWriter, req *http.Request, na
writeJSON(w, http.StatusNotFound, apiResponse{OK: false, Error: r.errText(req, err)})
return
}
// D72: the date is on the dialog BEFORE the press. Only where a press would start the 30 days.
if r.backupMgr != nil && r.backupMgr.OffsiteEndOffered() {
resp.OffsiteEndDate = i18n.FormatDate(r.langFor(req), r.backupMgr.OffsiteEndDateIfPressedNow().Local())
}
writeJSON(w, http.StatusOK, apiResponse{OK: true, Data: resp})
}
@@ -1101,6 +1106,19 @@ func (r *Router) removeStack(w http.ResponseWriter, req *http.Request, name stri
if body.RemoveBackups {
resp.BackupPathsRemoved = append(resp.BackupPathsRemoved, r.removeVerificationCopy(name)...)
}
// D72 / D84 (`07` §8.2f): „delete backup data” deletes the LOCAL backups now (above) and starts the 30 days of
// the app's OFF-SITE copies: the end record, and the household's one mail. Never on a removal that kept the
// backups; never on a box without the hub-provisioned tier (nothing would carry the deletion out).
if body.RemoveBackups && r.backupMgr != nil {
switch rec, created, serr := r.backupMgr.StartOffsiteEnd(name); {
case errors.Is(serr, backup.ErrOffsiteEndNotOffered):
r.dbg("removeStack: %s: no hub-provisioned off-site tier — no off-site end record", name)
case serr != nil:
r.logger.Printf("[WARN] [api] remove %s: its off-site end record was NOT written (%v) — its off-site copies stay; the Backups page offers „delete in 30 days”", name, serr)
case created:
r.logger.Printf("[INFO] [api] remove %s: its off-site copies end %s (D72)", name, rec.EndsAt)
}
}
// R-486 (v0.240.0): the app's backup preferences — and with them the Tier-2 RECORD that
// tier2RecordedCopyDir needs — are forgotten ONLY when the customer asked for the backups to be