diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-04 16:42:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-07-04 16:42:40 +0200 |
commit | c1340a6ac35f924161e6ec2a1d728e20c89e55c8 (patch) | |
tree | 8f0a6b72b36be586422002039720d3a08309cbea /server/initializers/constants.ts | |
parent | fd0bfc3ac43eb0c0c2ac0b21bc2e0670f546384f (diff) | |
download | PeerTube-c1340a6ac35f924161e6ec2a1d728e20c89e55c8.tar.gz PeerTube-c1340a6ac35f924161e6ec2a1d728e20c89e55c8.tar.zst PeerTube-c1340a6ac35f924161e6ec2a1d728e20c89e55c8.zip |
Add rate limit to registration and API endpoints
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 500f8770a..abd9c2003 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -280,17 +280,6 @@ let CONSTRAINTS_FIELDS = { | |||
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
283 | const RATES_LIMIT = { | ||
284 | LOGIN: { | ||
285 | WINDOW_MS: CONFIG.RATES_LIMIT.LOGIN.WINDOW_MS, | ||
286 | MAX: CONFIG.RATES_LIMIT.LOGIN.MAX | ||
287 | }, | ||
288 | ASK_SEND_EMAIL: { | ||
289 | WINDOW_MS: CONFIG.RATES_LIMIT.ASK_SEND_EMAIL.WINDOW_MS, | ||
290 | MAX: CONFIG.RATES_LIMIT.ASK_SEND_EMAIL.MAX | ||
291 | } | ||
292 | } | ||
293 | |||
294 | let VIDEO_VIEW_LIFETIME = 60000 * 60 // 1 hour | 283 | let VIDEO_VIEW_LIFETIME = 60000 * 60 // 1 hour |
295 | let CONTACT_FORM_LIFETIME = 60000 * 60 // 1 hour | 284 | let CONTACT_FORM_LIFETIME = 60000 * 60 // 1 hour |
296 | 285 | ||
@@ -624,8 +613,6 @@ if (isTestInstance() === true) { | |||
624 | FILES_CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000 | 613 | FILES_CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000 |
625 | MEMOIZE_TTL.OVERVIEWS_SAMPLE = 1 | 614 | MEMOIZE_TTL.OVERVIEWS_SAMPLE = 1 |
626 | ROUTE_CACHE_LIFETIME.OVERVIEWS.VIDEOS = '0ms' | 615 | ROUTE_CACHE_LIFETIME.OVERVIEWS.VIDEOS = '0ms' |
627 | |||
628 | RATES_LIMIT.LOGIN.MAX = 20 | ||
629 | } | 616 | } |
630 | 617 | ||
631 | updateWebserverUrls() | 618 | updateWebserverUrls() |
@@ -696,7 +683,6 @@ export { | |||
696 | SCHEDULER_INTERVALS_MS, | 683 | SCHEDULER_INTERVALS_MS, |
697 | REPEAT_JOBS, | 684 | REPEAT_JOBS, |
698 | STATIC_DOWNLOAD_PATHS, | 685 | STATIC_DOWNLOAD_PATHS, |
699 | RATES_LIMIT, | ||
700 | MIMETYPES, | 686 | MIMETYPES, |
701 | CRAWL_REQUEST_CONCURRENCY, | 687 | CRAWL_REQUEST_CONCURRENCY, |
702 | DEFAULT_AUDIO_RESOLUTION, | 688 | DEFAULT_AUDIO_RESOLUTION, |