summary refs log tree commit diff
path: root/tests/push (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Bump mypy-zope & mypy. (#16188)Patrick Cloke2023-08-291-1/+1
|
* Replace simple_async_mock with AsyncMock (#16180)Patrick Cloke2023-08-251-3/+2
| | | | Python 3.8 has a native AsyncMock, use it instead of a custom implementation.
* Stabilize support for MSC3958 (suppress notifications from edits). (#16113)Patrick Cloke2023-08-231-1/+0
|
* Update MSC3958 support to interact with intentional mentions. (#15992)Patrick Cloke2023-08-021-2/+19
| | | | | | | * Updates the rule ID. * Use `event_property_is` instead of `event_match`. This updates the implementation of MSC3958 to match the latest text from the MSC.
* Stabilize support for MSC3952: Intentional mentions. (#15520)Patrick Cloke2023-06-061-21/+13
|
* Rename blacklist/whitelist internally. (#15620)Patrick Cloke2023-05-191-1/+1
| | | | Avoid renaming configuration settings for now and rename internal code to use blocklist and allowlist instead.
* Merge branch 'release-v1.83' into developSean Quah2023-05-031-1/+1
|\
| * Revert "Reduce the size of the HTTP connection pool for non-pushers" (#15530) v1.83.0rc1Sean Quah2023-05-031-1/+1
| | | | | | | | | | | | | | | | | | #15514 introduced a regression where Synapse would encounter `PartialDownloadError`s when fetching OpenID metadata for certain providers on startup. Due to #8088, this prevents Synapse from starting entirely. Revert the change while we decide what to do about the regression.
* | Allow adding random delay to push (#15516)Erik Johnston2023-05-021-0/+37
|/ | | This is to discourage timing based profiling on the push gateways.
* Reduce the size of the HTTP connection pool for non-pushers. (#15514)Patrick Cloke2023-05-021-1/+1
| | | | | | | | | | | | | | Pushers tend to make many connections to the same HTTP host (e.g. a new event comes in, causes events to be pushed, and then the homeserver connects to the same host many times). Due to this the per-host HTTP connection pool size was increased, but this does not make sense for other SimpleHttpClients. Add a parameter for the connection pool and override it for pushers (making a separate SimpleHttpClient for pushers with the increased configuration). This returns the HTTP connection pool settings to the default Twisted ones for non-pusher HTTP clients.
* Make cleaning up pushers depend on the device_id instead of the token_id ↵Quentin Gliech2023-03-242-28/+24
| | | | | | | | | | | | | | (#15280) This makes it so that we rely on the `device_id` to delete pushers on logout, instead of relying on the `access_token_id`. This ensures we're not removing pushers on token refresh, and prepares for a world without access token IDs (also known as the OIDC). This actually runs the `set_device_id_for_pushers` background update, which was forgotten in #13831. Note that for backwards compatibility it still deletes pushers based on the `access_token` until the background update finishes.
* Reject mentions on the C-S API which are invalid. (#15311)Patrick Cloke2023-03-241-38/+56
| | | | | | Invalid mentions data received over the Client-Server API should be rejected with a 400 error. This will hopefully stop clients from sending invalid data, although does not help with data received over federation.
* Use immutabledict instead of frozendict (#15113)David Robertson2023-03-221-10/+8
| | | | | | | | | | Additionally: * Consistently use `freeze()` in test --------- Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de>
* Stabilize support for MSC3873: disambuguated event push keys. (#15190)Patrick Cloke2023-03-071-7/+3
| | | | | | | This removes the experimental configuration option and always escapes the push rule condition keys. Also escapes any (experimental) push rule condition keys in the base rules which contain dot in a field name.
* Stabilize support for MSC3966: event_property_contains push condition. (#15187)Patrick Cloke2023-03-072-18/+3
| | | | This removes the configuration flag & updates the identifiers to use the stable version.
* Stabilize support for MSC3758: event_property_is push condition (#15185)Patrick Cloke2023-03-062-20/+5
| | | | This removes the configuration flag & updates the identifiers to use the stable version.
* Update intentional mentions (MSC3952) to depend on ↵Patrick Cloke2023-03-022-31/+4
| | | | | | | `exact_event_property_contains` (MSC3966). (#15051) This replaces the specific `is_user_mention` push rule condition used in MSC3952 with the generic `exact_event_property_contains` push rule condition from MSC3966.
* Do not accept pattern_type from user input in push rules. (#15088)Patrick Cloke2023-02-281-0/+27
| | | | | | | | | | | | | | | | | | | | Internally the push rules module uses a `pattern_type` property for `event_match` conditions (and `related_event_match`) to mark the condition as matching the current user's Matrix ID or localpart. This is leaky to the Client-Server API where a user can successfully set a condition which provides `pattern_type` instead of `pattern` (note that there's no benefit to doing this -- the user can just use their own Matrix ID or localpart instead). When serializing back to the client the `pattern_type` property is converted into a proper `pattern`. The following changes are made to avoid this: * Separate the `KnownCondition::EventMatch` enum value into `EventMatch` and `EventMatchType`, each with their own expected properties. (Note that a similar change is made for `RelatedEventMatch`.) * Make it such that the `pattern_type` variants serialize to the same condition kind, but cannot be deserialized (since they're only provided by base rules). * As a final tweak, convert `user_id` vs. `user_localpart` values into an enum.
* Add module API callbacks for adding and deleting local 3PID associations (#15044Andrew Morgan2023-02-271-4/+2
|
* Batch up storing state groups when creating new room (#14918)Shay2023-02-241-5/+8
|
* Fix a typo in MSC3873 config option. (#15138)Patrick Cloke2023-02-231-1/+1
| | | | Previously the experimental configuration option referred to the wrong MSC number.
* Bump black from 22.12.0 to 23.1.0 (#15103)dependabot[bot]2023-02-222-3/+0
|
* Update intentional mentions (MSC3952) to depend on `exact_event_match` ↵Patrick Cloke2023-02-162-25/+16
| | | | | | | | | | (MSC3758). (#15037) This replaces the specific `is_room_mention` push rule condition used in MSC3952 with the generic `exact_event_match` push rule condition from MSC3758. No functionality changes due to this.
* Add final type hint to tests.unittest. (#15072)Patrick Cloke2023-02-142-32/+64
| | | | Adds a return type to HomeServerTestCase.make_homeserver and deal with any variables which are no longer Any.
* Implement MSC3966: Add a push rule condition to search for a value in an ↵Patrick Cloke2023-02-141-3/+50
| | | | | | array. (#15045) The `exact_event_property_contains` condition can be used to search for a value inside of an array.
* Support for MSC3758: exact_event_match push condition (#14964)Patrick Cloke2023-02-101-4/+143
| | | | | This specifies to search for an exact value match, instead of string globbing. It only works across non-compound JSON values (null, boolean, integer, and strings).
* MSC3873: Escape keys when flattening dicts. (#15004)Patrick Cloke2023-02-081-0/+8
| | | | | | This disambiguates keys which attempt to match fields with a dot in them (e.g. m.relates_to). Disabled by default behind an experimental configuration flag.
* Add tests for using _flatten_dict with an event. (#15002)Patrick Cloke2023-02-071-1/+62
|
* Implement MSC3958: suppress notifications from edits (#14960)Patrick Cloke2023-02-031-1/+41
| | | | | | | | Co-authored-by: Brad Murray <brad@beeper.com> Co-authored-by: Nick Barrett <nick@beeper.com> Copy the suppress_edits push rule from Beeper to implement MSC3958. https://github.com/beeper/synapse/blame/9415a1284b1bfb558bd66f28c24ca1611e6c6fa2/rust/src/push/base_rules.rs#L98-L114
* Add a docstring & tests for _flatten_dict. (#14981)Patrick Cloke2023-02-031-1/+25
|
* Support the backwards compatibility features in MSC3952. (#14958)Patrick Cloke2023-02-032-58/+151
| | | | If the feature is enabled and the event has a `m.mentions` property, skip processing of the legacy mentions rules.
* Handle malformed values of `notification.room` in power level events (#14942)David Robertson2023-01-301-13/+80
| | | | | | | | | | | | | | | | | | | | | | | * Better test for bad values in power levels events The previous test only checked that Synapse didn't raise an exception, but didn't check that we had correctly interpreted the value of the dodgy power level. It also conflated two things: bad room notification levels, and bad user levels. There _is_ logic for converting the latter to integers, but we should test it separately. * Check we ignore types that don't convert to int * Handle `None` values in `notifications.room` * Changelog * Also test that bad values are rejected by event auth * Docstring * linter scripttttttttt
* Implement MSC3952: Intentional mentions (#14823)Patrick Cloke2023-01-272-7/+147
| | | | | | | | MSC3952 defines push rules which searches for mentions in a list of Matrix IDs in the event body, instead of searching the entire event body for display name / local part. This is implemented behind an experimental configuration flag and does not yet implement the backwards compatibility pieces of the MSC.
* Factor out common code in tests and fix comments. (#14819)Patrick Cloke2023-01-111-36/+49
|
* Fix-up type hints for tests.push module. (#14816)Patrick Cloke2023-01-114-57/+61
|
* Add `push.enabled` option to disable push notification calculation (#14551)Will Hunt2022-12-011-2/+43
| | | | | | | * Add initial option * changelog * Some more linting
* Modernize unit tests configuration settings for workers. (#14568)realtyem2022-12-012-7/+1
| | | | Use the newer foo_instances configuration instead of the deprecated flags to enable specific features (e.g. start_pushers).
* Initial support for MSC3931: Room version push rule feature flags (#14520)Travis Ralston2022-11-281-0/+2
| | | | | | | * Add support for MSC3931: Room Version Supports push rule condition * Create experimental flag for future work, and use it to gate MSC3931 * Changelog entry
* Implementation for MSC3664: Pushrules for relations (#11804)DeepBlueV7.X2022-10-251-1/+214
|
* Add initial power level event to batch of bulk persisted events when ↵Shay2022-10-211-1/+1
| | | | creating a new room. (#14228)
* Remove the experimental implementation of MSC3772. (#14094)Patrick Cloke2022-10-121-74/+2
| | | MSC3772 has been abandoned.
* Fix sending events into rooms with non-integer power levels (#14073)David Robertson2022-10-061-0/+74
|
* Speed up calculating push actions in large rooms (#13973)Erik Johnston2022-09-301-2/+80
| | | | | We move the expensive check of visibility to after calculating push actions, avoiding the expensive check for users who won't get pushed anyway. I think this should have a big impact on rooms with large numbers of local users that have pushed disabled.
* Implement push rule evaluation in Rust. (#13838)Erik Johnston2022-09-291-11/+9
|
* Track device IDs for pushers (#13831)Brendan Abolivier2022-09-211-5/+50
| | | Second half of the MSC3881 implementation
* Support enabling/disabling pushers (from MSC3881) (#13799)Brendan Abolivier2022-09-212-15/+137
| | | Partial implementation of MSC3881
* Don't include appservice users when calculating push rules (#13332)Erik Johnston2022-07-201-0/+85
| | | This can cause a lot of extra load on servers with lots of appservice users. Introduced in #13078
* Speed up `get_unread_event_push_actions_by_room` (#13005)Erik Johnston2022-06-151-8/+8
| | | | | | | | | | | Fixes #11887 hopefully. The core change here is that `event_push_summary` now holds a summary of counts up until a much more recent point, meaning that the range of rows we need to count in `event_push_actions` is much smaller. This needs two major changes: 1. When we get a receipt we need to recalculate `event_push_summary` rather than just delete it 2. The logic for deleting `event_push_actions` is now divorced from calculating `event_push_summary`. In future it would be good to calculate `event_push_summary` while we persist a new event (it should just be a case of adding one to the relevant rows in `event_push_summary`), as that will further simplify the get counts logic and remove the need for us to periodically update `event_push_summary` in a background job.
* Experimental support for MSC3772 (#12740)Patrick Cloke2022-05-241-3/+81
| | | | | | | | | | Implements the following behind an experimental configuration flag: * A new push rule kind for mutually related events. * A new default push rule (`.m.rule.thread_reply`) under an unstable prefix. This is missing part of MSC3772: * The `.m.rule.thread_reply_to_me` push rule, this depends on MSC3664 / #11804.
* Add type hints to tests files. (#12256)Dirk Klimpel2022-03-211-11/+12
|
* Add type hints to more tests files. (#12240)Dirk Klimpel2022-03-171-17/+23
|
* Add an additional HTTP pusher + push rule tests. (#12188)Nick Mills-Barrett2022-03-111-3/+69
| | | And rename the field used for caching from _id to _cache_key.
* Fix `PushRuleEvaluator` and `Filter` to work on frozendicts (#12100)Richard van der Hoff2022-02-281-0/+9
| | | | | | | | | | * Fix `PushRuleEvaluator` to work on frozendicts frozendicts do not (necessarily) inherit from dict, so this needs to handle them correctly. * Fix event filtering for frozen events Looks like this one was introduced by #11194.
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-232-22/+22
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Prevent duplicate push notifications for room reads (#11835)lukasdenk2022-02-171-65/+64
|
* Make background updates controllable via a plugin (#11306)Erik Johnston2021-11-291-7/+2
| | | Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Default value for `public_baseurl` (#11210)Richard van der Hoff2021-11-081-1/+1
| | | | | We might as well use a default value for `public_baseurl` based on `server_name` - in many cases, it will be correct.
* Merge tag 'v1.42.0rc1' into developOlivier Wilkinson (reivilibre)2021-09-011-0/+44
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synapse 1.42.0rc1 (2021-09-01) ============================== Server administrators are reminded to read [the upgrade notes](docs/upgrade.md#upgrading-to-v1420). Features -------- - Add support for [MSC3231](https://github.com/matrix-org/matrix-doc/pull/3231): Token authenticated registration. Users can be required to submit a token during registration to authenticate themselves. Contributed by Callum Brown. ([\#10142](https://github.com/matrix-org/synapse/issues/10142)) - Add support for [MSC3283](https://github.com/matrix-org/matrix-doc/pull/3283): Expose `enable_set_displayname` in capabilities. ([\#10452](https://github.com/matrix-org/synapse/issues/10452)) - Port the `PresenceRouter` module interface to the new generic interface. ([\#10524](https://github.com/matrix-org/synapse/issues/10524)) - Add pagination to the spaces summary based on updates to [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946). ([\#10613](https://github.com/matrix-org/synapse/issues/10613), [\#10725](https://github.com/matrix-org/synapse/issues/10725)) Bugfixes -------- - Validate new `m.room.power_levels` events. Contributed by @aaronraimist. ([\#10232](https://github.com/matrix-org/synapse/issues/10232)) - Display an error on User-Interactive Authentication fallback pages when authentication fails. Contributed by Callum Brown. ([\#10561](https://github.com/matrix-org/synapse/issues/10561)) - Remove pushers when deleting an e-mail address from an account. Pushers for old unlinked emails will also be deleted. ([\#10581](https://github.com/matrix-org/synapse/issues/10581), [\#10734](https://github.com/matrix-org/synapse/issues/10734)) - Reject Client-Server `/keys/query` requests which provide `device_ids` incorrectly. ([\#10593](https://github.com/matrix-org/synapse/issues/10593)) - Rooms with unsupported room versions are no longer returned via `/sync`. ([\#10644](https://github.com/matrix-org/synapse/issues/10644)) - Enforce the maximum length for per-room display names and avatar URLs. ([\#10654](https://github.com/matrix-org/synapse/issues/10654)) - Fix a bug which caused the `synapse_user_logins_total` Prometheus metric not to be correctly initialised on restart. ([\#10677](https://github.com/matrix-org/synapse/issues/10677)) - Improve `ServerNoticeServlet` to avoid duplicate requests and add unit tests. ([\#10679](https://github.com/matrix-org/synapse/issues/10679)) - Fix long-standing issue which caused an error when a thumbnail is requested and there are multiple thumbnails with the same quality rating. ([\#10684](https://github.com/matrix-org/synapse/issues/10684)) - Fix a regression introduced in v1.41.0 which affected the performance of concurrent fetches of large sets of events, in extreme cases causing the process to hang. ([\#10703](https://github.com/matrix-org/synapse/issues/10703)) - Fix a regression introduced in Synapse 1.41 which broke email transmission on Systems using older versions of the Twisted library. ([\#10713](https://github.com/matrix-org/synapse/issues/10713)) Improved Documentation ---------------------- - Add documentation on how to connect Django with Synapse using OpenID Connect and django-oauth-toolkit. Contributed by @HugoDelval. ([\#10192](https://github.com/matrix-org/synapse/issues/10192)) - Advertise https://matrix-org.github.io/synapse documentation in the `README` and `CONTRIBUTING` files. ([\#10595](https://github.com/matrix-org/synapse/issues/10595)) - Fix some of the titles not rendering in the OpenID Connect documentation. ([\#10639](https://github.com/matrix-org/synapse/issues/10639)) - Minor clarifications to the documentation for reverse proxies. ([\#10708](https://github.com/matrix-org/synapse/issues/10708)) - Remove table of contents from the top of installation and contributing documentation pages. ([\#10711](https://github.com/matrix-org/synapse/issues/10711)) Deprecations and Removals ------------------------- - Remove deprecated Shutdown Room and Purge Room Admin API. ([\#8830](https://github.com/matrix-org/synapse/issues/8830)) Internal Changes ---------------- - Improve type hints for the proxy agent and SRV resolver modules. Contributed by @dklimpel. ([\#10608](https://github.com/matrix-org/synapse/issues/10608)) - Clean up some of the federation event authentication code for clarity. ([\#10614](https://github.com/matrix-org/synapse/issues/10614), [\#10615](https://github.com/matrix-org/synapse/issues/10615), [\#10624](https://github.com/matrix-org/synapse/issues/10624), [\#10640](https://github.com/matrix-org/synapse/issues/10640)) - Add a comment asking developers to leave a reason when bumping the database schema version. ([\#10621](https://github.com/matrix-org/synapse/issues/10621)) - Remove not needed database updates in modify user admin API. ([\#10627](https://github.com/matrix-org/synapse/issues/10627)) - Convert room member storage tuples to `attrs` classes. ([\#10629](https://github.com/matrix-org/synapse/issues/10629), [\#10642](https://github.com/matrix-org/synapse/issues/10642)) - Use auto-attribs for the attrs classes used in sync. ([\#10630](https://github.com/matrix-org/synapse/issues/10630)) - Make `backfill` and `get_missing_events` use the same codepath. ([\#10645](https://github.com/matrix-org/synapse/issues/10645)) - Improve the performance of the `/hierarchy` API (from [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946)) by caching responses received over federation. ([\#10647](https://github.com/matrix-org/synapse/issues/10647)) - Run a nightly CI build against Twisted trunk. ([\#10651](https://github.com/matrix-org/synapse/issues/10651), [\#10672](https://github.com/matrix-org/synapse/issues/10672)) - Do not print out stack traces for network errors when fetching data over federation. ([\#10662](https://github.com/matrix-org/synapse/issues/10662)) - Simplify tests for device admin rest API. ([\#10664](https://github.com/matrix-org/synapse/issues/10664)) - Add missing type hints to REST servlets. ([\#10665](https://github.com/matrix-org/synapse/issues/10665), [\#10666](https://github.com/matrix-org/synapse/issues/10666), [\#10674](https://github.com/matrix-org/synapse/issues/10674)) - Flatten the `tests.synapse.rests` package by moving the contents of `v1` and `v2_alpha` into the parent. ([\#10667](https://github.com/matrix-org/synapse/issues/10667)) - Update `complement.sh` to rebuild the base Docker image when run with workers. ([\#10686](https://github.com/matrix-org/synapse/issues/10686)) - Split the event-processing methods in `FederationHandler` into a separate `FederationEventHandler`. ([\#10692](https://github.com/matrix-org/synapse/issues/10692)) - Remove unused `compare_digest` function. ([\#10706](https://github.com/matrix-org/synapse/issues/10706))
| * Fix iteration in _remove_deleted_email_pushers background job. (#10734)Andrew Morgan2021-09-011-0/+44
| |
* | Correctly include room avatars in email notifications (#10658)David Robertson2021-09-011-5/+47
|/ | | | | | | | Judging by the template, this was intended ages ago, but we never actually passed an avatar URL to the template. So let's provide one. Closes #1546. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Remove pushers when deleting 3pid from account (#10581)Azrenbeth2021-08-261-0/+39
| | | | | When a user deletes an email from their account it will now also remove all pushers for that email and that user (even if these pushers were created by a different client)
* Flatten the synapse.rest.client package (#10600)reivilibre2021-08-172-3/+2
|
* Add a setting to disable TLS for sending email (#10546)Richard van der Hoff2021-08-061-9/+11
| | | This is mostly useful in case the server offers TLS, but doesn't present a valid certificate.
* Merge pull request from GHSA-x345-32rc-8h85Richard van der Hoff2021-05-111-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests for push rule pattern matching * tests for acl pattern matching * factor out common `re.escape` * Factor out common re.compile * Factor out common anchoring code * add word_boundary support to `glob_to_regex` * Use `glob_to_regex` in push rule evaluator NB that this drops support for character classes. I don't think anyone ever used them. * Improve efficiency of globs with multiple wildcards The idea here is that we compress multiple `*` globs into a single `.*`. We also need to consider `?`, since `*?*` is as hard to implement efficiently as `**`. * add assertion on regex pattern * Fix mypy * Simplify glob_to_regex * Inline the glob_to_regex helper function Signed-off-by: Dan Callahan <danc@element.io> * Moar comments Signed-off-by: Dan Callahan <danc@element.io> Co-authored-by: Dan Callahan <danc@element.io>
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-143-3/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Use mock from the stdlib. (#9772)Patrick Cloke2021-04-091-1/+1
|
* Test that we require validated email for email pushers (#9496)Erik Johnston2021-02-251-2/+32
|
* Handle empty rooms when generating email notifications. (#9257)Patrick Cloke2021-02-041-2/+49
| | | | | | Fixes some exceptions if the room state isn't quite as expected. If the expected state events aren't found, try to find them in the historical room state. If they still aren't found, fallback to a reasonable, although ugly, value.
* Refactor email summary generation. (#9260)Patrick Cloke2021-02-011-0/+30
| | | | | | * Fixes a case where no summary text was returned. * The use of messages_from_person vs. messages_from_person_and_others was tweaked to depend on whether there was 1 sender or multiple senders, not based on if there was 1 room or multiple rooms.
* Handle missing content keys when calculating presentable names. (#9165)Patrick Cloke2021-01-252-1/+230
| | | | Treat the content as untrusted and do not assume it is of the proper form.
* Convert internal pusher dicts to attrs classes. (#8940)Patrick Cloke2020-12-162-8/+8
| | | This improves type hinting and should use less memory.
* Remove spurious "SynapseRequest" result from `make_request"Richard van der Hoff2020-12-151-1/+1
| | | | This was never used, so let's get rid of it.
* Add additional validation to pusher URLs. (#8865)Patrick Cloke2020-12-041-22/+84
| | | | Pusher URLs now must end in `/_matrix/push/v1/notify` per the specification.
* Apply an IP range blacklist to push and key revocation requests. (#8821)Patrick Cloke2020-12-021-1/+3
| | | | | | | | | | | | Replaces the `federation_ip_range_blacklist` configuration setting with an `ip_range_blacklist` setting with wider scope. It now applies to: * Federation * Identity servers * Push notifications * Checking key validitity for third-party invite events The old `federation_ip_range_blacklist` setting is still honored if present, but with reduced scope (it only applies to federation and identity servers).
* Add a config option to change whether unread push notification counts are ↵Andrew Morgan2020-11-301-2/+161
| | | | | | | | per-message or per-room (#8820) This PR adds a new config option to the `push` section of the homeserver config, `group_unread_count_by_room`. By default Synapse will group push notifications by room (so if you have 1000 unread messages, if they lie in 55 rooms, you'll see an unread count on your phone of 55). However, it is also useful to be able to send out the true count of unread messages if desired. If `group_unread_count_by_room` is set to `false`, then with the above example, one would see an unread count of 1000 (email anyone?).
* Add ability for access tokens to belong to one user but grant access to ↵Erik Johnston2020-10-292-6/+6
| | | | | | | | | | another user. (#8616) We do it this way round so that only the "owner" can delete the access token (i.e. `/logout/all` by the "owner" also deletes that token, but `/logout/all` by the "target user" doesn't). A future PR will add an API for creating such a token. When the target user and authenticated entity are different the `Processed request` log line will be logged with a: `{@admin:server as @bob:server} ...`. I'm not convinced by that format (especially since it adds spaces in there, making it harder to use `cut -d ' '` to chop off the start of log lines). Suggestions welcome.
* Fix email notifications for invites without local state. (#8627)Erik Johnston2020-10-231-0/+29
| | | | This can happen if e.g. the room invited into is no longer on the server (or if all users left the room).
* Include a simple message in email notifications that include encrypted ↵Patrick Cloke2020-10-191-1/+14
| | | | content (#8545)
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Reduce run-times of tests by advancing the reactor less (#7757)Andrew Morgan2020-08-271-1/+1
|
* Don't ignore `set_tweak` actions with no explicit `value`. (#7766)reivilibre2020-07-061-0/+17
| | | | | | | | | | | | | | * Fix spec compliance; tweaks without values are valid (default to True, which is only concretely specified for `highlight`, but it seems only reasonable to generalise) * Changelog for 7766. * Add documentation to `tweaks_for_actions` May as well tidy up when I'm here. * Add a test for `tweaks_for_actions`
* Hack to add push priority to push notifications (#7765)reivilibre2020-07-011-5/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove obsolete comment about ancient temporary code Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Implement hack to set push priority based on whether the tweaks indicate the event might cause effects. * Changelog for 7765 Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Antilint * Add tests for push priority Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Update synapse/push/httppusher.py Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Antilint * Remove needless invites from tests. Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Ensure the body is a string before comparing push rules. (#7701)Patrick Cloke2020-06-151-9/+30
|
* Do not treat display names as globs for push rules. (#7271)Patrick Cloke2020-04-161-0/+65
|
* Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-212-7/+7
| | | | Ensure good comprehension hygiene using flake8-comprehensions.
* Clean up startup for the pusher (#6558)Richard van der Hoff2019-12-182-0/+7
| | | | | | | | | | | | | | | | | | | | | | | * Remove redundant python2 support code `str.decode()` doesn't exist on python3, so presumably this code was doing nothing * Filter out pushers with corrupt data When we get a row with unparsable json, drop the row, rather than returning a row with null `data`, which will then cause an explosion later on. * Improve logging when we can't start a pusher Log the ID to help us understand the problem * Make email pusher setup more robust We know we'll have a `data` member, since that comes from the database. What we *don't* know is if that is a dict, and if that has a `brand` member, and if that member is a string.
* Support for routing outbound HTTP requests via a proxy (#6239)Richard van der Hoff2019-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy. The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`. The proxy will then be used for * push * url previews * phone-home stats * recaptcha validation * CAS auth validation It will *not* be used for: * Application Services * Identity servers * Outbound federation * In worker configurations, connections from workers to masters Fixes #4198.
* Move logging utilities out of the side drawer of util/ and into logging/ (#5606)Amber Brown2019-07-041-1/+1
|
* Run Black. (#5482)Amber Brown2019-06-201-3/+3
|
* Merge pull request #5388 from matrix-org/erikj/fix_email_pushErik Johnston2019-06-171-23/+70
|\ | | | | Fix email notifications for unnamed rooms with multiple people
| * Add testErik Johnston2019-06-071-1/+28
| |
| * Refactor email testsErik Johnston2019-06-071-22/+42
| |
* | Bump bleach version so that tests can run on old deps.Erik Johnston2019-06-112-12/+0
|/
* Migrate all tests to use the dict-based config format instead of hanging ↵Amber Brown2019-05-132-17/+21
| | | | items off HomeserverConfig (#5171)
* Add admin api for sending server_notices (#5121)Richard van der Hoff2019-05-022-2/+2
|
* Move admin api impl to its own packageRichard van der Hoff2019-05-012-4/+6
| | | | It doesn't really belong under rest/client/v1 any more.
* Fix email testRichard van der Hoff2019-03-191-0/+2
| | | | | | | The Mailer expects the config object to have `email_smtp_pass` and `email_riot_base_url` attributes (and it won't by default, because the default config impl doesn't set any of the attributes unless email_enable_notifs is set).
* Fix logcontext leak in http pusher testRichard van der Hoff2018-11-191-1/+2
|
* Add some tests for the HTTP pusher (#4149)Amber Brown2018-11-061-0/+159
|
* Write some tests for the email pusher (#4095)Amber Brown2018-10-302-0/+148