aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-26 16:53:24 +0200
committerChocobozzz <me@florianbigard.com>2018-06-26 16:53:43 +0200
commit9b67da3d9bc951c624f17dce7821036f8518d893 (patch)
tree91de299c2eb45a12b0c775b085c5f7a13dc16f71 /server/initializers
parent11fa7d392a21fe73dd235375b89c554e9b5ba18c (diff)
downloadPeerTube-9b67da3d9bc951c624f17dce7821036f8518d893.tar.gz
PeerTube-9b67da3d9bc951c624f17dce7821036f8518d893.tar.zst
PeerTube-9b67da3d9bc951c624f17dce7821036f8518d893.zip
Add tracker rate limiter
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/constants.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 53902071c..4e1c8dda7 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -450,6 +450,14 @@ const FEEDS = {
450 450
451// --------------------------------------------------------------------------- 451// ---------------------------------------------------------------------------
452 452
453const TRACKER_RATE_LIMITS = {
454 INTERVAL: 60000 * 5, // 5 minutes
455 ANNOUNCES_PER_IP_PER_INFOHASH: 10, // maximum announces per torrent in the interval
456 ANNOUNCES_PER_IP: 30 // maximum announces for all our torrents in the interval
457}
458
459// ---------------------------------------------------------------------------
460
453// Special constants for a test instance 461// Special constants for a test instance
454if (isTestInstance() === true) { 462if (isTestInstance() === true) {
455 ACTOR_FOLLOW_SCORE.BASE = 20 463 ACTOR_FOLLOW_SCORE.BASE = 20
@@ -482,6 +490,7 @@ export {
482 AVATARS_SIZE, 490 AVATARS_SIZE,
483 ACCEPT_HEADERS, 491 ACCEPT_HEADERS,
484 BCRYPT_SALT_SIZE, 492 BCRYPT_SALT_SIZE,
493 TRACKER_RATE_LIMITS,
485 CACHE, 494 CACHE,
486 CONFIG, 495 CONFIG,
487 CONSTRAINTS_FIELDS, 496 CONSTRAINTS_FIELDS,