Show the API reference with Redoc

Replace the hand-built reference page with Redoc rendering the generated
OpenAPI document. The bundle is fetched by package.nix (pinned hash) and
served from the UI's own address; only that page gets a style nonce and
worker-src blob: in its CSP.

The spec now explains authentication, saved-not-applied, ETags (If-Match,
409) and errors, documents the ETag header, gives each operation a curl
sample, and no longer names MCP tools. Area GETs no longer emit
"parameters": null, which Redoc could not render.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV9dZrK6nipHkPfyM4F
This commit is contained in:
2026-11-01 22:01:30 +01:00
co-authored by Claude Sonnet 5.5
parent 64e08fb485
commit 876080d3f5
14 changed files with 245 additions and 201 deletions
+3
View File
@@ -21,6 +21,9 @@ address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostn
LEASES
echo '{"version": "0.0.0-dev", "serial": 1, "schema": 2}' > "$dir/router-release"
cd "$root/pkgs/router-webui"
# The API reference page is Redoc; the package fetches it (pkgs/router-webui/package.nix, same version).
[ -e static/redoc.standalone.js ] ||
curl -fsSL -o static/redoc.standalone.js https://cdn.jsdelivr.net/npm/redoc@2.5.2/bundles/redoc.standalone.js
echo devpassword1 | go run . passwd "$dir/webui-password"
echo
echo " https://127.0.0.1:8443 password: devpassword1 (the certificate is self-signed)"