v0.314.0: a restore puts the setup gate back as it was (R-1057); a test build moves with the floor (R-1053); Prowlarr links itself (R-1058); the box claims Plex by address (R-1060)
gates / gates (push) Successful in 47s
gates / gates (push) Successful in 47s
MinAgent 0.155.0 (unchanged). Tests red-proved by mutation (A: 10, B: 7, C: 1, C2: 2). Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -781,6 +781,12 @@ func (m *Manager) upFromAppConfig(name string) error {
|
||||
// RedeployFromEnv itself is this function plus the unchanged up-and-report tail, so its public
|
||||
// behaviour is identical to before the split.
|
||||
func (m *Manager) PersistUnitRedeployConfig(name string, env map[string]string) error {
|
||||
return m.PersistUnitRedeployConfigGate(name, env, GateAtBackup{})
|
||||
}
|
||||
|
||||
// PersistUnitRedeployConfigGate is PersistUnitRedeployConfig with the setup gate the backup recorded (R-1057,
|
||||
// restore_gate.go): the restore puts the gate back as it was when the backup was taken.
|
||||
func (m *Manager) PersistUnitRedeployConfigGate(name string, env map[string]string, gate GateAtBackup) error {
|
||||
stack, ok := m.GetStack(name)
|
||||
if !ok {
|
||||
return fmt.Errorf("stack %q not found", name)
|
||||
@@ -804,6 +810,10 @@ func (m *Manager) PersistUnitRedeployConfig(name string, env map[string]string)
|
||||
cfg.RestoredLogins = restoredLoginFields(name, meta, prior, env)
|
||||
priorRaw := LoadAppConfig(stackDir)
|
||||
carryLifeRecords(m.logger, name, priorRaw, cfg)
|
||||
reopen, err := m.applyGateAtBackup(name, stack.ComposePath, env, &meta, cfg, priorRaw == nil, gate)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// R-773: a REMOVED app has no app.yaml left, so nothing carries its sign-up lock (decision 47) and the restore
|
||||
// used to bring it back with sign-up open (measured on 9202: Karakeep's /signup 403 before, 200 after remove +
|
||||
// restore). The restored data comes back with its admin, so the restore applies what a fresh install gets after
|
||||
@@ -818,7 +828,7 @@ func (m *Manager) PersistUnitRedeployConfig(name string, env map[string]string)
|
||||
}
|
||||
cfg.FamilyGate = rec
|
||||
}
|
||||
if priorRaw == nil && cfg.SetupGate == nil {
|
||||
if (priorRaw == nil || reopen) && cfg.SetupGate == nil {
|
||||
rec, err := m.restoreSignupLock(name, stack.ComposePath, env, &meta)
|
||||
if err != nil {
|
||||
return fmt.Errorf("the sign-up lock could not be prepared (the app was not started): %w", err)
|
||||
|
||||
Reference in New Issue
Block a user