fix(R-1218, R-1219): stage the off-site password when its file exists; no recovery ceremony during a recovery offer
R-1218: escrowStart stages when OffboxRepoPasswordOnBox() (not OffboxConfigured()). R-1219: the top bar hides during an offer; the start handler answers 409 (api.escrow.recovery_offer_open, hu+en) before staging. Red-proved. Commit only.
This commit is contained in:
@@ -714,6 +714,14 @@ func (m *Manager) OffboxConfigured() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// OffboxRepoPasswordOnBox reports whether the off-site repository password FILE is on the box — whatever the target's
|
||||
// state. R-1218: ClearOffboxTarget keeps that file on purpose, and a switched-off target keeps it too, so a recovery
|
||||
// ceremony run then must still seal it; OffboxConfigured() is the wrong question for „is there a key to escrow".
|
||||
func (m *Manager) OffboxRepoPasswordOnBox() bool {
|
||||
_, err := os.Stat(m.offboxPwPath())
|
||||
return err == nil
|
||||
}
|
||||
|
||||
// offboxRepoPwPattern matches a valid restic repo password (generateOffboxPassword = 32 rand bytes → 64 hex).
|
||||
var offboxRepoPwPattern = regexp.MustCompile(`^[0-9a-fA-F]{64}$`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user