Skip to content

Commit 16e738f

Browse files
committed
Merge remote-tracking branch 'upstream/release-v1.27.0'
2 parents cb8f27f + d804285 commit 16e738f

File tree

152 files changed

+5042
-1528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+5042
-1528
lines changed

.buildkite/scripts/test_old_deps.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ apt-get install -y python3.5 python3.5-dev python3-pip libxml2-dev libxslt-dev x
1010

1111
export LANG="C.UTF-8"
1212

13+
# Prevent virtualenv from auto-updating pip to an incompatible version
14+
export VIRTUALENV_NO_DOWNLOAD=1
15+
1316
exec tox -e py35-old,combine

CHANGES.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,110 @@
1+
Synapse 1.27.0 (2021-02-16)
2+
===========================
3+
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 for workers. No action is needed by server administrators, and we do not expect resource usage of the Redis instance to change dramatically.
5+
6+
This release also changes the callback URI for OpenID Connect (OIDC) and SAML2 identity providers. If your server is configured to use single sign-on via an OIDC/OAuth2 or SAML2 IdP, you may need to make configuration changes. Please review [UPGRADE.rst](UPGRADE.rst) for more details on these changes.
7+
8+
This release also changes escaping of variables in the HTML templates for SSO or email notifications. If you have customised these templates, please review [UPGRADE.rst](UPGRADE.rst) for more details on these changes.
9+
10+
11+
Bugfixes
12+
--------
13+
14+
- Fix building Docker images for armv7. ([\#9405](https://github.com/matrix-org/synapse/issues/9405))
15+
16+
17+
Synapse 1.27.0rc2 (2021-02-11)
18+
==============================
19+
20+
Features
21+
--------
22+
23+
- Further improvements to the user experience of registration via single sign-on. ([\#9297](https://github.com/matrix-org/synapse/issues/9297))
24+
25+
26+
Bugfixes
27+
--------
28+
29+
- 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))
30+
- 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))
31+
32+
33+
Improved Documentation
34+
----------------------
35+
36+
- Clarify the sample configuration for changes made to the template loading code. ([\#9310](https://github.com/matrix-org/synapse/issues/9310))
37+
38+
39+
Synapse 1.27.0rc1 (2021-02-02)
40+
==============================
41+
42+
Features
43+
--------
44+
45+
- Add an admin API for getting and deleting forward extremities for a room. ([\#9062](https://github.com/matrix-org/synapse/issues/9062))
46+
- Add an admin API for retrieving the current room state of a room. ([\#9168](https://github.com/matrix-org/synapse/issues/9168))
47+
- Add experimental support for allowing clients to pick an SSO Identity Provider ([MSC2858](https://github.com/matrix-org/matrix-doc/pull/2858)). ([\#9183](https://github.com/matrix-org/synapse/issues/9183), [\#9242](https://github.com/matrix-org/synapse/issues/9242))
48+
- Add an admin API endpoint for shadow-banning users. ([\#9209](https://github.com/matrix-org/synapse/issues/9209))
49+
- Add ratelimits to the 3PID `/requestToken` APIs. ([\#9238](https://github.com/matrix-org/synapse/issues/9238))
50+
- Add support to the OpenID Connect integration for adding the user's email address. ([\#9245](https://github.com/matrix-org/synapse/issues/9245))
51+
- Add ratelimits to invites in rooms and to specific users. ([\#9258](https://github.com/matrix-org/synapse/issues/9258))
52+
- Improve the user experience of setting up an account via single-sign on. ([\#9262](https://github.com/matrix-org/synapse/issues/9262), [\#9272](https://github.com/matrix-org/synapse/issues/9272), [\#9275](https://github.com/matrix-org/synapse/issues/9275), [\#9276](https://github.com/matrix-org/synapse/issues/9276), [\#9277](https://github.com/matrix-org/synapse/issues/9277), [\#9286](https://github.com/matrix-org/synapse/issues/9286), [\#9287](https://github.com/matrix-org/synapse/issues/9287))
53+
- Add phone home stats for encrypted messages. ([\#9283](https://github.com/matrix-org/synapse/issues/9283))
54+
- Update the redirect URI for OIDC authentication. ([\#9288](https://github.com/matrix-org/synapse/issues/9288))
55+
56+
57+
Bugfixes
58+
--------
59+
60+
- Fix spurious errors in logs when deleting a non-existant pusher. ([\#9121](https://github.com/matrix-org/synapse/issues/9121))
61+
- Fix a long-standing bug where Synapse would return a 500 error when a thumbnail did not exist (and auto-generation of thumbnails was not enabled). ([\#9163](https://github.com/matrix-org/synapse/issues/9163))
62+
- Fix a long-standing bug where an internal server error was raised when attempting to preview an HTML document in an unknown character encoding. ([\#9164](https://github.com/matrix-org/synapse/issues/9164))
63+
- Fix a long-standing bug where invalid data could cause errors when calculating the presentable room name for push. ([\#9165](https://github.com/matrix-org/synapse/issues/9165))
64+
- Fix bug where we sometimes didn't detect that Redis connections had died, causing workers to not see new data. ([\#9218](https://github.com/matrix-org/synapse/issues/9218))
65+
- Fix a bug where `None` was passed to Synapse modules instead of an empty dictionary if an empty module `config` block was provided in the homeserver config. ([\#9229](https://github.com/matrix-org/synapse/issues/9229))
66+
- Fix a bug in the `make_room_admin` admin API where it failed if the admin with the greatest power level was not in the room. Contributed by Pankaj Yadav. ([\#9235](https://github.com/matrix-org/synapse/issues/9235))
67+
- Prevent password hashes from getting dropped if a client failed threepid validation during a User Interactive Auth stage. Removes a workaround for an ancient bug in Riot Web <v0.7.4. ([\#9265](https://github.com/matrix-org/synapse/issues/9265))
68+
- Fix single-sign-on when the endpoints are routed to synapse workers. ([\#9271](https://github.com/matrix-org/synapse/issues/9271))
69+
70+
71+
Improved Documentation
72+
----------------------
73+
74+
- Add docs for using Gitea as OpenID provider. ([\#9134](https://github.com/matrix-org/synapse/issues/9134))
75+
- Add link to Matrix VoIP tester for turn-howto. ([\#9135](https://github.com/matrix-org/synapse/issues/9135))
76+
- Add notes on integrating with Facebook for SSO login. ([\#9244](https://github.com/matrix-org/synapse/issues/9244))
77+
78+
79+
Deprecations and Removals
80+
-------------------------
81+
82+
- The `service_url` parameter in `cas_config` is deprecated in favor of `public_baseurl`. ([\#9199](https://github.com/matrix-org/synapse/issues/9199))
83+
- Add new endpoint `/_synapse/client/saml2` for SAML2 authentication callbacks, and deprecate the old endpoint `/_matrix/saml2`. ([\#9289](https://github.com/matrix-org/synapse/issues/9289))
84+
85+
86+
Internal Changes
87+
----------------
88+
89+
- Add tests to `test_user.UsersListTestCase` for List Users Admin API. ([\#9045](https://github.com/matrix-org/synapse/issues/9045))
90+
- Various improvements to the federation client. ([\#9129](https://github.com/matrix-org/synapse/issues/9129))
91+
- Speed up chain cover calculation when persisting a batch of state events at once. ([\#9176](https://github.com/matrix-org/synapse/issues/9176))
92+
- Add a `long_description_type` to the package metadata. ([\#9180](https://github.com/matrix-org/synapse/issues/9180))
93+
- Speed up batch insertion when using PostgreSQL. ([\#9181](https://github.com/matrix-org/synapse/issues/9181), [\#9188](https://github.com/matrix-org/synapse/issues/9188))
94+
- Emit an error at startup if different Identity Providers are configured with the same `idp_id`. ([\#9184](https://github.com/matrix-org/synapse/issues/9184))
95+
- Improve performance of concurrent use of `StreamIDGenerators`. ([\#9190](https://github.com/matrix-org/synapse/issues/9190))
96+
- Add some missing source directories to the automatic linting script. ([\#9191](https://github.com/matrix-org/synapse/issues/9191))
97+
- Precompute joined hosts and store in Redis. ([\#9198](https://github.com/matrix-org/synapse/issues/9198), [\#9227](https://github.com/matrix-org/synapse/issues/9227))
98+
- Clean-up template loading code. ([\#9200](https://github.com/matrix-org/synapse/issues/9200))
99+
- Fix the Python 3.5 old dependencies build. ([\#9217](https://github.com/matrix-org/synapse/issues/9217))
100+
- Update `isort` to v5.7.0 to bypass a bug where it would disagree with `black` about formatting. ([\#9222](https://github.com/matrix-org/synapse/issues/9222))
101+
- Add type hints to handlers code. ([\#9223](https://github.com/matrix-org/synapse/issues/9223), [\#9232](https://github.com/matrix-org/synapse/issues/9232))
102+
- Fix Debian package building on Ubuntu 16.04 LTS (Xenial). ([\#9254](https://github.com/matrix-org/synapse/issues/9254))
103+
- Minor performance improvement during TLS handshake. ([\#9255](https://github.com/matrix-org/synapse/issues/9255))
104+
- Refactor the generation of summary text for email notifications. ([\#9260](https://github.com/matrix-org/synapse/issues/9260))
105+
- Restore PyPy compatibility by not calling CPython-specific GC methods when under PyPy. ([\#9270](https://github.com/matrix-org/synapse/issues/9270))
106+
107+
1108
Synapse 1.26.0 (2021-01-27)
2109
===========================
3110

UPGRADE.rst

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,59 @@ for example:
8585
wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
8686
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
8787
88+
Upgrading to v1.27.0
89+
====================
90+
91+
Changes to callback URI for OAuth2 / OpenID Connect and SAML2
92+
-------------------------------------------------------------
93+
94+
This version changes the URI used for callbacks from OAuth2 and SAML2 identity providers:
95+
96+
* If your server is configured for single sign-on via an OpenID Connect or OAuth2 identity
97+
provider, you will need to add ``[synapse public baseurl]/_synapse/client/oidc/callback``
98+
to the list of permitted "redirect URIs" at the identity provider.
99+
100+
See `docs/openid.md <docs/openid.md>`_ for more information on setting up OpenID
101+
Connect.
102+
103+
* If your server is configured for single sign-on via a SAML2 identity provider, you will
104+
need to add ``[synapse public baseurl]/_synapse/client/saml2/authn_response`` as a permitted
105+
"ACS location" (also known as "allowed callback URLs") at the identity provider.
106+
107+
Changes to HTML templates
108+
-------------------------
109+
110+
The HTML templates for SSO and email notifications now have `Jinja2's autoescape <https://jinja.palletsprojects.com/en/2.11.x/api/#autoescaping>`_
111+
enabled for files ending in ``.html``, ``.htm``, and ``.xml``. If you have customised
112+
these templates and see issues when viewing them you might need to update them.
113+
It is expected that most configurations will need no changes.
114+
115+
If you have customised the templates *names* for these templates, it is recommended
116+
to verify they end in ``.html`` to ensure autoescape is enabled.
117+
118+
The above applies to the following templates:
119+
120+
* ``add_threepid.html``
121+
* ``add_threepid_failure.html``
122+
* ``add_threepid_success.html``
123+
* ``notice_expiry.html``
124+
* ``notice_expiry.html``
125+
* ``notif_mail.html`` (which, by default, includes ``room.html`` and ``notif.html``)
126+
* ``password_reset.html``
127+
* ``password_reset_confirmation.html``
128+
* ``password_reset_failure.html``
129+
* ``password_reset_success.html``
130+
* ``registration.html``
131+
* ``registration_failure.html``
132+
* ``registration_success.html``
133+
* ``sso_account_deactivated.html``
134+
* ``sso_auth_bad_user.html``
135+
* ``sso_auth_confirm.html``
136+
* ``sso_auth_success.html``
137+
* ``sso_error.html``
138+
* ``sso_login_idp_picker.html``
139+
* ``sso_redirect_confirm.html``
140+
88141
Upgrading to v1.26.0
89142
====================
90143

@@ -198,7 +251,7 @@ shown below:
198251
199252
return {"localpart": localpart}
200253
201-
Removal historical Synapse Admin API
254+
Removal historical Synapse Admin API
202255
------------------------------------
203256

204257
Historically, the Synapse Admin API has been accessible under:

debian/build_virtualenv

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ esac
3333
# Use --builtin-venv to use the better `venv` module from CPython 3.4+ rather
3434
# than the 2/3 compatible `virtualenv`.
3535

36+
# Pin pip to 20.3.4 to fix breakage in 21.0 on py3.5 (xenial)
37+
3638
dh_virtualenv \
3739
--install-suffix "matrix-synapse" \
3840
--builtin-venv \
3941
--python "$SNAKE" \
40-
--upgrade-pip \
42+
--upgrade-pip-to="20.3.4" \
4143
--preinstall="lxml" \
4244
--preinstall="mock" \
4345
--extra-pip-arg="--no-cache-dir" \

debian/changelog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
matrix-synapse-py3 (1.27.0) stable; urgency=medium
2+
3+
[ Dan Callahan ]
4+
* Fix build on Ubuntu 16.04 LTS (Xenial).
5+
6+
[ Synapse Packaging team ]
7+
* New synapse release 1.27.0.
8+
9+
-- Synapse Packaging team <[email protected]> Tue, 16 Feb 2021 13:11:28 +0000
10+
111
matrix-synapse-py3 (1.26.0) stable; urgency=medium
212

313
[ Richard van der Hoff ]

docker/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ RUN apt-get update && apt-get install -y \
2929
libwebp-dev \
3030
libxml++2.6-dev \
3131
libxslt1-dev \
32+
rustc \
3233
zlib1g-dev \
3334
&& rm -rf /var/lib/apt/lists/*
3435

3536
# Build dependencies that are not available as wheels, to speed up rebuilds
3637
RUN pip install --prefix="/install" --no-warn-script-location \
38+
cryptography \
3739
frozendict \
3840
jaeger-client \
3941
opentracing \

docker/Dockerfile-dhvirtualenv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ RUN env DEBIAN_FRONTEND=noninteractive apt-get install \
2727
wget
2828

2929
# fetch and unpack the package
30+
# TODO: Upgrade to 1.2.2 once xenial is dropped
3031
RUN mkdir /dh-virtualenv
3132
RUN wget -q -O /dh-virtualenv.tar.gz https://github.com/spotify/dh-virtualenv/archive/ac6e1b1.tar.gz
3233
RUN tar -xv --strip-components=1 -C /dh-virtualenv -f /dh-virtualenv.tar.gz

docs/admin_api/rooms.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* [Response](#response)
1010
* [Undoing room shutdowns](#undoing-room-shutdowns)
1111
- [Make Room Admin API](#make-room-admin-api)
12+
- [Forward Extremities Admin API](#forward-extremities-admin-api)
1213

1314
# List Room API
1415

@@ -367,6 +368,36 @@ Response:
367368
}
368369
```
369370

371+
# Room State API
372+
373+
The Room State admin API allows server admins to get a list of all state events in a room.
374+
375+
The response includes the following fields:
376+
377+
* `state` - The current state of the room at the time of request.
378+
379+
## Usage
380+
381+
A standard request:
382+
383+
```
384+
GET /_synapse/admin/v1/rooms/<room_id>/state
385+
386+
{}
387+
```
388+
389+
Response:
390+
391+
```json
392+
{
393+
"state": [
394+
{"type": "m.room.create", "state_key": "", "etc": true},
395+
{"type": "m.room.power_levels", "state_key": "", "etc": true},
396+
{"type": "m.room.name", "state_key": "", "etc": true}
397+
]
398+
}
399+
```
400+
370401
# Delete Room API
371402

372403
The Delete Room admin API allows server admins to remove rooms from server
@@ -511,3 +542,55 @@ optionally be specified, e.g.:
511542
"user_id": "@foo:example.com"
512543
}
513544
```
545+
546+
# Forward Extremities Admin API
547+
548+
Enables querying and deleting forward extremities from rooms. When a lot of forward
549+
extremities accumulate in a room, performance can become degraded. For details, see
550+
[#1760](https://github.com/matrix-org/synapse/issues/1760).
551+
552+
## Check for forward extremities
553+
554+
To check the status of forward extremities for a room:
555+
556+
```
557+
GET /_synapse/admin/v1/rooms/<room_id_or_alias>/forward_extremities
558+
```
559+
560+
A response as follows will be returned:
561+
562+
```json
563+
{
564+
"count": 1,
565+
"results": [
566+
{
567+
"event_id": "$M5SP266vsnxctfwFgFLNceaCo3ujhRtg_NiiHabcdefgh",
568+
"state_group": 439,
569+
"depth": 123,
570+
"received_ts": 1611263016761
571+
}
572+
]
573+
}
574+
```
575+
576+
## Deleting forward extremities
577+
578+
**WARNING**: Please ensure you know what you're doing and have read
579+
the related issue [#1760](https://github.com/matrix-org/synapse/issues/1760).
580+
Under no situations should this API be executed as an automated maintenance task!
581+
582+
If a room has lots of forward extremities, the extra can be
583+
deleted as follows:
584+
585+
```
586+
DELETE /_synapse/admin/v1/rooms/<room_id_or_alias>/forward_extremities
587+
```
588+
589+
A response as follows will be returned, indicating the amount of forward extremities
590+
that were deleted.
591+
592+
```json
593+
{
594+
"deleted": 1
595+
}
596+
```

docs/admin_api/user_admin_api.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,3 +760,33 @@ The following fields are returned in the JSON response body:
760760
- ``total`` - integer - Number of pushers.
761761

762762
See also `Client-Server API Spec <https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-pushers>`_
763+
764+
Shadow-banning users
765+
====================
766+
767+
Shadow-banning is a useful tool for moderating malicious or egregiously abusive users.
768+
A shadow-banned users receives successful responses to their client-server API requests,
769+
but the events are not propagated into rooms. This can be an effective tool as it
770+
(hopefully) takes longer for the user to realise they are being moderated before
771+
pivoting to another account.
772+
773+
Shadow-banning a user should be used as a tool of last resort and may lead to confusing
774+
or broken behaviour for the client. A shadow-banned user will not receive any
775+
notification and it is generally more appropriate to ban or kick abusive users.
776+
A shadow-banned user will be unable to contact anyone on the server.
777+
778+
The API is::
779+
780+
POST /_synapse/admin/v1/users/<user_id>/shadow_ban
781+
782+
To use it, you will need to authenticate by providing an ``access_token`` for a
783+
server admin: see `README.rst <README.rst>`_.
784+
785+
An empty JSON dict is returned.
786+
787+
**Parameters**
788+
789+
The following parameters should be set in the URL:
790+
791+
- ``user_id`` - The fully qualified MXID: for example, ``@user:server.com``. The user must
792+
be local.

0 commit comments

Comments
 (0)