Repository navigation
Conversation
helix-white
left a comment
There was a problem hiding this comment.
P2 — Preserve the existing SMTP setter aliases (shared-libs/crates/start-core/src/system/mod.rs:1288–1296). The previous server.set-smtp parameter type, SmtpValue, accepts server for host and login for username. SetSmtpParams drops both aliases, so an existing valid request such as {"server":"smtp.example.com","port":587,"from":"a@example.com","login":"a"} now fails deserialization. Moving the password out of the public database does not require breaking these callers.
The proposal flattens the existing SmtpValue into SetSmtpParams, keeping the field names, aliases, defaults and CLI definitions owned in one place. It adds regression cases for canonical and legacy requests, including password retention. The proposal is unbuilt and untested, as required for review proposals; its generated bindings, MCP catalog and man pages have not been regenerated.
I also traced migration/revision handling, private SMTP reads and callbacks, password retention, test-email credential selection, and the UI's save/reset behavior. The reviewed head merges cleanly with master. CI was still running when inspected; this verdict does not depend on its completion.
Proposed changes: e837bcb...proposal/4943
To adopt the proposal, cherry-pick it onto your branch rather than merging or pulling it, so the PR's head stays your own commit:
git fetch https://github.com/Start9Labs/start-technologies.git proposal/4943
git cherry-pick e837bcbd9d625029ff358e9c3bac809c1a9c66b3..FETCH_HEADIf your branch has moved since e837bcbd9d625029ff358e9c3bac809c1a9c66b3, resolve any conflicts the cherry-pick reports, or apply the changes your own way. Then push and say so in a comment.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
SetSmtpParams flattens SmtpValue instead of restating its fields, so set-smtp still accepts `server` for `host` and `login` for `username`. Adopted from helix-white's review proposal on #4943. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@helix-red please regenerate the TS bindings, CLI man pages and MCP catalog for this branch ( |
Dismissed by Helix: the changes require a substantive PR brief update. The new head restores server.set-smtp's server/login aliases through flattened SmtpValue, changing legacy requests from rejected to accepted and addressing the review's finding. The substantive compatibility explanation must now state that those existing RPC inputs remain supported.
|
Regenerated the TS osBindings, MCP tool catalog and |
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>
b15132d to
3131d1c
Compare
|
@helix-white the branch is now one commit authored by Matt, folding in your |
|
Closing: SMTP is being reworked as a whole in an upcoming PR, which will keep the password out of the public database as part of that change and improve the UX at the same time. Re-landing this separately would only conflict with it. |
helix-white
left a comment
There was a problem hiding this comment.
Approved at 3131d1c2f. The alias-preserving change addresses my earlier finding, and the regenerated schemas, MCP catalog and man page match that change. The branch merges cleanly with master.
Brief
- The public database stops distributing the saved SMTP password to browsers. Full credentials live in
private.smtp; the public summary reports whether a password is saved. Services retain their existing secret-bearingget-system-smtpeffect and watch the private value, including password-only changes. - System → SMTP leaves Password blank. Saving with it blank retains the password; Remove saved password marks it for removal on Save. Cancel abandons that removal. A test email can use the saved password only when host, port and username match. CLI/RPC callers must explicitly request retention; omitting both the password and retention still clears the password. The existing
server/loginaliases remain accepted through the reusedSmtpValuedefinition, adopted from my proposal. - The 0.4.3 migration advances to revision 5, moves existing credentials and publishes the non-secret summary. Reapplying the migration preserves an already-migrated value; downgrading across the version restores the old public representation. CLI/user documentation and all five UI translations accompany the change.
Implementation diff: +286 / −78 lines in 19 files (excludes lockfiles, tests, docs, release notes, and changelog; includes generated runtime schemas/catalog).
Data contracts — complete Rust definitions
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, VisitFields)]
#[serde(rename_all = "camelCase")]
pub struct SmtpInfo {
pub host: String,
pub port: u16,
pub from: String,
pub username: String,
pub password_set: bool,
#[serde(default)]
pub security: SmtpSecurity,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Parser, VisitFields)]
#[group(skip)]
#[serde(rename_all = "camelCase")]
pub struct SetSmtpParams {
#[command(flatten)]
#[serde(flatten)]
pub smtp: SmtpValue,
#[arg(long, help = "help.arg.smtp-keep-password")]
#[serde(default)]
pub keep_password: bool,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Parser, VisitFields)]
#[group(skip)]
#[serde(rename_all = "camelCase")]
pub struct TestSmtpParams {
#[arg(long, help = "help.arg.smtp-host")]
pub host: String,
#[arg(long, help = "help.arg.smtp-port")]
pub port: u16,
#[arg(long, help = "help.arg.smtp-from")]
pub from: String,
#[arg(long, help = "help.arg.smtp-to")]
pub to: String,
#[arg(long, help = "help.arg.smtp-username")]
pub username: String,
/// Omitted, uses the saved password for the same host, port and username.
#[arg(long, help = "help.arg.smtp-password")]
pub password: Option<String>,
#[arg(long, help = "help.arg.smtp-security")]
#[serde(default)]
pub security: SmtpSecurity,
}The reused credential type is unchanged:
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Parser, VisitFields)]
#[group(skip)]
#[serde(rename_all = "camelCase")]
pub struct SmtpValue {
#[arg(long, help = "help.arg.smtp-host")]
#[serde(alias = "server")]
pub host: String,
#[arg(long, help = "help.arg.smtp-port")]
pub port: u16,
#[arg(long, help = "help.arg.smtp-from")]
pub from: String,
#[arg(long, help = "help.arg.smtp-username")]
#[serde(alias = "login")]
pub username: String,
#[arg(long, help = "help.arg.smtp-password")]
pub password: Option<String>,
#[arg(long, help = "help.arg.smtp-security")]
#[serde(default)]
pub security: SmtpSecurity,
}The containing persisted models are:
#[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "camelCase")]
#[model = "Model<Self>"]
pub struct Private {
pub key_store: KeyStore,
pub password: String, // argon2 hash
#[serde(default)]
pub sessions: Sessions,
/// Retains the persisted name for existing databases.
#[serde(default = "generate_server_identity_key", rename = "developerKey")]
pub server_identity_key: Der64<ed25519_dalek::SigningKey>,
pub ssh_privkey: Pem<ssh_key::PrivateKey>,
pub available_ports: AvailablePorts,
pub notifications: Notifications,
#[serde(default)]
pub os_security_notifications: SecurityNotifications,
#[serde(default)]
pub registry_cursors: BTreeMap<url::Url, crate::registry::sync::RegistryCursor>,
#[serde(default)]
pub push: crate::notifications::push::PushState,
pub cifs: CifsTargets,
#[serde(default)]
pub backup_history: BTreeMap<String, crate::backup::history::BackupRun>,
#[serde(default)]
pub backup_target_credentials: BTreeMap<
crate::backup::target::BackupTargetId,
crate::shared_volumes::SharedVolumeCredentials,
>,
#[serde(default)]
pub shared_volume_credentials: BTreeMap<
crate::shared_volumes::SharedVolumeId,
crate::shared_volumes::SharedVolumeCredentials,
>,
#[serde(default)]
pub package_stores: BTreeMap<PackageId, Value>,
#[serde(default)]
pub smtp: Option<crate::system::SmtpValue>,
}
#[derive(Debug, Deserialize, Serialize, HasModel, VisitFields)]
#[serde(rename_all = "camelCase")]
#[model = "Model<Self>"]
pub struct ServerInfo {
pub id: String,
pub hostname: InternedString,
pub version: Version,
/// Commit of the running StartOS build, rewritten on every boot.
#[serde(default)]
pub git_hash: InternedString,
pub package_version_compat: VersionRange,
#[visit(ts(type = "z.record(z.string(), z.unknown())"))]
pub post_init_migration_todos: BTreeMap<Version, Value>,
#[serde(default)]
pub latest_migration_revision: usize,
pub last_backup: Option<DateTime<Utc>>,
pub network: NetworkInfo,
#[serde(default)]
pub status_info: ServerStatus,
pub unread_notification_count: u64,
#[serde(default = "initial_trusted_keys")]
pub trusted_keys: TrustedKeys,
/// Last observed trust proposals from connected registries.
#[serde(default)]
pub registry_keys: BTreeMap<InternedString, BTreeSet<crate::sign::AnyVerifyingKey>>,
/// Connected registries; written only through `server.registries`.
#[serde(default)]
pub registries: Registries,
/// Registry that provides StartOS updates; always connected.
#[serde(default = "initial_os_registry")]
pub os_registry: Url,
pub pubkey: String,
pub ca_fingerprint: String,
#[serde(default)]
pub ntp_synced: bool,
#[serde(default)]
pub zram: bool,
pub governor: Option<Governor>,
#[serde(default)]
pub epp: Option<Epp>,
pub smtp: Option<SmtpInfo>,
#[serde(default)]
pub nut: NutConfig,
#[serde(default = "default_echoip_urls")]
pub echoip_urls: Vec<Url>,
pub ram: u64,
pub devices: Vec<LshwDevice>,
pub kiosk: Option<bool>,
pub language: Option<InternedString>,
pub keyboard: Option<KeyboardOptions>,
}Existing persisted credentials are migrated before typed database normalization. Setter requests retain their flat JSON shape and legacy aliases. Consumers of the public SMTP value must use the password-presence summary rather than expecting credentials; package effects retain their existing credential contract.
Verification evidence
The author records a passing UI typecheck and 349 UI tests, i18n validation and formatting. The implementer's follow-up records successful local binding/catalog/man-page regeneration after adopting the alias fix. The current description's statement that CI will be the first real regeneration is therefore stale.
I built and ran this UI tree against the repository's mock backend only to capture the saved-password and pending-removal screens, using fictional credentials. The captured b15132d5c tree is identical to the squashed reviewed head. Screenshots follow in a separate attachment-only comment. No review tests were run, and this did not exercise live SMTP delivery, an OS upgrade, or service callbacks end to end.
At inspection, formatting/lockfiles, SDK/runtime/script tests, dependency licenses and changelog checks passed. Rust tests/man pages, generated-artifact checks and product builds were still pending; approval is based on the code, not an assumption that those checks will pass.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
The squashed head 3131d1c has been re-reviewed; my approval and screenshots are posted above. I also see the subsequent closure in favor of the broader SMTP rework. No further changes or review requests from me on this PR. |


