Skip to content

feat: attach to the machines a host's Herdr saved - #6

Merged
nimrc merged 2 commits into
mainfrom
feat/saved-machines
Nov 16, 2026
Merged

nimrc merged 2 commits into
mainfrom
feat/saved-machines

Conversation

@nimrc

@nimrc nimrc commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Brings nimrc/bellterm#30 to iOS: it fixes nimrc/bellterm#29, where running herdr --remote B in a pane on A only showed B as that pane's terminal, so the workspace list stayed A's.

What changed

  • native/ and crates/ are copied from nimrc/bellterm main and are identical to Android's again.
    • A route may carry a relay target. Every remote command then runs as ssh <bridge policy> -- <target> '<command>' on the host, so the host's keys, ssh config and known hosts sign in to the machine.
    • machines::list reads herdr machine list --json on the host.
  • bellterm-ffi exposes list_machines(config_json).
  • Swift
    • Node.machine holds the SSH target. Routes leaves the machine out of our SSH hops, sends it as relay, and asks only for the hops' passwords.
    • NodeStore.machine(host:…) saves a machine as a node via its host. Machines are deleted with their host and never offered as jump hosts.
    • The session sidebar gets a Machines section, listed when a session opens: the host, then its machines. Tapping one attaches to it and shows its session. Saved machine nodes can't be edited.
  • README: the feature.

Screenshots

MachineTests.sidebarListsTheHostsMachines renders the sidebar in a window on the CI simulator (iPhone Duo). It fails if nothing drew.

Light Dark

The full flow (listing the machine, switching to it, its own workspace, and back) runs end to end on an Android emulator in nimrc/bellterm's CI, against the same shared core.

Tests

  • CI: Rust workspace, iOS core build, and Swift tests (53 passed).
    • New MachineTests: routes skip the machine hop and its password, Node round-trips machine, Machine parsing, store deletion and jump candidates, and the sidebar render.
    • The first Swift run failed before any test started ("Failed to establish communication with the test runner"); the rerun passed.
  • Local: the app and its tests built for the simulator with Xcode 27.2 against this PR's CI-built core.

Sync native/ and crates/ with Bellterm for Android at nimrc/bellterm#30. The session sidebar lists the host and the SSH machines its Herdr saved with herdr machine add; tapping one attaches to it through the host's own ssh, and the machine is saved as a node via its host. bellterm-ffi exposes list_machines. MachineTests covers routes, storage and parsing, and renders the sidebar with machines.
@nimrc
nimrc marked this pull request as ready for review November 16, 2026 16:10
@nimrc
nimrc merged commit f5bd6b1 into main Nov 16, 2026
5 of 6 checks passed
@nimrc
nimrc deleted the feat/saved-machines branch November 16, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

通过 herdr remote 连接另一台服务器后,工作区列表未正确加载

1 participant