Repository navigation
feat(devices): list what protects the server in Phone & devices - #1975
Conversation
Settings > Phone & devices gains a read-only Access group: whether an access token is configured, the durable pairing gate (open, closed, or unavailable when devices.json cannot be read), the kind of address the server listens on, and how this one request arrived. Public reachability stays "Unknown" unless the request came through Tailscale Funnel on an install that declared serve its only ingress. Nothing reads as a safety verdict, and the open-LAN warning is unchanged. /api/health (both scopes) carries an optional SecuritySummary (shared/access.ts) only for authenticated full access, a watching device included, sent no-store and without herdr. It holds no token, hash, header, login or address. Anonymous answers omit it; an older server that sends none is shown as unavailable, never rebuilt from auth or the LAN warning. Tailscale and Funnel are labelled only with that provenance; Tailscale-shaped headers alone are "unknown", other forwarding is "proxy". A request no proxy said it forwarded is shown as "No proxy seen" with a line saying a proxy that adds nothing looks the same. useAccessState keeps the facts: the newest read to settle decides them, so an older answer landing after a newer failure shows nothing, and a failure clears the facts even while a newer read is still out. Checked with server/access.test.ts, seven api.contract.test.ts cases on an isolated herdr, src/lib/useAccess.hook.test.ts (the overlapping-read case failed before the fix), and scripts/security-summary-demo-regression.ts at 390 and 1440 px over known, unknown, proxy, gated, funnel, tailnet, unavailable, watch, older, loading and error answers. Closes #1604
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CodeRabbit's review was rate-limited ("Review limit reached"), so no CodeRabbit review has run on this PR. This change touches an HTTP contract and access facts, so here are the reviews that ran on it before the push, with how each finding was resolved. Reviewers: omo-native-code-reviewer (Claude), Codex gpt-6.1-sol (xhigh), Codex gpt-6-astra. HIGH, raised by all three: an unforwarded request was shown as "Direct" ( HIGH, Sol and Astra: a failed check could leave stale facts on screen ( HIGH, Sol: a tagged node without an owner earns the Funnel label. Declined. Funnel and Tailscale are labelled only on an install that declared serve its only ingress ( MEDIUM (code reviewer): LOW (code reviewer):
After the fixes: |
|
Merge pass review report. Overall: PASSED. This PR touches the access/authentication surface and an HTTP contract ( Tests and visual checks (all reproduced independently by Astra):
What the Access group shows:
Contract: Not covered: live Tailscale Funnel and older remote bundles were checked by reading the code, not run. CodeRabbit was rate-limited, so the agent review stands in for it, as AGENTS.md allows.
|
…summary #1975 shows the Phone & devices access facts with the demo's /api/devices left a 404 by design, and its browser regression stubs the list itself. The demo now answers its device routes (list, pairing, revoke-all, rename and revoke) only with ?demo_devices=; `list` is the fictional devices, and the other values are the lane's states as before. Without it the demo has no device list, as before this branch. The device-security regression asks for `list` where it named no state. Its phone press on Revoke all scrolls the row into view first, since the access facts now sit below Devices and the scrolled-end frame passes it. Its 44 px touch-target check allows a 0.01 px layout remainder (a 44 px box measured 43.99999 below the new group). Checked with both demo regressions (device-security at 390 and 1440, light, dark and Korean; security-summary at 390 and 1440) and the conventions and ci-browser tests.
…summary #1975 shows the Phone & devices access facts with the demo's /api/devices left a 404 by design, and its browser regression stubs the list itself. The demo now answers its device routes (list, pairing, revoke-all, rename and revoke) only with ?demo_devices=; `list` is the fictional devices, and the other values are the lane's states as before. Without it the demo has no device list, as before this branch. The device-security regression asks for `list` where it named no state. Its phone press on Revoke all scrolls the row into view first, since the access facts now sit below Devices and the scrolled-end frame passes it. Its 44 px touch-target check allows a 0.01 px layout remainder (a 44 px box measured 43.99999 below the new group). Checked with both demo regressions (device-security at 390 and 1440, light, dark and Korean; security-summary at 390 and 1440) and the conventions and ci-browser tests.
Closes #1604.
What it does
Settings → Phone & devices gets a read-only Access group after Devices. It lists, one fact per row, what protects this server:
Nothing on the screen calls the setup safe, secure or local only, and
LanExposureNoticeis unchanged. Before the answer arrives the group shows Loading; a failed check and an older server that sends no facts each get one sentence, and neither shows an earlier answer.Why
Settings couldn't tell you how the bridge is reachable. Agent of Empires' security page prompted this, but its summary calls a loopback bind "local only", which nothing here can prove: a proxy, tunnel or router in front can expose any bind. Neither the Codex nor the Claude app shows such a summary, so there is no app pattern to follow (DESIGN.md says so in the entry).
Contract (needs a real review: HTTP contract + access facts)
GET /api/health(full and?scope=bridge) carries an optionalsecurity: SecuritySummary(shared/access.ts) only for authenticated full access, a watching device included, sentCache-Control: no-store. The bridge scope answers it without herdr. Anonymous answers (no auth, wrong token, forged Funnel headers) carry no facts.decideAccess) is unchanged;lanExposedkeeps its results (its bind check is nowbindScope).OVIS_TAILSCALE_SERVE_ONLY), from loopback, while Tailscale runs here. Tailscale-shaped headers alone areunknown; other forwarding isproxy.directmeans no proxy said it forwarded the request. A proxy that adds nothing (nginx's bareproxy_pass, an SSH tunnel) looks the same, so the UI shows it as No proxy seen with a line saying so, never as "Direct".useAccessStatelets the newest read to settle decide the facts. An older answer landing after a newer failure shows nothing, and a failure clears the facts even while a newer read is still out.Verification
server/access.test.ts(bind aliases, tailnet literals, wildcard/other binds, verified/unverified ingress,lanExposedunchanged): 48 pass.server/api.contract.test.ts"access facts on /api/health": 7 cases on isolated servers (authenticated facts only, anonymous omits them, watch reads but can't change devices, corrupt registry is unavailable and gated, auth via is not ingress, an unknown proxy never means local only, bridge health without herdr).src/lib/useAccess.hook.test.ts: overlapping reads. The "failure while a newer read is out" case failed before the fix.scripts/security-summary-demo-regression.tsat 390 and 1440 px (enrolled in the browser lane): known, unknown, proxy, gated, funnel, tailnet, unavailable, watch, older-server, loading and error answers; no controls in the group; no verdict wording; LAN warning unchanged; a held older answer released after a failure shows no facts.curl -i /api/health?scope=bridgeanonymous → nosecurity; with the token → the five facts +Cache-Control: no-store; Tailscale-shaped and Funnel headers →unknown;X-Forwarded-For→proxy; the token appears nowhere in a response.bun run check faston the final commit: ok (workflow syntax, generated types/themes, typecheck, build; unit 7200 pass, 0 fail).SecurityFactstype moved from a component intosrc/lib, a stale env name in a comment, a DESIGN.md font token. Declined, with reasons: requiring an owner login for Funnel on a tagged node (a tagged node is "Tailscale runs here"; the owner adds nothing to whether serve carried the request);unknownfor unforwarded requests (it would apply to every headerless peer, sodirectwould never be produced; the relabel says exactly what is observed).Note: an earlier local run failed
server/legacy-env.test.tson clean main too, from this host's inotify limit (#1968); it passed in the final run, and this PR does not touch it.