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/config.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/config.ts')
-rw-r--r-- | server/initializers/config.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/initializers/config.ts b/server/initializers/config.ts index bb278ba43..eefb45fb9 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts | |||
@@ -72,6 +72,14 @@ const CONFIG = { | |||
72 | PORT: config.get<number>('webserver.port') | 72 | PORT: config.get<number>('webserver.port') |
73 | }, | 73 | }, |
74 | RATES_LIMIT: { | 74 | RATES_LIMIT: { |
75 | API: { | ||
76 | WINDOW_MS: parseDurationToMs(config.get<string>('rates_limit.api.window')), | ||
77 | MAX: config.get<number>('rates_limit.api.max') | ||
78 | }, | ||
79 | SIGNUP: { | ||
80 | WINDOW_MS: parseDurationToMs(config.get<string>('rates_limit.signup.window')), | ||
81 | MAX: config.get<number>('rates_limit.signup.max') | ||
82 | }, | ||
75 | LOGIN: { | 83 | LOGIN: { |
76 | WINDOW_MS: parseDurationToMs(config.get<string>('rates_limit.login.window')), | 84 | WINDOW_MS: parseDurationToMs(config.get<string>('rates_limit.login.window')), |
77 | MAX: config.get<number>('rates_limit.login.max') | 85 | MAX: config.get<number>('rates_limit.login.max') |