Compare commits

..
Author SHA1 Message Date
pascal af49dd6870 add timeline 2026-07-28 18:58:51 +02:00
pascal f6479c1f84 put on top of changeset branch 2026-07-28 17:13:13 +02:00
Eduard GertandClaude Fable 5 b523a7aa46 Live destination cards: match peer card height, show network inline
- Live destination peer cards (ResourceNode standalone branch) get the
  shared 64px card height instead of the old py-1 metrics
- Live standalone resource cards show "Name - Network" inline like
  draft (only drilled views keep hiding it - the header names it there)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 17:36:39 +02:00
Eduard GertandClaude Fable 5 8d66b88fea Clarify panel discard dialogs
"Discard changes to X?" read like dismissing the popup — the dialogs now
state the situation ("You have unsaved member/group changes") and spell
out that closing the panel loses the toggled assignments; the confirm
stays the short "Discard".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 16:30:11 +02:00
Eduard GertandClaude Fable 5 c8ba72517c Components panel: no blink on tab switch
Tab/search changes no longer remount the Virtuoso list (which painted
empty for a frame while measuring) — the mounted list scrolls back to
the top imperatively instead; the open/close remount for fresh
measurements stays.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 16:19:46 +02:00
Eduard GertandClaude Fable 5 ccd5440a5f Panels swap in place and virtualize; edges pass drags to the pane
- Group/peer panels: no remount on target switch (motion key removed,
  placement kept) — the slide-in only plays when opening from closed;
  search/tab/selection still reset per target
- Peers, resources, and groups lists virtualize with react-virtuoso
  through the styled scroll area (shared PanelVirtuosoScroller); lists
  remount per target so scroll offsets don't carry over
- Edges (and their wide interaction path) get pointer-events: none —
  no edge has a click action, so dragging over connection lines now
  pans the canvas; replaces the dimmed-only rule

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 16:15:57 +02:00
Eduard GertandClaude Fable 5 fab63e2c08 Highlight Connections polish; fix draft-entry policy column gaps
- Rename Focus to "Highlight Connections" (Waypoints icon): context menu
  item, header pill text, exit aria-label. No ring on the highlighted
  node (the dim is the signal) and no menu entry on it while active
- Availability relaxed: any node with an edge, as long as the canvas has
  at least two policies
- Dimmed edges get pointer-events: none (incl. the wide interaction
  path) so drag-to-pan works over them in highlight mode
- Draft entry from peer view: adopt live twin sizes BEFORE the build
  layout — its overlap pass measured fresh nodes with an 80px fallback
  and shoved the 60px-pitch policy column apart (huge gaps until Auto
  Arrange re-ran on measured nodes)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 16:03:51 +02:00
Eduard GertandClaude Fable 5 700950b452 Peer rename in canvas context menu; user-device modal says Assign
- Extract the peer page's Edit Peer Name modal into shared
  EditPeerNameModal and reuse it from the control-center context menu
  (existing peers only, permission-gated); saving PUTs the peer,
  patches canvas nodes in place, and revalidates /peers
- User-device setup modal: "Select" -> "Assign" (header, step 2, button)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 15:42:37 +02:00
Eduard GertandClaude Fable 5 344004f05e Align live canvas card heights and text metrics
- Peer, placeholder, select-peer, and select-user nodes all match the
  group node's 64px height
- SelectGroupNode padding py-3 -> py-3.5 (same as GroupNode)
- DeviceCard default variant adopts the placeholder card's tighter
  title/subtitle metrics so installed and pending peers read the same
- User select avatar on the peer icon-box surface (nb-gray-850)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 15:31:54 +02:00
Eduard GertandClaude Fable 5 77fa76d9f1 Draft mode: install steps, group sync, placeholder flows, e2e suites
Placeholder peers (user device / server / agent):
- Track pending installs as install-peer changeset entries: own "Install"
  section in Review & Deploy, resolved by install/select or removal,
  renames follow, deploy skips them (user steps, not API calls)
- User-device setup stepper modal (install NetBird -> select peer);
  the canvas node drops its inline select, upgraded placeholders always
  become plain peer cards
- Placeholders open the peer groups panel (click or Details); assigned
  existing groups ride on the generated setup key as auto_groups
- Group panel lists absorbed draft members (held on the group node) with
  NEW badge, IP/address placeholders, and alert CTAs: "Install or assign"
  / "Install" / "No network" (network picker works node-less via
  assignHeldResourceToNetwork)
- Install hostname matching also scans group-held placeholders

Groups & policies:
- Group renames and membership changes propagate into the group copies
  held by policy nodes/edges (policy-group-sync) so the edit modal and
  PeerGroupSelector stay current
- New side groups added while editing a policy join their column
  (same x, stacked below) instead of landing at the origin
- Group names: "All" reserved, duplicates rejected against canvas drafts
- Dropping into "All" rejected; All still mirrors draft peers added to
  other groups (implicit membership, never deployed)
- No-network draft resources can join groups
- Delete/Backspace routes through the context menu's Remove semantics
  (useNodeRemoval) instead of React Flow's raw deletion

Review & Deploy:
- Canvas warnings for undeployable states (placeholder-peer policies,
  unassigned resources); modal stays open on partial failure so a retry
  resumes; update-group deploys against fresh API state
- Focus mode is explicit only (context menu / header tool) - left-click
  opens panels without dimming
- Drop-eligible groups show a white border mid-drag

Tests & docs: interaction matrix spec (specs/interaction-matrix.md),
three Playwright suites (lifecycle, connections, full matrix) on a shared
e2e helper, testids across draft controls, unit tests for canvas
warnings and policy-group-sync.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 15:19:46 +02:00
Eduard GertandClaude Fable 5 9dec55718b Live resource edit/disable, peer Details in context menu, dialog polish
Live resources open the networks page's resource modal on click (PUT on
save) and their context menu offers Focus / Edit / Disable — every
action behind the live-mode warning; the canvas patches from the
response. Peer context menus gain Details (opens the groups panel);
live group Delete is dropped (Focus / Details / Rename remain). Dialog
confirms gain an opt-in dismissOnOutsideClick, enabled for all
control-center warnings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 12:09:57 +02:00
Eduard GertandClaude Fable 5 afad7ebbe3 Peer groups panel: click a peer to assign its groups
Clicking a peer opens the peer-side twin of the group panel — one Groups
tab listing every group ("All" excluded, draft-created ones included)
with assigned-first frozen order, search, and batch apply: draft stages
adds/removes into the changeset (canvas group nodes update in place),
live PUTs each changed group behind one warning confirmation. Same
chrome and close semantics (ESC keycap, discard guard, pane click), and
the clicked peer wears the panel halo — selectedPeerPanel lives in the
narrow DestinationGroup context so PeerNode can ring without
subscribing to CanvasState.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 11:53:06 +02:00
Eduard GertandClaude Fable 5 5f352614c8 Order drilled resources like frames; size network selector to its labels
The live single-network view now runs its resource column through
orderFrameResources, so the drilled view, the draft drill-down and the
overview frames all agree (policy-reached resources first). The network
selectors (live + draft drill-down) size to their longest option label,
clamped to the old 256px as max.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 11:33:41 +02:00
Eduard GertandClaude Fable 5 65b8f59031 Focus via context menu, live group actions, drilled group order parity
Focus Mode is entered from the node context menus ("Focus", shown only
where it declutters — 4+ edges and 2+ policies in the neighborhood, via
isFocusWorthy) or the "F" shortcut; the header button is gone and the
top-center pill owns the key handling. Live right-click now also covers
groups (Details / Rename / Delete behind live-mode warning confirmations,
PUT/DELETE + canvas patch) and peers/resources (Focus).

The shared drilled layout sorts both group columns by name so the live
single-network view and the draft drill-down agree on the order.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 11:25:51 +02:00
Eduard GertandClaude Fable 5 515ab88182 Rework focus mode into an explicit header tool; restore policy click-to-edit
Focus Mode is now armed from a header button next to the mode switcher
(SquareDashedMousePointer, sky accents, "F", switcher-style shell): the
next node click picks the focus target — hover previews the ring, node
buttons are inert, selectors/edge-less nodes are unfocusable — then the
mode goes sticky: the target keeps a glowing sky ring (cc-focus-root),
on-path nodes stay clickable/movable (dimmed ones lock), group panels
open without stealing focus, and only Esc / the top-center pill's X /
the button exit. The pill (switcher surface, fully rounded) names the
focused node. Fit-view moves to "1" to free F.

Policy left-click opens the editor again (live and draft); the context
menu keeps Edit/Disable. Network frames order policy-reached resources
first, via one shared helper so live and draft frames agree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 18:19:19 +02:00
Eduard GertandClaude Fable 5 102891784e Add a Beta badge to the Draft tab in the mode switcher
Same SmallBadge treatment as the sidebar's Reverse Proxy entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 17:33:02 +02:00
Eduard GertandClaude Fable 5 523095d3bd Rebuild the group panel as a membership editor with checkbox assign
The destination group panel becomes a search + Peers/Resources tabs
editor (PeerGroupSelector-style rows and checkboxes): toggles edit a
local selection previewed on the node's count text, and Assign (draft)
stages ONE coalesced update-group change while Save (live) PUTs behind
the live-mode warning. Implicit closes (Esc, keycap, pane click) confirm
before discarding unassigned toggles via a shared close guard; Cancel
discards directly. The changeset/deploy pipeline learns member REMOVALS
(removedPeerIds/removedResourceIds + removedMembers node sets).

Panel chrome: components-panel surface, right-anchored full-height with
header-width tracking (in-place on width changes — no flash), toolbar
spring slide-in, singleton mount, frozen row order per open, and the
canvas pans the group node clear of the panel. Focus mode is skipped for
nodes without connections, and mode switches close the panel and drop
node selection.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 17:30:52 +02:00
Eduard GertandClaude Fable 5 5a113b6b64 Reset the components panel scroll when switching category tabs
Virtuoso keeps its scroll offset across data swaps, so changing the
category (or entering/leaving search) landed mid-list at the previous
tab's position. Remount the list on category/search-mode changes, like
the existing open/close remount.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 16:27:02 +02:00
Eduard GertandClaude Fable 5 25cc20efcc Pin the draft frame grid to the live overview's fixed midline
The draft build centered the frame grid on the measured midpoint of the
source/policy columns, which always landed a few px off the live
overview's fixed midline — and the live-frame anchor shift then pushed
that delta onto the columns, so peer/policy cards hopped a few pixels on
every live↔draft switch. Use the same fixed midline as live
(SOURCE_NODE_HALF_HEIGHT) so the geometry matches exactly and nothing
moves.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 15:35:30 +02:00
Eduard GertandClaude Fable 5 e23272d163 Align the networks overview's columns with the other views' anchors
Policies move from x 480 / -17 center offset to the shared x 500 / +14
anchor, sources drop their -30 half-height shift, and the frame grid
centers on the columns' midline instead — so a policy and its source
keep their world position when switching between the peer/user/group
and networks views. The draft build layout mirrors the same change to
keep entry/Auto Arrange parity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 15:27:40 +02:00
Eduard GertandClaude Fable 5 80254c7d9a Keep the focused node draggable in focus mode
Focus mode turns global nodesDraggable off so dragging pans, which also
froze the focused node itself. The dim effect now stamps a per-node
draggable: true on the focus root (overrides the global flag) and strips
it when focus ends — works for policy/peer/resource focus and the group
panel alike.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 15:20:27 +02:00
Eduard GertandClaude Fable 5 dd08aea531 Focus policies/peers on click; live policy context menu with Edit + toggle
Clicking a policy or peer now enters focus mode (path highlight + blue
ring) in live and draft instead of opening the policy modal. Policy
editing moves to the right-click menu: in live it offers Edit and
Disable/Enable only — both behind a "you are in live mode"
confirmation — applying via updatePolicy and patching the canvas in
place through refreshLiveViewRef. No Delete in live.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 15:16:40 +02:00
Eduard GertandClaude Fable 5 63abf6bbfb Keep parents before children on the controlled canvas
On a controlled flow, instance.setNodes round-trips through
applyNodeChanges, which keeps replaced nodes at their ORIGINAL index —
so reparenting a resource that predates its frame (network drop
adoption, assign-to-network) left the child in front of the frame and
ReactFlow dropped the containment: correct parentId in state, card
rendered detached at frame-relative coordinates.

Reconcile the invariant centrally in onNodesChange (and heal persisted
snapshots saved with the bad order on draft restore). Also stamp the
owning network on policy-drop destination resources so they don't show
"No Network".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 14:49:17 +02:00
Eduard GertandClaude Fable 5 5605ff4eed Adopt pre-assigned draft resources when their network lands on canvas
Assigning a resource to a network that isn't a frame yet stamps only the
ref; dropping that network later now adopts those resources into the
frame (and the create-network assign waits for the frame to reach the
ReactFlow store instead of racing it on a 0ms timeout).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 14:49:05 +02:00
Eduard GertandClaude Fable 5 1b29d44146 Make Auto Arrange object-aware: resolve node overlaps after layout
Stragglers outside every layout column (e.g. a standalone resource in a
frames draft, type-bucketed at x 1400 inside the frame grid) could land
on top of another node. Add resolveNodeOverlaps to the shared draft
build layout: larger nodes anchor, smaller intersecting nodes are nudged
the shortest way clear plus a 40px margin, re-checked until free.
Detection is exact intersection so tight column rhythms keep entry-layout
parity. Unit-tested.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 14:21:41 +02:00
Eduard GertandClaude Fable 5 3516fa6f42 Make Auto Arrange reproduce the initial layout in every view
Extract the draft build layout into utils/draft-build-layout.ts
(applyDraftBuildLayout) and use it for the toolbar's Auto Arrange, so
arranging an untouched draft matches the entry layout exactly for drafts
entered from any live view; drill-downs re-run the shared drilled layout.
Delete the divergent applyDraftArrangeLayout and its height-aware pitch
machinery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 14:15:16 +02:00
Eduard GertandClaude Fable 5 d103f171ea Polish the Assign a network modal
- Footer buttons follow the shared modal pattern (right-aligned, gap-3)
  with the header's separator color; CTA renamed Save -> Assign Network.
