nextcloud / nextcloud/notify_push
User-Agent header not set by `notify_push` nor `test_client`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 344
- Forks
- 64
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
my logs are full of this error:
WARN [notify_push::connection] /build/source/src/connection.rs:99: Error while sending authentication request to nextcloud: Client error: 403 Forbidden
this is because NextCloud is deployed behind HAProxy with an anti-DDoS setting to block any connections without something/anything set in the User-Agent header:
http-request deny unless { req.hdr(user-agent) -m found }
here's a link to a Lighttpd recipe to enable the same anti-DDoS measures.
disabling these anti-DDoS measures to allow for notify_push requests to get through is not a wise choice -- the number of attacks attempts goes up noticeably.
to properly fix this, notify_push and test_client should always set a User-Agent header to something like notify_push/1.3.0 when making http requests. Any non-empty setting will do -- most anti-DDoS recipes look for empty and blacklisted User-Agent strings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the HTTP request construction in notify_push and test_client, then inspect how authentication requests are assembled. Verify that both clients send a non-empty User-Agent on every HTTP request, and add or update coverage where the existing request behavior is tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100