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

Commit

Permalink
Merge branch 'develop' into excise_36
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay authored Jan 20, 2022
2 parents 954665d + d090996 commit cb763cc
Show file tree
Hide file tree
Showing 95 changed files with 1,351 additions and 782 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ __pycache__/
book/

# complement
/complement-master
/complement-*
/master.tar.gz
49 changes: 47 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,53 @@
Synapse 1.50.0rc1 (2022-01-05)
==============================
Synapse 1.50.1 (2022-01-18)
===========================

This release fixes a bug in Synapse 1.50.0 that could prevent clients from being able to connect to Synapse if the `webclient` resource was enabled. Further details are available in [this issue](https://github.com/matrix-org/synapse/issues/11763).

Bugfixes
--------

- Fix a bug introduced in Synapse 1.50.0rc1 that could cause Matrix clients to be unable to connect to Synapse instances with the `webclient` resource enabled. ([\#11764](https://github.com/matrix-org/synapse/issues/11764))


Synapse 1.50.0 (2022-01-18)
===========================

**This release contains a critical bug that may prevent clients from being able to connect.
As such, it is not recommended to upgrade to 1.50.0. Instead, please upgrade straight to
to 1.50.1. Further details are available in [this issue](https://github.com/matrix-org/synapse/issues/11763).**

Please note that we now only support Python 3.7+ and PostgreSQL 10+ (if applicable), because Python 3.6 and PostgreSQL 9.6 have reached end-of-life.

No significant changes since 1.50.0rc2.


Synapse 1.50.0rc2 (2022-01-14)
==============================

This release candidate fixes a federation-breaking regression introduced in Synapse 1.50.0rc1.

Bugfixes
--------

- Fix a bug introduced in Synapse v1.0.0 whereby some device list updates would not be sent to remote homeservers if there were too many to send at once. ([\#11729](https://github.com/matrix-org/synapse/issues/11729))
- Fix a bug introduced in Synapse v1.50.0rc1 whereby outbound federation could fail because too many EDUs were produced for device updates. ([\#11730](https://github.com/matrix-org/synapse/issues/11730))


Improved Documentation
----------------------

- Document that now the minimum supported PostgreSQL version is 10. ([\#11725](https://github.com/matrix-org/synapse/issues/11725))


Internal Changes
----------------

- Fix a typechecker problem related to our (ab)use of `nacl.signing.SigningKey`s. ([\#11714](https://github.com/matrix-org/synapse/issues/11714))


Synapse 1.50.0rc1 (2022-01-05)
==============================


Features
--------
Expand Down
2 changes: 1 addition & 1 deletion changelog.d/11561.feature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Add `track_puppeted_user_ips` config flag to track puppeted user IP addresses. This also includes them in monthly active user counts.
Add `track_puppeted_user_ips` config flag to record client IP addresses against puppeted users, and include the puppeted users in monthly active user counts.
1 change: 1 addition & 0 deletions changelog.d/11576.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the `"password_hash"` field from the response dictionaries of the [Users Admin API](https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html).
1 change: 1 addition & 0 deletions changelog.d/11577.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include whether the requesting user has participated in a thread when generating a summary for [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440).
1 change: 1 addition & 0 deletions changelog.d/11669.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix preview of some gif URLs (like tenor.com). Contributed by Philippe Daouadi.
1 change: 1 addition & 0 deletions changelog.d/11675.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users.
1 change: 1 addition & 0 deletions changelog.d/11686.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Warn against using a Let's Encrypt certificate for TLS/DTLS TURN server client connections, and suggest using ZeroSSL certificate instead. This bypasses client-side connectivity errors caused by WebRTC libraries that reject Let's Encrypt certificates. Contibuted by @AndrewFerr.
1 change: 1 addition & 0 deletions changelog.d/11724.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve accuracy of `python_twisted_reactor_tick_time` prometheus metric.
1 change: 1 addition & 0 deletions changelog.d/11724.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove `python_twisted_reactor_pending_calls` prometheus metric.
1 change: 1 addition & 0 deletions changelog.d/11737.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make the list rooms admin api sort stable. Contributed by Daniël Sonck.
1 change: 1 addition & 0 deletions changelog.d/11742.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Minor efficiency improvements when inserting many values into the database.
1 change: 1 addition & 0 deletions changelog.d/11749.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `track_puppeted_user_ips` config flag to record client IP addresses against puppeted users, and include the puppeted users in monthly active user counts.
1 change: 1 addition & 0 deletions changelog.d/11755.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update documentation for configuring login with facebook.
1 change: 1 addition & 0 deletions changelog.d/11757.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `track_puppeted_user_ips` config flag to record client IP addresses against puppeted users, and include the puppeted users in monthly active user counts.
1 change: 1 addition & 0 deletions changelog.d/11760.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add optional debugging to investigate [issue 8631](https://github.com/matrix-org/synapse/issues/8631).
1 change: 1 addition & 0 deletions changelog.d/11761.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove `log_function` utility function and its uses.
1 change: 1 addition & 0 deletions changelog.d/11765.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a unit test that checks both `client` and `webclient` resources will function when simultaneously enabled.
1 change: 1 addition & 0 deletions changelog.d/11766.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow overriding complement commit using `COMPLEMENT_REF`.
1 change: 1 addition & 0 deletions changelog.d/11768.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use `auto_attribs` and native type hints for attrs classes.
1 change: 1 addition & 0 deletions changelog.d/11770.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users.
1 change: 1 addition & 0 deletions changelog.d/11771.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve accuracy of `python_twisted_reactor_tick_time` prometheus metric.
1 change: 1 addition & 0 deletions changelog.d/11774.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration.
1 change: 1 addition & 0 deletions changelog.d/11775.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a long-standing bug where space hierarchy over federation would only work correctly some of the time.
1 change: 1 addition & 0 deletions changelog.d/11776.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add some comments and type annotations for `_update_outliers_txn`.
1 change: 1 addition & 0 deletions changelog.d/11781.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update installation instructions to note that Python 3.6 is no longer supported.
1 change: 1 addition & 0 deletions changelog.d/11783.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration.
16 changes: 0 additions & 16 deletions contrib/prometheus/consoles/synapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,6 @@ <h3>Average reactor tick time</h3>
})
</script>

<h3>Pending calls per tick</h3>
<div id="reactor_pending_calls"></div>
<script>
new PromConsole.Graph({
node: document.querySelector("#reactor_pending_calls"),
expr: "rate(python_twisted_reactor_pending_calls_sum[30s]) / rate(python_twisted_reactor_pending_calls_count[30s])",
name: "[[job]]-[[index]]",
min: 0,
renderer: "line",
height: 150,
yAxisFormatter: PromConsole.NumberFormatter.humanize,
yHoverFormatter: PromConsole.NumberFormatter.humanize,
yTitle: "Pending Calls"
})
</script>

<h1>Storage</h1>

<h3>Queries</h3>
Expand Down
18 changes: 18 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
matrix-synapse-py3 (1.50.1) stable; urgency=medium

* New synapse release 1.50.1.

-- Synapse Packaging team <[email protected]> Tue, 18 Jan 2022 16:06:26 +0000

matrix-synapse-py3 (1.50.0) stable; urgency=medium

* New synapse release 1.50.0.

-- Synapse Packaging team <[email protected]> Tue, 18 Jan 2022 10:40:38 +0000

matrix-synapse-py3 (1.50.0~rc2) stable; urgency=medium

* New synapse release 1.50.0~rc2.

-- Synapse Packaging team <[email protected]> Fri, 14 Jan 2022 11:18:06 +0000

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

* New synapse release 1.50.0~rc1.
Expand Down
9 changes: 5 additions & 4 deletions docs/admin_api/user_admin_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ server admin: [Admin API](../usage/administration/admin_api)

It returns a JSON body like the following:

```json
```jsonc
{
"displayname": "User",
"name": "@user:example.com",
"displayname": "User", // can be null if not set
"threepids": [
{
"medium": "email",
Expand All @@ -32,11 +33,11 @@ It returns a JSON body like the following:
"validated_at": 1586458409743
}
],
"avatar_url": "<avatar_url>",
"avatar_url": "<avatar_url>", // can be null if not set
"is_guest": 0,
"admin": 0,
"deactivated": 0,
"shadow_banned": 0,
"password_hash": "$2b$12$p9B4GkqYdRTPGD",
"creation_ts": 1560432506,
"appservice_id": null,
"consent_server_notice_sent": null,
Expand Down
7 changes: 6 additions & 1 deletion docs/development/url_previews.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ When Synapse is asked to preview a URL it does the following:
5. If the media is HTML:
1. Decodes the HTML via the stored file.
2. Generates an Open Graph response from the HTML.
3. If an image exists in the Open Graph response:
3. If a JSON oEmbed URL was found in the HTML via autodiscovery:
1. Downloads the URL and stores it into a file via the media storage provider
and saves the local media metadata.
2. Convert the oEmbed response to an Open Graph response.
3. Override any Open Graph data from the HTML with data from oEmbed.
4. If an image exists in the Open Graph response:
1. Downloads the URL and stores it into a file via the media storage
provider and saves the local media metadata.
2. Generates thumbnails.
Expand Down
25 changes: 13 additions & 12 deletions docs/openid.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,6 @@ oidc_providers:

### Facebook

Like Github, Facebook provide a custom OAuth2 API rather than an OIDC-compliant
one so requires a little more configuration.

0. You will need a Facebook developer account. You can register for one
[here](https://developers.facebook.com/async/registration/).
1. On the [apps](https://developers.facebook.com/apps/) page of the developer
Expand All @@ -412,24 +409,28 @@ Synapse config:
idp_name: Facebook
idp_brand: "facebook" # optional: styling hint for clients
discover: false
issuer: "https://facebook.com"
issuer: "https://www.facebook.com"
client_id: "your-client-id" # TO BE FILLED
client_secret: "your-client-secret" # TO BE FILLED
scopes: ["openid", "email"]
authorization_endpoint: https://facebook.com/dialog/oauth
token_endpoint: https://graph.facebook.com/v9.0/oauth/access_token
user_profile_method: "userinfo_endpoint"
userinfo_endpoint: "https://graph.facebook.com/v9.0/me?fields=id,name,email,picture"
authorization_endpoint: "https://facebook.com/dialog/oauth"
token_endpoint: "https://graph.facebook.com/v9.0/oauth/access_token"
jwks_uri: "https://www.facebook.com/.well-known/oauth/openid/jwks/"
user_mapping_provider:
config:
subject_claim: "id"
display_name_template: "{{ user.name }}"
email_template: "{{ '{{ user.email }}' }}"
```

Relevant documents:
* https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow
* Using Facebook's Graph API: https://developers.facebook.com/docs/graph-api/using-graph-api/
* Reference to the User endpoint: https://developers.facebook.com/docs/graph-api/reference/user
* [Manually Build a Login Flow](https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow)
* [Using Facebook's Graph API](https://developers.facebook.com/docs/graph-api/using-graph-api/)
* [Reference to the User endpoint](https://developers.facebook.com/docs/graph-api/reference/user)

Facebook do have an [OIDC discovery endpoint](https://www.facebook.com/.well-known/openid-configuration),
but it has a `response_types_supported` which excludes "code" (which we rely on, and
is even mentioned in their [documentation](https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#login)),
so we have to disable discovery and configure the URIs manually.

### Gitea

Expand Down
38 changes: 21 additions & 17 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,7 @@ server_name: "SERVERNAME"
#
pid_file: DATADIR/homeserver.pid

# The absolute URL to the web client which /_matrix/client will redirect
# to if 'webclient' is configured under the 'listeners' configuration.
#
# This option can be also set to the filesystem path to the web client
# which will be served at /_matrix/client/ if 'webclient' is configured
# under the 'listeners' configuration, however this is a security risk:
# https://github.com/matrix-org/synapse#security-note
# The absolute URL to the web client which / will redirect to.
#
#web_client_location: https://riot.example.com/

Expand Down Expand Up @@ -310,8 +304,6 @@ presence:
# static: static resources under synapse/static (/_matrix/static). (Mostly
# useful for 'fallback authentication'.)
#
# webclient: A web client. Requires web_client_location to be set.
#
listeners:
# TLS-enabled listener: for when matrix traffic is sent directly to synapse.
#
Expand Down Expand Up @@ -1503,11 +1495,20 @@ room_prejoin_state:
#additional_event_types:
# - org.example.custom.event.type

# If enabled, puppeted user IP's can also be tracked. By default when
# puppeting another user, the user who has created the access token
# for puppeting is tracked. If this is enabled, both requests are tracked.
# Implicitly enables MAU tracking for puppeted users.
#track_puppeted_user_ips: false
# We record the IP address of clients used to access the API for various
# reasons, including displaying it to the user in the "Where you're signed in"
# dialog.
#
# By default, when puppeting another user via the admin API, the client IP
# address is recorded against the user who created the access token (ie, the
# admin user), and *not* the puppeted user.
#
# Uncomment the following to also record the IP address against the puppeted
# user. (This also means that the puppeted user will count as an "active" user
# for the purpose of monthly active user tracking - see 'limit_usage_by_mau' etc
# above.)
#
#track_puppeted_user_ips: true


# A list of application service config files to use
Expand Down Expand Up @@ -1876,10 +1877,13 @@ saml2_config:
# Defaults to false. Avoid this in production.
#
# user_profile_method: Whether to fetch the user profile from the userinfo
# endpoint. Valid values are: 'auto' or 'userinfo_endpoint'.
# endpoint, or to rely on the data returned in the id_token from the
# token_endpoint.
#
# Valid values are: 'auto' or 'userinfo_endpoint'.
#
# Defaults to 'auto', which fetches the userinfo endpoint if 'openid' is
# included in 'scopes'. Set to 'userinfo_endpoint' to always fetch the
# Defaults to 'auto', which uses the userinfo endpoint if 'openid' is
# not included in 'scopes'. Set to 'userinfo_endpoint' to always use the
# userinfo endpoint.
#
# allow_existing_users: set to 'true' to allow a user logging in via OIDC to
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ When following this route please make sure that the [Platform-specific prerequis
System requirements:

- POSIX-compliant system (tested on Linux & OS X)
- Python 3.7 or later, up to Python 3.10.
- Python 3.7 or later, up to Python 3.9.
- At least 1GB of free RAM if you want to join large public rooms like #matrix:matrix.org

To install the Synapse homeserver run:
Expand Down
16 changes: 16 additions & 0 deletions docs/turn-howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ This will install and start a systemd service called `coturn`.
# TLS private key file
pkey=/path/to/privkey.pem
# Ensure the configuration lines that disable TLS/DTLS are commented-out or removed
#no-tls
#no-dtls
```

In this case, replace the `turn:` schemes in the `turn_uris` settings below
Expand All @@ -145,6 +149,14 @@ This will install and start a systemd service called `coturn`.
We recommend that you only try to set up TLS/DTLS once you have set up a
basic installation and got it working.

NB: If your TLS certificate was provided by Let's Encrypt, TLS/DTLS will
not work with any Matrix client that uses Chromium's WebRTC library. This
currently includes Element Android & iOS; for more details, see their
[respective](https://github.com/vector-im/element-android/issues/1533)
[issues](https://github.com/vector-im/element-ios/issues/2712) as well as the underlying
[WebRTC issue](https://bugs.chromium.org/p/webrtc/issues/detail?id=11710).
Consider using a ZeroSSL certificate for your TURN server as a working alternative.

1. Ensure your firewall allows traffic into the TURN server on the ports
you've configured it to listen on (By default: 3478 and 5349 for TURN
traffic (remember to allow both TCP and UDP traffic), and ports 49152-65535
Expand Down Expand Up @@ -250,6 +262,10 @@ Here are a few things to try:
* Check that you have opened your firewall to allow UDP traffic to the UDP
relay ports (49152-65535 by default).
* Try disabling `coturn`'s TLS/DTLS listeners and enable only its (unencrypted)
TCP/UDP listeners. (This will only leave signaling traffic unencrypted;
voice & video WebRTC traffic is always encrypted.)

* Some WebRTC implementations (notably, that of Google Chrome) appear to get
confused by TURN servers which are reachable over IPv6 (this appears to be
an unexpected side-effect of its handling of multiple IP addresses as
Expand Down
11 changes: 11 additions & 0 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ process, for example:
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
```

# Upgrading to v1.51.0

## Deprecation of `webclient` listeners and non-HTTP(S) `web_client_location`

Listeners of type `webclient` are deprecated and scheduled to be removed in
Synapse v1.53.0.

Similarly, a non-HTTP(S) `web_client_location` configuration is deprecated and
will become a configuration error in Synapse v1.53.0.


# Upgrading to v1.50.0

## Dropping support for old Python and Postgres versions
Expand Down
Loading

0 comments on commit cb763cc

Please sign in to comment.