Summary
Browsers can no longer read the saved SMTP password from the server's public database.
serverInfois sent to every signed-in browser and cached there, and until now it carried the password in plain text.What users see:
get-system-smtp, and their callbacks still fire when the settings change.History
This change first merged as #4892, into
integration/registry-cache-sync. #4903 took it back out of that branch so #4898 would stay focused on registry sync. #4898 has since merged tomaster, and this PR lands the SMTP change onmasteron its own. A researcher asked on #4903 whether the change was still planned. This PR is the answer.@dr-bonez, I read #4903 as keeping the omnibus focused rather than an objection to the change itself; if you had a concern with the approach, say so here.
Changes
The code is #4892's, adapted to current
master:private.smtp.serverInfo.smtpbecomesSmtpInfo: host, port, from, username, security andpasswordSet.server.set-smtptakesSetSmtpParams: the existingSmtpValueflattened, so theserver/loginaliases still work, pluskeepPassword(CLI--keep-password). With it set and no password given, the saved password is kept. Without it, a missing password means no password, as before. Adopted from helix-white's review proposal, with tests for canonical and legacy requests.server.test-smtp's password is now optional. If it is omitted, the saved password is used, but only when the host, port and username match the saved settings. A test against another host therefore can't extract it.get-system-smtpreads and watchesprivate.smtp.masterrevision 4 is now feat(start-os): enforce unique shared-volume names #4901's shared-volume rename.up()copies an existing public SMTP value toprivate.smtpand replacespasswordwithpasswordSet. It skips a value that already haspasswordSet, so it is idempotent with revision 4.down()restores the public value. The revision-queueing test now covers revisions 0 through 4. Three tests cover the move, an unset password, and a server with no SMTP configured.mastergained since fix(start-os): keep the SMTP password out of the public database #4892.smtp.test.mjsstub now exportsescapeHtml, which the component has imported since fix(web): render package text as sanitized markdown, OS-interpolated values as plain text #4907. The CLI reference and the SMTP guide describe the new behavior. fix(start-os): keep the SMTP password out of the public database #4892'ssecuritychangelog fragment is included, because the exposure predates this release.Generated artifacts
The man pages, TS bindings and MCP catalog carry #4892's regenerated output, merged onto
master. The one conflict wasServerInfo.smtpintypes.schemas.ts, which I resolved tomaster's codegen style. CI'sstart-core Tests & Man PagesandGenerated Bindings & MCP Catalogjobs are the first real regeneration. If either reports drift, I'll commit its uploaded output.Verification
make start-core-format-check: clean.npm run check:i18n: all keys valid.npm run build:deps && npm run check:ui: the typecheck passes, and 349 of 349 tests pass after theescapeHtmlstub fix.review effort: 'xhigh'
🤖 Generated with Claude Code