Skip to content

Commit fa95886

Browse files
author
cfriedlander
committed
Merge tag 'v1.56.0' of https://github.com/matrix-org/synapse into adding-modules-for-ansible-self-build
Synapse 1.56.0 (2022-04-05) =========================== Synapse will now refuse to start up if open registration is enabled, in order to help mitigate abuse across the federation. If you would like to provide registration to anyone, consider adding [email](https://github.com/matrix-org/synapse/blob/8a519f8abc6de772167c2cca101d22ee2052fafc/docs/sample_config.yaml#L1285), [recaptcha](https://matrix-org.github.io/synapse/v1.56/CAPTCHA_SETUP.html) or [token-based](https://matrix-org.github.io/synapse/v1.56/usage/administration/admin_api/registration_tokens.html) verification in order to prevent automated registration from bad actors. This check can be disabled by setting the `enable_registration_without_verification` option in your homeserver configuration file to `true`. More details are available in the [upgrade notes](https://matrix-org.github.io/synapse/v1.56/upgrade.html#open-registration-without-verification-is-now-disabled-by-default). Synapse will additionally now refuse to start when using PostgreSQL with a non-`C` values for `COLLATE` and `CTYPE`, unless the config flag `allow_unsafe_locale`, found in the database section of the configuration file, is set to `true`. See the [upgrade notes](https://matrix-org.github.io/synapse/v1.56/upgrade#change-in-behaviour-for-postgresql-databases-with-unsafe-locale) for details. Internal Changes ---------------- - Bump the version of `black` for compatibility with the latest `click` release. ([\matrix-org#12320](matrix-org#12320)) Synapse 1.56.0rc1 (2022-03-29) ============================== Features -------- - Allow modules to store already existing 3PID associations. ([\matrix-org#12195](matrix-org#12195)) - Allow registering server administrators using the module API. Contributed by Famedly. ([\matrix-org#12250](matrix-org#12250)) Bugfixes -------- - Fix a long-standing bug which caused the `/_matrix/federation/v1/state` and `/_matrix/federation/v1/state_ids` endpoints to return incorrect or invalid data when called for an event which we have stored as an "outlier". ([\matrix-org#12087](matrix-org#12087)) - Fix a long-standing bug where events from ignored users would still be considered for relations. ([\matrix-org#12227](matrix-org#12227), [\matrix-org#12232](matrix-org#12232), [\matrix-org#12285](matrix-org#12285)) - Fix a bug introduced in Synapse 1.53.0 where an unnecessary query could be performed when fetching bundled aggregations for threads. ([\matrix-org#12228](matrix-org#12228)) - Fix a bug introduced in Synapse 1.52.0 where admins could not deactivate and GDPR-erase a user if Synapse was configured with limits on avatars. ([\matrix-org#12261](matrix-org#12261)) Improved Documentation ---------------------- - Fix the link to the module documentation in the legacy spam checker warning message. ([\matrix-org#12231](matrix-org#12231)) - Remove incorrect prefixes in the worker documentation for some endpoints. ([\matrix-org#12243](matrix-org#12243)) - Correct `check_username_for_spam` annotations and docs. ([\matrix-org#12246](matrix-org#12246)) - Correct Authentik OpenID typo, and add notes on troubleshooting. Contributed by @IronTooch. ([\matrix-org#12275](matrix-org#12275)) - HAProxy reverse proxy guide update to stop sending IPv4-mapped address to homeserver. Contributed by @villepeh. ([\matrix-org#12279](matrix-org#12279)) Internal Changes ---------------- - Rename `shared_rooms` to `mutual_rooms` ([MSC2666](matrix-org/matrix-spec-proposals#2666)), as per proposal changes. ([\matrix-org#12036](matrix-org#12036)) - Remove check on `update_user_directory` for shared rooms handler ([MSC2666](matrix-org/matrix-spec-proposals#2666)), and update/expand documentation. ([\matrix-org#12038](matrix-org#12038)) - Refactor `create_new_client_event` to use a new parameter, `state_event_ids`, which accurately describes the usage with [MSC2716](matrix-org/matrix-spec-proposals#2716) instead of abusing `auth_event_ids`. ([\matrix-org#12083](matrix-org#12083), [\matrix-org#12304](matrix-org#12304)) - Refuse to start if registration is enabled without email, captcha, or token-based verification unless the new config flag `enable_registration_without_verification` is set to `true`. ([\matrix-org#12091](matrix-org#12091), [\matrix-org#12322](matrix-org#12322)) - Add tests for database transaction callbacks. ([\matrix-org#12198](matrix-org#12198)) - Handle cancellation in `DatabasePool.runInteraction`. ([\matrix-org#12199](matrix-org#12199)) - Add missing type hints for cache storage. ([\matrix-org#12216](matrix-org#12216)) - Add missing type hints for storage. ([\matrix-org#12248](matrix-org#12248), [\matrix-org#12255](matrix-org#12255)) - Add type hints to tests files. ([\matrix-org#12224](matrix-org#12224), [\matrix-org#12240](matrix-org#12240), [\matrix-org#12256](matrix-org#12256)) - Use type stubs for `psycopg2`. ([\matrix-org#12269](matrix-org#12269)) - Improve type annotations for `execute_values`. ([\matrix-org#12311](matrix-org#12311)) - Clean-up logic around rebasing URLs for URL image previews. ([\matrix-org#12219](matrix-org#12219)) - Use the `ignored_users` table in additional places instead of re-parsing the account data. ([\matrix-org#12225](matrix-org#12225)) - Refactor the relations endpoints to add a `RelationsHandler`. ([\matrix-org#12237](matrix-org#12237)) - Generate announcement links in the release script. ([\matrix-org#12242](matrix-org#12242)) - Improve error message when dependencies check finds a broken installation. ([\matrix-org#12244](matrix-org#12244)) - Compress metrics HTTP resource when enabled. Contributed by Nick @ Beeper. ([\matrix-org#12258](matrix-org#12258)) - Refuse to start if the PostgreSQL database has a non-`C` locale, unless the config flag `allow_unsafe_db_locale` is set to true. ([\matrix-org#12262](matrix-org#12262), [\matrix-org#12288](matrix-org#12288)) - Optionally include account validity expiration information to experimental [MSC3720](matrix-org/matrix-spec-proposals#3720) account status responses. ([\matrix-org#12266](matrix-org#12266)) - Add a new cache `_get_membership_from_event_id` to speed up push rule calculations in large rooms. ([\matrix-org#12272](matrix-org#12272)) - Re-enable Complement concurrency in CI. ([\matrix-org#12283](matrix-org#12283)) - Remove unused test utilities. ([\matrix-org#12291](matrix-org#12291)) - Enhance logging for inbound federation events. ([\matrix-org#12301](matrix-org#12301)) - Fix compatibility with the recently-released Jinja 3.1. ([\matrix-org#12313](matrix-org#12313)) - Avoid trying to calculate the state at outlier events. ([\matrix-org#12314](matrix-org#12314))
2 parents bebed48 + ac80bfb commit fa95886

File tree

613 files changed

+32078
-19814
lines changed

Some content is hidden

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

613 files changed

+32078
-19814
lines changed

.ci/scripts/test_export_data_command.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
2121
echo "--- Prepare test database"
2222

2323
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
24-
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
24+
update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
2525

2626
# Run the export-data command on the sqlite test database
2727
python -m synapse.app.admin_cmd -c .ci/sqlite-config.yaml export-data @anon-20191002_181700-832:localhost:8800 \
@@ -41,7 +41,7 @@ fi
4141

4242
# Port the SQLite databse to postgres so we can check command works against postgres
4343
echo "+++ Port SQLite3 databse to postgres"
44-
scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
44+
synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
4545

4646
# Run the export-data command on postgres database
4747
python -m synapse.app.admin_cmd -c .ci/postgres-config.yaml export-data @anon-20191002_181700-832:localhost:8800 \

.ci/scripts/test_old_deps.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
#!/usr/bin/env bash
2-
3-
# this script is run by GitHub Actions in a plain `bionic` container; it installs the
2+
# this script is run by GitHub Actions in a plain `focal` container; it installs the
43
# minimal requirements for tox and hands over to the py3-old tox environment.
54

5+
# Prevent tzdata from asking for user input
6+
export DEBIAN_FRONTEND=noninteractive
7+
68
set -ex
79

810
apt-get update
9-
apt-get install -y python3 python3-dev python3-pip libxml2-dev libxslt-dev xmlsec1 zlib1g-dev tox
11+
apt-get install -y \
12+
python3 python3-dev python3-pip python3-venv \
13+
libxml2-dev libxslt-dev xmlsec1 zlib1g-dev tox libjpeg-dev libwebp-dev
1014

1115
export LANG="C.UTF-8"
1216

1317
# Prevent virtualenv from auto-updating pip to an incompatible version
1418
export VIRTUALENV_NO_DOWNLOAD=1
1519

16-
exec tox -e py3-old,combine
20+
exec tox -e py3-old

.ci/scripts/test_synapse_port_db.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@ python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
2525
echo "--- Prepare test database"
2626

2727
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
28-
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
28+
update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
2929

3030
# Create the PostgreSQL database.
3131
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
3232

3333
echo "+++ Run synapse_port_db against test database"
34-
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
34+
# TODO: this invocation of synapse_port_db (and others below) used to be prepended with `coverage run`,
35+
# but coverage seems unable to find the entrypoints installed by `pip install -e .`.
36+
synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
3537

3638
# We should be able to run twice against the same database.
3739
echo "+++ Run synapse_port_db a second time"
38-
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
40+
synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
3941

4042
#####
4143

@@ -46,12 +48,12 @@ echo "--- Prepare empty SQLite database"
4648
# we do this by deleting the sqlite db, and then doing the same again.
4749
rm .ci/test_db.db
4850

49-
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
51+
update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
5052

5153
# re-create the PostgreSQL database.
5254
.ci/scripts/postgres_exec.py \
5355
"DROP DATABASE synapse" \
5456
"CREATE DATABASE synapse"
5557

5658
echo "+++ Run synapse_port_db against empty database"
57-
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
59+
synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

44
# things to include
55
!docker
6-
!scripts
76
!synapse
87
!MANIFEST.in
98
!README.rst
109
!setup.py
11-
!synctl
1210

1311
**/__pycache__

.flake8

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# TODO: incorporate this into pyproject.toml if flake8 supports it in the future.
2+
# See https://github.com/PyCQA/flake8/issues/234
3+
[flake8]
4+
# see https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
5+
# for error codes. The ones we ignore are:
6+
# W503: line break before binary operator
7+
# W504: line break after binary operator
8+
# E203: whitespace before ':' (which is contrary to pep8?)
9+
# E731: do not assign a lambda expression, use a def
10+
# E501: Line too long (black enforces this for us)
11+
ignore=W503,W504,E203,E731,E501

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Use markdown where necessary, mostly for `code blocks`.
99
- End with either a period (.) or an exclamation mark (!).
1010
- Start with a capital letter.
11+
- Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
1112
* [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
1213
* [ ] [Code style](https://matrix-org.github.io/synapse/latest/code_style.html) is correct
1314
(run the [linters](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

.github/workflows/docker.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
username: ${{ secrets.DOCKERHUB_USERNAME }}
3535
password: ${{ secrets.DOCKERHUB_TOKEN }}
3636

37+
# TODO: consider using https://github.com/docker/metadata-action instead of this
38+
# custom magic
3739
- name: Calculate docker image tag
3840
id: set-tag
3941
run: |
@@ -53,18 +55,6 @@ jobs:
5355
esac
5456
echo "::set-output name=tag::$tag"
5557
56-
# for release builds, we want to get the amd64 image out asap, so first
57-
# we do an amd64-only build, before following up with a multiarch build.
58-
- name: Build and push amd64
59-
uses: docker/build-push-action@v2
60-
if: "${{ startsWith(github.ref, 'refs/tags/v') }}"
61-
with:
62-
push: true
63-
labels: "gitsha1=${{ github.sha }}"
64-
tags: "matrixdotorg/synapse:${{ steps.set-tag.outputs.tag }}"
65-
file: "docker/Dockerfile"
66-
platforms: linux/amd64
67-
6858
- name: Build and push all platforms
6959
uses: docker/build-push-action@v2
7060
with:

.github/workflows/release-artifacts.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
# of things breaking (but only build one set of debs)
88
pull_request:
99
push:
10-
branches: ["develop"]
10+
branches: ["develop", "release-*"]
1111

1212
# we do the full build on tags.
1313
tags: ["v*"]
@@ -31,7 +31,7 @@ jobs:
3131
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
3232
dists='["debian:sid"]'
3333
if [[ $GITHUB_REF == refs/tags/* ]]; then
34-
dists=$(scripts-dev/build_debian_packages --show-dists-json)
34+
dists=$(scripts-dev/build_debian_packages.py --show-dists-json)
3535
fi
3636
echo "::set-output name=distros::$dists"
3737
# map the step outputs to job outputs
@@ -74,7 +74,7 @@ jobs:
7474
# see https://github.com/docker/build-push-action/issues/252
7575
# for the cache magic here
7676
run: |
77-
./src/scripts-dev/build_debian_packages \
77+
./src/scripts-dev/build_debian_packages.py \
7878
--docker-build-arg=--cache-from=type=local,src=/tmp/.buildx-cache \
7979
--docker-build-arg=--cache-to=type=local,mode=max,dest=/tmp/.buildx-cache-new \
8080
--docker-build-arg=--progress=plain \
@@ -91,17 +91,7 @@ jobs:
9191

9292
build-sdist:
9393
name: "Build pypi distribution files"
94-
runs-on: ubuntu-latest
95-
steps:
96-
- uses: actions/checkout@v2
97-
- uses: actions/setup-python@v2
98-
- run: pip install wheel
99-
- run: |
100-
python setup.py sdist bdist_wheel
101-
- uses: actions/upload-artifact@v2
102-
with:
103-
name: python-dist
104-
path: dist/*
94+
uses: "matrix-org/backend-meta/.github/workflows/packaging.yml@v1"
10595

10696
# if it's a tag, create a release and attach the artifacts to it
10797
attach-assets:
@@ -122,7 +112,8 @@ jobs:
122112
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123113
with:
124114
files: |
125-
python-dist/*
115+
Sdist/*
116+
Wheel/*
126117
debs.tar.xz
127118
# if it's not already published, keep the release as a draft.
128119
draft: true

0 commit comments

Comments
 (0)