VAPP-23: Run one-shot commands on a device from the detail page #28
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/run-device-command-vapp-23"
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-23: Run one-shot commands on a device from the detail page
Adds a "Run command" action to the device detail page so an operator can dispatch a one-shot shell command to an online device without opening the interactive Terminal.
What changed
run_device_command(device_id, command)insrc/server_fns/mod.rs. It sends the control channel'sruncommandsshell action (type0,runAsUser0) and resolves the routing ack (for: "runcommands"), mappingnot-connected/not-authorized/no-nodes/no-dbto inline errors. Mirrors the existingpower_action/wake_deviceshape.RunCommandmodal reusing the page's existing modal / busy-guard / inline-error infrastructure (shared with Rename / Move / Delete): a command textarea, a busy-state Run button, a monospace result pane, and inline errors. Help text states the command runs as the agent's user and points to the Terminal tab for interactive work.Verified protocol behavior (per the issue's "verify before wiring" directive)
Checked against the vervain-server and vervain-agent sources:
run_commands(crates/meshcentral-web/src/user_session.rs): the shell path routes{action:"runcommands", type, cmds, runAsUser, userid, username}to the agent and answers the control channel with an ack only ({action:"ack", for:"runcommands", result}), result one ofok/not-connected/not-authorized/no-nodes/no-db.crates/vervain-agent/src/dispatch.rs): does not handle the shellruncommandsaction and emits no reply frame for it. Only the interactivemsg/consolerelay (used by the Terminal tab) streams output back, and that path runs a curated built-in command set rather than an arbitrary shell.Conclusion: the shell
runcommandspath is dispatch-only end-to-end. No stdout/stderr returns over the control channel, so per the issue the UI reports dispatch success/failure only and the dialog says so explicitly, pointing the operator at the Terminal tab for output.Acceptance criteria
just checkpasses🤖 Generated with Claude Code