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

Commit

Permalink
Merge branch 'develop' of github.com:matrix-org/synapse into dmr/link…
Browse files Browse the repository at this point in the history
…-to-rendered-docs

In particular, merge 54aa704 (#10711)
into my changes.
  • Loading branch information
David Robertson committed Aug 31, 2021
2 parents 39396e0 + e3abc0a commit 32cfc20
Show file tree
Hide file tree
Showing 110 changed files with 3,895 additions and 2,507 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/twisted_trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: JasonEtco/create-an-issue@v2
- uses: JasonEtco/create-an-issue@5d9504915f79f9cc6d791934b8ef34f2353dd74d # v2.5.0, 2020-12-06
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
update_existing: true
filename: .ci/twisted_trunk_build_failed_issue_template.md
24 changes: 20 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Users will stop receiving message updates via email for addresses that were previously linked to their account

Synapse 1.41.0 (2021-08-24)
===========================

This release adds support for Debian 12 (Bookworm), but **removes support for Ubuntu 20.10 (Groovy Gorilla)**, which reached End of Life last month.

Note that when using workers the `/_synapse/admin/v1/users/{userId}/media` must now be handled by media workers. See the [upgrade notes](https://matrix-org.github.io/synapse/latest/upgrade.html) for more information.


Features
--------

- Enable room capabilities ([MSC3244](https://github.com/matrix-org/matrix-doc/pull/3244)) by default and set room version 8 as the preferred room version when creating restricted rooms. ([\#10571](https://github.com/matrix-org/synapse/issues/10571))


Synapse 1.41.0rc1 (2021-08-18)
==============================

Expand All @@ -7,7 +23,7 @@ Features
- Add `get_userinfo_by_id` method to ModuleApi. ([\#9581](https://github.com/matrix-org/synapse/issues/9581))
- Initial local support for [MSC3266](https://github.com/matrix-org/synapse/pull/10394), Room Summary over the unstable `/rooms/{roomIdOrAlias}/summary` API. ([\#10394](https://github.com/matrix-org/synapse/issues/10394))
- Experimental support for [MSC3288](https://github.com/matrix-org/matrix-doc/pull/3288), sending `room_type` to the identity server for 3pid invites over the `/store-invite` API. ([\#10435](https://github.com/matrix-org/synapse/issues/10435))
- Add support for sending federation requests through a proxy. Contributed by @Bubu and @dklimpel. ([\#10475](https://github.com/matrix-org/synapse/issues/10475))
- Add support for sending federation requests through a proxy. Contributed by @Bubu and @dklimpel. See the [upgrade notes](https://matrix-org.github.io/synapse/latest/upgrade.html) for more information. ([\#10596](https://github.com/matrix-org/synapse/issues/10596)). ([\#10475](https://github.com/matrix-org/synapse/issues/10475))
- Add support for "marker" events which makes historical events discoverable for servers that already have all of the scrollback history (part of [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716)). ([\#10498](https://github.com/matrix-org/synapse/issues/10498))
- Add a configuration setting for the time a `/sync` response is cached for. ([\#10513](https://github.com/matrix-org/synapse/issues/10513))
- The default logging handler for new installations is now `PeriodicallyFlushingMemoryHandler`, a buffered logging handler which periodically flushes itself. ([\#10518](https://github.com/matrix-org/synapse/issues/10518))
Expand All @@ -29,7 +45,7 @@ Bugfixes
- Add some clarification to the sample config file. Contributed by @Kentokamoto. ([\#10129](https://github.com/matrix-org/synapse/issues/10129))
- Fix a long-standing bug where protocols which are not implemented by any appservices were incorrectly returned via `GET /_matrix/client/r0/thirdparty/protocols`. ([\#10532](https://github.com/matrix-org/synapse/issues/10532))
- Fix exceptions in logs when failing to get remote room list. ([\#10541](https://github.com/matrix-org/synapse/issues/10541))
- Fix longstanding bug which caused the user "status" to be reset when the user went offline. Contributed by @dklimpel. ([\#10550](https://github.com/matrix-org/synapse/issues/10550))
- Fix longstanding bug which caused the user's presence "status message" to be reset when the user went offline. Contributed by @dklimpel. ([\#10550](https://github.com/matrix-org/synapse/issues/10550))
- Allow public rooms to be previewed in the spaces summary APIs from [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946). ([\#10580](https://github.com/matrix-org/synapse/issues/10580))
- Fix a bug introduced in v1.37.1 where an error could occur in the asynchronous processing of PDUs when the queue was empty. ([\#10592](https://github.com/matrix-org/synapse/issues/10592))
- Fix errors on /sync when read receipt data is a string. Only affects homeservers with the experimental flag for [MSC2285](https://github.com/matrix-org/matrix-doc/pull/2285) enabled. Contributed by @SimonBrandner. ([\#10606](https://github.com/matrix-org/synapse/issues/10606))
Expand All @@ -40,15 +56,15 @@ Bugfixes
Improved Documentation
----------------------

- Add documentation for configuration a forward proxy. ([\#10443](https://github.com/matrix-org/synapse/issues/10443))
- Add documentation for configuring a forward proxy. ([\#10443](https://github.com/matrix-org/synapse/issues/10443))
- Updated the reverse proxy documentation to highlight the homserver configuration that is needed to make Synapse aware that is is intentionally reverse proxied. ([\#10551](https://github.com/matrix-org/synapse/issues/10551))
- Update CONTRIBUTING.md to fix index links and the instructions for SyTest in docker. ([\#10599](https://github.com/matrix-org/synapse/issues/10599))


Deprecations and Removals
-------------------------

- No longer build `.deb` packages for Ubuntu 20.10 LTS Groovy Gorilla, which has now EOLed. ([\#10588](https://github.com/matrix-org/synapse/issues/10588))
- No longer build `.deb` packages for Ubuntu 20.10 Groovy Gorilla, which has now EOLed. ([\#10588](https://github.com/matrix-org/synapse/issues/10588))
- The `template_dir` configuration settings in the `sso`, `account_validity` and `email` sections of the configuration file are now deprecated in favour of the global `templates.custom_template_directory` setting. See the [upgrade notes](https://matrix-org.github.io/synapse/latest/upgrade.html) for more information. ([\#10596](https://github.com/matrix-org/synapse/issues/10596))


Expand Down
1 change: 1 addition & 0 deletions changelog.d/10192.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add documentation on how to connect Django with synapse using oidc and django-oauth-toolkit. Contributed by @HugoDelval.
1 change: 1 addition & 0 deletions changelog.d/10232.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Validate new `m.room.power_levels` events. Contributed by @aaronraimist.
1 change: 1 addition & 0 deletions changelog.d/10581.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove pushers when deleting a 3pid from an account. Pushers for old unlinked emails will also be deleted.
1 change: 1 addition & 0 deletions changelog.d/10613.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add pagination to the spaces summary based on updates to [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946).
1 change: 1 addition & 0 deletions changelog.d/10621.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a comment asking developers to leave a reason when bumping the database schema version.
1 change: 1 addition & 0 deletions changelog.d/10639.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix some of the titles not rendering in the OIDC documentation.
1 change: 1 addition & 0 deletions changelog.d/10645.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make `backfill` and `get_missing_events` use the same codepath.
1 change: 1 addition & 0 deletions changelog.d/10647.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve the performance of the `/hierarchy` API (from [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946)) by caching responses received over federation.
1 change: 1 addition & 0 deletions changelog.d/10654.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enforce the maximum length for per-room display names and avatar URLs.
1 change: 1 addition & 0 deletions changelog.d/10662.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not print out stack traces for network errors when fetching data over federation.
1 change: 1 addition & 0 deletions changelog.d/10665.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add missing type hints to REST servlets.
1 change: 1 addition & 0 deletions changelog.d/10666.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add missing type hints to REST servlets.
1 change: 1 addition & 0 deletions changelog.d/10672.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Run a nightly CI build against Twisted trunk.
1 change: 1 addition & 0 deletions changelog.d/10674.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add missing type hints to REST servlets.
1 change: 1 addition & 0 deletions changelog.d/10677.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug which caused the `synapse_user_logins_total` Prometheus metric not to be correctly initialised on restart.
1 change: 1 addition & 0 deletions changelog.d/10679.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve ServerNoticeServlet to avoid duplicate requests and add unit tests.
1 change: 1 addition & 0 deletions changelog.d/10684.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix long-standing issue which caused an error when a thumbnail is requested and there are multiple thumbnails with the same quality rating.
1 change: 1 addition & 0 deletions changelog.d/10686.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update `complement.sh` to rebuild the base Docker image when run with workers.
1 change: 1 addition & 0 deletions changelog.d/10692.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Split the event-processing methods in `FederationHandler` into a separate `FederationEventHandler`.
1 change: 1 addition & 0 deletions changelog.d/10703.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a regression introduced in v1.41.0 which affected the performance of concurrent fetches of large sets of events, in extreme cases causing the process to hang.
1 change: 1 addition & 0 deletions changelog.d/10706.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unused `compare_digest` function.
1 change: 1 addition & 0 deletions changelog.d/10708.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Minor clarifications to the documentation for reverse proxies.
1 change: 1 addition & 0 deletions changelog.d/10711.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed table of contents from the top of installation and contributing documentation pages.
1 change: 1 addition & 0 deletions changelog.d/10713.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a regression introduced in Synapse 1.41 which broke email transmission on Systems using older versions of the Twisted library.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
matrix-synapse-py3 (1.41.0) stable; urgency=medium

* New synapse release 1.41.0.

-- Synapse Packaging team <[email protected]> Tue, 24 Aug 2021 15:31:45 +0100

matrix-synapse-py3 (1.41.0~rc1) stable; urgency=medium

* New synapse release 1.41.0~rc1.
Expand Down
2 changes: 1 addition & 1 deletion docs/development/contributing_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ follow a simple 'inbound=outbound' model for contributions: the act of
submitting an 'inbound' contribution means that the contributor agrees to
license the code under the same terms as the project's overall 'outbound'
license - in our case, this is almost always Apache Software License v2 (see
[LICENSE](LICENSE)).
[LICENSE](https://github.com/matrix-org/synapse/blob/develop/LICENSE)).

# 2. What do I need?

Expand Down
64 changes: 58 additions & 6 deletions docs/openid.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ oidc_providers:
display_name_template: "{{ user.name }}"
```
### [Dex][dex-idp]
### Dex
[Dex][dex-idp] is a simple, open-source, certified OpenID Connect Provider.
Although it is designed to help building a full-blown provider with an
Expand Down Expand Up @@ -117,7 +117,7 @@ oidc_providers:
localpart_template: "{{ user.name }}"
display_name_template: "{{ user.name|capitalize }}"
```
### [Keycloak][keycloak-idp]
### Keycloak

[Keycloak][keycloak-idp] is an opensource IdP maintained by Red Hat.

Expand Down Expand Up @@ -166,7 +166,9 @@ oidc_providers:
localpart_template: "{{ user.preferred_username }}"
display_name_template: "{{ user.name }}"
```
### [Auth0][auth0]
### Auth0

[Auth0][auth0] is a hosted SaaS IdP solution.

1. Create a regular web application for Synapse
2. Set the Allowed Callback URLs to `[synapse public baseurl]/_synapse/client/oidc/callback`
Expand Down Expand Up @@ -209,7 +211,7 @@ oidc_providers:

### GitHub

GitHub is a bit special as it is not an OpenID Connect compliant provider, but
[GitHub][github-idp] is a bit special as it is not an OpenID Connect compliant provider, but
just a regular OAuth2 provider.

The [`/user` API endpoint](https://developer.github.com/v3/users/#get-the-authenticated-user)
Expand Down Expand Up @@ -242,11 +244,13 @@ oidc_providers:
display_name_template: "{{ user.name }}"
```

### [Google][google-idp]
### Google

[Google][google-idp] is an OpenID certified authentication and authorisation provider.

1. Set up a project in the Google API Console (see
https://developers.google.com/identity/protocols/oauth2/openid-connect#appsetup).
2. add an "OAuth Client ID" for a Web Application under "Credentials".
2. Add an "OAuth Client ID" for a Web Application under "Credentials".
3. Copy the Client ID and Client Secret, and add the following to your synapse config:
```yaml
oidc_providers:
Expand Down Expand Up @@ -446,3 +450,51 @@ The synapse config will look like this:
config:
email_template: "{{ user.email }}"
```

## Django OAuth Toolkit

[django-oauth-toolkit](https://github.com/jazzband/django-oauth-toolkit) is a
Django application providing out of the box all the endpoints, data and logic
needed to add OAuth2 capabilities to your Django projects. It supports
[OpenID Connect too](https://django-oauth-toolkit.readthedocs.io/en/latest/oidc.html).

Configuration on Django's side:

1. Add an application: https://example.com/admin/oauth2_provider/application/add/ and choose parameters like this:
* `Redirect uris`: https://synapse.example.com/_synapse/client/oidc/callback
* `Client type`: `Confidential`
* `Authorization grant type`: `Authorization code`
* `Algorithm`: `HMAC with SHA-2 256`
2. You can [customize the claims](https://django-oauth-toolkit.readthedocs.io/en/latest/oidc.html#customizing-the-oidc-responses) Django gives to synapse (optional):
<details>
<summary>Code sample</summary>

```python
class CustomOAuth2Validator(OAuth2Validator):
def get_additional_claims(self, request):
return {
"sub": request.user.email,
"email": request.user.email,
"first_name": request.user.first_name,
"last_name": request.user.last_name,
}
```
</details>
Your synapse config is then:

```yaml
oidc_providers:
- idp_id: django_example
idp_name: "Django Example"
issuer: "https://example.com/o/"
client_id: "your-client-id" # CHANGE ME
client_secret: "your-client-secret" # CHANGE ME
scopes: ["openid"]
user_profile_method: "userinfo_endpoint" # needed because oauth-toolkit does not include user information in the authorization response
user_mapping_provider:
config:
localpart_template: "{{ user.email.split('@')[0] }}"
display_name_template: "{{ user.first_name }} {{ user.last_name }}"
email_template: "{{ user.email }}"
```
10 changes: 5 additions & 5 deletions docs/reverse_proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ server {
server_name matrix.example.com;
location ~* ^(\/_matrix|\/_synapse\/client) {
# note: do not add a path (even a single /) after the port in `proxy_pass`,
# otherwise nginx will canonicalise the URI and cause signature verification
# errors.
proxy_pass http://localhost:8008;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
Expand All @@ -76,10 +79,7 @@ server {
}
```

**NOTE**: Do not add a path after the port in `proxy_pass`, otherwise nginx will
canonicalise/normalise the URI.

### Caddy 1
### Caddy v1

```
matrix.example.com {
Expand All @@ -99,7 +99,7 @@ example.com:8448 {
}
```

### Caddy 2
### Caddy v2

```
matrix.example.com {
Expand Down
39 changes: 0 additions & 39 deletions docs/setup/installation.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,5 @@
# Installation Instructions

There are 3 steps to follow under **Installation Instructions**.

- [Installation Instructions](#installation-instructions)
- [Choosing your server name](#choosing-your-server-name)
- [Installing Synapse](#installing-synapse)
- [Installing from source](#installing-from-source)
- [Platform-specific prerequisites](#platform-specific-prerequisites)
- [Debian/Ubuntu/Raspbian](#debianubunturaspbian)
- [ArchLinux](#archlinux)
- [CentOS/Fedora](#centosfedora)
- [macOS](#macos)
- [OpenSUSE](#opensuse)
- [OpenBSD](#openbsd)
- [Windows](#windows)
- [Prebuilt packages](#prebuilt-packages)
- [Docker images and Ansible playbooks](#docker-images-and-ansible-playbooks)
- [Debian/Ubuntu](#debianubuntu)
- [Matrix.org packages](#matrixorg-packages)
- [Downstream Debian packages](#downstream-debian-packages)
- [Downstream Ubuntu packages](#downstream-ubuntu-packages)
- [Fedora](#fedora)
- [OpenSUSE](#opensuse-1)
- [SUSE Linux Enterprise Server](#suse-linux-enterprise-server)
- [ArchLinux](#archlinux-1)
- [Void Linux](#void-linux)
- [FreeBSD](#freebsd)
- [OpenBSD](#openbsd-1)
- [NixOS](#nixos)
- [Setting up Synapse](#setting-up-synapse)
- [Using PostgreSQL](#using-postgresql)
- [TLS certificates](#tls-certificates)
- [Client Well-Known URI](#client-well-known-uri)
- [Email](#email)
- [Registering a user](#registering-a-user)
- [Setting up a TURN server](#setting-up-a-turn-server)
- [URL previews](#url-previews)
- [Troubleshooting Installation](#troubleshooting-installation)


## Choosing your server name

It is important to choose the name for your server before you install Synapse,
Expand Down
5 changes: 5 additions & 0 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ This may affect you if you make use of custom HTML templates for the
The template is now provided an `error` variable if the authentication
process failed. See the default templates linked above for an example.

# Upgrading to v1.42.0

## Removal of out-of-date email pushers
Users will stop receiving message updates via email for addresses that were
once, but not still, linked to their account.

# Upgrading to v1.41.0

Expand Down
7 changes: 6 additions & 1 deletion docs/website_files/table-of-contents.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:root {
--pagetoc-width: 250px;
}

@media only screen and (max-width:1439px) {
.sidetoc {
display: none;
Expand All @@ -8,6 +12,7 @@
main {
position: relative;
margin-left: 100px !important;
margin-right: var(--pagetoc-width) !important;
}
.sidetoc {
margin-left: auto;
Expand All @@ -18,7 +23,7 @@
}
.pagetoc {
position: fixed;
width: 250px;
width: var(--pagetoc-width);
overflow: auto;
right: 20px;
height: calc(100% - var(--menu-bar-height));
Expand Down
2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ files =
synapse/storage/databases/main/keys.py,
synapse/storage/databases/main/pusher.py,
synapse/storage/databases/main/registration.py,
synapse/storage/databases/main/session.py,
synapse/storage/databases/main/stream.py,
synapse/storage/databases/main/ui_auth.py,
synapse/storage/database.py,
Expand Down Expand Up @@ -90,6 +91,7 @@ files =
tests/test_utils,
tests/handlers/test_password_providers.py,
tests/handlers/test_room_summary.py,
tests/handlers/test_send_email.py,
tests/handlers/test_sync.py,
tests/rest/client/test_login.py,
tests/rest/client/test_auth.py,
Expand Down
Loading

0 comments on commit 32cfc20

Please sign in to comment.