Compare commits

...

792 Commits

Author SHA1 Message Date
Andrew Morgan
20fc57683c log exceptions in _async_write_json_to_request_in_thread 2022-01-20 17:42:01 +00:00
Andrew Morgan
d1e6333f12 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2022-01-19 12:44:55 +00:00
Andrew Morgan
7ad7a47e5a Add missing auto_attribs=True to the _WrappedRustReporter class (#11768) 2022-01-19 12:39:11 +00:00
Andrew Morgan
20d4418485 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2022-01-19 10:59:51 +00:00
Philippe Daouadi
15ffc4143c Fix preview of imgur and Tenor URLs. (#11669)
By scraping Open Graph information from the HTML even
when an autodiscovery endpoint is found. The results are
then combined to capture as much information as possible
from the page.
2022-01-18 13:20:24 -05:00
Andrew Morgan
9eab71aa93 Merge branch 'master' into develop 2022-01-18 16:46:39 +00:00
Patrick Cloke
68acb0a29d Include whether the requesting user has participated in a thread. (#11577)
Per updates to MSC3440.

This is implement as a separate method since it needs to be cached
on a per-user basis, instead of a per-thread basis.
2022-01-18 11:38:57 -05:00
Andrew Morgan
fd05a3ed03 Wording fixes to 1.50.0/1 changelog entries 2022-01-18 16:13:54 +00:00
Andrew Morgan
9d0098595e Reword 1.50.0 warning a bit in the changelog 2022-01-18 16:11:38 +00:00
Andrew Morgan
ab12c909a2 1.50.1 2022-01-18 16:09:04 +00:00
Andrew Morgan
d93ec0a0ba Partially revert #11602 to prevent webclient overriding client resource (#11764) 2022-01-18 16:03:56 +00:00
Richard van der Hoff
251b5567ec Remove log_function and its uses (#11761)
I've never found this terribly useful. I think it was added in the early days
of Synapse, without much thought as to what would actually be useful to log,
and has just been cargo-culted ever since.

Rather, it tends to clutter up debug logs with useless information.
2022-01-18 13:06:04 +00:00
Andrew Morgan
47961ea855 Merge branch 'master' into develop 2022-01-18 11:46:24 +00:00
Andrew Morgan
4ec0a309cf Move python/postgres deprecation notice to the top of 1.50 changelog 2022-01-18 10:47:23 +00:00
Andrew Morgan
3ba9389699 1.50.0 2022-01-18 10:41:36 +00:00
lukasdenk
d8be9924ef Add a flag to the synapse_review_recent_signups script to ignore and filter appservice users. (#11675) 2022-01-17 16:43:25 +00:00
AndrewFerr
cefd4b87a3 Warn against using Let's Encrypt certs for encrypted TURN (#11686)
* Warn against using Let's Encrypt certs for encrypted TURN

This helps to avoid client-side issues:
* https://github.com/vector-im/element-android/issues/1533
* https://github.com/vector-im/element-ios/issues/2712

Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
2022-01-17 15:13:09 +00:00
Richard van der Hoff
86615aa965 Fix up docs for track_puppeted_user_ips (again) (#11757)
Fixes #11741
2022-01-17 14:55:30 +00:00
Richard van der Hoff
b0352f9c08 Update documentation for configuring facebook login (#11755)
... and a minor thinko fix in the sample config.
2022-01-17 12:35:00 +00:00
Richard van der Hoff
6a78ede569 Improve reactor_tick_time metric (#11724)
The existing implementation of the `python_twisted_reactor_tick_time` metric is pretty useless, because it *only* 
measures the time taken to execute timed calls and callbacks from threads. That neglects everything that 
happens off the back of I/O, which is obviously quite a lot for us.

To improve this, I've hooked into a different place in the reactor - in particular, where it calls `epoll`. That call is 
the only place it should wait for something to happen - the rest of the loop *should* be quick.

I've also removed `python_twisted_reactor_pending_calls`, because I don't believe anyone ever looks at it, and
it's a nuisance to populate.
2022-01-17 12:14:40 +00:00
Daniel Sonck
6b241f5286 Make pagination of rooms in admin api stable (#11737)
Always add state.room_id after the configurable ORDER BY. Otherwise,
for any sort, certain pages can contain results from
other pages. (Especially when sorting by creator, since there may
be many rooms by the same creator)

* Document different order direction of numerical fields

"joined_members", "joined_local_members", "version" and "state_events"
are ordered in descending direction by default (dir=f). Added a note
in tests to explain the differences in ordering.

Signed-off-by: Daniël Sonck <daniel@sonck.nl>
2022-01-17 11:42:51 +00:00
Olivier Wilkinson (reivilibre)
e7da1ced24 Merge branch 'release-v1.50' into develop 2022-01-14 15:25:16 +00:00
Andrew Morgan
18862f20b5 Remove the 'password_hash' from the Users Admin API endpoint response dictionary (#11576) 2022-01-14 14:53:33 +00:00
Jason Robinson
904bb04409 Fix sample_config.yaml in regards track_puppeted_user_ips (#11749)
* Fix sample_config.yaml in regards track_puppeted_user_ips

Closes #11741

Signed-off-by: Jason Robinson <jasonr@matrix.org>
2022-01-14 14:11:55 +00:00
Olivier Wilkinson (reivilibre)
422e33fabf Tweak the changelog summary section 2022-01-14 12:08:14 +00:00
Olivier Wilkinson (reivilibre)
867443472c 1.50.0rc2 2022-01-14 11:34:57 +00:00
Olivier Wilkinson (reivilibre)
8e8a00829f Merge branch 'release-v1.50' into matrix-org-hotfixes 2022-01-14 10:51:50 +00:00
Patrick Cloke
3e0536cd2a Replace uses of simple_insert_many with simple_insert_many_values. (#11742)
This should be (slightly) more efficient and it is simpler
to have a single method for inserting multiple values.
2022-01-13 19:44:18 -05:00
David Robertson
d70169bf9b Fix missing app variable in mail subject (#11745)
documentation claims that you can use the %(app)s variable in password_reset and email_validation subjects, but if you do you end up with an error 500

Co-authored-by: br4nnigan <10244835+br4nnigan@users.noreply.github.com>
2022-01-13 20:19:10 +00:00
David Robertson
4ca8fcdd5a Invite PR submitters to credit themselves (#11744)
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2022-01-13 18:12:59 +00:00
reivilibre
b602ba194b Fix a bug introduced in Synapse v1.50.0rc1 whereby outbound federation could fail because too many EDUs were produced for device updates. (#11730)
Co-authored-by: David Robertson <davidr@element.io>
2022-01-13 18:12:18 +00:00
qwertyforce
b9632046fb update room spec url in config files (#11739)
* change spec url in config files

* Create 11739.txt

* .txt -> .doc
2022-01-13 17:09:15 +00:00
Andy Balaam
5ff5f17377 Mention python3-venv and libpq-dev dependencies in contribution guide (#11740) 2022-01-13 16:33:37 +00:00
Patrick Cloke
0c40c619aa Include bundled aggregations in the sync response cache. (#11659) 2022-01-13 10:45:28 -05:00
Richard van der Hoff
20c6d85c6e Simplify GC prometheus metrics (#11723)
Rather than hooking into the reactor loop, just add a timed task that runs every 100 ms to do the garbage collection.

Part 1 of a quest to simplify the reactor monkey-patching.
2022-01-13 14:35:52 +00:00
Patrick Cloke
10a88ba91c Use auto_attribs/native type hints for attrs classes. (#11692) 2022-01-13 13:49:28 +00:00
Andy Balaam
b92a2ff797 Fix typo in demo docs: differnt (#11735) 2022-01-13 13:10:42 +00:00
Jason Robinson
2560b1b6b2 Allow tracking puppeted users for MAU (#11561)
Currently when puppeting another user, the user doing the puppeting is
tracked for client IPs and MAU (if configured).

When tracking MAU is important, it becomes necessary to be possible to
also track the client IPs and MAU of puppeted users. As an example a
client that manages user creation and creation of tokens via the Synapse
admin API, passing those tokens for the client to use.

This PR adds optional configuration to enable tracking of puppeted users
into monthly active users. The default behaviour stays the same.

Signed-off-by: Jason Robinson <jasonr@matrix.org>
2022-01-12 16:09:36 +00:00
reivilibre
22abfca8d9 Fix a bug introduced in Synapse v1.0.0 whereby device list updates would not be sent to remote homeservers if there were too many to send at once. (#11729)
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2022-01-12 15:21:13 +00:00
David Robertson
1b1aed38e3 Deal with mypy errors w/ type-hinted pynacl 1.5.0 (#11714)
* Deal with mypy errors w/ type-hinted pynacl 1.5.0

Fixes #11644.

I really don't like that we're monkey patching pynacl SignedKey
instances with alg and version objects. But I'm too scared to make the
changes necessary right now.

(Ideally I would replace `signedjson.types.SingingKey` with a runtime class which
wraps or inherits from `nacl.signing.SigningKey`.) C.f. https://github.com/matrix-org/python-signedjson/issues/16
2022-01-12 14:54:06 +00:00
haslersn
2185b28184 Fix documentation of supported PostgreSQL version (#11725)
Signed-off-by: Sebastian Hasler <sebastian.hasler@stuvus.uni-stuttgart.de>
2022-01-12 14:45:13 +00:00
haslersn
99ba5ae7b7 Fix documentation of supported PostgreSQL version (#11725)
Signed-off-by: Sebastian Hasler <sebastian.hasler@stuvus.uni-stuttgart.de>
2022-01-12 14:43:48 +00:00
Richard van der Hoff
d41c4654db Use buildkit's cache feature to speed up docker builds (#11691)
Having spent much of the last week attempting to run complement tests from somewhere with damp string instead of internet... something had to be done.
2022-01-12 10:37:57 +00:00
Michael Kaye
338e70c617 Complement environment variable name change and update .gitignore. (#11718) 2022-01-10 23:18:56 +00:00
Andrew Morgan
7c3408d1a8 Document the SYNAPSE_TEST_PERSIST_SQLITE_DB unit test env var (#11715) 2022-01-10 17:06:42 +00:00
reivilibre
ffd227c382 Fix docstring on add_account_data_for_user. (#11716) 2022-01-10 15:38:22 +00:00
David Robertson
c43dd4d01b Deal with mypy errors w/ type-hinted pynacl 1.5.0 (#11714)
* Deal with mypy errors w/ type-hinted pynacl 1.5.0

Fixes #11644.

I really don't like that we're monkey patching pynacl SignedKey
instances with alg and version objects. But I'm too scared to make the
changes necessary right now.

(Ideally I would replace `signedjson.types.SingingKey` with a runtime class which
wraps or inherits from `nacl.signing.SigningKey`.) C.f. https://github.com/matrix-org/python-signedjson/issues/16
2022-01-10 13:40:46 +00:00
kegsay
3be63654e4 Prettier complement logs (#11707)
* Prettier complement logs

* Changelog
2022-01-10 11:46:40 +00:00
Patrick Cloke
8e57584a58 Support spaces with > 50 rooms in the /hierarchy endpoint. (#11695)
By returning all of the m.space.child state of the space, not just
the first 50. The number of rooms returned is still capped at 50.

For the federation API this implies that the requesting server will
need to individually query for any other rooms it is not joined to.
2022-01-07 19:27:58 -05:00
David Robertson
d3cf0730f8 Optionally use an on-disk sqlite db in tests (#11702)
* Optionally use an on-disk sqlite db in tests

When debugging a test it is sometimes useful to inspect the state of the
DB. This is not easy when the db is in-memory: one cannot attach the
sqlite CLI to another process's DB.

With this change, if SYNAPSE_TEST_PERSIST_SQLITE_DB is set, we use
 `_trial_temp/test.db` as our sqlite database. One can then use 
`sqlite3 _trial_temp/test.db` and query to your heart's content.

The DB is destroyed and recreated between different test cases.

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2022-01-07 19:13:41 +00:00
David Robertson
2bb4bd1269 Test that bans win a join against a race when computing /sync response (#11701) 2022-01-07 16:43:21 +00:00
Olivier Wilkinson (reivilibre)
6a04767439 Merge branch 'release-v1.50' into develop 2022-01-07 14:22:13 +00:00
Patrick Cloke
6bf81a7a61 Bundle aggregations outside of the serialization method. (#11612)
This makes the serialization of events synchronous (and it no
longer access the database), but we must manually calculate and
provide the bundled aggregations.

Overall this should cause no change in behavior, but is prep work
for other improvements.
2022-01-07 09:10:46 -05:00
Olivier Wilkinson (reivilibre)
7fe7c45438 Move changelog entry for drop of support to 'Deprecations and Removals' 2022-01-07 12:51:20 +00:00
Richard van der Hoff
5cc41f1b05 Updates to opentracing hackery 2022-01-07 12:49:54 +00:00
Richard van der Hoff
99e7fb1d52 Wrap connection.commit with OpenTracing
This is an attempt to diagnose poor apdex levels, per
https://github.com/matrix-org/internal-config/issues/1181
2022-01-07 11:53:28 +00:00
Patrick Cloke
6c68e874b1 Remove the /send_relation endpoint. (#11682)
This was removed from MSC2674 before that was approved
and is not used by any known clients.
2022-01-06 19:00:34 +00:00
Patrick Cloke
201c48c8de Remove a Python 2-ism and improve type hints. (#11699)
On Python 2, indexing a byte-string gives back a byte-string,
while on Python 3 it gives back the ASCII equivalent as an int.
2022-01-06 18:08:48 +00:00
Olivier Wilkinson (reivilibre)
e87540abb1 Re-run Towncrier to add in the changelog entry for the Mjolnir workaround 2022-01-06 17:54:21 +00:00
Shay
70ce9aea71 Strip unauthorized fields from unsigned object in events received over federation (#11530)
* add some tests to verify we are stripping unauthorized fields out of unsigned

* add function to strip unauthorized fields from the unsigned object of event

* newsfragment

* update newsfragment number

* add check to on_send_membership_event

* refactor tests

* fix lint error

* slightly refactor tests and add some comments

* slight refactor

* refactor tests

* fix import error

* slight refactor

* remove unsigned filtration code from synapse/handlers/federation_event.py

* lint

* move unsigned filtering code to event base

* refactor tests

* update newsfragment

* requested changes

* remove unused retun values
2022-01-06 09:09:30 -08:00
Olivier Wilkinson (reivilibre)
1a776f6710 Merge branch 'release-v1.50' into matrix-org-hotfixes 2022-01-06 16:37:36 +00:00
reivilibre
eec34b1f2a Work around Mjolnir compatibility issue by adding an import for glob_to_regex in synapse.util, where it moved from. (#11696) 2022-01-06 16:36:26 +00:00
lukasdenk
2ef1fea8d2 Make room creations denied by user_may_create_room cause an M_FORBIDDEN error to be returned, not M_UNKNOWN (#11672)
Co-authored-by: reivilibre <olivier@librepush.net>
2022-01-06 13:16:42 +00:00
David Robertson
c9eb678b73 Remove debug logging for #4422 (#11693)
as per
https://github.com/matrix-org/synapse/pull/11532#discussion_r769123269
2022-01-06 12:44:36 +00:00
Travis Ralston
feb3e006d7 Fix space hierarchy endpoint to match MSC2946 (#11667)
Fixes minor discrepancies between the /hierarchy endpoint described
in MSC2946 and the implementation.

Note that the changes impact the stable and unstable /hierarchy and
unstable /spaces endpoints for both client and federation APIs.
2022-01-05 20:33:43 +00:00
Dirk Klimpel
3b51c763ba Fix get federation status of destination if no error occured (#11593) 2022-01-05 14:46:50 -05:00
Olivier Wilkinson (reivilibre)
daea7bcc34 Tweak changelog for #11677 2022-01-05 18:16:10 +00:00
Shay
d8f94eeec2 Run pyupgrade --py37-plus --keep-percent-format on Synapse (#11685)
* newsfragment

* fix newsfragment number

* update changelog

* remove extra space
2022-01-05 09:53:05 -08:00
Patrick Cloke
83acdb23fe Re-run towncrier. 2022-01-05 12:09:15 -05:00
Patrick Cloke
877b45e812 Include io.element.thread capability for MSC3440. (#11690) 2022-01-05 12:08:03 -05:00
Olivier Wilkinson (reivilibre)
717a5c085a Merge branch 'release-v1.50' into matrix-org-hotfixes 2022-01-05 14:19:39 +00:00
Olivier Wilkinson (reivilibre)
102f4d3598 Mention drop of support in changelog 2022-01-05 14:14:57 +00:00
Olivier Wilkinson (reivilibre)
ffd71029ab Add support removal notice to the upgrade notes 2022-01-05 14:14:16 +00:00
Olivier Wilkinson (reivilibre)
5f98d8e6fd Tweak changelog 2022-01-05 14:05:15 +00:00
David Robertson
88a78c6577 Cache empty responses from /user/devices (#11587)
If we've never made a request to a remote homeserver, we should cache the response---even if the response is "this user has no devices".
2022-01-05 13:33:28 +00:00
Olivier Wilkinson (reivilibre)
9be5aacc2d 1.50.0rc1 2022-01-05 12:39:48 +00:00
Richard van der Hoff
0fb3dd0830 Refactor the way we set outlier (#11634)
* `_auth_and_persist_outliers`: mark persisted events as outliers

Mark any events that get persisted via `_auth_and_persist_outliers` as, well,
outliers.

Currently this will be a no-op as everything will already be flagged as an
outlier, but I'm going to change that.

* `process_remote_join`: stop flagging as outlier

The events are now flagged as outliers later on, by `_auth_and_persist_outliers`.

* `send_join`: remove `outlier=True`

The events created here are returned in the result of `send_join` to
`FederationHandler.do_invite_join`. From there they are passed into
`FederationEventHandler.process_remote_join`, which passes them to
`_auth_and_persist_outliers`... which sets the `outlier` flag.

* `get_event_auth`: remove `outlier=True`

stop flagging the events returned by `get_event_auth` as outliers. This method
is only called by `_get_remote_auth_chain_for_event`, which passes the results
into `_auth_and_persist_outliers`, which will flag them as outliers.

* `_get_remote_auth_chain_for_event`: remove `outlier=True`

we pass all the events into `_auth_and_persist_outliers`, which will now flag
the events as outliers.

* `_check_sigs_and_hash_and_fetch`: remove unused `outlier` parameter

This param is now never set to True, so we can remove it.

* `_check_sigs_and_hash_and_fetch_one`: remove unused `outlier` param

This is no longer set anywhere, so we can remove it.

* `get_pdu`: remove unused `outlier` parameter

... and chase it down into `get_pdu_from_destination_raw`.

* `event_from_pdu_json`: remove redundant `outlier` param

This is never set to `True`, so can be removed.

* changelog

* update docstring
2022-01-05 12:26:11 +00:00
Philipp Matthias Schäfer
eedb4527f1 Fix link from generated configuration file to documentation (#11678)
Co-authored-by: reivilibre <olivier@librepush.net>
Co-authored-by: reivilibre <oliverw@matrix.org>
2022-01-05 12:16:52 +00:00
Fr3shTea
0201c6371c Fix SimpleHttpClient not sending Accept header in get_json (#11677)
Co-authored-by: reivilibre <olivier@librepush.net>
2022-01-05 11:59:29 +00:00
Dirk Klimpel
7a1cefc6e3 Add admin API to get users' account data (#11664)
Co-authored-by: reivilibre <olivier@librepush.net>
2022-01-05 11:49:06 +00:00
reivilibre
84bfe47b01 Re-apply: Move glob_to_regex and re_word_boundary to matrix-python-common #11505 (#11687)
Co-authored-by: Sean Quah <seanq@element.io>
2022-01-05 11:41:49 +00:00
reivilibre
84d790a32e Clarify SSO mapping provider documentation by writing def or async def before the names of methods, as appropriate. (#11681) 2022-01-05 11:25:32 +00:00
Callum Macdonald
7013e06e2f Improve Docker docs for use with Postgres (#11640) 2022-01-05 10:50:28 +00:00
Donny Johnson
0715e77b06 Correct Synapse install command for FreeBSD. (#11267)
Co-authored-by: reivilibre <olivier@librepush.net>
2022-01-05 10:38:51 +00:00
Richard van der Hoff
79f6d3550a update ngnix reverse-proxy example (#11680)
this should not be a case-insensitive match.
2022-01-04 22:31:45 +00:00
Richard van der Hoff
b38bdae3a2 Fix AssertionErrors after purging events (#11642)
* Fix AssertionErrors after purging events

If you purged a bunch of events from your database, and then restarted synapse
without receiving more events, then you would get a bunch of AssertionErrors on
restart.

This fixes the situation by rewinding the stream processors.

* `check-newsfragment`: ignore deleted newsfiles
2022-01-04 16:36:33 +00:00
Richard van der Hoff
878aa55293 FederationClient.backfill: stop flagging events as outliers (#11632)
Events returned by `backfill` should not be flagged as outliers.

Fixes:

```
AssertionError: null
  File "synapse/handlers/federation.py", line 313, in try_backfill
    dom, room_id, limit=100, extremities=extremities
  File "synapse/handlers/federation_event.py", line 517, in backfill
    await self._process_pulled_events(dest, events, backfilled=True)
  File "synapse/handlers/federation_event.py", line 642, in _process_pulled_events
    await self._process_pulled_event(origin, ev, backfilled=backfilled)
  File "synapse/handlers/federation_event.py", line 669, in _process_pulled_event
    assert not event.internal_metadata.is_outlier()
```

See https://sentry.matrix.org/sentry/synapse-matrixorg/issues/231992

Fixes #8894.
2022-01-04 16:31:32 +00:00
Richard van der Hoff
2359ee3864 Remove redundant get_current_events_token (#11643)
* Push `get_room_{min,max_stream_ordering}` into StreamStore

Both implementations of this are identical, so we may as well push it down and
get rid of the abstract base class nonsense.

* Remove redundant `StreamStore` class

This is empty now

* Remove redundant `get_current_events_token`

This was an exact duplicate of `get_room_max_stream_ordering`, so let's get rid
of it.

* newsfile
2022-01-04 16:10:27 +00:00
Richard van der Hoff
bd9821f7f1 Better error messages from get_create_event_for_room (#11638)
"Unknown room" can mean a multitude of things here. To help with debugging, add
some more words to the exception text.
2022-01-04 16:10:05 +00:00
Patrick Cloke
8422a7f7f6 Include the topic event in the prejoin state, per MSC3173. (#11666)
Invites and knocks will now include the topic in the stripped state
send to clients before joining the room.
2022-01-04 11:08:08 -05:00
Shay
13c974ed35 Drop Bionic from Debian builds (#11633)
* update Trove classifiers to remove py36

* stop building bionic

* update dh-virtualenv

* newsfragment

* fix newsfragment

* update version refs

* another try at correct tag

* Update changelog
2022-01-03 11:17:16 -08:00
Patrick Cloke
cbd82d0b2d Convert all namedtuples to attrs. (#11665)
To improve type hints throughout the code.
2021-12-30 18:47:12 +00:00
Dirk Klimpel
07a3b5daba Add type hints to synapse/storage/databases/main/events_bg_updates.py (#11654) 2021-12-30 07:22:31 -05:00
reivilibre
2c7f5e74e5 Fix a type annotation in test_account_data.py and remove it from the Mypy exclusion list. (#11657)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-12-29 15:12:30 +00:00
Dirk Klimpel
f82d38ed2e Improve type hints in storage classes. (#11652)
By using cast and making ignores more specific.
2021-12-29 13:04:28 +00:00
Patrick Cloke
f58b300d27 Do not attempt to bundled aggregations for /members and /state. (#11623)
Both of those APIs return state events, which will not have bundled
aggregations added anyway.
2021-12-29 08:02:03 -05:00
Dirk Klimpel
15bb1c8511 Add type hints to synapse/storage/databases/main/stats.py (#11653) 2021-12-29 08:01:13 -05:00
Shay
fcfe67578f Update to the current version of Black and run it on Synapse codebase (#11596)
* update black version

* run updated version of black on code

* newsfragment

* enumerate python versions
2021-12-23 20:22:15 -08:00
Patrick Cloke
66d7aa783a Fix mypy error with opentracing.tags. (#11622) 2021-12-23 11:47:24 +00:00
AndrewFerr
c500bf37d6 Add details for how to set up TURN behind NAT (#11553)
Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
2021-12-23 10:42:50 +00:00
Shay
87da37374a Drop EOL python 3.6 from CI (#11595)
* remove python 3.6 and postgres 9.6 from github workflow

* remove python 3.6 env from tox

* newsfragment

* correct postgres version

* add py310 to tox env list
2021-12-21 11:37:04 -08:00
Richard van der Hoff
144b9ede89 Merge branch 'master' into develop 2021-12-21 18:13:05 +00:00
Richard van der Hoff
9ec46d6231 Merge branch 'release-v1.49' 2021-12-21 18:12:18 +00:00
Richard van der Hoff
6b6dcdc338 update changelog
postgres 10 _+_
2021-12-21 17:41:34 +00:00
Richard van der Hoff
aa874a1390 1.49.2 2021-12-21 17:32:16 +00:00
Richard van der Hoff
2bf31f7807 Pin to frozendict<2.1.2 (#11625)
... to work around breakage on buster
(https://github.com/Marco-Sulla/python-frozendict/issues/41)
2021-12-21 17:26:04 +00:00
reivilibre
e6897e7383 Refactor tests.util.setup_test_homeserver and tests.server.setup_test_homeserver. (#11503) 2021-12-21 16:12:05 +00:00
Patrick Cloke
b6102230a7 Add type hints to event_push_actions. (#11594) 2021-12-21 13:25:34 +00:00
Richard van der Hoff
57ca8ab10f Add notes about dropping support for Python 3.6 and Postgres 9.6. 2021-12-21 12:06:31 +00:00
Richard van der Hoff
aa58e8a28a typopo 2021-12-21 11:24:24 +00:00
Richard van der Hoff
b9f2f6d3c4 more words 2021-12-21 11:23:35 +00:00
Richard van der Hoff
2215954147 Various opentracing enhancements (#11619)
* Wrap `auth.get_user_by_req` in an opentracing span

give `get_user_by_req` its own opentracing span, since it can result in a
non-trivial number of sub-spans which it is useful to group together.

This requires a bit of reorganisation because it also sets some tags (and may
force tracing) on the servlet span.

* Emit opentracing span for encoding json responses

This can be a significant time sink.

* Rename all sync spans with a prefix

* Write an opentracing span for encoding sync response

* opentracing span to group generate_room_entries

* opentracing spans within sync.encode_response

* changelog

* Use the `trace` decorator instead of context managers
2021-12-21 11:10:36 +00:00
Richard van der Hoff
8c36d332d5 1.49.1 2021-12-21 11:07:41 +00:00
Patrick Cloke
dd47788752 Do not bundle aggregations for APIs which shouldn't include them. (#11592)
And make bundling aggregations opt-in, instead of opt-out to avoid
having APIs to include extraneous data (and being much heavier than
necessary).
2021-12-20 14:14:38 -05:00
Richard van der Hoff
c3e38b88f2 Improve opentracing support for ResponseCache (#11607)
This adds some opentracing annotations to ResponseCache, to make it easier to see what's going on; in particular, it adds a link back to the initial trace which is actually doing the work of generating the response.
2021-12-20 18:12:08 +00:00
Richard van der Hoff
60fa4935b5 Improve opentracing for incoming HTTP requests (#11618)
* remove `start_active_span_from_request`

Instead, pull out a separate function, `span_context_from_request`, to extract
the parent span, which we can then pass into `start_active_span` as
normal. This seems to be clearer all round.

* Remove redundant tags from `incoming-federation-request`

These are all wrapped up inside a parent span generated in AsyncResource, so
there's no point duplicating all the tags that are set there.

* Leave request spans open until the request completes

It may take some time for the response to be encoded into JSON, and that JSON
to be streamed back to the client, and really we want that inside the top-level
span, so let's hand responsibility for closure to the SynapseRequest.

* opentracing logs for HTTP request events

* changelog
2021-12-20 17:45:03 +00:00
Richard van der Hoff
8e4083e2f6 Merge remote-tracking branch 'origin/release-v1.49' into develop 2021-12-20 16:34:01 +00:00
Richard van der Hoff
76aa5537ad Disable aggregation bundling on /sync responses (#11583)
* Disable aggregation bundling on `/sync` responses

A partial revert of #11478. This turns out to have had a significant CPU impact
on initial-sync handling. For now, let's disable it, until we find a more
efficient way of achieving this.

* Fix tests.

Co-authored-by: Patrick Cloke <patrickc@matrix.org>
2021-12-20 16:33:35 +00:00
Patrick Cloke
3e0cfd447e Return JSON errors for unknown resources under /matrix/client. (#11602)
Instead of returning 404 errors with HTML bodies when an unknown
prefix was requested (e.g. /matrix/client/v1 before Synapse v1.49.0).
2021-12-20 16:00:13 +00:00
V02460
7a7ca8f226 Use mock from standard library (#11588)
Instead of the backported version.
2021-12-20 10:34:46 -05:00
Shay
8ad39438fa Add opentracing types (#11603) 2021-12-20 12:18:09 +00:00
Dirk Klimpel
8428ef66c7 Add type hints to synapse/tests/rest/admin (#11590) 2021-12-16 14:59:56 -05:00
Dirk Klimpel
1847d027e6 Add type hints to synapse/storage/databases/main/transactions.py (#11589) 2021-12-16 14:59:35 -05:00
Eric Eastwood
43f5cc7adc Add MSC2716 and MSC3030 to /versions -> unstable_features (#11582)
As suggested in https://github.com/matrix-org/matrix-react-sdk/pull/7372#discussion_r769523369
2021-12-16 11:25:37 -06:00
Sean Quah
c7fe32edb4 Add type hints to synapse/storage/databases/main/room.py (#11575) 2021-12-15 18:00:48 +00:00
Patrick Cloke
f901f8b70e Require Collections as the parameters for simple_* methods. (#11580)
Instead of Iterable since the generators are not allowed due
to the potential for their re-use.
2021-12-15 17:00:50 +00:00
Patrick Cloke
323151b787 Convert EventStreamResult to attrs. (#11574) 2021-12-15 11:10:02 -05:00
Richard van der Hoff
59544678a1 Merge branch 'rav/no_bundle_aggregations_in_sync' into matrix-org-hotfixes 2021-12-15 13:13:08 +00:00
Richard van der Hoff
a9c146ac53 Disable aggregation bundling on /sync responses
A partial revert of #11478. This turns out to have had a significant CPU impact
on initial-sync handling. For now, let's disable it, until we find a more
efficient way of achieving this.
2021-12-15 13:10:25 +00:00
reivilibre
17886d2603 Add experimental support for MSC3202: allowing application services to masquerade as specific devices. (#11538) 2021-12-15 10:40:52 +00:00
Sean Quah
ecfcd9bbbe Add type hints to synapse/storage/databases/main/e2e_room_keys.py (#11549) 2021-12-14 17:46:47 +00:00
Sean Quah
0147b3de20 Add missing type hints to synapse.logging.context (#11556) 2021-12-14 17:35:28 +00:00
Patrick Cloke
2519beaad2 Add missing type hints to synapse.appservice (#11360) 2021-12-14 17:02:46 +00:00
Olivier Wilkinson (reivilibre)
70ca05373b Merge branch 'master' into develop 2021-12-14 14:22:48 +00:00
Olivier Wilkinson (reivilibre)
a91698df90 Merge tag 'v1.49.0'
Synapse 1.49.0 (2021-12-14)
===========================

No significant changes since version 1.49.0rc1.

Support for Ubuntu 21.04 ends next month on the 20th of January
---------------------------------------------------------------

For users of Ubuntu 21.04 (Hirsute Hippo), please be aware that [upstream support for this version of Ubuntu will end next month][Ubuntu2104EOL].
We will stop producing packages for Ubuntu 21.04 after upstream support ends.

[Ubuntu2104EOL]: https://lists.ubuntu.com/archives/ubuntu-announce/2021-December/000275.html

The wiki has been migrated to the documentation website
-------------------------------------------------------

We've decided to move the existing, somewhat stagnant pages from the GitHub wiki
to the [documentation website](https://matrix-org.github.io/synapse/latest/).

This was done for two reasons. The first was to ensure that changes are checked by
multiple authors before being committed (everyone makes mistakes!) and the second
was visibility of the documentation. Not everyone knows that Synapse has some very
useful information hidden away in its GitHub wiki pages. Bringing them to the
documentation website should help with visibility, as well as keep all Synapse documentation
in one, easily-searchable location.

Note that contributions to the documentation website happen through [GitHub pull
requests](https://github.com/matrix-org/synapse/pulls). Please visit [#synapse-dev:matrix.org](https://matrix.to/#/#synapse-dev:matrix.org)
if you need help with the process!

Synapse 1.49.0rc1 (2021-12-07)
==============================

Features
--------

- Add [MSC3030](https://github.com/matrix-org/matrix-doc/pull/3030) experimental client and federation API endpoints to get the closest event to a given timestamp. ([\#9445](https://github.com/matrix-org/synapse/issues/9445))
- Include bundled relation aggregations during a limited `/sync` request and `/relations` request, per [MSC2675](https://github.com/matrix-org/matrix-doc/pull/2675). ([\#11284](https://github.com/matrix-org/synapse/issues/11284), [\#11478](https://github.com/matrix-org/synapse/issues/11478))
- Add plugin support for controlling database background updates. ([\#11306](https://github.com/matrix-org/synapse/issues/11306), [\#11475](https://github.com/matrix-org/synapse/issues/11475), [\#11479](https://github.com/matrix-org/synapse/issues/11479))
- Support the stable API endpoints for [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946): the room `/hierarchy` endpoint. ([\#11329](https://github.com/matrix-org/synapse/issues/11329))
- Add admin API to get some information about federation status with remote servers. ([\#11407](https://github.com/matrix-org/synapse/issues/11407))
- Support expiry of refresh tokens and expiry of the overall session when refresh tokens are in use. ([\#11425](https://github.com/matrix-org/synapse/issues/11425))
- Stabilise support for [MSC2918](https://github.com/matrix-org/matrix-doc/blob/main/proposals/2918-refreshtokens.md#msc2918-refresh-tokens) refresh tokens as they have now been merged into the Matrix specification. ([\#11435](https://github.com/matrix-org/synapse/issues/11435), [\#11522](https://github.com/matrix-org/synapse/issues/11522))
- Update [MSC2918 refresh token](https://github.com/matrix-org/matrix-doc/blob/main/proposals/2918-refreshtokens.md#msc2918-refresh-tokens) support to confirm with the latest revision: accept the `refresh_tokens` parameter in the request body rather than in the URL parameters. ([\#11430](https://github.com/matrix-org/synapse/issues/11430))
- Support configuring the lifetime of non-refreshable access tokens separately to refreshable access tokens. ([\#11445](https://github.com/matrix-org/synapse/issues/11445))
- Expose `synapse_homeserver` and `synapse_worker` commands as entry points to run Synapse's main process and worker processes, respectively. Contributed by @Ma27. ([\#11449](https://github.com/matrix-org/synapse/issues/11449))
- `synctl stop` will now wait for Synapse to exit before returning. ([\#11459](https://github.com/matrix-org/synapse/issues/11459), [\#11490](https://github.com/matrix-org/synapse/issues/11490))
- Extend the "delete room" admin api to work correctly on rooms which have previously been partially deleted. ([\#11523](https://github.com/matrix-org/synapse/issues/11523))
- Add support for the `/_matrix/client/v3/login/sso/redirect/{idpId}` API from Matrix v1.1. This endpoint was overlooked when support for v3 endpoints was added in Synapse 1.48.0rc1. ([\#11451](https://github.com/matrix-org/synapse/issues/11451))

Bugfixes
--------

- Fix using [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) batch sending in combination with event persistence workers. Contributed by @tulir at Beeper. ([\#11220](https://github.com/matrix-org/synapse/issues/11220))
- Fix a long-standing bug where all requests that read events from the database could get stuck as a result of losing the database connection, properly this time. Also fix a race condition introduced in the previous insufficient fix in Synapse 1.47.0. ([\#11376](https://github.com/matrix-org/synapse/issues/11376))
- The `/send_join` response now includes the stable `event` field instead of the unstable field from [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083). ([\#11413](https://github.com/matrix-org/synapse/issues/11413))
- Fix a bug introduced in Synapse 1.47.0 where `send_join` could fail due to an outdated `ijson` version. ([\#11439](https://github.com/matrix-org/synapse/issues/11439), [\#11441](https://github.com/matrix-org/synapse/issues/11441), [\#11460](https://github.com/matrix-org/synapse/issues/11460))
- Fix a bug introduced in Synapse 1.36.0 which could cause problems fetching event-signing keys from trusted key servers. ([\#11440](https://github.com/matrix-org/synapse/issues/11440))
- Fix a bug introduced in Synapse 1.47.1 where the media repository would fail to work if the media store path contained any symbolic links. ([\#11446](https://github.com/matrix-org/synapse/issues/11446))
- Fix an `LruCache` corruption bug, introduced in Synapse 1.38.0, that would cause certain requests to fail until the next Synapse restart. ([\#11454](https://github.com/matrix-org/synapse/issues/11454))
- Fix a long-standing bug where invites from ignored users were included in incremental syncs. ([\#11511](https://github.com/matrix-org/synapse/issues/11511))
- Fix a regression in Synapse 1.48.0 where presence workers would not clear their presence updates over replication on shutdown. ([\#11518](https://github.com/matrix-org/synapse/issues/11518))
- Fix a regression in Synapse 1.48.0 where the module API's `looping_background_call` method would spam errors to the logs when given a non-async function. ([\#11524](https://github.com/matrix-org/synapse/issues/11524))

Updates to the Docker image
---------------------------

- Update `Dockerfile-workers` to healthcheck all workers in the container. ([\#11429](https://github.com/matrix-org/synapse/issues/11429))

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

- Update the media repository documentation. ([\#11415](https://github.com/matrix-org/synapse/issues/11415))
- Update section about backward extremities in the room DAG concepts doc to correct the misconception about backward extremities indicating whether we have fetched an events' `prev_events`. ([\#11469](https://github.com/matrix-org/synapse/issues/11469))

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

- Add `Final` annotation to string constants in `synapse.api.constants` so that they get typed as `Literal`s. ([\#11356](https://github.com/matrix-org/synapse/issues/11356))
- Add a check to ensure that users cannot start the Synapse master process when `worker_app` is set. ([\#11416](https://github.com/matrix-org/synapse/issues/11416))
- Add a note about postgres memory management and hugepages to postgres doc. ([\#11467](https://github.com/matrix-org/synapse/issues/11467))
- Add missing type hints to `synapse.config` module. ([\#11465](https://github.com/matrix-org/synapse/issues/11465))
- Add missing type hints to `synapse.federation`. ([\#11483](https://github.com/matrix-org/synapse/issues/11483))
- Add type annotations to `tests.storage.test_appservice`. ([\#11488](https://github.com/matrix-org/synapse/issues/11488), [\#11492](https://github.com/matrix-org/synapse/issues/11492))
- Add type annotations to some of the configuration surrounding refresh tokens. ([\#11428](https://github.com/matrix-org/synapse/issues/11428))
- Add type hints to `synapse/tests/rest/admin`. ([\#11501](https://github.com/matrix-org/synapse/issues/11501))
- Add type hints to storage classes. ([\#11411](https://github.com/matrix-org/synapse/issues/11411))
- Add wiki pages to documentation website. ([\#11402](https://github.com/matrix-org/synapse/issues/11402))
- Clean up `tests.storage.test_main` to remove use of legacy code. ([\#11493](https://github.com/matrix-org/synapse/issues/11493))
- Clean up `tests.test_visibility` to remove legacy code. ([\#11495](https://github.com/matrix-org/synapse/issues/11495))
- Convert status codes to `HTTPStatus` in `synapse.rest.admin`. ([\#11452](https://github.com/matrix-org/synapse/issues/11452), [\#11455](https://github.com/matrix-org/synapse/issues/11455))
- Extend the `scripts-dev/sign_json` script to support signing events. ([\#11486](https://github.com/matrix-org/synapse/issues/11486))
- Improve internal types in push code. ([\#11409](https://github.com/matrix-org/synapse/issues/11409))
- Improve type annotations in `synapse.module_api`. ([\#11029](https://github.com/matrix-org/synapse/issues/11029))
- Improve type hints for `LruCache`. ([\#11453](https://github.com/matrix-org/synapse/issues/11453))
- Preparation for database schema simplifications: disambiguate queries on `state_key`. ([\#11497](https://github.com/matrix-org/synapse/issues/11497))
- Refactor `backfilled` into specific behavior function arguments (`_persist_events_and_state_updates` and downstream calls). ([\#11417](https://github.com/matrix-org/synapse/issues/11417))
- Refactor `get_version_string` to fix-up types and duplicated code. ([\#11468](https://github.com/matrix-org/synapse/issues/11468))
- Refactor various parts of the `/sync` handler. ([\#11494](https://github.com/matrix-org/synapse/issues/11494), [\#11515](https://github.com/matrix-org/synapse/issues/11515))
- Remove unnecessary `json.dumps` from `tests.rest.admin`. ([\#11461](https://github.com/matrix-org/synapse/issues/11461))
- Save the OpenID Connect session ID on login. ([\#11482](https://github.com/matrix-org/synapse/issues/11482))
- Update and clean up recently ported documentation pages. ([\#11466](https://github.com/matrix-org/synapse/issues/11466))
2021-12-14 14:22:16 +00:00
Olivier Wilkinson (reivilibre)
4dd9ea8f4f Revert "Revert accidental fast-forward merge from v1.49.0rc1"
This reverts commit 158d73ebdd.
2021-12-14 14:22:01 +00:00
Olivier Wilkinson (reivilibre)
92906e1b60 Restructure changelog 2021-12-14 13:00:46 +00:00
Olivier Wilkinson (reivilibre)
9f3c7e85a4 1.49.0 2021-12-14 12:56:14 +00:00
Sean Quah
a4dce5b53d Remove redundant COALESCE()s around COUNT()s in database queries (#11570)
`COUNT()` never returns `NULL`. A `COUNT(*)` over 0 rows is 0 and a
`COUNT(NULL)` is also 0.
2021-12-14 12:34:30 +00:00
Patrick Cloke
33abbc3278 Add missing type hints to synapse.http. (#11571) 2021-12-14 07:00:47 -05:00
Richard van der Hoff
ff6fd52160 checks for generators in database functions (#11564)
A couple of safety-checks to hopefully stop people doing what I just did, and create a storage
function which only works the first time it is called (and not when it is re-run due to a database
concurrency error or similar).
2021-12-13 19:01:27 +00:00
Patrick Cloke
eb39da6782 Move HTML parsing to a separate file for URL previews. (#11566)
* Splits the logic for parsing HTML from the resource handling code.
* Fix a circular import in the oEmbed code (which uses the HTML parsing code).
* Renames some of the HTML parsing methods to:
  * Make it clear which methods are "internal" to the module.
  * Clarify what the methods do.
2021-12-13 17:55:07 +00:00
Sean Quah
5305a5e881 Type hint the constructors of the data store classes (#11555) 2021-12-13 17:05:00 +00:00
Sean Quah
1abfb15f07 Add type hints to synapse/storage/databases/main/end_to_end_keys.py (#11551) 2021-12-13 16:28:26 +00:00
Sean Quah
6da8591f2e Add type hints to synapse/storage/databases/main/account_data.py (#11546) 2021-12-13 16:28:10 +00:00
reivilibre
e5cdb9e233 Make get_device return None if the device doesn't exist rather than raising an exception. (#11565)
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2021-12-13 15:39:43 +00:00
Eric Eastwood
aa8708ebed Allow events to be created with no prev_events (MSC2716) (#11243)
The event still needs to have `auth_events` defined to be valid.

Split out from https://github.com/matrix-org/synapse/pull/11114
2021-12-10 23:08:51 -06:00
Eric Eastwood
8391bd6ab5 Test to ensure we share the same state_group across the whole historical batch (MSC2716) (#11487)
Part of MSC2716: https://github.com/matrix-org/matrix-doc/pull/2716

We did some work on making sure the `state_groups` were shared in
https://github.com/matrix-org/synapse/pull/10975
2021-12-10 20:59:20 -06:00
David Robertson
fd2dadb815 Adjust _get_rooms_changed comments (#11550)
C.f. https://github.com/matrix-org/synapse/pull/11494#pullrequestreview-827780886
2021-12-10 19:19:48 +00:00
Richard van der Hoff
f0562183e7 skip some dict munging in event persistence (#11560)
Create a new dict helper method `simple_insert_many_values_txn`, which takes
raw row values, rather than {key=>value} dicts. This saves us a bunch of dict
munging, and makes it easier to use generators rather than creating
intermediate lists and dicts.
2021-12-10 15:02:33 +00:00
Richard van der Hoff
86e7a6d16e Stop populating state_events.prev_state (#11558)
this field is never read, so we may as well stop populating it.
2021-12-10 14:13:23 +00:00
Patrick Cloke
9562f0c2f1 Ensure emails are canonicalized before fetching associated user. (#11547)
This should fix pushers with an email in non-canonical form is used as
the pushkey.
2021-12-10 07:17:28 -05:00
Patrick Cloke
3b8872299a Do not allow cross-room relations, per MSC2674. (#11516) 2021-12-09 13:16:01 -05:00
Patrick Cloke
0cc3bf97b4 Additional type hints for the config module, part 2. (#11480) 2021-12-09 16:15:46 +00:00
Dirk Klimpel
941ebe49ff Use HTTPStatus constants in place of literals in synapse.http (#11543) 2021-12-09 11:58:25 +00:00
Hubert Chathi
b47d10dc46 Support unprefixed versions of fallback key property names. (#11541) 2021-12-09 11:41:27 +00:00
Dirk Klimpel
b3bcacf3c1 Add missing errcode to parse_string and parse_boolean (#11542) 2021-12-09 11:23:34 +00:00
Robert Long
afa0a5e4fc Allow guests to send state events (#11378) 2021-12-09 11:02:05 +00:00
Patrick Cloke
d93362d87f Add a constant for receipt types (m.read). (#11531)
And expand some type hints in the receipts storage module.
2021-12-08 12:26:29 -05:00
Dirk Klimpel
7ecaa3b976 Clean up synapse.rest.admin (#11535) 2021-12-08 16:59:40 +00:00
reivilibre
83a74d9350 Document the usage of refresh tokens. (#11427)
Co-authored-by: David Robertson <davidr@element.io>
2021-12-08 15:31:17 +00:00
reivilibre
365e9482fe Use HTTPStatus constants in place of literals in tests.rest.client.test_auth. (#11520) 2021-12-08 14:54:47 +00:00
Richard van der Hoff
ff7cc17b57 Improve log messages for stream ids (#11536)
Somehow I'd managed to get my database in a pickle with stream ids. These
changes were useful to debug.
2021-12-08 14:15:14 +00:00
Hubert Chathi
8541809cb9 Send and handle cross-signing messages using the stable prefix. (#10520) 2021-12-08 10:01:38 +00:00
Andrew Morgan
d6fb96e056 Fix case in wait_for_background_updates where self.store does not exist (#11331)
Pull the DataStore from the HomeServer instance, which
always exists.
2021-12-07 11:51:53 -05:00
Sean Quah
158d73ebdd Revert accidental fast-forward merge from v1.49.0rc1
Revert "Sort internal changes in changelog"
Revert "Update CHANGES.md"
Revert "1.49.0rc1"
Revert "Revert "Move `glob_to_regex` and `re_word_boundary` to `matrix-python-common` (#11505) (#11527)"
Revert "Refactors in `_generate_sync_entry_for_rooms` (#11515)"
Revert "Correctly register shutdown handler for presence workers (#11518)"
Revert "Fix `ModuleApi.looping_background_call` for non-async functions (#11524)"
Revert "Fix 'delete room' admin api to work on incomplete rooms (#11523)"
Revert "Correctly ignore invites from ignored users (#11511)"
Revert "Fix the test breakage introduced by #11435 as a result of concurrent PRs (#11522)"
Revert "Stabilise support for MSC2918 refresh tokens as they have now been merged into the Matrix specification. (#11435)"
Revert "Save the OIDC session ID (sid) with the device on login (#11482)"
Revert "Add admin API to get some information about federation status (#11407)"
Revert "Include bundled aggregations in /sync and related fixes (#11478)"
Revert "Move `glob_to_regex` and `re_word_boundary` to `matrix-python-common` (#11505)"
Revert "Update backward extremity docs to make it clear that it does not indicate whether we have fetched an events' `prev_events` (#11469)"
Revert "Support configuring the lifetime of non-refreshable access tokens separately to refreshable access tokens. (#11445)"
Revert "Add type hints to `synapse/tests/rest/admin` (#11501)"
Revert "Revert accidental commits to develop."
Revert "Newsfile"
Revert "Give `tests.server.setup_test_homeserver` (nominally!) the same behaviour"
Revert "Move `tests.utils.setup_test_homeserver` to `tests.server`"
Revert "Convert one of the `setup_test_homeserver`s to `make_test_homeserver_synchronous`"
Revert "Disambiguate queries on `state_key` (#11497)"
Revert "Comments on the /sync tentacles (#11494)"
Revert "Clean up tests.storage.test_appservice (#11492)"
Revert "Clean up `tests.storage.test_main` to remove use of legacy code. (#11493)"
Revert "Clean up `tests.test_visibility` to remove legacy code. (#11495)"
Revert "Minor cleanup on recently ported doc pages  (#11466)"
Revert "Add most of the missing type hints to `synapse.federation`. (#11483)"
Revert "Avoid waiting for zombie processes in `synctl stop` (#11490)"
Revert "Fix media repository failing when media store path contains symlinks (#11446)"
Revert "Add type annotations to `tests.storage.test_appservice`. (#11488)"
Revert "`scripts-dev/sign_json`: support for signing events (#11486)"
Revert "Add MSC3030 experimental client and federation API endpoints to get the closest event to a given timestamp (#9445)"
Revert "Port wiki pages to documentation website (#11402)"
Revert "Add a license header and comment. (#11479)"
Revert "Clean-up get_version_string (#11468)"
Revert "Link background update controller docs to summary (#11475)"
Revert "Additional type hints for config module. (#11465)"
Revert "Register the login redirect endpoint for v3. (#11451)"
Revert "Update openid.md"
Revert "Remove mention of OIDC certification from Dex (#11470)"
Revert "Add a note about huge pages to our Postgres doc (#11467)"
Revert "Don't start Synapse master process if `worker_app` is set (#11416)"
Revert "Expose worker & homeserver as entrypoints in `setup.py` (#11449)"
Revert "Bundle relations of relations into the `/relations` result. (#11284)"
Revert "Fix `LruCache` corruption bug with a `size_callback` that can return 0 (#11454)"
Revert "Eliminate a few `Any`s in `LruCache` type hints (#11453)"
Revert "Remove unnecessary `json.dumps` from `tests.rest.admin` (#11461)"
Revert "Merge branch 'master' into develop"

This reverts commit 26b5d2320f.
This reverts commit bce4220f38.
This reverts commit 966b5d0fa0.
This reverts commit 088d748f2c.
This reverts commit 14d593f72d.
This reverts commit 2a3ec6facf.
This reverts commit eccc49d755.
This reverts commit b1ecd19c5d.
This reverts commit 9c55dedc8c.
This reverts commit 2d42e586a8.
This reverts commit 2f053f3f82.
This reverts commit a15a893df8.
This reverts commit 8b4b153c9e.
This reverts commit 494ebd7347.
This reverts commit a77c369897.
This reverts commit 4eb77965cd.
This reverts commit 637df95de6.
This reverts commit e5f426cd54.
This reverts commit 8cd68b8102.
This reverts commit 6cae125e20.
This reverts commit 7be88fbf48.
This reverts commit b3fd99b74a.
This reverts commit f7ec6e7d9e.
This reverts commit 5640992d17.
This reverts commit d26808dd85.
This reverts commit f91624a595.
This reverts commit 16d39a5490.
This reverts commit 8a4c296987.
This reverts commit 49e1356ee3.
This reverts commit d2279f471b.
This reverts commit b50e39df57.
This reverts commit 858d80bf0f.
This reverts commit 435f044807.
This reverts commit f61462e1be.
This reverts commit a6f1a3abec.
This reverts commit 84dc50e160.
This reverts commit ed635d3285.
This reverts commit 7b62791e00.
This reverts commit 153194c771.
This reverts commit f44d729d4c.
This reverts commit a265fbd397.
This reverts commit b9fef1a7cd.
This reverts commit b0eb64ff7b.
This reverts commit f1795463bf.
This reverts commit 70cbb1a5e3.
This reverts commit 42bf020463.
This reverts commit 379f2650cf.
This reverts commit 7ff22d6da4.
This reverts commit 5a0b652d36.
This reverts commit 432a174bc1.
This reverts commit b14f8a1baf, reversing
changes made to e713855dca.
2021-12-07 16:47:31 +00:00
Sean Quah
26b5d2320f Sort internal changes in changelog 2021-12-07 14:46:37 +00:00
Sean Quah
bce4220f38 Update CHANGES.md 2021-12-07 14:41:06 +00:00
Sean Quah
dbceb00688 Merge branch 'release-v1.49' into matrix-org-hotfixes 2021-12-07 13:57:18 +00:00
Sean Quah
966b5d0fa0 1.49.0rc1 2021-12-07 13:56:09 +00:00
Sean Quah
088d748f2c Revert "Move glob_to_regex and re_word_boundary to matrix-python-common (#11505) (#11527)
This reverts commit a77c369897.
2021-12-07 13:51:11 +00:00
David Robertson
14d593f72d Refactors in _generate_sync_entry_for_rooms (#11515)
* Move sync_token up to the top
* Pull out _get_ignored_users
* Try to signpost the body of `_generate_sync_entry_for_rooms`
* Pull out _calculate_user_changes

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-12-07 12:42:05 +00:00
David Robertson
2a3ec6facf Correctly register shutdown handler for presence workers (#11518)
Fixes #11517
2021-12-07 12:34:38 +00:00
Sean Quah
eccc49d755 Fix ModuleApi.looping_background_call for non-async functions (#11524)
After #10847, `looping_background_call` would print an error in the logs
every time a non-async function was called. Since the error would be
caught and ignored immediately, there were no other side effects.
2021-12-07 11:41:31 +00:00
Richard van der Hoff
b1ecd19c5d Fix 'delete room' admin api to work on incomplete rooms (#11523)
If, for some reason, we don't have the create event, we should still be able to
purge a room.
2021-12-07 11:37:54 +00:00
David Robertson
9c55dedc8c Correctly ignore invites from ignored users (#11511) 2021-12-07 11:24:31 +00:00
reivilibre
2d42e586a8 Fix the test breakage introduced by #11435 as a result of concurrent PRs (#11522) 2021-12-07 10:49:39 +00:00
reivilibre
2f053f3f82 Stabilise support for MSC2918 refresh tokens as they have now been merged into the Matrix specification. (#11435) 2021-12-06 19:11:43 +00:00
Quentin Gliech
a15a893df8 Save the OIDC session ID (sid) with the device on login (#11482)
As a step towards allowing back-channel logout for OIDC.
2021-12-06 12:43:06 -05:00
Dirk Klimpel
8b4b153c9e Add admin API to get some information about federation status (#11407) 2021-12-06 16:59:50 +00:00
Patrick Cloke
494ebd7347 Include bundled aggregations in /sync and related fixes (#11478)
Due to updates to MSC2675 this includes a few fixes:

* Include bundled aggregations for /sync.
* Do not include bundled aggregations for /initialSync and /events.
* Do not bundle aggregations for state events.
* Clarifies comments and variable names.
2021-12-06 15:51:15 +00:00
Sean Quah
a77c369897 Move glob_to_regex and re_word_boundary to matrix-python-common (#11505) 2021-12-06 11:36:08 +00:00
Eric Eastwood
4eb77965cd Update backward extremity docs to make it clear that it does not indicate whether we have fetched an events' prev_events (#11469)
Spawning from https://github.com/matrix-org/synapse/pull/9445#discussion_r758958181

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-12-03 18:25:04 -06:00
reivilibre
637df95de6 Support configuring the lifetime of non-refreshable access tokens separately to refreshable access tokens. (#11445) 2021-12-03 16:42:44 +00:00
Dirk Klimpel
e5f426cd54 Add type hints to synapse/tests/rest/admin (#11501) 2021-12-03 13:57:13 +00:00
Olivier Wilkinson (reivilibre)
8cd68b8102 Revert accidental commits to develop. 2021-12-03 12:31:28 +00:00
Olivier Wilkinson (reivilibre)
6cae125e20 Newsfile
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2021-12-03 12:25:37 +00:00
Olivier Wilkinson (reivilibre)
7be88fbf48 Give tests.server.setup_test_homeserver (nominally!) the same behaviour
by calling into `make_test_homeserver_synchronous`.

The function *could* have been inlined at this point but the function is big enough

and it felt fine to leave it as is.

At least there isn't a confusing name clash anymore!
2021-12-03 11:40:05 +00:00
Olivier Wilkinson (reivilibre)
b3fd99b74a Move tests.utils.setup_test_homeserver to tests.server
It had no users.

We have just taken the identity of a previous function but don't provide the same
behaviour, so we need to fix this in the next commit...
2021-12-03 11:38:14 +00:00
Olivier Wilkinson (reivilibre)
f7ec6e7d9e Convert one of the setup_test_homeservers to make_test_homeserver_synchronous
and pass in the homeserver rather than calling a same-named function to ask for one.

Later commits will jiggle things around to make this sensible.
2021-12-03 11:35:24 +00:00
Richard van der Hoff
5640992d17 Disambiguate queries on state_key (#11497)
We're going to add a `state_key` column to the `events` table, so we need to
add some disambiguation to queries which use it.
2021-12-02 22:42:58 +00:00
David Robertson
d26808dd85 Comments on the /sync tentacles (#11494)
This mainly consists of docstrings and inline comments. There are one or two type annotations and variable renames thrown in while I was here.

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-12-02 20:58:32 +00:00
reivilibre
f91624a595 Clean up tests.storage.test_appservice (#11492) 2021-12-02 18:43:33 +00:00
reivilibre
16d39a5490 Clean up tests.storage.test_main to remove use of legacy code. (#11493) 2021-12-02 18:13:43 +00:00
reivilibre
8a4c296987 Clean up tests.test_visibility to remove legacy code. (#11495) 2021-12-02 18:13:30 +00:00
Shay
49e1356ee3 Minor cleanup on recently ported doc pages (#11466)
* move wiki pages to synapse/docs and add a few titles where necessary

* update SUMMARY.md with added pages

* add changelog

* move incorrectly located newsfragment

* update changelog number

* snake case added files and update summary.md accordingly

* update issue/pr links

* update relative links to docs

* update changelog to indicate that we moved wiki pages to the docs and state reasoning

* requested changes to admin_faq.md

* requested changes to database_maintenance_tools.md

* requested changes to understanding_synapse_through_graphana_graphs.md

* add changelog

* fix leftover merge errata

* fix unwanted changes from merge

* use two spaces between entries

* outdent code blocks
2021-12-02 09:46:20 -08:00
Patrick Cloke
d2279f471b Add most of the missing type hints to synapse.federation. (#11483)
This skips a few methods which are difficult to type.
2021-12-02 16:18:10 +00:00
Sean Quah
b50e39df57 Avoid waiting for zombie processes in synctl stop (#11490) 2021-12-02 16:07:06 +00:00
Sean Quah
858d80bf0f Fix media repository failing when media store path contains symlinks (#11446) 2021-12-02 16:05:24 +00:00
reivilibre
435f044807 Add type annotations to tests.storage.test_appservice. (#11488) 2021-12-02 15:30:05 +00:00
Richard van der Hoff
f61462e1be scripts-dev/sign_json: support for signing events (#11486) 2021-12-02 15:18:40 +00:00
Eric Eastwood
a6f1a3abec Add MSC3030 experimental client and federation API endpoints to get the closest event to a given timestamp (#9445)
MSC3030: https://github.com/matrix-org/matrix-doc/pull/3030

Client API endpoint. This will also go and fetch from the federation API endpoint if unable to find an event locally or we found an extremity with possibly a closer event we don't know about.
```
GET /_matrix/client/unstable/org.matrix.msc3030/rooms/<roomID>/timestamp_to_event?ts=<timestamp>&dir=<direction>
{
    "event_id": ...
    "origin_server_ts": ...
}
```

Federation API endpoint:
```
GET /_matrix/federation/unstable/org.matrix.msc3030/timestamp_to_event/<roomID>?ts=<timestamp>&dir=<direction>
{
    "event_id": ...
    "origin_server_ts": ...
}
```

Co-authored-by: Erik Johnston <erik@matrix.org>
2021-12-02 01:02:20 -06:00
Shay
84dc50e160 Port wiki pages to documentation website (#11402)
* move wiki pages to synapse/docs and add a few titles where necessary

* update SUMMARY.md with added pages

* add changelog

* move incorrectly located newsfragment

* update changelog number

* snake case added files and update summary.md accordingly

* update issue/pr links

* update relative links to docs

* update changelog to indicate that we moved wiki pages to the docs and state reasoning

* revert unintentional change to CHANGES.md

* add link

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>

* Update CHANGES.md

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2021-12-01 10:12:19 -08:00
Patrick Cloke
ed635d3285 Add a license header and comment. (#11479) 2021-12-01 12:51:14 -05:00
Patrick Cloke
7b62791e00 Clean-up get_version_string (#11468) 2021-12-01 12:43:32 -05:00
Brendan Abolivier
153194c771 Link background update controller docs to summary (#11475) 2021-12-01 14:13:01 +00:00
Patrick Cloke
f44d729d4c Additional type hints for config module. (#11465)
This adds some misc. type hints to helper methods used
in the `synapse.config` module.
2021-12-01 07:28:23 -05:00
Patrick Cloke
a265fbd397 Register the login redirect endpoint for v3. (#11451)
As specified for Matrix v1.1.
2021-12-01 07:25:58 -05:00
Richard van der Hoff
b9fef1a7cd Update openid.md
fix header level
2021-12-01 10:57:55 +00:00
Etienne Dysli Metref
b0eb64ff7b Remove mention of OIDC certification from Dex (#11470)
Dex isn't yet [1,2] a certified OpenID Provider implementation. As of today, it's not on the list maintained by the OpenID Foundation. [3]

[1] https://github.com/dexidp/dex/issues/42
[2] https://github.com/dexidp/dex/issues/262
[3] https://openid.net/certification/
2021-12-01 09:40:51 +00:00
Shay
f1795463bf Add a note about huge pages to our Postgres doc (#11467)
* Add note to postgres doc about hugepages

* Newsfragment
2021-11-30 19:05:20 -08:00
Shay
70cbb1a5e3 Don't start Synapse master process if worker_app is set (#11416)
* Add check to catch syanpse master process starting when workers are configured

* add test to verify that starting master process with worker config raises error

* newsfragment

* specify config.worker.worker_app in check

* update test

* report specific config option that triggered the error

Co-authored-by: reivilibre <oliverw@matrix.org>

* clarify error message

Co-authored-by: reivilibre <oliverw@matrix.org>

Co-authored-by: reivilibre <oliverw@matrix.org>
2021-11-30 10:12:18 -08:00
Maximilian Bosch
42bf020463 Expose worker & homeserver as entrypoints in setup.py (#11449)
Co-authored-by: reivilibre <oliverw@matrix.org>
2021-11-30 16:52:45 +00:00
Patrick Cloke
379f2650cf Bundle relations of relations into the /relations result. (#11284)
Per updates to MSC2675 which now states that bundled
aggregations should be included from the `/relations`
endpoint.
2021-11-30 11:33:33 -05:00
Sean Quah
7ff22d6da4 Fix LruCache corruption bug with a size_callback that can return 0 (#11454)
When all entries in an `LruCache` have a size of 0 according to the
provided `size_callback`, and `drop_from_cache` is called on a cache
node, the node would be unlinked from the LRU linked list but remain in
the cache dictionary. An assertion would be later be tripped due to the
inconsistency.

Avoid unintentionally calling `__len__` and use a strict `is None`
check instead when unwrapping the weak reference.
2021-11-30 16:28:02 +00:00
Sean Quah
5a0b652d36 Eliminate a few Anys in LruCache type hints (#11453) 2021-11-30 15:39:07 +00:00
Dirk Klimpel
432a174bc1 Remove unnecessary json.dumps from tests.rest.admin (#11461)
The tests helpers automatically convert dictionaries to
JSON payloads, no need to do it manually for each
test.
2021-11-30 14:51:04 +00:00
Brendan Abolivier
b14f8a1baf Merge branch 'master' into develop 2021-11-30 14:28:30 +00:00
Patrick Cloke
28f5252c1f Add missing copyright header. (#11460) 2021-11-30 13:23:53 +00:00
Richard van der Hoff
f13a8d1c69 synctl stop: wait for processes to exit (#11459)
If you're trying to shut down Synapse, it's rather handy if it *actually* shuts
down before you move on.
2021-11-30 11:51:12 +00:00
Marcus
a9481223d1 Improved push typing (#11409)
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2021-11-30 11:49:20 +00:00
Dirk Klimpel
35b1900f00 Convert status codes to HTTPStatus in tests.rest.admin (#11455) 2021-11-30 09:53:54 +00:00
Dirk Klimpel
e8ae94a223 Convert status codes to HTTPStatus in synapse.rest.admin (#11452) 2021-11-29 22:19:45 +00:00
Eric Eastwood
fb58611d21 Refactor backfilled into specific behavior function arguments (_persist_events_and_state_updates) (#11417)
Part of https://github.com/matrix-org/synapse/issues/11300

Call stack:

 - `_persist_events_and_state_updates` (added `use_negative_stream_ordering`)
    - `_persist_events_txn`
       - `_update_room_depths_txn` (added `update_room_forward_stream_ordering`)
       - `_update_metadata_tables_txn`
          - `_store_room_members_txn` (added `inhibit_local_membership_updates`)

Using keyword-only arguments (`*`) to reduce the mistakes from `backfilled` being left as a positional argument somewhere and being interpreted wrong by our new arguments.
2021-11-29 16:01:54 -06:00
Patrick Cloke
a4521ce0a8 Support the stable /hierarchy endpoint from MSC2946 (#11329)
This also makes additional updates where the implementation
had drifted from the approved MSC.

Unstable endpoints will be removed at a later data.
2021-11-29 14:32:20 -05:00
Erik Johnston
d08ef6f155 Make background updates controllable via a plugin (#11306)
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2021-11-29 17:57:06 +01:00
Patrick Cloke
9d1971a5c4 Return the stable event field from /send_join per MSC3083. (#11413)
This does not remove the unstable field and still parses both.
Handling of the unstable field will need to be removed in the
future.
2021-11-29 15:43:20 +00:00
Sean Quah
7564b8e118 Update the media repository documentation (#11415) 2021-11-29 15:37:56 +00:00
reivilibre
a82b90ab32 Add type annotations to some of the configuration surrounding refresh tokens. (#11428) 2021-11-29 13:34:14 +00:00
Richard van der Hoff
9cd13c5f63 Fix perspectives requests for multiple keys for the same server (#11440)
If we tried to request multiple keys for the same server, we would end up
dropping some of those requests.
2021-11-29 13:15:36 +00:00
Tulir Asokan
7b4e228e41 Fix using MSC2716 batch sending with event persistence workers (#11220)
Signed-off-by: Tulir Asokan <tulir@beeper.com>
2021-11-29 13:13:23 +00:00
David Robertson
dc0a3cd596 disallow-untyped-defs for the module_api (#11029) 2021-11-29 11:28:12 +00:00
David Robertson
aa457b625e Fix changelog filename in #11441 2021-11-29 11:15:28 +00:00
David Robertson
776ad3e5e9 Add a test case for the SendJoinParser (#11441)
This would have caught the bug #11438 introduced in #11217 and fixed in #11439.
2021-11-29 11:11:46 +00:00
Daniel Molkentin
e5c5e213ea Bump ijson dependency to 3.1 (#11438) (#11439)
Since e81fa92648, Synapse depends on
the use_float flag which has been introduced in ijson 3.1 and
is not available in 3.0. This is known to cause runtime errors
with send_join.

Signed-off-by: Daniel Molkentin <danimo@infra.run>

Co-authored-by: Daniel Molkentin <danimo@infra.run>
2021-11-26 20:51:22 +00:00
reivilibre
1b6691dce4 Update MSC2918 refresh token support to confirm with the latest revision: accept the refresh_tokens parameter in the request body rather than in the URL parameters. (#11430) 2021-11-26 19:06:16 +00:00
Sean Quah
ffd858aa68 Add type hints to synapse/storage/databases/main/events_worker.py (#11411)
Also refactor the stream ID trackers/generators a bit and try to
document them better.
2021-11-26 18:41:31 +00:00
reivilibre
1d8b80b334 Support expiry of refresh tokens and expiry of the overall session when refresh tokens are in use. (#11425) 2021-11-26 14:27:14 +00:00
Michael Kaye
e2c300e7e4 Create healthcheck script for synapse-workers container (#11429)
The intent is to iterate through all the worker ports and only
report healthy when all are healthy, starting with the main process.
2021-11-26 14:05:20 +00:00
Sean Quah
c675a18071 Track ongoing event fetches correctly (again) (#11376)
The previous fix for the ongoing event fetches counter
(8eec25a1d9) was both insufficient and
incorrect.

When the database is unreachable, `_do_fetch` never gets run and so
`_event_fetch_ongoing` is never decremented.

The previous fix also moved the `_event_fetch_ongoing` decrement outside
of the `_event_fetch_lock` which allowed race conditions to corrupt the
counter.
2021-11-26 13:47:24 +00:00
Sean Quah
7862f821de Annotate string constants in synapse.api.constants with Final (#11356)
This change makes mypy complain if the constants are ever reassigned,
and, more usefully, makes mypy type them as `Literal`s instead of `str`s,
allowing code of the following form to pass mypy:
```py
def do_something(membership: Literal["join", "leave"], ...): ...

do_something(Membership.JOIN, ...)
```
2021-11-25 16:14:23 +00:00
Brendan Abolivier
cb79a2b785 Merge branch 'develop' into matrix-org-hotfixes 2021-11-25 15:16:47 +00:00
David Robertson
098e964bbc Prevent the media store from writing outside of the configured directory
And the associated changelog/release process updates too.

Applied by patch from the security fork.
2021-11-23 10:14:27 +00:00
David Robertson
e147f067c5 Merge branch 'release-v1.47' into matrix-org-hotfixes 2021-11-23 10:09:27 +00:00
Andrew Morgan
ce06cb59c3 Merge branch 'release-v1.47' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-11-16 13:55:44 +00:00
Andrew Morgan
2a93005a7b Merge branch 'release-v1.47' into matrix-org-hotfixes 2021-11-15 11:52:32 +00:00
Olivier Wilkinson (reivilibre)
9d3b04e749 Merge branch 'release-v1.47' into matrix-org-hotfixes 2021-11-09 11:58:35 +00:00
Erik Johnston
459d2ae157 Merge remote-tracking branch 'origin/release-v1.46' into matrix-org-hotfixes 2021-11-02 10:04:06 +00:00
Erik Johnston
2bb023ba2b Don't seqscan event_json due to relates_to_id 2021-10-27 11:56:36 +01:00
Sean Quah
d8c1a21492 Merge branch 'release-v1.46' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-10-26 14:32:17 +01:00
Sean Quah
c59b9711f3 Merge branch 'release-v1.45' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-10-20 11:06:51 +01:00
David Robertson
27e6e45349 Merge branch 'release-v1.45' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-10-13 10:52:17 +01:00
Erik Johnston
2aacb49446 Merge remote-tracking branch 'origin/release-v1.45' into matrix-org-hotfixes 2021-10-12 14:27:34 +01:00
Brendan Abolivier
6ce0dc0620 Merge branch 'release-v1.45' into matrix-org-hotfixes 2021-10-12 10:21:26 +01:00
Brendan Abolivier
ebbd37b66d Merge branch 'release-v1.44' into matrix-org-hotfixes 2021-10-04 14:17:05 +01:00
Olivier Wilkinson (reivilibre)
4cb6ffdf46 Merge branch 'release-v1.44' into matrix-org-hotfixes 2021-09-30 11:43:38 +01:00
Erik Johnston
b9a0f7983d Merge remote-tracking branch 'origin/release-v1.44' into matrix-org-hotfixes 2021-09-28 14:37:06 +01:00
Erik Johnston
ba3a888a05 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-09-28 11:55:53 +01:00
David Robertson
a8340692ab Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-09-22 13:35:31 +01:00
Erik Johnston
2cc4c33d0a Merge remote-tracking branch 'origin/dmr/cache-eviction-hack' into matrix-org-hotfixes 2021-09-16 11:13:00 +01:00
Erik Johnston
bb0a4bd6d5 Merge remote-tracking branch 'origin/release-v1.43' into matrix-org-hotfixes 2021-09-16 11:12:52 +01:00
David Robertson
6227858482 Changelog 2021-09-15 17:22:21 +01:00
David Robertson
361ffb8f0a Don't expire get_users_who_share_room & friends 2021-09-15 17:22:17 +01:00
David Robertson
c9fb203ce0 Allow LruCaches to opt out of time-based expiry 2021-09-15 17:20:07 +01:00
Andrew Morgan
003c2ab629 Merge branch 'release-v1.43' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-09-14 11:02:37 +01:00
Richard van der Hoff
97ef48b07e Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-09-10 10:43:42 +01:00
Richard van der Hoff
dffdda5f89 Revert "Expand on why users should read upgrade notes"
This reverts commit 4d03ad5255.

This was committed to the wrong branch - it has been superceded by ca3cb1e039
on the release branches.
2021-09-10 10:42:14 +01:00
Brendan Abolivier
4d03ad5255 Expand on why users should read upgrade notes 2021-09-06 15:57:57 +01:00
Brendan Abolivier
92bbe0ebe1 Merge branch 'release-v1.42' into matrix-org-hotfixes 2021-09-06 15:38:03 +01:00
Andrew Morgan
ca2e5b2060 Merge branch 'release-v1.42' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-09-01 10:56:17 +01:00
Olivier Wilkinson (reivilibre)
3cd1277a7b Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-08-31 14:33:17 +01:00
Richard van der Hoff
619cc1d230 Merge branch 'release-v1.41' into matrix-org-hotfixes 2021-08-31 11:30:16 +01:00
Richard van der Hoff
ac646fed06 Remove some redundant patches from the hotfixes branch 2021-08-26 09:45:19 +01:00
Patrick Cloke
fe3466a8ad Merge remote-tracking branch 'origin/release-v1.41' into matrix-org-hotfixes 2021-08-20 07:53:27 -04:00
Andrew Morgan
2f4fe530a1 Merge branch 'release-v1.41' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-08-18 14:23:52 +01:00
Andrew Morgan
18572fddcc Merge branch 'release-v1.41' into matrix-org-hotfixes 2021-08-17 14:35:20 +01:00
Šimon Brandner
40e92b224c Handle string read receipt data (#10606)
* Handle string read receipt data

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Test that we handle string read receipt data

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Add changelog for #10606

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Add docs

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Ignore malformed RRs

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Only surround hidden = ...

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Remove unnecessary argument

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Update changelog.d/10606.bugfix

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2021-08-16 12:23:15 +01:00
Brendan Abolivier
53d7d92511 Merge branch 'release-v1.40' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-08-09 11:32:41 +01:00
Brendan Abolivier
0dcc40e81a Merge branch 'release-v1.40' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-08-04 15:20:28 +01:00
Olivier Wilkinson (reivilibre)
11dda97e86 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-08-03 10:34:44 +01:00
Andrew Morgan
1d3a9fe6e5 Merge branch 'release-v1.39' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-07-28 10:36:55 +01:00
Erik Johnston
12c92eec18 Merge remote-tracking branch 'origin/release-v1.38' into matrix-org-hotfixes 2021-07-22 15:30:22 +01:00
Andrew Morgan
c0121d69e7 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-07-20 11:48:03 +01:00
Erik Johnston
cc07548d71 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-07-16 11:25:22 +01:00
Erik Johnston
8a2be4f799 Merge remote-tracking branch 'origin/release-v1.38' into matrix-org-hotfixes 2021-07-09 10:17:22 +01:00
Brendan Abolivier
fc8a586ab9 Merge branch 'release-v1.38' into matrix-org-hotfixes 2021-07-06 14:11:37 +01:00
Richard van der Hoff
7eea8de9de Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-07-01 08:59:54 +01:00
Richard van der Hoff
cfddd43bfb bump background update rate 2021-06-29 20:56:46 +01:00
Richard van der Hoff
d70eefc313 Merge branch 'release-v1.37' into matrix-org-hotfixes 2021-06-29 20:54:40 +01:00
Richard van der Hoff
b4bdab8e52 Revert "Don't send catchup transactions for matrix hq"
This reverts commits 5575b5cb43,
f271b32bea,
ffe17e47ce
2021-06-29 16:13:09 +01:00
Richard van der Hoff
b18d18d03b Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-29 12:49:50 +01:00
Richard van der Hoff
077d441d42 Merge branch 'develop' into matrix-org-hotfixes 2021-06-29 11:27:25 +01:00
Erik Johnston
ffe17e47ce Fix SQL 2021-06-28 14:29:27 +01:00
Erik Johnston
f271b32bea don't send out events for matrix.org 2021-06-28 14:17:56 +01:00
Erik Johnston
5575b5cb43 Don't send catchup transactions for matrix hq
This is because there are problems with HQ atm.
2021-06-28 14:12:48 +01:00
Brendan Abolivier
0bbdca814a Merge branch 'release-v1.37' into matrix-org-hotfixes 2021-06-24 10:58:19 +01:00
Brendan Abolivier
c80e8b98de Tweak changelog 2021-06-24 10:57:39 +01:00
Brendan Abolivier
a0e48edd2f Merge branch 'release-v1.37' into matrix-org-hotfixes 2021-06-24 09:41:28 +01:00
Brendan Abolivier
6f4c860c56 Merge branch 'release-v1.37' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-06-23 09:49:14 +01:00
Richard van der Hoff
89013b99bd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-16 15:35:00 +01:00
Erik Johnston
a4b573ee48 Merge branch 'release-v1.36' into matrix-org-hotfixes 2021-06-11 15:37:22 +01:00
Andrew Morgan
f6e1e48dcf Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-06-08 13:52:56 +01:00
Andrew Morgan
fc8bab8291 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-06-08 11:52:11 +01:00
Andrew Morgan
efc5febc33 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-06-08 11:21:03 +01:00
Richard van der Hoff
68d7704d19 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-07 16:57:58 +01:00
Richard van der Hoff
f36457dce2 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-04 10:41:36 +01:00
Patrick Cloke
09361655d2 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-02 11:38:54 -04:00
Erik Johnston
a027b65c8e Merge remote-tracking branch 'origin/release-v1.35' into matrix-org-hotfixes 2021-05-28 17:15:01 +01:00
Erik Johnston
d2fcfef679 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-27 17:11:57 +01:00
Erik Johnston
2d83d19061 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-25 10:23:00 +01:00
Erik Johnston
6942377f90 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-14 11:31:38 +01:00
Brendan Abolivier
019ed44b84 Merge branch 'release-v1.34.0' into matrix-org-hotfixes 2021-05-12 16:41:04 +01:00
Richard van der Hoff
b0b8110acd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-12 12:57:55 +01:00
Brendan Abolivier
ab717bceb5 Merge branch 'release-v1.33.2' into matrix-org-hotfixes 2021-05-11 10:49:58 +01:00
Brendan Abolivier
6157f02067 Revert "improve efficiency of _glob_to_re"
This reverts commit edac710bc0.
2021-05-11 10:49:45 +01:00
Erik Johnston
7865bc1dfb Always cache 'event_to_prev_state_group'
Fixes regression in send PDU times introduced in #9905.
2021-05-07 14:55:22 +01:00
Erik Johnston
e11cd368b7 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-06 15:07:28 +01:00
Erik Johnston
a8f48246b6 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-06 10:25:53 +01:00
Andrew Morgan
696e7df2e8 Merge branch 'release-v1.33.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-29 11:30:12 +01:00
Andrew Morgan
9979fef4fe Revert "Experimental Federation Speedup (#9702)"
This reverts commit 05e8c70c05.
2021-04-27 13:47:39 +01:00
Andrew Morgan
9773abf3d8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-27 13:46:16 +01:00
Richard van der Hoff
7b5022ee2e Merge remote-tracking branch 'origin/release-v1.32.2' into matrix-org-hotfixes 2021-04-21 16:43:10 +01:00
Richard van der Hoff
f21a46216f Merge branch 'release-v1.32.2' into matrix-org-hotfixes 2021-04-21 16:39:55 +01:00
Andrew Morgan
a468d19fd6 Merge branch 'release-v1.32.1' into matrix-org-hotfixes 2021-04-21 10:26:43 +01:00
Richard van der Hoff
edac710bc0 improve efficiency of _glob_to_re 2021-04-19 19:03:38 +01:00
Andrew Morgan
bf4ad8070e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-19 14:32:50 +01:00
Andrew Morgan
118e789e0c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-13 16:10:20 +01:00
Andrew Morgan
77866a5f5f Merge branch 'matrix-org-hotfixes' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-13 16:10:07 +01:00
Erik Johnston
053c8c019f Merge branch 'erikj/fix_stalled_catchup' into matrix-org-hotfixes 2021-04-08 18:05:22 +01:00
Patrick Cloke
fbcc8703dc Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-04-08 08:10:56 -04:00
Erik Johnston
f46b864748 Merge remote-tracking branch 'origin/release-v1.31.0' into matrix-org-hotfixes 2021-03-30 11:41:52 +01:00
Erik Johnston
2b8650547f Merge tag 'v1.30.1' into matrix-org-hotfixes
Synapse 1.30.1 (2021-03-26)
===========================

This release is identical to Synapse 1.30.0, with the exception of explicitly
setting a minimum version of Python's Cryptography library to ensure that users
of Synapse are protected from the recent [OpenSSL security advisories](https://mta.openssl.org/pipermail/openssl-announce/2021-March/000198.html),
especially CVE-2021-3449.

Note that Cryptography defaults to bundling its own statically linked copy of
OpenSSL, which means that you may not be protected by your operating system's
security updates.

It's also worth noting that Cryptography no longer supports Python 3.5, so
admins deploying to older environments may not be protected against this or
future vulnerabilities. Synapse will be dropping support for Python 3.5 at the
end of March.

Updates to the Docker image
---------------------------

- Ensure that the docker container has up to date versions of openssl. ([\#9697](https://github.com/matrix-org/synapse/issues/9697))

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

- Enforce that `cryptography` dependency is up to date to ensure it has the most recent openssl patches. ([\#9697](https://github.com/matrix-org/synapse/issues/9697))
2021-03-26 14:44:31 +00:00
Erik Johnston
f36a060d2c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-24 16:13:19 +00:00
Richard van der Hoff
ea74189a90 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-24 12:45:54 +00:00
Andrew Morgan
05ec9e8d37 Revert "Patch to temporarily drop cross-user m.key_share_requests (#8675)" (#9668)
We patched `matrix-org-hotfixes` a little while ago in #8675 to drop any cross-user key share requests while they were being accidentally spammed by a client. This was a temporary fix until we had some rate-limiting in place.

Rate-limiting landed in https://github.com/matrix-org/synapse/pull/8957. Note that the rate-limit can't be configured, but has what appear to be [sensible defaults](db2efa9c50/synapse/config/ratelimiting.py (L105-L113)).

Note that the original patch was already actually overridden partially when the rate-limit PR landed, as they conflicted. So we've already lifted the restriction between local devices on matrix.org, but requests were still blocked from being sent over federation. This PR cleans up the remaining bits.

This reverts commit d60af9305a.
2021-03-23 10:53:05 +00:00
Andrew Morgan
6557eba7dc Revert "Patch to temporarily drop cross-user m.key_share_requests (#8675)"
This reverts commit d60af9305a.
2021-03-23 10:24:03 +00:00
Richard van der Hoff
d8953b34f2 Merge branch 'develop' into matrix-org-hotfixes 2021-03-16 12:42:54 +00:00
Richard van der Hoff
56c0c711c1 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-09 15:23:55 +00:00
Erik Johnston
61a970e25f Merge remote-tracking branch 'origin/release-v1.29.0' into matrix-org-hotfixes 2021-03-04 10:23:26 +00:00
Erik Johnston
50c242fa29 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-03 16:08:05 +00:00
Erik Johnston
8965291b87 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-03 12:12:15 +00:00
Erik Johnston
81c7b0515d Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-03 10:59:10 +00:00
Richard van der Hoff
fdbccc1e74 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-02-26 14:05:40 +00:00
Richard van der Hoff
0e56f02d5d Revert "Redirect redirect requests if they arrive on the wrong URI"
This reverts commit 5ee8a1c50a.

This has now been superceded on develop by PR #9436.
2021-02-26 14:05:00 +00:00
Richard van der Hoff
c7934aee2c Revert "more login hacking"
This reverts commit 47d2b49e2b.

This has now been superceded on develop by PR 9472.
2021-02-26 14:04:05 +00:00
Erik Johnston
5d405f7e7a Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-02-22 12:55:32 +00:00
Erik Johnston
5054eb291e Merge remote-tracking branch 'origin/release-v1.28.0' into matrix-org-hotfixes 2021-02-19 10:06:01 +00:00
Richard van der Hoff
47d2b49e2b more login hacking 2021-02-18 14:29:48 +00:00
Richard van der Hoff
1f507c2515 Merge branch 'rav/fix_cookie_path' into matrix-org-hotfixes
Merge the cookie fix to hotfixes
2021-02-18 14:03:43 +00:00
Richard van der Hoff
5ee8a1c50a Redirect redirect requests if they arrive on the wrong URI 2021-02-18 14:01:23 +00:00
Richard van der Hoff
7b7831bb63 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-02-17 16:31:57 +00:00
Erik Johnston
a4aa56a0eb Ensure that we never stop reconnecting to redis (#9391) 2021-02-11 17:39:56 +00:00
Patrick Cloke
fa0f99e4f2 Merge branch 'release-v1.27.0' into matrix-org-hotfixes 2021-02-11 11:30:16 -05:00
Richard van der Hoff
844b3e3f65 Revert "block groups requests to fosdem"
This reverts commit 3f6530ed55.
2021-02-06 12:03:46 +00:00
Richard van der Hoff
3f6530ed55 block groups requests to fosdem 2021-02-06 11:04:32 +00:00
Erik Johnston
25757a3d47 Merge branch 'erikj/media_spam_checker' into matrix-org-hotfixes 2021-02-05 10:13:55 +00:00
Erik Johnston
6e774373c2 Merge remote-tracking branch 'origin/release-v1.27.0' into matrix-org-hotfixes 2021-02-02 16:06:59 +00:00
Erik Johnston
512e313f18 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-26 14:15:26 +00:00
Patrick Cloke
a574751a87 Merge remote-tracking branch 'origin/release-v1.26.0' into matrix-org-hotfixes 2021-01-25 08:07:39 -05:00
Erik Johnston
bde75f5f66 Merge remote-tracking branch 'origin/release-v1.26.0' into matrix-org-hotfixes 2021-01-21 16:05:34 +00:00
Erik Johnston
e33124a642 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-20 10:45:19 +00:00
Erik Johnston
bed4fa29fd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-19 10:19:25 +00:00
Erik Johnston
f5ab7d8306 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-18 11:14:37 +00:00
Erik Johnston
029c9ef967 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-15 14:05:55 +00:00
Erik Johnston
e6b27b480c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-14 17:39:13 +00:00
Erik Johnston
43dc637136 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-14 15:29:29 +00:00
Erik Johnston
00c62b9d07 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-08 11:18:20 +00:00
Erik Johnston
82a91208d6 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-07 13:04:45 +00:00
Erik Johnston
91fd180be1 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-07 10:35:04 +00:00
Patrick Cloke
fb4a4f9f15 Merge branch 'release-v1.25.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-01-05 12:12:07 -05:00
Richard van der Hoff
5a4f09228d Remove cache from room directory query results
This reverts a285fe0. Hopefully the cache is no longer required, thanks to
2021-01-05 13:52:36 +00:00
Richard van der Hoff
97d12dcf56 Merge remote-tracking branch 'origin/release-v1.25.0' into matrix-org-hotfixes 2021-01-05 11:32:29 +00:00
Patrick Cloke
f4f65f4e99 Allow redacting events on workers (#8994)
Adds the redacts endpoint to workers that have the client listener.
2020-12-29 11:06:10 -05:00
Patrick Cloke
863359a04f Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-12-15 11:26:13 -05:00
Patrick Cloke
33a349df91 Merge branch 'develop' into matrix-org-hotfixes 2020-12-15 08:23:14 -05:00
Patrick Cloke
a41b1dc49f Merge branch 'release-v1.24.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-12-04 09:03:12 -05:00
Patrick Cloke
16744644f6 Merge branch 'release-v1.24.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-12-02 08:40:21 -05:00
Erik Johnston
dbf46f3891 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-11-27 10:25:17 +00:00
Erik Johnston
52984e9e69 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-11-13 12:05:55 +00:00
Richard van der Hoff
ce2107eee1 Merge branch 'rav/fix_sighup' into matrix-org-hotfixes 2020-10-31 10:54:23 +00:00
Richard van der Hoff
8373e6254f Fix SIGHUP handler
Fixes:

```
builtins.TypeError: _reload_logging_config() takes 1 positional argument but 2 were given
```
2020-10-31 10:53:12 +00:00
Erik Johnston
1ff3bc332a Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-30 12:08:09 +00:00
Andrew Morgan
172ddb3b45 Merge branch 'develop' into matrix-org-hotfixes
* develop:
  Don't unnecessarily start bg process in replication sending loop. (#8670)
  Don't unnecessarily start bg process while handling typing. (#8668)
2020-10-28 12:14:03 +00:00
Andrew Morgan
d60af9305a Patch to temporarily drop cross-user m.key_share_requests (#8675)
Cross-user `m.key_share_requests` are a relatively new `to_device` message that allows user to re-request session keys for a message from another user if they were otherwise unable to retrieve them.

Unfortunately, these have had performance concerns on matrix.org. This is a temporary patch to disable them while we investigate a better solution.
2020-10-28 11:58:47 +00:00
Erik Johnston
bcb6b243e9 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-27 14:13:14 +00:00
Erik Johnston
32457baa40 Merge branch 'release-v1.22.0' into matrix-org-hotfixes 2020-10-26 15:03:36 +00:00
Erik Johnston
ab4cd7f802 Merge remote-tracking branch 'origin/release-v1.21.3' into matrix-org-hotfixes 2020-10-22 09:57:06 +01:00
Erik Johnston
e9b5e642c3 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-10-16 11:34:53 +01:00
Erik Johnston
9250ee8650 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-14 13:32:07 +01:00
Richard van der Hoff
bdbe2b12c2 Revert "block membership events from spammy freenode bridge"
This reverts commit cd2f831b9d.
2020-10-13 17:10:45 +01:00
Erik Johnston
43bcb1e54e Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-13 13:29:50 +01:00
Richard van der Hoff
cd2f831b9d block membership events from spammy freenode bridge 2020-10-12 19:09:30 +01:00
Erik Johnston
4b43332131 Merge remote-tracking branch 'origin/release-v1.21.0' into matrix-org-hotfixes 2020-10-07 17:09:29 +01:00
Richard van der Hoff
77daff166d Merge remote-tracking branch 'origin/release-v1.21.0' into matrix-org-hotfixes 2020-10-02 12:32:26 +01:00
Richard van der Hoff
5ccc0785c1 Revert "fix remote thumbnails?"
This has now been fixed by a different commit (73d93039f).

This reverts commit b0a463f758.
2020-10-02 12:30:49 +01:00
Richard van der Hoff
b0a463f758 fix remote thumbnails? 2020-10-01 15:53:18 +01:00
Richard van der Hoff
8a8d01d732 Merge branch 'develop' into matrix-org-hotfixes 2020-10-01 15:07:33 +01:00
Richard van der Hoff
1c22954668 Revert "Temporary fix to ensure kde can contact matrix.org if stuff breaks"
This reverts commit d90b0946ed.

We believe this is no longer required.
2020-10-01 12:10:55 +01:00
Richard van der Hoff
e675bbcc49 Remove redundant EventCreationHandler._is_worker_app attribute
This was added in 1c347c84bf/#7544 as a temporary optimisation. That was never
merged to develop, since it conflicted with #7492. The merge cf92310da forgot
to remove it.
2020-10-01 11:51:57 +01:00
Richard van der Hoff
607367aeb1 Fix typo in comment
I think this came from a bad merge
2020-10-01 11:43:16 +01:00
Richard van der Hoff
ac6c5f198e Remove dangling changelog.d files
These result from PRs which were cherry-picked from release branches.
2020-10-01 11:31:07 +01:00
Richard van der Hoff
db13a8607e Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-01 11:22:36 +01:00
Richard van der Hoff
cfb3096e33 Revert federation-transaction-transmission backoff hacks
This reverts b852a8247, 15b2a5081, 28889d8da.

I don't think these patches are required any more, and if they are, they should
be on mainline, not hidden in our hotfixes branch. Let's try backing them out:
if that turns out to be an error, we can PR them properly.
2020-10-01 11:22:19 +01:00
Erik Johnston
7b6f857aa9 Merge remote-tracking branch 'origin/release-v1.20.0' into matrix-org-hotfixes 2020-09-22 10:11:01 +01:00
Erik Johnston
9eea5c43af Intelligently select extremities used in backfill. (#8349)
Instead of just using the most recent extremities let's pick the
ones that will give us results that the pagination request cares about,
i.e. pick extremities only if they have a smaller depth than the
pagination token.

This is useful when we fail to backfill an extremity, as we no longer
get stuck requesting that same extremity repeatedly.
2020-09-18 15:07:36 +01:00
Andrew Morgan
104c490274 Use _check_sigs_and_hash_and_fetch to validate backfill requests (#8350)
This is a bit of a hack, as `_check_sigs_and_hash_and_fetch` is intended
for attempting to pull an event from the database/(re)pull it from the
server that originally sent the event if checking the signature of the
event fails.

During backfill we *know* that we won't have the event in our database,
however it is still useful to be able to query the original sending
server as the server we're backfilling from may be acting maliciously.

The main benefit and reason for this change however is that
`_check_sigs_and_hash_and_fetch` will drop an event during backfill if
it cannot be successfully validated, whereas the current code will
simply fail the backfill request - resulting in the client's /messages
request silently being dropped.

This is a quick patch to fix backfilling rooms that contain malformed
events. A better implementation in planned in future.
2020-09-18 15:07:33 +01:00
Patrick Cloke
bbb7ca1f15 Merge remote-tracking branch 'origin/release-v1.19.2' into matrix-org-hotfixes 2020-09-16 08:21:05 -04:00
Patrick Cloke
27ef82d972 Merge remote-tracking branch 'origin/release-v1.20.0' into matrix-org-hotfixes 2020-09-11 07:34:53 -04:00
Richard van der Hoff
9df3a8a19f Merge branch 'release-v1.20.0' into matrix-org-hotfixes 2020-09-09 16:59:10 +01:00
Richard van der Hoff
5c4b13cd8f Merge remote-tracking branch 'origin/release-v1.20.0' into matrix-org-hotfixes 2020-09-07 17:00:02 +01:00
Richard van der Hoff
d74e8f2875 Merge branch 'release-v1.20.0' into matrix-org-hotfixes 2020-09-07 13:44:54 +01:00
Brendan Abolivier
cc23d81a74 Merge branch 'develop' into matrix-org-hotfixes 2020-09-04 11:02:10 +01:00
Brendan Abolivier
505ea932f5 Merge branch 'develop' into matrix-org-hotfixes 2020-09-03 15:30:00 +01:00
Richard van der Hoff
5f224a4794 Merge branch 'develop' into matrix-org-hotfixes 2020-08-28 15:59:57 +01:00
Patrick Cloke
3f488bfded Merge branch 'develop' into matrix-org-hotfixes 2020-08-27 10:16:21 -04:00
Richard van der Hoff
b4c1cfacc2 Merge branch 'develop' into matrix-org-hotfixes 2020-08-18 18:20:01 +01:00
Richard van der Hoff
afe4c4e02e Merge branch 'develop' into matrix-org-hotfixes 2020-08-18 18:13:47 +01:00
Brendan Abolivier
527f73d902 Merge branch 'develop' into matrix-org-hotfixes 2020-08-13 11:45:08 +01:00
Richard van der Hoff
82fec809a5 Merge branch 'develop' into matrix-org-hotfixes 2020-07-31 10:30:05 +01:00
Richard van der Hoff
b2ccc72a00 Merge branch 'release-v1.18.0' into matrix-org-hotfixes 2020-07-28 10:15:22 +01:00
Richard van der Hoff
be777e325d Merge branch 'develop' into matrix-org-hotfixes 2020-07-24 09:57:49 +01:00
Richard van der Hoff
25880bd441 Merge branch 'develop' into matrix-org-hotfixes 2020-07-09 12:49:39 +01:00
Richard van der Hoff
cc86fbc9ad Merge branch 'develop' into matrix-org-hotfixes 2020-07-09 11:06:52 +01:00
Patrick Cloke
bd30967bd7 Merge branch 'release-v1.15.2' into matrix-org-hotfixes 2020-07-02 10:08:07 -04:00
Andrew Morgan
8fed03aa3e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-07-01 11:12:28 +01:00
Andrew Morgan
ba66e3dfef Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-07-01 10:46:06 +01:00
Erik Johnston
199ab854d6 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-06-26 11:08:10 +01:00
Erik Johnston
c16bb06d25 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-06-25 09:39:01 +01:00
Erik Johnston
d06f4ab693 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-06-17 16:32:39 +01:00
Erik Johnston
8ba1086801 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-06-17 14:38:15 +01:00
Brendan Abolivier
fea4b1d6ad Merge branch 'release-v1.15.1' into matrix-org-hotfixes 2020-06-16 11:29:33 +01:00
Brendan Abolivier
ae91d50100 Merge branch 'release-v1.15.1' into matrix-org-hotfixes 2020-06-16 10:16:44 +01:00
Brendan Abolivier
0d29112624 Merge branch 'release-v1.15.0' into matrix-org-hotfixes 2020-06-11 13:43:55 +01:00
Brendan Abolivier
d6c7550cf5 Merge tag 'v1.15.0rc1' of github.com:matrix-org/synapse into matrix-org-hotfixes
Synapse 1.15.0rc1 (2020-06-09)
==============================

Features
--------

- Advertise support for Client-Server API r0.6.0 and remove related unstable feature flags. ([\#6585](https://github.com/matrix-org/synapse/issues/6585))
- Add an option to disable autojoining rooms for guest accounts. ([\#6637](https://github.com/matrix-org/synapse/issues/6637))
- For SAML authentication, add the ability to pass email addresses to be added to new users' accounts via SAML attributes. Contributed by Christopher Cooper. ([\#7385](https://github.com/matrix-org/synapse/issues/7385))
- Add admin APIs to allow server admins to manage users' devices. Contributed by @dklimpel. ([\#7481](https://github.com/matrix-org/synapse/issues/7481))
- Add support for generating thumbnails for WebP images. Previously, users would see an empty box instead of preview image. ([\#7586](https://github.com/matrix-org/synapse/issues/7586))
- Support the standardized `m.login.sso` user-interactive authentication flow. ([\#7630](https://github.com/matrix-org/synapse/issues/7630))

Bugfixes
--------

- Allow new users to be registered via the admin API even if the monthly active user limit has been reached. Contributed by @dkimpel. ([\#7263](https://github.com/matrix-org/synapse/issues/7263))
- Fix email notifications not being enabled for new users when created via the Admin API. ([\#7267](https://github.com/matrix-org/synapse/issues/7267))
- Fix str placeholders in an instance of `PrepareDatabaseException`. Introduced in Synapse v1.8.0. ([\#7575](https://github.com/matrix-org/synapse/issues/7575))
- Fix a bug in automatic user creation during first time login with `m.login.jwt`. Regression in v1.6.0. Contributed by @olof. ([\#7585](https://github.com/matrix-org/synapse/issues/7585))
- Fix a bug causing the cross-signing keys to be ignored when resyncing a device list. ([\#7594](https://github.com/matrix-org/synapse/issues/7594))
- Fix metrics failing when there is a large number of active background processes. ([\#7597](https://github.com/matrix-org/synapse/issues/7597))
- Fix bug where returning rooms for a group would fail if it included a room that the server was not in. ([\#7599](https://github.com/matrix-org/synapse/issues/7599))
- Fix duplicate key violation when persisting read markers. ([\#7607](https://github.com/matrix-org/synapse/issues/7607))
- Prevent an entire iteration of the device list resync loop from failing if one server responds with a malformed result. ([\#7609](https://github.com/matrix-org/synapse/issues/7609))
- Fix exceptions when fetching events from a remote host fails. ([\#7622](https://github.com/matrix-org/synapse/issues/7622))
- Make `synctl restart` start synapse if it wasn't running. ([\#7624](https://github.com/matrix-org/synapse/issues/7624))
- Pass device information through to the login endpoint when using the login fallback. ([\#7629](https://github.com/matrix-org/synapse/issues/7629))
- Advertise the `m.login.token` login flow when OpenID Connect is enabled. ([\#7631](https://github.com/matrix-org/synapse/issues/7631))
- Fix bug in account data replication stream. ([\#7656](https://github.com/matrix-org/synapse/issues/7656))

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

- Update the OpenBSD installation instructions. ([\#7587](https://github.com/matrix-org/synapse/issues/7587))
- Advertise Python 3.8 support in `setup.py`. ([\#7602](https://github.com/matrix-org/synapse/issues/7602))
- Add a link to `#synapse:matrix.org` in the troubleshooting section of the README. ([\#7603](https://github.com/matrix-org/synapse/issues/7603))
- Clarifications to the admin api documentation. ([\#7647](https://github.com/matrix-org/synapse/issues/7647))

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

- Convert the identity handler to async/await. ([\#7561](https://github.com/matrix-org/synapse/issues/7561))
- Improve query performance for fetching state from a PostgreSQL database. ([\#7567](https://github.com/matrix-org/synapse/issues/7567))
- Speed up processing of federation stream RDATA rows. ([\#7584](https://github.com/matrix-org/synapse/issues/7584))
- Add comment to systemd example to show postgresql dependency. ([\#7591](https://github.com/matrix-org/synapse/issues/7591))
- Refactor `Ratelimiter` to limit the amount of expensive config value accesses. ([\#7595](https://github.com/matrix-org/synapse/issues/7595))
- Convert groups handlers to async/await. ([\#7600](https://github.com/matrix-org/synapse/issues/7600))
- Clean up exception handling in `SAML2ResponseResource`. ([\#7614](https://github.com/matrix-org/synapse/issues/7614))
- Check that all asynchronous tasks succeed and general cleanup of `MonthlyActiveUsersTestCase` and `TestMauLimit`. ([\#7619](https://github.com/matrix-org/synapse/issues/7619))
- Convert `get_user_id_by_threepid` to async/await. ([\#7620](https://github.com/matrix-org/synapse/issues/7620))
- Switch to upstream `dh-virtualenv` rather than our fork for Debian package builds. ([\#7621](https://github.com/matrix-org/synapse/issues/7621))
- Update CI scripts to check the number in the newsfile fragment. ([\#7623](https://github.com/matrix-org/synapse/issues/7623))
- Check if the localpart of a Matrix ID is reserved for guest users earlier in the registration flow, as well as when responding to requests to `/register/available`. ([\#7625](https://github.com/matrix-org/synapse/issues/7625))
- Minor cleanups to OpenID Connect integration. ([\#7628](https://github.com/matrix-org/synapse/issues/7628))
- Attempt to fix flaky test: `PhoneHomeStatsTestCase.test_performance_100`. ([\#7634](https://github.com/matrix-org/synapse/issues/7634))
- Fix typos of `m.olm.curve25519-aes-sha2` and `m.megolm.v1.aes-sha2` in comments, test files. ([\#7637](https://github.com/matrix-org/synapse/issues/7637))
- Convert user directory, state deltas, and stats handlers to async/await. ([\#7640](https://github.com/matrix-org/synapse/issues/7640))
- Remove some unused constants. ([\#7644](https://github.com/matrix-org/synapse/issues/7644))
- Fix type information on `assert_*_is_admin` methods. ([\#7645](https://github.com/matrix-org/synapse/issues/7645))
- Convert registration handler to async/await. ([\#7649](https://github.com/matrix-org/synapse/issues/7649))
2020-06-10 10:57:26 +01:00
Brendan Abolivier
4cf4c7dc99 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-06-01 12:58:34 +02:00
Erik Johnston
6fdf5ef66b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-29 13:27:12 +01:00
Brendan Abolivier
d4220574a2 Merge branch 'release-v1.14.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-28 14:12:46 +02:00
Erik Johnston
1a9c8d5ee9 Merge commit 'ef3934ec8f123f6f553b07471588fbcc7f444cd8' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-27 20:06:41 +01:00
Erik Johnston
407dbf8574 Merge branch 'release-v1.14.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-27 13:35:15 +01:00
Erik Johnston
8beca8e21f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-26 09:43:21 +01:00
Erik Johnston
cf92310da2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-21 15:19:00 +01:00
Richard van der Hoff
89f795fe8a Merge branch 'rav/matrix_hacks' into matrix-org-hotfixes 2020-05-20 23:40:22 +01:00
Richard van der Hoff
1c347c84bf inline some config references 2020-05-20 23:33:13 +01:00
Richard van der Hoff
0d8fb99cdf Merge branch 'rav/matrix_hacks' into matrix-org-hotfixes 2020-05-20 22:18:21 +01:00
Richard van der Hoff
b3a9ad124c Fix field name in stubbed out presence servlet 2020-05-20 22:17:59 +01:00
Richard van der Hoff
a902468354 Merge branch 'rav/matrix_hacks' into matrix-org-hotfixes 2020-05-20 22:13:44 +01:00
Richard van der Hoff
84639b32ae stub out GET presence requests 2020-05-20 22:13:32 +01:00
Patrick Cloke
dac5d5ae42 Merge branch 'release-v1.13.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-18 10:27:51 -04:00
Richard van der Hoff
6bd2a39a7d Merge branch 'release-v1.13.0' into matrix-org-hotfixes 2020-05-14 10:08:45 +01:00
Richard van der Hoff
309e30bae3 Merge remote-tracking branch 'origin/release-v1.13.0' into matrix-org-hotfixes 2020-05-11 13:09:14 +01:00
Richard van der Hoff
7ff7a415d1 Revert emergency registration patches
Revert "Merge commit '4d3ebc' into matrix-org-hotfixes"

This reverts commit 617541c4c6, reversing
changes made to ae4f6140f1.
2020-05-11 13:08:48 +01:00
Richard van der Hoff
6610343332 Revert emergency registration patches
Revert "Merge remote-tracking branch 'origin/clokep/no-validate-ui-auth-sess' into matrix-org-hotfixes"

This reverts commit 5adad58d95, reversing
changes made to 617541c4c6.
2020-05-11 13:08:14 +01:00
Richard van der Hoff
5adad58d95 Merge remote-tracking branch 'origin/clokep/no-validate-ui-auth-sess' into matrix-org-hotfixes 2020-05-07 15:19:54 +01:00
Patrick Cloke
d7c7f64f17 Propagate changes to the client dict to the database. 2020-05-07 10:07:09 -04:00
Patrick Cloke
c4c84b67d5 Disable a failing test. 2020-05-07 10:05:00 -04:00
Richard van der Hoff
617541c4c6 Merge commit '4d3ebc' into matrix-org-hotfixes 2020-05-07 14:16:52 +01:00
Patrick Cloke
4d3ebc3620 Disable validation that a UI authentication session has not been modified during a request cycle.
Partial backout of 1c1242acba (#7068)
2020-05-07 08:34:14 -04:00
Richard van der Hoff
ae4f6140f1 Merge branch 'release-v1.13.0' into matrix-org-hotfixes 2020-05-07 10:42:56 +01:00
Richard van der Hoff
323cfe3efb fix bad merge 2020-05-06 12:14:01 +01:00
Richard van der Hoff
b0d2add89d Merge branch 'rav/cross_signing_keys_cache' into matrix-org-hotfixes 2020-05-06 11:59:41 +01:00
Richard van der Hoff
ff20747703 Merge branch 'release-v1.13.0' into matrix-org-hotfixes 2020-05-06 11:57:36 +01:00
Richard van der Hoff
9192f1b9dd Merge rav/upsert_for_device_list into matrix-org-hotfixes 2020-05-06 11:46:19 +01:00
Richard van der Hoff
89d178e8e7 Merge rav/fix_dropped_messages into matrix-org-hotfixes 2020-05-05 22:42:48 +01:00
Richard van der Hoff
1c24e35e85 Merge erikj/faster_device_lists_fetch into matrix-org-hotfixes 2020-05-05 18:36:17 +01:00
Erik Johnston
5debf3071c Fix redis password support 2020-05-04 16:44:21 +01:00
Richard van der Hoff
e9bd4bb388 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-05-01 09:26:57 +01:00
Richard van der Hoff
649e48a799 Merge branch 'develop' into matrix-org-hotfixes 2020-04-24 14:07:47 +01:00
Richard van der Hoff
9b0157686b Merge branch 'release-v1.12.4' into matrix-org-hotfixes 2020-04-22 13:30:35 +01:00
Richard van der Hoff
8288218b29 Merge remote-tracking branch 'origin/release-v1.12.4' into matrix-org-hotfixes 2020-04-21 11:03:32 +01:00
Richard van der Hoff
da5e6eea45 Revert recent merges of #7289 into matrix-org-hotfixes
This was incorrectly merged before it was ready.

This reverts commit aead826d2d, reversing
changes made to 4cd2a4ae3a.

It also reverts commits 9b8212d25, fb3f1fb5c and 2fdfa96ee.
2020-04-21 11:00:57 +01:00
Andrew Morgan
2fdfa96ee6 lint 2020-04-17 17:38:36 +01:00
Andrew Morgan
fb3f1fb5c0 Fix log lines, return type, tuple handling 2020-04-17 17:36:53 +01:00
Andrew Morgan
9b8212d256 Update changelog 2020-04-17 17:36:24 +01:00
Andrew Morgan
aead826d2d Merge branch 'release-v1.12.4' of github.com:matrix-org/synapse into matrix-org-hotfixes
* 'release-v1.12.4' of github.com:matrix-org/synapse:
  Query missing cross-signing keys on local sig upload
2020-04-17 15:49:31 +01:00
Andrew Morgan
4cd2a4ae3a Merge branch 'release-v1.12.4' into HEAD
* release-v1.12.4:
  Only register devices edu handler on the master process (#7255)
  tweak changelog
  1.12.3
  Fix the debian build in a better way. (#7212)
  Fix changelog wording
  1.12.2
  Pin Pillow>=4.3.0,<7.1.0 to fix dep issue
  1.12.1
2020-04-14 13:36:19 +01:00
Andrew Morgan
66cd243e6f Merge branch 'release-v1.12.1' of github.com:matrix-org/synapse into matrix-org-hotfixes
* 'release-v1.12.1' of github.com:matrix-org/synapse:
  Note where bugs were introduced
  1.12.1rc1
  Newsfile
  Rewrite changelog
  Add changelog
  Only import sqlite3 when type checking
  Fix another instance
  Only setdefault for signatures if device has key_json
  Fix starting workers when federation sending not split out.
  matrix.org was fine
  Update CHANGES.md
  changelog typos
  1.12.0 changelog
  1.12.0
  more changelog
  changelog fixes
  fix typo
  1.12.0rc1
  update grafana dashboard
2020-03-31 12:06:11 +01:00
Richard van der Hoff
7b66a1f0d9 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-03-19 10:29:20 +00:00
Richard van der Hoff
059e91bdce Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-03-19 10:03:10 +00:00
Erik Johnston
f86962cb6b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-03-18 17:17:03 +00:00
Brendan Abolivier
03c694bb08 Fix schema deltas 2020-03-12 16:48:11 +00:00
Brendan Abolivier
08d68c5296 Populate the room version from state events
See `rooms_version_column_3.sql.postgres` for details about why we need to do
that.
2020-03-12 15:59:24 +00:00
Brendan Abolivier
568461b5ec Also don't filter out events sent by ignored users when checking state visibility 2020-03-11 17:04:18 +00:00
Brendan Abolivier
6b73b8b70c Fix condition 2020-03-11 15:32:07 +00:00
Brendan Abolivier
936686ed2d Don't filter out events when we're checking the visibility of state 2020-03-11 15:21:25 +00:00
Brendan Abolivier
74050d0c1c Merge branch 'develop' into matrix-org-hotfixes 2020-03-09 15:06:56 +00:00
Richard van der Hoff
69111a8b2a Merge branch 'develop' into matrix-org-hotfixes 2020-02-27 10:46:36 +00:00
Richard van der Hoff
d840ee5bde Revert "skip send without trailing slash"
I think this was done back when most synapses would reject the
no-trailing-slash version; it's no longer required, and makes matrix.org spec-incompliant.

This reverts commit fc5be50d56.
2020-02-27 10:44:55 +00:00
Erik Johnston
e3d811e85d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-19 15:48:33 +00:00
Erik Johnston
578ad9fc48 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-19 15:11:20 +00:00
Richard van der Hoff
9dbe34f0d0 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-02-19 11:40:25 +00:00
Erik Johnston
93a0751302 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-19 10:16:46 +00:00
Erik Johnston
bc936b5657 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-18 16:11:26 +00:00
Richard van der Hoff
d6eae548a7 Merge branch 'release-v1.10.0' into matrix-org-hotfixes 2020-02-11 10:43:32 +00:00
Richard van der Hoff
e439438b9b Merge branch 'release-v1.10.0' into matrix-org-hotfixes 2020-02-10 09:56:51 +00:00
Richard van der Hoff
f8a1e0d1d2 Merge branch 'release-v1.10.0' into matrix-org-hotfixes 2020-02-10 09:54:40 +00:00
Erik Johnston
8a29def84a Add support for putting fed user query API on workers (#6873) 2020-02-07 15:59:05 +00:00
Erik Johnston
77a166577a Allow moving group read APIs to workers (#6866) 2020-02-07 13:57:07 +00:00
Erik Johnston
7d5268d37c Merge branch 'release-v1.10.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-06 10:26:39 +00:00
Erik Johnston
c854d255e5 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-31 15:06:16 +00:00
Brendan Abolivier
c660962d4d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-22 13:48:11 +00:00
Richard van der Hoff
767bef0033 Merge branch 'rav/storage_provider_debug' into matrix-org-hotfixes 2020-01-21 23:03:22 +00:00
Richard van der Hoff
4d02bfd6e1 a bit of debugging for media storage providers 2020-01-21 23:02:58 +00:00
Andrew Morgan
a099ab7d38 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-14 10:37:32 +00:00
Erik Johnston
ce72a9ccdb Merge branch 'erikj/media_admin_apis' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-08 15:52:58 +00:00
Erik Johnston
bace86ed15 Merge branch 'release-v1.8.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-08 15:52:48 +00:00
Erik Johnston
45bf455948 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-07 14:24:36 +00:00
Richard van der Hoff
859663565c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-01-06 15:43:41 +00:00
Richard van der Hoff
0876a5b641 Merge branch 'release-v1.7.3' into matrix-org-hotfixes 2019-12-31 10:47:29 +00:00
Richard van der Hoff
5b5314ee41 Merge branch 'release-v1.7.2' into matrix-org-hotfixes 2019-12-20 10:48:04 +00:00
Richard van der Hoff
aff9189149 Merge remote-tracking branch 'origin/release-v1.7.1' into matrix-org-hotfixes 2019-12-17 16:00:43 +00:00
Richard van der Hoff
2eda49a8db Merge remote-tracking branch 'origin/release-v1.7.1' into matrix-org-hotfixes 2019-12-17 10:56:36 +00:00
Richard van der Hoff
96b17d4e4f Merge remote-tracking branch 'origin/release-v1.7.0' into matrix-org-hotfixes 2019-12-17 10:56:26 +00:00
Erik Johnston
aadc131dc1 Merge branch 'babolivier/pusher-room-store' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-12-10 12:50:04 +00:00
Neil Johnson
0a522121a0 Merge branch 'release-v1.7.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-12-10 11:25:28 +00:00
Andrew Morgan
0b5e2c8093 Merge branch 'release-v1.6.1' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-28 11:40:33 +00:00
Erik Johnston
c665d154a2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-26 18:56:54 +00:00
Neil Johnson
31295b5a60 Merge branch 'release-v1.6.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-26 13:16:18 +00:00
Erik Johnston
aebe20c452 Fix phone home stats (#6418)
Fix phone home stats
2019-11-26 13:10:09 +00:00
Andrew Morgan
508e0f9310 1.6.0 2019-11-26 12:15:46 +00:00
Andrew Morgan
e04e7e830e Merge branch 'release-v1.6.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-26 12:06:38 +00:00
Andrew Morgan
5407e69732 Change /push/v1/notify IP to 10.103.0.7 2019-11-26 12:04:19 +00:00
Erik Johnston
2c59eb368c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-20 15:17:10 +00:00
Erik Johnston
6d1a3e2bdd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-19 12:59:39 +00:00
Richard van der Hoff
7fa4586e36 Merge branch 'rav/url_preview_limit_title_2' into matrix-org-hotfixes 2019-11-05 18:18:02 +00:00
Erik Johnston
33b4aa8d99 Merge branch 'release-v1.5.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-29 12:18:44 +00:00
Erik Johnston
627cf5def8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-25 11:35:14 +01:00
Erik Johnston
b409d51dee Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-25 10:19:09 +01:00
Erik Johnston
4a4e620f30 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-11 10:40:15 +01:00
Richard van der Hoff
28889d8da5 fix logging 2019-10-11 09:57:18 +01:00
Richard van der Hoff
15b2a50817 Add some randomness to the high-cpu backoff hack 2019-10-11 09:15:56 +01:00
Richard van der Hoff
b852a8247d Awful hackery to try to get the fed sender to keep up
Basically, if the federation sender starts getting behind, insert some sleeps
into the transaction transmission code to give the fed sender a chance to catch
up.

Might have to experiment a bit with the numbers.
2019-10-10 10:34:08 +01:00
Erik Johnston
7b55cca011 Merge branch 'erikj/cache_memberships' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-07 13:15:22 +01:00
Richard van der Hoff
a9577ab1f4 Merge branch 'develop' into matrix-org-hotfixes 2019-10-03 17:52:22 +01:00
Richard van der Hoff
cb217d5d60 Revert "Awful hackery to try to get the fed sender to keep up"
This reverts commit 721086a291.

This didn't help.
2019-10-03 17:05:24 +01:00
Andrew Morgan
f4f5355bcf Merge branch 'release-v1.4.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-03 13:06:32 +01:00
Erik Johnston
23bb2713d2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-02 16:51:08 +01:00
Erik Johnston
b2471e1109 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-02 15:39:31 +01:00
Erik Johnston
610219d53d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-02 14:09:29 +01:00
Erik Johnston
b464afe283 Merge branch 'release-v1.4.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-02 11:09:05 +01:00
Richard van der Hoff
7657ad3ced Merge branch 'rav/federation_sender_hackery' into matrix-org-hotfixes 2019-09-27 16:14:52 +01:00
Richard van der Hoff
721086a291 Awful hackery to try to get the fed sender to keep up
Basically, if the federation sender starts getting behind, insert some sleeps
into the transaction transmission code to give the fed sender a chance to catch
up.

Might have to experiment a bit with the numbers.
2019-09-27 16:13:51 +01:00
Richard van der Hoff
6e6b53ed3a Merge branch 'develop' into matrix-org-hotfixes 2019-09-26 15:22:33 +01:00
Richard van der Hoff
601b50672d Merge branch 'develop' into matrix-org-hotfixes 2019-09-25 12:48:40 +01:00
Richard van der Hoff
a7af389da0 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-09-24 17:05:15 +01:00
Neil Johnson
99db0d76fd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-24 14:56:12 +01:00
Richard van der Hoff
561b0f79bc Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-09-24 10:11:19 +01:00
Richard van der Hoff
8569f3cdef Merge branch 'rav/fix_retry_reset' into matrix-org-hotfixes 2019-09-20 12:14:19 +01:00
Richard van der Hoff
7b61e6f5d6 Merge branch 'develop' into matrix-org-hotfixes 2019-09-18 13:55:25 +01:00
Richard van der Hoff
05241b3031 Revert "Fix m.federate bug"
This has now been merged into develop (142c9325c) so we no longer need this
cherry-picked commit.

This reverts commit ee91c69ef7.
2019-09-18 13:54:57 +01:00
Richard van der Hoff
e01026d84d Revert "Fix existing v2 identity server calls (MSC2140) (#6013)"
This has now been merged into develop (3505ffcda) so we don't need this
cherry-picked commit.

This reverts commit e0eef47315.
2019-09-18 13:53:37 +01:00
Erik Johnston
ee91c69ef7 Fix m.federate bug 2019-09-13 14:44:48 +01:00
Andrew Morgan
e0eef47315 Fix existing v2 identity server calls (MSC2140) (#6013)
Two things I missed while implementing [MSC2140](https://github.com/matrix-org/matrix-doc/pull/2140/files#diff-c03a26de5ac40fb532de19cb7fc2aaf7R80).

1. Access tokens should be provided to the identity server as `access_token`, not `id_access_token`, even though the homeserver may accept the tokens as `id_access_token`.
2. Access tokens must be sent to the identity server in a query parameter, the JSON body is not allowed.

We now send the access token as part of an `Authorization: ...` header, which fixes both things.

The breaking code was added in https://github.com/matrix-org/synapse/pull/5892

Sytest PR: https://github.com/matrix-org/sytest/pull/697
2019-09-13 14:08:26 +01:00
Erik Johnston
44d2ca2990 Merge branch 'anoa/fix_3pid_validation' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-10 18:15:24 +01:00
Erik Johnston
9240622c1a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-06 14:10:53 +01:00
Erik Johnston
0dbba85e95 Merge branch 'anoa/worker_store_reg' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-06 13:02:12 +01:00
Andrew Morgan
1ceeccb769 Move get_threepid_validation_session into RegistrationWorkerStore 2019-09-06 13:00:34 +01:00
Erik Johnston
39883e85bd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-06 12:50:28 +01:00
Erik Johnston
68f53b7a0e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-06 09:53:37 +01:00
Erik Johnston
e679b008ff Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-05 15:23:40 +01:00
Erik Johnston
e80a5b7492 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-04 13:13:30 +01:00
Richard van der Hoff
b272e7345f Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-08-30 12:01:24 +01:00
Erik Johnston
a81e0233e9 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-29 11:18:57 +01:00
Richard van der Hoff
80898481ab Merge branch 'release-v1.3.1' into matrix-org-hotfixes 2019-08-17 09:22:30 +01:00
Brendan Abolivier
9d4c716d85 Merge branch 'release-v1.3.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-15 11:36:00 +01:00
Brendan Abolivier
d90b0946ed Temporary fix to ensure kde can contact matrix.org if stuff breaks 2019-08-13 18:05:06 +01:00
Brendan Abolivier
8d5762b0dc Merge branch 'release-v1.3.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-13 17:39:30 +01:00
Brendan Abolivier
a7efbc5416 Merge branch 'release-v1.3.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-13 15:54:01 +01:00
Richard van der Hoff
be362cb8f8 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-08-13 10:52:19 +01:00
Erik Johnston
873ff9522b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-01 14:46:09 +01:00
Erik Johnston
c1ee2999a0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-31 10:01:56 +01:00
Erik Johnston
9b2b386f76 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-30 13:26:19 +01:00
Erik Johnston
65fe31786d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-30 10:12:13 +01:00
Andrew Morgan
70b6d1dfd6 Merge branch 'release-v1.2.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-24 13:32:41 +01:00
Erik Johnston
ee62aed72e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-23 10:23:40 +01:00
Erik Johnston
c02f26319d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-23 09:20:26 +01:00
Andrew Morgan
fdd182870c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-22 10:19:16 +01:00
Richard van der Hoff
4102cb220a Merge branch 'release-v1.2.0' into matrix-org-hotfixes 2019-07-18 15:20:00 +01:00
Erik Johnston
5299707329 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-17 10:56:55 +01:00
Richard van der Hoff
43e01be158 Merge remote-tracking branch 'origin/release-v1.1.0' into matrix-org-hotfixes 2019-07-03 09:49:35 +01:00
Richard van der Hoff
589e080c6b Merge branch 'release-v1.1.0' into matrix-org-hotfixes 2019-07-03 09:47:55 +01:00
Richard van der Hoff
24e48bc9ff Merge branch 'release-v1.1.0' into matrix-org-hotfixes 2019-07-02 12:05:33 +01:00
Erik Johnston
576b62a6a3 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-28 10:04:54 +01:00
Erik Johnston
ad2ba70959 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-24 15:31:36 +01:00
Erik Johnston
a330505025 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-21 14:36:13 +01:00
Erik Johnston
67b73fd147 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-21 13:27:04 +01:00
Erik Johnston
c08e4dbadc Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-17 14:10:28 +01:00
Erik Johnston
6dbd498772 Merge branch 'master' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-11 17:25:54 +01:00
Erik Johnston
03b09b32d6 Merge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-11 14:00:50 +01:00
Erik Johnston
8f1711da0e Merge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-11 00:23:54 +01:00
Erik Johnston
6fb6c98f71 Merge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-10 18:34:45 +01:00
Erik Johnston
aad993f24d Merge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-10 16:05:10 +01:00
Erik Johnston
544e101c24 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-04 16:58:38 +01:00
Richard van der Hoff
8699f380f0 hotfix RetryLimiter 2019-06-04 12:14:41 +01:00
Richard van der Hoff
e91a68ef3a Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-06-04 11:59:55 +01:00
Richard van der Hoff
9f5048c198 Merge branch 'rav/limit_displayname_length' into matrix-org-hotfixes 2019-06-01 11:15:43 +01:00
Erik Johnston
b3c40ba58a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-05-31 10:58:47 +01:00
Erik Johnston
8d69193a42 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-05-30 14:33:44 +01:00
Erik Johnston
bbcd19f2d0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-05-24 10:53:01 +01:00
Erik Johnston
3cd598135f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-05-23 15:54:13 +01:00
Richard van der Hoff
1c8f2c34ff Merge branch 'develop' into matrix-org-hotfixes 2019-05-21 16:29:25 +01:00
Richard van der Hoff
ca03f90ee7 Merge branch 'develop' into matrix-org-hotfixes 2019-05-20 15:55:39 +01:00
Richard van der Hoff
9feee29d76 Merge tag 'v0.99.4rc1' into matrix-org-hotfixes
v0.99.4rc1
2019-05-14 11:12:22 +01:00
Richard van der Hoff
e7dcee13da Merge commit 'a845abbf3' into matrix-org-hotfixes 2019-05-03 17:12:28 +01:00
Richard van der Hoff
7467738834 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-05-02 13:37:35 +01:00
Erik Johnston
d75fb8ae22 Merge branch 'erikj/ratelimit_3pid_invite' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-26 18:12:33 +01:00
Erik Johnston
ae25a8efef Merge branch 'erikj/postpath' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-17 10:14:57 +01:00
Richard van der Hoff
fc5be50d56 skip send without trailing slash 2019-04-16 15:16:57 +01:00
Erik Johnston
aadba440da Point pusher to new box 2019-04-15 19:23:21 +01:00
Erik Johnston
ec94d6a590 VersionRestServlet doesn't take a param 2019-04-15 19:21:32 +01:00
Erik Johnston
42ce90c3f7 Merge branch 'erikj/move_endpoints' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-15 18:56:46 +01:00
Erik Johnston
8467756dc1 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-04 14:43:57 +01:00
Erik Johnston
613b443ff0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-02 18:25:45 +01:00
Richard van der Hoff
233b61ac61 Remove spurious changelog files from hotfixes
The relevant patches are now in develop thanks to
https://github.com/matrix-org/synapse/pull/4816.
2019-04-02 13:51:37 +01:00
Richard van der Hoff
f41c9d37d6 Merge branch 'develop' into matrix-org-hotfixes 2019-04-02 13:47:08 +01:00
Neil Johnson
1048e2ca6a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-27 09:18:35 +00:00
Richard van der Hoff
ce0ce1add3 Merge branch 'develop' into matrix-org-hotfixes 2019-03-25 16:48:56 +00:00
Erik Johnston
b0bf1ea7bd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-21 14:10:31 +00:00
Richard van der Hoff
2561b628af Merge branch 'develop' into matrix-org-hotfixes 2019-03-19 12:19:20 +00:00
Richard van der Hoff
73c6630718 Revert "Reinstate EDU-batching hacks"
This reverts commit ed8ccc3737.
2019-03-19 12:17:28 +00:00
Erik Johnston
a189bb03ab Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-14 14:39:06 +00:00
Erik Johnston
404a2d70be Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-14 13:55:29 +00:00
Richard van der Hoff
ed8ccc3737 Reinstate EDU-batching hacks
This reverts commit c7285607a3.
2019-03-13 14:42:11 +00:00
Erik Johnston
18b1a92162 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-08 09:56:17 +00:00
Amber Brown
199aa72d35 Merge branch 'develop' of ssh://github.com/matrix-org/synapse into
matrix-org-hotfixes
2019-03-07 21:43:10 +11:00
Erik Johnston
8f7dbbc14a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-06 19:30:30 +00:00
Erik Johnston
27dbc9ac42 Reenable presence tests and remove pointless change 2019-03-06 17:12:45 +00:00
Richard van der Hoff
e9aa401994 Remove redundant changes from synapse/replication/tcp/streams.py (#4813)
This was some hacky code (introduced in c10c71e70d) to make the presence stream
do nothing on hotfixes. We now ensure that no replication clients subscribe to
the presence stream, so this is redundant.
2019-03-06 13:21:32 +00:00
Richard van der Hoff
9e9572c79e Run black on synapse/handlers/user_directory.py (#4812)
This got done on the develop branch in #4635, but the subsequent merge to
hotfixes (88af0317a) discarded the changes for some reason.

Fixing this here and now means (a) there are fewer differences between
matrix-org-hotfixes and develop, making future patches easier to merge, and (b)
fixes some pep8 errors on the hotfixes branch which have been annoying me for
some time.
2019-03-06 11:56:03 +00:00
Richard van der Hoff
c7285607a3 Revert EDU-batching hacks from matrix-org-hotfixes
Firstly: we want to do this in a better way, which is the intention of
too many RRs, which means we need to make it happen again.

This reverts commits: 8d7c0264b 000d23090 eb0334b07 4d07dc0d1
2019-03-06 11:04:53 +00:00
Erik Johnston
a6e2546980 Fix outbound federation 2019-03-05 14:50:37 +00:00
Erik Johnston
dc510e0e43 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-05 14:41:13 +00:00
Richard van der Hoff
ed12338f35 Remove #4733 debug (#4767)
We don't need any of this stuff now; this brings protocol.py back into line
with develop for the hotfixes branch.
2019-03-04 14:00:03 +00:00
Richard van der Hoff
bf3f8b8855 Add more debug for #4422 (#4769) 2019-02-28 17:46:22 +00:00
Richard van der Hoff
67acd1aa1b Merge branch 'develop' into matrix-org-hotfixes 2019-02-27 10:29:24 +00:00
Erik Johnston
75c924430e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-26 09:36:29 +00:00
Richard van der Hoff
6087c53830 Add more debug for membership syncing issues (#4719) 2019-02-25 17:00:18 +00:00
Erik Johnston
b50fe65a22 Add logging when sending error 2019-02-25 15:55:21 +00:00
Erik Johnston
17009e689b Merge pull request #4734 from matrix-org/rav/repl_debug
Add some debug to help with #4733
2019-02-25 15:52:45 +00:00
Richard van der Hoff
5d2f755d3f Add some debug to help with #4733 2019-02-25 14:37:23 +00:00
Richard van der Hoff
8d7c0264bc more fix edu batching hackery 2019-02-24 23:27:52 +00:00
Richard van der Hoff
000d230901 fix edu batching hackery 2019-02-24 23:19:37 +00:00
Richard van der Hoff
eb0334b07c more edu batching hackery 2019-02-24 23:15:09 +00:00
Richard van der Hoff
4d07dc0d18 Add a delay to the federation loop for EDUs 2019-02-24 22:24:36 +00:00
Erik Johnston
0ea52872ab Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-22 15:29:41 +00:00
Richard van der Hoff
6868d53fe9 bail out early in on_new_receipts if no pushers 2019-02-21 15:58:15 +00:00
Richard van der Hoff
68af15637b Merge branch 'develop' into matrix-org-hotfixes 2019-02-20 14:24:17 +00:00
Richard van der Hoff
4da63d9f6f Merge branch 'develop' into matrix-org-hotfixes 2019-02-20 14:15:56 +00:00
Richard van der Hoff
085d69b0bd Apply the pusher http hack in the right place (#4692)
Do it in the constructor, so that it works for badge updates as well as pushes
2019-02-20 11:25:10 +00:00
Erik Johnston
776fe6c184 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-20 09:52:24 +00:00
Erik Johnston
0e07d2c7d5 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-19 13:24:37 +00:00
Erik Johnston
90ec885805 Revert "Merge pull request #4654 from matrix-org/hawkowl/registration-worker"
This reverts commit 5bd2e2c31d, reversing
changes made to d97c3a6ce6.
2019-02-19 13:23:17 +00:00
Erik Johnston
5a28154c4d Revert "Merge pull request #4655 from matrix-org/hawkowl/registration-worker"
This reverts commit 93555af5c9, reversing
changes made to 5bd2e2c31d.
2019-02-19 13:23:14 +00:00
Erik Johnston
2fcb51e703 Merge branch 'matthew/well-known-cors' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-18 18:38:49 +00:00
Erik Johnston
26f524872f Revert change that cached connection factory 2019-02-18 18:36:54 +00:00
Erik Johnston
88af0317a2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-15 22:39:13 +00:00
Erik Johnston
c10c71e70d Emergency changes 2019-02-15 18:15:21 +00:00
Erik Johnston
93555af5c9 Merge pull request #4655 from matrix-org/hawkowl/registration-worker
Device replication
2019-02-15 18:12:49 +00:00
Amber Brown
06622e4110 fix 2019-02-16 05:11:09 +11:00
Amber Brown
155efa9e36 fix 2019-02-16 05:10:48 +11:00
Amber Brown
3175edc5d8 maybe 2019-02-16 05:09:08 +11:00
Amber Brown
d95252c01f use a device replication thingy 2019-02-16 05:08:58 +11:00
Erik Johnston
5bd2e2c31d Merge pull request #4654 from matrix-org/hawkowl/registration-worker
Registration worker
2019-02-15 17:51:34 +00:00
Amber Brown
84528e4fb2 cleanup 2019-02-16 04:49:09 +11:00
Amber Brown
e4381ed514 pep8 2019-02-16 04:42:04 +11:00
Amber Brown
d9235b9e29 fix appservice, add to frontend proxy 2019-02-16 04:39:49 +11:00
Amber Brown
ce5f3b1ba5 add all the files 2019-02-16 04:35:58 +11:00
Amber Brown
7b5c04312e isort 2019-02-16 04:35:27 +11:00
Amber Brown
f5bafd70f4 add cache remover endpoint and wire it up 2019-02-16 04:34:23 +11:00
Richard van der Hoff
d97c3a6ce6 Merge remote-tracking branch 'origin/release-v0.99.1' into matrix-org-hotfixes 2019-02-13 14:29:05 +00:00
Erik Johnston
341c35614a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-13 10:29:31 +00:00
Richard van der Hoff
fecf28319c Merge branch 'release-v0.99.0' into matrix-org-hotfixes 2019-02-01 13:29:31 +00:00
Richard van der Hoff
345d8cfb69 Merge branch 'release-v0.99.0' into matrix-org-hotfixes 2019-02-01 13:21:42 +00:00
Richard van der Hoff
b60d005156 Merge branch 'develop' into matrix-org-hotfixes 2019-01-31 18:44:04 +00:00
Richard van der Hoff
6c232a69df Revert "Break infinite loop on redaction in v3 rooms"
We've got a better fix of this now.

This reverts commit decb5698b3.
2019-01-31 18:43:49 +00:00
Amber Brown
e97c1df30c remove slow code on userdir (#4534) 2019-01-31 13:26:38 +00:00
Richard van der Hoff
decb5698b3 Break infinite loop on redaction in v3 rooms 2019-01-31 00:23:58 +00:00
Erik Johnston
62962e30e4 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-30 17:04:08 +00:00
Erik Johnston
05413d4e20 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-30 14:27:19 +00:00
Erik Johnston
ca46dcf683 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-30 13:11:25 +00:00
Erik Johnston
d351be1567 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-30 11:48:29 +00:00
Andrew Morgan
c7f2eaf4f4 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-29 10:07:13 +00:00
Andrew Morgan
53d25116df Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-25 14:33:14 +00:00
Andrew Morgan
08e25ffa0c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-24 15:51:59 +00:00
Andrew Morgan
1c148e442b Merge branch 'anoa/room_dir_quick_fix' into matrix-org-hotfixes 2019-01-24 15:37:16 +00:00
Andrew Morgan
acaca1b4e9 Merge branch 'anoa/room_dir_quick_fix' into matrix-org-hotfixes 2019-01-24 14:51:35 +00:00
Andrew Morgan
4777836b83 Fix missing synapse metrics import 2019-01-23 15:26:03 +00:00
Andrew Morgan
7da659dd6d Use existing stream position counter metric 2019-01-23 15:04:12 +00:00
Andrew Morgan
77dfe51aba Name metric consistently 2019-01-23 15:04:05 +00:00
Andrew Morgan
ef7865e2f2 Track user_dir current event stream position 2019-01-23 15:03:54 +00:00
Matthew Hodgson
5cb15c0443 warn if we ignore device lists 2019-01-15 22:11:46 +00:00
Matthew Hodgson
b43172ffbc Merge pull request #4396 from matrix-org/matthew/bodge_device_update_dos
limit remote device lists to 10000 entries per user
2019-01-15 21:47:00 +00:00
Matthew Hodgson
b4796d1814 drop the limit to 1K as e2e will be hosed beyond that point anyway 2019-01-15 21:46:29 +00:00
Matthew Hodgson
482d06774a don't store remote device lists if they have more than 10K devices 2019-01-15 21:38:07 +00:00
Matthew Hodgson
046d731fbd limit remote device lists to 1000 entries per user 2019-01-15 21:07:12 +00:00
Richard van der Hoff
892f6c98ec Merge tag 'v0.34.1.1' into matrix-org-hotfixes
Synapse 0.34.1.1 (2019-01-11)
=============================

This release fixes CVE-2019-5885 and is recommended for all users of Synapse 0.34.1.

This release is compatible with Python 2.7 and 3.5+. Python 3.7 is fully supported.

Bugfixes
--------

- Fix spontaneous logout on upgrade
  ([\#4374](https://github.com/matrix-org/synapse/issues/4374))
2019-01-11 10:21:18 +00:00
Erik Johnston
7fafa2d954 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-09 09:13:16 +00:00
Richard van der Hoff
1d63046542 Merge tag 'v0.34.1rc1' into matrix-org-hotfixes
Synapse 0.34.1rc1 (2019-01-08)
==============================

Features
--------

- Special-case a support user for use in verifying behaviour of a given server. The support user does not appear in user directory or monthly active user counts. ([\#4141](https://github.com/matrix-org/synapse/issues/4141), [\#4344](https://github.com/matrix-org/synapse/issues/4344))
- Support for serving .well-known files ([\#4262](https://github.com/matrix-org/synapse/issues/4262))
- Rework SAML2 authentication ([\#4265](https://github.com/matrix-org/synapse/issues/4265), [\#4267](https://github.com/matrix-org/synapse/issues/4267))
- SAML2 authentication: Initialise user display name from SAML2 data ([\#4272](https://github.com/matrix-org/synapse/issues/4272))
- Synapse can now have its conditional/extra dependencies installed by pip. This functionality can be used by using `pip install matrix-synapse[feature]`, where feature is a comma separated list with the possible values `email.enable_notifs`, `matrix-synapse-ldap3`, `postgres`, `resources.consent`, `saml2`, `url_preview`, and `test`. If you want to install all optional dependencies, you can use "all" instead. ([\#4298](https://github.com/matrix-org/synapse/issues/4298), [\#4325](https://github.com/matrix-org/synapse/issues/4325), [\#4327](https://github.com/matrix-org/synapse/issues/4327))
- Add routes for reading account data. ([\#4303](https://github.com/matrix-org/synapse/issues/4303))
- Add opt-in support for v2 rooms ([\#4307](https://github.com/matrix-org/synapse/issues/4307))
- Add a script to generate a clean config file ([\#4315](https://github.com/matrix-org/synapse/issues/4315))
- Return server data in /login response ([\#4319](https://github.com/matrix-org/synapse/issues/4319))

Bugfixes
--------

- Fix contains_url check to be consistent with other instances in code-base and check that value is an instance of string. ([\#3405](https://github.com/matrix-org/synapse/issues/3405))
- Fix CAS login when username is not valid in an MXID ([\#4264](https://github.com/matrix-org/synapse/issues/4264))
- Send CORS headers for /media/config ([\#4279](https://github.com/matrix-org/synapse/issues/4279))
- Add 'sandbox' to CSP for media reprository ([\#4284](https://github.com/matrix-org/synapse/issues/4284))
- Make the new landing page prettier. ([\#4294](https://github.com/matrix-org/synapse/issues/4294))
- Fix deleting E2E room keys when using old SQLite versions. ([\#4295](https://github.com/matrix-org/synapse/issues/4295))
- The metric synapse_admin_mau:current previously did not update when config.mau_stats_only was set to True ([\#4305](https://github.com/matrix-org/synapse/issues/4305))
- Fixed per-room account data filters ([\#4309](https://github.com/matrix-org/synapse/issues/4309))
- Fix indentation in default config ([\#4313](https://github.com/matrix-org/synapse/issues/4313))
- Fix synapse:latest docker upload ([\#4316](https://github.com/matrix-org/synapse/issues/4316))
- Fix test_metric.py compatibility with prometheus_client 0.5. Contributed by Maarten de Vries <maarten@de-vri.es>. ([\#4317](https://github.com/matrix-org/synapse/issues/4317))
- Avoid packaging _trial_temp directory in -py3 debian packages ([\#4326](https://github.com/matrix-org/synapse/issues/4326))
- Check jinja version for consent resource ([\#4327](https://github.com/matrix-org/synapse/issues/4327))
- fix NPE in /messages by checking if all events were filtered out ([\#4330](https://github.com/matrix-org/synapse/issues/4330))
- Fix `python -m synapse.config` on Python 3. ([\#4356](https://github.com/matrix-org/synapse/issues/4356))

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

- Remove the deprecated v1/register API on Python 2. It was never ported to Python 3. ([\#4334](https://github.com/matrix-org/synapse/issues/4334))

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

- Getting URL previews of IP addresses no longer fails on Python 3. ([\#4215](https://github.com/matrix-org/synapse/issues/4215))
- drop undocumented dependency on dateutil ([\#4266](https://github.com/matrix-org/synapse/issues/4266))
- Update the example systemd config to use a virtualenv ([\#4273](https://github.com/matrix-org/synapse/issues/4273))
- Update link to kernel DCO guide ([\#4274](https://github.com/matrix-org/synapse/issues/4274))
- Make isort tox check print diff when it fails ([\#4283](https://github.com/matrix-org/synapse/issues/4283))
- Log room_id in Unknown room errors ([\#4297](https://github.com/matrix-org/synapse/issues/4297))
- Documentation improvements for coturn setup. Contributed by Krithin Sitaram. ([\#4333](https://github.com/matrix-org/synapse/issues/4333))
- Update pull request template to use absolute links ([\#4341](https://github.com/matrix-org/synapse/issues/4341))
- Update README to not lie about required restart when updating TLS certificates ([\#4343](https://github.com/matrix-org/synapse/issues/4343))
- Update debian packaging for compatibility with transitional package ([\#4349](https://github.com/matrix-org/synapse/issues/4349))
- Fix command hint to generate a config file when trying to start without a config file ([\#4353](https://github.com/matrix-org/synapse/issues/4353))
- Add better logging for unexpected errors while sending transactions ([\#4358](https://github.com/matrix-org/synapse/issues/4358))
2019-01-08 11:37:25 +00:00
Richard van der Hoff
4c238a9a91 Merge remote-tracking branch 'origin/release-v0.34.0' into matrix-org-hotfixes 2018-12-19 10:24:26 +00:00
Richard van der Hoff
002db39a36 Merge tag 'v0.34.0rc1' into matrix-org-hotfixes 2018-12-04 14:07:28 +00:00
Richard van der Hoff
c4074e4ab6 Revert "Merge branch 'rav/timestamp_patch' into matrix-org-hotfixes"
This reverts commit 7960e814e5, reversing
changes made to 3dd704ee9a.

We no longer need this; please redo it as a proper MSC & synapse PR if you want
to keep it...
2018-12-03 10:15:39 +00:00
Richard van der Hoff
7960e814e5 Merge branch 'rav/timestamp_patch' into matrix-org-hotfixes 2018-11-30 12:10:30 +00:00
Richard van der Hoff
080025e533 Fix buglet and remove thread_id stuff 2018-11-30 12:09:33 +00:00
Richard van der Hoff
9accd63a38 Initial patch from Erik 2018-11-30 12:04:38 +00:00
Richard van der Hoff
3dd704ee9a Merge branch 'develop' into matrix-org-hotfixes 2018-11-20 11:29:45 +00:00
Richard van der Hoff
28e28a1974 Merge branch 'develop' into matrix-org-hotfixes 2018-11-20 11:03:35 +00:00
Richard van der Hoff
b699178aa1 Merge branch 'develop' into matrix-org-hotfixes 2018-11-14 11:54:29 +00:00
Richard van der Hoff
c08c649fa1 Merge remote-tracking branch 'origin/erikj/fix_device_comparison' into matrix-org-hotfixes 2018-11-08 12:48:19 +00:00
hera
5c0c4b4079 Fix encoding error for consent form on python3
The form was rendering this as "b'01234....'".

-- richvdh
2018-11-08 11:03:39 +00:00
Richard van der Hoff
b55cdfaa31 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-11-08 10:47:56 +00:00
Richard van der Hoff
34406cf22c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-11-06 10:49:20 +00:00
Amber Brown
f91aefd245 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-31 04:41:03 +11:00
Erik Johnston
f8281f42c8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-10-29 18:16:58 +00:00
Amber Brown
7171bdf279 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-29 23:14:47 +11:00
Erik Johnston
9f2d14ee26 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-10-26 09:52:23 +01:00
Amber Brown
ead471e72d Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-22 22:18:02 +11:00
Richard van der Hoff
9a4011de46 Merge branch 'develop' into matrix-org-hotfixes 2018-10-18 16:37:01 +01:00
Amber Brown
33551be61b Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-15 20:15:27 +11:00
Richard van der Hoff
eeb29d99fd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-09 09:49:08 +01:00
Richard van der Hoff
1a0c407e6b Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-09 09:47:37 +01:00
Erik Johnston
c4b37cbf18 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-10-02 16:44:57 +01:00
Erik Johnston
7fa156af80 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-10-02 14:39:30 +01:00
Richard van der Hoff
78825f4f1c Merge branch 'develop' into matrix-org-hotfixes 2018-09-26 13:27:33 +01:00
Richard van der Hoff
6e15b5debe Revert "Actuall set cache factors in workers"
This reverts commit e21c312e16.
2018-09-26 13:25:52 +01:00
Matthew Hodgson
2e0d2879d0 Merge branch 'develop' into matrix-org-hotfixes 2018-09-26 11:00:26 +01:00
Michael Kaye
128043072b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-24 11:20:10 +01:00
Erik Johnston
b2fda9d20e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-20 11:00:14 +01:00
Erik Johnston
3c8c5eabc2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-15 11:40:37 +01:00
Erik Johnston
2da2041e2e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-14 19:56:33 +01:00
Erik Johnston
b5eef203f4 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-14 18:25:55 +01:00
Erik Johnston
df73da691f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-13 16:15:56 +01:00
Matthew Hodgson
30d054e0bb Merge branch 'develop' into matrix-org-hotfixes 2018-09-12 17:16:21 +01:00
Erik Johnston
ebb3cc4ab6 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-12 11:22:06 +01:00
Erik Johnston
17201abd53 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-11 14:17:33 +01:00
Erik Johnston
2f141f4c41 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-22 11:47:08 +01:00
Richard van der Hoff
638c0bf49b Merge branch 'rav/fix_gdpr_consent' into matrix-org-hotfixes 2018-08-21 22:54:35 +01:00
hera
d1065e6f51 Merge tag 'v0.33.3rc2' into matrix-org-hotfixes
Bugfixes
--------

- Fix bug in v0.33.3rc1 which caused infinite loops and OOMs
([\#3723](https://github.com/matrix-org/synapse/issues/3723))
2018-08-21 19:12:14 +00:00
Erik Johnston
567863127a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-20 13:34:47 +01:00
Erik Johnston
f5abc10724 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-20 11:12:18 +01:00
Erik Johnston
bb795b56da Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-16 15:51:16 +01:00
Erik Johnston
4dd0604f61 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-15 15:37:05 +01:00
Richard van der Hoff
c05d278ba0 Merge branch 'rav/federation_metrics' into matrix-org-hotfixes 2018-08-07 19:11:29 +01:00
Erik Johnston
49a3163958 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-06 13:33:54 +01:00
Erik Johnston
1a568041fa Merge branch 'release-v0.33.1' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-02 15:28:32 +01:00
Erik Johnston
c9db8b0c32 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-24 17:22:23 +01:00
Erik Johnston
aa1bf10b91 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-24 15:49:38 +01:00
Erik Johnston
5222907bea Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-23 17:54:41 +01:00
Erik Johnston
e1eb147f2a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-23 16:45:22 +01:00
hera
e43eb47c5f Fixup limiter 2018-07-23 15:22:47 +00:00
hera
27eb4c45cd Lower hacky timeout for member limiter 2018-07-23 15:16:36 +00:00
Erik Johnston
b136d7ff8f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-23 16:09:40 +01:00
Richard van der Hoff
9e56e1ab30 Merge branch 'develop' into matrix-org-hotfixes 2018-07-19 16:40:28 +01:00
Erik Johnston
742f757337 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-19 10:26:13 +01:00
Richard van der Hoff
2f5dfe299c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-07-17 15:26:47 +01:00
Erik Johnston
e4eec87c6a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-17 11:18:39 +01:00
Erik Johnston
f793ff4571 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-17 10:04:33 +01:00
Richard van der Hoff
195aae2f16 Merge branch 'develop' into matrix-org-hotfixes 2018-07-12 12:09:25 +01:00
Erik Johnston
7c79f2cb72 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-12 09:59:58 +01:00
Richard van der Hoff
f04e35c170 Merge branch 'develop' into matrix-org-hotfixes 2018-07-10 18:04:03 +01:00
Matthew Hodgson
36bbac05bd Merge branch 'develop' of git+ssh://github.com/matrix-org/synapse into matrix-org-hotfixes 2018-07-06 19:21:09 +01:00
Erik Johnston
e2a4b7681e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-05 10:29:32 +01:00
Erik Johnston
957944eee4 Merge pull request #3476 from matrix-org/erikj/timeout_memberships
Timeout membership requests after 90s
2018-07-03 10:18:39 +01:00
Erik Johnston
bf425e533e Fix PEP8 2018-07-03 10:11:09 +01:00
Erik Johnston
ca21957b8a Timeout membership requests after 90s
This is a hacky fix to try and stop in flight requests from building up
2018-07-02 13:56:08 +01:00
Erik Johnston
6a95270671 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-29 14:10:29 +01:00
hera
82781f5838 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-06-28 21:09:28 +00:00
Matthew Hodgson
aae6d3ff69 Merge remote-tracking branch 'origin/revert-3451-hawkowl/sorteddict-api' into matrix-org-hotfixes 2018-06-26 18:36:29 +01:00
Matthew Hodgson
9175225adf Merge remote-tracking branch 'origin/hawkowl/sorteddict-api' into matrix-org-hotfixes 2018-06-26 17:52:37 +01:00
David Baker
7a32fa0101 Fix error on deleting users pending deactivation
Use simple_delete instead of simple_delete_one as commented
2018-06-26 11:57:44 +01:00
Erik Johnston
d46450195b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-25 20:14:34 +01:00
Erik Johnston
c0128c1021 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-25 20:12:13 +01:00
Erik Johnston
3320b7c9a4 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-25 15:23:18 +01:00
Erik Johnston
4c22c9b0b6 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-25 14:37:13 +01:00
Richard van der Hoff
6d6ea1bb40 Merge branch 'develop' into matrix-org-hotfixes 2018-06-22 16:35:37 +01:00
aphrodite
9e38981ae4 Send HTTP pushes direct to http-priv rather than via clouldflare
(This is a heinous hack that ought to be made more generic and pushed back to develop)
2018-06-22 15:58:15 +01:00
hera
463e7c2709 Lower member limiter 2018-06-22 15:58:15 +01:00
Richard van der Hoff
ce9d0b1d0c Fix earlier logging patch
`@cached` doesn't work on decorated functions, because it uses inspection on
the target to calculate the number of arguments.
2018-06-22 15:58:15 +01:00
Richard van der Hoff
80786d5caf Logging for get_users_in_room 2018-06-22 15:58:15 +01:00
Richard van der Hoff
e18378c3e2 Increase member limiter to 20
Let's see if this makes the bridges go faster, or if it kills the synapse
master.
2018-06-22 15:58:15 +01:00
hera
0ca2857baa increase sync cache to 2 minutes
to give synchrotrons being hammered by repeating initial /syncs to get more
chance to actually complete and avoid a DoS
2018-06-22 15:58:15 +01:00
Erik Johnston
e21c312e16 Actuall set cache factors in workers 2018-06-22 15:58:15 +01:00
Richard van der Hoff
1031bd25f8 Avoid doing presence updates on replication reconnect
Presence is supposed to be disabled on matrix.org, so we shouldn't send a load
of USER_SYNC commands every time the synchrotron reconnects to the master.
2018-06-22 15:58:15 +01:00
hera
fae708c0e8 Disable auth on room_members for now
because the moznet bridge is broken (https://github.com/matrix-org/matrix-appservice-irc/issues/506)
2018-06-22 15:58:15 +01:00
Erik Johnston
8f8ea91eef Bump LAST_SEEN_GRANULARITY in client_ips 2018-06-22 15:58:15 +01:00
Erik Johnston
7a1406d144 Prefill client_ip_last_seen in replication 2018-06-22 15:58:15 +01:00
Erik Johnston
6373874833 Move event sending to end in shutdown room admin api 2018-06-22 15:58:15 +01:00
Erik Johnston
a79823e64b Add dummy presence REST handler to frontend proxy
The handler no-ops all requests as presence is disabled.
2018-06-22 15:58:15 +01:00
Erik Johnston
1766a5fdc0 Increase MAX_EVENTS_BEHIND for replication clients 2018-06-22 15:58:14 +01:00
Erik Johnston
e6b1ea3eb2 Disable presence in txn queue 2018-06-22 15:58:14 +01:00
Erik Johnston
e5537cf983 Limit concurrent AS joins 2018-06-22 15:58:14 +01:00
Erik Johnston
43bb12e640 Disable presence
This reverts commit 0ebd376a53 and
disables presence a bit more
2018-06-22 15:58:14 +01:00
Erik Johnston
66dcbf47a3 Disable auto search for prefixes in event search 2018-06-22 15:58:14 +01:00
Erik Johnston
a285fe05fd Add timeout to ResponseCache of /public_rooms 2018-06-22 15:58:14 +01:00
380 changed files with 14959 additions and 6799 deletions

View File

@@ -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))

View File

@@ -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:
@@ -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
@@ -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
@@ -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"
@@ -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
@@ -374,7 +376,8 @@ jobs:
working-directory: complement/dockerfiles
# Run Complement
- run: go test -v -tags synapse_blacklist,msc2403,msc2946,msc3083 ./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

4
.gitignore vendored
View File

@@ -50,3 +50,7 @@ __pycache__/
# docs
book/
# complement
/complement-master
/master.tar.gz

View File

@@ -1,3 +1,274 @@
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
--------
- Allow guests to send state events per [MSC3419](https://github.com/matrix-org/matrix-doc/pull/3419). ([\#11378](https://github.com/matrix-org/synapse/issues/11378))
- Add experimental support for part of [MSC3202](https://github.com/matrix-org/matrix-doc/pull/3202): allowing application services to masquerade as specific devices. ([\#11538](https://github.com/matrix-org/synapse/issues/11538))
- Add admin API to get users' account data. ([\#11664](https://github.com/matrix-org/synapse/issues/11664))
- Include the room topic in the stripped state included with invites and knocking. ([\#11666](https://github.com/matrix-org/synapse/issues/11666))
- Send and handle cross-signing messages using the stable prefix. ([\#10520](https://github.com/matrix-org/synapse/issues/10520))
- Support unprefixed versions of fallback key property names. ([\#11541](https://github.com/matrix-org/synapse/issues/11541))
Bugfixes
--------
- Fix a long-standing bug where relations from other rooms could be included in the bundled aggregations of an event. ([\#11516](https://github.com/matrix-org/synapse/issues/11516))
- Fix a long-standing bug which could cause `AssertionError`s to be written to the log when Synapse was restarted after purging events from the database. ([\#11536](https://github.com/matrix-org/synapse/issues/11536), [\#11642](https://github.com/matrix-org/synapse/issues/11642))
- Fix a bug introduced in Synapse 1.17.0 where a pusher created for an email with capital letters would fail to be created. ([\#11547](https://github.com/matrix-org/synapse/issues/11547))
- Fix a long-standing bug where responses included bundled aggregations when they should not, per [MSC2675](https://github.com/matrix-org/matrix-doc/pull/2675). ([\#11592](https://github.com/matrix-org/synapse/issues/11592), [\#11623](https://github.com/matrix-org/synapse/issues/11623))
- Fix a long-standing bug that some unknown endpoints would return HTML error pages instead of JSON `M_UNRECOGNIZED` errors. ([\#11602](https://github.com/matrix-org/synapse/issues/11602))
- Fix a bug introduced in Synapse 1.19.3 which could sometimes cause `AssertionError`s when backfilling rooms over federation. ([\#11632](https://github.com/matrix-org/synapse/issues/11632))
Improved Documentation
----------------------
- Update Synapse install command for FreeBSD as the package is now prefixed with `py38`. Contributed by @itchychips. ([\#11267](https://github.com/matrix-org/synapse/issues/11267))
- Document the usage of refresh tokens. ([\#11427](https://github.com/matrix-org/synapse/issues/11427))
- Add details for how to configure a TURN server when behind a NAT. Contibuted by @AndrewFerr. ([\#11553](https://github.com/matrix-org/synapse/issues/11553))
- Add references for using Postgres to the Docker documentation. ([\#11640](https://github.com/matrix-org/synapse/issues/11640))
- Fix the documentation link in newly-generated configuration files. ([\#11678](https://github.com/matrix-org/synapse/issues/11678))
- Correct the documentation for `nginx` to use a case-sensitive url pattern. Fixes an error introduced in v1.21.0. ([\#11680](https://github.com/matrix-org/synapse/issues/11680))
- Clarify SSO mapping provider documentation by writing `def` or `async def` before the names of methods, as appropriate. ([\#11681](https://github.com/matrix-org/synapse/issues/11681))
Deprecations and Removals
-------------------------
- Replace `mock` package by its standard library version. ([\#11588](https://github.com/matrix-org/synapse/issues/11588))
- Drop support for Python 3.6 and Ubuntu 18.04. ([\#11633](https://github.com/matrix-org/synapse/issues/11633))
Internal Changes
----------------
- Allow specific, experimental events to be created without `prev_events`. Used by [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716). ([\#11243](https://github.com/matrix-org/synapse/issues/11243))
- A test helper (`wait_for_background_updates`) no longer depends on classes defining a `store` property. ([\#11331](https://github.com/matrix-org/synapse/issues/11331))
- Add type hints to `synapse.appservice`. ([\#11360](https://github.com/matrix-org/synapse/issues/11360))
- Add missing type hints to `synapse.config` module. ([\#11480](https://github.com/matrix-org/synapse/issues/11480))
- Add test to ensure we share the same `state_group` across the whole historical batch when using the [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint. ([\#11487](https://github.com/matrix-org/synapse/issues/11487))
- Refactor `tests.util.setup_test_homeserver` and `tests.server.setup_test_homeserver`. ([\#11503](https://github.com/matrix-org/synapse/issues/11503))
- Move `glob_to_regex` and `re_word_boundary` to `matrix-python-common`. ([\#11505](https://github.com/matrix-org/synapse/issues/11505), [\#11687](https://github.com/matrix-org/synapse/issues/11687))
- Use `HTTPStatus` constants in place of literals in `tests.rest.client.test_auth`. ([\#11520](https://github.com/matrix-org/synapse/issues/11520))
- Add a receipt types constant for `m.read`. ([\#11531](https://github.com/matrix-org/synapse/issues/11531))
- Clean up `synapse.rest.admin`. ([\#11535](https://github.com/matrix-org/synapse/issues/11535))
- Add missing `errcode` to `parse_string` and `parse_boolean`. ([\#11542](https://github.com/matrix-org/synapse/issues/11542))
- Use `HTTPStatus` constants in place of literals in `synapse.http`. ([\#11543](https://github.com/matrix-org/synapse/issues/11543))
- Add missing type hints to storage classes. ([\#11546](https://github.com/matrix-org/synapse/issues/11546), [\#11549](https://github.com/matrix-org/synapse/issues/11549), [\#11551](https://github.com/matrix-org/synapse/issues/11551), [\#11555](https://github.com/matrix-org/synapse/issues/11555), [\#11575](https://github.com/matrix-org/synapse/issues/11575), [\#11589](https://github.com/matrix-org/synapse/issues/11589), [\#11594](https://github.com/matrix-org/synapse/issues/11594), [\#11652](https://github.com/matrix-org/synapse/issues/11652), [\#11653](https://github.com/matrix-org/synapse/issues/11653), [\#11654](https://github.com/matrix-org/synapse/issues/11654), [\#11657](https://github.com/matrix-org/synapse/issues/11657))
- Fix an inaccurate and misleading comment in the `/sync` code. ([\#11550](https://github.com/matrix-org/synapse/issues/11550))
- Add missing type hints to `synapse.logging.context`. ([\#11556](https://github.com/matrix-org/synapse/issues/11556))
- Stop populating unused database column `state_events.prev_state`. ([\#11558](https://github.com/matrix-org/synapse/issues/11558))
- Minor efficiency improvements in event persistence. ([\#11560](https://github.com/matrix-org/synapse/issues/11560))
- Add some safety checks that storage functions are used correctly. ([\#11564](https://github.com/matrix-org/synapse/issues/11564), [\#11580](https://github.com/matrix-org/synapse/issues/11580))
- Make `get_device` return `None` if the device doesn't exist rather than raising an exception. ([\#11565](https://github.com/matrix-org/synapse/issues/11565))
- Split the HTML parsing code from the URL preview resource code. ([\#11566](https://github.com/matrix-org/synapse/issues/11566))
- Remove redundant `COALESCE()`s around `COUNT()`s in database queries. ([\#11570](https://github.com/matrix-org/synapse/issues/11570))
- Add missing type hints to `synapse.http`. ([\#11571](https://github.com/matrix-org/synapse/issues/11571))
- Add [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) and [MSC3030](https://github.com/matrix-org/matrix-doc/pull/3030) to `/versions` -> `unstable_features` to detect server support. ([\#11582](https://github.com/matrix-org/synapse/issues/11582))
- Add type hints to `synapse/tests/rest/admin`. ([\#11590](https://github.com/matrix-org/synapse/issues/11590))
- Drop end-of-life Python 3.6 and Postgres 9.6 from CI. ([\#11595](https://github.com/matrix-org/synapse/issues/11595))
- Update black version and run it on all the files. ([\#11596](https://github.com/matrix-org/synapse/issues/11596))
- Add opentracing type stubs and fix associated mypy errors. ([\#11603](https://github.com/matrix-org/synapse/issues/11603), [\#11622](https://github.com/matrix-org/synapse/issues/11622))
- Improve OpenTracing support for requests which use a `ResponseCache`. ([\#11607](https://github.com/matrix-org/synapse/issues/11607))
- Improve OpenTracing support for incoming HTTP requests. ([\#11618](https://github.com/matrix-org/synapse/issues/11618))
- A number of improvements to opentracing support. ([\#11619](https://github.com/matrix-org/synapse/issues/11619))
- Refactor the way that the `outlier` flag is set on events received over federation. ([\#11634](https://github.com/matrix-org/synapse/issues/11634))
- Improve the error messages from `get_create_event_for_room`. ([\#11638](https://github.com/matrix-org/synapse/issues/11638))
- Remove redundant `get_current_events_token` method. ([\#11643](https://github.com/matrix-org/synapse/issues/11643))
- Convert `namedtuples` to `attrs`. ([\#11665](https://github.com/matrix-org/synapse/issues/11665), [\#11574](https://github.com/matrix-org/synapse/issues/11574))
- Update the `/capabilities` response to include whether support for [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440) is available. ([\#11690](https://github.com/matrix-org/synapse/issues/11690))
- Send the `Accept` header in HTTP requests made using `SimpleHttpClient.get_json`. ([\#11677](https://github.com/matrix-org/synapse/issues/11677))
- Work around Mjolnir compatibility issue by adding an import for `glob_to_regex` in `synapse.util`, where it moved from. ([\#11696](https://github.com/matrix-org/synapse/issues/11696))
Synapse 1.49.2 (2021-12-21)
===========================
This release fixes a regression introduced in Synapse 1.49.0 which could cause `/sync` requests to take significantly longer. This would particularly affect "initial" syncs for users participating in a large number of rooms, and in extreme cases, could make it impossible for such users to log in on a new client.
**Note:** in line with our [deprecation policy](https://matrix-org.github.io/synapse/latest/deprecation_policy.html) for platform dependencies, this will be the last release to support Python 3.6 and PostgreSQL 9.6, both of which have now reached upstream end-of-life. Synapse will require Python 3.7+ and PostgreSQL 10+.
**Note:** We will also stop producing packages for Ubuntu 18.04 (Bionic Beaver) after this release, as it uses Python 3.6.
Bugfixes
--------
- Fix a performance regression in `/sync` handling, introduced in 1.49.0. ([\#11583](https://github.com/matrix-org/synapse/issues/11583))
Internal Changes
----------------
- Work around a build problem on Debian Buster. ([\#11625](https://github.com/matrix-org/synapse/issues/11625))
Synapse 1.49.1 (2021-12-21)
===========================
Not released due to problems building the debian packages.
Synapse 1.49.0 (2021-12-14)
===========================
No significant changes since version 1.49.0rc1.
Support for Ubuntu 21.04 ends next month on the 20th of January
---------------------------------------------------------------
For users of Ubuntu 21.04 (Hirsute Hippo), please be aware that [upstream support for this version of Ubuntu will end next month][Ubuntu2104EOL].
We will stop producing packages for Ubuntu 21.04 after upstream support ends.
[Ubuntu2104EOL]: https://lists.ubuntu.com/archives/ubuntu-announce/2021-December/000275.html
The wiki has been migrated to the documentation website
-------------------------------------------------------
We've decided to move the existing, somewhat stagnant pages from the GitHub wiki
to the [documentation website](https://matrix-org.github.io/synapse/latest/).
This was done for two reasons. The first was to ensure that changes are checked by
multiple authors before being committed (everyone makes mistakes!) and the second
was visibility of the documentation. Not everyone knows that Synapse has some very
useful information hidden away in its GitHub wiki pages. Bringing them to the
documentation website should help with visibility, as well as keep all Synapse documentation
in one, easily-searchable location.
Note that contributions to the documentation website happen through [GitHub pull
requests](https://github.com/matrix-org/synapse/pulls). Please visit [#synapse-dev:matrix.org](https://matrix.to/#/#synapse-dev:matrix.org)
if you need help with the process!
Synapse 1.49.0rc1 (2021-12-07)
==============================
Features
--------
- Add [MSC3030](https://github.com/matrix-org/matrix-doc/pull/3030) experimental client and federation API endpoints to get the closest event to a given timestamp. ([\#9445](https://github.com/matrix-org/synapse/issues/9445))
- Include bundled relation aggregations during a limited `/sync` request and `/relations` request, per [MSC2675](https://github.com/matrix-org/matrix-doc/pull/2675). ([\#11284](https://github.com/matrix-org/synapse/issues/11284), [\#11478](https://github.com/matrix-org/synapse/issues/11478))
- Add plugin support for controlling database background updates. ([\#11306](https://github.com/matrix-org/synapse/issues/11306), [\#11475](https://github.com/matrix-org/synapse/issues/11475), [\#11479](https://github.com/matrix-org/synapse/issues/11479))
- Support the stable API endpoints for [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946): the room `/hierarchy` endpoint. ([\#11329](https://github.com/matrix-org/synapse/issues/11329))
- Add admin API to get some information about federation status with remote servers. ([\#11407](https://github.com/matrix-org/synapse/issues/11407))
- Support expiry of refresh tokens and expiry of the overall session when refresh tokens are in use. ([\#11425](https://github.com/matrix-org/synapse/issues/11425))
- Stabilise support for [MSC2918](https://github.com/matrix-org/matrix-doc/blob/main/proposals/2918-refreshtokens.md#msc2918-refresh-tokens) refresh tokens as they have now been merged into the Matrix specification. ([\#11435](https://github.com/matrix-org/synapse/issues/11435), [\#11522](https://github.com/matrix-org/synapse/issues/11522))
- Update [MSC2918 refresh token](https://github.com/matrix-org/matrix-doc/blob/main/proposals/2918-refreshtokens.md#msc2918-refresh-tokens) support to confirm with the latest revision: accept the `refresh_tokens` parameter in the request body rather than in the URL parameters. ([\#11430](https://github.com/matrix-org/synapse/issues/11430))
- Support configuring the lifetime of non-refreshable access tokens separately to refreshable access tokens. ([\#11445](https://github.com/matrix-org/synapse/issues/11445))
- Expose `synapse_homeserver` and `synapse_worker` commands as entry points to run Synapse's main process and worker processes, respectively. Contributed by @Ma27. ([\#11449](https://github.com/matrix-org/synapse/issues/11449))
- `synctl stop` will now wait for Synapse to exit before returning. ([\#11459](https://github.com/matrix-org/synapse/issues/11459), [\#11490](https://github.com/matrix-org/synapse/issues/11490))
- Extend the "delete room" admin api to work correctly on rooms which have previously been partially deleted. ([\#11523](https://github.com/matrix-org/synapse/issues/11523))
- Add support for the `/_matrix/client/v3/login/sso/redirect/{idpId}` API from Matrix v1.1. This endpoint was overlooked when support for v3 endpoints was added in Synapse 1.48.0rc1. ([\#11451](https://github.com/matrix-org/synapse/issues/11451))
Bugfixes
--------
- Fix using [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) batch sending in combination with event persistence workers. Contributed by @tulir at Beeper. ([\#11220](https://github.com/matrix-org/synapse/issues/11220))
- Fix a long-standing bug where all requests that read events from the database could get stuck as a result of losing the database connection, properly this time. Also fix a race condition introduced in the previous insufficient fix in Synapse 1.47.0. ([\#11376](https://github.com/matrix-org/synapse/issues/11376))
- The `/send_join` response now includes the stable `event` field instead of the unstable field from [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083). ([\#11413](https://github.com/matrix-org/synapse/issues/11413))
- Fix a bug introduced in Synapse 1.47.0 where `send_join` could fail due to an outdated `ijson` version. ([\#11439](https://github.com/matrix-org/synapse/issues/11439), [\#11441](https://github.com/matrix-org/synapse/issues/11441), [\#11460](https://github.com/matrix-org/synapse/issues/11460))
- Fix a bug introduced in Synapse 1.36.0 which could cause problems fetching event-signing keys from trusted key servers. ([\#11440](https://github.com/matrix-org/synapse/issues/11440))
- Fix a bug introduced in Synapse 1.47.1 where the media repository would fail to work if the media store path contained any symbolic links. ([\#11446](https://github.com/matrix-org/synapse/issues/11446))
- Fix an `LruCache` corruption bug, introduced in Synapse 1.38.0, that would cause certain requests to fail until the next Synapse restart. ([\#11454](https://github.com/matrix-org/synapse/issues/11454))
- Fix a long-standing bug where invites from ignored users were included in incremental syncs. ([\#11511](https://github.com/matrix-org/synapse/issues/11511))
- Fix a regression in Synapse 1.48.0 where presence workers would not clear their presence updates over replication on shutdown. ([\#11518](https://github.com/matrix-org/synapse/issues/11518))
- Fix a regression in Synapse 1.48.0 where the module API's `looping_background_call` method would spam errors to the logs when given a non-async function. ([\#11524](https://github.com/matrix-org/synapse/issues/11524))
Updates to the Docker image
---------------------------
- Update `Dockerfile-workers` to healthcheck all workers in the container. ([\#11429](https://github.com/matrix-org/synapse/issues/11429))
Improved Documentation
----------------------
- Update the media repository documentation. ([\#11415](https://github.com/matrix-org/synapse/issues/11415))
- Update section about backward extremities in the room DAG concepts doc to correct the misconception about backward extremities indicating whether we have fetched an events' `prev_events`. ([\#11469](https://github.com/matrix-org/synapse/issues/11469))
Internal Changes
----------------
- Add `Final` annotation to string constants in `synapse.api.constants` so that they get typed as `Literal`s. ([\#11356](https://github.com/matrix-org/synapse/issues/11356))
- Add a check to ensure that users cannot start the Synapse master process when `worker_app` is set. ([\#11416](https://github.com/matrix-org/synapse/issues/11416))
- Add a note about postgres memory management and hugepages to postgres doc. ([\#11467](https://github.com/matrix-org/synapse/issues/11467))
- Add missing type hints to `synapse.config` module. ([\#11465](https://github.com/matrix-org/synapse/issues/11465))
- Add missing type hints to `synapse.federation`. ([\#11483](https://github.com/matrix-org/synapse/issues/11483))
- Add type annotations to `tests.storage.test_appservice`. ([\#11488](https://github.com/matrix-org/synapse/issues/11488), [\#11492](https://github.com/matrix-org/synapse/issues/11492))
- Add type annotations to some of the configuration surrounding refresh tokens. ([\#11428](https://github.com/matrix-org/synapse/issues/11428))
- Add type hints to `synapse/tests/rest/admin`. ([\#11501](https://github.com/matrix-org/synapse/issues/11501))
- Add type hints to storage classes. ([\#11411](https://github.com/matrix-org/synapse/issues/11411))
- Add wiki pages to documentation website. ([\#11402](https://github.com/matrix-org/synapse/issues/11402))
- Clean up `tests.storage.test_main` to remove use of legacy code. ([\#11493](https://github.com/matrix-org/synapse/issues/11493))
- Clean up `tests.test_visibility` to remove legacy code. ([\#11495](https://github.com/matrix-org/synapse/issues/11495))
- Convert status codes to `HTTPStatus` in `synapse.rest.admin`. ([\#11452](https://github.com/matrix-org/synapse/issues/11452), [\#11455](https://github.com/matrix-org/synapse/issues/11455))
- Extend the `scripts-dev/sign_json` script to support signing events. ([\#11486](https://github.com/matrix-org/synapse/issues/11486))
- Improve internal types in push code. ([\#11409](https://github.com/matrix-org/synapse/issues/11409))
- Improve type annotations in `synapse.module_api`. ([\#11029](https://github.com/matrix-org/synapse/issues/11029))
- Improve type hints for `LruCache`. ([\#11453](https://github.com/matrix-org/synapse/issues/11453))
- Preparation for database schema simplifications: disambiguate queries on `state_key`. ([\#11497](https://github.com/matrix-org/synapse/issues/11497))
- Refactor `backfilled` into specific behavior function arguments (`_persist_events_and_state_updates` and downstream calls). ([\#11417](https://github.com/matrix-org/synapse/issues/11417))
- Refactor `get_version_string` to fix-up types and duplicated code. ([\#11468](https://github.com/matrix-org/synapse/issues/11468))
- Refactor various parts of the `/sync` handler. ([\#11494](https://github.com/matrix-org/synapse/issues/11494), [\#11515](https://github.com/matrix-org/synapse/issues/11515))
- Remove unnecessary `json.dumps` from `tests.rest.admin`. ([\#11461](https://github.com/matrix-org/synapse/issues/11461))
- Save the OpenID Connect session ID on login. ([\#11482](https://github.com/matrix-org/synapse/issues/11482))
- Update and clean up recently ported documentation pages. ([\#11466](https://github.com/matrix-org/synapse/issues/11466))
Synapse 1.48.0 (2021-11-30)
===========================

2
changelog.d/11530.bugfix Normal file
View File

@@ -0,0 +1,2 @@
Fix a long-standing issue which could cause Synapse to incorrectly accept data in the unsigned field of events
received over federation.

View File

@@ -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.

View File

@@ -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).

View File

@@ -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
changelog.d/11583.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix a performance regression in `/sync` handling, introduced in 1.49.0.

1
changelog.d/11587.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix a long-standing bug where Synapse wouldn't cache a response indicating that a remote user has no devices.

1
changelog.d/11593.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix an error in to get federation status of a destination server even if no error has occurred. This admin API was new introduced in Synapse 1.49.0.

1
changelog.d/11612.misc Normal file
View File

@@ -0,0 +1 @@
Avoid database access in the JSON serialization process.

1
changelog.d/11659.bugfix Normal file
View File

@@ -0,0 +1 @@
Include the bundled aggregations in the `/sync` response, per [MSC2675](https://github.com/matrix-org/matrix-doc/pull/2675).

1
changelog.d/11667.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix `/_matrix/client/v1/room/{roomId}/hierarchy` endpoint returning incorrect fields which have been present since Synapse 1.49.0.

1
changelog.d/11669.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix preview of some gif URLs (like tenor.com). Contributed by Philippe Daouadi.

View File

@@ -0,0 +1 @@
Return an `M_FORBIDDEN` error code instead of `M_UNKNOWN` when a spam checker module prevents a user from creating a room.

View File

@@ -0,0 +1 @@
Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users.

View File

@@ -0,0 +1 @@
Remove the unstable `/send_relation` endpoint.

1
changelog.d/11685.misc Normal file
View File

@@ -0,0 +1 @@
Run `pyupgrade --py37-plus --keep-percent-format` on Synapse.

1
changelog.d/11686.doc Normal file
View File

@@ -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
changelog.d/11691.misc Normal file
View File

@@ -0,0 +1 @@
Use buildkit's cache feature to speed up docker builds.

1
changelog.d/11692.misc Normal file
View File

@@ -0,0 +1 @@
Use `auto_attribs` and native type hints for attrs classes.

1
changelog.d/11693.misc Normal file
View File

@@ -0,0 +1 @@
Remove debug logging for #4422, which has been closed since Synapse 0.99.

1
changelog.d/11695.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix a bug where the 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.

1
changelog.d/11699.misc Normal file
View File

@@ -0,0 +1 @@
Remove fallback code for Python 2.

1
changelog.d/11701.misc Normal file
View File

@@ -0,0 +1 @@
Add a test for [an edge case](https://github.com/matrix-org/synapse/pull/11532#discussion_r769104461) in the `/sync` logic.

1
changelog.d/11702.misc Normal file
View File

@@ -0,0 +1 @@
Add the option to write sqlite test dbs to disk when running tests.

1
changelog.d/11707.misc Normal file
View File

@@ -0,0 +1 @@
Improve Complement test output for Gitub Actions.

1
changelog.d/11710.bugfix Normal file
View File

@@ -0,0 +1 @@
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.

1
changelog.d/11714.misc Normal file
View File

@@ -0,0 +1 @@
Fix a typechecker problem related to our (ab)use of `nacl.signing.SigningKey`s.

1
changelog.d/11715.doc Normal file
View File

@@ -0,0 +1 @@
Document the new `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable in the contributing guide.

1
changelog.d/11716.misc Normal file
View File

@@ -0,0 +1 @@
Fix docstring on `add_account_data_for_user`.

1
changelog.d/11718.misc Normal file
View File

@@ -0,0 +1 @@
Complement environment variable name change and update `.gitignore`.

1
changelog.d/11723.misc Normal file
View File

@@ -0,0 +1 @@
Simplify calculation of prometheus metrics for garbage collection.

1
changelog.d/11724.misc Normal file
View File

@@ -0,0 +1 @@
Improve accuracy of `python_twisted_reactor_tick_time` prometheus metric.

View File

@@ -0,0 +1 @@
Remove `python_twisted_reactor_pending_calls` prometheus metric.

1
changelog.d/11725.doc Normal file
View File

@@ -0,0 +1 @@
Document that now the minimum supported PostgreSQL version is 10.

1
changelog.d/11735.doc Normal file
View File

@@ -0,0 +1 @@
Fix typo in demo docs: differnt.

1
changelog.d/11737.bugfix Normal file
View File

@@ -0,0 +1 @@
Make the list rooms admin api sort stable. Contributed by Daniël Sonck.

1
changelog.d/11739.doc Normal file
View File

@@ -0,0 +1 @@
Update room spec url in config files.

1
changelog.d/11740.doc Normal file
View File

@@ -0,0 +1 @@
Mention python3-venv and libpq-dev dependencies in contribution guide.

1
changelog.d/11742.misc Normal file
View File

@@ -0,0 +1 @@
Minor efficiency improvements when inserting many values into the database.

1
changelog.d/11744.misc Normal file
View File

@@ -0,0 +1 @@
Invite PR authors to give themselves credit in the changelog.

1
changelog.d/11745.bugfix Normal file
View File

@@ -0,0 +1 @@
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.

View File

@@ -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
changelog.d/11755.doc Normal file
View File

@@ -0,0 +1 @@
Update documentation for configuring login with facebook.

View File

@@ -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
changelog.d/11761.misc Normal file
View File

@@ -0,0 +1 @@
Remove `log_function` utility function and its uses.

1
changelog.d/11768.misc Normal file
View File

@@ -0,0 +1 @@
Use `auto_attribs` and native type hints for attrs classes.

View File

@@ -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:

View File

@@ -92,22 +92,6 @@ new PromConsole.Graph({
})
</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>

48
debian/changelog vendored
View File

@@ -1,3 +1,51 @@
matrix-synapse-py3 (1.50.1) stable; urgency=medium
* New synapse release 1.50.1.
-- Synapse Packaging team <packages@matrix.org> 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 <packages@matrix.org> 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 <packages@matrix.org> 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 <packages@matrix.org> Wed, 05 Jan 2022 12:36:17 +0000
matrix-synapse-py3 (1.49.2) stable; urgency=medium
* New synapse release 1.49.2.
-- Synapse Packaging team <packages@matrix.org> Tue, 21 Dec 2021 17:31:03 +0000
matrix-synapse-py3 (1.49.1) stable; urgency=medium
* New synapse release 1.49.1.
-- Synapse Packaging team <packages@matrix.org> Tue, 21 Dec 2021 11:07:30 +0000
matrix-synapse-py3 (1.49.0) stable; urgency=medium
* New synapse release 1.49.0.
-- Synapse Packaging team <packages@matrix.org> Tue, 14 Dec 2021 12:39:46 +0000
matrix-synapse-py3 (1.49.0~rc1) stable; urgency=medium
* New synapse release 1.49.0~rc1.
-- Synapse Packaging team <packages@matrix.org> Tue, 07 Dec 2021 13:52:21 +0000
matrix-synapse-py3 (1.48.0) stable; urgency=medium
* New synapse release 1.48.0.

View File

@@ -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.

View File

@@ -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
@@ -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 \
@@ -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
@@ -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 \

View File

@@ -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.
#
@@ -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
@@ -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"]

View File

@@ -21,3 +21,6 @@ VOLUME ["/data"]
# files to run the desired worker configuration. Will start supervisord.
COPY ./docker/configure_workers_and_start.py /configure_workers_and_start.py
ENTRYPOINT ["/configure_workers_and_start.py"]
HEALTHCHECK --start-period=5s --interval=15s --timeout=5s \
CMD /bin/sh /healthcheck.sh

View File

@@ -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:

View File

@@ -0,0 +1,6 @@
#!/bin/sh
# This healthcheck script is designed to return OK when every
# host involved returns OK
{%- for healthcheck_url in healthcheck_urls %}
curl -fSs {{ healthcheck_url }} || exit 1
{%- endfor %}

View File

@@ -474,10 +474,16 @@ def generate_worker_files(environ, config_path: str, data_dir: str):
# Determine the load-balancing upstreams to configure
nginx_upstream_config = ""
# At the same time, prepare a list of internal endpoints to healthcheck
# starting with the main process which exists even if no workers do.
healthcheck_urls = ["http://localhost:8080/health"]
for upstream_worker_type, upstream_worker_ports in nginx_upstreams.items():
body = ""
for port in upstream_worker_ports:
body += " server localhost:%d;\n" % (port,)
healthcheck_urls.append("http://localhost:%d/health" % (port,))
# Add to the list of configured upstreams
nginx_upstream_config += NGINX_UPSTREAM_CONFIG_BLOCK.format(
@@ -510,6 +516,13 @@ def generate_worker_files(environ, config_path: str, data_dir: str):
worker_config=supervisord_config,
)
# healthcheck config
convert(
"/conf/healthcheck.sh.j2",
"/healthcheck.sh",
healthcheck_urls=healthcheck_urls,
)
# Ensure the logging directory exists
log_dir = data_dir + "/logs"
if not os.path.exists(log_dir):

View File

@@ -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)
@@ -44,6 +45,7 @@
- [Presence router callbacks](modules/presence_router_callbacks.md)
- [Account validity callbacks](modules/account_validity_callbacks.md)
- [Password auth provider callbacks](modules/password_auth_provider_callbacks.md)
- [Background update controller callbacks](modules/background_update_controller_callbacks.md)
- [Porting a legacy module to the new interface](modules/porting_legacy_module.md)
- [Workers](workers.md)
- [Using `synctl` with Workers](synctl_workers.md)
@@ -64,9 +66,15 @@
- [Statistics](admin_api/statistics.md)
- [Users](admin_api/user_admin_api.md)
- [Server Version](admin_api/version_api.md)
- [Federation](usage/administration/admin_api/federation.md)
- [Manhole](manhole.md)
- [Monitoring](metrics-howto.md)
- [Understanding Synapse Through Grafana Graphs](usage/administration/understanding_synapse_through_grafana_graphs.md)
- [Useful SQL for Admins](usage/administration/useful_sql_for_admins.md)
- [Database Maintenance Tools](usage/administration/database_maintenance_tools.md)
- [State Groups](usage/administration/state_groups.md)
- [Request log format](usage/administration/request_log.md)
- [Admin FAQ](usage/administration/admin_faq.md)
- [Scripts]()
# Development
@@ -94,3 +102,4 @@
# Other
- [Dependency Deprecation Policy](deprecation_policy.md)
- [Running Synapse on a Single-Board Computer](other/running_synapse_on_single_board_computers.md)

View File

@@ -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",
@@ -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,
@@ -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

View File

@@ -14,8 +14,8 @@ i.e. when a version reaches End of Life Synapse will withdraw support for that
version in future releases.
Details on the upstream support life cycles for Python and PostgreSQL are
documented at https://endoflife.date/python and
https://endoflife.date/postgresql.
documented at [https://endoflife.date/python](https://endoflife.date/python) and
[https://endoflife.date/postgresql](https://endoflife.date/postgresql).
Context

View File

@@ -20,7 +20,9 @@ recommended for development. More information about WSL can be found at
<https://docs.microsoft.com/en-us/windows/wsl/install>. Running Synapse natively
on Windows is not officially supported.
The code of Synapse is written in Python 3. To do pretty much anything, you'll need [a recent version of Python 3](https://wiki.python.org/moin/BeginnersGuide/Download).
The code of Synapse is written in Python 3. To do pretty much anything, you'll need [a recent version of Python 3](https://www.python.org/downloads/). Your Python also needs support for [virtual environments](https://docs.python.org/3/library/venv.html). This is usually built-in, but some Linux distributions like Debian and Ubuntu split it out into its own package. Running `sudo apt install python3-venv` should be enough.
Synapse can connect to PostgreSQL via the [psycopg2](https://pypi.org/project/psycopg2/) Python library. Building this library from source requires access to PostgreSQL's C header files. On Debian or Ubuntu Linux, these can be installed with `sudo apt install libpq-dev`.
The source code of Synapse is hosted on GitHub. You will also need [a recent version of git](https://github.com/git-guides/install-git).
@@ -169,6 +171,27 @@ To increase the log level for the tests, set `SYNAPSE_TEST_LOG_LEVEL`:
SYNAPSE_TEST_LOG_LEVEL=DEBUG trial tests
```
By default, tests will use an in-memory SQLite database for test data. For additional
help with debugging, one can use an on-disk SQLite database file instead, in order to
review database state during and after running tests. This can be done by setting
the `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable. Doing so will cause the
database state to be stored in a file named `test.db` under the trial process'
working directory. Typically, this ends up being `_trial_temp/test.db`. For example:
```sh
SYNAPSE_TEST_PERSIST_SQLITE_DB=1 trial tests
```
The database file can then be inspected with:
```sh
sqlite3 _trial_temp/test.db
```
Note that the database file is cleared at the beginning of each test run. Thus it
will always only contain the data generated by the *last run test*. Though generally
when debugging, one is only running a single test anyway.
### Running tests under PostgreSQL
Invoking `trial` as above will use an in-memory SQLite database. This is great for

View File

@@ -38,16 +38,15 @@ Most-recent-in-time events in the DAG which are not referenced by any other even
The forward extremities of a room are used as the `prev_events` when the next event is sent.
## Backwards extremity
## Backward extremity
The current marker of where we have backfilled up to and will generally be the
oldest-in-time events we know of in the DAG.
`prev_events` of the oldest-in-time events we have in the DAG. This gives a starting point when
backfilling history.
This is an event where we haven't fetched all of the `prev_events` for.
Once we have fetched all of its `prev_events`, it's unmarked as a backwards
extremity (although we may have formed new backwards extremities from the prev
events during the backfilling process).
When we persist a non-outlier event, we clear it as a backward extremity and set
all of its `prev_events` as the new backward extremities if they aren't already
persisted in the `events` table.
## Outliers
@@ -56,8 +55,7 @@ We mark an event as an `outlier` when we haven't figured out the state for the
room at that point in the DAG yet.
We won't *necessarily* have the `prev_events` of an `outlier` in the database,
but it's entirely possible that we *might*. The status of whether we have all of
the `prev_events` is marked as a [backwards extremity](#backwards-extremity).
but it's entirely possible that we *might*.
For example, when we fetch the event auth chain or state for a given event, we
mark all of those claimed auth events as outliers because we haven't done the

View File

@@ -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.

View File

@@ -2,29 +2,80 @@
*Synapse implementation-specific details for the media repository*
The media repository is where attachments and avatar photos are stored.
It stores attachment content and thumbnails for media uploaded by local users.
It caches attachment content and thumbnails for media uploaded by remote users.
The media repository
* stores avatars, attachments and their thumbnails for media uploaded by local
users.
* caches avatars, attachments and their thumbnails for media uploaded by remote
users.
* caches resources and thumbnails used for
[URL previews](development/url_previews.md).
## Storage
All media in Matrix can be identified by a unique
[MXC URI](https://spec.matrix.org/latest/client-server-api/#matrix-content-mxc-uris),
consisting of a server name and media ID:
```
mxc://<server-name>/<media-id>
```
Each item of media is assigned a `media_id` when it is uploaded.
The `media_id` is a randomly chosen, URL safe 24 character string.
## Local Media
Synapse generates 24 character media IDs for content uploaded by local users.
These media IDs consist of upper and lowercase letters and are case-sensitive.
Other homeserver implementations may generate media IDs differently.
Metadata such as the MIME type, upload time and length are stored in the
sqlite3 database indexed by `media_id`.
Local media is recorded in the `local_media_repository` table, which includes
metadata such as MIME types, upload times and file sizes.
Note that this table is shared by the URL cache, which has a different media ID
scheme.
Content is stored on the filesystem under a `"local_content"` directory.
### Paths
A file with media ID `aabbcccccccccccccccccccc` and its `128x96` `image/jpeg`
thumbnail, created by scaling, would be stored at:
```
local_content/aa/bb/cccccccccccccccccccc
local_thumbnails/aa/bb/cccccccccccccccccccc/128-96-image-jpeg-scale
```
Thumbnails are stored under a `"local_thumbnails"` directory.
## Remote Media
When media from a remote homeserver is requested from Synapse, it is assigned
a local `filesystem_id`, with the same format as locally-generated media IDs,
as described above.
The item with `media_id` `"aabbccccccccdddddddddddd"` is stored under
`"local_content/aa/bb/ccccccccdddddddddddd"`. Its thumbnail with width
`128` and height `96` and type `"image/jpeg"` is stored under
`"local_thumbnails/aa/bb/ccccccccdddddddddddd/128-96-image-jpeg"`
A record of remote media is stored in the `remote_media_cache` table, which
can be used to map remote MXC URIs (server names and media IDs) to local
`filesystem_id`s.
Remote content is cached under `"remote_content"` directory. Each item of
remote content is assigned a local `"filesystem_id"` to ensure that the
directory structure `"remote_content/server_name/aa/bb/ccccccccdddddddddddd"`
is appropriate. Thumbnails for remote content are stored under
`"remote_thumbnail/server_name/..."`
### Paths
A file from `matrix.org` with `filesystem_id` `aabbcccccccccccccccccccc` and its
`128x96` `image/jpeg` thumbnail, created by scaling, would be stored at:
```
remote_content/matrix.org/aa/bb/cccccccccccccccccccc
remote_thumbnail/matrix.org/aa/bb/cccccccccccccccccccc/128-96-image-jpeg-scale
```
Older thumbnails may omit the thumbnailing method:
```
remote_thumbnail/matrix.org/aa/bb/cccccccccccccccccccc/128-96-image-jpeg
```
Note that `remote_thumbnail/` does not have an `s`.
## URL Previews
See [URL Previews](development/url_previews.md) for documentation on the URL preview
process.
When generating previews for URLs, Synapse may download and cache various
resources, including images. These resources are assigned temporary media IDs
of the form `yyyy-mm-dd_aaaaaaaaaaaaaaaa`, where `yyyy-mm-dd` is the current
date and `aaaaaaaaaaaaaaaa` is a random sequence of 16 case-sensitive letters.
The metadata for these cached resources is stored in the
`local_media_repository` and `local_media_repository_url_cache` tables.
Resources for URL previews are deleted after a few days.
### Paths
The file with media ID `yyyy-mm-dd_aaaaaaaaaaaaaaaa` and its `128x96`
`image/jpeg` thumbnail, created by scaling, would be stored at:
```
url_cache/yyyy-mm-dd/aaaaaaaaaaaaaaaa
url_cache_thumbnails/yyyy-mm-dd/aaaaaaaaaaaaaaaa/128-96-image-jpeg-scale
```

View File

@@ -0,0 +1,71 @@
# Background update controller callbacks
Background update controller callbacks allow module developers to control (e.g. rate-limit)
how database background updates are run. A database background update is an operation
Synapse runs on its database in the background after it starts. It's usually used to run
database operations that would take too long if they were run at the same time as schema
updates (which are run on startup) and delay Synapse's startup too much: populating a
table with a big amount of data, adding an index on a big table, deleting superfluous data,
etc.
Background update controller callbacks can be registered using the module API's
`register_background_update_controller_callbacks` method. Only the first module (in order
of appearance in Synapse's configuration file) calling this method can register background
update controller callbacks, subsequent calls are ignored.
The available background update controller callbacks are:
### `on_update`
_First introduced in Synapse v1.49.0_
```python
def on_update(update_name: str, database_name: str, one_shot: bool) -> AsyncContextManager[int]
```
Called when about to do an iteration of a background update. The module is given the name
of the update, the name of the database, and a flag to indicate whether the background
update will happen in one go and may take a long time (e.g. creating indices). If this last
argument is set to `False`, the update will be run in batches.
The module must return an async context manager. It will be entered before Synapse runs a
background update; this should return the desired duration of the iteration, in
milliseconds.
The context manager will be exited when the iteration completes. Note that the duration
returned by the context manager is a target, and an iteration may take substantially longer
or shorter. If the `one_shot` flag is set to `True`, the duration returned is ignored.
__Note__: Unlike most module callbacks in Synapse, this one is _synchronous_. This is
because asynchronous operations are expected to be run by the async context manager.
This callback is required when registering any other background update controller callback.
### `default_batch_size`
_First introduced in Synapse v1.49.0_
```python
async def default_batch_size(update_name: str, database_name: str) -> int
```
Called before the first iteration of a background update, with the name of the update and
of the database. The module must return the number of elements to process in this first
iteration.
If this callback is not defined, Synapse will use a default value of 100.
### `min_batch_size`
_First introduced in Synapse v1.49.0_
```python
async def min_batch_size(update_name: str, database_name: str) -> int
```
Called before running a new batch for a background update, with the name of the update and
of the database. The module must return an integer representing the minimum number of
elements to process in this iteration. This number must be at least 1, and is used to
ensure that progress is always made.
If this callback is not defined, Synapse will use a default value of 100.

View File

@@ -71,15 +71,15 @@ Modules **must** register their web resources in their `__init__` method.
## Registering a callback
Modules can use Synapse's module API to register callbacks. Callbacks are functions that
Synapse will call when performing specific actions. Callbacks must be asynchronous, and
are split in categories. A single module may implement callbacks from multiple categories,
and is under no obligation to implement all callbacks from the categories it registers
callbacks for.
Synapse will call when performing specific actions. Callbacks must be asynchronous (unless
specified otherwise), and are split in categories. A single module may implement callbacks
from multiple categories, and is under no obligation to implement all callbacks from the
categories it registers callbacks for.
Modules can register callbacks using one of the module API's `register_[...]_callbacks`
methods. The callback functions are passed to these methods as keyword arguments, with
the callback name as the argument name and the function as its value. This is demonstrated
in the example below. A `register_[...]_callbacks` method exists for each category.
the callback name as the argument name and the function as its value. A
`register_[...]_callbacks` method exists for each category.
Callbacks for each category can be found on their respective page of the
[Synapse documentation website](https://matrix-org.github.io/synapse).

View File

@@ -83,7 +83,7 @@ oidc_providers:
### Dex
[Dex][dex-idp] is a simple, open-source, certified OpenID Connect Provider.
[Dex][dex-idp] is a simple, open-source OpenID Connect Provider.
Although it is designed to help building a full-blown provider with an
external database, it can be configured with static passwords in a config file.
@@ -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
@@ -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
@@ -523,7 +524,7 @@ The synapse config will look like this:
email_template: "{{ user.email }}"
```
## Django OAuth Toolkit
### Django OAuth Toolkit
[django-oauth-toolkit](https://github.com/jazzband/django-oauth-toolkit) is a
Django application providing out of the box all the endpoints, data and logic

View File

@@ -0,0 +1,74 @@
## Summary of performance impact of running on resource constrained devices such as SBCs
I've been running my homeserver on a cubietruck at home now for some time and am often replying to statements like "you need loads of ram to join large rooms" with "it works fine for me". I thought it might be useful to curate a summary of the issues you're likely to run into to help as a scaling-down guide, maybe highlight these for development work or end up as documentation. It seems that once you get up to about 4x1.5GHz arm64 4GiB these issues are no longer a problem.
- **Platform**: 2x1GHz armhf 2GiB ram [Single-board computers](https://wiki.debian.org/CheapServerBoxHardware), SSD, postgres.
### Presence
This is the main reason people have a poor matrix experience on resource constrained homeservers. Element web will frequently be saying the server is offline while the python process will be pegged at 100% cpu. This feature is used to tell when other users are active (have a client app in the foreground) and therefore more likely to respond, but requires a lot of network activity to maintain even when nobody is talking in a room.
![Screenshot_2020-10-01_19-29-46](https://user-images.githubusercontent.com/71895/94848963-a47a3580-041c-11eb-8b6e-acb772b4259e.png)
While synapse does have some performance issues with presence [#3971](https://github.com/matrix-org/synapse/issues/3971), the fundamental problem is that this is an easy feature to implement for a centralised service at nearly no overhead, but federation makes it combinatorial [#8055](https://github.com/matrix-org/synapse/issues/8055). There is also a client-side config option which disables the UI and idle tracking [enable_presence_by_hs_url] to blacklist the largest instances but I didn't notice much difference, so I recommend disabling the feature entirely at the server level as well.
[enable_presence_by_hs_url]: https://github.com/vector-im/element-web/blob/v1.7.8/config.sample.json#L45
### Joining
Joining a "large", federated room will initially fail with the below message in Element web, but waiting a while (10-60mins) and trying again will succeed without any issue. What counts as "large" is not message history, user count, connections to homeservers or even a simple count of the state events, it is instead how long the state resolution algorithm takes. However, each of those numbers are reasonable proxies, so we can use them as estimates since user count is one of the few things you see before joining.
![Screenshot_2020-10-02_17-15-06](https://user-images.githubusercontent.com/71895/94945781-18771500-04d3-11eb-8419-83c2da73a341.png)
This is [#1211](https://github.com/matrix-org/synapse/issues/1211) and will also hopefully be mitigated by peeking [matrix-org/matrix-doc#2753](https://github.com/matrix-org/matrix-doc/pull/2753) so at least you don't need to wait for a join to complete before finding out if it's the kind of room you want. Note that you should first disable presence, otherwise it'll just make the situation worse [#3120](https://github.com/matrix-org/synapse/issues/3120). There is a lot of database interaction too, so make sure you've [migrated your data](../postgres.md) from the default sqlite to postgresql. Personally, I recommend patience - once the initial join is complete there's rarely any issues with actually interacting with the room, but if you like you can just block "large" rooms entirely.
### Sessions
Anything that requires modifying the device list [#7721](https://github.com/matrix-org/synapse/issues/7721) will take a while to propagate, again taking the client "Offline" until it's complete. This includes signing in and out, editing the public name and verifying e2ee. The main mitigation I recommend is to keep long-running sessions open e.g. by using Firefox SSB "Use this site in App mode" or Chromium PWA "Install Element".
### Recommended configuration
Put the below in a new file at /etc/matrix-synapse/conf.d/sbc.yaml to override the defaults in homeserver.yaml.
```
# Set to false to disable presence tracking on this homeserver.
use_presence: false
# When this is enabled, the room "complexity" will be checked before a user
# joins a new remote room. If it is above the complexity limit, the server will
# disallow joining, or will instantly leave.
limit_remote_rooms:
# Uncomment to enable room complexity checking.
#enabled: true
complexity: 3.0
# Database configuration
database:
name: psycopg2
args:
user: matrix-synapse
# Generate a long, secure one with a password manager
password: hunter2
database: matrix-synapse
host: localhost
cp_min: 5
cp_max: 10
```
Currently the complexity is measured by [current_state_events / 500](https://github.com/matrix-org/synapse/blob/v1.20.1/synapse/storage/databases/main/events_worker.py#L986). You can find join times and your most complex rooms like this:
```
admin@homeserver:~$ zgrep '/client/r0/join/' /var/log/matrix-synapse/homeserver.log* | awk '{print $18, $25}' | sort --human-numeric-sort
29.922sec/-0.002sec /_matrix/client/r0/join/%23debian-fasttrack%3Apoddery.com
182.088sec/0.003sec /_matrix/client/r0/join/%23decentralizedweb-general%3Amatrix.org
911.625sec/-570.847sec /_matrix/client/r0/join/%23synapse%3Amatrix.org
admin@homeserver:~$ sudo --user postgres psql matrix-synapse --command 'select canonical_alias, joined_members, current_state_events from room_stats_state natural join room_stats_current where canonical_alias is not null order by current_state_events desc fetch first 5 rows only'
canonical_alias | joined_members | current_state_events
-------------------------------+----------------+----------------------
#_oftc_#debian:matrix.org | 871 | 52355
#matrix:matrix.org | 6379 | 10684
#irc:matrix.org | 461 | 3751
#decentralizedweb-general:matrix.org | 997 | 1509
#whatsapp:maunium.net | 554 | 854
```

View File

@@ -1,6 +1,6 @@
# Using Postgres
Synapse supports PostgreSQL versions 9.6 or later.
Synapse supports PostgreSQL versions 10 or later.
## Install postgres client libraries
@@ -118,6 +118,9 @@ performance:
Note that the appropriate values for those fields depend on the amount
of free memory the database host has available.
Additionally, admins of large deployments might want to consider using huge pages
to help manage memory, especially when using large values of `shared_buffers`. You
can read more about that [here](https://www.postgresql.org/docs/10/kernel-resources.html#LINUX-HUGE-PAGES).
## Porting from SQLite

View File

@@ -63,7 +63,7 @@ server {
server_name matrix.example.com;
location ~* ^(\/_matrix|\/_synapse\/client) {
location ~ ^(/_matrix|/_synapse/client) {
# note: do not add a path (even a single /) after the port in `proxy_pass`,
# otherwise nginx will canonicalise the URI and cause signature verification
# errors.

View File

@@ -37,7 +37,7 @@
# Server admins can expand Synapse's functionality with external modules.
#
# See https://matrix-org.github.io/synapse/latest/modules.html for more
# See https://matrix-org.github.io/synapse/latest/modules/index.html for more
# documentation on how to configure or create custom modules for Synapse.
#
modules:
@@ -164,7 +164,7 @@ presence:
# The default room version for newly created rooms.
#
# Known room versions are listed here:
# https://matrix.org/docs/spec/#complete-list-of-room-versions
# https://spec.matrix.org/latest/rooms/#complete-list-of-room-versions
#
# For example, for room version 1, default_room_version should be set
# to "1".
@@ -1209,6 +1209,44 @@ oembed:
#
#session_lifetime: 24h
# Time that an access token remains valid for, if the session is
# using refresh tokens.
# For more information about refresh tokens, please see the manual.
# Note that this only applies to clients which advertise support for
# refresh tokens.
#
# Note also that this is calculated at login time and refresh time:
# changes are not applied to existing sessions until they are refreshed.
#
# By default, this is 5 minutes.
#
#refreshable_access_token_lifetime: 5m
# Time that a refresh token remains valid for (provided that it is not
# exchanged for another one first).
# This option can be used to automatically log-out inactive sessions.
# Please see the manual for more information.
#
# Note also that this is calculated at login time and refresh time:
# changes are not applied to existing sessions until they are refreshed.
#
# By default, this is infinite.
#
#refresh_token_lifetime: 24h
# Time that an access token remains valid for, if the session is NOT
# using refresh tokens.
# Please note that not all clients support refresh tokens, so setting
# this to a short value may be inconvenient for some users who will
# then be logged out frequently.
#
# Note also that this is calculated at login time: changes are not applied
# retrospectively to existing sessions for users that have already logged in.
#
# By default, this is infinite.
#
#nonrefreshable_access_token_lifetime: 24h
# The user must provide all of the below types of 3PID when registering.
#
#registrations_require_3pid:
@@ -1450,6 +1488,7 @@ room_prejoin_state:
# - m.room.encryption
# - m.room.name
# - m.room.create
# - m.room.topic
#
# Uncomment the following to disable these defaults (so that only the event
# types listed in 'additional_event_types' are shared). Defaults to 'false'.
@@ -1464,6 +1503,21 @@ room_prejoin_state:
#additional_event_types:
# - org.example.custom.event.type
# 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
#
@@ -1831,10 +1885,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.
#
# Defaults to 'auto', which fetches the userinfo endpoint if 'openid' is
# included in 'scopes'. Set to 'userinfo_endpoint' to always fetch the
# Valid values are: 'auto' or 'userinfo_endpoint'.
#
# 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

View File

@@ -164,7 +164,7 @@ xbps-install -S synapse
Synapse can be installed via FreeBSD Ports or Packages contributed by Brendan Molloy from:
- Ports: `cd /usr/ports/net-im/py-matrix-synapse && make install clean`
- Packages: `pkg install py37-matrix-synapse`
- Packages: `pkg install py38-matrix-synapse`
#### OpenBSD

View File

@@ -49,12 +49,12 @@ comment these options out and use those specified by the module instead.
A custom mapping provider must specify the following methods:
* `__init__(self, parsed_config)`
* `def __init__(self, parsed_config)`
- Arguments:
- `parsed_config` - A configuration object that is the return value of the
`parse_config` method. You should set any configuration options needed by
the module here.
* `parse_config(config)`
* `def parse_config(config)`
- This method should have the `@staticmethod` decoration.
- Arguments:
- `config` - A `dict` representing the parsed content of the
@@ -63,13 +63,13 @@ A custom mapping provider must specify the following methods:
any option values they need here.
- Whatever is returned will be passed back to the user mapping provider module's
`__init__` method during construction.
* `get_remote_user_id(self, userinfo)`
* `def get_remote_user_id(self, userinfo)`
- Arguments:
- `userinfo` - A `authlib.oidc.core.claims.UserInfo` object to extract user
information from.
- This method must return a string, which is the unique, immutable identifier
for the user. Commonly the `sub` claim of the response.
* `map_user_attributes(self, userinfo, token, failures)`
* `async def map_user_attributes(self, userinfo, token, failures)`
- This method must be async.
- Arguments:
- `userinfo` - A `authlib.oidc.core.claims.UserInfo` object to extract user
@@ -91,7 +91,7 @@ A custom mapping provider must specify the following methods:
during a user's first login. Once a localpart has been associated with a
remote user ID (see `get_remote_user_id`) it cannot be updated.
- `displayname`: An optional string, the display name for the user.
* `get_extra_attributes(self, userinfo, token)`
* `async def get_extra_attributes(self, userinfo, token)`
- This method must be async.
- Arguments:
- `userinfo` - A `authlib.oidc.core.claims.UserInfo` object to extract user
@@ -125,15 +125,15 @@ comment these options out and use those specified by the module instead.
A custom mapping provider must specify the following methods:
* `__init__(self, parsed_config, module_api)`
* `def __init__(self, parsed_config, module_api)`
- Arguments:
- `parsed_config` - A configuration object that is the return value of the
`parse_config` method. You should set any configuration options needed by
the module here.
- `module_api` - a `synapse.module_api.ModuleApi` object which provides the
stable API available for extension modules.
* `parse_config(config)`
- This method should have the `@staticmethod` decoration.
* `def parse_config(config)`
- **This method should have the `@staticmethod` decoration.**
- Arguments:
- `config` - A `dict` representing the parsed content of the
`saml_config.user_mapping_provider.config` homeserver config option.
@@ -141,15 +141,15 @@ A custom mapping provider must specify the following methods:
any option values they need here.
- Whatever is returned will be passed back to the user mapping provider module's
`__init__` method during construction.
* `get_saml_attributes(config)`
- This method should have the `@staticmethod` decoration.
* `def get_saml_attributes(config)`
- **This method should have the `@staticmethod` decoration.**
- Arguments:
- `config` - A object resulting from a call to `parse_config`.
- Returns a tuple of two sets. The first set equates to the SAML auth
response attributes that are required for the module to function, whereas
the second set consists of those attributes which can be used if available,
but are not necessary.
* `get_remote_user_id(self, saml_response, client_redirect_url)`
* `def get_remote_user_id(self, saml_response, client_redirect_url)`
- Arguments:
- `saml_response` - A `saml2.response.AuthnResponse` object to extract user
information from.
@@ -157,7 +157,7 @@ A custom mapping provider must specify the following methods:
redirected to.
- This method must return a string, which is the unique, immutable identifier
for the user. Commonly the `uid` claim of the response.
* `saml_response_to_user_attributes(self, saml_response, failures, client_redirect_url)`
* `def saml_response_to_user_attributes(self, saml_response, failures, client_redirect_url)`
- Arguments:
- `saml_response` - A `saml2.response.AuthnResponse` object to extract user
information from.

View File

@@ -71,7 +71,12 @@ Below are the templates Synapse will look for when generating the content of an
* `sender_avatar_url`: the avatar URL (as a `mxc://` URL) for the event's
sender
* `sender_hash`: a hash of the user ID of the sender
* `msgtype`: the type of the message
* `body_text_html`: html representation of the message
* `body_text_plain`: plaintext representation of the message
* `image_url`: mxc url of an image, when "msgtype" is "m.image"
* `link`: a `matrix.to` link to the room
* `avator_url`: url to the room's avator
* `reason`: information on the event that triggered the email to be sent. It's an
object with the following attributes:
* `room_id`: the ID of the room the event was sent in

View File

@@ -15,8 +15,8 @@ The following sections describe how to install [coturn](<https://github.com/cotu
For TURN relaying with `coturn` to work, it must be hosted on a server/endpoint with a public IP.
Hosting TURN behind a NAT (even with appropriate port forwarding) is known to cause issues
and to often not work.
Hosting TURN behind NAT requires port forwaring and for the NAT gateway to have a public IP.
However, even with appropriate configuration, NAT is known to cause issues and to often not work.
## `coturn` setup
@@ -103,7 +103,23 @@ This will install and start a systemd service called `coturn`.
denied-peer-ip=192.168.0.0-192.168.255.255
denied-peer-ip=172.16.0.0-172.31.255.255
# recommended additional local peers to block, to mitigate external access to internal services.
# https://www.rtcsec.com/article/slack-webrtc-turn-compromise-and-bug-bounty/#how-to-fix-an-open-turn-relay-to-address-this-vulnerability
no-multicast-peers
denied-peer-ip=0.0.0.0-0.255.255.255
denied-peer-ip=100.64.0.0-100.127.255.255
denied-peer-ip=127.0.0.0-127.255.255.255
denied-peer-ip=169.254.0.0-169.254.255.255
denied-peer-ip=192.0.0.0-192.0.0.255
denied-peer-ip=192.0.2.0-192.0.2.255
denied-peer-ip=192.88.99.0-192.88.99.255
denied-peer-ip=198.18.0.0-198.19.255.255
denied-peer-ip=198.51.100.0-198.51.100.255
denied-peer-ip=203.0.113.0-203.0.113.255
denied-peer-ip=240.0.0.0-255.255.255.255
# special case the turn server itself so that client->TURN->TURN->client flows work
# this should be one of the turn server's listening IPs
allowed-peer-ip=10.0.0.1
# consider whether you want to limit the quota of relayed streams per user (or total) to avoid risk of DoS.
@@ -121,34 +137,58 @@ 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_uri` settings below
In this case, replace the `turn:` schemes in the `turn_uris` settings below
with `turns:`.
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
for the UDP relay.)
1. We do not recommend running a TURN server behind NAT, and are not aware of
anyone doing so successfully.
If you want to try it anyway, you will at least need to tell coturn its
external IP address:
1. If your TURN server is behind NAT, the NAT gateway must have an external,
publicly-reachable IP address. You must configure coturn to advertise that
address to connecting clients:
```
external-ip=192.88.99.1
external-ip=EXTERNAL_NAT_IPv4_ADDRESS
```
... and your NAT gateway must forward all of the relayed ports directly
(eg, port 56789 on the external IP must be always be forwarded to port
56789 on the internal IP).
You may optionally limit the TURN server to listen only on the local
address that is mapped by NAT to the external address:
If you get this working, let us know!
```
listening-ip=INTERNAL_TURNSERVER_IPv4_ADDRESS
```
If your NAT gateway is reachable over both IPv4 and IPv6, you may
configure coturn to advertise each available address:
```
external-ip=EXTERNAL_NAT_IPv4_ADDRESS
external-ip=EXTERNAL_NAT_IPv6_ADDRESS
```
When advertising an external IPv6 address, ensure that the firewall and
network settings of the system running your TURN server are configured to
accept IPv6 traffic, and that the TURN server is listening on the local
IPv6 address that is mapped by NAT to the external IPv6 address.
1. (Re)start the turn server:
@@ -216,15 +256,16 @@ connecting". Unfortunately, troubleshooting this can be tricky.
Here are a few things to try:
* Check that your TURN server is not behind NAT. As above, we're not aware of
anyone who has successfully set this up.
* Check that you have opened your firewall to allow TCP and UDP traffic to the
TURN ports (normally 3478 and 5349).
* 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
@@ -234,6 +275,18 @@ Here are a few things to try:
Try removing any AAAA records for your TURN server, so that it is only
reachable over IPv4.
* If your TURN server is behind NAT:
* double-check that your NAT gateway is correctly forwarding all TURN
ports (normally 3478 & 5349 for TCP & UDP TURN traffic, and 49152-65535 for the UDP
relay) to the NAT-internal address of your TURN server. If advertising
both IPv4 and IPv6 external addresses via the `external-ip` option, ensure
that the NAT is forwarding both IPv4 and IPv6 traffic to the IPv4 and IPv6
internal addresses of your TURN server. When in doubt, remove AAAA records
for your TURN server and specify only an IPv4 address as your `external-ip`.
* ensure that your TURN server uses the NAT gateway as its default route.
* Enable more verbose logging in coturn via the `verbose` setting:
```

View File

@@ -85,6 +85,17 @@ process, for example:
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
```
# Upgrading to v1.50.0
## Dropping support for old Python and Postgres versions
In line with our [deprecation policy](deprecation_policy.md),
we've dropped support for Python 3.6 and PostgreSQL 9.6, as they are no
longer supported upstream.
This release of Synapse requires Python 3.7+ and PostgreSQL 10+.
# Upgrading to v1.47.0
## Removal of old Room Admin API

View File

@@ -0,0 +1,114 @@
# Federation API
This API allows a server administrator to manage Synapse's federation with other homeservers.
Note: This API is new, experimental and "subject to change".
## List of destinations
This API gets the current destination retry timing info for all remote servers.
The list contains all the servers with which the server federates,
regardless of whether an error occurred or not.
If an error occurs, it may take up to 20 minutes for the error to be displayed here,
as a complete retry must have failed.
The API is:
A standard request with no filtering:
```
GET /_synapse/admin/v1/federation/destinations
```
A response body like the following is returned:
```json
{
"destinations":[
{
"destination": "matrix.org",
"retry_last_ts": 1557332397936,
"retry_interval": 3000000,
"failure_ts": 1557329397936,
"last_successful_stream_ordering": null
}
],
"total": 1
}
```
To paginate, check for `next_token` and if present, call the endpoint again
with `from` set to the value of `next_token`. This will return a new page.
If the endpoint does not return a `next_token` then there are no more destinations
to paginate through.
**Parameters**
The following query parameters are available:
- `from` - Offset in the returned list. Defaults to `0`.
- `limit` - Maximum amount of destinations to return. Defaults to `100`.
- `order_by` - The method in which to sort the returned list of destinations.
Valid values are:
- `destination` - Destinations are ordered alphabetically by remote server name.
This is the default.
- `retry_last_ts` - Destinations are ordered by time of last retry attempt in ms.
- `retry_interval` - Destinations are ordered by how long until next retry in ms.
- `failure_ts` - Destinations are ordered by when the server started failing in ms.
- `last_successful_stream_ordering` - Destinations are ordered by the stream ordering
of the most recent successfully-sent PDU.
- `dir` - Direction of room order. Either `f` for forwards or `b` for backwards. Setting
this value to `b` will reverse the above sort order. Defaults to `f`.
*Caution:* The database only has an index on the column `destination`.
This means that if a different sort order is used,
this can cause a large load on the database, especially for large environments.
**Response**
The following fields are returned in the JSON response body:
- `destinations` - An array of objects, each containing information about a destination.
Destination objects contain the following fields:
- `destination` - string - Name of the remote server to federate.
- `retry_last_ts` - integer - The last time Synapse tried and failed to reach the
remote server, in ms. This is `0` if the last attempt to communicate with the
remote server was successful.
- `retry_interval` - integer - How long since the last time Synapse tried to reach
the remote server before trying again, in ms. This is `0` if no further retrying occuring.
- `failure_ts` - nullable integer - The first time Synapse tried and failed to reach the
remote server, in ms. This is `null` if communication with the remote server has never failed.
- `last_successful_stream_ordering` - nullable integer - The stream ordering of the most
recent successfully-sent [PDU](understanding_synapse_through_grafana_graphs.md#federation)
to this destination, or `null` if this information has not been tracked yet.
- `next_token`: string representing a positive integer - Indication for pagination. See above.
- `total` - integer - Total number of destinations.
# Destination Details API
This API gets the retry timing info for a specific remote server.
The API is:
```
GET /_synapse/admin/v1/federation/destinations/<destination>
```
A response body like the following is returned:
```json
{
"destination": "matrix.org",
"retry_last_ts": 1557332397936,
"retry_interval": 3000000,
"failure_ts": 1557329397936,
"last_successful_stream_ordering": null
}
```
**Response**
The response fields are the same like in the `destinations` array in
[List of destinations](#list-of-destinations) response.

View File

@@ -0,0 +1,103 @@
## Admin FAQ
How do I become a server admin?
---
If your server already has an admin account you should use the user admin API to promote other accounts to become admins. See [User Admin API](../../admin_api/user_admin_api.md#Change-whether-a-user-is-a-server-administrator-or-not)
If you don't have any admin accounts yet you won't be able to use the admin API so you'll have to edit the database manually. Manually editing the database is generally not recommended so once you have an admin account, use the admin APIs to make further changes.
```sql
UPDATE users SET admin = 1 WHERE name = '@foo:bar.com';
```
What servers are my server talking to?
---
Run this sql query on your db:
```sql
SELECT * FROM destinations;
```
What servers are currently participating in this room?
---
Run this sql query on your db:
```sql
SELECT DISTINCT split_part(state_key, ':', 2)
FROM current_state_events AS c
INNER JOIN room_memberships AS m USING (room_id, event_id)
WHERE room_id = '!cURbafjkfsMDVwdRDQ:matrix.org' AND membership = 'join';
```
What users are registered on my server?
---
```sql
SELECT NAME from users;
```
Manually resetting passwords:
---
See https://github.com/matrix-org/synapse/blob/master/README.rst#password-reset
I have a problem with my server. Can I just delete my database and start again?
---
Deleting your database is unlikely to make anything better.
It's easy to make the mistake of thinking that you can start again from a clean slate by dropping your database, but things don't work like that in a federated network: lots of other servers have information about your server.
For example: other servers might think that you are in a room, your server will think that you are not, and you'll probably be unable to interact with that room in a sensible way ever again.
In general, there are better solutions to any problem than dropping the database. Come and seek help in https://matrix.to/#/#synapse:matrix.org.
There are two exceptions when it might be sensible to delete your database and start again:
* You have *never* joined any rooms which are federated with other servers. For instance, a local deployment which the outside world can't talk to.
* You are changing the `server_name` in the homeserver configuration. In effect this makes your server a completely new one from the point of view of the network, so in this case it makes sense to start with a clean database.
(In both cases you probably also want to clear out the media_store.)
I've stuffed up access to my room, how can I delete it to free up the alias?
---
Using the following curl command:
```
curl -H 'Authorization: Bearer <access-token>' -X DELETE https://matrix.org/_matrix/client/r0/directory/room/<room-alias>
```
`<access-token>` - can be obtained in riot by looking in the riot settings, down the bottom is:
Access Token:\<click to reveal\>
`<room-alias>` - the room alias, eg. #my_room:matrix.org this possibly needs to be URL encoded also, for example %23my_room%3Amatrix.org
How can I find the lines corresponding to a given HTTP request in my homeserver log?
---
Synapse tags each log line according to the HTTP request it is processing. When it finishes processing each request, it logs a line containing the words `Processed request: `. For example:
```
2019-02-14 22:35:08,196 - synapse.access.http.8008 - 302 - INFO - GET-37 - ::1 - 8008 - {@richvdh:localhost} Processed request: 0.173sec/0.001sec (0.002sec, 0.000sec) (0.027sec/0.026sec/2) 687B 200 "GET /_matrix/client/r0/sync HTTP/1.1" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" [0 dbevts]"
```
Here we can see that the request has been tagged with `GET-37`. (The tag depends on the method of the HTTP request, so might start with `GET-`, `PUT-`, `POST-`, `OPTIONS-` or `DELETE-`.) So to find all lines corresponding to this request, we can do:
```
grep 'GET-37' homeserver.log
```
If you want to paste that output into a github issue or matrix room, please remember to surround it with triple-backticks (```) to make it legible (see https://help.github.com/en/articles/basic-writing-and-formatting-syntax#quoting-code).
What do all those fields in the 'Processed' line mean?
---
See [Request log format](request_log.md).
What are the biggest rooms on my server?
---
```sql
SELECT s.canonical_alias, g.room_id, count(*) AS num_rows
FROM
state_groups_state AS g,
room_stats_state AS s
WHERE g.room_id = s.room_id
GROUP BY s.canonical_alias, g.room_id
ORDER BY num_rows desc
LIMIT 10;
```
You can also use the [List Room API](../../admin_api/rooms.md#list-room-api)
and `order_by` `state_events`.

View File

@@ -0,0 +1,18 @@
This blog post by Victor Berger explains how to use many of the tools listed on this page: https://levans.fr/shrink-synapse-database.html
# List of useful tools and scripts for maintenance Synapse database:
## [Purge Remote Media API](../../admin_api/media_admin_api.md#purge-remote-media-api)
The purge remote media API allows server admins to purge old cached remote media.
## [Purge Local Media API](../../admin_api/media_admin_api.md#delete-local-media)
This API deletes the *local* media from the disk of your own server.
## [Purge History API](../../admin_api/purge_history_api.md)
The purge history API allows server admins to purge historic events from their database, reclaiming disk space.
## [synapse-compress-state](https://github.com/matrix-org/rust-synapse-compress-state)
Tool for compressing (deduplicating) `state_groups_state` table.
## [SQL for analyzing Synapse PostgreSQL database stats](useful_sql_for_admins.md)
Some easy SQL that reports useful stats about your Synapse database.

View File

@@ -0,0 +1,25 @@
# How do State Groups work?
As a general rule, I encourage people who want to understand the deepest darkest secrets of the database schema to drop by #synapse-dev:matrix.org and ask questions.
However, one question that comes up frequently is that of how "state groups" work, and why the `state_groups_state` table gets so big, so here's an attempt to answer that question.
We need to be able to relatively quickly calculate the state of a room at any point in that room's history. In other words, we need to know the state of the room at each event in that room. This is done as follows:
A sequence of events where the state is the same are grouped together into a `state_group`; the mapping is recorded in `event_to_state_groups`. (Technically speaking, since a state event usually changes the state in the room, we are recording the state of the room *after* the given event id: which is to say, to a handwavey simplification, the first event in a state group is normally a state event, and others in the same state group are normally non-state-events.)
`state_groups` records, for each state group, the id of the room that we're looking at, and also the id of the first event in that group. (I'm not sure if that event id is used much in practice.)
Now, if we stored all the room state for each `state_group`, that would be a huge amount of data. Instead, for each state group, we normally store the difference between the state in that group and some other state group, and only occasionally (every 100 state changes or so) record the full state.
So, most state groups have an entry in `state_group_edges` (don't ask me why it's not a column in `state_groups`) which records the previous state group in the room, and `state_groups_state` records the differences in state since that previous state group.
A full state group just records the event id for each piece of state in the room at that point.
## Known bugs with state groups
There are various reasons that we can end up creating many more state groups than we need: see https://github.com/matrix-org/synapse/issues/3364 for more details.
## Compression tool
There is a tool at https://github.com/matrix-org/rust-synapse-compress-state which can compress the `state_groups_state` on a room by-room basis (essentially, it reduces the number of "full" state groups). This can result in dramatic reductions of the storage used.

View File

@@ -0,0 +1,84 @@
## Understanding Synapse through Grafana graphs
It is possible to monitor much of the internal state of Synapse using [Prometheus](https://prometheus.io)
metrics and [Grafana](https://grafana.com/).
A guide for configuring Synapse to provide metrics is available [here](../../metrics-howto.md)
and information on setting up Grafana is [here](https://github.com/matrix-org/synapse/tree/master/contrib/grafana).
In this setup, Prometheus will periodically scrape the information Synapse provides and
store a record of it over time. Grafana is then used as an interface to query and
present this information through a series of pretty graphs.
Once you have grafana set up, and assuming you're using [our grafana dashboard template](https://github.com/matrix-org/synapse/blob/master/contrib/grafana/synapse.json), look for the following graphs when debugging a slow/overloaded Synapse:
## Message Event Send Time
![image](https://user-images.githubusercontent.com/1342360/82239409-a1c8e900-9930-11ea-8081-e4614e0c63f4.png)
This, along with the CPU and Memory graphs, is a good way to check the general health of your Synapse instance. It represents how long it takes for a user on your homeserver to send a message.
## Transaction Count and Transaction Duration
![image](https://user-images.githubusercontent.com/1342360/82239985-8d392080-9931-11ea-80d0-843ab2f22e1e.png)
![image](https://user-images.githubusercontent.com/1342360/82240050-ab068580-9931-11ea-98f1-f94671cbac9a.png)
These graphs show the database transactions that are occurring the most frequently, as well as those are that are taking the most amount of time to execute.
![image](https://user-images.githubusercontent.com/1342360/82240192-e86b1300-9931-11ea-9aac-3e2c9bfa6fdc.png)
In the first graph, we can see obvious spikes corresponding to lots of `get_user_by_id` transactions. This would be useful information to figure out which part of the Synapse codebase is potentially creating a heavy load on the system. However, be sure to cross-reference this with Transaction Duration, which states that `get_users_by_id` is actually a very quick database transaction and isn't causing as much load as others, like `persist_events`:
![image](https://user-images.githubusercontent.com/1342360/82240467-62030100-9932-11ea-8db9-917f2d977fe1.png)
Still, it's probably worth investigating why we're getting users from the database that often, and whether it's possible to reduce the amount of queries we make by adjusting our cache factor(s).
The `persist_events` transaction is responsible for saving new room events to the Synapse database, so can often show a high transaction duration.
## Federation
The charts in the "Federation" section show information about incoming and outgoing federation requests. Federation data can be divided into two basic types:
- PDU (Persistent Data Unit) - room events: messages, state events (join/leave), etc. These are permanently stored in the database.
- EDU (Ephemeral Data Unit) - other data, which need not be stored permanently, such as read receipts, typing notifications.
The "Outgoing EDUs by type" chart shows the EDUs within outgoing federation requests by type: `m.device_list_update`, `m.direct_to_device`, `m.presence`, `m.receipt`, `m.typing`.
If you see a large number of `m.presence` EDUs and are having trouble with too much CPU load, you can disable `presence` in the Synapse config. See also [#3971](https://github.com/matrix-org/synapse/issues/3971).
## Caches
![image](https://user-images.githubusercontent.com/1342360/82240572-8b239180-9932-11ea-96ff-6b5f0e57ebe5.png)
![image](https://user-images.githubusercontent.com/1342360/82240666-b8703f80-9932-11ea-86af-9f663988d8da.png)
This is quite a useful graph. It shows how many times Synapse attempts to retrieve a piece of data from a cache which the cache did not contain, thus resulting in a call to the database. We can see here that the `_get_joined_profile_from_event_id` cache is being requested a lot, and often the data we're after is not cached.
Cross-referencing this with the Eviction Rate graph, which shows that entries are being evicted from `_get_joined_profile_from_event_id` quite often:
![image](https://user-images.githubusercontent.com/1342360/82240766-de95df80-9932-11ea-8c15-5acfc57c48da.png)
we should probably consider raising the size of that cache by raising its cache factor (a multiplier value for the size of an individual cache). Information on doing so is available [here](https://github.com/matrix-org/synapse/blob/ee421e524478c1ad8d43741c27379499c2f6135c/docs/sample_config.yaml#L608-L642) (note that the configuration of individual cache factors through the configuration file is available in Synapse v1.14.0+, whereas doing so through environment variables has been supported for a very long time). Note that this will increase Synapse's overall memory usage.
## Forward Extremities
![image](https://user-images.githubusercontent.com/1342360/82241440-13566680-9934-11ea-8b88-ba468db937ed.png)
Forward extremities are the leaf events at the end of a DAG in a room, aka events that have no children. The more that exist in a room, the more [state resolution](https://spec.matrix.org/v1.1/server-server-api/#room-state-resolution) that Synapse needs to perform (hint: it's an expensive operation). While Synapse has code to prevent too many of these existing at one time in a room, bugs can sometimes make them crop up again.
If a room has >10 forward extremities, it's worth checking which room is the culprit and potentially removing them using the SQL queries mentioned in [#1760](https://github.com/matrix-org/synapse/issues/1760).
## Garbage Collection
![image](https://user-images.githubusercontent.com/1342360/82241911-da6ac180-9934-11ea-9a0d-a311fe22acd0.png)
Large spikes in garbage collection times (bigger than shown here, I'm talking in the
multiple seconds range), can cause lots of problems in Synapse performance. It's more an
indicator of problems, and a symptom of other problems though, so check other graphs for what might be causing it.
## Final Thoughts
If you're still having performance problems with your Synapse instance and you've
tried everything you can, it may just be a lack of system resources. Consider adding
more CPU and RAM, and make use of [worker mode](../../workers.md)
to make use of multiple CPU cores / multiple machines for your homeserver.

View File

@@ -0,0 +1,156 @@
## Some useful SQL queries for Synapse Admins
## Size of full matrix db
`SELECT pg_size_pretty( pg_database_size( 'matrix' ) );`
### Result example:
```
pg_size_pretty
----------------
6420 MB
(1 row)
```
## Show top 20 larger rooms by state events count
```sql
SELECT r.name, s.room_id, s.current_state_events
FROM room_stats_current s
LEFT JOIN room_stats_state r USING (room_id)
ORDER BY current_state_events DESC
LIMIT 20;
```
and by state_group_events count:
```sql
SELECT rss.name, s.room_id, count(s.room_id) FROM state_groups_state s
LEFT JOIN room_stats_state rss USING (room_id)
GROUP BY s.room_id, rss.name
ORDER BY count(s.room_id) DESC
LIMIT 20;
```
plus same, but with join removed for performance reasons:
```sql
SELECT s.room_id, count(s.room_id) FROM state_groups_state s
GROUP BY s.room_id
ORDER BY count(s.room_id) DESC
LIMIT 20;
```
## Show top 20 larger tables by row count
```sql
SELECT relname, n_live_tup as rows
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC
LIMIT 20;
```
This query is quick, but may be very approximate, for exact number of rows use `SELECT COUNT(*) FROM <table_name>`.
### Result example:
```
state_groups_state - 161687170
event_auth - 8584785
event_edges - 6995633
event_json - 6585916
event_reference_hashes - 6580990
events - 6578879
received_transactions - 5713989
event_to_state_groups - 4873377
stream_ordering_to_exterm - 4136285
current_state_delta_stream - 3770972
event_search - 3670521
state_events - 2845082
room_memberships - 2785854
cache_invalidation_stream - 2448218
state_groups - 1255467
state_group_edges - 1229849
current_state_events - 1222905
users_in_public_rooms - 364059
device_lists_stream - 326903
user_directory_search - 316433
```
## Show top 20 rooms by new events count in last 1 day:
```sql
SELECT e.room_id, r.name, COUNT(e.event_id) cnt FROM events e
LEFT JOIN room_stats_state r USING (room_id)
WHERE e.origin_server_ts >= DATE_PART('epoch', NOW() - INTERVAL '1 day') * 1000 GROUP BY e.room_id, r.name ORDER BY cnt DESC LIMIT 20;
```
## Show top 20 users on homeserver by sent events (messages) at last month:
```sql
SELECT user_id, SUM(total_events)
FROM user_stats_historical
WHERE TO_TIMESTAMP(end_ts/1000) AT TIME ZONE 'UTC' > date_trunc('day', now() - interval '1 month')
GROUP BY user_id
ORDER BY SUM(total_events) DESC
LIMIT 20;
```
## Show last 100 messages from needed user, with room names:
```sql
SELECT e.room_id, r.name, e.event_id, e.type, e.content, j.json FROM events e
LEFT JOIN event_json j USING (room_id)
LEFT JOIN room_stats_state r USING (room_id)
WHERE sender = '@LOGIN:example.com'
AND e.type = 'm.room.message'
ORDER BY stream_ordering DESC
LIMIT 100;
```
## Show top 20 larger tables by storage size
```sql
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
AND C.relkind <> 'i'
AND nspname !~ '^pg_toast'
ORDER BY pg_total_relation_size(C.oid) DESC
LIMIT 20;
```
### Result example:
```
public.state_groups_state - 27 GB
public.event_json - 9855 MB
public.events - 3675 MB
public.event_edges - 3404 MB
public.received_transactions - 2745 MB
public.event_reference_hashes - 1864 MB
public.event_auth - 1775 MB
public.stream_ordering_to_exterm - 1663 MB
public.event_search - 1370 MB
public.room_memberships - 1050 MB
public.event_to_state_groups - 948 MB
public.current_state_delta_stream - 711 MB
public.state_events - 611 MB
public.presence_stream - 530 MB
public.current_state_events - 525 MB
public.cache_invalidation_stream - 466 MB
public.receipts_linearized - 279 MB
public.state_groups - 160 MB
public.device_lists_remote_cache - 124 MB
public.state_group_edges - 122 MB
```
## Show rooms with names, sorted by events in this rooms
`echo "select event_json.room_id,room_stats_state.name from event_json,room_stats_state where room_stats_state.room_id=event_json.room_id" | psql synapse | sort | uniq -c | sort -n`
### Result example:
```
9459 !FPUfgzXYWTKgIrwKxW:matrix.org | This Week in Matrix
9459 !FPUfgzXYWTKgIrwKxW:matrix.org | This Week in Matrix (TWIM)
17799 !iDIOImbmXxwNngznsa:matrix.org | Linux in Russian
18739 !GnEEPYXUhoaHbkFBNX:matrix.org | Riot Android
23373 !QtykxKocfZaZOUrTwp:matrix.org | Matrix HQ
39504 !gTQfWzbYncrtNrvEkB:matrix.org | ru.[matrix]
43601 !iNmaIQExDMeqdITdHH:matrix.org | Riot
43601 !iNmaIQExDMeqdITdHH:matrix.org | Riot Web/Desktop
```
## Lookup room state info by list of room_id
```sql
SELECT rss.room_id, rss.name, rss.canonical_alias, rss.topic, rss.encryption, rsc.joined_members, rsc.local_users_in_room, rss.join_rules
FROM room_stats_state rss
LEFT JOIN room_stats_current rsc USING (room_id)
WHERE room_id IN (WHERE room_id IN (
'!OGEhHVWSdvArJzumhm:matrix.org',
'!YTvKGNlinIzlkMTVRl:matrix.org'
)
```

View File

@@ -0,0 +1,139 @@
# Refresh Tokens
Synapse supports refresh tokens since version 1.49 (some earlier versions had support for an earlier, experimental draft of [MSC2918] which is not compatible).
[MSC2918]: https://github.com/matrix-org/matrix-doc/blob/main/proposals/2918-refreshtokens.md#msc2918-refresh-tokens
## Background and motivation
Synapse users' sessions are identified by **access tokens**; access tokens are
issued to users on login. Each session gets a unique access token which identifies
it; the access token must be kept secret as it grants access to the user's account.
Traditionally, these access tokens were eternally valid (at least until the user
explicitly chose to log out).
In some cases, it may be desirable for these access tokens to expire so that the
potential damage caused by leaking an access token is reduced.
On the other hand, forcing a user to re-authenticate (log in again) often might
be too much of an inconvenience.
**Refresh tokens** are a mechanism to avoid some of this inconvenience whilst
still getting most of the benefits of short access token lifetimes.
Refresh tokens are also a concept present in OAuth 2 — further reading is available
[here](https://datatracker.ietf.org/doc/html/rfc6749#section-1.5).
When refresh tokens are in use, both an access token and a refresh token will be
issued to users on login. The access token will expire after a predetermined amount
of time, but otherwise works in the same way as before. When the access token is
close to expiring (or has expired), the user's client should present the homeserver
(Synapse) with the refresh token.
The homeserver will then generate a new access token and refresh token for the user
and return them. The old refresh token is invalidated and can not be used again*.
Finally, refresh tokens also make it possible for sessions to be logged out if they
are inactive for too long, before the session naturally ends; see the configuration
guide below.
*To prevent issues if clients lose connection half-way through refreshing a token,
the refresh token is only invalidated once the new access token has been used at
least once. For all intents and purposes, the above simplification is sufficient.
## Caveats
There are some caveats:
* If a third party gets both your access token and refresh token, they will be able to
continue to enjoy access to your session.
* This is still an improvement because you (the user) will notice when *your*
session expires and you're not able to use your refresh token.
That would be a giveaway that someone else has compromised your session.
You would be able to log in again and terminate that session.
Previously (with long-lived access tokens), a third party that has your access
token could go undetected for a very long time.
* Clients need to implement support for refresh tokens in order for them to be a
useful mechanism.
* It is up to homeserver administrators if they want to issue long-lived access
tokens to clients not implementing refresh tokens.
* For compatibility, it is likely that they should, at least until client support
is widespread.
* Users with clients that support refresh tokens will still benefit from the
added security; it's not possible to downgrade a session to using long-lived
access tokens so this effectively gives users the choice.
* In a closed environment where all users use known clients, this may not be
an issue as the homeserver administrator can know if the clients have refresh
token support. In that case, the non-refreshable access token lifetime
may be set to a short duration so that a similar level of security is provided.
## Configuration Guide
The following configuration options, in the `registration` section, are related:
* `session_lifetime`: maximum length of a session, even if it's refreshed.
In other words, the client must log in again after this time period.
In most cases, this can be unset (infinite) or set to a long time (years or months).
* `refreshable_access_token_lifetime`: lifetime of access tokens that are created
by clients supporting refresh tokens.
This should be short; a good value might be 5 minutes (`5m`).
* `nonrefreshable_access_token_lifetime`: lifetime of access tokens that are created
by clients which don't support refresh tokens.
Make this short if you want to effectively force use of refresh tokens.
Make this long if you don't want to inconvenience users of clients which don't
support refresh tokens (by forcing them to frequently re-authenticate using
login credentials).
* `refresh_token_lifetime`: lifetime of refresh tokens.
In other words, the client must refresh within this time period to maintain its session.
Unless you want to log inactive sessions out, it is often fine to use a long
value here or even leave it unset (infinite).
Beware that making it too short will inconvenience clients that do not connect
very often, including mobile clients and clients of infrequent users (by making
it more difficult for them to refresh in time, which may force them to need to
re-authenticate using login credentials).
**Note:** All four options above only apply when tokens are created (by logging in or refreshing).
Changes to these settings do not apply retroactively.
### Using refresh token expiry to log out inactive sessions
If you'd like to force sessions to be logged out upon inactivity, you can enable
refreshable access token expiry and refresh token expiry.
This works because a client must refresh at least once within a period of
`refresh_token_lifetime` in order to maintain valid credentials to access the
account.
(It's suggested that `refresh_token_lifetime` should be longer than
`refreshable_access_token_lifetime` and this section assumes that to be the case
for simplicity.)
Note: this will only affect sessions using refresh tokens. You may wish to
set a short `nonrefreshable_access_token_lifetime` to prevent this being bypassed
by clients that do not support refresh tokens.
#### Choosing values that guarantee permitting some inactivity
It may be desirable to permit some short periods of inactivity, for example to
accommodate brief outages in client connectivity.
The following model aims to provide guidance for choosing `refresh_token_lifetime`
and `refreshable_access_token_lifetime` to satisfy requirements of the form:
1. inactivity longer than `L` **MUST** cause the session to be logged out; and
2. inactivity shorter than `S` **MUST NOT** cause the session to be logged out.
This model makes the weakest assumption that all active clients will refresh as
needed to maintain an active access token, but no sooner.
*In reality, clients may refresh more often than this model assumes, but the
above requirements will still hold.*
To satisfy the above model,
* `refresh_token_lifetime` should be set to `L`; and
* `refreshable_access_token_lifetime` should be set to `L - S`.

View File

@@ -210,7 +210,7 @@ expressions:
^/_matrix/federation/v1/get_groups_publicised$
^/_matrix/key/v2/query
^/_matrix/federation/unstable/org.matrix.msc2946/spaces/
^/_matrix/federation/unstable/org.matrix.msc2946/hierarchy/
^/_matrix/federation/(v1|unstable/org.matrix.msc2946)/hierarchy/
# Inbound federation transaction request
^/_matrix/federation/v1/send/
@@ -223,7 +223,7 @@ expressions:
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$
^/_matrix/client/unstable/org.matrix.msc2946/rooms/.*/spaces$
^/_matrix/client/unstable/org.matrix.msc2946/rooms/.*/hierarchy$
^/_matrix/client/(v1|unstable/org.matrix.msc2946)/rooms/.*/hierarchy$
^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$
^/_matrix/client/(api/v1|r0|v3|unstable)/account/3pid$
^/_matrix/client/(api/v1|r0|v3|unstable)/devices$

View File

@@ -25,15 +25,9 @@ exclude = (?x)
^(
|synapse/storage/databases/__init__.py
|synapse/storage/databases/main/__init__.py
|synapse/storage/databases/main/account_data.py
|synapse/storage/databases/main/cache.py
|synapse/storage/databases/main/devices.py
|synapse/storage/databases/main/e2e_room_keys.py
|synapse/storage/databases/main/end_to_end_keys.py
|synapse/storage/databases/main/event_federation.py
|synapse/storage/databases/main/event_push_actions.py
|synapse/storage/databases/main/events_bg_updates.py
|synapse/storage/databases/main/events_worker.py
|synapse/storage/databases/main/group_server.py
|synapse/storage/databases/main/metrics.py
|synapse/storage/databases/main/monthly_active_users.py
@@ -41,12 +35,9 @@ exclude = (?x)
|synapse/storage/databases/main/purge_events.py
|synapse/storage/databases/main/push_rule.py
|synapse/storage/databases/main/receipts.py
|synapse/storage/databases/main/room.py
|synapse/storage/databases/main/roommember.py
|synapse/storage/databases/main/search.py
|synapse/storage/databases/main/state.py
|synapse/storage/databases/main/stats.py
|synapse/storage/databases/main/transactions.py
|synapse/storage/databases/main/user_directory.py
|synapse/storage/schema/
@@ -87,9 +78,6 @@ exclude = (?x)
|tests/push/test_presentable_names.py
|tests/push/test_push_rule_evaluator.py
|tests/rest/admin/test_admin.py
|tests/rest/admin/test_device.py
|tests/rest/admin/test_media.py
|tests/rest/admin/test_server_notice.py
|tests/rest/admin/test_user.py
|tests/rest/admin/test_username_available.py
|tests/rest/client/test_account.py
@@ -111,8 +99,6 @@ exclude = (?x)
|tests/server.py
|tests/server_notices/test_resource_limits_server_notices.py
|tests/state/test_v2.py
|tests/storage/test_account_data.py
|tests/storage/test_appservice.py
|tests/storage/test_background_update.py
|tests/storage/test_base.py
|tests/storage/test_client_ips.py
@@ -125,7 +111,6 @@ exclude = (?x)
|tests/test_server.py
|tests/test_state.py
|tests/test_terms_auth.py
|tests/test_visibility.py
|tests/unittest.py
|tests/util/caches/test_cached_call.py
|tests/util/caches/test_deferred_cache.py
@@ -151,6 +136,9 @@ disallow_untyped_defs = True
[mypy-synapse.app.*]
disallow_untyped_defs = True
[mypy-synapse.appservice.*]
disallow_untyped_defs = True
[mypy-synapse.config._base]
disallow_untyped_defs = True
@@ -160,12 +148,27 @@ disallow_untyped_defs = True
[mypy-synapse.events.*]
disallow_untyped_defs = True
[mypy-synapse.federation.*]
disallow_untyped_defs = True
[mypy-synapse.federation.transport.client]
disallow_untyped_defs = False
[mypy-synapse.handlers.*]
disallow_untyped_defs = True
[mypy-synapse.http.server]
disallow_untyped_defs = True
[mypy-synapse.logging.context]
disallow_untyped_defs = True
[mypy-synapse.metrics.*]
disallow_untyped_defs = True
[mypy-synapse.module_api.*]
disallow_untyped_defs = True
[mypy-synapse.push.*]
disallow_untyped_defs = True
@@ -178,21 +181,48 @@ disallow_untyped_defs = True
[mypy-synapse.state.*]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.account_data]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.client_ips]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.directory]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.e2e_room_keys]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.end_to_end_keys]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.event_push_actions]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.events_bg_updates]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.events_worker]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.room]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.room_batch]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.profile]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.stats]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.state_deltas]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.transactions]
disallow_untyped_defs = True
[mypy-synapse.storage.databases.main.user_erasure_store]
disallow_untyped_defs = True
@@ -217,9 +247,16 @@ disallow_untyped_defs = True
[mypy-tests.storage.test_user_directory]
disallow_untyped_defs = True
[mypy-tests.rest.admin.*]
disallow_untyped_defs = True
[mypy-tests.rest.client.test_directory]
disallow_untyped_defs = True
[mypy-tests.federation.transport.test_client]
disallow_untyped_defs = True
;; Dependencies without annotations
;; Before ignoring a module, check to see if type stubs are available.
;; The `typeshed` project maintains stubs here:
@@ -276,9 +313,6 @@ ignore_missing_imports = True
[mypy-netaddr]
ignore_missing_imports = True
[mypy-opentracing]
ignore_missing_imports = True
[mypy-parameterized.*]
ignore_missing_imports = True

View File

@@ -35,7 +35,7 @@
showcontent = true
[tool.black]
target-version = ['py36']
target-version = ['py37', 'py38', 'py39', 'py310']
exclude = '''
(

View File

@@ -24,7 +24,6 @@ DISTS = (
"debian:bullseye",
"debian:bookworm",
"debian:sid",
"ubuntu:bionic", # 18.04 LTS (our EOL forced by Py36 on 2021-12-23)
"ubuntu:focal", # 20.04 LTS (our EOL forced by Py38 on 2024-10-14)
"ubuntu:hirsute", # 21.04 (EOL 2022-01-05)
"ubuntu:impish", # 21.10 (EOL 2022-07)

View File

@@ -42,8 +42,8 @@ echo "--------------------------"
echo
matched=0
for f in $(git diff --name-only FETCH_HEAD... -- changelog.d); do
# check that any modified newsfiles on this branch end with a full stop.
for f in $(git diff --diff-filter=d --name-only FETCH_HEAD... -- changelog.d); do
# check that any added newsfiles on this branch end with a full stop.
lastchar=$(tr -d '\n' < "$f" | tail -c 1)
if [ "$lastchar" != '.' ] && [ "$lastchar" != '!' ]; then
echo -e "\e[31mERROR: newsfragment $f does not end with a '.' or '!'\e[39m" >&2

View File

@@ -23,6 +23,9 @@
# Exit if a line returns a non-zero exit code
set -e
# enable buildkit for the docker builds
export DOCKER_BUILDKIT=1
# Change to the repository root
cd "$(dirname $0)/.."
@@ -47,7 +50,7 @@ if [[ -n "$WORKERS" ]]; then
COMPLEMENT_DOCKERFILE=SynapseWorkers.Dockerfile
# And provide some more configuration to complement.
export COMPLEMENT_CA=true
export COMPLEMENT_VERSION_CHECK_ITERATIONS=500
export COMPLEMENT_SPAWN_HS_TIMEOUT_SECS=25
else
export COMPLEMENT_BASE_IMAGE=complement-synapse
COMPLEMENT_DOCKERFILE=Synapse.Dockerfile
@@ -65,4 +68,5 @@ if [[ -n "$1" ]]; then
fi
# Run the tests!
go test -v -tags synapse_blacklist,msc2946,msc3083,msc2403 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests/...
echo "Images built; running complement"
go test -v -tags synapse_blacklist,msc2403 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests/...

View File

@@ -15,6 +15,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Script for signing and sending federation requests.
Some tips on doing the join dance with this:
room_id=...
user_id=...
# make_join
federation_client.py "/_matrix/federation/v1/make_join/$room_id/$user_id?ver=5" > make_join.json
# sign
jq -M .event make_join.json | sign_json --sign-event-room-version=$(jq -r .room_version make_join.json) -o signed-join.json
# send_join
federation_client.py -X PUT "/_matrix/federation/v2/send_join/$room_id/x" --body $(<signed-join.json) > send_join.json
"""
import argparse
import base64
import json

View File

@@ -22,6 +22,8 @@ import yaml
from signedjson.key import read_signing_keys
from signedjson.sign import sign_json
from synapse.api.room_versions import KNOWN_ROOM_VERSIONS
from synapse.crypto.event_signing import add_hashes_and_signatures
from synapse.util import json_encoder
@@ -68,6 +70,16 @@ Example usage:
),
)
parser.add_argument(
"--sign-event-room-version",
type=str,
help=(
"Sign the JSON as an event for the given room version, rather than raw JSON. "
"This means that we will add a 'hashes' object, and redact the event before "
"signing."
),
)
input_args = parser.add_mutually_exclusive_group()
input_args.add_argument("input_data", nargs="?", help="Raw JSON to be signed.")
@@ -116,7 +128,17 @@ Example usage:
print("Input json was not an object", file=sys.stderr)
sys.exit(1)
sign_json(obj, args.server_name, keys[0])
if args.sign_event_room_version:
room_version = KNOWN_ROOM_VERSIONS.get(args.sign_event_room_version)
if not room_version:
print(
f"Unknown room version {args.sign_event_room_version}", file=sys.stderr
)
sys.exit(1)
add_hashes_and_signatures(room_version, obj, args.server_name, keys[0])
else:
sign_json(obj, args.server_name, keys[0])
for c in json_encoder.iterencode(obj):
args.output.write(c)
args.output.write("\n")

View File

@@ -96,7 +96,7 @@ CONDITIONAL_REQUIREMENTS["all"] = list(ALL_OPTIONAL_REQUIREMENTS)
# We pin black so that our tests don't start failing on new releases.
CONDITIONAL_REQUIREMENTS["lint"] = [
"isort==5.7.0",
"black==21.6b0",
"black==21.12b0",
"flake8-comprehensions",
"flake8-bugbear==21.3.2",
"flake8",
@@ -107,6 +107,7 @@ CONDITIONAL_REQUIREMENTS["mypy"] = [
"mypy-zope==0.3.2",
"types-bleach>=4.1.0",
"types-jsonschema>=3.2.0",
"types-opentracing>=2.4.2",
"types-Pillow>=8.3.4",
"types-pyOpenSSL>=20.0.7",
"types-PyYAML>=5.4.10",
@@ -150,12 +151,17 @@ setup(
long_description=long_description,
long_description_content_type="text/x-rst",
python_requires="~=3.6",
entry_points={
"console_scripts": [
"synapse_homeserver = synapse.app.homeserver:main",
"synapse_worker = synapse.app.generic_worker:main",
]
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Topic :: Communications :: Chat",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",

View File

@@ -17,11 +17,12 @@
from typing import Any, List, Optional, Type, Union
from twisted.internet import protocol
from twisted.internet.defer import Deferred
class RedisProtocol(protocol.Protocol):
def publish(self, channel: str, message: bytes): ...
async def ping(self) -> None: ...
async def set(
def ping(self) -> "Deferred[None]": ...
def set(
self,
key: str,
value: Any,
@@ -29,8 +30,8 @@ class RedisProtocol(protocol.Protocol):
pexpire: Optional[int] = None,
only_if_not_exists: bool = False,
only_if_exists: bool = False,
) -> None: ...
async def get(self, key: str) -> Any: ...
) -> "Deferred[None]": ...
def get(self, key: str) -> "Deferred[Any]": ...
class SubscriberProtocol(RedisProtocol):
def __init__(self, *args, **kwargs): ...

View File

@@ -47,7 +47,7 @@ try:
except ImportError:
pass
__version__ = "1.48.0"
__version__ = "1.50.1"
if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
# We import here so that we don't have to install a bunch of deps when

View File

@@ -46,7 +46,9 @@ class UserInfo:
ips: List[str] = attr.Factory(list)
def get_recent_users(txn: LoggingTransaction, since_ms: int) -> List[UserInfo]:
def get_recent_users(
txn: LoggingTransaction, since_ms: int, exclude_app_service: bool
) -> List[UserInfo]:
"""Fetches recently registered users and some info on them."""
sql = """
@@ -56,6 +58,9 @@ def get_recent_users(txn: LoggingTransaction, since_ms: int) -> List[UserInfo]:
AND deactivated = 0
"""
if exclude_app_service:
sql += " AND appservice_id IS NULL"
txn.execute(sql, (since_ms / 1000,))
user_infos = [UserInfo(user_id, creation_ts) for user_id, creation_ts in txn]
@@ -113,7 +118,7 @@ def main() -> None:
"-e",
"--exclude-emails",
action="store_true",
help="Exclude users that have validated email addresses",
help="Exclude users that have validated email addresses.",
)
parser.add_argument(
"-u",
@@ -121,6 +126,12 @@ def main() -> None:
action="store_true",
help="Only print user IDs that match.",
)
parser.add_argument(
"-a",
"--exclude-app-service",
help="Exclude appservice users.",
action="store_true",
)
config = ReviewConfig()
@@ -133,6 +144,7 @@ def main() -> None:
since_ms = time.time() * 1000 - Config.parse_duration(config_args.since)
exclude_users_with_email = config_args.exclude_emails
exclude_users_with_appservice = config_args.exclude_app_service
include_context = not config_args.only_users
for database_config in config.database.databases:
@@ -143,7 +155,7 @@ def main() -> None:
with make_conn(database_config, engine, "review_recent_signups") as db_conn:
# This generates a type of Cursor, not LoggingTransaction.
user_infos = get_recent_users(db_conn.cursor(), since_ms) # type: ignore[arg-type]
user_infos = get_recent_users(db_conn.cursor(), since_ms, exclude_users_with_appservice) # type: ignore[arg-type]
for user_info in user_infos:
if exclude_users_with_email and user_info.emails:

View File

@@ -32,7 +32,7 @@ from synapse.appservice import ApplicationService
from synapse.events import EventBase
from synapse.http import get_request_user_agent
from synapse.http.site import SynapseRequest
from synapse.logging import opentracing as opentracing
from synapse.logging.opentracing import active_span, force_tracing, start_active_span
from synapse.storage.databases.main.registration import TokenLookupResult
from synapse.types import Requester, StateMap, UserID, create_requester
from synapse.util.caches.lrucache import LruCache
@@ -71,6 +71,7 @@ class Auth:
self._auth_blocking = AuthBlocking(self.hs)
self._track_appservice_user_ips = hs.config.appservice.track_appservice_user_ips
self._track_puppeted_user_ips = hs.config.api.track_puppeted_user_ips
self._macaroon_secret_key = hs.config.key.macaroon_secret_key
self._force_tracing_for_users = hs.config.tracing.force_tracing_for_users
@@ -149,13 +150,53 @@ class Auth:
is invalid.
AuthError if access is denied for the user in the access token
"""
parent_span = active_span()
with start_active_span("get_user_by_req"):
requester = await self._wrapped_get_user_by_req(
request, allow_guest, rights, allow_expired
)
if parent_span:
if requester.authenticated_entity in self._force_tracing_for_users:
# request tracing is enabled for this user, so we need to force it
# tracing on for the parent span (which will be the servlet span).
#
# It's too late for the get_user_by_req span to inherit the setting,
# so we also force it on for that.
force_tracing()
force_tracing(parent_span)
parent_span.set_tag(
"authenticated_entity", requester.authenticated_entity
)
parent_span.set_tag("user_id", requester.user.to_string())
if requester.device_id is not None:
parent_span.set_tag("device_id", requester.device_id)
if requester.app_service is not None:
parent_span.set_tag("appservice_id", requester.app_service.id)
return requester
async def _wrapped_get_user_by_req(
self,
request: SynapseRequest,
allow_guest: bool,
rights: str,
allow_expired: bool,
) -> Requester:
"""Helper for get_user_by_req
Once get_user_by_req has set up the opentracing span, this does the actual work.
"""
try:
ip_addr = request.getClientIP()
user_agent = get_request_user_agent(request)
access_token = self.get_access_token_from_request(request)
user_id, app_service = await self._get_appservice_user_id(request)
(
user_id,
device_id,
app_service,
) = await self._get_appservice_user_id_and_device_id(request)
if user_id and app_service:
if ip_addr and self._track_appservice_user_ips:
await self.store.insert_client_ip(
@@ -163,18 +204,16 @@ class Auth:
access_token=access_token,
ip=ip_addr,
user_agent=user_agent,
device_id="dummy-device", # stubbed
device_id="dummy-device"
if device_id is None
else device_id, # stubbed
)
requester = create_requester(user_id, app_service=app_service)
requester = create_requester(
user_id, app_service=app_service, device_id=device_id
)
request.requester = user_id
if user_id in self._force_tracing_for_users:
opentracing.force_tracing()
opentracing.set_tag("authenticated_entity", user_id)
opentracing.set_tag("user_id", user_id)
opentracing.set_tag("appservice_id", app_service.id)
return requester
user_info = await self.get_user_by_access_token(
@@ -208,6 +247,18 @@ class Auth:
user_agent=user_agent,
device_id=device_id,
)
# Track also the puppeted user client IP if enabled and the user is puppeting
if (
user_info.user_id != user_info.token_owner
and self._track_puppeted_user_ips
):
await self.store.insert_client_ip(
user_id=user_info.user_id,
access_token=access_token,
ip=ip_addr,
user_agent=user_agent,
device_id=device_id,
)
if is_guest and not allow_guest:
raise AuthError(
@@ -232,13 +283,6 @@ class Auth:
)
request.requester = requester
if user_info.token_owner in self._force_tracing_for_users:
opentracing.force_tracing()
opentracing.set_tag("authenticated_entity", user_info.token_owner)
opentracing.set_tag("user_id", user_info.user_id)
if device_id:
opentracing.set_tag("device_id", device_id)
return requester
except KeyError:
raise MissingClientTokenError()
@@ -274,33 +318,81 @@ class Auth:
403, "Application service has not registered this user (%s)" % user_id
)
async def _get_appservice_user_id(
async def _get_appservice_user_id_and_device_id(
self, request: Request
) -> Tuple[Optional[str], Optional[ApplicationService]]:
) -> Tuple[Optional[str], Optional[str], Optional[ApplicationService]]:
"""
Given a request, reads the request parameters to determine:
- whether it's an application service that's making this request
- what user the application service should be treated as controlling
(the user_id URI parameter allows an application service to masquerade
any applicable user in its namespace)
- what device the application service should be treated as controlling
(the device_id[^1] URI parameter allows an application service to masquerade
as any device that exists for the relevant user)
[^1] Unstable and provided by MSC3202.
Must use `org.matrix.msc3202.device_id` in place of `device_id` for now.
Returns:
3-tuple of
(user ID?, device ID?, application service?)
Postconditions:
- If an application service is returned, so is a user ID
- A user ID is never returned without an application service
- A device ID is never returned without a user ID or an application service
- The returned application service, if present, is permitted to control the
returned user ID.
- The returned device ID, if present, has been checked to be a valid device ID
for the returned user ID.
"""
DEVICE_ID_ARG_NAME = b"org.matrix.msc3202.device_id"
app_service = self.store.get_app_service_by_token(
self.get_access_token_from_request(request)
)
if app_service is None:
return None, None
return None, None, None
if app_service.ip_range_whitelist:
ip_address = IPAddress(request.getClientIP())
if ip_address not in app_service.ip_range_whitelist:
return None, None
return None, None, None
# This will always be set by the time Twisted calls us.
assert request.args is not None
if b"user_id" not in request.args:
return app_service.sender, app_service
if b"user_id" in request.args:
effective_user_id = request.args[b"user_id"][0].decode("utf8")
await self.validate_appservice_can_control_user_id(
app_service, effective_user_id
)
else:
effective_user_id = app_service.sender
user_id = request.args[b"user_id"][0].decode("utf8")
await self.validate_appservice_can_control_user_id(app_service, user_id)
effective_device_id: Optional[str] = None
if app_service.sender == user_id:
return app_service.sender, app_service
if (
self.hs.config.experimental.msc3202_device_masquerading_enabled
and DEVICE_ID_ARG_NAME in request.args
):
effective_device_id = request.args[DEVICE_ID_ARG_NAME][0].decode("utf8")
# We only just set this so it can't be None!
assert effective_device_id is not None
device_opt = await self.store.get_device(
effective_user_id, effective_device_id
)
if device_opt is None:
# For now, use 400 M_EXCLUSIVE if the device doesn't exist.
# This is an open thread of discussion on MSC3202 as of 2021-12-09.
raise AuthError(
400,
f"Application service trying to use a device that doesn't exist ('{effective_device_id}' for {effective_user_id})",
Codes.EXCLUSIVE,
)
return user_id, app_service
return effective_user_id, effective_device_id, app_service
async def get_user_by_access_token(
self,

View File

@@ -17,6 +17,8 @@
"""Contains constants from the specification."""
from typing_extensions import Final
# the max size of a (canonical-json-encoded) event
MAX_PDU_SIZE = 65536
@@ -39,125 +41,125 @@ class Membership:
"""Represents the membership states of a user in a room."""
INVITE = "invite"
JOIN = "join"
KNOCK = "knock"
LEAVE = "leave"
BAN = "ban"
LIST = (INVITE, JOIN, KNOCK, LEAVE, BAN)
INVITE: Final = "invite"
JOIN: Final = "join"
KNOCK: Final = "knock"
LEAVE: Final = "leave"
BAN: Final = "ban"
LIST: Final = (INVITE, JOIN, KNOCK, LEAVE, BAN)
class PresenceState:
"""Represents the presence state of a user."""
OFFLINE = "offline"
UNAVAILABLE = "unavailable"
ONLINE = "online"
BUSY = "org.matrix.msc3026.busy"
OFFLINE: Final = "offline"
UNAVAILABLE: Final = "unavailable"
ONLINE: Final = "online"
BUSY: Final = "org.matrix.msc3026.busy"
class JoinRules:
PUBLIC = "public"
KNOCK = "knock"
INVITE = "invite"
PRIVATE = "private"
PUBLIC: Final = "public"
KNOCK: Final = "knock"
INVITE: Final = "invite"
PRIVATE: Final = "private"
# As defined for MSC3083.
RESTRICTED = "restricted"
RESTRICTED: Final = "restricted"
class RestrictedJoinRuleTypes:
"""Understood types for the allow rules in restricted join rules."""
ROOM_MEMBERSHIP = "m.room_membership"
ROOM_MEMBERSHIP: Final = "m.room_membership"
class LoginType:
PASSWORD = "m.login.password"
EMAIL_IDENTITY = "m.login.email.identity"
MSISDN = "m.login.msisdn"
RECAPTCHA = "m.login.recaptcha"
TERMS = "m.login.terms"
SSO = "m.login.sso"
DUMMY = "m.login.dummy"
REGISTRATION_TOKEN = "org.matrix.msc3231.login.registration_token"
PASSWORD: Final = "m.login.password"
EMAIL_IDENTITY: Final = "m.login.email.identity"
MSISDN: Final = "m.login.msisdn"
RECAPTCHA: Final = "m.login.recaptcha"
TERMS: Final = "m.login.terms"
SSO: Final = "m.login.sso"
DUMMY: Final = "m.login.dummy"
REGISTRATION_TOKEN: Final = "org.matrix.msc3231.login.registration_token"
# This is used in the `type` parameter for /register when called by
# an appservice to register a new user.
APP_SERVICE_REGISTRATION_TYPE = "m.login.application_service"
APP_SERVICE_REGISTRATION_TYPE: Final = "m.login.application_service"
class EventTypes:
Member = "m.room.member"
Create = "m.room.create"
Tombstone = "m.room.tombstone"
JoinRules = "m.room.join_rules"
PowerLevels = "m.room.power_levels"
Aliases = "m.room.aliases"
Redaction = "m.room.redaction"
ThirdPartyInvite = "m.room.third_party_invite"
RelatedGroups = "m.room.related_groups"
Member: Final = "m.room.member"
Create: Final = "m.room.create"
Tombstone: Final = "m.room.tombstone"
JoinRules: Final = "m.room.join_rules"
PowerLevels: Final = "m.room.power_levels"
Aliases: Final = "m.room.aliases"
Redaction: Final = "m.room.redaction"
ThirdPartyInvite: Final = "m.room.third_party_invite"
RelatedGroups: Final = "m.room.related_groups"
RoomHistoryVisibility = "m.room.history_visibility"
CanonicalAlias = "m.room.canonical_alias"
Encrypted = "m.room.encrypted"
RoomAvatar = "m.room.avatar"
RoomEncryption = "m.room.encryption"
GuestAccess = "m.room.guest_access"
RoomHistoryVisibility: Final = "m.room.history_visibility"
CanonicalAlias: Final = "m.room.canonical_alias"
Encrypted: Final = "m.room.encrypted"
RoomAvatar: Final = "m.room.avatar"
RoomEncryption: Final = "m.room.encryption"
GuestAccess: Final = "m.room.guest_access"
# These are used for validation
Message = "m.room.message"
Topic = "m.room.topic"
Name = "m.room.name"
Message: Final = "m.room.message"
Topic: Final = "m.room.topic"
Name: Final = "m.room.name"
ServerACL = "m.room.server_acl"
Pinned = "m.room.pinned_events"
ServerACL: Final = "m.room.server_acl"
Pinned: Final = "m.room.pinned_events"
Retention = "m.room.retention"
Retention: Final = "m.room.retention"
Dummy = "org.matrix.dummy_event"
Dummy: Final = "org.matrix.dummy_event"
SpaceChild = "m.space.child"
SpaceParent = "m.space.parent"
SpaceChild: Final = "m.space.child"
SpaceParent: Final = "m.space.parent"
MSC2716_INSERTION = "org.matrix.msc2716.insertion"
MSC2716_BATCH = "org.matrix.msc2716.batch"
MSC2716_MARKER = "org.matrix.msc2716.marker"
MSC2716_INSERTION: Final = "org.matrix.msc2716.insertion"
MSC2716_BATCH: Final = "org.matrix.msc2716.batch"
MSC2716_MARKER: Final = "org.matrix.msc2716.marker"
class ToDeviceEventTypes:
RoomKeyRequest = "m.room_key_request"
RoomKeyRequest: Final = "m.room_key_request"
class DeviceKeyAlgorithms:
"""Spec'd algorithms for the generation of per-device keys"""
ED25519 = "ed25519"
CURVE25519 = "curve25519"
SIGNED_CURVE25519 = "signed_curve25519"
ED25519: Final = "ed25519"
CURVE25519: Final = "curve25519"
SIGNED_CURVE25519: Final = "signed_curve25519"
class EduTypes:
Presence = "m.presence"
Presence: Final = "m.presence"
class RejectedReason:
AUTH_ERROR = "auth_error"
AUTH_ERROR: Final = "auth_error"
class RoomCreationPreset:
PRIVATE_CHAT = "private_chat"
PUBLIC_CHAT = "public_chat"
TRUSTED_PRIVATE_CHAT = "trusted_private_chat"
PRIVATE_CHAT: Final = "private_chat"
PUBLIC_CHAT: Final = "public_chat"
TRUSTED_PRIVATE_CHAT: Final = "trusted_private_chat"
class ThirdPartyEntityKind:
USER = "user"
LOCATION = "location"
USER: Final = "user"
LOCATION: Final = "location"
ServerNoticeMsgType = "m.server_notice"
ServerNoticeLimitReached = "m.server_notice.usage_limit_reached"
ServerNoticeMsgType: Final = "m.server_notice"
ServerNoticeLimitReached: Final = "m.server_notice.usage_limit_reached"
class UserTypes:
@@ -165,91 +167,95 @@ class UserTypes:
'admin' and 'guest' users should also be UserTypes. Normal users are type None
"""
SUPPORT = "support"
BOT = "bot"
ALL_USER_TYPES = (SUPPORT, BOT)
SUPPORT: Final = "support"
BOT: Final = "bot"
ALL_USER_TYPES: Final = (SUPPORT, BOT)
class RelationTypes:
"""The types of relations known to this server."""
ANNOTATION = "m.annotation"
REPLACE = "m.replace"
REFERENCE = "m.reference"
THREAD = "io.element.thread"
ANNOTATION: Final = "m.annotation"
REPLACE: Final = "m.replace"
REFERENCE: Final = "m.reference"
THREAD: Final = "io.element.thread"
class LimitBlockingTypes:
"""Reasons that a server may be blocked"""
MONTHLY_ACTIVE_USER = "monthly_active_user"
HS_DISABLED = "hs_disabled"
MONTHLY_ACTIVE_USER: Final = "monthly_active_user"
HS_DISABLED: Final = "hs_disabled"
class EventContentFields:
"""Fields found in events' content, regardless of type."""
# Labels for the event, cf https://github.com/matrix-org/matrix-doc/pull/2326
LABELS = "org.matrix.labels"
LABELS: Final = "org.matrix.labels"
# Timestamp to delete the event after
# cf https://github.com/matrix-org/matrix-doc/pull/2228
SELF_DESTRUCT_AFTER = "org.matrix.self_destruct_after"
SELF_DESTRUCT_AFTER: Final = "org.matrix.self_destruct_after"
# cf https://github.com/matrix-org/matrix-doc/pull/1772
ROOM_TYPE = "type"
ROOM_TYPE: Final = "type"
# Whether a room can federate.
FEDERATE = "m.federate"
FEDERATE: Final = "m.federate"
# The creator of the room, as used in `m.room.create` events.
ROOM_CREATOR = "creator"
ROOM_CREATOR: Final = "creator"
# Used in m.room.guest_access events.
GUEST_ACCESS = "guest_access"
GUEST_ACCESS: Final = "guest_access"
# Used on normal messages to indicate they were historically imported after the fact
MSC2716_HISTORICAL = "org.matrix.msc2716.historical"
MSC2716_HISTORICAL: Final = "org.matrix.msc2716.historical"
# For "insertion" events to indicate what the next batch ID should be in
# order to connect to it
MSC2716_NEXT_BATCH_ID = "org.matrix.msc2716.next_batch_id"
MSC2716_NEXT_BATCH_ID: Final = "org.matrix.msc2716.next_batch_id"
# Used on "batch" events to indicate which insertion event it connects to
MSC2716_BATCH_ID = "org.matrix.msc2716.batch_id"
MSC2716_BATCH_ID: Final = "org.matrix.msc2716.batch_id"
# For "marker" events
MSC2716_MARKER_INSERTION = "org.matrix.msc2716.marker.insertion"
MSC2716_MARKER_INSERTION: Final = "org.matrix.msc2716.marker.insertion"
# The authorising user for joining a restricted room.
AUTHORISING_USER = "join_authorised_via_users_server"
AUTHORISING_USER: Final = "join_authorised_via_users_server"
class RoomTypes:
"""Understood values of the room_type field of m.room.create events."""
SPACE = "m.space"
SPACE: Final = "m.space"
class RoomEncryptionAlgorithms:
MEGOLM_V1_AES_SHA2 = "m.megolm.v1.aes-sha2"
DEFAULT = MEGOLM_V1_AES_SHA2
MEGOLM_V1_AES_SHA2: Final = "m.megolm.v1.aes-sha2"
DEFAULT: Final = MEGOLM_V1_AES_SHA2
class AccountDataTypes:
DIRECT = "m.direct"
IGNORED_USER_LIST = "m.ignored_user_list"
DIRECT: Final = "m.direct"
IGNORED_USER_LIST: Final = "m.ignored_user_list"
class HistoryVisibility:
INVITED = "invited"
JOINED = "joined"
SHARED = "shared"
WORLD_READABLE = "world_readable"
INVITED: Final = "invited"
JOINED: Final = "joined"
SHARED: Final = "shared"
WORLD_READABLE: Final = "world_readable"
class GuestAccess:
CAN_JOIN = "can_join"
CAN_JOIN: Final = "can_join"
# anything that is not "can_join" is considered "forbidden", but for completeness:
FORBIDDEN = "forbidden"
FORBIDDEN: Final = "forbidden"
class ReceiptTypes:
READ: Final = "m.read"
class ReadReceiptEventFields:
MSC2285_HIDDEN = "org.matrix.msc2285.hidden"
MSC2285_HIDDEN: Final = "org.matrix.msc2285.hidden"

View File

@@ -351,8 +351,7 @@ class Filter:
True if the event matches the filter.
"""
# We usually get the full "events" as dictionaries coming through,
# except for presence which actually gets passed around as its own
# namedtuple type.
# except for presence which actually gets passed around as its own type.
if isinstance(event, UserPresenceState):
user_id = event.user_id
field_matchers = {

Some files were not shown because too many files have changed in this diff Show More