From aa967fbf69f8caaa1838c2c5883c0b5b7bf1720b Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Mon, 13 Jul 2026 09:37:05 +0200 Subject: [PATCH] =?UTF-8?q?controller:=20Felhom-offsite=20status=20card=20?= =?UTF-8?q?=E2=80=94=20three=20honest=20states=20from=20local=20data=20(op?= =?UTF-8?q?t-in=20pitch=20/=20Akt=C3=ADv-nincs-kijel=C3=B6lt=20/=20the=20r?= =?UTF-8?q?egular=20status=20block);=20display-only=20by=20design=20(decis?= =?UTF-8?q?ion=202:=20never=20a=20state=20change),=20state-tested=20incl.?= =?UTF-8?q?=20the=20no-form/no-button=20invariant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01GzammAMzsJTgpQHqxwM2bC --- controller/internal/web/backups_split_test.go | 53 +++++++++++++++++++ .../web/templates/backups_remote.html | 9 ++++ 2 files changed, 62 insertions(+) diff --git a/controller/internal/web/backups_split_test.go b/controller/internal/web/backups_split_test.go index e513238..b26fc15 100644 --- a/controller/internal/web/backups_split_test.go +++ b/controller/internal/web/backups_split_test.go @@ -85,6 +85,59 @@ func TestBackupsSplit_CrossPageAnchors(t *testing.T) { } } +// Felhom-offsite status card (v0.124.0, decision 2): three honest states, display-only — +// the card itself must never carry a form or button (no state change from the card, ever). +func TestBackupsRemote_OffsiteStatusCardStates(t *testing.T) { + cardOf := func(html string) string { + i := strings.Index(html, `id="felhom-offsite-card"`) + if i < 0 { + return "" + } + j := strings.Index(html[i:], "") + return html[i : i+j] + } + + // State 1: no target configured → the opt-in pitch (and no "Aktív" headline). + data := splitTestData() + data["OffboxConfigured"] = false + data["Offbox"] = nil + data["OffboxToggledCount"] = 0 + html := renderBackupPage(t, "backups_remote", data) + if !strings.Contains(html, "Felhom offsite tárhely — igényelhető szolgáltatás. Titkosított, házon kívüli másolat a mentéseidről. Érdeklődj az üzemeltetőnél.") { + t.Error("state 1: the opt-in pitch is missing") + } + if strings.Contains(html, "Aktív — nincs kijelölt alkalmazás") { + t.Error("state 1 must not render the state-2 headline") + } + if card := cardOf(html); strings.Contains(card, " +{{if not .OffboxConfigured}} +
Felhom offsite tárhely — igényelhető szolgáltatás. Titkosított, házon kívüli másolat a mentéseidről. Érdeklődj az üzemeltetőnél.
+{{else if eq .OffboxToggledCount 0}} +
Aktív — nincs kijelölt alkalmazás
+{{end}} +

Távoli mentés (3. mentés) — titkosított, offsite

Az alkalmazás-mentések titkosított másolata egy távoli tárolóra — saját NAS vagy Felhom offsite tárhely — restic + SFTP kapcsolaton. A tároló csak titkosított adatot lát. Ez a 3-2-1 szabály „1 off-site" lába — független a helyi másodpéldánytól és a teljes rendszermentéstől.