hyperhive/nix
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 922f91cb7d swarm-authelia: stop answering machine callers with a 200 error page
The authelia vhost intercepts upstream errors and serves a friendly
"SSO unavailable" page. The `=` form of `error_page` takes its status
from the redirected location, and that location serves a file -- so the
page is returned as **200**.

That is right for a human typing the URL and wrong for every machine
caller, all of which reach authelia through this same vhost by name:

  - `/api/authz/auth-request` -- nginx `auth_request` treats any 2xx as
    success, so a down authelia means access GRANTED
  - `/api/oidc/introspection` -- a token check answering 200
  - `/api/oidc/token`, `/.well-known/openid-configuration` -- clients
    parsing an HTML error page as their JSON document

Routes `/api/` and `/.well-known/` without the interception. A longer
prefix wins over `/`, and the intercept directives live inside the `/`
location rather than at server level, so they do not reach the new ones.

Split by AUDIENCE rather than by an enumerated path list: a human still
gets the page, and every machine caller -- including the login page's own
XHR, and any endpoint added later -- gets the real status.

Measured against a real nginx with a dead upstream, both arms: machine
paths return 502 where they returned 200+HTML, a subrequest through the
new prefix denies (matching a direct port dial) where through `/` it
served the protected content, and the browser control confirms the
friendly page survives. URI preservation checked separately against a
live echo upstream -- `proxy_pass` with no URI part passes the full
original path.
2026-08-27 14:04:18 +02:00
..
agent-modules backendEnvironmentFile: use the harness dir, not state, per review 2026-08-27 12:53:50 +02:00
docs refactor(nix): move the matrix host options under services.hyperhive.swarm 2026-08-05 13:45:09 +02:00
host-modules swarm-authelia: stop answering machine callers with a 200 error page 2026-08-27 14:04:18 +02:00
packages wire swarm-authelia-bridge: systemd unit, oidc client, controller auth env 2026-08-16 22:38:40 +02:00
templates refactor: nix/host-modules + nix/agent-modules layout, update doc paths 2026-07-13 22:05:49 +02:00
checks.nix nix: stop restating the npm-deps-hash regenerate command in 3 places 2026-08-16 15:57:22 +02:00
devshell.nix ci: coverage on manual dispatch, no threshold 2026-08-27 14:03:12 +02:00
module-eval.nix nix: fix shallow-merge drop in module-eval's hive stub helper 2026-08-14 09:55:19 +02:00
rust.nix docs(rust): the dep-cache comment no longer describes two consumers 2026-08-11 22:29:56 +02:00
sources.nix refactor: slim flake.nix into nix/ entry files 2026-07-13 20:55:43 +02:00
treefmt.nix refactor: slim flake.nix into nix/ entry files 2026-07-13 20:55:43 +02:00