[repo] NixOS and docs: Caddy admin socket for changes under Caddy, polkit start/stop only, edge never stops restarting, openssl in the VM tests, beside-Caddy without secrets in argv, pinned Ianitor rev, X-Served-By trial marker

This commit is contained in:
2026-11-08 10:49:42 +01:00
parent e84eb1ba74
commit bc336d1188
7 changed files with 86 additions and 38 deletions
+9 -6
View File
@@ -15,8 +15,9 @@
# --public HOST must answer 2xx or 3xx (not a sign-in redirect)
# --protected HOST without a session, must redirect to --auth-host (302/303) or answer 401
# --auth-host HOST Authelia's portal name, for --protected
# --via-ianitor HOST must answer 2xx/3xx, and the answer must not come from Caddy alone
# (Ianitor adds no Via; Caddy adds "Via: 1.1 Caddy" once, so exactly one)
# --via-ianitor HOST must answer 2xx/3xx with "X-Served-By: ianitor": the trial hosts set that
# response header in their Ianitor route (configuration-server.patch), so
# an answer Caddy gives on its own fails
# --control-port N control's port (default 7878): must NOT answer from outside
# --insecure accept a certificate the client does not trust (staging: tls internal)
#
@@ -57,7 +58,7 @@ failures=0
pass() { printf 'ok %s\n' "$1"; }
fail() { printf 'FAIL %s\n' "$1"; failures=$((failures + 1)); }
# status, location and the number of Via headers for https://HOST/ sent to the server
# the response head of https://HOST/ sent to the server
probe() {
curl -sS -o /dev/null -D - --max-time 15 "${insecure[@]}" \
--resolve "$1:443:$server" "https://$1/" 2>/dev/null | tr -d '\r'
@@ -88,9 +89,11 @@ done
for h in "${via[@]}"; do
head=$(probe "$h")
code=$(printf '%s\n' "$head" | awk 'NR==1 {print $2}')
vias=$(printf '%s\n' "$head" | grep -ci '^via:' || true)
if [[ "$code" =~ ^[23][0-9][0-9]$ ]]; then
pass "through Ianitor $h answers $code (Via headers: $vias)"
served=$(printf '%s\n' "$head" | awk 'tolower($1)=="x-served-by:" {print tolower($2)}')
if [[ "$code" =~ ^[23][0-9][0-9]$ ]] && [ "$served" = "ianitor" ]; then
pass "through Ianitor $h answers $code (X-Served-By: ianitor)"
elif [[ "$code" =~ ^[23][0-9][0-9]$ ]]; then
fail "$h answers $code, but not through Ianitor (no X-Served-By: ianitor)"
else
fail "through Ianitor $h answers '${code:-nothing}'"
fi