- Network select: search inside the popover, popover matches trigger
  width, list capped at 190px, placeholder "Select or create a
  network...".
- New optional `footer` slot on SelectDropdown: content pinned below the
  scrollable options (always visible regardless of scroll/search) — used
  for "Create New Network", styled like a regular entry.
- Creating a network opens the Add Network form ON TOP of the picker
  (nested modal); Cancel returns to the picker instead of closing both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 13:59:24 +02:00
Eduard GertandClaude Fable 5 8583fd9175 Gate canvas deletion: nothing in live, no standalone edges in draft
onBeforeDelete on the ReactFlow canvas: live mode blocks Backspace/
Delete entirely (the canvas mirrors the account); draft mode keeps node
deletion (edges cascade with their endpoints) but never deletes a
selected connection on its own.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 12:48:57 +02:00
Eduard GertandClaude Fable 5 d43c51495d Center-align source/policy columns with network frames
The networks view stacked source and policy node TOPS on the column
midline while the frame grid centers frames on it, leaving a lone peer
~30px and a policy pill ~17px below their frame. Both the live overview
and the draft rebuild now subtract shared half-height constants.

Draft fixes this exposed: packFrameGrid also runs for a single frame
(previously left at the far layout column, so the live-anchor shift
dragged the columns ~350px out of line), and the frame-grid midline
falls back to the live twin's measured height instead of an 80px guess.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 12:39:44 +02:00
Eduard GertandClaude Fable 5 47a01c68c1 Unify column spacing and kill the live<->draft mode-switch flicker
- Source columns (live peer/group/user views, user-view peers, draft
  rebuild) share the destination column's 100px pitch instead of 80/120.
- Live destination resources show "Name - Network" inline like draft
  (network ref stamped in addDestinationResourceNodes).
- Draft rebuild: dual-role groups (source AND destination) restack in
  the destination column like the live view shows them.
- Mode-switch flicker: React Flow hides unmeasured nodes for one frame,
  blanking the swapped canvas. Draft nodes now adopt their live twin's
  measured size (initialWidth/Height), including renamed ids (self-ref
  dest-group clones, destination resources/peers).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 18:04:01 +02:00
Eduard GertandClaude Fable 5 966d7bca36 Group view: show policies where the group is a destination
Policies were matched by rule.sources only, so a destination-only group
rendered an empty view. Those policies now render mirrored to the left
(sources -> policy -> selected group); source groups carry explicit
enabled state so they don't fall back to the incoming-edge check and
render dimmed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 17:38:25 +02:00
Eduard GertandClaude Fable 5 e3ef24e9bd Rewrite control-center CLAUDE.md: 326 → 67 lines
Keep architecture, layout/sort parity rules, changeset/deploy facts, and
the hard-won perf/camera gotchas; drop per-file trees and feature
narration discoverable from code. Fix stale claims (change types,
deploy order, provider names, focus-mode scope).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 17:27:25 +02:00
Eduard GertandClaude Fable 5 e79de5e317 Match draft rebuild layout/order to the live view it was entered from
Peer/group/user-entered drafts used the networks-overview rhythm (160
base, policies 480/90) and scattered destinations across layout buckets.
Now frameless drafts use the live views' spacing (120 + DEFAULT_LAYOUT_
CONFIG), restack destinations as one x1000/100 column ordered like live
(groups first, then resources/peers by first policy edge), sort policies
with the views' sortBy, and name-sort destinations on group-view entry.
Existing destination resources get their real network stamped (no bogus
"No Network" badge), and the live destination-peer card sizes to content
(w-auto) like the draft peer card.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 17:21:30 +02:00
Eduard GertandClaude Fable 5 a6f43c8ef0 Fix top-left node flash when returning to control center
On client-side nav back to the page, nodes commit before fitView's
measurement wait completes and painted at the default viewport. The
first fit after mount now hides the viewport (cc-prefit, instant hide),
snap-fits without animation, and fades the scene in already framed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:57:45 +02:00
Eduard GertandClaude Fable 5 cc0455d4a5 Unify live/draft network view: interactive live frames, matching layout
- Live frames gain the draft chrome for real: Add Resource opens the
  networks ResourceModalContent (real POST), routing bar Add + zero-state
  open the real RoutingPeerModalContent; the Add band is reserved in both
  modes
