Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 2c9b4a5

Browse files
committed
Merge tag 'v1.27.0rc2' into develop
Synapse 1.27.0rc2 (2021-02-11) ============================== Features -------- - Further improvements to the user experience of registration via single sign-on. ([\#9297](#9297)) Bugfixes -------- - Fix ratelimiting introduced in v1.27.0rc1 for invites to respect the `ratelimit` flag on application services. ([\#9302](#9302)) - Do not automatically calculate `public_baseurl` since it can be wrong in some situations. Reverts behaviour introduced in v1.26.0. ([\#9313](#9313)) Improved Documentation ---------------------- - Clarify the sample configuration for changes made to the template loading code. ([\#9310](#9310))
2 parents 6aa87f8 + dcb9c2e commit 2c9b4a5

File tree

20 files changed

+120
-46
lines changed

20 files changed

+120
-46
lines changed

CHANGES.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1+
Synapse 1.27.0rc2 (2021-02-11)
2+
==============================
3+
4+
Features
5+
--------
6+
7+
- Further improvements to the user experience of registration via single sign-on. ([\#9297](https://github.com/matrix-org/synapse/issues/9297))
8+
9+
10+
Bugfixes
11+
--------
12+
13+
- Fix ratelimiting introduced in v1.27.0rc1 for invites to respect the `ratelimit` flag on application services. ([\#9302](https://github.com/matrix-org/synapse/issues/9302))
14+
- Do not automatically calculate `public_baseurl` since it can be wrong in some situations. Reverts behaviour introduced in v1.26.0. ([\#9313](https://github.com/matrix-org/synapse/issues/9313))
15+
16+
17+
Improved Documentation
18+
----------------------
19+
20+
- Clarify the sample configuration for changes made to the template loading code. ([\#9310](https://github.com/matrix-org/synapse/issues/9310))
21+
22+
123
Synapse 1.27.0rc1 (2021-02-02)
224
==============================
325

4-
Note that this release includes a change in Synapse to use Redis as a cache ─ as well as a pub/sub mechanism ─ if Redis support is enabled. No action is needed by server administrators, and we do not expect resource usage of the Redis instance to change dramatically.
26+
Note that this release includes a change in Synapse to use Redis as a cache ─ as well as a pub/sub mechanism ─ if Redis support is enabled for workers. No action is needed by server administrators, and we do not expect resource usage of the Redis instance to change dramatically.
527

628
This release also changes the callback URI for OpenID Connect (OIDC) identity providers. If your server is configured to use single sign-on via an OIDC/OAuth2 IdP, you may need to make configuration changes. Please review [UPGRADE.rst](UPGRADE.rst) for more details on these changes.
729

changelog.d/9297.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/9302.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/9310.doc

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/sample_config.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ pid_file: DATADIR/homeserver.pid
7474
# Otherwise, it should be the URL to reach Synapse's client HTTP listener (see
7575
# 'listeners' below).
7676
#
77-
# If this is left unset, it defaults to 'https://<server_name>/'. (Note that
78-
# that will not work unless you configure Synapse or a reverse-proxy to listen
79-
# on port 443.)
80-
#
8177
#public_baseurl: https://example.com/
8278

8379
# Set the soft limit on the number of file descriptors synapse can use
@@ -1177,9 +1173,8 @@ account_validity:
11771173
# send an email to the account's email address with a renewal link. By
11781174
# default, no such emails are sent.
11791175
#
1180-
# If you enable this setting, you will also need to fill out the 'email'
1181-
# configuration section. You should also check that 'public_baseurl' is set
1182-
# correctly.
1176+
# If you enable this setting, you will also need to fill out the 'email' and
1177+
# 'public_baseurl' configuration sections.
11831178
#
11841179
#renew_at: 1w
11851180

@@ -1270,7 +1265,8 @@ account_validity:
12701265
# The identity server which we suggest that clients should use when users log
12711266
# in on this server.
12721267
#
1273-
# (By default, no suggestion is made, so it is left up to the client.)
1268+
# (By default, no suggestion is made, so it is left up to the client.
1269+
# This setting is ignored unless public_baseurl is also set.)
12741270
#
12751271
#default_identity_server: https://matrix.org
12761272

@@ -1295,6 +1291,8 @@ account_validity:
12951291
# by the Matrix Identity Service API specification:
12961292
# https://matrix.org/docs/spec/identity_service/latest
12971293
#
1294+
# If a delegate is specified, the config option public_baseurl must also be filled out.
1295+
#
12981296
account_threepid_delegates:
12991297
#email: https://example.com # Delegate email sending to example.com
13001298
#msisdn: http://localhost:8090 # Delegate SMS sending to this local process
@@ -1948,9 +1946,9 @@ sso:
19481946
# phishing attacks from evil.site. To avoid this, include a slash after the
19491947
# hostname: "https://my.client/".
19501948
#
1951-
# The login fallback page (used by clients that don't natively support the
1952-
# required login flows) is automatically whitelisted in addition to any URLs
1953-
# in this list.
1949+
# If public_baseurl is set, then the login fallback page (used by clients
1950+
# that don't natively support the required login flows) is whitelisted in
1951+
# addition to any URLs in this list.
19541952
#
19551953
# By default, this list is empty.
19561954
#

synapse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
except ImportError:
4949
pass
5050

51-
__version__ = "1.27.0rc1"
51+
__version__ = "1.27.0rc2"
5252

5353
if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
5454
# We import here so that we don't have to install a bunch of deps when

synapse/api/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def __init__(self, hs_config):
4242
"""
4343
if hs_config.form_secret is None:
4444
raise ConfigError("form_secret not set in config")
45+
if hs_config.public_baseurl is None:
46+
raise ConfigError("public_baseurl not set in config")
4547

4648
self._hmac_secret = hs_config.form_secret.encode("utf-8")
4749
self._public_baseurl = hs_config.public_baseurl

synapse/config/cas.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from synapse.config.sso import SsoAttributeRequirement
1919

20-
from ._base import Config
20+
from ._base import Config, ConfigError
2121
from ._util import validate_config
2222

2323

@@ -35,13 +35,15 @@ def read_config(self, config, **kwargs):
3535

3636
if self.cas_enabled:
3737
self.cas_server_url = cas_config["server_url"]
38-
public_base_url = cas_config.get("service_url") or self.public_baseurl
39-
if public_base_url[-1] != "/":
40-
public_base_url += "/"
38+
39+
# The public baseurl is required because it is used by the redirect
40+
# template.
41+
public_baseurl = self.public_baseurl
42+
if not public_baseurl:
43+
raise ConfigError("cas_config requires a public_baseurl to be set")
44+
4145
# TODO Update this to a _synapse URL.
42-
self.cas_service_url = (
43-
public_base_url + "_matrix/client/r0/login/cas/ticket"
44-
)
46+
self.cas_service_url = public_baseurl + "_matrix/client/r0/login/cas/ticket"
4547
self.cas_displayname_attribute = cas_config.get("displayname_attribute")
4648
required_attributes = cas_config.get("required_attributes") or {}
4749
self.cas_required_attributes = _parsed_required_attributes_def(

synapse/config/emailconfig.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ def read_config(self, config, **kwargs):
166166
if not self.email_notif_from:
167167
missing.append("email.notif_from")
168168

169+
# public_baseurl is required to build password reset and validation links that
170+
# will be emailed to users
171+
if config.get("public_baseurl") is None:
172+
missing.append("public_baseurl")
173+
169174
if missing:
170175
raise ConfigError(
171176
MISSING_PASSWORD_RESET_CONFIG_ERROR % (", ".join(missing),)
@@ -264,6 +269,9 @@ def read_config(self, config, **kwargs):
264269
if not self.email_notif_from:
265270
missing.append("email.notif_from")
266271

272+
if config.get("public_baseurl") is None:
273+
missing.append("public_baseurl")
274+
267275
if missing:
268276
raise ConfigError(
269277
"email.enable_notifs is True but required keys are missing: %s"

synapse/config/oidc_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ def read_config(self, config, **kwargs):
5353
"Multiple OIDC providers have the idp_id %r." % idp_id
5454
)
5555

56-
self.oidc_callback_url = self.public_baseurl + "_synapse/client/oidc/callback"
56+
public_baseurl = self.public_baseurl
57+
if public_baseurl is None:
58+
raise ConfigError("oidc_config requires a public_baseurl to be set")
59+
self.oidc_callback_url = public_baseurl + "_synapse/client/oidc/callback"
5760

5861
@property
5962
def oidc_enabled(self) -> bool:

0 commit comments

Comments
 (0)