docs: update P33RS tab wiring to match domain-as-key reshape

This commit is contained in:
iris 2026-05-31 23:35:47 +02:00
commit b6c5dcc397

View file

@ -14,7 +14,7 @@ swap.
**Chrome header** (fixed, overlays the active tab pane): **Chrome header** (fixed, overlays the active tab pane):
- **Tab strip**: `◆ SW4RM ◆`, `◆ Y3R C4LL ◆`, `◆ SYST3M ◆`, - **Tab strip**: `◆ SW4RM ◆`, `◆ Y3R C4LL ◆`, `◆ SYST3M ◆`,
`◆ SCH3DUL3S ◆`, `◆ P33RS ◆` (hidden when no peers configured), `◆ SCH3DUL3S ◆`, `◆ P33RS ◆` (hidden when `swarm.peers` is empty),
`◆ M4TR1X ◆ →` (optional page link, see below), `◆ FL0W ◆ →` `◆ M4TR1X ◆ →` (optional page link, see below), `◆ FL0W ◆ →`
(page link), and `◆ S3TT1NGS ◆`. Count pills on SW4RM (container (page link), and `◆ S3TT1NGS ◆`. Count pills on SW4RM (container
count), Y3R C4LL (pending approvals + questions), and SCH3DUL3S count), Y3R C4LL (pending approvals + questions), and SCH3DUL3S
@ -182,31 +182,34 @@ operator has one place for everything time-fired.
Peer hives in this swarm. The tab is hidden when the Peer hives in this swarm. The tab is hidden when the
`state.peer_hives` array from `/api/state` is empty (i.e. no `state.peer_hives` array from `/api/state` is empty (i.e. no
`services.hyperhive.peers` are configured). When at least `services.hyperhive.swarm.peers` are configured). When at least
one peer is present the `hidden` attribute is removed and the tab one peer is present the `hidden` attribute is removed and the tab
becomes active. becomes active.
**P33R H1V3S** — each peer renders as a card row: a hexagon icon **P33R H1V3S** — each peer renders as a card row: a hexagon icon
(`⬡`), the peer's configured label as the primary name, and the (`⬡`), the peer's DNS domain as the primary name, and the peer
peer dashboard URL as a clickable secondary link. Clicking the dashboard HTTPS URL as a clickable secondary link. Clicking the
URL opens the peer hive's dashboard in a new tab. URL opens the peer hive's dashboard in a new tab.
### Backend wiring ### Backend wiring
The host daemon reads `services.hyperhive.peers` from the The host daemon reads `services.hyperhive.swarm.peers` from the
nix config, serialises each entry as `{ name, url }` into nix config (an attrset keyed by peer domain), serialises each
`state.peer_hives: Vec<PeerHiveView>`, and includes the field entry as `{ name, url }` into `state.peer_hives: Vec<PeerHiveView>`,
in the `/api/state` snapshot. `tabs.js` reads and includes the field in the `/api/state` snapshot. `tabs.js`
`state.peer_hives` on every `refreshState` call and calls reads `state.peer_hives` on every `refreshState` call and calls
`renderPeerHives(peers)`, which rebuilds the `#peers-section` `renderPeerHives(peers)`, which rebuilds the `#peers-section`
div from scratch. div from scratch.
The `name` field is the operator-assigned label; `url` is the The `name` field is the peer's DNS domain (the attrset key); `url`
peer's dashboard root URL (e.g. `http://domain/`). Both come is `https://{domain}/`. Both are derived from the env var
from the env var `HYPERHIVE_PEERS` (a JSON array of `HYPERHIVE_PEERS` (a JSON array of `{ domain, cert_fingerprint }`
`{ label, domain }` pairs) that the nix module writes into the objects) that the nix module writes into the c0re container
c0re container environment. `parse_peer_hives()` in `dashboard.rs` environment. `cert_fingerprint` is null for CA-trusted (e.g.
converts `domain` to `url = http://{domain}/` for the frontend. Let's Encrypt) peers and non-null to pin a self-signed cert.
`parse_peer_hives()` in `dashboard.rs` converts each entry to the
`PeerHiveView { name: domain, url: "https://domain/" }` shape the
frontend reads.
## S3TT1NGS tab ## S3TT1NGS tab