mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 14:33:17 -10:00
backend.FeatureLink ("link"), native on Lima, smolvm and Docker, with its
row on internals/backends.md; linkFeatures() returns it, so link add, each
launch, the session and each connection check it with Require.
- Env.Links is guestLinks: an address and a name per target, by address,
none for a target whose policy rule no longer holds.
- Launch (setUpVM, after the ssh config pins host keys): linkRuns.atLaunch
starts devvm _links detached (pid in run/<vm>.links.pid, its log in
logs/<vm>.links.log), warns once per stopped target (link_target_stopped)
and per target whose policy rule broke (link_policy_mismatch) or whose
backend lacks links (link_target_unusable), never starting one, and
reads the new session's log for refused forwards (link_port_taken).
- link add and link rm on a running client send the setup again and make
sure _links runs (linkRuns.apply), reporting a new link the VM refused;
on a stopped one, links_next_start.
- Stopping: Lifecycle.Stop and every Env.start stop the session; a session
killed has its sockets removed; its masters' control sockets go with
their ssh.
- devvm rm (Lifecycle.forget, so gc --orphans and retention too) stops the
session and removes every link to the VM from other clients
(links_target_gone), giving running clients their links at once.
- devvm network off on a target linked by clients with policy
(network_off_linked) and on for a client linked to a target without
(network_on_linked) are refused.
- link unpublish names the clients that link to the withdrawn ports
(unpublished_linked).
- devvm ls has a LINKS column and "links" in --json; devvm doctor lists
link; gc --orphans removes links to VMs without state and link sockets
nothing listens on, which devvm space counts as leftover state.
- net_off_log says devvm logs only a VM's links' connections without
network policy.
- Lima: Start already compares the guest environment, so it edits only
when the links' names change (TestStartSetsLinkNames); lima.md and the
design note say the edit's new host keys are pinned again at the start.
Fixes to the earlier link code: vmssh's masters left their control
sockets when killed; the session's log names a forward the VM refused on
a line of its own (ReadLinksLog).
Tests: vm TestGuestLinks, TestPolicyLinked, TestUnlinkTarget,
TestLinkLeftovers, TestLinkRuns, TestLinksAtLaunch; vmssh TestReadLinksLog;
lima TestStartSetsLinkNames; link.txtar updated, link_life.txtar new, the
stub ssh carries link masters; e2e's project section has a link smoke check
on Lima.
Co-Authored-By: Claude Opus 5.5 <[email protected]>