gateway: serve the hive dashboard on <hive>.hives.<swarm> behind authelia, drop htpasswd
The dashboard, its API, the swagger UI and the agent routes move to their own vhost, `swarm.dashboardDomain` = `<hive>.hives.<swarm.domain>`, under the swarm domain so authelia's session cookie reaches it. `/`, `/api/` and `/api/docs/` ask authelia through `auth_request`, and authelia's `operatorsOnly` rule for each hive's dashboard name lets only the admins group in. The hive domain keeps matrix discovery and redirects every other path to the new name. The name rides as a SAN on the hive's own gateway leaf: the per-hive bao role allows it, and hive-tls asks for it and checks coverage. HTTP Basic auth is gone: the htpasswd writer and its test, the `hivectl gateway` verbs and host-socket requests, the `gateway.auth` options (now a removed-option error), the unauthorized page and the bcrypt dependency. tmpfiles deletes a leftover gateway.htpasswd, which held bcrypt hashes at 0644. c0re hands out dashboard and agent URLs on the new name (HYPERHIVE_DASHBOARD_DOMAIN), and the swarm controller's hive roster carries each hive's dashboard name for the swarm UI's hive list. Closes #3469
This commit is contained in:
parent
09ad7386b2
commit
92559af8e7
47 changed files with 351 additions and 623 deletions
|
|
@ -110,14 +110,14 @@ impl From<ContainerView> for hive_sh4re::container::AgentStatusRow {
|
|||
}
|
||||
}
|
||||
|
||||
/// This agent's own web UI, behind the gateway. `None` when the hive's
|
||||
/// This agent's own web UI, behind the gateway. `None` when the dashboard's
|
||||
/// domain isn't configured — same env var, same "empty string counts as
|
||||
/// unset" filter `server.rs::hive_urls()` uses for `HiveUrls::home`, kept
|
||||
/// in sync with it by reading the one env var directly rather than
|
||||
/// threading a resolved domain through `HiveEnv` for a value nothing else
|
||||
/// needs pre-resolved.
|
||||
fn agent_url(name: &str) -> Option<String> {
|
||||
let domain = std::env::var("HYPERHIVE_HIVE_DOMAIN")
|
||||
let domain = std::env::var("HYPERHIVE_DASHBOARD_DOMAIN")
|
||||
.ok()
|
||||
.filter(|v| !v.is_empty())?;
|
||||
Some(agent_url_for_domain(&domain, name))
|
||||
|
|
@ -565,7 +565,7 @@ mod tests {
|
|||
// No source for reminders on this side (see the `From` impl's doc
|
||||
// comment) — always the stub, never left uninitialised.
|
||||
assert_eq!(row.pending_reminders, 0);
|
||||
// `url` depends on process-global env (`HYPERHIVE_HIVE_DOMAIN`), so
|
||||
// `url` depends on process-global env (`HYPERHIVE_DASHBOARD_DOMAIN`), so
|
||||
// it isn't asserted here — mutating env vars in a test race with
|
||||
// every other test in this binary. `agent_url_for_domain` below
|
||||
// covers the actual path-formatting logic without touching env.
|
||||
|
|
|
|||
Loading…
Reference in a new issue