Add the Helia feedback relay #2

Merged
laurence merged 5 commits from feat/initial-relay into main 2026-10-19 21:03:17 +01:00
Owner

Adds the feedback relay: the small public service the Helia app posts feedback to, which files it as an issue on laurence/helia through a restricted bot account (Forgejo registration is closed, so the public cannot open issues themselves).

Closes #1. Deployment and the decisions behind it are tracked in laurence/ankh-morpork-infra#563.

What it does:

  • GET /api/v1/challenge and POST /api/v1/feedback as described in docs/PROTOCOL.md.
  • Proof of work with HMAC-signed single-use challenges, behind a ClientAuth trait so a future client-certificate mode can slot in without changing the report format.
  • Per-client and global rate limits, strict validation, screenshot decode and re-encode (drops EXIF and every other chunk), highlight rectangles drawn on a copy, spam heuristic that labels rather than drops, kill switch.
  • Prometheus metrics on a separate internal port, JSON logs with no addresses.
  • deploy/push-image.py builds a FROM scratch image around the static musl binary and pushes it without a Docker daemon.

Automated testing:

  • 22 unit tests (protocol validation, proof of work, rate limits, imaging, spam, metrics, issue body).
  • 5 end-to-end tests over real HTTP against a mock Forgejo: happy path with screenshot, reused and bad proof of work, 413, 415, 429 with Retry-After, 503 kill switch, spam labelling, and that health and metrics are not on the public port.
  • clippy (pedantic, warnings denied), rustfmt, cargo-deny, header check and a static musl release build run in CI.
Adds the feedback relay: the small public service the Helia app posts feedback to, which files it as an issue on laurence/helia through a restricted bot account (Forgejo registration is closed, so the public cannot open issues themselves). Closes #1. Deployment and the decisions behind it are tracked in laurence/ankh-morpork-infra#563. What it does: - `GET /api/v1/challenge` and `POST /api/v1/feedback` as described in `docs/PROTOCOL.md`. - Proof of work with HMAC-signed single-use challenges, behind a `ClientAuth` trait so a future client-certificate mode can slot in without changing the report format. - Per-client and global rate limits, strict validation, screenshot decode and re-encode (drops EXIF and every other chunk), highlight rectangles drawn on a copy, spam heuristic that labels rather than drops, kill switch. - Prometheus metrics on a separate internal port, JSON logs with no addresses. - `deploy/push-image.py` builds a FROM scratch image around the static musl binary and pushes it without a Docker daemon. Automated testing: - 22 unit tests (protocol validation, proof of work, rate limits, imaging, spam, metrics, issue body). - 5 end-to-end tests over real HTTP against a mock Forgejo: happy path with screenshot, reused and bad proof of work, 413, 415, 429 with Retry-After, 503 kill switch, spam labelling, and that health and metrics are not on the public port. - clippy (pedantic, warnings denied), rustfmt, cargo-deny, header check and a static musl release build run in CI.
Add the Helia feedback relay
Some checks failed
ci / clippy (pull_request) Successful in 39s
ci / reuse (pull_request) Successful in 2s
ci / fmt (pull_request) Failing after 13s
ci / test (pull_request) Successful in 26s
ci / musl (pull_request) Successful in 1m3s
ci / deny (pull_request) Failing after 1m52s
9bbe95f6ba
Fix formatting, lints and the time advisory; probe the repository with the narrow token
Some checks failed
ci / fmt (pull_request) Has been cancelled
ci / musl (pull_request) Has been cancelled
ci / reuse (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
ci / clippy (pull_request) Has been cancelled
ci / deny (pull_request) Has been cancelled
b46e17162b
Update the lockfile past the time advisory
All checks were successful
ci / fmt (pull_request) Successful in 12s
ci / reuse (pull_request) Successful in 2s
ci / clippy (pull_request) Successful in 40s
ci / test (pull_request) Successful in 38s
ci / musl (pull_request) Successful in 54s
ci / deny (pull_request) Successful in 1m37s
84fa62e444
Add a healthcheck subcommand for the scratch image
All checks were successful
ci / fmt (pull_request) Successful in 12s
ci / reuse (pull_request) Successful in 2s
ci / clippy (pull_request) Successful in 46s
ci / test (pull_request) Successful in 37s
ci / musl (pull_request) Successful in 54s
ci / deny (pull_request) Successful in 2m6s
c2c0ad7311
Add a smoke and abuse-control test client
All checks were successful
ci / clippy (pull_request) Successful in 51s
ci / fmt (pull_request) Successful in 13s
ci / musl (pull_request) Successful in 1m7s
ci / reuse (pull_request) Successful in 2s
ci / deny (pull_request) Successful in 2m21s
ci / test (pull_request) Successful in 41s
119ffe2695
laurence changed title from WIP: Add the Helia feedback relay to Add the Helia feedback relay 2026-10-19 20:54:20 +01:00
laurence scheduled this pull request to auto merge when all checks succeed 2026-10-19 20:54:20 +01:00
laurence deleted branch feat/initial-relay 2026-10-19 21:03:17 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
laurence/helia-feedback-relay!2
No description provided.