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 /config | |
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 'config')
-rw-r--r-- | config/default.yaml | 8 | ||||
-rw-r--r-- | config/production.yaml.example | 8 | ||||
-rw-r--r-- | config/test.yaml | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/config/default.yaml b/config/default.yaml index a213d5b0a..be5c8993c 100644 --- a/config/default.yaml +++ b/config/default.yaml | |||
@@ -10,10 +10,18 @@ webserver: | |||
10 | port: 9000 | 10 | port: 9000 |
11 | 11 | ||
12 | rates_limit: | 12 | rates_limit: |
13 | api: | ||
14 | # 50 attempts in 10 seconds | ||
15 | window: 10 seconds | ||
16 | max: 50 | ||
13 | login: | 17 | login: |
14 | # 15 attempts in 5 min | 18 | # 15 attempts in 5 min |
15 | window: 5 minutes | 19 | window: 5 minutes |
16 | max: 15 | 20 | max: 15 |
21 | signup: | ||
22 | # 2 attempts in 5 min (only succeeded attempts are taken into account) | ||
23 | window: 5 minutes | ||
24 | max: 2 | ||
17 | ask_send_email: | 25 | ask_send_email: |
18 | # 3 attempts in 5 min | 26 | # 3 attempts in 5 min |
19 | window: 5 minutes | 27 | window: 5 minutes |
diff --git a/config/production.yaml.example b/config/production.yaml.example index cdf6136d8..f55f5c096 100644 --- a/config/production.yaml.example +++ b/config/production.yaml.example | |||
@@ -9,10 +9,18 @@ webserver: | |||
9 | port: 443 | 9 | port: 443 |
10 | 10 | ||
11 | rates_limit: | 11 | rates_limit: |
12 | api: | ||
13 | # 50 attempts in 10 seconds | ||
14 | window: 10 seconds | ||
15 | max: 50 | ||
12 | login: | 16 | login: |
13 | # 15 attempts in 5 min | 17 | # 15 attempts in 5 min |
14 | window: 5 minutes | 18 | window: 5 minutes |
15 | max: 15 | 19 | max: 15 |
20 | signup: | ||
21 | # 2 attempts in 5 min (only succeeded attempts are taken into account) | ||
22 | window: 5 minutes | ||
23 | max: 2 | ||
16 | ask_send_email: | 24 | ask_send_email: |
17 | # 3 attempts in 5 min | 25 | # 3 attempts in 5 min |
18 | window: 5 minutes | 26 | window: 5 minutes |
diff --git a/config/test.yaml b/config/test.yaml index 8d3921614..0a5df75be 100644 --- a/config/test.yaml +++ b/config/test.yaml | |||
@@ -5,6 +5,14 @@ listen: | |||
5 | webserver: | 5 | webserver: |
6 | https: false | 6 | https: false |
7 | 7 | ||
8 | rates_limit: | ||
9 | signup: | ||
10 | window: 10 minutes | ||
11 | max: 50 | ||
12 | login: | ||
13 | window: 5 minutes | ||
14 | max: 20 | ||
15 | |||
8 | database: | 16 | database: |
9 | hostname: 'localhost' | 17 | hostname: 'localhost' |
10 | port: 5432 | 18 | port: 5432 |