diff options
author | Erik Johnston <erik@matrix.org> | 2018-10-25 15:25:31 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-10-25 15:25:31 +0100 |
commit | b94a43d5b5a949fbd67109b34cfcec925fa82fe4 (patch) | |
tree | 1e427071264b9cd23233175b3cff4684d93d6e36 /synapse/config/registration.py | |
parent | Use allow/deny (diff) | |
parent | Merge pull request #3975 from matrix-org/matthew/autocreate_autojoin (diff) | |
download | synapse-b94a43d5b5a949fbd67109b34cfcec925fa82fe4.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/alias_disallow_list
Diffstat (limited to 'synapse/config/registration.py')
-rw-r--r-- | synapse/config/registration.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/synapse/config/registration.py b/synapse/config/registration.py index 0fb964eb67..7480ed5145 100644 --- a/synapse/config/registration.py +++ b/synapse/config/registration.py @@ -15,10 +15,10 @@ from distutils.util import strtobool +from synapse.config._base import Config, ConfigError +from synapse.types import RoomAlias from synapse.util.stringutils import random_string_with_symbols -from ._base import Config - class RegistrationConfig(Config): @@ -44,6 +44,10 @@ class RegistrationConfig(Config): ) self.auto_join_rooms = config.get("auto_join_rooms", []) + for room_alias in self.auto_join_rooms: + if not RoomAlias.is_valid(room_alias): + raise ConfigError('Invalid auto_join_rooms entry %s' % (room_alias,)) + self.autocreate_auto_join_rooms = config.get("autocreate_auto_join_rooms", True) def default_config(self, **kwargs): registration_shared_secret = random_string_with_symbols(50) @@ -98,6 +102,13 @@ class RegistrationConfig(Config): # to these rooms #auto_join_rooms: # - "#example:example.com" + + # Where auto_join_rooms are specified, setting this flag ensures that the + # the rooms exist by creating them when the first user on the + # homeserver registers. + # Setting to false means that if the rooms are not manually created, + # users cannot be auto-joined since they do not exist. + autocreate_auto_join_rooms: true """ % locals() def add_arguments(self, parser): |