@@ -259,7 +259,6 @@ def read_config(self, config, **kwargs):
259259 raise ConfigError (str (e ))
260260
261261 self .pid_file = self .abspath (config .get ("pid_file" ))
262- self .web_client_location = config .get ("web_client_location" , None )
263262 self .soft_file_limit = config .get ("soft_file_limit" , 0 )
264263 self .daemonize = config .get ("daemonize" )
265264 self .print_pidfile = config .get ("print_pidfile" )
@@ -506,8 +505,17 @@ def read_config(self, config, **kwargs):
506505 l2 .append (listener )
507506 self .listeners = l2
508507
509- if not self .web_client_location :
510- _warn_if_webclient_configured (self .listeners )
508+ self .web_client_location = config .get ("web_client_location" , None )
509+ self .web_client_location_is_redirect = self .web_client_location and (
510+ self .web_client_location .startswith ("http://" )
511+ or self .web_client_location .startswith ("https://" )
512+ )
513+ # A non-HTTP(S) web client location is deprecated.
514+ if self .web_client_location and not self .web_client_location_is_redirect :
515+ logger .warning (NO_MORE_NONE_HTTP_WEB_CLIENT_LOCATION_WARNING )
516+
517+ # Warn if webclient is configured for a worker.
518+ _warn_if_webclient_configured (self .listeners )
511519
512520 self .gc_thresholds = read_gc_thresholds (config .get ("gc_thresholds" , None ))
513521 self .gc_seconds = self .read_gc_intervals (config .get ("gc_min_interval" , None ))
@@ -793,13 +801,7 @@ def generate_config_section(
793801 #
794802 pid_file: %(pid_file)s
795803
796- # The absolute URL to the web client which /_matrix/client will redirect
797- # to if 'webclient' is configured under the 'listeners' configuration.
798- #
799- # This option can be also set to the filesystem path to the web client
800- # which will be served at /_matrix/client/ if 'webclient' is configured
801- # under the 'listeners' configuration, however this is a security risk:
802- # https://github.com/matrix-org/synapse#security-note
804+ # The absolute URL to the web client which / will redirect to.
803805 #
804806 #web_client_location: https://riot.example.com/
805807
@@ -1011,8 +1013,6 @@ def generate_config_section(
10111013 # static: static resources under synapse/static (/_matrix/static). (Mostly
10121014 # useful for 'fallback authentication'.)
10131015 #
1014- # webclient: A web client. Requires web_client_location to be set.
1015- #
10161016 listeners:
10171017 # TLS-enabled listener: for when matrix traffic is sent directly to synapse.
10181018 #
@@ -1349,9 +1349,15 @@ def parse_listener_def(listener: Any) -> ListenerConfig:
13491349 return ListenerConfig (port , bind_addresses , listener_type , tls , http_config )
13501350
13511351
1352+ NO_MORE_NONE_HTTP_WEB_CLIENT_LOCATION_WARNING = """
1353+ Synapse no longer supports serving a web client. To remove this warning,
1354+ configure 'web_client_location' with an HTTP(S) URL.
1355+ """
1356+
1357+
13521358NO_MORE_WEB_CLIENT_WARNING = """
1353- Synapse no longer includes a web client. To enable a web client, configure
1354- web_client_location. To remove this warning, remove 'webclient' from the 'listeners'
1359+ Synapse no longer includes a web client. To redirect the root resource to a web client, configure
1360+ ' web_client_location' . To remove this warning, remove 'webclient' from the 'listeners'
13551361configuration.
13561362"""
13571363
0 commit comments