gitea/routers
Rowan Bohde c57304ac3f
Add middleware for request prioritization (#33951)
This adds a middleware for overload protection that is intended to help protect against malicious scrapers.
It does this via [`codel`](https://github.com/bohde/codel), which will perform the following:

1. Limit the number of in-flight requests to some user-defined max
2. When in-flight requests have reached their begin queuing requests.
    Logged-in requests having priority above logged-out requests
3. Once a request has been queued for too long,
    it has a probabilistic chance to be rejected based on how overloaded the entire system is.

When a server experiences more traffic than it can handle,
this keeps latency low for logged-in users and rejects just
enough requests from logged-out users to not overload the service.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2025-04-14 16:25:48 +02:00
..
api Fix bug when migrating repository (#34182) 2025-04-14 04:48:03 +00:00
common Add middleware for request prioritization (#33951) 2025-04-14 16:25:48 +02:00
install Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
private Cache GPG keys, emails and users when list commits (#34086) 2025-04-09 16:34:38 +00:00
utils Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
web Add middleware for request prioritization (#33951) 2025-04-14 16:25:48 +02:00
init.go Prepare for support performance trace (#33286) 2025-01-15 20:05:18 +00:00