hermes: dashboard auth gate + container firewall port #27

Merged
repomaa merged 1 commit from hermes-dashboard-auth into main 2026-09-30 11:25:07 +03:00
Collaborator

Problem

https://hermes.in.freun.dev timed out after the 2026-09-28 01:36 deploy. Two independent causes:

  1. Auth gate: the current hermes-agent build refuses to bind the dashboard to a
    non-loopback address (10.69.0.10) unless an auth provider is registered. The
    credentials that worked before lived only in the runtime config.yaml /
    .env, which the module rebuilds from scratch on every activation — so they
    were wiped, and hermes-backend crash-looped with exit 1.
  2. Firewall: networking.firewall.enable = true in the container with an empty
    allowedTCPPorts, so the host nginx vhost's proxied connections to
    10.69.0.10:9119 were dropped (TLS handshake completes, response hangs).

Fix

  • modules.secrets.hermes.env gains HERMES_DASHBOARD_BASIC_AUTH_PASSWORD and
    HERMES_DASHBOARD_BASIC_AUTH_SECRET — the dashboard auth plugin reads
    HERMES_DASHBOARD_BASIC_AUTH_* env vars with precedence over config, and they
    flow through the existing sops.templates."hermes-env" →
    environmentFiles → merged .env path.
  • HERMES_DASHBOARD_BASIC_AUTH_USERNAME = "hermes" is a non-secret and goes in
    the plain environment block.
  • Container firewall opens cfg.dashboardPort for the host vhost.

The Host-header middleware accepts hermes.in.freun.dev already (it matches
settings.dashboard.public_url), so no proxy-header changes are needed.

⚠️ Rekey needed BEFORE deploying this

sops secrets/hermes.yaml (YubiKey; creation rule already exists) and add:

HERMES_DASHBOARD_BASIC_AUTH_PASSWORD: <vault>
HERMES_DASHBOARD_BASIC_AUTH_SECRET: <vault>

Both values are in the Vaultwarden org item hermes dashboard (freun-dev)
(password field = login password; signing secret is in the notes). Until the
rekey lands, sops-install-secrets on freun-dev will fail on the missing keys
and the container won't rebuild.

Verification

  • nix eval green for the toplevel drv, container firewall ports [9119], and
    the username env var.
  • The plugin's env-var path was exercised end-to-end against the live backend
    (bind gate satisfied, correct password → 200 + session cookie, wrong password
    → 401).
## Problem `https://hermes.in.freun.dev` timed out after the 2026-09-28 01:36 deploy. Two independent causes: 1. **Auth gate**: the current hermes-agent build refuses to bind the dashboard to a non-loopback address (`10.69.0.10`) unless an auth provider is registered. The credentials that worked before lived only in the runtime `config.yaml` / `.env`, which the module rebuilds from scratch on every activation — so they were wiped, and `hermes-backend` crash-looped with exit 1. 2. **Firewall**: `networking.firewall.enable = true` in the container with an empty `allowedTCPPorts`, so the host nginx vhost's proxied connections to `10.69.0.10:9119` were dropped (TLS handshake completes, response hangs). ## Fix - `modules.secrets.hermes.env` gains `HERMES_DASHBOARD_BASIC_AUTH_PASSWORD` and `HERMES_DASHBOARD_BASIC_AUTH_SECRET` — the dashboard auth plugin reads `HERMES_DASHBOARD_BASIC_AUTH_*` env vars with precedence over config, and they flow through the existing `sops.templates."hermes-env"` → `environmentFiles` → merged `.env` path. - `HERMES_DASHBOARD_BASIC_AUTH_USERNAME = "hermes"` is a non-secret and goes in the plain `environment` block. - Container firewall opens `cfg.dashboardPort` for the host vhost. The Host-header middleware accepts `hermes.in.freun.dev` already (it matches `settings.dashboard.public_url`), so no proxy-header changes are needed. ## ⚠️ Rekey needed BEFORE deploying this `sops secrets/hermes.yaml` (YubiKey; creation rule already exists) and add: ``` HERMES_DASHBOARD_BASIC_AUTH_PASSWORD: <vault> HERMES_DASHBOARD_BASIC_AUTH_SECRET: <vault> ``` Both values are in the Vaultwarden org item **`hermes dashboard (freun-dev)`** (password field = login password; signing secret is in the notes). Until the rekey lands, `sops-install-secrets` on freun-dev will fail on the missing keys and the container won't rebuild. ## Verification - `nix eval` green for the toplevel drv, container firewall ports `[9119]`, and the username env var. - The plugin's env-var path was exercised end-to-end against the live backend (bind gate satisfied, correct password → 200 + session cookie, wrong password → 401).
hermes: dashboard auth gate + container firewall port
All checks were successful
Build Images / build (pull_request) Successful in 40s
Check / check (pull_request) Successful in 4m17s
380e267051
The dashboard backend refuses non-loopback binds without a registered auth
provider, and the container firewall dropped the host vhost's proxied traffic
(allowedTCPPorts was empty). Feed the basic-auth credentials through the
existing sops env file and open the dashboard port.

