feat(dev-server): opt-in Tailscale preview via dev.json config - #233
Open
theshwal wants to merge 1 commit into
Open
feat(dev-server): opt-in Tailscale preview via dev.json config#233theshwal wants to merge 1 commit into
theshwal wants to merge 1 commit into
Conversation
Add an optional Tailscale preview to dev servers, enabled per project through `tailscaleExpose` in `.openfox/dev.json`. The preview starts automatically after a successful dev server start, remains non-blocking on Tailscale errors, and is cleaned up on stop, crash, or stopAll without touching pre-existing Serve entries. Add config UI, read-only Tailnet status, unit coverage, and gated Playwright E2E verification for Tailscale-enabled environments.
Contributor
Author
CI status snapshot —
|
| Check | Status |
|---|---|
lint |
✅ pass |
typecheck |
✅ pass |
duplicate |
✅ pass |
test |
✅ pass |
ai-disclosure |
✅ pass |
windows |
❌ fail |
The only failing check is windows, on the pre-existing flaky test fires close event after killing process group — unrelated to this PR's diff. The test pass-rate on this runner is normally green; the failure is environmental (Windows process-group kill race).
QA_PASS and INT_PASS confirmed on f28999cf43234ec55b4d1796cbd8d1d334fabbfc.
A re-run of the windows job should target the same SHA (no new commit needed).
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 Tailscale preview to the dev server, enabled per project through a new
tailscaleExposeboolean in.openfox/dev.json(defaultfalse).The preview starts automatically after a successful dev server start, remains non-blocking on Tailscale errors, and is cleaned up on stop, crash, or stopAll — without touching pre-existing Serve entries.
Feature
tailscaleExposein.openfox/dev.json— defaults tofalse; existing projects are unaffected.tailscaleExpose: true.stopAll(no orphan entries).tailscalePreview.status: 'error'and do not affect dev server state.Mechanism
foregroundtailscale serveonly — entry disappears naturally with the controlling process. No--bgfallback.stdoutURL is primary source for the Tailnet URL (matches Tailscale's actual exposed entry).tailscale serve status --jsonis used only to:Web/TCPand foreground-ownedForeground[*].Web/TCPentries).tailscale serve --https=<port> off) — neverreset. Pre-existing entries (e.g. 443 → 10369) are never touched.Tests
src/server/dev-server/tailscale-preview.test.ts) — 25 tests covering foreground spawn, stdout URL parsing,Foreground[*]status JSON normalization (with a host-agnostic redacted fixture), targeted inverse, never-reset guarantee, stopAll.src/server/dev-server/manager.test.ts) —tailscaleExposeconfig round-trip, auto-launch fire-and-forget (never blocks on Tailscale error), no auto-launch when absent orfalse, idempotent re-call, stop-coupled cleanup,stopAllcleanup.e2e-playwright/tailscale-preview.spec.tswith a hard gate: tests skip cleanly whenOPENFOX_TS_NODE_HOST/OPENFOX_TS_NODE_IPare unset or when thetailscalebinary / backend is unavailable, so the standard CI suite is not impacted.Blocked request ... allowedHosts(HTTP 403) as a Vite backend compat limitation, not a feature bug.Verification
ffmpeg x11grab— captured window screenshot showing the Tailscale URL in the address bar and the dev-server content (TAILSCALE_PREVIEW_TEST_A) loaded in the same image. Pre-existing 443 entry intact before/after. Screenshots persisted at/home/hermesy/openfox-verify/feature-tailscale-preview-v1.1/(not committed).f28999cf43234ec55b4d1796cbd8d1d334fabbfc.Known limitation (backend compat, not a feature bug)
allowedHosts: when the dev server is Vite (default since v5), Vite returns HTTP 403Blocked request. This host (...) is not allowedbecause theHostheader it sees is the Tailscale MagicDNS hostname. The Tailscale mechanism itself works correctly; users need to add the tailnet host toserver.allowedHostsinvite.config.{js,ts}. Example: seeweb/vite.config.local.ts.examplewhich is already in the repo.Out of scope
tailscale funnel(public HTTPS exposure)tailscaledrestartAI-Enhanced Development
Cache Impact