gateway: service modules declare their vhost under gateway.vhosts
Ten service modules (forge, matrix chat, authelia, grafana, otel, nats, swarm-ui, victorialogs, victoriametrics, bao UI) wrote services.nginx.virtualHosts themselves, each applying the gateway's listen set, per-name TLS attrs and security headers by hand. They now declare services.hyperhive.gateway.vhosts.<name> with only their own locations and options; ./declared-vhosts.nix renders it into the nginx vhost with listen, TLS and headers added. An eval assertion refuses a declared vhost that sets listen, addSSL, onlySSL, enableACME, useACMEHost, sslCertificate or sslCertificateKey, and one declared while the gateway is off. nats' own leaf is the new `certificate` field. The rendered nginx vhosts are unchanged.
This commit is contained in:
parent
7b50ae57e4
commit
ddb583cc22
17 changed files with 652 additions and 513 deletions
|
|
@ -558,9 +558,7 @@ in
|
|||
# Websockets: Grafana Live streams panel updates over one, and without
|
||||
# the upgrade headers dashboards load and then never refresh — which
|
||||
# reads as stale data rather than as a proxy fault.
|
||||
services.nginx.virtualHosts."${cfg.domain}" = (gatewayCfg.lib.tlsFor cfg.domain) // {
|
||||
listen = gatewayCfg.lib.listen;
|
||||
extraConfig = gatewayCfg.lib.securityHeaders;
|
||||
services.hyperhive.gateway.vhosts."${cfg.domain}" = {
|
||||
# Grafana serves its Prometheus exposition to anyone, signed in or not
|
||||
# (`metrics.enabled` below, no `basic_auth_*`), so this location's auth
|
||||
# is the only gate on it. `=` is enough: nginx matches the decoded,
|
||||
|
|
|
|||
Loading…
Reference in a new issue