refactor(3202): authelia declares its own vhost and dns name

Moves the authelia vhost out of the gateway's vhosts.nix and its
`address=` rule out of dnsmasq.nix, into swarm-authelia.nix.

Both land inside that module's existing `cfg.enable` guard, which is
the load-bearing part: every hive in a swarm knows `authelia.url`, but
only the host that RUNS the container may claim the name. A client hive
declaring the vhost would answer for a service it does not run, and
publishing the DNS record would point every agent on its bridge at that
wrong answer.

The kit grows a fourth member, `errorPages`, because the vhost aims its
502/503/504 at the gateway's styled sso-unavailable page. Republished
rather than imported per module: a service rendering its own would drift
from the rest of the gateway the first time the theme changed.
This commit is contained in:
atlas 2026-08-13 12:50:55 +02:00
commit 56ab6d26c1
6 changed files with 91 additions and 56 deletions

View file

@ -64,11 +64,17 @@ let
svcCert = "${tlsDir}/swarm-services.pem";
svcKey = "${tlsDir}/swarm-services-key.pem";
# Styled static error pages. Built once here and reached two ways:
# directly by ./vhosts.nix, and via the published kit by any service
# module that aims an `error_page` at one.
errorPages = import ./error-pages.nix { inherit pkgs; };
# The vhost construction kit (listen set / per-name TLS attrs /
# security headers). Computed here, published as `cfg.lib` below, and
# handed to ./vhosts.nix **as the published value** — so the tree the
# gateway renders and the kit a service module gets are the same
# object by construction, not by two call sites agreeing.
# security headers / error pages). Computed here, published as
# `cfg.lib` below, and handed to ./vhosts.nix **as the published
# value** — so the tree the gateway renders and the kit a service
# module gets are the same object by construction, not by two call
# sites agreeing.
vhostLib = import ./vhost-lib.nix {
inherit
lib
@ -78,6 +84,7 @@ let
svcCert
svcKey
swarmServiceDomains
errorPages
;
};
@ -86,6 +93,7 @@ let
inherit
lib
cfg
errorPages
matrixCfg
autheliaCfg
uiCfg
@ -94,7 +102,6 @@ let
dashboardDist
swaggerUiTheme
;
errorPages = import ./error-pages.nix { inherit pkgs; };
};
in
{
@ -373,7 +380,6 @@ in
cfg
networkCfg
matrixCfg
autheliaCfg
uiCfg
hyperhiveDomain
;