Watch
0
0
Fork
You've already forked hyperhive
0

matrix: serve the web client unconditionally; link it from the swarm domain

Removes services.hyperhive.deploy.matrix.gui.enable and its
swarm.matrix.gui.enable alias; both are mkRemovedOptionModule stubs. A
host running the homeserver serves fluffychat at gatewayHost's vhost,
and the hive's /matrix/ redirect follows the same condition.

The swarm-controller builds the Matrix quick link from
swarm.matrix.gatewayHost, replacing hive-matrix.nix's per-host entry.
HIVE_MATRIX_PUBLIC_URL is set on every hive with a gatewayHost, so
`hivectl open matrix` resolves off the homeserver's host too.

Drops HIVE_MATRIX_GUI_ENABLED and the dashboard's matrix_gui_enabled
field; nothing in the frontend reads it.

Refs #4885
This commit is contained in:
atlas 2026-10-02 18:41:21 +02:00
commit f60f8af33b
10 changed files with 48 additions and 96 deletions

View file

@ -73,12 +73,6 @@ pub(super) struct StateSnapshot {
/// links each container's config + each approval's commit into the
/// forge's `agent-configs` repos.
forge_present: bool,
/// Whether `services.hyperhive.deploy.matrix.gui.enable` is on. Sourced
/// from the `HIVE_MATRIX_GUI_ENABLED` env var the c0re NixOS module
/// sets. The matrix client itself is served on the homeserver's
/// gateway vhost; the hive's `/matrix/` path redirects there
/// (`nix/host-modules/hive-gateway/vhosts.nix`).
matrix_gui_enabled: bool,
/// Whether `hive-gateway` is in front of this dashboard. Sourced
/// from the `HIVE_GATEWAY_ENABLED` env var, which the c0re NixOS
/// module now always sets (the gateway runs unconditionally
@ -313,17 +307,10 @@ pub(super) async fn api_state(
tombstones,
port_conflicts,
forge_present: crate::forge::is_present().await,
matrix_gui_enabled: std::env::var_os("HIVE_MATRIX_GUI_ENABLED").is_some_and(|v| {
// Accept any truthy string ("1", "true", "yes") since the
// env var is set by NixOS module wiring with the literal
// "1"; defensive parse so manual overrides also work.
let s = v.to_string_lossy().to_ascii_lowercase();
matches!(s.as_str(), "1" | "true" | "yes")
}),
gateway_enabled: std::env::var_os("HIVE_GATEWAY_ENABLED").is_some_and(|v| {
// Same truthy-string parse as `matrix_gui_enabled`; the
// env var is set by the c0re NixOS module to the literal
// "1" — the gateway always runs alongside hyperhive.
// Accept any truthy string ("1", "true", "yes"): the c0re
// NixOS module sets the literal "1" (the gateway always runs
// alongside hyperhive), and manual overrides also parse.
let s = v.to_string_lossy().to_ascii_lowercase();
matches!(s.as_str(), "1" | "true" | "yes")
}),