From a5d0c771a3e47bff314e9fe94838cb1540461da0 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 30 Jan 2019 15:11:18 +0000 Subject: 0.99.0rc1 --- synapse/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse') diff --git a/synapse/__init__.py b/synapse/__init__.py index d6a191ccc6..94d5f6e3b0 100644 --- a/synapse/__init__.py +++ b/synapse/__init__.py @@ -27,4 +27,4 @@ try: except ImportError: pass -__version__ = "0.34.1.1" +__version__ = "0.99.0rc1" -- cgit 1.5.1 From ed8c5e4cda75f120db32c313c7b24bd15659c5e3 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 30 Jan 2019 15:46:27 +0000 Subject: Fix remote invite rejections not comming down sync This was broken in PR #4405, commit 886e5ac, where we changed remote rejections to be outliers. The fix is to explicitly add the leave event in when we know its an out of band invite. We can't always add the event as if the server is/was in the room there might be more events to send down the sync than just the leave. --- synapse/handlers/sync.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'synapse') diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index f7f768f751..28857bfc1c 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -1473,10 +1473,22 @@ class SyncHandler(object): if since_token and since_token.is_after(leave_token): continue + # If this is an out of band message, like a remote invite + # rejection, we include it in the recents batch. Otherwise, we + # let _load_filtered_recents handle fetching the correct + # batches. + # + # This is all screaming out for a refactor, as the logic here is + # subtle and the moving parts numerous. + if leave_event.internal_metadata.is_out_of_band_membership(): + batch_events = [leave_event] + else: + batch_events = None + room_entries.append(RoomSyncResultBuilder( room_id=room_id, rtype="archived", - events=None, + events=batch_events, newly_joined=room_id in newly_joined_rooms, full_state=False, since_token=since_token, -- cgit 1.5.1 From 81b7e7eed323f55d6550e7a270a9dc2c4c7b0fe0 Mon Sep 17 00:00:00 2001 From: Neil Johnson Date: Wed, 30 Jan 2019 16:11:36 +0000 Subject: Update constants.py remove trailing , --- synapse/api/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse') diff --git a/synapse/api/constants.py b/synapse/api/constants.py index 0cbae9429b..fedfb92b3e 100644 --- a/synapse/api/constants.py +++ b/synapse/api/constants.py @@ -109,7 +109,7 @@ class RoomVersions(object): class RoomDisposition(object): - STABLE = "stable", + STABLE = "stable" UNSTABLE = "unstable" -- cgit 1.5.1 From ad7ac8853cab27cb7f5aedcde4f1aaae82f8d5c9 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 30 Jan 2019 16:26:13 +0000 Subject: by default include m.room.encryption on invites (#3902) * by default include m.room.encryption on invites * fix constant * changelog --- changelog.d/3902.feature | 1 + synapse/api/constants.py | 1 + synapse/config/api.py | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 changelog.d/3902.feature (limited to 'synapse') diff --git a/changelog.d/3902.feature b/changelog.d/3902.feature new file mode 100644 index 0000000000..eb8d9f2393 --- /dev/null +++ b/changelog.d/3902.feature @@ -0,0 +1 @@ +Include m.room.encryption on invites by default diff --git a/synapse/api/constants.py b/synapse/api/constants.py index 0cbae9429b..39ff4f62eb 100644 --- a/synapse/api/constants.py +++ b/synapse/api/constants.py @@ -73,6 +73,7 @@ class EventTypes(object): RoomHistoryVisibility = "m.room.history_visibility" CanonicalAlias = "m.room.canonical_alias" RoomAvatar = "m.room.avatar" + RoomEncryption = "m.room.encryption" GuestAccess = "m.room.guest_access" # These are used for validation diff --git a/synapse/config/api.py b/synapse/config/api.py index 403d96ba76..9f25bbc5cb 100644 --- a/synapse/config/api.py +++ b/synapse/config/api.py @@ -24,6 +24,7 @@ class ApiConfig(Config): EventTypes.JoinRules, EventTypes.CanonicalAlias, EventTypes.RoomAvatar, + EventTypes.RoomEncryption, EventTypes.Name, ]) @@ -36,5 +37,6 @@ class ApiConfig(Config): - "{JoinRules}" - "{CanonicalAlias}" - "{RoomAvatar}" + - "{RoomEncryption}" - "{Name}" """.format(**vars(EventTypes)) -- cgit 1.5.1 From b8b898666e61a0151eb3c22653f5c5b3e2f47328 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 30 Jan 2019 16:31:07 +0000 Subject: v0.99.0rc2 --- CHANGES.md | 17 +++++++++++++++++ changelog.d/4527.bugfix | 1 - changelog.d/4528.doc | 1 - synapse/__init__.py | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) delete mode 100644 changelog.d/4527.bugfix delete mode 100644 changelog.d/4528.doc (limited to 'synapse') diff --git a/CHANGES.md b/CHANGES.md index 1b51cbf530..e08b8771b8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,23 @@ +Synapse 0.99.0rc2 (2019-01-30) +============================== + +Bugfixes +-------- + +- Fix bug when rejecting remote invites. ([\#4527](https://github.com/matrix-org/synapse/issues/4527)) +- Fix incorrect rendering of server capabilities. ([81b7e7eed](https://github.com/matrix-org/synapse/commit/81b7e7eed323f55d6550e7a270a9dc2c4c7b0fe0)) + +Improved Documentation +---------------------- + +- Add documentation on enabling ACME support when upgrading to v0.99. ([\#4528](https://github.com/matrix-org/synapse/issues/4528)) + + Synapse 0.99.0rc1 (2019-01-30) ============================== +Synapse v0.99.x is a precursor to the upcoming Synapse v1.0 release. It contains foundational changes to room architecture and the federation security model necessary to support the upcoming r0 release of the Server to Server API. + Features -------- diff --git a/changelog.d/4527.bugfix b/changelog.d/4527.bugfix deleted file mode 100644 index 974d799b88..0000000000 --- a/changelog.d/4527.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix bug when rejecting remote invites diff --git a/changelog.d/4528.doc b/changelog.d/4528.doc deleted file mode 100644 index 432ef55aa6..0000000000 --- a/changelog.d/4528.doc +++ /dev/null @@ -1 +0,0 @@ -Add documentation on enabling ACME support when upgrading to v0.99. diff --git a/synapse/__init__.py b/synapse/__init__.py index 94d5f6e3b0..5da59aa924 100644 --- a/synapse/__init__.py +++ b/synapse/__init__.py @@ -27,4 +27,4 @@ try: except ImportError: pass -__version__ = "0.99.0rc1" +__version__ = "0.99.0rc2" -- cgit 1.5.1 From 563f6a832b379e2cde6b5618a7c344c2bcd793a1 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Thu, 31 Jan 2019 11:44:04 +0000 Subject: Reject large transactions on federation (#4513) * Reject large transactions on federation * Add changelog * lint * Simplify large transaction handling --- changelog.d/4513.misc | 1 + synapse/federation/federation_server.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 changelog.d/4513.misc (limited to 'synapse') diff --git a/changelog.d/4513.misc b/changelog.d/4513.misc new file mode 100644 index 0000000000..1f64a96465 --- /dev/null +++ b/changelog.d/4513.misc @@ -0,0 +1 @@ +Reject federation transactions if they include more than 50 PDUs or 100 EDUs. \ No newline at end of file diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index aeadc9c564..3da86d4ba6 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -148,6 +148,22 @@ class FederationServer(FederationBase): logger.debug("[%s] Transaction is new", transaction.transaction_id) + # Reject if PDU count > 50 and EDU count > 100 + if (len(transaction.pdus) > 50 + or (hasattr(transaction, "edus") and len(transaction.edus) > 100)): + + logger.info( + "Transaction PDU or EDU count too large. Returning 400", + ) + + response = {} + yield self.transaction_actions.set_response( + origin, + transaction, + 400, response + ) + defer.returnValue((400, response)) + received_pdus_counter.inc(len(transaction.pdus)) origin_host, _ = parse_server_name(origin) -- cgit 1.5.1