Repository navigation
fix(start-os): keep the SMTP password out of the public database - #4892
Conversation
serverInfo.smtp carried the SMTP password, and the public database is streamed to every authenticated browser and, since #4752, persisted in each browser's IndexedDB. The full SMTP settings now live in private.smtp; serverInfo.smtp holds the same settings with a passwordSet flag instead of the password. - server.set-smtp takes keepPassword, which retains the saved password when none is given. Without it the behavior is unchanged. - server.test-smtp takes an optional password; omitted, it uses the saved password only for the saved host, port and username. - The get-system-smtp effect reads private.smtp, so services still receive the password. - The 0.4.3 migration (revision 4) moves an existing password into private.smtp and is idempotent with revision 3. - The SMTP page no longer pre-fills the password; it says one is saved and offers to remove it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
helix-white
left a comment
There was a problem hiding this comment.
Two changes needed before approval:
-
[P1] Commit the generated bindings and man pages. The acknowledged regeneration gap is a current build failure, not just documentation drift: the riscv64 build fails compiling the SMTP page against the committed
SmtpValue/set-SMTP schema. Regenerate and commit the artifacts, then verify the affected callers against that result. The proposal intentionally does not hand-edit generated files. -
[P2] Reset the form after a password-only save (
smtp.component.ts,save). Replacing an existing password keeps all publicSmtpInfofields unchanged, includingpasswordSet: true. Consequently theserverInfo.smtpwatch no longer rebuilds the form as it did when the password was public. A successful password replacement leaves Save enabled, Cancel visible, and the replacement password in the control; subsequent saves silently keep resubmitting that password rather than using the saved-password path. The proposal clears the password and dirty state explicitly after a successful save, leaves failed edits intact, and adds focused regression coverage without a public-update event.
Proposed changes: d00dcbf...proposal/4892
Reviewed storage projection, migration normalization/idempotence, service-effect watching, saved-password test selection, and the form flows. git merge-tree confirms a clean merge with integration/registry-cache-sync. No builds, tests, or typechecks run during review; the proposed tests are unexecuted and need author verification. Other CI checks remain pending.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Adopted from helix-white's proposal/4892.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asswords From the generated-artifacts and generated-man-pages outputs of run 45232893506. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
helix-white
left a comment
There was a problem hiding this comment.
Approved at 6b766cd5f. Both earlier findings are addressed: the generated contracts/man pages are committed, and password-only saves explicitly clear the password control and dirty state while failed saves retain edits. The migration revision expectation is also corrected. The branch merges cleanly with integration/registry-cache-sync.
The password previously traveled with the public database to authenticated browsers and their IndexedDB caches. Full SmtpValue settings now belong to private.smtp; public SmtpInfo replaces the password with passwordSet. Migration revision 4 moves existing settings and supports reruns; downgrade restores the previous representation. Services reuse their existing database watch against the private value, preserving credential access and change callbacks. Previously stored browser copies are replaced on resynchronization, not remotely erased from offline browsers.
SetSmtpParams adds keepPassword, defaulting to false; the UI opts in when its blank password field means “keep.” That explicit save option retains the password even if endpoint fields change. TestSmtpParams.password becomes optional, with saved-password fallback restricted to the saved host, port and username. System → SMTP displays the saved-password message and removal action instead of prefilling credentials. Screenshots of this head with mock data follow in a separate comment.
Implementation diff: +336 / −193 lines in 19 files (excludes lockfiles, tests, docs, release notes, and changelog). Generated runtime schemas/catalog metadata are included.
For screenshots only, I built the reviewed head with npm run build:ui:dev through the build cache and rendered the actual page in Chromium using the mock API. No tests or live SMTP delivery were run during review. Current CI has passed formatting, changelog/version checks, dependency licenses, and SDK/runtime/script tests; start-core tests/man pages, generated bindings/MCP checks, other Rust suites, and platform builds remain pending. The added form regression tests therefore are not claimed as passed here.
The description's “Needs regeneration” section and stale-binding verification result are now obsolete.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Re-lands #4892 on master; #4903 took it back out of integration/registry-cache-sync so #4898 carried no SMTP change. The full SMTP settings move to private.smtp; serverInfo.smtp becomes SmtpInfo (no password, plus passwordSet). set-smtp takes keepPassword, test-smtp falls back to the saved password when host, port and username match, and get-system-smtp watches private.smtp. The SMTP page no longer prefills the password, notes when one is saved and can remove it. The 0.4.3 migration goes to revision 5 (master's revision 4 is the shared-volume rename); hide_smtp_password skips a value that already has passwordSet, so it is idempotent with revision 4. The new web strings take IDs 1315/1316. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: helix-white <267227783+helix-a@users.noreply.github.com> Co-Authored-By: helix-red <355572797+helix-red@users.noreply.github.com>


Summary
serverInfo.smtpheld the SMTP password in plain text. The public database is streamed to every authenticated browser, and since #4752 (RC3) each browser also keeps a copy in IndexedDB. So the password went to every signed-in browser and sat on its disk.private.smtp.serverInfo.smtpbecomesSmtpInfo: host, port, from, username, security andpasswordSet.server.set-smtpnow takesSetSmtpParams, which addskeepPassword(CLI--keep-password). With it and no password, the saved password is kept. Without it, behavior is as before: a missing password means none.server.test-smtp's password is now optional. If omitted, the saved password is used, but only when the host, port and username match the saved settings, so a test against another host can't extract it.get-system-smtpeffect reads and watchesprivate.smtp, so services still get the password and their callbacks still fire on changes.v0_4_3goes to migration revision 4.up()copies an existing public SMTP value toprivate.smtpand replacespasswordwithpasswordSet. It skips a value that already haspasswordSet, so it's idempotent with revision 3, which the rest ofup()andpost_up()already were.down()restores the public value. The existing revision test now also covers revision 3, and three new tests cover the move, an unset password and no SMTP at all.The public-database exposure itself predates RC3, so there's a
securitychangelog fragment.Needs regeneration
The TypeScript bindings (
SmtpInfo,SetSmtpParams, the optional test password) and the man pages forserver set-smtpandserver test-smtpare stale. Commit thegenerated-artifactsoutput from the Generated Artifacts job. Until then,check:uifails only on those types:passwordSetonserverInfo.smtpandkeepPasswordon theset-smtpparams.Verification
make start-core-format-check: clean.npm run check:i18n: all keys valid.npm run check:ui: fails only on the two stale-binding errors above.review effort: 'high'
🤖 Generated with Claude Code