Added some ratelimiting middleware

This commit is contained in:
Slatian
2023-02-25 12:14:50 +01:00
parent 9f3b6d0c17
commit a48050b234
8 changed files with 307 additions and 18 deletions

View File

@ -45,3 +45,19 @@ template_location = "templates"
# Prefixes of user agents that should get a text reponse by default
text_user_agents = ["curl/"]
[ratelimit]
# Configure a Quota for the Rate limiter
# Please note that this depends on the ip_header being
# configured correctly!
# How many requests per minute are allowed
# (How fast the leaky bucket drains)
per_minute = 20
# How many requests may come in at once
# (How much capacity the leaky bucket has)
burst = 15
#Note: The ratelimit is implemented using the governor crate