feat(shares): R-7b Parts 4-6 — shares restore, samba liveness, UI truth-up
Part 4 — restore: RestoreSharesScratch + PlaceSharesRestore as SIBLINGS of the
per-app scratch/place pair. Files merged missing-only (never overwriting), each
destination PREFIX-ASSERTED against registered LIVE storage roots; definitions
merged with existing-wins; ReconcileSamba via a seam (backup must not import
stacks); credential restored best-effort into the samba named volume.
New routes POST /backup/shares/{restore,place} + a restore-page entry that renders
'Megosztasok', never the raw reserved key.
Also adds scratchJoin: reconstructing an absolute captured path under a scratch
must strip the volume name rather than rely on filepath.Join.
Part 5 — liveness: EffectiveProtected gains a settings-backed dynamic extra so the
samba CONTAINER (not the stack name — they differ) is watched exactly while sharing
is on. FINDING: the issue -> health 'fail' -> existing health_critical event ->
alert -> Hungarian degradation e-mail path needs NO further change, and introduces
no new event type, so the allowlist gotcha does not apply.
Part 6 — UI: per-tier backup status lines on the Megosztas page (amber only on
deviation). Verified the two warning-prose sites (offbox_capture/tier2_capture)
only ever receive per-app stack names, so no mapping is needed there.
RED-PROOFS RUN AND REVERTED (both fired):
4. prefix-assert removed -> place-guard traversal test FAILS
5. dynamic samba extra removed -> Scenario E enabled-case FAILS
This commit is contained in:
@@ -102,6 +102,25 @@
|
||||
{{else}}
|
||||
<p class="form-hint">Nincs távoli mentésre jelölt alkalmazás — a kijelölés a <a href="/backups/remote">Távoli mentés</a> oldalon történik.</p>
|
||||
{{end}}
|
||||
|
||||
<!-- R-7b: the shares source. Not an app row — it has no per-app toggle and no recovery unit —
|
||||
so it is its own entry. The reserved `_shares` key never appears here; the label always
|
||||
comes from the display mapping. -->
|
||||
{{if .SharesRestoreOffered}}
|
||||
<div class="app-row-list" style="margin-top:1rem">
|
||||
{{template "app_list_row" dict "Slug" "" "Name" .SharesDisplayName}}
|
||||
<form method="POST" action="/backup/shares/restore" style="display:inline">{{$.CSRFField}}
|
||||
<button type="submit" class="btn btn-xs btn-outline">Megosztások visszaállítása</button>
|
||||
</form>
|
||||
{{if .SharesScratchReady}}
|
||||
<form method="POST" action="/backup/shares/place" style="display:inline">{{$.CSRFField}}
|
||||
<button type="submit" class="btn btn-xs btn-outline">Helyreállítás az élő adatok közé (csak a hiányzó fájlok)</button>
|
||||
</form>
|
||||
<span class="form-hint" style="display:block;margin-top:.25rem">A meglévő fájlokat nem írja felül. A már létező megosztás-beállítások változatlanok maradnak.</span>
|
||||
{{end}}
|
||||
{{template "app_list_row_end"}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
||||
@@ -127,6 +127,51 @@
|
||||
A megosztás törlésekor <strong>a mappa és a fájlok megmaradnak</strong> — csak a hálózati
|
||||
elérés szűnik meg.
|
||||
</div>
|
||||
|
||||
<div class="backup-section-card" style="margin-top:1rem">
|
||||
<h3>A megosztások mentése</h3>
|
||||
<p class="form-hint" style="margin:-0.25rem 0 0.75rem">
|
||||
A megosztott mappák a többi adattal együtt mentésre kerülnek. A „Felhőmentés” bekapcsolva
|
||||
azt jelenti, hogy a mappa a távoli tárhelyre is felkerül; kikapcsolva csak a második
|
||||
meghajtóra készül másolat.
|
||||
</p>
|
||||
<ul class="plain-list">
|
||||
<li>
|
||||
<strong>2. mentés (másik meghajtó):</strong>
|
||||
{{if .SharesTier2Status}}
|
||||
{{if eq .SharesTier2Status "ok"}}
|
||||
rendben{{if .SharesTier2LastRun}} — {{.SharesTier2LastRun}}{{end}}
|
||||
{{if .SharesTier2Warning}}<span class="badge badge-warn">{{.SharesTier2Warning}}</span>{{end}}
|
||||
{{else if eq .SharesTier2Status "no_target"}}
|
||||
<span class="badge badge-warn">nincs cél — {{.SharesTier2Error}}</span>
|
||||
{{else}}
|
||||
<span class="badge badge-warn">hiba — {{.SharesTier2Error}}</span>
|
||||
{{end}}
|
||||
{{else}}
|
||||
még nem futott
|
||||
{{end}}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Távoli mentés (felhő):</strong>
|
||||
{{if .SharesOffsiteStatus}}
|
||||
{{if eq .SharesOffsiteStatus "ok"}}
|
||||
rendben — {{.SharesOffsiteCount}} megosztás{{if .SharesOffsiteLastRun}}, {{.SharesOffsiteLastRun}}{{end}}
|
||||
{{else if eq .SharesOffsiteStatus "blocked"}}
|
||||
<span class="badge badge-warn">a tárhelykeret miatt csak a beállítások kerültek fel</span>
|
||||
{{else if eq .SharesOffsiteStatus "skipped"}}
|
||||
<span class="badge badge-warn">kimaradt</span>
|
||||
{{else}}
|
||||
<span class="badge badge-warn">hiba</span>
|
||||
{{end}}
|
||||
{{else}}
|
||||
még nem futott
|
||||
{{end}}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="form-hint">
|
||||
Visszaállítani a <a href="/backups/restore">Visszaállítás</a> oldalon lehet.
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="backup-table-empty">Még nincs megosztott mappa.</div>
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user