Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
067ce795
Commit
067ce795
authored
6 years ago
by
Brendan Abolivier
Browse files
Options
Downloads
Patches
Plain Diff
Move settings from registration to ratelimiting in config file
parent
16c8b4ec
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/config/ratelimiting.py
+18
-0
18 additions, 0 deletions
synapse/config/ratelimiting.py
synapse/config/registration.py
+2
-18
2 additions, 18 deletions
synapse/config/registration.py
with
20 additions
and
18 deletions
synapse/config/ratelimiting.py
+
18
−
0
View file @
067ce795
...
@@ -27,6 +27,13 @@ class RatelimitConfig(Config):
...
@@ -27,6 +27,13 @@ class RatelimitConfig(Config):
self
.
federation_rc_reject_limit
=
config
[
"
federation_rc_reject_limit
"
]
self
.
federation_rc_reject_limit
=
config
[
"
federation_rc_reject_limit
"
]
self
.
federation_rc_concurrent
=
config
[
"
federation_rc_concurrent
"
]
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
):
def
default_config
(
self
,
**
kwargs
):
return
"""
\
return
"""
\
## Ratelimiting ##
## Ratelimiting ##
...
@@ -62,4 +69,15 @@ class RatelimitConfig(Config):
...
@@ -62,4 +69,15 @@ class RatelimitConfig(Config):
# single server
# single server
#
#
federation_rc_concurrent: 3
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
"""
"""
This diff is collapsed.
Click to expand it.
synapse/config/registration.py
+
2
−
18
View file @
067ce795
...
@@ -54,13 +54,6 @@ class RegistrationConfig(Config):
...
@@ -54,13 +54,6 @@ class RegistrationConfig(Config):
config
.
get
(
"
disable_msisdn_registration
"
,
False
)
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
):
def
default_config
(
self
,
generate_secrets
=
False
,
**
kwargs
):
if
generate_secrets
:
if
generate_secrets
:
registration_shared_secret
=
'
registration_shared_secret:
"
%s
"'
%
(
registration_shared_secret
=
'
registration_shared_secret:
"
%s
"'
%
(
...
@@ -71,6 +64,8 @@ class RegistrationConfig(Config):
...
@@ -71,6 +64,8 @@ class RegistrationConfig(Config):
return
"""
\
return
"""
\
## Registration ##
## Registration ##
# Registration can be rate-limited using the parameters in the
"
Ratelimiting
"
# section of this file.
# Enable registration for new users.
# Enable registration for new users.
enable_registration: False
enable_registration: False
...
@@ -147,17 +142,6 @@ class RegistrationConfig(Config):
...
@@ -147,17 +142,6 @@ class RegistrationConfig(Config):
# users cannot be auto-joined since they do not exist.
# users cannot be auto-joined since they do not exist.
#
#
autocreate_auto_join_rooms: true
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
()
"""
%
locals
()
def
add_arguments
(
self
,
parser
):
def
add_arguments
(
self
,
parser
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment