Repository navigation
fix: the error alert lists each kind of error, scanner 404s stop counting as errors, and nginx sees the visitor's address behind Cloudflare - #461
Merged
Conversation
…ting as errors, and nginx sees the visitor's address behind Cloudflare
HardMax71
enabled auto-merge (squash)
October 24, 2026 21:46
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.



Summary
The Error lines alert from #449 mailed
A=23 C=1five times since Oct 23, never saying what failed. All 28 lines were scanners asking for files the app never had (/wp-includes/css/buttons.css), and nginx logs each one as[error].Changes
nginx gets
log_not_found off, so a missing file is just a 404. It takes the visitor's address fromCF-Connecting-IPon connections from Cloudflare's ranges and sends only that upstream. Before, everyone behind one Cloudflare server shared one rate limit, and the backend read anX-Forwarded-Forentry a client could forge.The collector's drain processor gives each error line a template like
open() <*> failed (2: No such file or directory). Error lines groups by service and template, so the mail reads "16 errors in the last 5 minutes:", then "10x frontend: ..." per template and a link to the latest lines. Rules with a panel also get__dashboardUid__and__panelId__, the only way Grafana links a panel in mails.Note
Port 5001 still answers anyone until the Hetzner firewall that admits only Cloudflare's ranges is applied; that is a change on the server, not in this repo.
Type of Change
Test Plan
cd backend && uv run pytest tests/unit)cd frontend && npm run test)docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')cd frontend && npm run test:e2e)uv run python -m scripts.export_openapiin backend/, thennpm run generate:apiin frontend/), never edited by handValidation: a throwaway stack from this branch mailed that format for nginx and worker errors. Scanner paths logged no error line, and forged headers from a non-Cloudflare peer were dropped. Drain grouped 22 prod error lines from six services;
mkdocs build --strictpasses.Checklist
pre-commit run --all-filesand all checks pass