mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Move settings from registration to ratelimiting in config file
This commit is contained in:
parent
16c8b4ecbd
commit
067ce795c0
@ -27,6 +27,13 @@ class RatelimitConfig(Config):
|
||||
self.federation_rc_reject_limit = config["federation_rc_reject_limit"]
|
||||
self.federation_rc_concurrent = config["federation_rc_concurrent"]
|
||||
|
||||
self.rc_registration_requests_per_second = config.get(
|
||||
"rc_registration_requests_per_second", 0.17,
|
||||
)
|
||||
self.rc_registration_request_burst_count = config.get(
|
||||
"rc_registration_request_burst_count", 3,
|
||||
)
|
||||
|
||||
def default_config(self, **kwargs):
|
||||
return """\
|
||||
## Ratelimiting ##
|
||||
@ -62,4 +69,15 @@ class RatelimitConfig(Config):
|
||||
# single server
|
||||
#
|
||||
federation_rc_concurrent: 3
|
||||
|
||||
# Number of registration requests a client can send per second.
|
||||
# Defaults to 1/minute (0.17).
|
||||
#
|
||||
#rc_registration_requests_per_second: 0.17
|
||||
|
||||
# Number of registration requests a client can send before being
|
||||
# throttled.
|
||||
# Defaults to 3.
|
||||
#
|
||||
#rc_registration_request_burst_count: 3.0
|
||||
"""
|
||||
|
@ -54,13 +54,6 @@ class RegistrationConfig(Config):
|
||||
config.get("disable_msisdn_registration", False)
|
||||
)
|
||||
|
||||
self.rc_registration_requests_per_second = config.get(
|
||||
"rc_registration_requests_per_second", 0.17,
|
||||
)
|
||||
self.rc_registration_request_burst_count = config.get(
|
||||
"rc_registration_request_burst_count", 3,
|
||||
)
|
||||
|
||||
def default_config(self, generate_secrets=False, **kwargs):
|
||||
if generate_secrets:
|
||||
registration_shared_secret = 'registration_shared_secret: "%s"' % (
|
||||
@ -71,6 +64,8 @@ class RegistrationConfig(Config):
|
||||
|
||||
return """\
|
||||
## Registration ##
|
||||
# Registration can be rate-limited using the parameters in the "Ratelimiting"
|
||||
# section of this file.
|
||||
|
||||
# Enable registration for new users.
|
||||
enable_registration: False
|
||||
@ -147,17 +142,6 @@ class RegistrationConfig(Config):
|
||||
# users cannot be auto-joined since they do not exist.
|
||||
#
|
||||
autocreate_auto_join_rooms: true
|
||||
|
||||
# Number of registration requests a client can send per second.
|
||||
# Defaults to 1/minute (0.17).
|
||||
#
|
||||
#rc_registration_requests_per_second: 0.17
|
||||
|
||||
# Number of registration requests a client can send before being
|
||||
# throttled.
|
||||
# Defaults to 3.
|
||||
#
|
||||
#rc_registration_request_burst_count: 3.0
|
||||
""" % locals()
|
||||
|
||||
def add_arguments(self, parser):
|
||||
|
Loading…
Reference in New Issue
Block a user