Add rate limit support to API

This allows us to prevent users from hammering the API every few seconds
to check if any of their packages were updated. Real world users check
as often as every 5 or 10 seconds.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Florian Pritz 2018-02-01 11:55:44 +01:00 committed by Lukas Fleischer
parent f51d4c32cd
commit 27654afadb
4 changed files with 111 additions and 0 deletions

View file

@ -36,6 +36,10 @@ enable-maintenance = 1
maintenance-exceptions = 127.0.0.1
render-comment-cmd = /usr/local/bin/aurweb-rendercomment
[ratelimit]
request_limit = 4000
window_length = 86400
[notifications]
notify-cmd = /usr/local/bin/aurweb-notify
sendmail = /usr/bin/sendmail