Rekey needed before deploy: add HERMES_DASHBOARD_BASIC_AUTH_PASSWORD and
HERMES_DASHBOARD_BASIC_AUTH_SECRET to secrets/hermes.yaml (creation rule
already exists; sops secrets/hermes.yaml with the YubiKey). Values are in
the vault item 'hermes dashboard (freun-dev)'.
hermes force-pushed hermes-dashboard-auth from 380e267051
All checks were successful
Build Images / build (pull_request) Successful in 40s
Check / check (pull_request) Successful in 4m17s
to ba619b9f83
Some checks failed
Build Images / build (pull_request) Has been cancelled
Check / check (pull_request) Has been cancelled
2026-09-30 10:41:02 +03:00
Compare
Author
Collaborator

Current status from inside the container (2026-09-30):

  • freun-dev was re-deployed at ~10:19 EEST and container@hermes is now on a closure built from current main, which does not include this PR's firewall/auth changes:
    • The container's nixos firewall still has an empty allowlist — the host nginx vhost (hermes.in.freun.dev → 10.69.0.10:9119) is being dropped by the container firewall. This matches the reported "dashboard times out over NetBird".
    • .env inside the container contains only the old keys (HYPER_API_KEY, SFERENCE_API_KEY, MATRIX_*) — no HERMES_DASHBOARD_BASIC_AUTH_*. The auth-gate env vars therefore aren't provisioned yet.
  • Today at 10:19 the deployed hermes-backend.service started failing closed: Refusing to bind dashboard to 10.69.0.10 — the auth gate engages on non-loopback binds, but no auth providers are registered (verified by running the ExecStart by hand; same message). The service is currently crash-looping with Restart=always. The new agent build fails closed because the non-loopback bind engages the gate but the basic-auth provider has no credentials → the rekey in the commit message is now the blocking step: add HERMES_DASHBOARD_BASIC_AUTH_PASSWORD + HERMES_DASHBOARD_BASIC_AUTH_SECRET to secrets/hermes.yaml (vault item "hermes dashboard (freun-dev)"), then merge + deploy this PR to restore the dashboard (auth gate satisfied, port 9119 open in the container firewall).
Current status from inside the container (2026-09-30): - freun-dev was re-deployed at ~10:19 EEST and `container@hermes` is now on a closure built from current `main`, which does **not** include this PR's firewall/auth changes: - The container's nixos firewall still has an empty allowlist — the host nginx vhost (`hermes.in.freun.dev` → `10.69.0.10:9119`) is being dropped by the container firewall. This matches the reported "dashboard times out over NetBird". - `.env` inside the container contains only the old keys (`HYPER_API_KEY`, `SFERENCE_API_KEY`, `MATRIX_*`) — no `HERMES_DASHBOARD_BASIC_AUTH_*`. The auth-gate env vars therefore aren't provisioned yet. - Today at 10:19 the deployed `hermes-backend.service` started failing closed: `Refusing to bind dashboard to 10.69.0.10 — the auth gate engages on non-loopback binds, but no auth providers are registered` (verified by running the ExecStart by hand; same message). The service is currently crash-looping with Restart=always. The new agent build fails closed because the non-loopback bind engages the gate but the basic-auth provider has no credentials → **the rekey in the commit message is now the blocking step**: add `HERMES_DASHBOARD_BASIC_AUTH_PASSWORD` + `HERMES_DASHBOARD_BASIC_AUTH_SECRET` to `secrets/hermes.yaml` (vault item "hermes dashboard (freun-dev)"), then merge + deploy this PR to restore the dashboard (auth gate satisfied, port 9119 open in the container firewall).
repomaa force-pushed hermes-dashboard-auth from ba619b9f83
Some checks failed
Build Images / build (pull_request) Has been cancelled
Check / check (pull_request) Has been cancelled
to 4486ea4ded
All checks were successful
Build Images / build (pull_request) Successful in 42s
Check / check (pull_request) Successful in 5m15s
2026-09-30 10:56:55 +03:00
Compare
repomaa scheduled this pull request to auto merge when all checks succeed 2026-09-30 10:57:25 +03:00
repomaa canceled auto merging this pull request when all checks succeed 2026-09-30 11:13:40 +03:00
repomaa scheduled this pull request to auto merge when all checks succeed 2026-09-30 11:13:47 +03:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
repomaa/nixos!27
No description provided.