fix: basicauth double-prefix render; open-webui off slirp4netns

basicauth (2026-08-22 incident):
- the Caddyfile template carried its own $2a$14$ prefix and deploy.sh
  substituted the full hash (prefix included), rendering an invalid
  double-prefixed hash. Every basicauth vhost rejected every password
  with 401 and Caddy logged nothing.
- template is now a bare REPLACE_WITH_HASH token; tests pin the render
  contract (no prefix in template; rendered line is exactly 'dank <hash>').

open-webui (2026-08-22 incident):
- its slirp4netns helper process died, leaving the container running
  with only 'lo' in its netns: port 3005 accepted TCP and reset every
  request, so chat served empty responses for ~2 days, unlogged.
- move to a pinned bridge network (systemd-open-webui, 10.89.3.0/24,
  gw 10.89.3.1) — no per-container helper to die.
- LLM endpoint reached via the gateway (host.containers.internal is
  slirp-only): OPENAI_API_BASE_URL=http://10.89.3.1:52625.
- add a quadlet healthcheck: /health (app) + non-loopback interface
  (network liveness; the dead-tap state leaves only 'lo').
- deploy script now copies the .network file too.
- docs updated (OpenWebUI History section, Caddy basic-auth contract).
This commit is contained in:
Frank committed 2026-08-22 13:07:43 -07:00
1 parent 5c9ade4e7a
commit da68b5ce1a
9 files changed
+129 -27

No files matched your search

+13
View File
@@ -49,6 +49,19 @@ CADDYFILE="$REPO_ROOT/dankclaw/Caddyfile"
grep -q 'REPLACE_WITH_HASH' "$CADDYFILE"
}
@test "the basicauth placeholder is a bare token (no bcrypt prefix in the template)" {
# Regression (2026-08-22): the template line was
# dank $2a$14$REPLACE_WITH_HASH
# and deploy.sh substitutes the FULL hash (prefix included), so the
# rendered line became an invalid double-prefixed hash and every
# basicauth vhost rejected every password with 401.
if grep -qE '\$2[abxy]\$[0-9]+\$REPLACE_WITH_HASH' "$CADDYFILE"; then
echo "Caddyfile: bcrypt prefix before REPLACE_WITH_HASH (double-prefix regression)"
return 1
fi
grep -qE 'dank REPLACE_WITH_HASH' "$CADDYFILE"
}
@test "compose no longer defines the quadlet-replaced services" {
# gitea, its postgres, and open-webui run as boot-persistent quadlets on
# dankclaw (see dankclaw/gitea/quadlet, dankclaw/open-webui/quadlet).