Skip to content

WSL backend receives the listen selection (#9) - #17

Merged
Khang5687 merged 5 commits into
fork-mainfrom
feat/wsl-selection
Sep 16, 2026
Merged

Khang5687 merged 5 commits into
fork-mainfrom
feat/wsl-selection

Conversation

@Khang5687

Copy link
Copy Markdown
Owner

Ticket: #9 (parent spec #1, ADR 0003). Closes #9. Supersedes #2's two-valued fix on the fork; #2 remains open only to track upstream pingdotgg#10358.

The WSL backend receives the user's listen-interface selection instead of a hardcoded wildcard. The bootstrap envelope carries the selection into the distro and the Linux server resolves it against WSL's own interfaces; the desktop's backend config carries the selection rather than a pre-spelled host string, so WSL and native envelope builders format one value. The distro-IP probe and renderer URL are gated on the selection carrying lan (the only case that binds the distro's virtual NIC); local-only and tailscale-only ride WSL2 localhost forwarding and skip the probe. Native path behaviourally unchanged.

ADR 0003 records what a selection means inside WSL, the NAT-mode limitation, and the trade against upstream's wildcard (which existed because loopback-only inside WSL failed readiness probes on some hosts). If that returns, the named fix is a distro-NIC fallback on a failed loopback probe, not a wildcard.

Verification: contracts 379 and desktop 827 tests pass, desktop typecheck clean. Tests cover local-only, tailscale-only, lan, and custom-with-address: host string, renderer URL and probe count each asserted, so no wildcard and no pre-resolved IP can reach the WSL launch path.

Not verified on a real WSL machine — none available. Loopback-only bind, localhost forwarding and distro-NIC advertisement are argued from code and WSL2's documented networking, not observed; commit body and ADR both say so. A WSL user confirming local-only would close the gap.

The WSL launch path hardcoded `host: "0.0.0.0"` and always advertised the
distro's eth0 IP, so "Limited to this machine" was untrue inside the
distro and the selection the user made on Windows stopped at the WSL
boundary.

The bootstrap envelope now carries the listen-interface selection (ADR
0003) for WSL exactly as it does for the native backend, and the Linux
side resolves it against WSL's own interfaces. `backendConfig` carries
the selection itself instead of a pre-spelled `--host` string, so both
envelope builders format the one value. The renderer only uses the distro
IP when the selection carries `lan`, which is the only case that binds
the distro's virtual NIC; local-only and tailscale-only stay on WSL2
localhost forwarding and skip the probe entirely.

Unverified on real WSL: no WSL machine was available.

Closes #9
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Sep 16, 2026
@Khang5687
Khang5687 merged commit dfae3c3 into fork-main Sep 16, 2026
7 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant