feat(web): opt-in webHosts to reach the page over a private network - #4
Merged
Merged
Conversation
webHosts lists hostnames and IP literals the page answers to without webAuth. Every entry is an accepted Host at webPort (IPv6 in brackets); IP literals are also listened on next to 127.0.0.1. Hostnames are never resolved or bound. An extra address that cannot be bound is a warning. Absent, the page stays localhost-only exactly as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WhVzVMS6mftCFV735rT41b
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.
Summary
Adds an optional
webHostsfield toforeman.jsonso the owner can open the status page from another machine on a trusted private network (for examplehttp://mini:8090) without settingwebAuth.Hostat the page's port (IPv6 as[addr]:port, case-insensitive).127.0.0.1. Hostnames are never resolved or bound.webAuthset, credentials still replace the Host check;webHostsonly adds listen addresses.Security trade-off, documented in the README: anyone who can reach a listed address gets unauthenticated control of the page, so list only addresses on a private network you trust.
Known limitation
Extra addresses are bound once at daemon start. If the private network interface comes up later (e.g. after a reboot), that bind warns and is not retried until the daemon restarts.
Test plan
pnpm lint && pnpm typecheck && pnpm test && pnpm buildgreen (598 tests)listenAddressesdedupe, absentwebHostsunchanged::1bind closes with the server; unbindable192.0.2.1warns while loopback serveswebHostson a local instance and open the page from another tailnet machine🤖 Generated with Claude Code
https://claude.ai/code/session_01WhVzVMS6mftCFV735rT41b