1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Add tracker rate limiter

This commit is contained in:
Chocobozzz 2018-06-26 16:53:24 +02:00
parent 11fa7d392a
commit 9b67da3d9b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 107 additions and 33 deletions

View file

@ -450,6 +450,14 @@ const FEEDS = {
// ---------------------------------------------------------------------------
const TRACKER_RATE_LIMITS = {
INTERVAL: 60000 * 5, // 5 minutes
ANNOUNCES_PER_IP_PER_INFOHASH: 10, // maximum announces per torrent in the interval
ANNOUNCES_PER_IP: 30 // maximum announces for all our torrents in the interval
}
// ---------------------------------------------------------------------------
// Special constants for a test instance
if (isTestInstance() === true) {
ACTOR_FOLLOW_SCORE.BASE = 20
@ -482,6 +490,7 @@ export {
AVATARS_SIZE,
ACCEPT_HEADERS,
BCRYPT_SALT_SIZE,
TRACKER_RATE_LIMITS,
CACHE,
CONFIG,
CONSTRAINTS_FIELDS,