- Live frames contain destination resource-group rows like draft
  (per-network ids); peer-only destination groups are skipped in the
  networks view (live never drew them; networks-entered drafts drop them
  + their edges); draft group folding matches canDropGroupIntoNetwork
  (one member resource in exactly one network, peers don't block)
- Identical geometry and order across modes: shared FRAME_GRID_BASE_X,
  frame heights re-seeded after folding, group rows first, sources
  (groups + source peers) as ONE 160-pitch column, policies at x480/90,
  every column + the frame grid sorted by name
- Routing-peers dropdown polish: rows prefetch on trigger hover (no
  skeleton flash), skeleton geometry matches the final list, exact list
  height (no scrollbar for short lists), tighter search-to-rows gap

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:48:57 +02:00
Eduard GertandClaude Fable 5 f3d4ef75ae Focus mode works in draft mode too
useGroupFocusDim and the focus drag-lock no longer gate on live mode;
className joins the history's transient keys so focus toggles never
create undo entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:05:22 +02:00
Eduard GertandClaude Fable 5 b3dde3f6a2 Live focus mode + policy nodes in networks overview; drop user-detail view
- Networks overview builds source -> policy node -> network frame with
  smart edges (like draft) instead of labeled straight lines; sources
  left, policies middle, packFrameGrid right; frames whose policies are
  all disabled dim (frame + child rows)
- AnimatedLine is a SmartEdge-style bezier with a midpoint label chip
  (orthogonal channel router removed); drill-out reveal zooms out
- Focus mode (live): clicking a group opens its panel, clicking a
  peer (user view) or resource card sets focusedNodeId; everything off
  the node's path dims to grayscale (forward+backward closures) via
  cc-dimmed className; dimmed nodes are non-interactive and clicks fall
  through to the pane which exits focus; node dragging disabled while
  focused (dragging pans; per-node draggable:true removed - it
  overrides the global flag)
- User-detail view removed: previousSelectedUser breadcrumb,
  forceSinglePeerView/forceSingleUserView, user-peer history level,
  onForceSingleUserView
- Bigger frame grid gaps (280/200)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:03:27 +02:00
Eduard GertandClaude Fable 5 93010cd3d7 Drill-out reveal zooms out instead of growing in
The fly-out's reveal reused the drill-in's grow-in (0.7x -> fit), which
read inverted going back; direction "out" now starts at 1.45x and
settles outward, mirroring the dive.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 14:56:12 +02:00
Eduard GertandClaude Fable 5 34b2ce3493 Fix whole-canvas re-renders: stable ReactFlow props + memoized contexts
React profiler showed ~2700-fiber User-Blocking commits (120-170ms) on
every drag tick, hover flip and click. Root causes and fixes:

- DraftModeProvider context value memoized (hover state changes handed a
  fresh value to every useDraftMode consumer = every node)
- Every callback/object prop on <ReactFlow> is identity-stable via
  useStableHandler; inline callbacks defeated GraphView's memo so each
  nodes update re-rendered the entire canvas subtree
- selectedDestinationGroup split into its own context (group click
  re-rendered every node via useCanvasUI)
- Edges subscribe to endpoint rects via useEdgeNodeRect (value equality)
  instead of useInternalNode; ResourceNode's parent-hidden check likewise
- elevateEdgesOnSelect off (edge DOM reshuffle restarted dash animations)
- Draft persistence + history capture skip while dragging and pre-check
  structurally before stringifying; history ignores transient node state
- Lazy router-rows fetch for draft frames too; Add Resource button uses
  a ref instead of mounting useControlCenterData per frame
- Components panel, PeersToolbar, DestinationGroupPanel, CanvasToolbar,
  DraftEmptyCanvas subscribe structurally (useStructuralNodes), not to
  the churning canvas context
- Drag drop-target highlight throttled to ~8px steps
- Live networks overview arranged like draft (sources left, packFrameGrid
  staggered frame grid right; d3 force layout removed from this view)
- Draft build: resource-only destination groups fold INTO their network
  frame; frames seeded with the capped grid; useAnySourceGroupEnabled
  skips when enabled is explicit

Verified via Chrome trace on the live app: 4ms/s JS during a 125Hz drag
over 36 network frames, no long tasks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 14:50:43 +02:00
Eduard GertandClaude Fable 5 be6744aa18 Live view policy destinations render as cards
destinationResourceNode gets standalone: true in the shared builder —
resource destinations route to the StandaloneResourceNode card, peer
destinations get the same card surface as PeerNode's card variant
(previously both were transparent rows).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 10:44:20 +02:00
Eduard GertandClaude Fable 5 6eec46e37c Draft overview network selector + drill history survives mode switches
Draft mode (not drilled) shows the top-left network SelectDropdown like
live: "All Networks" first, canvas frames sorted by name, picking one
drills in. Drill history entries are consumed deferred (150ms) so the
transient deactivation during draft/live switches reuses the entry
instead of racing history.back() — browser Back after switching modes
now exits to the overview instead of leaving the page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 10:24:26 +02:00
Eduard GertandClaude Fable 5 a9836381d4 Hide peer connect handles in live networks view
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 10:13:19 +02:00
Eduard GertandClaude Fable 5 5882d95343 Browser Back exits canvas drill-downs; lighter simple connection lines
useDrillDownBrowserHistory tracks a stack of drill levels (network
drill-down, user-to-peer breadcrumb): entering pushes one same-URL
history entry, popstate exits through the same path as the UI back
arrow, UI exits consume the entry silently. SimpleConnection stroke
lightened from #595959 to #7d7d7d.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 10:08:57 +02:00
Eduard GertandClaude Fable 5 6526f72f4d Fix misaligned camera when returning to control center via client nav
Warm SWR cache makes the view initialize before ReactFlow measured the
freshly remounted nodes; fitView now retries (bounded rAF loop) until
every target node has a measured size before fitting.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 09:54:58 +02:00
Eduard GertandClaude Fable 5 8aebc55be2 Group view initial pick falls back to All when only All has policies
getFirstGroup excluded All from the has-policies check, so an empty
non-All group could win over a populated All view. New order: non-All
group with policies, then All with policies, then any non-All, then any.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 09:51:54 +02:00
Eduard GertandClaude Fable 5 aeea740bd2 User view peers render as draft-style cards without connect handles
PeerNode now always renders the invisible AllHandles edge anchors
(GroupNode's pattern) so showHandles:false only hides the visible
connect bubbles instead of detaching edges.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 09:39:39 +02:00
Eduard GertandClaude Fable 5 7c0f6b4d66 Live policy saves patch the canvas in place from the PUT response
No more waiting on the SWR /policies revalidation (or a layout reset):
refreshLiveView rebuilds the current view with the saved policy spliced
in, keeping positions and camera; all view appliers accept a
policiesOverride and the policy modal reads the canvas node's policy
first in both modes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 09:29:26 +02:00
Eduard GertandClaude Fable 5 9908a5ddcb Shared drill-down canvas transition (dive/fly-out) for draft and live
utils/canvas-transition.ts: one continuous zoom stitched across an invisible
swap — accelerating dive/zoom-out + fade-out (half ease-in), swap while
transparent, grow-in reveal + fade-in (half ease-out) into a viewport
computed from the new scene. One-liner facades drillInto/drillOutOf (Node or
Rect targets) for any future drill-down; isCanvasTransitionActive suppresses
view-init fitViews mid-transition.

- Draft drill-down enter/exit refactored onto it (position-aware close-up on
  exit, exitingRef guards the reconciling repair; frame layout + edge
  attachment + row/card rendering key off frame.hidden so nothing morphs
  while visible)
- Live network select dives into the clicked frame (dropdown picks zoom from
  center), back flies out to the overview

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 17:54:02 +02:00
Eduard GertandClaude Fable 5 acabf71011 Exiting draft mirrors the draft's drill state in live
Backed out of the drill inside draft → live lands on the all-networks
overview instead of the stale drilled snapshot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 16:41:19 +02:00
Eduard GertandClaude Fable 5 9e5816c5a4 Unify the single-network (drilled) layout across live and draft
- utils/drilled-layout.ts: ONE layout (applyDrilledLayout, 95px resource
  pitch, getDrilledFrameAnchor incl. the column's +5 centerY offset) shared
  by the live single-network view, the draft drill-down, and live→draft
- Draft drill re-lays the kept world out with it (parent positions
  snapshotted, restored on exit with hidden flags + viewport); drilled frame
  grid is a fixed-pitch single column, cards auto-size (no forced width)
- Live networks render as read-only frames (RoutingPeersBar without Add,
  frame anchors/handles for edges, hover highlight, click/row-click drills,
  bottom padding instead of the draft Add band); drilled resources render as
  standalone cards in live too, with direct policy→resource edges
- Entering draft from live drilled carries the network as a frame and enters
  the draft drill-down in the same commit (pre-hidden, no flash); exiting
  draft while drilled lands in the live view of that network
- Live all-networks lines are blue with an All fallback label; peer sources
  drawn in both live network views; NEW badge only for id-less networks
- Drill header: name chip matches the live selector (icon size/color,
  typography, paddings), edit segment for all frames (existing networks open
  the real network modal), RoutingPeersBar height/chevron aligned with the
  fixed-height network selector; SelectDropdown defers onChange past its
  close animation (no blink) and uses a 16px chevron

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 16:14:07 +02:00
Eduard GertandClaude Fable 5 48e899ed65 Shared RoutingPeersBar for draft frames and the live network header
Extracts the frame's [status | Add] routing button group + searchable
routers popover into RoutingPeersBar (indicator, row type, peer-count and
sort helpers). NetworkNode consumes it unchanged; the live single-network
header's NetworkRoutingPeerCount now renders the same bar over the API
routers, with Add/edit navigating to the routing-peers tab. Status button
left padding 14px.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 12:37:13 +02:00
Eduard GertandClaude Fable 5 fc68538457 Frame's Add Resource button drops a blank row instead of opening the editor
Matches the context menu's Add Resource (addResourceToFrame); the editor
still opens on row click.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 12:14:40 +02:00
Eduard GertandClaude Fable 5 b994d703ff Network frame routing-peers dropdown
- Frame status button gains a ChevronsUpDown trigger and a PeerSelector-style
  popover (search by peer/group name, no enter badge): one row per router with
  muted OS icon + peer name or group badge + group name (peer count inline)
- Draft router rows open the routing-peer modal prefilled (editChangeId on
  routingPeerModal); save replaces the create-router change
- Status counts peers, not routers: groups contribute their peer count,
  disabled routers contribute nothing and render at 50% opacity, sorted last
- Floating bar nudged 2px left; NetworkRouter API routers of existing
  networks are listed too (read-only)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 12:08:18 +02:00
Eduard GertandClaude Fable 5 59af25d45c Groups can drop into network frames; selection, count-label and grouping fixes
- Drag a group onto a network frame → converts in place to a resource-group
  row inside it (same node id, policy edges re-attach to the frame). Eligible
  when the group is empty, has a resource already in that network, or carries
  unassigned draft resources (canDropGroupIntoNetwork, tested)
- Grouped standalone draft resources ride on the group node (data.draftResources);
  dropping the group into a frame records create-resource changes assigning
  them to that network with the group membership
- Frame children are selectable:false — full-width rows no longer join any
  grazing rubber-band selection (phantom Create Group members)
- Create Group resolves draft resources via getDraftResource so their new-…
  ids reach the group (count label, changeset membership, policy regrouping)
- Group count label leads with resources: "2 Resources, 1 Peer"

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 11:24:00 +02:00
Eduard GertandClaude Fable 5 ee7f1d1dfb Resource-sourced drags onto peers/groups open the policy modal flipped
Dragging from a resource onto a peer/group prefills the create-policy modal
with the resource as destination and the peer/group as source (framed
resources keep the network destination scope). Also: context-menu Add
Routing Peer uses Share2Icon, NetworkNode Add buttons use CirclePlusIcon.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 10:56:27 +02:00
Eduard GertandClaude Fable 5 d6bc80670f Dropped and dragged nodes settle on top of the canvas z-order
Shared getTopZIndex (max settled z + 2, beating frames and their children)
applied in placeNode, dropExistingNetworkFrame, addNewGroup, and
onNodeDragStop — e.g. a peer dropped over a network frame paints above it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 10:35:49 +02:00
Eduard GertandClaude Fable 5 e8ba1d7378 Policy Remove empties its sources/destinations; re-drop uses draft state
- Removing an existing policy records an update-policy change with emptied sources/destinations (draft policies still just cancel their pending create)
- Components panel re-drop (and network/resource auto-drawn policies) prefer the pending update-policy state over API data, so a disconnected policy doesn't come back with its deployed sides

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 10:29:01 +02:00
Eduard GertandClaude Fable 5 1f6028253e Draft policies: pull in resource policies on drop, canvas-only policy Remove, delete confirms
- Dropping an existing network/resource also draws the API policies targeting its resources (getPoliciesTargetingResources + drawResourcePolicies)
- Policy context menu Remove (CircleMinus, no confirm) removes only the policy node and edges, keeps sources/destinations on canvas, cancels pending create / drops pending updates
- Deletes (policy/resource/group) confirm: marked for deletion, deleted on Review & Deploy
- Group node removal strips the group from connected policies (like peers/resources); deferred policy sweep skips policies removed in the same cascade
- Remove icons switched to CircleMinusIcon; unit tests for the policy matcher

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 10:15:09 +02:00
Eduard GertandClaude Opus 4.8 b5e3d8ff88 Fix group node "Details" being immediately dismissed
The context menu's item-click and outside-click shared one onClose that
cleared the panel too, so "Details" opened the group panel then instantly
closed it. Split into onClose (menu only, for item clicks — stopPropagation so
it doesn't reach the document listener) and onDismiss (everything, for outside
click/scroll). Details now opens the panel and it sticks; outside click still
dismisses menu + panel in one click.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 17:09:15 +02:00
Eduard GertandClaude Opus 4.8 3a3b0785c3 Fix live hierarchical layout alignment regression
centerNodesVertically is shared by the live hierarchical layout and the draft
auto-arrange; the height-aware pitch added for tall network frames broke live
column alignment (unequal per-node pitches). Make height-aware pitch opt-in
(auto-arrange only); live keeps a fixed pitch so equal-height nodes stay in a
straight line.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 17:03:52 +02:00
Eduard GertandClaude Opus 4.8 0913a6aa2c Standalone resources, existing-network frames, resource changeset ops
- Dropped resources are standalone cards with an inline network label / "No
  Network" picker (DraftResourceNetworkModal); assign via drag-into-frame or
  the picker; extract StandaloneResourceNode
- Existing networks drop as full frames (dropExistingNetworkFrame) with their
  resources as children; reparent an already-dropped resource instead of
  duplicating its node id
- Refactor frame-ness to an explicit data.frame flag (isFrameNode /
  isDraftNetworkNode); network-new- now means only "draft network", existing
  frames keep their real id
- Resource context menu: Edit (all), Enable/Disable, Rename (draft), and
  Remove vs Delete (existing framed) — wired into the changeset via new
  update-resource / delete-resource change types + deploy PUT/DELETE; draft
  enabled folds into create-resource
- Components panel: existing resources show "name - network" and can't drop
  into a frame; resource drags highlight the target frame (white border)
- Frame z-layer so no node renders between a frame and its resources
- Auto-arrange stacks columns by measured node height
- Group node "Details" menu item opens the panel; policy left-click no longer
  leaves a halo; misc spacing/badge/icon tweaks

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 16:57:21 +02:00
Eduard GertandClaude Opus 4.8 aa8be0655d Network frame refinements: resource groups, spacing, auto-arrange heights
- Add "Add Resource Group" context-menu item (default group icon); blank
  group rows drop first in the frame and count toward layout/overflow
- Group naming now consistent ("Group", "Group (2)", …) everywhere
- Resource groups: Rename + Details context menu, sky halo on right-click,
  hover-only white ring during connects, "No Resources" count label
- Group node context menu gains "Details" (list icon) to open the panel;
  clicking a group no longer toggles the panel closed (only outside click)
- Newly added resources/groups always land first in the frame grid
- Auto-arrange stacks columns by measured node height so tall network
  frames (with floating routing bars) don't overlap neighbours
- Tune Add Resource button spacing (top gap + bottom padding)
- Remove routing-peer HelpCircle + HA tooltip; nudge "+N more" cell 1px
- Fix User Device select node NEW badge alignment

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 12:09:57 +02:00
Eduard GertandClaude Opus 4.8 1471767e27 Network frame: floating Add/routing controls + bottom Add Resource button
- PeerNode: server/agent placeholder Install button uses the shared Button
  (secondary, xs) to match the User Device select node.
- NetworkNode: rework the frame's floating controls — an "Add" resource
  control and a routing-peers button group ([● status | + Add]) sized to
  match the Install button (secondary, xs).
- Add a secondary "Add Resource" button in the frame body: centered when
  empty, full-width bottom row once resources exist; opens the resource
  editor. Reserve a bottom band for it in the frame layout (mutually
  exclusive with the "+N More" overflow footer).
- Sparse frames (0/1 resource) match the two-resource width; empty frames
  get a little extra height so the centered button breathes.
- Hovering the floating controls / add button no longer highlights the
  frame or reveals its ConnectHandle (new ConnectHandle `hidden` prop).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 17:28:13 +02:00
Eduard GertandClaude Opus 4.8 b26c6f0a12 Network frame: header Add dropdown + "+N More" overflow footer
Rework the draft network frame's resource affordances:

- Move adding into a header "Add" dropdown (chevron) on the right of the
  name/count, with Routing Peer (server icon) and Resource (resource
  icon) items. Removes the separate "Add" button from the floating
  routing-peer status pill and drops the always-present "Add Resource"
  child row (AddNetworkResourceNode deleted).
- Summarize resources past the visible cap with a "+N More" footer
  rendered by NetworkNode in a band useNetworkFrameLayout reserves at the
  frame bottom (pointer-events-none, so clicking still drills in),
  replacing the fade mask and the short-lived ResourceOverflowNode.

useNetworkFrameLayout is simplified to lay out only resource children and
sweeps legacy add-resource/overflow child nodes from persisted drafts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 10:27:31 +02:00
Eduard GertandClaude Opus 4.8 b1824b50ba Add networks empty with an always-present Add Resource row
New draft networks are created without seeded resources: drop the
layout-testing seed (30 fake resources + 10 resource groups) from
addDraftNetwork so a network starts empty.

Every network frame — including a freshly-added empty one — now always
contains the "Add Resource" child row: useNetworkFrameLayout creates it
if missing and no longer removes it when the frame is empty (dead
obsoleteAddRows path removed). The centered "No resources yet" hint is
gone; the header subtitle reads "No Resources" when empty and the frame
keeps its header separator.

Also removes the bottom-fade gradient overlay from the existing-network
card's resource preview grid.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 09:41:49 +02:00
Eduard GertandClaude Fable 5 9bfb73231d Draft editors, context menus, components panel & selection toolbar
- Resource editor gains a create-mode (frame's Add Resource row opens the
  modal; the node is only created on save) and the provider nesting fix
  for the resource-modal refactor; new DraftNetworkEditModal (name +
  description) shared by the network context menu and drill-down header.
- Context menus: Edit items (SquarePen) for policies/networks/resources,
  policy Remove vs Delete split (draft vs API), PencilLine renames,
  Add Resource on frames, Policy above Group ordering.
- Components panel: draft peers/policies/networks listed with NEW badges
  (IP placeholder, kind icons), "Networks & Resources" category with
  existing networks droppable as live cards, virtualization measurement
  fixes, panel hides once a real drag starts.
- Selection toolbar: Remove option next to Create Group, padding fix.
- Auto-names drop the "New " prefix ("Group", "Resource").

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 17:54:06 +02:00
Eduard GertandClaude Fable 5 987054f765 Network frames v2: destination picker, drill-down, routing modal, layout
Spec §10 implementation plus the frame interaction model:

- Connections: peer/group drops onto a frame or its contained rows open
  the create-policy modal (source prefilled, destination scoped to the
  network, one-way); POLICY↔network drags open the minimal destination
  picker (DraftNetworkDestinationModal). Drag no longer creates routers.
- Policy edges to framed resources attach to the frame in the parent view
  and to the actual resource in the drill-down (useFrameEdgeAttachment,
  pure logic + tests in utils/frame-view).
- Drill-down: clicking a frame enters a live-mode-like single-network view
  (no frame box, square-ish grid, back/name/edit/routing-count header);
  hidden flags + viewport restore on exit.
- Routing peers: the frame button group and context menu open the networks
  page's routing-peer modal; routers are changeset-only (no canvas nodes),
  counts derive from create-router changes, deploy sends the modal's
  metric/masquerade/enabled.
- Frame layout: 4x2 row-major grid capped at 6 visible resources with a
  fade-out on the last row, always-visible Add Resource row, tunable
  padding/gap/width constants, drop z-order fix for stacked frames.
- Node visuals: NEW badges after draft names, frame-hover highlights
  header/border/icon boxes, placeholder select copy, min widths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 17:53:51 +02:00
Eduard GertandClaude Fable 5 71cc5c038d Pure-data modal modes and draft-aware props for shared components
- NetworkModal, NetworkRoutingPeerModal and NetworkResourceModal gain a
  useSave={false} mode: no API calls, values return via onSaved — the
  draft canvas reuses the exact networks-page modals.
- AccessControlModal: destinationScope restricts the destination selector
  to a network's resources/groups (no peers) and locks the policy one-way.
- PeerGroupSelector: groupIds whitelist (disables inline group creation),
  initialTab (open tab without reordering triggers), scoped empty states,
  and a default icon for type-less draft resources.
- ResourceBadge/PeerOperatingSystemIcon: default resource icon and
  Server/Agent/User-Device icons for draft placeholder peers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 17:53:31 +02:00
Eduard GertandClaude Fable 5 991ee63b6d DRY up NetworkNode and the full-area target handle
NetworkNode: RoutingPeersIndicator and AddRoutingPeerButton extracted
(shared by the draft frame and the live card). The invisible
whole-node target handle becomes handles/FullAreaTargetHandle, reused
by AllHandles, PolicyNode, and NetworkNode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 14:20:59 +02:00
Eduard GertandClaude Fable 5 869ae3af02 Dragging a contained resource moves its network frame
Frame children are draggable again (non-draggable nodes emit no drag
events — the gesture fell through to canvas panning). A drag-start
handler snapshots child + frame positions; each drag tick transfers
the child's displacement to the frame while snapping the child back
into its slot, so the whole frame (and every resource in it) follows
the cursor. Framed resources stay excluded from drag-into-group.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 14:14:22 +02:00
Eduard GertandClaude Fable 5 fe5eae8625 Dragging a contained resource drags its network frame
Restore ReactFlow's fall-through: frame children are non-draggable,
so a drag on a resource moves the parent frame (and everything in
it). Clicks still open the resource editor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:53:49 +02:00
Eduard GertandClaude Fable 5 79096499c1 Stop contained resources from dragging their network frame
Dragging a non-draggable frame child fell through to dragging the
parent — contained resources now carry the "nodrag" class (clicks
still open the editor). Frame width reduced to 340px.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:51:33 +02:00
Eduard GertandClaude Fable 5 c75f4d93f1 Document accepted draft-mode v1 limitations
specs/limitations.md: framed resources can't drag into groups (use the
editor's Groups field), routing-edge-only deletion leaves its router
change, network descriptions not editable on canvas.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:48:49 +02:00
Eduard GertandClaude Fable 5 7d1281f941 Enlarge the draft network frame
420px wide with a taller header (64px), roomier rows and padding;
contained resources keep spanning the frame width.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:46:37 +02:00
Eduard GertandClaude Fable 5 a57f4a6276 Fixed full-width resources inside network frames; roomier nodes
- Contained resources are laid out by the frame: not draggable, and
  spanning (basically) the full frame width; popping out of a removed
  frame restores free dragging and auto width
- Network frame widened (360px) with slightly taller header/padding
  and peer-style hover treatment
- Group nodes get a little more padding

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:44:51 +02:00
Eduard GertandClaude Fable 5 b9e65b1ad6 Simplify draft resource/network node presentation
- No "Set up" affordance above incomplete resources — the dimmed
  x.x.x.x placeholder and click-to-edit carry that state
- The resource editor no longer opens on drop (click / context-menu
  Edit instead)
- Network frames: solid background with a dashed border
- Routing-peer indicator hidden entirely at 0 (the floating Add
  Routing Peer button covers it); NEW badges removed from draft
  resource and network nodes

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:37:59 +02:00
Eduard GertandClaude Fable 5 2f86fd0421 Draft resources: peer-style cards inside auto-created network frames
- Dropping a resource auto-creates a draft network FRAME around it —
  a bordered, slightly opaque container node; the resource lives
  inside as a ReactFlow child (frame grows per member, children pop
  out at absolute positions when the frame is removed)
- Draft networks (panel template + editor inline-create) use the
  frame rendering: header with name/NEW badge/routing traffic light,
  "No resources yet" hint, floating Add Routing Peer button
- The draft resource node mirrors the placeholder-peer card: derived
  type icon box, NEW badge, dimmed "x.x.x.x" address placeholder;
  left-click and context-menu Edit open the resource editor
- Resources carry a single LEFT connect handle — dragging into a
  policy sets it as the destination (source side rejected); network
  assignment reparents into frames instead of membership edges
- Auto-arrange is parent-aware: child connectivity resolves onto the
  frame, children keep their relative positions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:26:08 +02:00
Eduard GertandClaude Fable 5 15475d8b14 Add unit tests for draft networks, resources & routing peers
- draft-connect: peer/group→network router connects, resource→network
  membership, network/resource source rejection, policy-side resource
  rules, draft-resource prefill with derived types
- changeset: create-network/resource/router recording, fold-into-create,
  network removal cascade, group-rename following into resource/router
  refs, placeholder router id renames, membership cleanup
- capabilities: routing-peer/assignable/configurable/renamable matrix
  rows; complete vs incomplete draft-resource groupability
- helpers: address→type derivation, isCompleteDraftResource, policy
  gating on tracked draft resources
- storage: round-trip of the three new change types

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 12:36:34 +02:00
Eduard GertandClaude Fable 5 e89d7251e2 Implement draft-mode networks, resources & routing peers
Implements specs/draft-networks-resources.md (v1):

- Networks drop with a create-network change (unique auto-name,
  deployable immediately); NetworkNode is draft-aware — NEW badge,
  draft resource count/previews, routing-peer traffic light from
  routing edges, floating "Add Routing Peer" button at 0 routers,
  Rename / Add Routing Peer / Remove context menu (removal cascades
  to dependent resource/router changes)
- Resources drop + open the new DraftResourceEditorModal (unique
  name, validated address, network selector with API + draft
  networks and inline create, optional groups/description);
  incomplete resources carry an amber "Set up" affordance and stay
  out of the changeset; completing one re-runs referencing policies
- Routing peers: peer/group → network connects (and the Add Routing
  Peer install flow) draw "routes" edges and record create-router;
  placeholder routers gate until install, then the upgrade sweep
  records them with the real peer id
- Resources are destinations-only (hard-rejected as connect
  sources); draft resources participate in policies with new-… ids
  via additionalResources, join groups (deploy fans membership out
  through the resource's own groups field)
- Deploy: groups → networks → resources → routers → policies with
  networkClientToId / resourceClientToId resolution and live-modal
  router defaults; Review & Deploy shows non-blocking warnings for
  router-less networks and policy-less resources

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 12:36:34 +02:00
Eduard GertandClaude Fable 5 9a7b313a19 Add Vitest unit tests for draft mode logic
npm run test:unit — Vitest + jsdom, no infra (e2e stays on Playwright).

- draft-connect.test.ts: full connect matrix (modal prefills incl.
  placeholders and XOR-side rules; direct policy-side edits with
  handle mapping, duplicate/occupied no-ops)
- node-capabilities.test.ts: per-node-kind capability spec (rename /
  install / peer-select / join-a-group for every node type)
- DraftChangesetContext.test.tsx: coalescing rules via renderHook
- helpers.test.ts: isDeployablePolicy, policy regrouping, IP/hostname
  placeholders
- draft-storage.test.ts: persistence round-trips
- Legacy hand-rolled ip/version test scripts excluded from vitest

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 12:07:36 +02:00
Eduard GertandClaude Fable 5 db261b184a User Device select node, upgrade follow-through, and draft consistency fixes
User Device placeholder:
- Drops a canvas node like Server/Agent, rendered as a live-style
  peer-select dropdown ("Select user device..."); choosing a peer
  upgrades the node in place and keeps the dropdown so the selection
  can be switched — policies and edges follow the new peer
- Install buttons float top-left above all placeholder nodes (inside
  the node so they zoom with the canvas), secondary styling
- Placeholder ids renamed new-<uuid> → draft-<uuid>

Group membership follow-through:
- Grouping/dragging placeholders records them as members with their
  draft ids; on install/select the id is renamed across the changeset
  (replacePeerIdInGroups) and group nodes' addedMembers; deploy
  filters never-installed draft ids
- Group counts/addedMembers update on every canvas instance of a
  group (source node + destination copies)
- Policies referencing a grouped or removed peer/resource are rewired
  (group takes the side) or cleared (side emptied) — an incomplete
  policy drops its pending create/update so broken state never deploys

Other:
- Peer view → draft: the picked peer is skipped when a canvas group
  already contains it (was overlapping the group node)
- Auto-arrange vertical spacing increased (160/80/160)
- Connect rules extracted to utils/draft-connect.ts and capability
  predicates to utils/node-capabilities.ts (pure, unit-testable),
  wired into NodeContextMenu + useDragToGroup

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 12:07:36 +02:00
Eduard GertandClaude Fable 5 ca6ac21d52 Add spec for draft-mode networks, resources & routing peers
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 12:01:15 +02:00
Eduard GertandClaude Fable 5 f27f7b189b Draft peers, blank policies, and placeholder install flow
Components panel & context menus:
- Panel not-found state matches the global search modal styling
- Context menus (canvas + node) flip away from viewport edges
- User Device template delays panel close so its modal opens first
- Template icon boxes match existing entities (solid bg)

Placeholder peers (Server / Agent):
- Node mirrors the real peer card (layout, text sizes, truncation);
  IP slot shows a dimmed placeholder from the account network range
- Unique per-drop names ("Agent", "Agent (1)", ...), renamable via
  context menu with uniqueness check across draft peers
- Selectable in policy modals (additionalPeers in PeerGroupSelector)
  and connectable like real peers via their draft-<uuid> ids
- Install modal suggests a unique hostname (netbird up --hostname),
  stamped on the node; useDraftPeerUpgrade watches the peers list and
  swaps installed placeholders for real peers in place, re-recording
  their policies into the changeset

Policies in draft:
- Policy template drops a blank policy node (no modal) named
  "Policy" / "Policy (1)"; blank/undeployable policies stay out of
  the changeset until they have both sides and no placeholder refs
- Peers can be dragged onto policy sides (single-peer XOR groups)
- Connect prefills the create modal (peers as peer resource, groups
  as lists) and resets stale prefill state on every connect
- Peer selector dropdown opens on the tab of the current selection

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 17:34:01 +02:00
Eduard Gert dee5c6e244 Use SmartEdge for policy edges in live views
Migrate peer/group/user/network view policy edges from the DirectionIn
edge type to SmartEdge, enabling bidirectional rendering and dynamic
side selection in live mode. DirectionIn and BidirectionalEdges remain
registered but unused.
2026-07-15 11:58:00 +02:00
Eduard Gert 6db980fcff Add draft persistence, undo/redo, and review & deploy flow
- Persist draft changes and canvas to localStorage, restored on mount
- Snapshot-based undo/redo for canvas and changeset (DraftHistoryContext)
- Review & deploy modal with grouped changes and deploy changeset hook
- Discard draft flow and leave guard for unsaved drafts
- Group rename modal and draft node creation hooks
- Move components panel into draft/ and adjust related UI
2026-07-15 11:45:32 +02:00
Eduard GertandClaude Fable 5 6a299aa594 Hide network selector in header when no networks exist
In live mode on the networks tab, the header network selector now only
renders when there is at least one network, matching the empty state
shown by ControlCenterEmptyStates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 11:29:27 +02:00
Eduard Gert 050d28d7af adjust empty draft state 2026-07-14 11:59:34 +02:00
Eduard Gert 6abf5d21c1 adjust empty draft state 2026-07-14 11:59:30 +02:00
Eduard Gert 368cfac0fe adjust sidebar 2026-07-13 17:03:09 +02:00
Eduard Gert 5c220e5176 adjust sidebar 2026-07-13 13:45:03 +02:00
Eduard Gert 9f5e0edd45 adjust save and apply 2026-07-09 09:45:01 +02:00
Eduard Gert 9a99c5930f adjust draft mode ui 2026-07-08 17:26:24 +02:00
Eduard Gert 1c10d195e7 add blue halo when selecting node 2026-07-07 12:19:18 +02:00
Eduard GertandClaude Opus 4.7 a57da47f45 Merge control-center-edit: draft mode, canvas toolbar, connect handles
Overlays feature/control-center-edit's control-center paths onto main:
new draft/ mode with canvas toolbar, keyboard shortcuts, drag-to-group,
create-group modal, connect-handles for drawing policies, SmartEdge
routing, and refactored ControlCenterContext into CanvasState + UI +
Policy providers. Adds hooks/views split (peer/group/user/network).

AccessControlModal + useAccessControl gain initialSourceGroups /
initialSourceResource so draft-mode policy creation can seed the source
side (previously only destination could be pre-filled).

Unrelated cloud-repo changes (data-testid -> data-cy renames, DNS,
reverse-proxy, integrations, etc.) are excluded.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-07-06 17:10:19 +02:00
Misha Bragin 8d41de995c Fix Skip TLS doc link and model pricing format (#699) 2026-07-03 07:03:42 +02:00
Misha Bragin 30dd75d95d Feature/add skip tls verification (#697) 2026-07-01 22:25:05 +02:00
Zoltan Papp bfa064a19d Add Metrics settings tab with metrics push toggle (#613)
* Add Metrics settings tab with metrics push toggle

Add a dedicated Metrics tab to Settings with a toggle for enabling
anonymous performance metrics collection. Moves metrics out of the
Clients tab into its own tab with description and docs link.

* Update docs link
2026-07-01 19:00:00 +02:00
Misha Bragin db73d18370 Feature/add provider session (#695) 2026-07-01 16:32:44 +02:00
Misha Bragin ba32178425 Fix peer table page reset when switching kind (#696) 2026-07-01 16:09:15 +02:00
4ea4fd4a4c Reload nginx after patching CSP header (#687)
* fix(docker): reload nginx after patching CSP header

nginx is started by supervisord (priority 100) before init_react_envs.sh
(priority 201) and is never reloaded afterwards, so it keeps serving the
static default.conf CSP that has no connect-src. Over plain HTTP this blocks
OIDC discovery and the management API, breaking browser SSH/RDP auth.

Reload nginx at the end of the init script so the dynamically built CSP
header takes effect.

* Update docker/init_react_envs.sh

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix(docker): log nginx -t output on failed CSP reload

When the reload never succeeds, run nginx -t before exiting so the logs show
whether the patched config is invalid or nginx never came up.

* conditionally emit `upgrade-insecure-requests` in CSP

---------

Co-authored-by: Viktor Liu <17948409+lixmal@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: mlsmaycon <mlsmaycon@gmail.com>
2026-07-01 15:32:22 +02:00
Bethuel Mmbaga deaae9159c Show reason for peer login expiration events (#694) 2026-07-01 12:32:11 +03:00
Bethuel Mmbaga d7fd24244d Prevent gated useFetchApi hooks from overwriting shared cache entries (#692) 2026-06-30 17:44:38 +03:00
Misha Bragin 9230b3e4e3 Add Claude provider selector and Bedrock (#691) 2026-06-30 11:50:15 +02:00
Misha Bragin 19ad8d6806 Prefill Vertex endpoint (#689) 2026-06-29 10:53:07 +02:00
Misha Bragin 38fc2970e6 Support Vertex keyfile upload and agent config (#688) 2026-06-28 22:34:54 +02:00
Misha Bragin 4ec4d29e84 The empty-state peer card now renders AddPeerDropdown 2026-06-28 12:12:11 +02:00
Misha Bragin 944d1b5bf6 Agent network (#684) 2026-06-27 19:11:41 +02:00
Max Bruch c325c170ab Add origin URL of AUTH_AUTHORITY to CSP_DOMAINS #679 (#680) 2026-06-26 13:11:52 +02:00
Bethuel Mmbaga 76529fc089 Preserve inactivity expiration on partial peer updates (#676) 2026-06-23 17:30:06 +03:00
Maycon Santos 8c22e64d02 Restrict cloud/licensed-only API calls in open-source mode (#675)
Gate premium endpoints so the open-source dashboard stops calling
endpoints the open-source management server does not serve:

- MSP/Distributor: only fetch /integrations/msp, /integrations/msp/switcher
  and /integrations/msp/reseller on NetBird Cloud
- EDR bypass: only fetch /peers/edr/bypassed when licensed
- Event Streaming: gate /integrations/event-streaming GETs on the license
  in addition to the existing permission check
- useIsLicensed: cache the licensed-only probe result (per API origin, 1h
  TTL) so it no longer re-fires on every page load
- Team > Users: show the Identity Provider Sync tile in open-source mode so
  IdP sync remains discoverable
2026-06-23 15:59:15 +02:00
Maycon Santos 7653e3411c Merge NetBird cloud edition into the dashboard (#674)
Brings the unified dashboard into the open-source repo. Premium features
ship in the open code, gated at runtime via NETBIRD_CLOUD and
NETBIRD_LICENSED, with upgrade prompts for unlicensed self-hosted
deployments. Adds the cloud-only feature areas (billing, integrations,
MSP, traffic events, notifications) and the Playwright e2e suite.
2026-06-21 16:01:08 +02:00
Maycon Santos 86b6e23981 Update announcements.json (#673) 2026-06-20 16:43:04 +02:00
Eduard Gert 389a0c0785 update banner (#672) 2026-06-20 15:59:23 +02:00
Misha Bragin bf6601782d DNS Zones & Setup modal improvements (#669) 2026-06-15 16:02:33 +02:00
Max 5eac5162e0 Insert link to remote jobs documentation (#664)
Replaced general link to docs homepage with exact Documentation link for Remote Jobs
2026-06-12 09:39:36 +02:00
Brandon Hopkins 1d8d32dd12 Edit banner to IPv6 kh link (#662) 2026-06-05 12:54:59 -07:00
Brandon Hopkins 578d890bb5 Add Logout URL to the Identity Provider dialog (#657)
* Add Logout URL section

* Condensed the URL section, added logout note
2026-06-05 08:28:32 -07:00
Maycon Santos e8f0f20455 Update reverse proxy modals (#661)
* add multi-environment deployment options for reverse proxy setup

* refactor reverse proxy modal to handle state updates more robustly
2026-06-04 20:43:45 +02:00
Misha Bragin 8c94090e3d Group Networks and Routes under Network Routing (#660) 2026-06-04 19:44:13 +02:00
Misha Bragin 1917df6f60 Improve Table Filters Layout (#654) 2026-06-04 18:24:53 +02:00
Misha Bragin 358b477ded Move setup keys to Settings (#653) 2026-05-27 17:17:04 +02:00
Maycon Santosandcoderabbitai[bot] f535fe2667 Feature/private service expose (#646)
* feat: private service expose

Dashboard surface for the netbird private-service feature: the
reverse-proxy modal gains a Private toggle and the target modal gains
a Direct-upstream option with custom upstream host, both feeding the
backend's Service.private + target.direct_upstream / target.host
fields. The Proxy Events page wraps its table in PeersProvider so
peer-name fallback resolution works for tunnel-peer callers.

Reverse-proxy modal changes (ReverseProxyModal.tsx):
- Private toggle that pivots the modal between standalone and cluster
  target types and auto-injects the cluster target.

Reverse-proxy target modal changes:
- Direct upstream toggle (target dials via the host stack instead of
  the embedded NetBird client).
- Custom upstream host input revealed when Direct upstream is on.
- New ReverseProxyClusterTargetSelector + ReverseProxyAddressInput.
- useReverseProxyTargetOptions updated for the new option shape.

Proxy Events table:
- Reuses across the reverse-proxy events surface; UserCell falls back
  to the peer name when no user is attached to the call.

* feat(reverse-proxy): move NetBird-only access to auth tab + access groups

Restructures the Private (NetBird-only) flow so the auth model is
clearer:

- Removes the 'Private (NetBird-only)' toggle from the Service main
  page. Service mode is the only primary choice now.
- Adds a 'NetBird-only access' toggle on the Authentication tab, gated
  on serviceMode=HTTP and selectedDomain.supports_private===true. When
  the cluster doesn't support it, the toggle is disabled with an
  inline note explaining why.
- Adds an Access Groups picker (PeerGroupSelector) inline on the auth
  tab when NetBird-only is on. Replaces the previous bearer-auth
  distribution_groups overload — these groups go on the new
  service.access_groups field on the wire.
- When NetBird-only is enabled, all other auth modes (SSO, password,
  PIN, headers, link) are hidden — the inbound peer's WireGuard
  identity is the only auth path.
- Adds a 'Direct upstream' toggle to the Advanced settings tab,
  gated on isPrivate + cluster supports private. The toggle is
  service-level in the UI; on save it patches the (single) cluster
  target's options.direct_upstream.
- togglePrivate now also clears bearer/password/pin/header/link
  state when entering private mode (strict mutual exclusivity).

* fix(reverse-proxy): tighten NetBird-only flow per review

Five fixes from the first cut:

1. Auth-tab design mismatch. The NetBird-only block was an inline
   FancyToggleSwitch + inline PeerGroupSelector. It now follows the
   same SettingCard.Item pattern as SSO/Password/PIN/Headers: a
   clickable row showing enabled state that opens a dedicated modal
   (AuthNetBirdOnlyModal) where the access groups are picked.

2. Trimmed wordy NetBird-only description down to one line.

3. Trimmed wordy Direct upstream help text.

4. Removed the per-target Direct upstream toggle from the target
   modal. Direct upstream now lives only at the service level (under
   Advanced settings) for private services. Cluster targets still
   imply direct_upstream via the existing sanitizeTargets path, so
   the wire stays correct.

5. togglePrivate no longer drops the user's existing targets when
   entering private mode. The previous behavior silently dropped any
   non-cluster targets the operator had configured, leaving the
   targets list empty and the Save button disabled. Now: targets
   stay put, canSaveService gates on 'all targets are cluster type'
   so the Save button accurately reflects what the backend will
   accept, and an inline warning explains what to fix when the
   constraint isn't met.

The AuthNetBirdOnlyModal requires at least one access group before
Enable becomes clickable, mirroring the SSO modal's pattern.

* fix(reverse-proxy): allow any target type on private services

The cluster-target restriction was a holdover from the previous
auth-by-bearer-groups model where only cluster targets exposed a
proxy peer that could host the ACL. With the new access_groups path
the ACL is server-side and works regardless of how the proxy reaches
the upstream.

- Drop the inline 'Private services only support cluster targets'
  warning.
- canSaveService no longer requires all targets to be cluster type.
- Service-level Direct upstream now applies to every target (cluster,
  peer, host, domain) when private, so the operator can mix target
  types and still control the dial path globally.
- Tightened NetBird-only description to '...connected peers in the
  selected NetBird groups.' (per review).
- Tightened Direct upstream help to '...reachable without a Wireguard
  connection.' (per review).

A future iteration may add a dedicated cluster-only mode with its own
guided flow; for now the operator picks whatever target types suit
their topology.

* fix(reverse-proxy): count NetBird-only access as protection

The 'No Protection Configured' popup fired even on private services
because isUnprotected only checked the password/PIN/bearer/header/link
auth modes. NetBird-only access is also a form of protection (tunnel
identity + access groups), so include isPrivate in the gate.

* fix(reverse-proxy): show NetBird-only auth and resolve access group names

Two display bugs for private services:

- ReverseProxyModal seeded accessGroups with {id}-only stubs, which
  made useGroupHelper skip its ID→Group resolution and render empty
  pills in the NetBird-only modal when editing an existing service.
  Pass the raw string[] so useGroupHelper resolves full Group objects
  with names against the GroupsProvider.

- ReverseProxyAuthCell only inspected password/pin/bearer/headers
  auth flags, so a NetBird-only service displayed "No Auth" in the
  services table. Add a NetBird-only entry that counts toward the
  auth badge, renders as "NetBird Only" with the CircleUser icon
  when it's the single auth, and lists the access groups (name +
  user count) in the hover.

* feat(reverse-proxy): unify proxy-cluster target into the peer/resource selector

Operators picking a target for a service now see Proxy Clusters as a
third tab alongside Peers and Resources, gated on at least one cluster
advertising supports_private. When the service already has a proxy
cluster the tab lists only that cluster; when it doesn't, picking a
cluster commits it as the service's domain. The dedicated private-mode
cluster picker is removed in favour of this unified flow.

Selecting a cluster target now also auto-flips the service to
NetBird-only, since cluster targets are only reachable over the
WireGuard overlay and SSO/password/PIN advertise an auth path no
public client could exercise. The Access Control tab carries a note
explaining that an allow rule for the account's NetBird network range
is applied automatically alongside any operator-configured rules.

PeerGroupSelector gains opt-in showClusters/clusters/selectedCluster/
onClusterChange props plus a Proxy Clusters tab in its TabsList; the
tabOrder union widens to include "clusters". All call sites that don't
pass showClusters render unchanged.

* fix(reverse-proxy): polish private-service copy and lock Direct Upstream for cluster targets

Title-case NetBird-Only Access and Direct Upstream so the labels read
consistently across the auth tab, the dedicated modal, and the
services-table auth cell.

Cluster targets are reached via the embedded proxy's host network
stack and have no WireGuard endpoint to fall back to, so toggling
Direct Upstream off would silently break them. When any target is a
cluster the toggle is forced on, the FancyToggleSwitch is disabled,
and the helper text explains why. The save path writes the locked-on
value to every target's options.direct_upstream so the persisted
state matches what the UI shows.

* fix(reverse-proxy): support dynamic placeholder and restrict input to IPv4 or IPv6 when required

* fix(reverse-proxy): rename "Agent" to "Peer" in events user cell tooltip

* feat(reverse-proxy): gate NetBird-Only + Direct Upstream on cluster capability

When the selected cluster doesn't have at least one connected embedded
proxy (`netbird proxy`), the NetBird-Only Access and Direct Upstream
controls are visually disabled with a tooltip explaining why, instead of
silently no-op (NetBird-Only) or hidden (Direct Upstream).

- ReverseProxyCluster interface gains the optional `private` flag that
  the management API now exposes on /api/reverse-proxies/clusters.
- ClustersFeaturesCell renders a new "Private" badge for clusters whose
  `private === true`, matching the other capability badges.
- SettingCard.Item gains a `disabled` prop: opacity-50 + cursor-not-allowed,
  click/keyboard guarded, Add/Edit button greyed out. No visual change
  for existing usages (default false).
- ReverseProxyModal:
  - NetBird-Only Access card is now wrapped in a FullTooltip that
    activates only when the cluster lacks support; the SettingCard.Item
    is rendered with `disabled` in that case. Description text stops
    switching based on cluster state — the tooltip explains the gate.
  - Direct Upstream toggle is no longer hidden when supports_private is
    false; it stays visible and disabled (alongside the existing
    hasClusterTarget locked-on case), wrapped in a tooltip explaining
    the cluster requirement. Existing private services whose cluster
    lost the capability now show the control disabled rather than
    vanishing.

* disable button when no group were selected

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Feature/private service expose update (#651)

* feat(reverse-proxy): refine UI state and copy for NetBird-Only and Direct Upstream controls

- Default `Direct Upstream` to `false` for peer/resource targets; enhance tooltip descriptions.
- Improve conditional rendering of `NetBird-Only Access` setting with appropriate tooltips for unsupported clusters.
- Add cluster badge interaction in `PeerGroupSelector` and dynamic placeholder handling.
- Simplify `ReverseProxyTargetSelector` messaging for proxy forwarding options.
- Enhance `ClustersFeaturesCell` with richer description for the "Private" badge.

* refactor(reverse-proxy): improve tooltip and modal text for clarity

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-05-26 21:37:11 +02:00
Misha Bragin 52f7020a0f Fix broken SSH and RDP (#650) 2026-05-26 20:14:36 +02:00
Misha Bragin a604643f9a Feature/simplified layout (#649)
Splits the Peers sidebar entry into User Devices (/peers/users) and Servers (/peers/servers), with /peers redirecting to User Devices and a shared kind filter splitting peers
by whether the owner is a real user vs a service/no-user. The Servers page description and an inline link replace what was the old "Setup Keys" sidebar item under Peers.
2026-05-25 13:09:30 +02:00
Maycon SantosandEduard Gert 42cd088c5d rebuild self-hosted page as Clusters with type features (#641)
* feat(reverse-proxy): rebuild self-hosted page as Clusters with type + features

The Self-Hosted Proxies page was account-only by design but the
underlying API already returned every cluster the account could see.
Lifting that filter and renaming the page surfaces shared clusters
too — operators can see what NetBird-deployed clusters are reachable
alongside their own self-hosted ones, with online status and feature
support visible per row.

ReverseProxyCluster matches the new backend shape: `type`
(account/shared), `online`, and the three capability flags. The
`isSelfHostedCluster` provider hook now compares against `type ===
account` instead of a deprecated boolean.

Page folder renamed self-hosted-proxies → clusters (history-preserving
git mv). Table columns: Cluster (with an EphemeralPeerIndicator-style
icon next to the name marking account vs shared and a colored dot for
online status), Connected Proxies (plain numeric), Features (one
tooltip-backed badge per supported capability), Actions (Delete only
on account-owned rows; shared clusters render an empty action cell).

Empty state shows when the list is fully empty with a doc link in the
page header. Sidebar entry restored under Reverse Proxy.

* Update record in modal, update doc link, update modal title

* update reverse proxy documentation links to latest anchors

* update cluster modal description to "proxy cluster" instead of "self-hosted cluster"

---------

Co-authored-by: Eduard Gert <kontakt@eduardgert.de>
2026-05-20 11:48:38 +02:00
Maycon Santos 7400ac806e remove self-hosted proxies menu item (#640) 2026-05-14 17:50:07 +02:00
Viktor Liu 240ff5af9a Fix IPv6 input across reverse proxy, routes and resources (#638) 2026-05-14 16:43:02 +02:00
Eduard Gert dc86c30463 Add self-hosted proxies (#636)
* Add self-hosted proxies

* fix selfhosted badge for domain
2026-05-12 15:22:12 +02:00
Nicolas Frati e58f75ae3c Enable MFA for local users toggle (#615)
* implement enable mfa for local users toggle

* fix visibility check

* Added beta badge to MFA auth toggle
2026-05-08 16:51:17 +02:00
Viktor Liu dc1adebd27 Add IPv6 overlay settings and peer display (#594) 2026-05-07 15:20:12 +02:00
Bethuel Mmbaga d76cbd1122 Add Microsoft AD FS support for embedded Dex identity providers (#625) 2026-04-28 12:42:48 +03:00
Eduard Gert 01330e0f58 Fix missing peer context in group network routes tab (#620) 2026-04-23 17:05:05 +02:00
Viktor Liu e9ac1a1a23 Add CrowdSec IP reputation (#600) 2026-04-21 12:29:37 +02:00
raghvendra b53802a5c5 fix: prevent storage clear and logout on failed account deletion (#611) 2026-04-13 09:07:14 +02:00
Eduard Gert 9addc18956 Fix reverse proxy mode selection (#606)
* Fix reverse proxy mode selection

* Fix isNetBirdHosted

* Fix activity description
2026-04-09 09:52:35 +02:00
822 changed files with 101379 additions and 10413 deletions

No files matched your search

+7
View File
@@ -10,3 +10,10 @@ Select exactly one:
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
## E2E tests
Optional: override the image tags used by the Playwright e2e workflow.
Defaults to `main` when omitted.
management-cloud-tag: main
reverse-proxy-tag: main
+42 -13
View File
@@ -7,17 +7,24 @@ on:
- "**"
pull_request:
# Cancel in-progress runs on the same ref (PR or branch) when a new commit
# arrives, so we don't waste CI building superseded commits.
concurrency:
group: build-and-push-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
IMAGE_NAME: netbirdio/dashboard
DOCKERHUB_IMAGE: netbirdio/dashboard
GHCR_IMAGE: ghcr.io/netbirdio/dashboard-cloud
jobs:
build_n_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- name: setup-node
uses: actions/setup-node@v3
uses: actions/setup-node@v5
with:
node-version: '20'
cache: 'npm'
@@ -69,25 +76,43 @@ jobs:
NEXT_PUBLIC_DASHBOARD_VERSION: ${{ steps.version.outputs.version }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
-
name: Login to DockerHub
uses: docker/login-action@v2
images: |
${{ env.DOCKERHUB_IMAGE }}
${{ env.GHCR_IMAGE }}
flavor: |
latest=false
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=ref,event=pr
type=sha
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.NB_DOCKER_USER }}
password: ${{ secrets.NB_DOCKER_TOKEN }}
-
name: Docker build and push
uses: docker/build-push-action@v3
- name: Log in to the GitHub Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
@@ -95,3 +120,7 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- run: |
echo '### Pushed tags' >> $GITHUB_STEP_SUMMARY
echo '${{ steps.meta.outputs.tags }}' >> $GITHUB_STEP_SUMMARY
+162
View File
@@ -0,0 +1,162 @@
name: Playwright E2E Tests
on:
push:
branches: [main]
pull_request:
# `edited` is included so that updating the PR description (e.g. to set
# `management-cloud-tag: <tag>` or `reverse-proxy-tag: <tag>`) re-triggers
# the e2e run with the new tag.
types: [opened, synchronize, reopened, edited]
workflow_dispatch:
inputs:
management-cloud-tag:
description: 'Management Cloud image tag'
required: true
type: string
default: 'main'
reverse-proxy-tag:
description: 'Reverse Proxy image tag'
required: true
type: string
default: 'main'
env:
REGISTRY: ghcr.io
jobs:
playwright-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: setup-node
uses: actions/setup-node@v5
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.CI_DOCKER_PULL_GITHUB_TOKEN }}
- run: echo '{}' > .local-config.json
- name: Install jq
run: sudo apt-get install jq
- name: Resolve management-cloud image tag
id: management_tag
env:
INPUT_TAG: ${{ inputs.management-cloud-tag }}
PR_BODY: ${{ github.event.pull_request.body }}
run: |
# Use workflow_dispatch input if provided, otherwise parse PR body.
# Falls back to `main` when not specified.
if [ -n "$INPUT_TAG" ]; then
TAG="$INPUT_TAG"
else
TAG=$(printf '%s' "$PR_BODY" \
| grep -iE '^[[:space:]]*management-cloud-tag:[[:space:]]*[A-Za-z0-9._-]+[[:space:]]*$' \
| head -n1 \
| sed -E 's/^[[:space:]]*[Mm]anagement-cloud-tag:[[:space:]]*([A-Za-z0-9._-]+)[[:space:]]*$/\1/' \
|| true)
if [ -z "$TAG" ]; then
TAG="main"
fi
fi
echo "Using management-cloud tag: $TAG"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Resolve reverse-proxy image tag
id: reverse_proxy_tag
env:
INPUT_TAG: ${{ inputs.reverse-proxy-tag }}
PR_BODY: ${{ github.event.pull_request.body }}
run: |
if [ -n "$INPUT_TAG" ]; then
TAG="$INPUT_TAG"
else
TAG=$(printf '%s' "$PR_BODY" \
| grep -iE '^[[:space:]]*reverse-proxy-tag:[[:space:]]*[A-Za-z0-9._-]+[[:space:]]*$' \
| head -n1 \
| sed -E 's/^[[:space:]]*[Rr]everse-proxy-tag:[[:space:]]*([A-Za-z0-9._-]+)[[:space:]]*$/\1/' \
|| true)
if [ -z "$TAG" ]; then
TAG="main"
fi
fi
echo "Using reverse-proxy tag: $TAG"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Setup test environment
env:
MANAGEMENT_IMAGE_TAG: ${{ steps.management_tag.outputs.tag }}
REVERSE_PROXY_IMAGE_TAG: ${{ steps.reverse_proxy_tag.outputs.tag }}
run: cd ./e2e/environment && bash create-test-env.sh
- name: Run Playwright tests
id: playwright
run: |
set -o pipefail
npm run test:ci 2>&1 | tee playwright-output.log
- name: Append Playwright summary to job summary
if: always() && hashFiles('e2e/test-results/results.json') != ''
run: |
if [ -f e2e/test-results/results.json ]; then
passed=$(jq '.stats.expected // 0' e2e/test-results/results.json)
failed=$(jq '.stats.unexpected // 0' e2e/test-results/results.json)
skipped=$(jq '.stats.skipped // 0' e2e/test-results/results.json)
duration=$(jq '.stats.duration // 0' e2e/test-results/results.json)
{
echo '### Playwright results'
echo ''
echo "| Passed | Failed | Skipped | Duration |"
echo "|--------|--------|---------|----------|"
echo "| $passed | $failed | $skipped | ${duration}ms |"
} >> "$GITHUB_STEP_SUMMARY"
fi
- name: Collect container logs
if: failure()
run: |
cd e2e/environment
docker compose logs management --tail=500 --no-color > management.log 2>&1 || true
docker compose logs reverse-proxy --tail=500 --no-color > reverse-proxy.log 2>&1 || true
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report
path: e2e/playwright-report/
- uses: actions/upload-artifact@v7
if: ${{ failure() }}
with:
name: playwright-traces
path: e2e/test-results/
- uses: actions/upload-artifact@v7
if: ${{ failure() }}
with:
name: management-logs
path: e2e/environment/management.log
- uses: actions/upload-artifact@v7
if: ${{ failure() }}
with:
name: reverse-proxy-logs
path: e2e/environment/reverse-proxy.log
+7 -2
View File
@@ -36,9 +36,14 @@ yarn-error.log*
next-env.d.ts
# config
.local-config.json
.local*config*.json
.test-config.json
cypress.env.json
e2e/playwright.env.json
e2e/fixtures/auth/*.json
e2e/test-results/
e2e/playwright-report/
/test-results/
/playwright-report/
.configs/.local-config.zitadel.json
.configs/.staging-config.json
.configs/.temp-config.json
+1 -1
View File
@@ -1,3 +1,3 @@
Mikhail Bragin (https://github.com/braginini)
Maycon Santos (https://github.com/mlsmaycon)
Wiretrustee UG (haftungsbeschränkt)
NetBird GmbH
+3 -3
View File
@@ -1,8 +1,8 @@
[
{
"tag": "New",
"text": "NetBird Reverse Proxy - Expose internal services to the public with automatic TLS and optional authentication.",
"link": "https://docs.netbird.io/manage/reverse-proxy",
"tag": "Preview",
"text": "The new NetBird desktop app is here - now available as a 0.75 release candidate.",
"link": "https://github.com/netbirdio/netbird/discussions/6483",
"linkText": "Learn more",
"variant": "important",
"isExternal": true,
Executable
+77
View File
@@ -0,0 +1,77 @@
#!/usr/bin/env bash
#
# Build the netbird-dashboard Docker image for linux/amd64 and export it as a
# portable tarball that can be loaded and run on a remote server.
#
# The dashboard image is nginx serving a Next.js *static export*: the Dockerfile
# only COPYs the pre-built out/ directory, so we build out/ on the host first
# (the static files are arch-independent) and then assemble the amd64 image.
#
# Usage:
# ./build.sh # build + export netbird-dashboard.tar.gz
# IMAGE_TAG=v1 ./build.sh # override the image tag
# SKIP_BUILD=1 ./build.sh # reuse an existing out/ (skip npm build)
#
set -euo pipefail
# Always run relative to this script's directory (the project root).
cd "$(dirname "$0")"
IMAGE_NAME="${IMAGE_NAME:-netbird-dashboard}"
IMAGE_TAG="${IMAGE_TAG:-amd64}"
IMAGE="${IMAGE_NAME}:${IMAGE_TAG}"
OUTPUT="${OUTPUT:-${IMAGE_NAME}.tar.gz}"
# Build the static export (out/) unless told to reuse an existing one. Next 16
# no longer runs ESLint during `next build`; types are checked by the build via
# tsc (verify separately with `npx tsc --noEmit`).
if [[ "${SKIP_BUILD:-0}" != "1" ]]; then
if [[ ! -d node_modules ]]; then
echo "==> Installing dependencies (npm ci)"
npm ci
fi
echo "==> Building static export (next build) into out/"
npx next build
fi
if [[ ! -d out ]]; then
echo "ERROR: out/ not found — the static export did not build." >&2
exit 1
fi
# The .dockerignore lives under docker/, but Docker reads it from the build
# context root. Stage it for the duration of the build so node_modules/.next
# don't get shipped into the build context.
cleanup() { rm -f .dockerignore; }
trap cleanup EXIT
cp docker/.dockerignore .dockerignore
echo "==> Building ${IMAGE} for linux/amd64"
docker build \
--platform linux/amd64 \
-f docker/Dockerfile \
-t "${IMAGE}" \
.
echo "==> Exporting ${IMAGE} to ${OUTPUT}"
docker save "${IMAGE}" | gzip > "${OUTPUT}"
echo "==> Done: ${OUTPUT} ($(du -h "${OUTPUT}" | cut -f1))"
echo
echo "Copy and run on the server:"
echo " scp ${OUTPUT} user@your-server:/tmp/"
echo " docker load < /tmp/${OUTPUT}"
echo
echo "Run (nginx serves on container port 80). Set the runtime env vars the"
echo "dashboard templates at startup — for the Agent Network onboarding test,"
echo "flip NETBIRD_AGENT_NETWORK_ONLY=true:"
echo " docker run -d --name ${IMAGE_NAME} --restart unless-stopped \\"
echo " -p 8080:80 \\"
echo " -e NETBIRD_MGMT_API_ENDPOINT=https://your-mgmt:443 \\"
echo " -e AUTH_AUTHORITY=https://your-idp/realms/netbird \\"
echo " -e AUTH_CLIENT_ID=netbird-dashboard \\"
echo " -e AUTH_AUDIENCE=netbird-dashboard \\"
echo " -e AUTH_SUPPORTED_SCOPES='openid profile email' \\"
echo " -e USE_AUTH0=false \\"
echo " -e NETBIRD_AGENT_NETWORK_ONLY=true \\"
echo " ${IMAGE}"
+11 -1
View File
@@ -14,5 +14,15 @@
"hotjarTrackID": "$NETBIRD_HOTJAR_TRACK_ID",
"googleAnalyticsID": "$NETBIRD_GOOGLE_ANALYTICS_ID",
"googleTagManagerID": "$NETBIRD_GOOGLE_TAG_MANAGER_ID",
"wasmPath": "$NETBIRD_WASM_PATH"
"authServiceUrl": "$NETBIRD_AUTH_SERVICE_URL",
"wasmPath": "$NETBIRD_WASM_PATH",
"licensed": "$NETBIRD_LICENSED",
"cloud": "$NETBIRD_CLOUD",
"agentNetworkOnly": "$NETBIRD_AGENT_NETWORK_ONLY",
"agentNetworkEnabled": "$NETBIRD_AGENT_NETWORK_ENABLED",
"hubspotPortalId": "$NETBIRD_HUBSPOT_PORTAL_ID",
"hubspotSignupFormId": "$NETBIRD_HUBSPOT_SIGNUP_FORM_ID",
"hubspotOnboardingFormId": "$NETBIRD_HUBSPOT_ONBOARDING_FORM_ID",
"hubspotSurveyFormId": "$NETBIRD_HUBSPOT_SURVEY_FORM_ID",
"analyticsExcludedEmails": "$NETBIRD_ANALYTICS_EXCLUDED_EMAILS"
}
-15
View File
@@ -1,15 +0,0 @@
import { defineConfig } from "cypress";
export default defineConfig({
e2e: {
baseUrl: "http://localhost:3000",
},
component: {
devServer: {
framework: "next",
bundler: "webpack",
},
},
viewportWidth: 1920,
viewportHeight: 1080,
});
-13
View File
@@ -1,13 +0,0 @@
describe("Click all tabs in peer modal", () => {
it("passes", () => {
cy.visit("/install");
cy.get("div").contains("Linux").click();
cy.get("[data-cy=copy-to-clipboard]").click();
cy.get("div").contains("Windows").click();
cy.get("[data-cy=copy-to-clipboard]").click();
cy.get("div").contains("Android").click();
cy.get("[data-cy=copy-to-clipboard]").click();
cy.get("div").contains("Docker").click();
cy.get("[data-cy=copy-to-clipboard]").click();
});
});
-5
View File
@@ -1,5 +0,0 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
-37
View File
@@ -1,37 +0,0 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
-20
View File
@@ -1,20 +0,0 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
-9
View File
@@ -1,9 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"baseUrl": "http://localhost:3000",
"types": ["cypress", "node"],
},
"include": ["**/*.ts"]
}
+12
View File
@@ -0,0 +1,12 @@
# The image only needs the pre-built static export (out/) and the docker/
# config files. Keep the build context small by dropping everything heavy and
# irrelevant — without this, `docker build .` ships node_modules and .next.
node_modules
.next
.git
.github
e2e
src
public
*.tar.gz
*.tar
+12 -2
View File
@@ -14,14 +14,24 @@ server {
location / {
try_files $uri $uri.html $uri/ =404;
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob: ws: wss: https:;" always;
add_header Last-Modified "";
expires off;
}
error_page 404 /404.html;
location = /404.html {
internal;
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob: ws: wss: https:;" always;
add_header Last-Modified "";
expires off;
}
}
+120 -2
View File
@@ -61,12 +61,109 @@ export NETBIRD_GOOGLE_ANALYTICS_ID=${NETBIRD_GOOGLE_ANALYTICS_ID}
export NETBIRD_GOOGLE_TAG_MANAGER_ID=${NETBIRD_GOOGLE_TAG_MANAGER_ID}
export NETBIRD_TOKEN_SOURCE=${NETBIRD_TOKEN_SOURCE:-accessToken}
export NETBIRD_DRAG_QUERY_PARAMS=${NETBIRD_DRAG_QUERY_PARAMS:-false}
export NETBIRD_AUTH_SERVICE_URL=${NETBIRD_AUTH_SERVICE_URL}
export NETBIRD_WASM_PATH=${NETBIRD_WASM_PATH}
export NETBIRD_CSP=${NETBIRD_CSP}
export NETBIRD_LICENSED=${NETBIRD_LICENSED:-false}
export NETBIRD_CLOUD=${NETBIRD_CLOUD:-false}
export NETBIRD_AGENT_NETWORK_ONLY=${NETBIRD_AGENT_NETWORK_ONLY:-false}
export NETBIRD_AGENT_NETWORK_ENABLED=${NETBIRD_AGENT_NETWORK_ENABLED:-false}
export NETBIRD_HUBSPOT_PORTAL_ID=${NETBIRD_HUBSPOT_PORTAL_ID}
export NETBIRD_HUBSPOT_SIGNUP_FORM_ID=${NETBIRD_HUBSPOT_SIGNUP_FORM_ID}
export NETBIRD_HUBSPOT_ONBOARDING_FORM_ID=${NETBIRD_HUBSPOT_ONBOARDING_FORM_ID}
export NETBIRD_HUBSPOT_SURVEY_FORM_ID=${NETBIRD_HUBSPOT_SURVEY_FORM_ID}
export NETBIRD_ANALYTICS_EXCLUDED_EMAILS=${NETBIRD_ANALYTICS_EXCLUDED_EMAILS}
echo "NetBird latest version: ${NETBIRD_LATEST_VERSION}"
# Build CSP
FIRST_PARTY_CSP="pkgs.netbird.io"
FIRST_PARTY_CSP_CONNECT_SRC="wss://*.netbird.io"
THIRD_PARTY_CSP="*.licdn.com *.linkedin.com *.vector.co *.sibforms.com *.hotjar.com *.hotjar.io *.redditstatic.com pixel-config.reddit.com *.clarity.ms c.bing.com *.microsoft.com googleads.g.doubleclick.net pagead2.googlesyndication.com www.google.com www.googleadservices.com *.google-analytics.com *.googletagmanager.com analytics.google.com *.hubapi.com *.hs-banner.com *.hubspot.com *.hubspot.net js.hs-analytics.com *.hsforms.net *.hscollectedforms.net *.hs-analytics.net *.hsforms.com track.hubspot.com *.hsadspixel.net static.hsappstatic.net"
THIRD_PARTY_CSP_CONNECT_SRC="https://api.github.com/repos/netbirdio/netbird/releases/latest https://raw.githubusercontent.com/netbirdio/dashboard/ wss://ws.hotjar.com"
THIRD_PARTY_CSP_SCRIPT_SRC="'sha256-7knV6EIjKUvCpYWE2rCYx8dYV2WCNb2bpTuitFXzBcA=' *.hs-scripts.com"
CSP_DOMAINS=""
CSP_DOMAINS_CONNECT_SRC=""
if [[ -n "${NETBIRD_CSP}" ]]; then
CSP_DOMAINS="$CSP_DOMAINS $NETBIRD_CSP"
fi
# Add AUTH_AUTHORITY to CSP
if [[ -n "${AUTH_AUTHORITY}" ]]; then
CSP_DOMAINS="$CSP_DOMAINS $AUTH_AUTHORITY"
AUTH_AUTHORITY_ORIGIN=$(echo "$AUTH_AUTHORITY" | sed -E 's|^(https?://[^/]+).*|\1|')
CSP_DOMAINS="$CSP_DOMAINS $AUTH_AUTHORITY_ORIGIN"
fi
# Add AUTH_AUDIENCE to CSP
if [[ -n "${AUTH_AUDIENCE}" && ("${AUTH_AUDIENCE}" == *"http://"* || "${AUTH_AUDIENCE}" == *"https://"*) ]]; then
CSP_DOMAINS="$CSP_DOMAINS $AUTH_AUDIENCE"
fi
# Add NETBIRD_AUTH_SERVICE_URL to CSP
if [[ -n "${NETBIRD_AUTH_SERVICE_URL}" ]]; then
CSP_DOMAINS="$CSP_DOMAINS $NETBIRD_AUTH_SERVICE_URL"
fi
# Add NETBIRD_MGMT_API_ENDPOINT to CSP
if [[ -n "${NETBIRD_MGMT_API_ENDPOINT}" ]]; then
MGMT_DOMAIN=$(echo "$NETBIRD_MGMT_API_ENDPOINT" | sed -E 's|https?://||' | cut -d'/' -f1 | cut -d':' -f1)
if [[ -n "$MGMT_DOMAIN" ]]; then
if [[ "$NETBIRD_MGMT_API_ENDPOINT" == https://* ]]; then
CSP_DOMAINS="$CSP_DOMAINS $NETBIRD_MGMT_API_ENDPOINT"
CSP_DOMAINS_CONNECT_SRC="$CSP_DOMAINS_CONNECT_SRC wss://$MGMT_DOMAIN"
elif [[ "$NETBIRD_MGMT_API_ENDPOINT" == http://* ]]; then
CSP_DOMAINS="$CSP_DOMAINS $NETBIRD_MGMT_API_ENDPOINT"
CSP_DOMAINS_CONNECT_SRC="$CSP_DOMAINS_CONNECT_SRC ws://$MGMT_DOMAIN"
fi
fi
fi
# Add LETSENCRYPT_DOMAIN to CSP
if [[ -n "${LETSENCRYPT_DOMAIN}" ]]; then
if [[ "$LETSENCRYPT_DOMAIN" == *"localhost"* ]]; then
CSP_DOMAINS="$CSP_DOMAINS http://$LETSENCRYPT_DOMAIN"
CSP_DOMAINS_CONNECT_SRC="$CSP_DOMAINS_CONNECT_SRC ws://$LETSENCRYPT_DOMAIN"
else
CSP_DOMAINS="$CSP_DOMAINS https://$LETSENCRYPT_DOMAIN"
CSP_DOMAINS_CONNECT_SRC="$CSP_DOMAINS_CONNECT_SRC wss://$LETSENCRYPT_DOMAIN"
fi
fi
CSP_CONNECT_SRC="$CSP_DOMAINS $CSP_DOMAINS_CONNECT_SRC $FIRST_PARTY_CSP $FIRST_PARTY_CSP_CONNECT_SRC $THIRD_PARTY_CSP $THIRD_PARTY_CSP_CONNECT_SRC"
CSP_FRAME_SRC="$CSP_DOMAINS $FIRST_PARTY_CSP $THIRD_PARTY_CSP"
CSP_SCRIPT_SRC="$CSP_DOMAINS $FIRST_PARTY_CSP $THIRD_PARTY_CSP $THIRD_PARTY_CSP_SCRIPT_SRC"
# Remove duplicates
CSP_CONNECT_SRC=$(echo $CSP_CONNECT_SRC | tr ' ' '\n' | sort -u | tr '\n' ' ' | sed 's/ $//')
CSP_FRAME_SRC=$(echo $CSP_FRAME_SRC | tr ' ' '\n' | sort -u | tr '\n' ' ' | sed 's/ $//')
CSP_SCRIPT_SRC=$(echo $CSP_SCRIPT_SRC | tr ' ' '\n' | sort -u | tr '\n' ' ' | sed 's/ $//')
# upgrade-insecure-requests tells the browser to rewrite every http subresource,
# fetch and WebSocket to https/wss. That is correct for https deployments but breaks
# plain-http ones (e.g. local or self-hosted over http), where it would rewrite the
# working http/ws endpoints to unreachable https/wss. Emit it only when the backend
# is served over https, matching the ws:// vs wss:// scheme logic above.
CSP_UPGRADE_INSECURE=" upgrade-insecure-requests;"
if [[ "$NETBIRD_MGMT_API_ENDPOINT" == http://* || "$AUTH_AUTHORITY" == http://* ]]; then
CSP_UPGRADE_INSECURE=""
fi
# Update CSP in nginx config
CSP_POLICY="default-src 'none'; connect-src 'self' $CSP_CONNECT_SRC; frame-src 'self' $CSP_FRAME_SRC; script-src 'self' 'wasm-unsafe-eval' $CSP_SCRIPT_SRC; font-src 'self'; img-src * data:; manifest-src 'self'; style-src 'self' 'unsafe-inline'; frame-ancestors 'self'; base-uri 'self'; form-action 'self';$CSP_UPGRADE_INSECURE"
CSP_HEADER="add_header Content-Security-Policy \"$CSP_POLICY\" always;"
echo "CSP header: $CSP_HEADER"
# Replace CSP header in nginx config
sed -i "s|add_header Content-Security-Policy \"[^\"]*\" always;|$CSP_HEADER|g" /etc/nginx/http.d/default.conf || {
echo "Failed to replace CSP header"
}
# replace ENVs in the config
ENV_STR="\$\$USE_AUTH0 \$\$AUTH_AUDIENCE \$\$AUTH_AUTHORITY \$\$AUTH_CLIENT_ID \$\$AUTH_CLIENT_SECRET \$\$AUTH_SUPPORTED_SCOPES \$\$NETBIRD_MGMT_API_ENDPOINT \$\$NETBIRD_MGMT_GRPC_API_ENDPOINT \$\$NETBIRD_HOTJAR_TRACK_ID \$\$NETBIRD_GOOGLE_ANALYTICS_ID \$\$NETBIRD_GOOGLE_TAG_MANAGER_ID \$\$AUTH_REDIRECT_URI \$\$AUTH_SILENT_REDIRECT_URI \$\$NETBIRD_TOKEN_SOURCE \$\$NETBIRD_DRAG_QUERY_PARAMS \$\$NETBIRD_WASM_PATH"
ENV_STR="\$\$USE_AUTH0 \$\$AUTH_AUDIENCE \$\$AUTH_AUTHORITY \$\$AUTH_CLIENT_ID \$\$AUTH_CLIENT_SECRET \$\$AUTH_SUPPORTED_SCOPES \$\$NETBIRD_MGMT_API_ENDPOINT \$\$NETBIRD_MGMT_GRPC_API_ENDPOINT \$\$NETBIRD_HOTJAR_TRACK_ID \$\$NETBIRD_GOOGLE_ANALYTICS_ID \$\$NETBIRD_GOOGLE_TAG_MANAGER_ID \$\$AUTH_REDIRECT_URI \$\$AUTH_SILENT_REDIRECT_URI \$\$NETBIRD_TOKEN_SOURCE \$\$NETBIRD_DRAG_QUERY_PARAMS \$\$NETBIRD_AUTH_SERVICE_URL \$\$NETBIRD_WASM_PATH \$\$NETBIRD_LICENSED \$\$NETBIRD_CLOUD \$\$NETBIRD_AGENT_NETWORK_ONLY \$\$NETBIRD_AGENT_NETWORK_ENABLED \$\$NETBIRD_HUBSPOT_PORTAL_ID \$\$NETBIRD_HUBSPOT_SIGNUP_FORM_ID \$\$NETBIRD_HUBSPOT_ONBOARDING_FORM_ID \$\$NETBIRD_HUBSPOT_SURVEY_FORM_ID \$\$NETBIRD_ANALYTICS_EXCLUDED_EMAILS"
OIDC_TRUSTED_DOMAINS="/usr/share/nginx/html/OidcTrustedDomains.js"
envsubst "$ENV_STR" < "$OIDC_TRUSTED_DOMAINS".tmpl > "$OIDC_TRUSTED_DOMAINS"
@@ -74,4 +171,25 @@ for f in $(grep -R -l AUTH_SUPPORTED_SCOPES /usr/share/nginx/html); do
cp "$f" "$f".copy
envsubst "$ENV_STR" < "$f".copy > "$f"
rm "$f".copy
done
done
# Reload nginx so the patched CSP header takes effect.
# supervisord starts nginx (priority 100) before this script (priority 201) and
# never reloads it, so without this nginx keeps serving the static default.conf
# CSP that has no connect-src, breaking OIDC discovery over plain HTTP.
reloaded=false
for i in $(seq 1 10); do
if nginx -s reload 2>/dev/null; then
echo "Reloaded nginx to apply updated CSP configuration"
reloaded=true
break
fi
echo "Waiting for nginx to be ready before reload (attempt $i)..."
sleep 1
done
if [[ "$reloaded" != true ]]; then
echo "Failed to reload nginx after patching CSP header" >&2
nginx -t || true
exit 1
fi
+234
View File
@@ -0,0 +1,234 @@
# Playwright E2E Testing Guide
Complete reference for writing, running, and debugging Playwright E2E tests in the NetBird Dashboard.
## Philosophy
Tests simulate real user behavior: navigate via sidebar, click buttons, type into inputs, verify outcomes on screen. Use `{ force: true }` for Radix modal pointer-events issues.
## Setup & Running
```bash
npm run test:setup # Create docker-based test environment with Zitadel
npm run test:dev # Start app in test mode on http://localhost:1337
npm run test # Run all e2e tests headless
npm run test:ui # Open Playwright interactive UI
npx playwright test --config=e2e/playwright.config.ts tests/networks.spec.ts # Single spec
npm run test:clean # Tear down test environment
```
Config: `e2e/playwright.config.ts` (baseURL: `http://localhost:1337`). Auth: `e2e/playwright.env.json` (gitignored).
### Config Details
- `fullyParallel: false` — tests run sequentially within each spec
- Workers: 2 in CI, 4 locally
- Retries: 1
- Viewport: 1920x1080
- Timeouts: action 10s, navigation 15s
- On failure: screenshot, trace, video retained
## File Structure
```
e2e/
playwright.config.ts
helpers/
fixtures.ts # dashboardAsOwner / dashboardAsUser fixtures
auth.ts # loginToApp(), navigateTo()
navigation.ts # visitByNavigation()
utils.ts # generateRandomName(), clearScrollLock()
api.ts # Direct REST API helpers (list/delete for all entities)
reverse-proxy-l4.ts # Shared L4 reverse proxy helpers
fixtures/auth/ # Generated storageState files (gitignored)
environment/ # Docker compose, setup/teardown scripts
tests/
login.spec.ts # Auth setup (login both users, save storageState)
*.spec.ts # Test specs
```
## Architecture
Auth is handled by `login.spec.ts`, which runs as a separate Playwright project (`"login"`) that all other tests depend on via `dependencies: ["login"]` in the config. It logs in both users and saves Zitadel session cookies to `fixtures/auth/`. If auth files already exist, login is skipped. Each test file that modifies shared state (e.g., user roles) must restore it before finishing.
## Authentication
Two test users authenticated via the `login` project, saved as `storageState`:
| User | File | Role | Usage |
|------|------|------|-------|
| owner | `fixtures/auth/owner.json` | Owner | Default for all tests |
| user | `fixtures/auth/user.json` | User (changeable) | Role-based testing |
### Custom Fixtures (`helpers/fixtures.ts`)
Tests use custom fixtures instead of raw `page`:
```typescript
import { test, expect } from "../helpers/fixtures";
test("example", async ({ dashboardAsOwner: page }) => {
// Pre-authenticated as owner, reused across worker
});
test("multi-user", async ({ dashboardAsUser: page }) => {
// Pre-authenticated as user
});
```
- `dashboardAsOwner` — Pre-authenticated Page for the owner user (worker-scoped, reused across tests)
- `dashboardAsUser` — Pre-authenticated Page for the user user (worker-scoped)
For multi-context scenarios (e.g., approval/billing tests), create a new browser context directly:
```typescript
const context = await browser.newContext({ storageState: "e2e/fixtures/auth/user.json" });
const page = await context.newPage();
```
## Helpers Reference
### `auth.ts`
- **`loginToApp(page, user?)`** — Full Zitadel OIDC login flow. Handles app ready, setup modal, approval pending, onboarding, account selection, and login form states.
- **`navigateTo(page, path)`** — `page.goto(path)` + dismisses setup modal if present + clears scroll-lock.
### `navigation.ts`
- **`visitByNavigation(page, navText)`** — Clicks sidebar items by exact text via `left-navigation-item` testid.
### `utils.ts`
- **`generateRandomName(prefix?)`** — Returns `prefix` + 7 random alphanumeric chars.
- **`clearScrollLock(page)`** — Removes Radix artifacts: `data-scroll-locked`, `pointer-events: none`, stale overlay divs.
### `api.ts`
Direct REST API helpers that extract Bearer tokens from intercepted responses. Used for cleanup (deleting test artifacts by prefix). Covers: groups, networks, policies, routes, setup keys, DNS zones, nameserver groups, notification channels, reverse proxy services, users.
Pattern: `listX(page)` / `deleteXById(page, id)` / `deleteXByPrefix(page, prefix)`
### `reverse-proxy-l4.ts`
Shared helpers for TCP/TLS/UDP reverse proxy service tests:
- **`createNetwork(page)`** — Creates network, returns name
- **`addResource(page, networkName, address)`** — Adds resource to a network
- **`selectL4Resource(page, resourceName)`** — Selects resource in L4 target dropdown
- **`addAccessControlRules(page)`** / **`removeAllAccessControlRules(page)`** — Manages standard test rules
- **`resetServiceFilters(page)`** — Clicks "Reset Filters & Search" button if visible
- **`openServiceEdit(page, subdomain)`** — Navigates to services, resets filters, opens edit modal
- **`deleteService(page, subdomain)`** — Deletes service via action dropdown
- **`saveServiceEdit(page)`** — Saves with "No Protection" confirmation handling
- **`deleteNetwork(page, networkName)`** — Navigates to networks and deletes by name
## Writing Tests
### Standard Structure
```typescript
import { test, expect } from "../helpers/fixtures";
import { navigateTo } from "../helpers/auth";
import { generateRandomName } from "../helpers/utils";
test.describe.serial("Feature Name", () => {
test("Should create an item", async ({ dashboardAsOwner: page }) => {
await navigateTo(page, "/feature-page");
const name = generateRandomName("prefix-");
// ... create item
});
test("Should delete the item", async ({ dashboardAsOwner: page }) => {
// ... cleanup
});
});
```
### Key Patterns
**Selectors** — Always use `data-testid` via `page.getByTestId()`:
```typescript
page.getByTestId("group-name-input") // [data-testid="group-name-input"]
page.getByTestId("confirmation.confirm") // Confirmation dialogs
```
**Text matching:**
```typescript
page.getByText("Some text")
page.locator("tr").filter({ hasText: name })
```
**Assertions:**
```typescript
await expect(locator).toBeVisible()
await expect(locator).not.toBeVisible()
await expect(locator).toHaveAttribute("data-state", "checked")
await expect(locator).toContainText("text")
```
**Form inputs:**
```typescript
await input.fill("text") // Clears and types
await input.press("Enter")
await input.press("Escape")
```
**Radix modal workaround:**
```typescript
await button.click({ force: true }); // Force click, bypasses pointer-events checks
```
**Waiting for API responses:**
```typescript
const responsePromise = page.waitForResponse(
resp => resp.url().includes("/api/...") && resp.request().method() === "POST",
{ timeout: 30_000 },
);
await page.getByTestId("submit").click();
const response = await responsePromise;
expect([200, 201]).toContain(response.status());
```
**Cleanup with API helpers:**
```typescript
import { deleteGroupsByPrefix, deleteServicesByPrefix } from "../helpers/api";
// At the start of a test or in cleanup
await deleteServicesByPrefix(page, "my-prefix-");
await deleteGroupsByPrefix(page, "my-prefix-");
```
### Sidebar Navigation
```typescript
await visitByNavigation(page, "Access Control"); // Expand parent
await visitByNavigation(page, "Policies"); // Click child
```
| Parent | Children |
|--------|----------|
| Access Control | Policies, Groups, Posture Checks |
| Team | Users, Service Users |
| DNS | Nameservers, Zones, DNS Settings |
| Reverse Proxy | Custom Domains, Services |
## Test Coverage
| Area | Spec Files | Tag |
|------|-----------|-----|
| Access Control | `access-control.spec.ts`, `access-control-groups.spec.ts` | `@access-control` |
| DNS | `dns-zones.spec.ts`, `dns-nameservers.spec.ts`, `dns-settings.spec.ts` | `@dns` |
| Networks | `networks.spec.ts`, `network-routes.spec.ts` | `@network` |
| Reverse Proxy | `reverse-proxy-services-https.spec.ts`, `reverse-proxy-services-tcp.spec.ts`, `reverse-proxy-services-tls.spec.ts`, `reverse-proxy-services-udp.spec.ts`, `reverse-proxy-custom-domains.spec.ts` | `@reverse-proxy` |
| Settings | `settings-authentication.spec.ts`, `settings-clients.spec.ts`, `settings-groups.spec.ts`, `settings-networks.spec.ts`, `settings-permissions.spec.ts` | `@settings` |
| Notifications | `settings-notifications-email.spec.ts`, `settings-notifications-slack.spec.ts`, `settings-notifications-webhook.spec.ts` | `@notifications` |
| Team | `team-users.spec.ts`, `team-service-users.spec.ts`, `team-users-approval-and-billing.spec.ts` | `@team` |
| Setup Keys | `setup-keys.spec.ts` | `@setup-keys` |
| Control Center | `control-center-draft.spec.ts`, `control-center-draft-connections.spec.ts`, `control-center-draft-matrix.spec.ts` | `@control-center` |
## Debugging
1. `e2e/test-results/` — traces and screenshots on failure
2. `npx playwright show-report` — open the HTML report
3. `npm run test:ui` — interactive mode with step-by-step execution
4. `npx playwright test --config=e2e/playwright.config.ts --debug tests/<file>` — debugger mode
## `data-testid` Conventions
- Use `data-testid` selectors throughout. Add new ones to React components as needed.
- Kebab-case naming: `feature-field-input`, `action-feature`, `feature-actions`.
- Always use `data-testid` — both on native HTML elements and custom components. Custom components declare `"data-testid"?: string` in their props interface and place it on the appropriate internal DOM element.
+12
View File
@@ -0,0 +1,12 @@
# Ignore zitadel environment
.env
Caddyfile
management.json
turnserver.conf
zitadel.env
proxy.env
proxy-no-ports.env
proxy-certs/
proxy-certs-no-ports/
docker-compose.yml
/machinekey
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
check_docker_compose() {
if command -v docker-compose &> /dev/null
then
echo "docker-compose"
return
fi
if docker compose --help &> /dev/null
then
echo "docker compose"
return
fi
echo "docker-compose is not installed or not in PATH. Please follow the steps from the official guide: https://docs.docker.com/engine/install/" > /dev/stderr
exit 1
}
DOCKER_COMPOSE_COMMAND=$(check_docker_compose)
$DOCKER_COMPOSE_COMMAND down --volumes
rm -f docker-compose.yml Caddyfile zitadel.env .env dashboard.env machinekey/zitadel-admin-sa.token turnserver.conf management.json proxy.env proxy-no-ports.env
rm -rf proxy-certs proxy-certs-no-ports
rm -f ../../.test-config.json ../playwright.env.json
rm -f ../fixtures/auth/owner.json ../fixtures/auth/user.json
Loaded 20 of 822 files, more files were not shown because too many files have changed in this diff. Show more