Hardening: self-exclusion, login rate-limit, SSE keepalive, graceful shutdown#2
Merged
Merged
Conversation
…tdown Review-pass hardening for shipping to other users: - docker.js: exclude the app's own container from the dashboard (best-effort via SELF_CONTAINER_NAME + hostname match) so it can't be told to update and thereby kill itself mid-update. - auth.js: per-client-IP failed-login rate limiting with a temporary lockout (returns 429 too_many_attempts); covered by new unit tests (52 total). - sse.js: 15s keepalive comments + X-Accel-Buffering:no so reverse proxies don't drop the log stream during long, sparse pulls; clear keepalive on finish/disconnect. - index.js: graceful SIGTERM/SIGINT shutdown (close server + SQLite), and disable x-powered-by. - Dockerfile: HEALTHCHECK against /api/health. - client: useUpdateRunner settles exactly once (a late stream-close error no longer overwrites a success); accurate empty-state copy; iOS PWA meta tags. - docs: LICENSE (MIT), env/contract/README updates for the above. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Lj6nYJQDtLaZFvvEQJGM4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review-pass hardening to make the app ship-ready for other users (no functional rewrites — the core flows were already sound). Branched off
main.Fixes
SELF_CONTAINER_NAME, defaultdiun-updater, + hostname match).429 too_many_attempts). New unit tests (52 total, all passing).X-Accel-Buffering: noso a reverse proxy doesn't drop the log stream during a long pull with sparse output; keepalive cleared on finish/disconnect.docker stopdoesn't leave the WAL half-written. Alsox-powered-bydisabled.HEALTHCHECKagainst/api/health.useUpdateRunnernow settles exactly once, so a stream-close error arriving after the result can't overwrite a success or double-refresh; accurate empty-state copy; iOS PWA meta tags.LICENSE(MIT), plus.env.example,API_CONTRACT.md, and README updated for all of the above.Verified
node --test: 52/52 pass (incl. 5 new rate-limit tests).vite buildclean.401, 11th →429;SIGTERM→ clean shutdown.Still pending (unchanged from before): live Docker E2E on a real host — this build env has no daemon. Follow the README's 5-minute throwaway-stack test.
🤖 Generated with Claude Code
Generated by Claude Code