Repository navigation
Conversation
When silo backup restore --accept-lost-credentials replaced the live database with a backup taken under another SECRET_KEY, the "enter them again" line still listed encrypted server-specific settings the live server doesn't have, such as notifications.web_push.vapid_keypair on a server that never used web push. The operator can't enter that, Silo generates it on first use, and the backup's value would never have survived: CarryServerSpecificSettings gives the restored database the live server's server-specific settings and deletes the backup's others. On a replace, clearLostSettings now leaves out every setting carriedServerSpecific covers, which takes in the live server's own settings it already left out. A separate restore is unchanged. Closes Silo-Server#5249 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Quick104
left a comment
There was a problem hiding this comment.
Review of 3eab901. The change is correct; one trade-off is left for the maintainers (inline) and one comment nit.
Nit, not on a changed line: the comments on postLoad.liveOwn (internal/backup/restore.go, around line 313) and above the ServerSpecificSettingKeys call in swap.go (around line 186) still describe liveOwn as what keeps settings out of the lost list. The lost-settings pass no longer reads it. It now only decides which cleared outbound units are reported as kept.
🤖 Claude Code (claude-opus-5-5)
| } | ||
| keys = slices.DeleteFunc(keys, func(k string) bool { return slices.Contains(liveOwn, k) }) | ||
| if replace { | ||
| keys = slices.DeleteFunc(keys, carriedServerSpecific) |
There was a problem hiding this comment.
Maintainer decision (low): AI providers that no job uses. The PR relies on the outbound line ("... enter them again to use them: AI providers") to cover ai.providers. That line fires only when some AI setting survives ClearUnreadableSettings, usually a plaintext job binding. A provider that was connected but never selected for a job (the create endpoint says "Nothing uses it until a job selects it") lives only in ai.providers.
Trigger: a replace with another SECRET_KEY onto a server without AI providers, from a backup whose providers no job uses. ClearUnreadableSettings deletes the registry before CarryOutboundSettings checks for surviving secrets, so the AI unit isn't reported there, and this filter now drops ai.providers from the cannot-read line.
Impact: neither line mentions the backup's AI providers. The restored server loses them either way, since the carry gives it the live server's (empty) registry. Only the hint is gone, and only for a provider no job used.
Options: accept it, as #5249 weighed; or, in a follow-up, have the outbound report also name a unit whose secrets the unreadable-settings pass cleared. Left for the maintainers; no change needed from the author.
There was a problem hiding this comment.
Author's view, for whoever decides: I'd accept it for this PR. The restored server loses those providers either way, and only the hint is missing, only for a provider no job used. Naming a unit whose secrets the unreadable-settings pass cleared fits better as its own change to the outbound report. I can open that follow-up if you want it.
|
Review of 58ac1cf (earlier: 3eab901) The fix is correct and does what the PR says. On a replace, every key Since the last review I merged main into the branch, because main's #5475 changed the outbound report this PR relies on for AI providers. #5475 narrows the open trade-off below: when the backup leaves a legacy AI endpoint behind, the outbound line now names "AI providers". I also fixed the backups architecture doc and one test comment that still described the old rule (58ac1cf). Verification
Addressed
Remaining for the maintainers
Validated features: no passed case on the v1.0 board touches backup or restore. User manual: the restore page's "If the backup came from another server or key" section says the command lists cleared settings "such as storage, plugin, or email server credentials". A full restore never lists storage credentials, which are this server's own. A siloserver.org issue should adjust that example on Other clients: none. The change is Council
In round 2, Gemini flagged the doc drift, fixed in 58ac1cf, and the separate-restore case, filed as #5675. Sol and Gemini both found the AI reset problem described above, and a run on main confirmed it predates this PR. Opus found nothing blocking: it called the ChatGPT, push relay and search keys part of the same trade-off, and noted a redundant Fit: 9/10 · Readiness: 8/10 — conditional (one maintainer decision)
🤖 Claude Code (claude-opus-5-5) |
The lost-settings pass no longer reads liveOwn. It only decides which cleared outbound units are reported as kept (review on Silo-Server#5473). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The comment nit is fixed in c2fe6f0. The comments on |
The backups architecture doc and the comment on TestSwapReportsOnlyWhatTheRestoredServerLacks still described the old rule, where only the settings the live server supplies stayed off the list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Quick104
left a comment
There was a problem hiding this comment.
Review of eb9f6ef (c2fe6f0 with main merged in). The code change is still correct. Two findings, both fixed or tracked; details below and in the summary comment.
- Doc drift (low, fixed in 58ac1cf).
docs/architecture/backups.mdstill said a replace leaves off the lost list only the server-specific settings the live server supplies (ServerSpecificSettingKeys). After this PR it leaves off every onecarriedServerSpecificmatches, andServerSpecificSettingKeysonly decides which cleared outbound units are reported as kept. The comment onTestSwapReportsOnlyWhatTheRestoredServerLackssaid the same. I fixed both in a commit on this branch, so there's no need to change them yourself. - Separate restore still lists the web push key pair (low, predates this PR).
restore --intopassesreplace=false, so a cross-key separate restore still says to enternotifications.web_push.vapid_keypairagain, which Silo generates on first use. The fix would change the lines this PR changes, so it's filed as #5675 to follow this PR. Nothing to change here.
🤖 Claude Code (claude-opus-5-5)
Depends on: none. Merge order: none. Follows #5199 (merged), which added the live server's own settings to this check.
Problem
Closes #5249
Related issue: #5199
Validation tasks: none
Other clients: none.
silo backup restoreoutput only.When
silo backup restore --accept-lost-credentialsreplaced the live database with a backup taken under anotherSECRET_KEY, the "cannot read" line still listed encrypted server-specific settings the live server doesn't have:The operator can't enter a web push key pair; Silo generates one on first use (
WebPushService.vapidKeys). And the backup's value would never have survived anyway.CarryServerSpecificSettingsgives the restored database the live server's server-specific settings and deletes the backup's ones the live server lacks.clearLostSettings(internal/backup/restore.go) left out only the ones the live server holds (liveOwn).Approach
clearLostSettingstakes whether the restore is a replace. On a replace it leaves out every settingcarriedServerSpecificcovers: those are the live server's value or none, whichever key the backup used. This takes in theliveOwnkeys it already left out;liveOwnis still used for the outbound line.restore --into) keeps the backup's server-specific settings and is unchanged.ai.providersis no longer named. That matches a replace with the same key, which reports nothing for it either, since the carry deletes the backup's list. Units that still need re-entry are named by the outbound line ("enter them again to use them").Validation
TestSwapListsNoServerSpecificSettingAsLost(swap_test.go): a replace onto a server with no server-specific settings, where the key can't readai.providers,notifications.web_push.vapid_keypairandtmdb.api_key, lists onlytmdb.api_key. Onmainit fails with all three listed; with this change it passes. The existingTestSwapReportsOnlyWhatTheRestoredServerLacksstill passes.go test ./internal/backup/ -run 'Swap|Restore|Lost|Carry': pass.go vet: clean.golangci-linton the changed package (pre-commit): 0 issues.RestoreSwapthroughPGLoader) of a backup taken under one key, holding encryptedai.providers, the web push key pair andtmdb.api_key, onto a live database under another key that has none of them. Base printsCleared 3 ... ai.providers, notifications.web_push.vapid_keypair, tmdb.api_key. This branch printsCleared 1 ... tmdb.api_key. In both, the restored database holds none of the three. That scratch test was not committed.docs/architecture/backups.mdnow states the new rule (review commit).Evidence
Evidence: not needed. No visible change in the apps; the change is a line of
silo backup restoreoutput, shown by the test.On
main(0a631fb), with the new test:With this PR the line reads
Cleared 1 encrypted settings this SECRET_KEY cannot read; enter them again after Silo starts: tmdb.api_key, and:Risks
ai.providersnamed in this line. The restored server has none either way, as described above.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Omit server-specific settings from replace-restore lost list
clearLostSettingsin restore.go now takes a replace flag and filters these keys viacarriedServerSpecific. The restored database gets the live server's value, or no value if the live server has none.truefor this flag in swap.go; separate restores passfalseand still list unreadable settings for re-entry.TestSwapListsNoServerSpecificSettingAsLostand updates the backup architecture doc in backups.md.falseargument inRestoreSeparatein restore.go.Macroscope summarized 58ac1cf.