VAPP-16: Agent install flow behind "+ New Device" #14
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/new-device-install-flow-vapp-16"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
VAPP-16: Agent install flow behind "+ New Device"
The "+ New Device" topbar button was inert. This wires it (and a new empty state on
/devices) to an enrollment dialog so an operator can onboard a device without leaving the app.What it does
/devicesempty state, both via a sharedNewDeviceOpencontext signal; the dialog is mounted once inLayout.list_meshes.get_mesh_installserver fn proxies vervain-server's session-gated/meshsettings.ashx?id=<short>route (forwarding the session as themc_sessioncookie, the same way the control channel does) and parses the config'sMeshServerline into the browser-facinghttps://host:portbase..mshconfig download (adata:URL so the exactMeshIDis preserved and previewed), the agent binary download (/meshagents/6, the unauthenticated route; AgentId 6 = Linux64), and a copy-paste install snippet (download,vervain-agent config seal --from <file>,vervain-agent install --system) with the real server URL substituted in.Acceptance criteria
.mshtext from/meshsettings.ashxis passed through verbatim and previewed)Checks
cargo check(server + wasm32),cargo clippy -D warnings,cargo fmt --check, andcargo testall pass. Added unit tests for theMeshServerURL parsing andContent-Dispositionfilename extraction.🤖 Generated with Claude Code
The /meshsettings.ashx config carries only the legacy MeshServer= and MeshID= keys, but vervain-agent's settings store requires ServerURL= and GroupID= and refuses to start without them ("required key `ServerURL` is missing"), so the dialog's verbatim .msh could not enroll a clean host and the snippet's seal step produced a non-booting config. get_mesh_install now appends the two keys derived from their legacy twins (never overwriting explicit values), keeping the legacy lines intact. Unit tests cover the derivation and the no-overwrite rule. Verified end to end against a live vervain-server: fetched the dialog's payload through the real server fn, sealed it verbatim on a clean directory (no manual config set steps), ran the agent, and the device appeared on /devices. This closes the PR's previously unchecked acceptance criterion. #VAPP-16 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Fixed two things: (1) resolved the merge conflict with main (import union in src/server_fns/mod.rs after the user-management merge); (2) the previously unchecked acceptance criterion was failing for a real reason: the verbatim /meshsettings.ashx config carries only the legacy MeshServer=/MeshID= keys, but vervain-agent requires ServerURL=/GroupID= and refuses to boot without them, so the snippet's seal step produced a non-starting config. get_mesh_install now derives and appends the two keys (never overwriting explicit ones), with unit tests. Verified end to end against a live stack: fetched the dialog's payload through the real server fn, sealed it verbatim with no manual steps, ran the agent, and the device appeared on /devices via meshctrl and the app. All ACs now hold; just check clean (7 tests).