Back off every dashboard login, bound requests and connections, fix the notes renderer #146
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dashboard-hardening"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this PR does
Hardens the dashboard's web server and sign-in, and fixes the Markdown renderer used for the guide and release notes.
LoginThrottle.begin(new) records an attempt before the slow password check, so parallel attempts each count. Past the free attempts the answer is 429 withRetry-After, without checking._AUTH_GATE).busy(from #145's backoff), or a helper that can't be reached. The page then answers 503, "Couldn't check your password right now. Try again in a moment.", andLoginThrottle.forgiveun-records the attempt._verify_system_loginreturns True, False or None.MAX_CONTENT_LENGTHis 64 KB app-wide, so a larger body gets 413 before anything parses it.max_import_mbplus 64 KB. Past that it returns to the networks page with "That file is too large to import."kestrel-daemon.servicegetsLimitNOFILE=4096andPrivateTmp=yes.#: the paragraph loop now uses the heading branch's exact test, so a#line that isn't a heading (#142 fixed,#### Notes, a bare#) is paragraph text.GUIDE_MDrenders byte-for-byte as before (checked).Checklist
make lint(ansible--syntax-check,yamllint,shellcheck --severity=error, and the real-data check). The Lint workflow runs this on the PR.make test(thekestrel_pipytest suite and the real-data check's tests). The Test workflow runs this on the PR..envfiles, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you.docs/, and the on-device operator guide (GUIDE_MDinkestrel_pi/userguide.py) where it applies.Release impact
kestrel_pipackage,plugins/*.py, systemd units, the journald drop-in, a lib script already in the engine'sLIB_SCRIPTS, or the CLI.config.txt/cmdline, kernel modules, the base image or partition size,builder/config.json,builder/config.yml, theMakefile, the Release workflow (.forgejo/workflows/main.yml), a shipped config default (config.toml/default.conf), or a brand-new lib script.Notes for review
web.py,webtls.py, and the daemon's unit. The update engine installs units and runsdaemon-reload, soPrivateTmp/LimitNOFILEapply after an in-place update.ThreadedWSGIServersubclassed with the caps (_capped_server), instead of throughmake_server(threaded=True), which built the same class. The deferred TLS handshake is unchanged.beginlets only the free number of parallel attempts through, andforgiveun-records./loginbody gets 413; the import refuses without the login before reading a large body; past its limit it gets the banner.#lines, the placeholder case, and a fuzz test of 3,000 random inputs, each finishing in under 0.5 s.web-ui-conventions.md(two new security conventions) and CLAUDE.md.🤖 Generated with Claude Code