feat(web): Let the console bind to a configured host - #133
Merged
Merged
Conversation
Co-Authored-By: Codex <noreply@openai.com>
Retain the loopback checks while accepting local interface and machine host names on other binds. Co-Authored-By: Codex <noreply@openai.com>
Keep the loopback default and derive advertised URLs from the selected bind host. Co-Authored-By: Codex <noreply@openai.com>
Preserve the loopback default when no child host argument is supplied. Co-Authored-By: Codex <noreply@openai.com>
Compare the requested bind host during child reuse and advertise a host-specific URL. Co-Authored-By: Codex <noreply@openai.com>
Log invalid web.host values and keep daemon startup on the resolved bind host. Co-Authored-By: Codex <noreply@openai.com>
Resolve configured hosts, accept the ui override, and print trusted-network links and warnings. Co-Authored-By: Codex <noreply@openai.com>
Describe the web.host setting, CLI override, child argument, and protocol parameter. Co-Authored-By: Codex <noreply@openai.com>
Separate caller-selected binds from the resolved config preference. This keeps ordinary web commands from moving a child explicitly bound by `ui --host`. Co-Authored-By: Codex
Keep localhost bookmarks on the canonical loopback URL for wildcard binds while skipping the redirect for specific hosts. Co-Authored-By: Codex
Accept the selected bind IP even if interface enumeration omits it, and limit machine hostname suffixes to Tailscale MagicDNS names. Co-Authored-By: Codex
Validate both host request fields before the supervisor changes a running child. Co-Authored-By: Codex
Return the selected bind address with web.ensure so warnings and alternate links match the child that is actually running. Co-Authored-By: Codex <noreply@anthropic.com>
Add WH-12 tests for hostile MagicDNS names and wildcard bind Hosts. Record the focused gate and mutation results. Co-Authored-By: Codex <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
The web console only listens on
127.0.0.1(listen()insrc/web/server.ts), andsrc/web/security.tsrejects every Host except127.0.0.1:<port>andlocalhost:<port>. It can't be opened from another device, for example over Tailscale.Change
web.hostin the config (an IPv4 or IPv6 address; default127.0.0.1, unchanged) andcodedeck ui --host <ip>for one launch. A value that isn't an IP is ignored withIgnoring invalid web.host in config: ....--hostexits 1 with--host must be an IP address.--host), the in-process fallback and the daemon autostart all bind to the resolved host.web.ensuretakeshost(explicit, fromui --host) andpreferredHost(fromweb.host). These follow the port rule: an explicit host is never moved by a laterreview/usage --web/setup, and a config host moves only a child that was started from config. The result now includes the activehost. A non-IP host is rejected withWEB_BAD_HOSTbefore the running child is touched.<hostname>.<tailnet>.ts.net(MagicDNS). Anything else gets 403. The token, cookie, Origin and/apichecks are unchanged. On127.0.0.1,0.0.0.0and::binds,localhoststill redirects to127.0.0.1.0.0.0.0/::the CLI prints anAlso on http://<ip>:<port>/?t=...line for each non-internal IPv4 address. It warns whenever the bind isn't loopback, because the console is plain HTTP.README.mdanddocs/protocol.md. Spec, tasks, validation and run report in.specs/features/web-host/.To use it over Tailscale, set
"web": { "host": "0.0.0.0" }(or runcodedeck ui --host 0.0.0.0) and open the printedAlso on http://<tailscale-ip>:7777/?t=...link once per browser.Validation
Scoped vitest batches (
--no-cache), after rebasing onmain:tests/web-port.test.ts tests/web-security.test.ts: 41 passedtests/web-server.test.ts tests/web-child.test.ts: 36 passedtests/web-supervisor.test.ts tests/daemon-web.test.ts: 53 passedtests/web-launch.test.ts tests/web-cli.test.ts tests/web-host-docs.test.ts: 46 passednpx tsc --noEmit -p .: cleanMutation probe by an independent verifier: 21/21 behavior faults killed after two remediation rounds (
validation.md,Verdict: PASS).Smoke with a built child on
0.0.0.0, curled on the machine's real Tailscale IP:The full suite was not run. Not covered: a real second device,
::withbindv6only=1, IPv6 address normalization in the host comparison.