Commit graph

21804 commits

Author SHA1 Message Date
Andrew Morgan
7911e2835d
Prevent federation user keys query from returning device names if disallowed (#14304) 2022-10-28 18:06:02 +01:00
David Robertson
730b13dbc9
Improve RawHeaders type hints (#14303) 2022-10-28 16:04:02 +00:00
Patrick Cloke
81815e0561
Switch search SQL to triple-quote strings. (#14311)
For ease of reading we switch from concatenated strings to
triple quote strings.
2022-10-28 11:44:10 -04:00
Andrew Morgan
453914b472 Merge branch 'master' into develop 2022-10-28 16:30:54 +01:00
Andrew Morgan
d1efa7b3a4
Add a note that #14300 did not get a fix for 1.70.1 (#14318) 2022-10-28 16:28:30 +01:00
Olivier Wilkinson (reivilibre)
1335367ca7 Merge branch 'master' into develop 2022-10-28 15:59:51 +01:00
Dirk Klimpel
44f0d573cf
Add docs for an empty trusted_key_servers config option (#13999)
* Add docs for an empty `trusted_key_servers` config option

* small rewording

* Tweak changelog
2022-10-28 13:55:03 +01:00
Olivier Wilkinson (reivilibre)
e0d9013adf Tweak changelog 2022-10-28 12:26:40 +01:00
Olivier Wilkinson (reivilibre)
cc3a04876f 1.70.1 2022-10-28 12:10:37 +01:00
reivilibre
6a6e1e8c07
Fix room creation being rate limited too aggressively since Synapse v1.69.0. (#14314)
* Introduce a test for the old behaviour which we want to restore

* Reintroduce the old behaviour in a simpler way

* Newsfile

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>

* Use 1 credit instead of 2 for creating a room: be more lenient than before

Notably, the UI in Element Web was still broken after restoring to prior behaviour.

After discussion, we agreed that it would be sensible to increase the limit.

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2022-10-28 11:53:34 +01:00
Eric Eastwood
aa70556699
Check appservice user interest against the local users instead of all users (get_users_in_room mis-use) (#13958) 2022-10-27 18:29:23 +00:00
Patrick Cloke
67583281e3
Fix tests for change in PostgreSQL 14 behavior change. (#14310)
PostgreSQL 14 changed the behavior of `websearch_to_tsquery` to
improve some behaviour.

The tests were hitting those edge-cases about handling of hanging double
quotes. This fixes the tests to take into account the PostgreSQL version.
2022-10-27 13:58:12 +00:00
Dirk Klimpel
1357ae869f
Add workers settings to configuration manual (#14086)
* Add workers settings to configuration manual
* Update `pusher_instances`
* update url to python logger
* update headlines
* update links after headline change
* remove link from `daemon process`

There is no docs in Synapse for this

* extend example for `federation_sender_instances` and `pusher_instances`
* more infos about stream writers
* add link to DAG
* update `pusher_instances`
* update `worker_listeners`
* update `stream_writers`
* Update `worker_name`

Co-authored-by: David Robertson <davidr@element.io>
2022-10-27 14:39:47 +01:00
Mathieu Velten
4dc05f3019
Fix presence bug introduced in 1.64 by #13313 (#14243)
* Fix presence bug introduced in 1.64 by #13313

Signed-off-by: Mathieu Velten <mathieuv@matrix.org>

* Add changelog

* Add DISTINCT

* Apply suggestions from code review

Signed-off-by: Mathieu Velten <mathieuv@matrix.org>
2022-10-27 13:16:00 +01:00
David Robertson
cbe01ccc3f
Reject history insertion during partial joins (#14291) 2022-10-27 10:52:23 +01:00
Eric Eastwood
40fa8294e3
Refactor MSC3030 /timestamp_to_event to move away from our snowflake pull from destination pattern (#14096)
1. `federation_client.timestamp_to_event(...)` now handles all `destination` looping and uses our generic `_try_destination_list(...)` helper.
 2. Consistently handling `NotRetryingDestination` and `FederationDeniedError` across `get_pdu` , backfill, and the generic `_try_destination_list` which is used for many places we use this pattern.
 3. `get_pdu(...)` now returns `PulledPduInfo` so we know which `destination` we ended up pulling the PDU from
2022-10-26 16:10:55 -05:00
David Robertson
0d59ae706a
Use poetry 1.2 for complement in latest deps (#14305) 2022-10-26 17:22:26 +01:00
Ashish Kumar
0cfbb35131
fix broken avatar checks when server_name contains a port (#13927)
Fixes check_avatar_size_and_mime_type() to successfully update avatars on homeservers running on non-default ports which it would mistakenly treat as remote homeserver while validating the avatar's size and mime type.

Signed-off-by: Ashish Kumar ashfame@users.noreply.github.com
2022-10-26 15:51:23 +01:00
David Robertson
04fd6221de
Fix incorrectly sending authentication tokens to application service as headers (#14301) 2022-10-26 14:00:01 +01:00
Olivier Wilkinson (reivilibre)
86b7d9b886 Merge branch 'master' into develop 2022-10-26 13:05:09 +01:00
Quentin Gliech
8756d5c87e
Save login tokens in database (#13844)
* Save login tokens in database

Signed-off-by: Quentin Gliech <quenting@element.io>

* Add upgrade notes

* Track login token reuse in a Prometheus metric

Signed-off-by: Quentin Gliech <quenting@element.io>
2022-10-26 11:45:41 +01:00
Olivier Wilkinson (reivilibre)
23fa636ed7 1.70.0 2022-10-26 11:13:29 +01:00
James Salter
d902181de9
Unified search query syntax using the full-text search capabilities of the underlying DB. (#11635)
Support a unified search query syntax which leverages more of the full-text
search of each database supported by Synapse.

Supports, with the same syntax across Postgresql 11+ and Sqlite:

- quoted "search terms"
- `AND`, `OR`, `-` (negation) operators
- Matching words based on their stem, e.g. searches for "dog" matches
  documents containing "dogs". 

This is achieved by 

- If on postgresql 11+, pass the user input to `websearch_to_tsquery`
- If on sqlite, manually parse the query and transform it into the sqlite-specific
  query syntax.

Note that postgresql 10, which is close to end-of-life, falls back to using
`phraseto_tsquery`, which only supports a subset of the features.

Multiple terms separated by a space are implicitly ANDed.

Note that:

1. There is no escaping of full-text syntax that might be supported by the database;
  e.g. `NOT`, `NEAR`, `*` in sqlite. This runs the risk that people might discover this
  as accidental functionality and depend on something we don't guarantee.
2. English text is assumed for stemming. To support other languages, either the target
  language needs to be known at the time of indexing the message (via room metadata,
  or otherwise), or a separate index for each language supported could be created.

Sqlite docs: https://www.sqlite.org/fts3.html#full_text_index_queries
Postgres docs: https://www.postgresql.org/docs/11/textsearch-controls.html
2022-10-25 14:05:22 -04:00
Olivier Wilkinson (reivilibre)
85fcbba595 Merge branch 'release-v1.70' into develop 2022-10-25 15:39:35 +01:00
Quentin Gliech
9192d74b0b
Refactor OIDC tests to better mimic an actual OIDC provider. (#13910)
This implements a fake OIDC server, which intercepts calls to the HTTP client.
Improves accuracy of tests by covering more internal methods.

One particular example was the ID token validation, which previously mocked.

This uncovered an incorrect dependency: Synapse actually requires at least
authlib 0.15.1, not 0.14.0.
2022-10-25 14:25:02 +00:00
DeepBlueV7.X
2d0ba3f89a
Implementation for MSC3664: Pushrules for relations (#11804) 2022-10-25 14:38:01 +01:00
Olivier Wilkinson (reivilibre)
0f1befd0b1 Tweak changelog 2022-10-25 14:16:05 +01:00
Nick Mills-Barrett
c9dffd5b33
Remove unused @lru_cache decorator (#13595)
* Remove unused `@lru_cache` decorator

Spotted this working on something else.

Co-authored-by: David Robertson <davidr@element.io>
2022-10-25 11:39:25 +01:00
Erik Johnston
d125919963
Cache rust build deps in trial CI (#14287) 2022-10-25 11:27:56 +01:00
Olivier Wilkinson (reivilibre)
8c8fcdb87d 1.70.0rc2 2022-10-25 11:02:55 +01:00
asymmetric
8c94dd3a27
Enable WAL for SQLite (#13897)
Signed-off-by: Lorenzo Manacorda <lorenzo@mailbox.org>
2022-10-25 10:22:55 +01:00
Patrick Cloke
581b37b5d6
Revert behavior change for bundling edits of non-message events (#14283) 2022-10-24 17:07:16 +01:00
Ryan Miguel
19c0e55ef7
Return NOT_JSON if decode fails and defer set_timeline_upper_limit ca… (#14262)
* Return NOT_JSON if decode fails and defer set_timeline_upper_limit call until after check_valid_filter. Fixes #13661. Signed-off-by: Ryan Miguel <miguel.ryanj@gmail.com>.

* Reword changelog
2022-10-24 16:55:06 +01:00
dependabot[bot]
872ea2f4de
Bump serde_json from 1.0.86 to 1.0.87 (#14279) 2022-10-24 14:08:22 +01:00
David Robertson
1e73effebf
Fix typo in cibuildwheel conf introduced in #14253 2022-10-24 13:56:18 +01:00
Erik Johnston
09b588854e
Fix TypeError: 'dict_keys' object is not reversible (#14280) 2022-10-24 13:05:14 +01:00
dependabot[bot]
386e72a22d
Bump peaceiris/actions-gh-pages from 3.8.0 to 3.9.0 (#14276) 2022-10-24 10:16:33 +00:00
dependabot[bot]
c6987f65fe
Bump peaceiris/actions-mdbook from 1.1.14 to 1.2.0 (#14275) 2022-10-24 10:13:29 +00:00
Richard van der Hoff
1469fed0e3
Add debugging to help diagnose lost device-list-update (#14268) 2022-10-24 10:45:10 +01:00
dependabot[bot]
6c82b3759f
Bump pysaml2 from 7.1.2 to 7.2.1 (#14270) 2022-10-24 10:40:30 +01:00
dependabot[bot]
94f239d911
Bump jinja2 from 3.0.3 to 3.1.2 (#14271) 2022-10-24 10:40:08 +01:00
dependabot[bot]
673970bb5a
Bump types-requests from 2.28.11 to 2.28.11.2 (#14272) 2022-10-24 10:39:16 +01:00
dependabot[bot]
cb76892c7d
Bump setuptools-rust from 1.5.1 to 1.5.2 (#14273) 2022-10-24 10:39:00 +01:00
dependabot[bot]
cd02bfc026
Bump prometheus-client from 0.14.0 to 0.15.0 (#14274) 2022-10-24 10:38:40 +01:00
dependabot[bot]
5f06488418
Bump anyhow from 1.0.65 to 1.0.66 (#14278) 2022-10-24 10:20:13 +01:00
dependabot[bot]
278b530875
Bump serde from 1.0.145 to 1.0.147 (#14277) 2022-10-24 10:19:55 +01:00
Shay
b7a7ff6ee3
Add initial power level event to batch of bulk persisted events when creating a new room. (#14228) 2022-10-21 10:46:22 -07:00
Germain
1d45ad8b2a
Improve aesthetics and reusability of HTML templates. (#13652)
Use a base template to create a cohesive feel across the HTML
templates provided by Synapse.

Adds basic styling to the base template for a more user-friendly
look and feel.
2022-10-21 17:44:00 +00:00
Richard van der Hoff
d24346f530
Fix logging error on SIGHUP (#14258) 2022-10-21 16:03:44 +01:00
Erik Johnston
1c642156d7
Only build aarch64 wheels for cpython manylinux (#14259) 2022-10-21 14:22:26 +00:00