diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-12-18 11:01:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 11:01:57 -0500 |
commit | 56e00ca85e502247112a95ab8c452c83ab5fc4b0 (patch) | |
tree | 218165e2312491057446e9ea61b90a6ce4b1e4e2 /synapse/config | |
parent | Allow server admin to get admin bit in rooms where local user is an admin (#8... (diff) | |
download | synapse-56e00ca85e502247112a95ab8c452c83ab5fc4b0.tar.xz |
Send the location of the web client to the IS when inviting via 3PIDs. (#8930)
Adds a new setting `email.invite_client_location` which, if defined, is passed to the identity server during invites.
Diffstat (limited to 'synapse/config')
-rw-r--r-- | synapse/config/emailconfig.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py index 7c8b64d84b..d4328c46b9 100644 --- a/synapse/config/emailconfig.py +++ b/synapse/config/emailconfig.py @@ -322,6 +322,22 @@ class EmailConfig(Config): self.email_subjects = EmailSubjectConfig(**subjects) + # The invite client location should be a HTTP(S) URL or None. + self.invite_client_location = email_config.get("invite_client_location") or None + if self.invite_client_location: + if not isinstance(self.invite_client_location, str): + raise ConfigError( + "Config option email.invite_client_location must be type str" + ) + if not ( + self.invite_client_location.startswith("http://") + or self.invite_client_location.startswith("https://") + ): + raise ConfigError( + "Config option email.invite_client_location must be a http or https URL", + path=("email", "invite_client_location"), + ) + def generate_config_section(self, config_dir_path, server_name, **kwargs): return ( """\ @@ -389,6 +405,12 @@ class EmailConfig(Config): # #validation_token_lifetime: 15m + # The web client location to direct users to during an invite. This is passed + # to the identity server as the org.matrix.web_client_location key. Defaults + # to unset, giving no guidance to the identity server. + # + #invite_client_location: https://app.element.io + # Directory in which Synapse will try to find the template files below. # If not set, or the files named below are not found within the template # directory, default templates from within the Synapse package will be used. |