Skip to content

Commit

Permalink
Merge tag 'v1.51.0' into develop
Browse files Browse the repository at this point in the history
Synapse 1.51.0 (2022-01-25)
===========================

No significant changes since 1.51.0rc2.

Synapse 1.51.0 deprecates `webclient` listeners and non-HTTP(S) `web_client_location`s. Support for these will be removed in Synapse 1.53.0, at which point Synapse will not be capable of directly serving a web client for Matrix.

Synapse 1.51.0rc2 (2022-01-24)
==============================

Bugfixes
--------

- Fix a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\matrix-org#11806](matrix-org#11806))

Synapse 1.51.0rc1 (2022-01-21)
==============================

Features
--------

- 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. ([\matrix-org#11561](matrix-org#11561), [\matrix-org#11749](matrix-org#11749), [\matrix-org#11757](matrix-org#11757))
- Include whether the requesting user has participated in a thread when generating a summary for [MSC3440](matrix-org/matrix-spec-proposals#3440). ([\matrix-org#11577](matrix-org#11577))
- Return an `M_FORBIDDEN` error code instead of `M_UNKNOWN` when a spam checker module prevents a user from creating a room. ([\matrix-org#11672](matrix-org#11672))
- Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users. ([\matrix-org#11675](matrix-org#11675), [\matrix-org#11770](matrix-org#11770))

Bugfixes
--------

- Fix a long-standing issue which could cause Synapse to incorrectly accept data in the unsigned field of events
  received over federation. ([\matrix-org#11530](matrix-org#11530))
- Fix a long-standing bug where Synapse wouldn't cache a response indicating that a remote user has no devices. ([\matrix-org#11587](matrix-org#11587))
- Fix an error that occurs whilst trying to get the federation status of a destination server that was working normally. This admin API was newly introduced in Synapse v1.49.0. ([\matrix-org#11593](matrix-org#11593))
- Fix bundled aggregations not being included in the `/sync` response, per [MSC2675](matrix-org/matrix-spec-proposals#2675). ([\matrix-org#11612](matrix-org#11612), [\matrix-org#11659](matrix-org#11659), [\matrix-org#11791](matrix-org#11791))
- Fix the `/_matrix/client/v1/room/{roomId}/hierarchy` endpoint returning incorrect fields which have been present since Synapse 1.49.0. ([\matrix-org#11667](matrix-org#11667))
- Fix preview of some GIF URLs (like tenor.com). Contributed by Philippe Daouadi. ([\matrix-org#11669](matrix-org#11669))
- Fix a bug where only the first 50 rooms from a space were returned from the `/hierarchy` API. This has existed since the introduction of the API in Synapse v1.41.0. ([\matrix-org#11695](matrix-org#11695))
- Fix a bug introduced in Synapse v1.18.0 where password reset and address validation emails would not be sent if their subject was configured to use the 'app' template variable. Contributed by @br4nnigan. ([\matrix-org#11710](matrix-org#11710), [\matrix-org#11745](matrix-org#11745))
- Make the 'List Rooms' Admin API sort stable. Contributed by Daniël Sonck. ([\matrix-org#11737](matrix-org#11737))
- Fix a long-standing bug where space hierarchy over federation would only work correctly some of the time. ([\matrix-org#11775](matrix-org#11775))
- Fix a bug introduced in Synapse v1.46.0 that prevented `on_logged_out` module callbacks from being correctly awaited by Synapse. ([\matrix-org#11786](matrix-org#11786))

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

- Warn against using a Let's Encrypt certificate for TLS/DTLS TURN server client connections, and suggest using ZeroSSL certificate instead. This works around client-side connectivity errors caused by WebRTC libraries that reject Let's Encrypt certificates. Contibuted by @AndrewFerr. ([\matrix-org#11686](matrix-org#11686))
- Document the new `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable in the contributing guide. ([\matrix-org#11715](matrix-org#11715))
- Document that the minimum supported PostgreSQL version is now 10. ([\matrix-org#11725](matrix-org#11725))
- Fix typo in demo docs: differnt. ([\matrix-org#11735](matrix-org#11735))
- Update room spec URL in config files. ([\matrix-org#11739](matrix-org#11739))
- Mention `python3-venv` and `libpq-dev` dependencies in the contribution guide. ([\matrix-org#11740](matrix-org#11740))
- Update documentation for configuring login with Facebook. ([\matrix-org#11755](matrix-org#11755))
- Update installation instructions to note that Python 3.6 is no longer supported. ([\matrix-org#11781](matrix-org#11781))

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

- Remove the unstable `/send_relation` endpoint. ([\matrix-org#11682](matrix-org#11682))
- Remove `python_twisted_reactor_pending_calls` Prometheus metric. ([\matrix-org#11724](matrix-org#11724))
- 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). ([\matrix-org#11576](matrix-org#11576))
- **Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration. ([\matrix-org#11774](matrix-org#11774), [\matrix-org#11783](matrix-org#11783

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

- Run `pyupgrade --py37-plus --keep-percent-format` on Synapse. ([\matrix-org#11685](matrix-org#11685))
- Use buildkit's cache feature to speed up docker builds. ([\matrix-org#11691](matrix-org#11691))
- Use `auto_attribs` and native type hints for attrs classes. ([\matrix-org#11692](matrix-org#11692), [\matrix-org#11768](matrix-org#11768))
- Remove debug logging for matrix-org#4422, which has been closed since Synapse 0.99. ([\matrix-org#11693](matrix-org#11693))
- Remove fallback code for Python 2. ([\matrix-org#11699](matrix-org#11699))
- Add a test for [an edge case](matrix-org#11532 (comment)) in the `/sync` logic. ([\matrix-org#11701](matrix-org#11701))
- Add the option to write SQLite test dbs to disk when running tests. ([\matrix-org#11702](matrix-org#11702))
- Improve Complement test output for Gitub Actions. ([\matrix-org#11707](matrix-org#11707))
- Fix docstring on `add_account_data_for_user`. ([\matrix-org#11716](matrix-org#11716))
- Complement environment variable name change and update `.gitignore`. ([\matrix-org#11718](matrix-org#11718))
- Simplify calculation of Prometheus metrics for garbage collection. ([\matrix-org#11723](matrix-org#11723))
- Improve accuracy of `python_twisted_reactor_tick_time` Prometheus metric. ([\matrix-org#11724](matrix-org#11724), [\matrix-org#11771](matrix-org#11771))
- Minor efficiency improvements when inserting many values into the database. ([\matrix-org#11742](matrix-org#11742))
- Invite PR authors to give themselves credit in the changelog. ([\matrix-org#11744](matrix-org#11744))
- Add optional debugging to investigate [issue 8631](matrix-org#8631). ([\matrix-org#11760](matrix-org#11760))
- Remove `log_function` utility function and its uses. ([\matrix-org#11761](matrix-org#11761))
- Add a unit test that checks both `client` and `webclient` resources will function when simultaneously enabled. ([\matrix-org#11765](matrix-org#11765))
- Allow overriding complement commit using `COMPLEMENT_REF`. ([\matrix-org#11766](matrix-org#11766))
- Add some comments and type annotations for `_update_outliers_txn`. ([\matrix-org#11776](matrix-org#11776))
  • Loading branch information
PiotrKozimor committed Feb 1, 2022
2 parents 80b18aa + 343d4f1 commit 2b0208f
Show file tree
Hide file tree
Showing 264 changed files with 7,764 additions and 4,343 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Use markdown where necessary, mostly for `code blocks`.
- End with either a period (.) or an exclamation mark (!).
- Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
* [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
* [ ] [Code style](https://matrix-org.github.io/synapse/latest/code_style.html) is correct
(run the [linters](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
17 changes: 10 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
database: ["sqlite"]
toxenv: ["py"]
include:
Expand All @@ -85,9 +85,9 @@ jobs:
toxenv: "py-noextras"

# Oldest Python with PostgreSQL
- python-version: "3.6"
- python-version: "3.7"
database: "postgres"
postgres-version: "9.6"
postgres-version: "10"
toxenv: "py"

# Newest Python with newest PostgreSQL
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["pypy-3.6"]
python-version: ["pypy-3.7"]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -291,8 +291,8 @@ jobs:
strategy:
matrix:
include:
- python-version: "3.6"
postgres-version: "9.6"
- python-version: "3.7"
postgres-version: "10"

- python-version: "3.10"
postgres-version: "14"
Expand Down Expand Up @@ -366,6 +366,8 @@ jobs:
# Build initial Synapse image
- run: docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile .
working-directory: synapse
env:
DOCKER_BUILDKIT: 1

# Build a ready-to-run Synapse image based on the initial image above.
# This new image includes a config file, keys for signing and TLS, and
Expand All @@ -374,7 +376,8 @@ jobs:
working-directory: complement/dockerfiles

# Run Complement
- run: go test -v -tags synapse_blacklist,msc2403 ./tests/...
- run: set -o pipefail && go test -v -json -tags synapse_blacklist,msc2403 ./tests/... 2>&1 | gotestfmt
shell: bash
env:
COMPLEMENT_BASE_IMAGE: complement-synapse:latest
working-directory: complement
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ __pycache__/

# docs
book/

# complement
/complement-*
/master.tar.gz
225 changes: 225 additions & 0 deletions CHANGES.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions contrib/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
# failure
restart: unless-stopped
# See the readme for a full documentation of the environment settings
# NOTE: You must edit homeserver.yaml to use postgres, it defaults to sqlite
environment:
- SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
volumes:
Expand Down
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
42 changes: 42 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
matrix-synapse-py3 (1.51.0) stable; urgency=medium

* New synapse release 1.51.0.

-- Synapse Packaging team <[email protected]> Tue, 25 Jan 2022 11:28:51 +0000

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

* New synapse release 1.51.0~rc2.

-- Synapse Packaging team <[email protected]> Mon, 24 Jan 2022 12:25:00 +0000

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

* New synapse release 1.51.0~rc1.

-- Synapse Packaging team <[email protected]> Fri, 21 Jan 2022 10:46:02 +0000

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.

-- Synapse Packaging team <[email protected]> Wed, 05 Jan 2022 12:36:17 +0000

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

* New synapse release 1.49.2.
Expand Down
2 changes: 1 addition & 1 deletion demo/README
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Logs and sqlitedb will be stored in demo/808{0,1,2}.{log,db}



Also note that when joining a public room on a differnt HS via "#foo:bar.net", then you are (in the current impl) joining a room with room_id "foo". This means that it won't work if your HS already has a room with that name.
Also note that when joining a public room on a different HS via "#foo:bar.net", then you are (in the current impl) joining a room with room_id "foo". This means that it won't work if your HS already has a room with that name.

26 changes: 21 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Dockerfile to build the matrixdotorg/synapse docker images.
#
# Note that it uses features which are only available in BuildKit - see
# https://docs.docker.com/go/buildkit/ for more information.
#
# To build the image, run `docker build` command from the root of the
# synapse repository:
#
# docker build -f docker/Dockerfile .
# DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile .
#
# There is an optional PYTHON_VERSION build argument which sets the
# version of python to build against: for example:
#
# docker build -f docker/Dockerfile --build-arg PYTHON_VERSION=3.6 .
# DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile --build-arg PYTHON_VERSION=3.9 .
#

ARG PYTHON_VERSION=3.8
Expand All @@ -19,7 +22,16 @@ ARG PYTHON_VERSION=3.8
FROM docker.io/python:${PYTHON_VERSION}-slim as builder

# install the OS build deps
RUN apt-get update && apt-get install -y \
#
# RUN --mount is specific to buildkit and is documented at
# https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md#build-mounts-run---mount.
# Here we use it to set up a cache for apt, to improve rebuild speeds on
# slow connections.
#
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y \
build-essential \
libffi-dev \
libjpeg-dev \
Expand All @@ -44,7 +56,8 @@ COPY synapse/python_dependencies.py /synapse/synapse/python_dependencies.py
# used while you develop on the source
#
# This is aiming at installing the `install_requires` and `extras_require` from `setup.py`
RUN pip install --prefix="/install" --no-warn-script-location \
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --prefix="/install" --no-warn-script-location \
/synapse[all]

# Copy over the rest of the project
Expand All @@ -66,7 +79,10 @@ LABEL org.opencontainers.image.documentation='https://github.com/matrix-org/syna
LABEL org.opencontainers.image.source='https://github.com/matrix-org/synapse.git'
LABEL org.opencontainers.image.licenses='Apache-2.0'

RUN apt-get update && apt-get install -y \
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y \
curl \
gosu \
libjpeg62-turbo \
Expand Down
9 changes: 4 additions & 5 deletions docker/Dockerfile-dhvirtualenv
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG distro=""
### Stage 0: build a dh-virtualenv
###

# This is only really needed on bionic and focal, since other distributions we
# This is only really needed on focal, since other distributions we
# care about have a recent version of dh-virtualenv by default. Unfortunately,
# it looks like focal is going to be with us for a while.
#
Expand All @@ -36,9 +36,8 @@ RUN env DEBIAN_FRONTEND=noninteractive apt-get install \
wget

# fetch and unpack the package
# TODO: Upgrade to 1.2.2 once bionic is dropped (1.2.2 requires debhelper 12; bionic has only 11)
RUN mkdir /dh-virtualenv
RUN wget -q -O /dh-virtualenv.tar.gz https://github.com/spotify/dh-virtualenv/archive/ac6e1b1.tar.gz
RUN wget -q -O /dh-virtualenv.tar.gz https://github.com/spotify/dh-virtualenv/archive/refs/tags/1.2.2.tar.gz
RUN tar -xv --strip-components=1 -C /dh-virtualenv -f /dh-virtualenv.tar.gz

# install its build deps. We do another apt-cache-update here, because we might
Expand Down Expand Up @@ -86,12 +85,12 @@ RUN apt-get update -qq -o Acquire::Languages=none \
libpq-dev \
xmlsec1

COPY --from=builder /dh-virtualenv_1.2~dev-1_all.deb /
COPY --from=builder /dh-virtualenv_1.2.2-1_all.deb /

# install dhvirtualenv. Update the apt cache again first, in case we got a
# cached cache from docker the first time.
RUN apt-get update -qq -o Acquire::Languages=none \
&& apt-get install -yq /dh-virtualenv_1.2~dev-1_all.deb
&& apt-get install -yq /dh-virtualenv_1.2.2-1_all.deb

WORKDIR /synapse/source
ENTRYPOINT ["bash","/synapse/source/docker/build_debian.sh"]
4 changes: 4 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ The following environment variables are supported in `generate` mode:
directories. If unset, and no user is set via `docker run --user`, defaults
to `991`, `991`.

## Postgres

By default the config will use SQLite. See the [docs on using Postgres](https://github.com/matrix-org/synapse/blob/develop/docs/postgres.md) for more info on how to use Postgres. Until this section is improved [this issue](https://github.com/matrix-org/synapse/issues/8304) may provide useful information.

## Running synapse

Once you have a valid configuration file, you can start synapse as follows:
Expand Down
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- [SSO Mapping Providers](sso_mapping_providers.md)
- [Password Auth Providers](password_auth_providers.md)
- [JSON Web Tokens](jwt.md)
- [Refresh Tokens](usage/configuration/user_authentication/refresh_tokens.md)
- [Registration Captcha](CAPTCHA_SETUP.md)
- [Application Services](application_services.md)
- [Server Notices](server_notices.md)
Expand Down
84 changes: 80 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 Expand Up @@ -480,6 +481,81 @@ The following fields are returned in the JSON response body:
- `joined_rooms` - An array of `room_id`.
- `total` - Number of rooms.

## Account Data
Gets information about account data for a specific `user_id`.

The API is:

```
GET /_synapse/admin/v1/users/<user_id>/accountdata
```

A response body like the following is returned:

```json
{
"account_data": {
"global": {
"m.secret_storage.key.LmIGHTg5W": {
"algorithm": "m.secret_storage.v1.aes-hmac-sha2",
"iv": "fwjNZatxg==",
"mac": "eWh9kNnLWZUNOgnc="
},
"im.vector.hide_profile": {
"hide_profile": true
},
"org.matrix.preview_urls": {
"disable": false
},
"im.vector.riot.breadcrumb_rooms": {
"rooms": [
"!LxcBDAsDUVAfJDEo:matrix.org",
"!MAhRxqasbItjOqxu:matrix.org"
]
},
"m.accepted_terms": {
"accepted": [
"https://example.org/somewhere/privacy-1.2-en.html",
"https://example.org/somewhere/terms-2.0-en.html"
]
},
"im.vector.setting.breadcrumbs": {
"recent_rooms": [
"!MAhRxqasbItqxuEt:matrix.org",
"!ZtSaPCawyWtxiImy:matrix.org"
]
}
},
"rooms": {
"!GUdfZSHUJibpiVqHYd:matrix.org": {
"m.fully_read": {
"event_id": "$156334540fYIhZ:matrix.org"
}
},
"!tOZwOOiqwCYQkLhV:matrix.org": {
"m.fully_read": {
"event_id": "$xjsIyp4_NaVl2yPvIZs_k1Jl8tsC_Sp23wjqXPno"
}
}
}
}
}
```

**Parameters**

The following parameters should be set in the URL:

- `user_id` - fully qualified: for example, `@user:server.com`.

**Response**

The following fields are returned in the JSON response body:

- `account_data` - A map containing the account data for the user
- `global` - A map containing the global account data for the user
- `rooms` - A map containing the account data per room for the user

## User media

### List media uploaded by a user
Expand Down
Loading

0 comments on commit 2b0208f

Please sign in to comment.