Watch
0
0
Fork
You've already forked hyperhive
0

gateway: declare the gateway's own vhosts under gateway.vhosts

The catch-all, the dashboard and the hive-domain vhost were built in
vhosts.nix with the listen set, TLS attrs and headers applied by hand.
They are declared under services.hyperhive.gateway.vhosts now, so every
vhost behind the gateway goes through declared-vhosts.nix.

Two gateway-side rules cover what the catch-all needed: a vhost can set
securityHeaders = false (the catch-all only returns 444), and `default`
is rendered at mkDefault priority so an operator's own default vhost
still wins. The matrix discovery locations are unchanged.

The rendered nginx vhosts are unchanged.
This commit is contained in:
atlas 2026-10-16 13:19:36 +02:00 • committed by mara
commit 68e30957e2
6 changed files with 97 additions and 35 deletions

View file

@ -114,7 +114,7 @@ let
caBundle = "${config.services.hyperhive.deploy.hive-controller.tls.stateDir}/trust-bundle.pem";
};
nginxTree = import ./vhosts.nix {
ownVhosts = import ./vhosts.nix {
gwLib = cfg.lib;
inherit (config.services.hyperhive.swarm) dashboardDomain;
autheliaDomain = config.services.hyperhive.swarm.authelia.domain;
@ -145,6 +145,9 @@ in
# file's `let` and are not option surface.
services.hyperhive.gateway.lib = vhostLib;
# The gateway's own vhosts, rendered the way every service's are.
services.hyperhive.gateway.vhosts = ownVhosts.vhosts;
assertions = [
{
assertion = !(cfg.tls.acme.enable && cfg.tls.certDir != null);
@ -392,7 +395,6 @@ in
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
inherit (nginxTree) virtualHosts;
# Route the error log through syslog so each line keeps its own
# severity. The module default is `stderr`, and systemd files that