Watch
0
0
Fork
You've already forked hyperhive
0

move the hive's vhosts and matrix discovery out of the gateway

The dashboard vhost, the hive domain vhost and the dashboard's local
name move to hive-c0re/vhosts.nix; the matrix .well-known discovery and
the legacy /matrix/ redirect move to glue-matrix-hive-discovery.nix,
which adds them to the hive domain vhost. Both declare through
gateway.vhosts. hive-gateway/vhosts.nix keeps the catch-all only, and
the gateway no longer reads deploy.matrix or c0re.servedFrontend, nor
deploy.hive-controller.enable for its vhosts.

Part of #3742.
This commit is contained in:
atlas 2026-10-17 13:44:20 +02:00 • committed by mara
commit b4c5954491
17 changed files with 391 additions and 378 deletions

View file

@ -126,7 +126,7 @@ fn agent_url(name: &str) -> Option<String> {
/// The pure half of [`agent_url`], split out so the path-scheme formatting
/// is testable without an env var in the loop. `/agent/<name>/` is the
/// gateway's real path scheme
/// (`nix/host-modules/hive-gateway/vhosts.nix`'s per-agent `agentLocations`
/// (`nix/host-modules/hive-c0re/vhosts.nix`'s per-agent `agentLocations`
/// block) — computed once here so a client (trollshell's sidebar, the
/// dashboard) never has to derive it and silently drift if that scheme
/// ever changes.

View file

@ -22,7 +22,7 @@ use crate::lifecycle;
/// Root of the auto-generated `OpenAPI` spec, served raw at
/// `/api/openapi.json` — see [`utoipa`]. Swagger UI itself (browsable at
/// `/api/docs`) is nginx-hosted from the nix store (see
/// `nix/host-modules/hive-gateway/vhosts.nix`'s `swaggerUiLocations`).
/// `nix/host-modules/hive-c0re/vhosts.nix`'s `swaggerUiLocations`).
/// Only routes carrying a `#[utoipa::path(...)]` annotation show up in
/// the spec — an unannotated route just doesn't appear, nothing breaks.
#[derive(OpenApi)]
@ -91,7 +91,7 @@ struct AppState {
)]
fn app(coord: Arc<Coordinator>) -> axum::Router {
// API-only: the gateway static-serves the dashboard dist and proxies
// non-static requests here (see `nix/host-modules/hive-gateway/vhosts.nix`).
// non-static requests here (see `nix/host-modules/hive-c0re/vhosts.nix`).
// Unmatched paths 404.
// No static fallback needed here either. Every route (SSE streams
// included — `utoipa::path` can document an SSE body as an opaque

View file

@ -223,8 +223,8 @@ pub const KNOWLEDGE_DIR: &str = "/var/lib/hyperhive/knowledge";
/// confinement; nothing else is doing that job.
///
/// Sibling of the gateway's `tls/`, which already lived here.
// nix: named by the gateway's nginx config (hive-gateway/vhosts.nix) and created by
// its tmpfiles rules (hive-gateway/default.nix) — must match.
// nix: named by the dashboard vhost (hive-c0re/vhosts.nix) and created by the gateway's
// tmpfiles rules (hive-gateway/default.nix) — must match.
pub const GATEWAY_CONF_DIR: &str = "/var/lib/hive-gateway/conf";
#[must_use]