gitea/routers/web
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
..
admin Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
auth Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
devtest Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
events Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
explore Improve issue & code search (#33860) 2025-03-13 11:07:48 +08:00
feed Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
healthcheck Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
misc Refactor cache-control (#33861) 2025-03-13 07:04:50 +08:00
org refactor organization menu (#33928) 2025-04-10 12:12:55 -07:00
repo Fix incorrect file links (#34189) 2025-04-13 12:27:31 -07:00
shared refactor organization menu (#33928) 2025-04-10 12:12:55 -07:00
user refactor organization menu (#33928) 2025-04-10 12:12:55 -07:00
base.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
githttp.go Fix git client accessing renamed repo (#34034) 2025-03-28 07:28:58 +08:00
goget.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
home.go Refactor error system (#33610) 2025-02-16 22:13:17 -08:00
metrics.go
nodeinfo.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
passkey.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
swagger_json.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
web.go Add middleware for request prioritization (#33951) 2025-04-14 16:25:48 +02:00
webfinger.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00