Hangar: local dev environment (multi-server, backups, ngrok, UX)#49454
Draft
AndreyKizimenko wants to merge 9 commits into
Draft
Hangar: local dev environment (multi-server, backups, ngrok, UX)#49454AndreyKizimenko wants to merge 9 commits into
AndreyKizimenko wants to merge 9 commits into
Conversation
Moved off rc-minor-fleet-v4.89.0 where it was sitting uncommitted. Adds per-server orchestration (ServerSwitcher, servers/ipc libs) and related Go service + frontend changes across the Hangar dev tool.
Backups now live under the app-data dir keyed by server id (surviving worktree teardown), and the backup/restore docker command is built by Hangar itself instead of the worktree's tools/backup_db scripts — so a secondary worktree on an old ref can't silently target the primary stack. The Database tab can browse and restore another server's backups into the active server.
startServe only spawns the process, so the button re-enabled instantly and looked spammable while the server was still booting. Hold the busy state until health reports it up (with a timeout safety net).
A renamed/removed tunnel lingered in default_tunnels (no chip to unpick it) and was still passed to `ngrok start`, which failed. Drop selections that no longer exist in the yml on a valid parse, in both the Server and Settings tabs.
Fetch running tunnels from ngrok's local API (127.0.0.1:4040) and render each public_url as a clickable link on the ngrok card while it's running.
The fleet-serve card links to https://<project>.localhost:PORT (isolated login cookie per host — Chrome/Firefox resolve *.localhost with no setup) and https://localhost:PORT, so signing into one local server no longer clobbers another's session.
Replace the per-server accent dot + cryptic s/d badges with one dot that's green when anything's running on that server, grey otherwise — matching the Server-tab process cards. Server identity stays on the name + active border.
Split the tab bar into server-scoped (Git/Server/Logs/Database) and global (fleetctl/GitOps/osquery-perf) groups, and fade the server switcher on global tabs where the selection doesn't apply.
A dedicated filter for a single branch was noise. Fetch main separately and render it as the first row of the RC list; a search still matches across all refs.
AndreyKizimenko
temporarily deployed
to
Docker Hub
July 16, 2026 23:40 — with
GitHub Actions
Inactive
7 tasks
Contributor
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
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.
Related issue: N/A — internal developer tooling (
tools/hangar).Summary
Fleet Hangar is the local dev-environment control panel (
tools/hangar, Go + Wails). This PR builds out multi-server support — running up to 3 independent local Fleet servers in parallel, each on its own git worktree, offset ports, and docker compose project — plus a set of refinements found while QAing it.Opening as a draft for transparency. All changes are confined to
tools/hangar/; nothing touches the Fleet server, agent, or any shipped code.What's here (one commit per item):
dockercommand is built by Hangar itself instead of the worktree'stools/backup_dbscripts (so a secondary worktree on an old ref can't silently dump/restore the primary stack), and the Database tab can browse and restore another server's backups into the active server.fleet serveis actually listening.ngrok.yml.https://<project>.localhost:PORT(isolated login cookie per host) plushttps://localhost:PORT, fixing cross-server session clobbering.Checklist for submitter
If some of the following don't apply, delete the relevant line.
Changes file added for user-visible changes — N/A:
tools/hangaris a developer tool and is not part of a Fleet release.Input data is properly validated,
SELECT *is avoided, SQL injection is prevented, JS inline code is prevented, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.[A-Za-z0-9._-](and rejected if starting with.); server-id path segments are sanitized to[A-Za-z0-9_-](no dots, so no traversal); paths interpolated into thedockercommand are single-quoted.Timeouts are implemented and retries are limited to avoid infinite loops
If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI — N/A: no Fleet server API changes.
Testing
Database migrations
N/A — no database migrations.
New Fleet configuration settings
N/A — no Fleet server configuration settings (Hangar stores its own settings in app-data).
fleetd/orbit/Fleet Desktop
N/A — no fleetd/orbit/Fleet Desktop changes.