summary refs log tree commit diff
path: root/synapse/config/ratelimiting.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-02-25 13:57:56 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-02-25 13:57:56 +0000
commit1dfbad8f10fa5b29dcf08673eee4e231b02c5713 (patch)
treebc95feba86dc32c482345a24c86d3b022975f549 /synapse/config/ratelimiting.py
parentClean up some code in the retry logic (#6017) (diff)
parentMerge pull request #6015 from matrix-org/erikj/ratelimit_admin_redaction (diff)
downloadsynapse-1dfbad8f10fa5b29dcf08673eee4e231b02c5713.tar.xz
Merge pull request #6015 from matrix-org/erikj/ratelimit_admin_redaction
Diffstat (limited to 'synapse/config/ratelimiting.py')
-rw-r--r--synapse/config/ratelimiting.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/config/ratelimiting.py b/synapse/config/ratelimiting.py
index a1ea4fe02d..65fd8309e0 100644
--- a/synapse/config/ratelimiting.py
+++ b/synapse/config/ratelimiting.py
@@ -83,6 +83,12 @@ class RatelimitConfig(Config):
             "federation_rr_transactions_per_room_per_second", 50
         )
 
+        rc_admin_redaction = config.get("rc_admin_redaction")
+        if rc_admin_redaction:
+            self.rc_admin_redaction = RateLimitConfig(rc_admin_redaction)
+        else:
+            self.rc_admin_redaction = None
+
     def generate_config_section(self, **kwargs):
         return """\
         ## Ratelimiting ##
@@ -107,6 +113,9 @@ class RatelimitConfig(Config):
         #     attempts for this account.
         #   - one that ratelimits third-party invites requests based on the account
         #     that's making the requests.
+        #   - one for ratelimiting redactions by room admins. If this is not explicitly
+        #     set then it uses the same ratelimiting as per rc_message. This is useful
+        #     to allow room admins to deal with abuse quickly.
         #
         # The defaults are as shown below.
         #
@@ -132,6 +141,10 @@ class RatelimitConfig(Config):
         #rc_third_party_invite:
         #  per_second: 0.2
         #  burst_count: 10
+        #
+        #rc_admin_redaction:
+        #  per_second: 1
+        #  burst_count: 50
 
 
         # Ratelimiting settings for incoming federation