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

Commit 8895af3

Browse files
committed
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/password_reset_confirmation
* 'develop' of github.com:matrix-org/synapse: (85 commits) Use the default templates when a custom template file cannot be found (#8037) Changelog changes 1.19.0 Convert stream database to async/await. (#8074) Add a shadow-banned flag to users. (#8092) Convert pusher databases to async/await. (#8075) Convert receipts and events databases to async/await. (#8076) Add type hints to synapse.handlers.room (#8090) Remove some unused database functions. (#8085) Convert misc database code to async (#8087) Remove a space at the start of a changelog entry. More changelog tweaks More changelog tweaks Remove unwanted changelog line 1.19.0rc1 Run `remove_push_actions_from_staging` in foreground (#8081) Drop federation transmission queues during a significant remote outage. (#7864) Fix unawaited coroutine error in tests. (#8072) Convert the roommember database to async/await. (#8070) Convert devices database to async/await. (#8069) ...
2 parents 129903e + e04e465 commit 8895af3

File tree

496 files changed

+5482
-5009
lines changed

Some content is hidden

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

496 files changed

+5482
-5009
lines changed

.circleci/config.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@ jobs:
44
machine: true
55
steps:
66
- checkout
7-
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:${CIRCLE_TAG} -t matrixdotorg/synapse:${CIRCLE_TAG}-py3 .
7+
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:${CIRCLE_TAG} .
88
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
99
- run: docker push matrixdotorg/synapse:${CIRCLE_TAG}
10-
- run: docker push matrixdotorg/synapse:${CIRCLE_TAG}-py3
1110
dockerhubuploadlatest:
1211
machine: true
1312
steps:
1413
- checkout
15-
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:latest -t matrixdotorg/synapse:latest-py3 .
14+
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:latest .
1615
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
1716
- run: docker push matrixdotorg/synapse:latest
18-
- run: docker push matrixdotorg/synapse:latest-py3
1917

2018
workflows:
2119
version: 2

.github/ISSUE_TEMPLATE/BUG_REPORT.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ about: Create a report to help us improve
44

55
---
66

7+
<!--
8+
79
**THIS IS NOT A SUPPORT CHANNEL!**
810
**IF YOU HAVE SUPPORT QUESTIONS ABOUT RUNNING OR CONFIGURING YOUR OWN HOME SERVER**,
911
please ask in **#synapse:matrix.org** (using a matrix.org account if necessary)
1012
11-
<!--
12-
1313
If you want to report a security issue, please see https://matrix.org/security-disclosure-policy/
1414
1515
This is a bug report template. By following the instructions below and

CHANGES.md

+74
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
1+
Synapse 1.19.0 (2020-08-17)
2+
===========================
3+
4+
No significant changes since 1.19.0rc1.
5+
6+
Removal warning
7+
---------------
8+
9+
As outlined in the [previous release](https://github.com/matrix-org/synapse/releases/tag/v1.18.0), we are no longer publishing Docker images with the `-py3` tag suffix. On top of that, we have also removed the `latest-py3` tag. Please see [the announcement in the upgrade notes for 1.18.0](https://github.com/matrix-org/synapse/blob/develop/UPGRADE.rst#upgrading-to-v1180).
10+
11+
12+
Synapse 1.19.0rc1 (2020-08-13)
13+
==============================
14+
15+
Features
16+
--------
17+
18+
- Add option to allow server admins to join rooms which fail complexity checks. Contributed by @lugino-emeritus. ([\#7902](https://github.com/matrix-org/synapse/issues/7902))
19+
- Add an option to purge room or not with delete room admin endpoint (`POST /_synapse/admin/v1/rooms/<room_id>/delete`). Contributed by @dklimpel. ([\#7964](https://github.com/matrix-org/synapse/issues/7964))
20+
- Add rate limiting to users joining rooms. ([\#8008](https://github.com/matrix-org/synapse/issues/8008))
21+
- Add a `/health` endpoint to every configured HTTP listener that can be used as a health check endpoint by load balancers. ([\#8048](https://github.com/matrix-org/synapse/issues/8048))
22+
- Allow login to be blocked based on the values of SAML attributes. ([\#8052](https://github.com/matrix-org/synapse/issues/8052))
23+
- Allow guest access to the `GET /_matrix/client/r0/rooms/{room_id}/members` endpoint, according to MSC2689. Contributed by Awesome Technologies Innovationslabor GmbH. ([\#7314](https://github.com/matrix-org/synapse/issues/7314))
24+
25+
26+
Bugfixes
27+
--------
28+
29+
- Fix a bug introduced in Synapse v1.7.2 which caused inaccurate membership counts in the room directory. ([\#7977](https://github.com/matrix-org/synapse/issues/7977))
30+
- Fix a long standing bug: 'Duplicate key value violates unique constraint "event_relations_id"' when message retention is configured. ([\#7978](https://github.com/matrix-org/synapse/issues/7978))
31+
- Fix "no create event in auth events" when trying to reject invitation after inviter leaves. Bug introduced in Synapse v1.10.0. ([\#7980](https://github.com/matrix-org/synapse/issues/7980))
32+
- Fix various comments and minor discrepencies in server notices code. ([\#7996](https://github.com/matrix-org/synapse/issues/7996))
33+
- Fix a long standing bug where HTTP HEAD requests resulted in a 400 error. ([\#7999](https://github.com/matrix-org/synapse/issues/7999))
34+
- Fix a long-standing bug which caused two copies of some log lines to be written when synctl was used along with a MemoryHandler logger. ([\#8011](https://github.com/matrix-org/synapse/issues/8011), [\#8012](https://github.com/matrix-org/synapse/issues/8012))
35+
36+
37+
Updates to the Docker image
38+
---------------------------
39+
40+
- We no longer publish Docker images with the `-py3` tag suffix, as [announced in the upgrade notes](https://github.com/matrix-org/synapse/blob/develop/UPGRADE.rst#upgrading-to-v1180). ([\#8056](https://github.com/matrix-org/synapse/issues/8056))
41+
42+
43+
Improved Documentation
44+
----------------------
45+
46+
- Document how to set up a client .well-known file and fix several pieces of outdated documentation. ([\#7899](https://github.com/matrix-org/synapse/issues/7899))
47+
- Improve workers docs. ([\#7990](https://github.com/matrix-org/synapse/issues/7990), [\#8000](https://github.com/matrix-org/synapse/issues/8000))
48+
- Fix typo in `docs/workers.md`. ([\#7992](https://github.com/matrix-org/synapse/issues/7992))
49+
- Add documentation for how to undo a room shutdown. ([\#7998](https://github.com/matrix-org/synapse/issues/7998), [\#8010](https://github.com/matrix-org/synapse/issues/8010))
50+
51+
52+
Internal Changes
53+
----------------
54+
55+
- Reduce the amount of whitespace in JSON stored and sent in responses. Contributed by David Vo. ([\#7372](https://github.com/matrix-org/synapse/issues/7372))
56+
- Switch to the JSON implementation from the standard library and bump the minimum version of the canonicaljson library to 1.2.0. ([\#7936](https://github.com/matrix-org/synapse/issues/7936), [\#7979](https://github.com/matrix-org/synapse/issues/7979))
57+
- Convert various parts of the codebase to async/await. ([\#7947](https://github.com/matrix-org/synapse/issues/7947), [\#7948](https://github.com/matrix-org/synapse/issues/7948), [\#7949](https://github.com/matrix-org/synapse/issues/7949), [\#7951](https://github.com/matrix-org/synapse/issues/7951), [\#7963](https://github.com/matrix-org/synapse/issues/7963), [\#7973](https://github.com/matrix-org/synapse/issues/7973), [\#7975](https://github.com/matrix-org/synapse/issues/7975), [\#7976](https://github.com/matrix-org/synapse/issues/7976), [\#7981](https://github.com/matrix-org/synapse/issues/7981), [\#7987](https://github.com/matrix-org/synapse/issues/7987), [\#7989](https://github.com/matrix-org/synapse/issues/7989), [\#8003](https://github.com/matrix-org/synapse/issues/8003), [\#8014](https://github.com/matrix-org/synapse/issues/8014), [\#8016](https://github.com/matrix-org/synapse/issues/8016), [\#8027](https://github.com/matrix-org/synapse/issues/8027), [\#8031](https://github.com/matrix-org/synapse/issues/8031), [\#8032](https://github.com/matrix-org/synapse/issues/8032), [\#8035](https://github.com/matrix-org/synapse/issues/8035), [\#8042](https://github.com/matrix-org/synapse/issues/8042), [\#8044](https://github.com/matrix-org/synapse/issues/8044), [\#8045](https://github.com/matrix-org/synapse/issues/8045), [\#8061](https://github.com/matrix-org/synapse/issues/8061), [\#8062](https://github.com/matrix-org/synapse/issues/8062), [\#8063](https://github.com/matrix-org/synapse/issues/8063), [\#8066](https://github.com/matrix-org/synapse/issues/8066), [\#8069](https://github.com/matrix-org/synapse/issues/8069), [\#8070](https://github.com/matrix-org/synapse/issues/8070))
58+
- Move some database-related log lines from the default logger to the database/transaction loggers. ([\#7952](https://github.com/matrix-org/synapse/issues/7952))
59+
- Add a script to detect source code files using non-unix line terminators. ([\#7965](https://github.com/matrix-org/synapse/issues/7965), [\#7970](https://github.com/matrix-org/synapse/issues/7970))
60+
- Log the SAML session ID during creation. ([\#7971](https://github.com/matrix-org/synapse/issues/7971))
61+
- Implement new experimental push rules for some users. ([\#7997](https://github.com/matrix-org/synapse/issues/7997))
62+
- Remove redundant and unreliable signature check for v1 Identity Service lookup responses. ([\#8001](https://github.com/matrix-org/synapse/issues/8001))
63+
- Improve the performance of the register endpoint. ([\#8009](https://github.com/matrix-org/synapse/issues/8009))
64+
- Reduce less useful output in the newsfragment CI step. Add a link to the changelog section of the contributing guide on error. ([\#8024](https://github.com/matrix-org/synapse/issues/8024))
65+
- Rename storage layer objects to be more sensible. ([\#8033](https://github.com/matrix-org/synapse/issues/8033))
66+
- Change the default log config to reduce disk I/O and storage for new servers. ([\#8040](https://github.com/matrix-org/synapse/issues/8040))
67+
- Add an assertion on `prev_events` in `create_new_client_event`. ([\#8041](https://github.com/matrix-org/synapse/issues/8041))
68+
- Add a comment to `ServerContextFactory` about the use of `SSLv23_METHOD`. ([\#8043](https://github.com/matrix-org/synapse/issues/8043))
69+
- Log `OPTIONS` requests at `DEBUG` rather than `INFO` level to reduce amount logged at `INFO`. ([\#8049](https://github.com/matrix-org/synapse/issues/8049))
70+
- Reduce amount of outbound request logging at `INFO` level. ([\#8050](https://github.com/matrix-org/synapse/issues/8050))
71+
- It is no longer necessary to explicitly define `filters` in the logging configuration. (Continuing to do so is redundant but harmless.) ([\#8051](https://github.com/matrix-org/synapse/issues/8051))
72+
- Add and improve type hints. ([\#8058](https://github.com/matrix-org/synapse/issues/8058), [\#8064](https://github.com/matrix-org/synapse/issues/8064), [\#8060](https://github.com/matrix-org/synapse/issues/8060), [\#8067](https://github.com/matrix-org/synapse/issues/8067))
73+
74+
175
Synapse 1.18.0 (2020-07-30)
276
===========================
377

changelog.d/7736.feature

-1
This file was deleted.

changelog.d/7864.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a memory leak by limiting the length of time that messages will be queued for a remote server that has been unreachable.

changelog.d/7899.doc

-1
This file was deleted.

changelog.d/7902.feature

-1
This file was deleted.

changelog.d/7936.misc

-1
This file was deleted.

changelog.d/7952.misc

-1
This file was deleted.

changelog.d/7964.feature

-1
This file was deleted.

changelog.d/7965.misc

-1
This file was deleted.

changelog.d/7970.misc

-1
This file was deleted.

changelog.d/7971.misc

-1
This file was deleted.

changelog.d/7973.misc

-1
This file was deleted.

changelog.d/7975.misc

-1
This file was deleted.

changelog.d/7976.misc

-1
This file was deleted.

changelog.d/7978.bugfix

-1
This file was deleted.

changelog.d/7979.misc

-1
This file was deleted.

changelog.d/7980.bugfix

-1
This file was deleted.

changelog.d/7981.misc

-1
This file was deleted.

changelog.d/7990.doc

-1
This file was deleted.

changelog.d/7992.doc

-1
This file was deleted.

changelog.d/8037.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use the default template file when its equivalent is not found in a custom template directory.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

changelog.d/8081.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix `Re-starting finished log context PUT-nnnn` warning when event persistence failed.

changelog.d/8085.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove some unused database functions.
File renamed without changes.

changelog.d/8090.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add type hints to `synapse.handlers.room`.

changelog.d/8092.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for shadow-banning users (ignoring any message send requests).

debian/changelog

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
matrix-synapse-py3 (1.xx.0) stable; urgency=medium
1+
matrix-synapse-py3 (1.19.0) stable; urgency=medium
22

33
[ Synapse Packaging team ]
4-
* New synapse release 1.xx.0.
4+
* New synapse release 1.19.0.
55

66
[ Aaron Raimist ]
77
* Fix outdated documentation for SYNAPSE_CACHE_FACTOR
88

9-
-- Synapse Packaging team <packages@matrix.org> XXXXX
9+
-- Synapse Packaging team <packages@matrix.org> Mon, 17 Aug 2020 14:06:42 +0100
1010

1111
matrix-synapse-py3 (1.18.0) stable; urgency=medium
1212

docker/conf/log.config

-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@ formatters:
44
precise:
55
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
66

7-
filters:
8-
context:
9-
(): synapse.logging.context.LoggingContextFilter
10-
request: ""
11-
127
handlers:
138
console:
149
class: logging.StreamHandler
1510
formatter: precise
16-
filters: [context]
1711

1812
loggers:
1913
synapse.storage.SQL:

docs/admin_api/shutdown_room.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ You will need to authenticate with an access token for an admin user.
3333
* `message` - Optional. A string containing the first message that will be sent as
3434
`new_room_user_id` in the new room. Ideally this will clearly convey why the
3535
original room was shut down.
36-
36+
3737
If not specified, the default value of `room_name` is "Content Violation
3838
Notification". The default value of `message` is "Sharing illegal content on
3939
othis server is not permitted and rooms in violation will be blocked."
@@ -72,3 +72,30 @@ Response:
7272
"new_room_id": "!newroomid:example.com",
7373
},
7474
```
75+
76+
## Undoing room shutdowns
77+
78+
*Note*: This guide may be outdated by the time you read it. By nature of room shutdowns being performed at the database level,
79+
the structure can and does change without notice.
80+
81+
First, it's important to understand that a room shutdown is very destructive. Undoing a shutdown is not as simple as pretending it
82+
never happened - work has to be done to move forward instead of resetting the past. In fact, in some cases it might not be possible
83+
to recover at all:
84+
85+
* If the room was invite-only, your users will need to be re-invited.
86+
* If the room no longer has any members at all, it'll be impossible to rejoin.
87+
* The first user to rejoin will have to do so via an alias on a different server.
88+
89+
With all that being said, if you still want to try and recover the room:
90+
91+
1. For safety reasons, shut down Synapse.
92+
2. In the database, run `DELETE FROM blocked_rooms WHERE room_id = '!example:example.org';`
93+
* For caution: it's recommended to run this in a transaction: `BEGIN; DELETE ...;`, verify you got 1 result, then `COMMIT;`.
94+
* The room ID is the same one supplied to the shutdown room API, not the Content Violation room.
95+
3. Restart Synapse.
96+
97+
You will have to manually handle, if you so choose, the following:
98+
99+
* Aliases that would have been redirected to the Content Violation room.
100+
* Users that would have been booted from the room (and will have been force-joined to the Content Violation room).
101+
* Removal of the Content Violation room if desired.

docs/reverse_proxy.md

+7
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,10 @@ client IP addresses are recorded correctly.
139139
Having done so, you can then use `https://matrix.example.com` (instead
140140
of `https://matrix.example.com:8448`) as the "Custom server" when
141141
connecting to Synapse from a client.
142+
143+
144+
## Health check endpoint
145+
146+
Synapse exposes a health check endpoint for use by reverse proxies.
147+
Each configured HTTP listener has a `/health` endpoint which always returns
148+
200 OK (and doesn't get logged).

docs/sample_config.yaml

+24-3
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,10 @@ log_config: "CONFDIR/SERVERNAME.log.config"
746746
# - one for ratelimiting redactions by room admins. If this is not explicitly
747747
# set then it uses the same ratelimiting as per rc_message. This is useful
748748
# to allow room admins to deal with abuse quickly.
749+
# - two for ratelimiting number of rooms a user can join, "local" for when
750+
# users are joining rooms the server is already in (this is cheap) vs
751+
# "remote" for when users are trying to join rooms not on the server (which
752+
# can be more expensive)
749753
#
750754
# The defaults are as shown below.
751755
#
@@ -771,6 +775,14 @@ log_config: "CONFDIR/SERVERNAME.log.config"
771775
#rc_admin_redaction:
772776
# per_second: 1
773777
# burst_count: 50
778+
#
779+
#rc_joins:
780+
# local:
781+
# per_second: 0.1
782+
# burst_count: 3
783+
# remote:
784+
# per_second: 0.01
785+
# burst_count: 3
774786

775787

776788
# Ratelimiting settings for incoming federation
@@ -1565,6 +1577,17 @@ saml2_config:
15651577
#
15661578
#grandfathered_mxid_source_attribute: upn
15671579

1580+
# It is possible to configure Synapse to only allow logins if SAML attributes
1581+
# match particular values. The requirements can be listed under
1582+
# `attribute_requirements` as shown below. All of the listed attributes must
1583+
# match for the login to be permitted.
1584+
#
1585+
#attribute_requirements:
1586+
# - attribute: userGroup
1587+
# value: "staff"
1588+
# - attribute: department
1589+
# value: "sales"
1590+
15681591
# Directory in which Synapse will try to find the template files below.
15691592
# If not set, default templates from within the Synapse package will be used.
15701593
#
@@ -1979,9 +2002,7 @@ email:
19792002
# Directory in which Synapse will try to find the template files below.
19802003
# If not set, default templates from within the Synapse package will be used.
19812004
#
1982-
# DO NOT UNCOMMENT THIS SETTING unless you want to customise the templates.
1983-
# If you *do* uncomment it, you will need to make sure that all the templates
1984-
# below are in the directory.
2005+
# Do not uncomment this setting unless you want to customise the templates.
19852006
#
19862007
# Synapse will look for the following templates in this directory:
19872008
#

docs/sample_log_config.yaml

+35-11
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,57 @@ formatters:
1111
precise:
1212
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
1313

14-
filters:
15-
context:
16-
(): synapse.logging.context.LoggingContextFilter
17-
request: ""
18-
1914
handlers:
2015
file:
21-
class: logging.handlers.RotatingFileHandler
16+
class: logging.handlers.TimedRotatingFileHandler
2217
formatter: precise
2318
filename: /var/log/matrix-synapse/homeserver.log
24-
maxBytes: 104857600
25-
backupCount: 10
26-
filters: [context]
19+
when: midnight
20+
backupCount: 3 # Does not include the current log file.
2721
encoding: utf8
22+
23+
# Default to buffering writes to log file for efficiency. This means that
24+
# will be a delay for INFO/DEBUG logs to get written, but WARNING/ERROR
25+
# logs will still be flushed immediately.
26+
buffer:
27+
class: logging.handlers.MemoryHandler
28+
target: file
29+
# The capacity is the number of log lines that are buffered before
30+
# being written to disk. Increasing this will lead to better
31+
# performance, at the expensive of it taking longer for log lines to
32+
# be written to disk.
33+
capacity: 10
34+
flushLevel: 30 # Flush for WARNING logs as well
35+
36+
# A handler that writes logs to stderr. Unused by default, but can be used
37+
# instead of "buffer" and "file" in the logger handlers.
2838
console:
2939
class: logging.StreamHandler
3040
formatter: precise
31-
filters: [context]
3241

3342
loggers:
3443
synapse.storage.SQL:
3544
# beware: increasing this to DEBUG will make synapse log sensitive
3645
# information such as access tokens.
3746
level: INFO
3847

48+
twisted:
49+
# We send the twisted logging directly to the file handler,
50+
# to work around https://github.com/matrix-org/synapse/issues/3471
51+
# when using "buffer" logger. Use "console" to log to stderr instead.
52+
handlers: [file]
53+
propagate: false
54+
3955
root:
4056
level: INFO
41-
handlers: [file, console]
57+
58+
# Write logs to the `buffer` handler, which will buffer them together in memory,
59+
# then write them to a file.
60+
#
61+
# Replace "buffer" with "console" to log to stderr instead. (Note that you'll
62+
# also need to update the configuation for the `twisted` logger above, in
63+
# this case.)
64+
#
65+
handlers: [buffer]
4266

4367
disable_existing_loggers: false

0 commit comments

Comments
 (0)