Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui, hive dashboard, agent page: one profile menu with the signed-in user, avatar and authelia links

The swarm UI's user menu moves to @hive/shared and takes the whoami URL and
authelia's URL as props; the swarm UI keeps a thin wrapper, and the hive
dashboard and the per-agent page mount the same component. The dashboard's
nginx vhost proxies /api/whoami to authelia (the agent page is served from
the same vhost), and hive-c0re's state carries authelia_public_url, set from
services.hyperhive.swarm.authelia.url. The agent page shows the menu only
behind the gateway.
This commit is contained in:
iris 2026-10-25 15:05:35 +01:00 • committed by mara
commit cd41e1d510
19 changed files with 417 additions and 154 deletions

View file

@ -89,6 +89,12 @@ pub(super) struct StateSnapshot {
/// `services.hyperhive.swarm.domain`. `None` when the domain is unset —
/// the dashboard's pages menu then omits the swarm entry.
swarm_public_url: Option<String>,
/// Browser URL of the swarm's SSO provider (authelia). Sourced from
/// `HIVE_AUTHELIA_PUBLIC_URL`, which the c0re NixOS module sets from
/// `services.hyperhive.swarm.authelia.url`. The profile menu links
/// authelia's settings and sign-out pages from it. `None` when the
/// variable is absent — the menu then shows the name without those links.
authelia_public_url: Option<String>,
/// Human name of this single-host hive instance (e.g. `"pr1ma"`).
/// Sourced from `HYPERHIVE_HIVE_NAME` env var, set by the c0re
/// NixOS module from `services.hyperhive.hiveName`. `None` when
@ -209,6 +215,9 @@ pub(super) async fn api_state(
swarm_public_url: std::env::var("HIVE_SWARM_PUBLIC_URL")
.ok()
.filter(|s| !s.is_empty()),
authelia_public_url: std::env::var("HIVE_AUTHELIA_PUBLIC_URL")
.ok()
.filter(|s| !s.is_empty()),
hive_name: std::env::var("HYPERHIVE_HIVE_NAME")
.ok()
.filter(|s| !s.is_empty()),