@@ -49,6 +49,10 @@ def __init__(self, config, synapse_config):
4949
5050 self .startup_job_max_delta = self .period * 10.0 / 100.0
5151
52+ if self .renew_by_email_enabled :
53+ if "public_baseurl" not in synapse_config :
54+ raise ConfigError ("Can't send renewal emails without 'public_baseurl'" )
55+
5256 template_dir = config .get ("template_dir" )
5357
5458 if not template_dir :
@@ -105,6 +109,13 @@ def read_config(self, config, **kwargs):
105109 account_threepid_delegates = config .get ("account_threepid_delegates" ) or {}
106110 self .account_threepid_delegate_email = account_threepid_delegates .get ("email" )
107111 self .account_threepid_delegate_msisdn = account_threepid_delegates .get ("msisdn" )
112+ if self .account_threepid_delegate_msisdn and not self .public_baseurl :
113+ raise ConfigError (
114+ "The configuration option `public_baseurl` is required if "
115+ "`account_threepid_delegate.msisdn` is set, such that "
116+ "clients know where to submit validation tokens to. Please "
117+ "configure `public_baseurl`."
118+ )
108119
109120 self .default_identity_server = config .get ("default_identity_server" )
110121 self .allow_guest_access = config .get ("allow_guest_access" , False )
@@ -227,9 +238,8 @@ def generate_config_section(self, generate_secrets=False, **kwargs):
227238 # send an email to the account's email address with a renewal link. By
228239 # default, no such emails are sent.
229240 #
230- # If you enable this setting, you will also need to fill out the 'email'
231- # configuration section. You should also check that 'public_baseurl' is set
232- # correctly.
241+ # If you enable this setting, you will also need to fill out the 'email' and
242+ # 'public_baseurl' configuration sections.
233243 #
234244 #renew_at: 1w
235245
@@ -320,7 +330,8 @@ def generate_config_section(self, generate_secrets=False, **kwargs):
320330 # The identity server which we suggest that clients should use when users log
321331 # in on this server.
322332 #
323- # (By default, no suggestion is made, so it is left up to the client.)
333+ # (By default, no suggestion is made, so it is left up to the client.
334+ # This setting is ignored unless public_baseurl is also set.)
324335 #
325336 #default_identity_server: https://matrix.org
326337
@@ -345,6 +356,8 @@ def generate_config_section(self, generate_secrets=False, **kwargs):
345356 # by the Matrix Identity Service API specification:
346357 # https://matrix.org/docs/spec/identity_service/latest
347358 #
359+ # If a delegate is specified, the config option public_baseurl must also be filled out.
360+ #
348361 account_threepid_delegates:
349362 #email: https://example.com # Delegate email sending to example.com
350363 #msisdn: http://localhost:8090 # Delegate SMS sending to this local process
0 commit comments