Skip to content

Hotfix: header label fallback + VITE_EXPOSE gate - #10

Merged
unforced merged 2 commits into
mainfrom
hotfix/header-label-and-expose
Apr 18, 2026
Merged

Hotfix: header label fallback + VITE_EXPOSE gate#10
unforced merged 2 commits into
mainfrom
hotfix/header-label-and-expose

Conversation

@unforced

Copy link
Copy Markdown
Contributor

Two follow-on fixes from the fetch-binding hotfix (PR #9, already merged), per team-lead direction.

Summary

1. Header: fall back to URL host when vault name is empty

Aaron hit a blank <option> next to the Manage button. Root cause: the unscoped OAuth token response (/oauth/authorize vs /vaults/<name>/oauth/authorize) returns an empty vault field, so VaultRecord.name is blank for default-vault connections.

src/components/Header.tsx now uses name || new URL(v.url).host || v.url and sorts by the computed label. Three tests cover the full fallback chain.

2. vite.config.ts: gate exposed dev server behind VITE_EXPOSE=true

Aaron needs the dev server reachable over his tailnet, but permissive binding shouldn't be the committed default. Gate host: "0.0.0.0" and allowedHosts: true on process.env.VITE_EXPOSE === "true". README documents the flag under Development.

Follow-up (non-blocking, tracked separately)

The vault's unscoped OAuth token response returns an empty vault field — either it should include the default vault's actual name or omit the field entirely. Will file an issue on parachute-vault.

Test plan

  • bun run lint clean
  • bun run typecheck clean
  • bun run test — 104 tests pass (3 new Header tests)
  • bun run build succeeds
  • Aaron verifies the vault dropdown shows a label for default-vault connections
  • Aaron verifies VITE_EXPOSE=true bun run dev accepts his tailnet host; bun run dev (default) does not

🤖 Generated with Claude Code

unforced and others added 2 commits April 18, 2026 16:25
The unscoped OAuth token response (/oauth/authorize vs
/vaults/<name>/oauth/authorize) returns an empty vault field, leaving
VaultRecord.name blank. The vault switcher then rendered a blank
<option>, so Aaron saw an empty dropdown next to Manage.

Use name when present, otherwise the URL host, otherwise the raw URL.
Tests cover all three branches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Binding to 0.0.0.0 + accepting any Host header is useful when reaching
the dev server from another device on a tailnet, but permissive by
default isn't the right committed behavior. Gate both on
VITE_EXPOSE=true so the default stays locked down. README documents
the flag under Development.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant