summary refs log tree commit diff
path: root/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '7f837959e' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-195-20/+47
|\ | | | | | | | | | | * commit '7f837959e': Convert directory, e2e_room_keys, end_to_end_keys, monthly_active_users database to async (#8042) Convert additional database stores to async/await (#8045)
| * Convert directory, e2e_room_keys, end_to_end_keys, monthly_active_users ↵Patrick Cloke2020-08-074-18/+45
| | | | | | | | database to async (#8042)
| * Convert additional database stores to async/await (#8045)Patrick Cloke2020-08-071-2/+2
| |
* | Merge commit '7620912d8' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-0/+34
|\| | | | | | | | | * commit '7620912d8': Add health check endpoint (#8048)
| * Add health check endpoint (#8048)Erik Johnston2020-08-071-0/+34
| |
* | Merge commit '2ffd6783c' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-192-175/+2
|\| | | | | | | | | * commit '2ffd6783c': Revert #7736 (#8039)
| * Revert #7736 (#8039)Brendan Abolivier2020-08-062-175/+2
| |
* | Merge commit 'fe6cfc80e' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-33/+11
|\| | | | | | | | | * commit 'fe6cfc80e': Convert some util functions to async (#8035)
| * Convert some util functions to async (#8035)Patrick Cloke2020-08-061-33/+11
| |
* | Merge commit 'd4a7829b1' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-199-68/+93
|\| | | | | | | | | * commit 'd4a7829b1': Convert synapse.api to async/await (#8031)
| * Convert synapse.api to async/await (#8031)Patrick Cloke2020-08-069-68/+93
| |
* | Merge commit '66f24449d' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-1/+1
|\| | | | | | | | | * commit '66f24449d': Improve performance of the register endpoint (#8009)
| * Improve performance of the register endpoint (#8009)Patrick Cloke2020-08-061-1/+1
| |
* | Merge commit 'a7bdf98d0' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-1617-125/+129
|\| | | | | | | | | * commit 'a7bdf98d0': Rename database classes to make some sense (#8033)
| * Rename database classes to make some sense (#8033)Erik Johnston2020-08-0517-125/+129
| |
* | Merge commit 'e19de43eb' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-161-1/+1
|\| | | | | | | | | * commit 'e19de43eb': Convert streams to async. (#8014)
| * Convert streams to async. (#8014)Patrick Cloke2020-08-041-1/+1
| |
* | Merge commit '5d92a1428' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-162-7/+63
|\| | | | | | | | | * commit '5d92a1428': Prevent join->join membership transitions changing member count (#7977)
| * Prevent join->join membership transitions changing member count (#7977)Andrew Morgan2020-08-032-7/+63
| | | | | | | | | | | | | | | | | | | | | | `StatsHandler` handles updates to the `current_state_delta_stream`, and updates room stats such as the amount of state events, joined users, etc. However, it counts every new join membership as a new user entering a room (and that user being in another room), whereas it's possible for a user's membership status to go from join -> join, for instance when they change their per-room profile information. This PR adds a check for join->join membership transitions, and bails out early, as none of the further checks are necessary at that point. Due to this bug, membership stats in many rooms have ended up being wildly larger than their true values. I am not sure if we also want to include a migration step which recalculates these statistics (possibly using the `_populate_stats_process_rooms` bg update). Bug introduced in the initial implementation https://github.com/matrix-org/synapse/pull/4338.
* | Merge commit '681250980' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-161-3/+42
|\| | | | | | | | | * commit '681250980': Implement handling of HTTP HEAD requests. (#7999)
| * Implement handling of HTTP HEAD requests. (#7999)Patrick Cloke2020-08-031-3/+42
| |
* | Merge commit '2a89ce8cd' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-161-23/+16
|\| | | | | | | | | * commit '2a89ce8cd': Convert the crypto module to async/await. (#8003)
| * Convert the crypto module to async/await. (#8003)Patrick Cloke2020-08-031-23/+16
| |
* | Merge commit '394be6a0e' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-161-0/+4
|\| | | | | | | | | | | | | * commit '394be6a0e': Newsfile Add ratelimiting on joins Add docs for undoing room shutdowns (#7998)
| * Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2020-07-3125-170/+595
| |\ | | | | | | | | | erikj/add_rate_limiting_to_joins
| * | Add ratelimiting on joinsErik Johnston2020-07-311-0/+4
| | |
* | | Merge commit 'c978f6c45' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-1610-52/+71
|\ \ \ | | |/ | |/| | | | | | | * commit 'c978f6c45': Convert federation client to async/await. (#7975)
| * | Convert federation client to async/await. (#7975)Patrick Cloke2020-07-3010-52/+71
| | |
* | | Merge commit '4cce8ef74' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-163-38/+75
|\| | | | | | | | | | | | | | * commit '4cce8ef74': Convert appservice to async. (#7973)
| * | Convert appservice to async. (#7973)Patrick Cloke2020-07-303-38/+75
| | |
* | | Merge commit 'b3a97d6da' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-163-19/+29
|\| | | | | | | | | | | | | | * commit 'b3a97d6da': Convert some of the data store to async. (#7976)
| * | Convert some of the data store to async. (#7976)Patrick Cloke2020-07-303-19/+29
| | |
* | | Merge commit '3950ae51e' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-1613-67/+426
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3950ae51e': Ensure that remove_pusher is always async (#7981) Ensure the msg property of HttpResponseException is a string. (#7979) Remove from the event_relations table when purging historical events. (#7978) Add additional logging for SAML sessions. (#7971) Add MSC reference to changelog for #7736 Re-implement unread counts (#7736) Various improvements to the docs (#7899) Convert storage layer to async/await. (#7963) Add an option to disable purge in delete room admin API (#7964) Move some log lines from default logger to sql/transaction loggers (#7952) Use the JSON module from the std library instead of simplejson. (#7936) Fix exit code for `check_line_terminators.sh` (#7970) Option to allow server admins to join complex rooms (#7902) Fix typo in metrics docs (#7966) Add script for finding files with unix line terminators (#7965) Convert the remaining media repo code to async / await. (#7947) Convert a synapse.events to async/await. (#7949) Convert groups and visibility code to async / await. (#7951) Convert push to async/await. (#7948)
| * | Re-implement unread counts (#7736)Brendan Abolivier2020-07-292-2/+175
| | |
| * | Convert storage layer to async/await. (#7963)Patrick Cloke2020-07-285-45/+63
| | |
| * | Add an option to disable purge in delete room admin API (#7964)Dirk Klimpel2020-07-281-2/+55
| | | | | | | | | | | | | | | | | | Add option ```purge``` to ```POST /_synapse/admin/v1/rooms/<room_id>/delete``` Fixes: #3761 Signed-off-by: Dirk Klimpel dirk@klimpel.org
| * | Option to allow server admins to join complex rooms (#7902)lugino-emeritus2020-07-281-0/+109
| | | | | | | | | | | | | | | Fixes #7901. Signed-off-by: Niklas Tittjung <nik_t.01@web.de>
| * | Convert a synapse.events to async/await. (#7949)Patrick Cloke2020-07-272-8/+10
| | |
| * | Convert groups and visibility code to async / await. (#7951)Patrick Cloke2020-07-271-6/+6
| | |
| * | Convert push to async/await. (#7948)Patrick Cloke2020-07-272-4/+8
| |/
* | Remember mappings when we bind a 3pid using the internal sydent bind API (#66)Andrew Morgan2020-10-141-0/+6
| | | | | | | | | | | | | | https://github.com/matrix-org/synapse-dinsic/pull/51 added an option that would automatically bind a user's threepid to a configured identity server after they had registered. Unfortunately, when you bind threepids, ideally you would store that mapping in the database so that later on you can remove those mappings when you deactivate an account. We found that due the fact that we did not store these mappings, threepids were not unbound upon user account deactivation. This PR fixes the issue by creating the mappings again, meaning they will again be removed upon account deactivation.
* | "Freeze" a room when the last admin of that room leaves (#59)Andrew Morgan2020-10-131-1/+130
| | | | | | | | | | | | | | | | If the last admin of a room departs, and thus the room no longer has any admins within it, we "freeze" the room. Freezing a room means that the power level required to do anything in the room (sending messages, inviting others etc) will require power level 100. At the moment, an admin can come back and unfreeze the room manually. The plan is to eventually make unfreezing of the room automatic on admin rejoin, though that will be in a separate PR. This *could* work in mainline, however if the admin who leaves is on a homeserver without this functionality, then the room isn't frozen. I imagine this would probably be pretty confusing to people. Part of this feature was allowing Synapse modules to send events, which has been implemented in mainline at https://github.com/matrix-org/synapse/pull/8479, and cherry-picked to the `dinsic` fork in 62c7b10. The actual freezing logic has been implemented here in the RoomAccessRules module.
* | Allow modules to create and send events into rooms (#8479)Andrew Morgan2020-10-123-86/+262
| | | | | | | | | | | | | | | | This PR allows Synapse modules making use of the `ModuleApi` to create and send non-membership events into a room. This can useful to have modules send messages, or change power levels in a room etc. Note that they must send event through a user that's already in the room. The non-membership event limitation is currently arbitrary, as it's another chunk of work and not necessary at the moment. This commit has been cherry-picked from mainline.
* | Swap method calls in RoomAccessTestCase.test_change_rules (#64)Andrew Morgan2020-09-181-5/+6
| | | | | | | | | | Swap these calls around, as the check for changing `restricted` to `unrestricted` will actually change `self.restricted_room` to an unrestricted room. Do that last, instead of first. Additionally add a comment with a warning.
* | Make all rooms noisy by default (#60)Mathieu Velten2020-09-181-6/+6
| |
* | Make AccessRules use the public rooms directory instead of checking a room's ↵Andrew Morgan2020-09-183-55/+285
| | | | | | | | | | | | | | join rules on rule change (#63) This PR switches several conditions regarding room access rules to check against the status of the room's inclusion in the public room list instead of its join rules. The code includes a snapshot of https://github.com/matrix-org/synapse/pull/8292, which will likely change in time and need merging in again.
* | Override the power levels defaults, enforce mod requirement for invites, ↵Andrew Morgan2020-09-111-5/+52
| | | | | | | | | | | | | | | | | | | | admin requirements for unknown state events (#61) This PR modifies the `RoomAccessRules` module, an implementation of `ThirdPartyEventRules`, to both: * Modify the default power levels when creating a room to set: - `invite` to be minimum PL50 - `state_default` to be minimum PL100 * Enforce this when creating the room.
* | RoomAccessRules cleanup (#62)Andrew Morgan2020-09-101-34/+27
| | | | | | | | | | | | | | Various cleanups of the DINUM-specific `RoomAccessRules` module, including: * Type hints * Docstring cleanups * Some code cleanups
* | Add a config option for validating 'next_link' parameters against a domain ↵Andrew Morgan2020-09-091-7/+96
| | | | | | | | | | | | | | | | | | | | | | | | whitelist (#8275) This is a config option ported over from DINUM's Sydent: https://github.com/matrix-org/sydent/pull/285 They've switched to validating 3PIDs via Synapse rather than Sydent, and would like to retain this functionality. This original purpose for this change is phishing prevention. This solution could also potentially be replaced by a similar one to https://github.com/matrix-org/synapse/pull/8004, but across all `*/submit_token` endpoint. This option may still be useful to enterprise even with that safeguard in place though, if they want to be absolutely sure that their employees don't follow links to other domains.
* | Merge commit 'f88c48f3b' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-039-1570/+1665
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f88c48f3b': 1.18.0rc1 Fix error reporting when using `opentracing.trace` (#7961) Fix typing replication not being handled on master (#7959) Remove hacky error handling for inlineDeferreds. (#7950) Convert tests/rest/admin/test_room.py to unix file endings (#7953) Support oEmbed for media previews. (#7920) Convert state resolution to async/await (#7942) Fix up types and comments that refer to Deferreds. (#7945) Do not convert async functions to Deferreds in the interactive_auth_handler (#7944) Convert more of the media code to async/await (#7873) Return an empty body for OPTIONS requests. (#7886) Downgrade warning on client disconnect to INFO (#7928) Convert presence handler helpers to async/await. (#7939) Update the auth providers to be async. (#7935) Put a cache on `/state_ids` (#7931)
| * Convert tests/rest/admin/test_room.py to unix file endings (#7953)Andrew Morgan2020-07-271-1447/+1447
| | | | | | | | | | Converts tests/rest/admin/test_room.py to have unix file endings after they were accidentally changed in #7613. Keeping the same changelog as #7613 as it hasn't gone out in a release yet.
| * Support oEmbed for media previews. (#7920)Patrick Cloke2020-07-271-8/+134
| | | | | | Fixes previews of Twitter URLs by using their oEmbed endpoint to grab content.
| * Convert state resolution to async/await (#7942)Patrick Cloke2020-07-245-50/+73
| |
| * Convert more of the media code to async/await (#7873)Patrick Cloke2020-07-241-1/+4
| |
| * Return an empty body for OPTIONS requests. (#7886)Patrick Cloke2020-07-241-6/+6
| |
| * Downgrade warning on client disconnect to INFO (#7928)Richard van der Hoff2020-07-241-58/+1
| | | | | | | | Clients disconnecting before we finish processing the request happens from time to time. We don't need to yell about it
* | Merge commit '68cd93582' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-032-37/+40
|\| | | | | | | | | * commit '68cd93582': Convert the federation agent and related code to async/await. (#7874)
| * Convert the federation agent and related code to async/await. (#7874)Patrick Cloke2020-07-232-37/+40
| |
* | Merge commit 'cc9bb3dc3' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-038-102/+120
|\| | | | | | | | | * commit 'cc9bb3dc3': Convert the message handler to async/await. (#7884)
| * Convert the message handler to async/await. (#7884)Patrick Cloke2020-07-228-102/+120
| |
* | Merge commit 'de119063f' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-036-34/+280
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'de119063f': (31 commits) Convert room list handler to async/await. (#7912) Element CSS and logo in email templates (#7919) Lint the contrib/ directory in CI and linting scripts, add synctl to linting script (#7914) Remove unused code from synapse.logging.utils. (#7897) Fix a typo in the sample config. (#7890) Fix deprecation warning: import ABC from collections.abc (#7892) Change sample config's postgres user to synapse_user (#7889) Fix deprecation warning due to invalid escape sequences (#7895) Remove Ubuntu Eoan that is now EOL (#7888) Fix the trace function for async functions. (#7872) Add help for creating a user via docker (#7885) Switch to Debian:Slim from Alpine for the docker image (#7839) Stop using 'device_max_stream_id' (#7882) Fix TypeError in synapse.notifier (#7880) Add a default limit (of 100) to get/sync operations. (#7858) Change "unknown room ver" logging to warning. (#7881) Convert device handler to async/await (#7871) Convert synapse.app to async/await. (#7868) Convert _base, profile, and _receipts handlers to async/await (#7860) Add admin endpoint to get members in a room. (#7842) ...
| * Convert device handler to async/await (#7871)Patrick Cloke2020-07-173-28/+30
| |
| * Convert _base, profile, and _receipts handlers to async/await (#7860)Patrick Cloke2020-07-171-6/+11
| |
| * Add admin endpoint to get members in a room. (#7842)Michael Albert2020-07-161-0/+46
| |
| * Add ability to run multiple pusher instances (#7855)Erik Johnston2020-07-161-0/+193
| | | | | | This reuses the same scheme as federation sender sharding
* | Merge commit 'a973bcb8a' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-039-433/+764
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a973bcb8a': Add some tiny type annotations (#7870) Remove obsolete comment. Ensure that calls to `json.dumps` are compatible with the standard library json. (#7836) Avoid brand new rooms in `delete_old_current_state_events` (#7854) Allow accounts to be re-activated from the admin APIs. (#7847) Fix tests Fix typo Newsfile Use get_users_in_room rather than state handler in typing for speed Fix client reader sharding tests (#7853) Convert E2E key and room key handlers to async/await. (#7851) Return the proper 403 Forbidden error during errors with JWT logins. (#7844) remove `retry_on_integrity_error` wrapper for persist_events (#7848)
| * Merge branch 'erikj/faster_typing' of github.com:matrix-org/synapse into developErik Johnston2020-07-151-2/+2
| |\
| | * Fix testsErik Johnston2020-07-151-2/+2
| | |
| * | Allow accounts to be re-activated from the admin APIs. (#7847)Patrick Cloke2020-07-151-0/+47
| | |
| * | Fix client reader sharding tests (#7853)Erik Johnston2020-07-154-173/+271
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix client reader sharding tests * Newsfile * Fix typing * Update changelog.d/7853.misc Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Move mocking of http_client to tests Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
| * Convert E2E key and room key handlers to async/await. (#7851)Patrick Cloke2020-07-152-237/+422
| |
| * Return the proper 403 Forbidden error during errors with JWT logins. (#7844)Patrick Cloke2020-07-151-21/+22
| |
* | Merge commit '491f0dab1' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-032-0/+403
|\| | | | | | | | | * commit '491f0dab1': Add delete room admin endpoint (#7613)
| * Add delete room admin endpoint (#7613)Dirk Klimpel2020-07-142-0/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Delete Room admin API allows server admins to remove rooms from server and block these rooms. `DELETE /_synapse/admin/v1/rooms/<room_id>` It is a combination and improvement of "[Shutdown room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/shutdown_room.md)" and "[Purge room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/purge_room.md)" API. Fixes: #6425 It also fixes a bug in [synapse/storage/data_stores/main/room.py](synapse/storage/data_stores/main/room.py) in ` get_room_with_stats`. It should return `None` if the room is unknown. But it returns an `IndexError`. https://github.com/matrix-org/synapse/blob/901b1fa561e3cc661d78aa96d59802cf2078cb0d/synapse/storage/data_stores/main/room.py#L99-L105 Related to: - #5575 - https://github.com/Awesome-Technologies/synapse-admin/issues/17 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* | Merge commit '77d2c0541' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-031-6/+100
|\| | | | | | | | | * commit '77d2c0541': Add the option to validate the `iss` and `aud` claims for JWT logins. (#7827)
| * Add the option to validate the `iss` and `aud` claims for JWT logins. (#7827)Patrick Cloke2020-07-141-6/+100
| |
* | Merge commit '457096e6d' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-031-0/+133
|\| | | | | | | | | * commit '457096e6d': Support handling registration requests across multiple client readers. (#7830)
| * Support handling registration requests across multiple client readers. (#7830)Patrick Cloke2020-07-131-0/+133
| |
* | Merge commit '66a4af8d9' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-031-1/+1
|\| | | | | | | | | * commit '66a4af8d9': Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)
| * Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)Patrick Cloke2020-07-101-1/+1
| |
* | Merge commit 'f299441cc' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-032-0/+287
|\| | | | | | | | | * commit 'f299441cc': Add ability to shard the federation sender (#7798)
| * Add ability to shard the federation sender (#7798)Erik Johnston2020-07-102-0/+287
| |
* | Merge commit '43726783e' into dinsicAndrew Morgan2020-08-0313-54/+63
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '43726783e': (22 commits) 1.17.0rc1 Fix some spelling mistakes / typos. (#7811) `update_membership` declaration: now always returns an event id. (#7809) Improve stacktraces from exceptions in background processes (#7808) Fix `can only concatenate list (not "tuple") to list` exception (#7810) Pass original request headers from workers to the main process. (#7797) Generate real events when we reject invites (#7804) Add `HomeServer.signing_key` property (#7805) Revert "Update the installation docs on apt-transport-https (#7801)" Do not use simplejson in Synapse. (#7800) Stop passing bytes when dumping JSON (#7799) Update the installation docs on apt-transport-https (#7801) shuffle changelog slightly Change Caddy links (old is deprecated) (#7789) Stop populating unused table `local_invites`. (#7793) Refactor getting replication updates from database v2. (#7740) Add libwebp dependency to Dockerfile (#7791) Add documentation for JWT login type and improve sample config. (#7776) Convert the appservice handler to async/await. (#7775) Don't ignore `set_tweak` actions with no explicit `value`. (#7766) ...
| * Fix some spelling mistakes / typos. (#7811)Patrick Cloke2020-07-096-7/+7
| |
| * Add `HomeServer.signing_key` property (#7805)Richard van der Hoff2020-07-081-5/+2
| | | | | | ... instead of duplicating `config.signing_key[0]` everywhere
| * Stop populating unused table `local_invites`. (#7793)Richard van der Hoff2020-07-071-1/+0
| | | | | | | | | | This table is no longer used, so we may as well stop populating it. Removing it would prevent people rolling back to older releases of Synapse, so that can happen in a future release.
| * Convert the appservice handler to async/await. (#7775)Patrick Cloke2020-07-061-33/+35
| |
| * 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`
| * isort 5 compatibility (#7786)Will Hunt2020-07-053-8/+2
| | | | | | The CI appears to use the latest version of isort, which is a problem when isort gets a major version bump. Rather than try to pin the version, I've done the necessary to make isort5 happy with synapse.
* | Merge commit '5cdca53aa' into dinsicAndrew Morgan2020-08-035-44/+606
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '5cdca53aa': Merge different Resource implementation classes (#7732) Fix inconsistent handling of upper and lower cases of email addresses. (#7021) Allow YAML config file to contain None (#7779) Fix a typo. Move 1.15.2 after 1.16.0rc2. 1.16.0rc2 Remove an extraneous space. Add links to the fixes. Fix tense in the release notes. Hack to add push priority to push notifications (#7765) Add early returns to `_check_for_soft_fail` (#7769) Use symbolic names for replication stream names (#7768) Type checking for `FederationHandler` (#7770) Fix new metric where we used ms instead of seconds (#7771) Fix incorrect error message when database CTYPE was set incorrectly. (#7760) Pin link in CHANGES.md Fixes to CHANGES.md
| * Merge different Resource implementation classes (#7732)Erik Johnston2020-07-032-9/+65
| |
| * Fix inconsistent handling of upper and lower cases of email addresses. (#7021)Dirk Klimpel2020-07-032-30/+194
| | | | | | fixes #7016
| * 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>
* | Merge commit 'dc80a0762' into dinsicAndrew Morgan2020-08-036-122/+308
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'dc80a0762': 1.16.0rc1 Back out MSC2625 implementation (#7761) Additional configuration options for auto-join rooms (#7763) Add some metrics for inbound and outbound federation processing times (#7755) Explain the purpose of the "tests" conditional dependency requirement (#7751) Add another yield point to state res v2 (#7746) Move flake8 to end. Don't exit script on failure (#7738) Make tox actions work on Debian 10 (#7703) Yield during large v2 state res. (#7735) add org.matrix.login.jwt so that m.login.jwt can be deprecated (#7675) Set Content-Length for Metrics requests (#7730) Sync ignored table names in synapse_port_db to current database schema (#7717) Allow local media to be marked as safe from being quarantined. (#7718) Convert directory handler to async/await (#7727) Speed up state res v2 across large state differences. (#7725)
| * Back out MSC2625 implementation (#7761)Brendan Abolivier2020-07-012-45/+19
| |
| * Additional configuration options for auto-join rooms (#7763)Patrick Cloke2020-06-301-2/+210
| |
| * Yield during large v2 state res. (#7735)Erik Johnston2020-06-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | State res v2 across large data sets can be very CPU intensive, and if all the relevant events are in the cache the algorithm will run from start to finish within a single reactor tick. This can result in blocking the reactor tick for several seconds, which can have major repercussions on other requests. To fix this we simply add the occaisonal `sleep(0)` during iterations to yield execution until the next reactor tick. The aim is to only do this for large data sets so that we don't impact otherwise quick resolutions.=
| * add org.matrix.login.jwt so that m.login.jwt can be deprecated (#7675)Sorunome2020-06-241-3/+7
| |
| * Allow local media to be marked as safe from being quarantined. (#7718)Patrick Cloke2020-06-221-72/+65
| |
* | Merge commit '363082561' into dinsicAndrew Morgan2020-08-031-6/+7
|\| | | | | | | | | * commit '363082561': Convert the typing handler to async/await. (#7679)
| * Convert the typing handler to async/await. (#7679)Patrick Cloke2020-06-171-6/+7
| |
* | Merge commit '434716e1d' into dinsicAndrew Morgan2020-08-031-1/+1
|\| | | | | | | | | * commit '434716e1d': Fetch from the r0 media path instead of the unspecced v1. (#7714)
| * Fetch from the r0 media path instead of the unspecced v1. (#7714)Patrick Cloke2020-06-171-1/+1
| |
* | Merge commit '46613aaf7' into dinsicAndrew Morgan2020-08-032-19/+45
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '46613aaf7': (27 commits) Incorporate review Lint Incorporate review bits Pre-populate the unread_count column Don't update the schema version Use attr instead of a dict Lint Test that a mark_unread action updates the right counter when using a slave store Remove debug logging Test that a mark_unread action updates the right counter Fix summary rotation Log for invalid values of notif Fix SQL Fix schema update Lint Save the count of unread messages to event_push_summary Actually act on mark_unread Appease mypy Lint Use temporary prefixes as per the MSC ...
| * Implement unread counter (MSC2625) (#7673)Brendan Abolivier2020-06-172-19/+45
| |\ | | | | | | Implementation of https://github.com/matrix-org/matrix-doc/pull/2625
| | * Merge branch 'develop' into babolivier/mark_unreadBrendan Abolivier2020-06-152-21/+141
| | |\
| | * \ Merge branch 'develop' into babolivier/mark_unreadBrendan Abolivier2020-06-154-7/+110
| | |\ \
| | * | | LintBrendan Abolivier2020-06-121-3/+1
| | | | |
| | * | | Test that a mark_unread action updates the right counter when using a slave ↵Brendan Abolivier2020-06-121-0/+15
| | | | | | | | | | | | | | | | | | | | store
| | * | | Remove debug loggingBrendan Abolivier2020-06-121-2/+0
| | | | |
| | * | | Test that a mark_unread action updates the right counterBrendan Abolivier2020-06-121-5/+16
| | | | |
| | * | | Fix testsBrendan Abolivier2020-06-102-17/+21
| | | | |
* | | | | Merge commit 'ac51bd581' into dinsicAndrew Morgan2020-08-031-0/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | * commit 'ac51bd581': Include a user agent in federation requests. (#7677)
| * | | | Include a user agent in federation requests. (#7677)Patrick Cloke2020-06-161-0/+10
| | | | |
* | | | | Merge commit 'a3f11567d' into dinsicAndrew Morgan2020-08-0310-23/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | * commit 'a3f11567d': Replace all remaining six usage with native Python 3 equivalents (#7704)
| * | | | Replace all remaining six usage with native Python 3 equivalents (#7704)Dagfinn Ilmari Mannsåker2020-06-1610-23/+14
| | | | |
* | | | | Merge commit '03619324f' into dinsicAndrew Morgan2020-08-0316-58/+373
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '03619324f': Create a ListenerConfig object (#7681) Fix changelog wording 1.15.1 Wrap register_device coroutine in an ensureDeferred (#7684) Ensure the body is a string before comparing push rules. (#7701) Ensure etag is a string for GET room_keys/version response (#7691) Update m.id.phone to use 'phone' instead of 'number' (#7687) Fix "There was no active span when trying to log." error (#7698) Enable 3PID add/bind/unbind endpoints on r0 routes Discard RDATA from already seen positions. (#7648) Replace iteritems/itervalues/iterkeys with native versions. (#7692) Fix warnings about losing log context during UI auth. (#7688) Fix a typo when comparing the URI & method during UI Auth. (#7689) Remove "user_id" from GET /presence. (#7606) Increase the default SAML session expirary time to 15 minutes. (#7664) fix typo in sample_config.yaml (#7652) Take out a lock before modifying _CACHES (#7663) Add option to enable encryption by default for new rooms (#7639) Clean-up the fallback login code. (#7657)
| * | | | Create a ListenerConfig object (#7681)Richard van der Hoff2020-06-165-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ended up being a bit more invasive than I'd hoped for (not helped by generic_worker duplicating some of the code from homeserver), but hopefully it's an improvement. The idea is that, rather than storing unstructured `dict`s in the config for the listener configurations, we instead parse it into a structured `ListenerConfig` object.
| * | | | Merge branch 'master' into developBrendan Abolivier2020-06-162-0/+54
| |\ \ \ \
| | * | | | Wrap register_device coroutine in an ensureDeferred (#7684)Andrew Morgan2020-06-162-0/+54
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/matrix-org/synapse/issues/7683 Broke in: #7649 We had a `yield` acting on a coroutine. To be fair this one is a bit difficult to notice as there's a function in the middle that just passes the coroutine along.
| * | | | Ensure the body is a string before comparing push rules. (#7701)Patrick Cloke2020-06-151-9/+30
| | | | |
| * | | | Ensure etag is a string for GET room_keys/version response (#7691)Hubert Chathi2020-06-151-0/+1
| | |_|/ | |/| |
| * | | Discard RDATA from already seen positions. (#7648)Patrick Cloke2020-06-152-21/+141
| | |/ | |/|
| * | Add option to enable encryption by default for new rooms (#7639)Andrew Morgan2020-06-104-7/+110
| |/ | | | | | | | | | | | | | | | | Fixes https://github.com/matrix-org/synapse/issues/2431 Adds config option `encryption_enabled_by_default_for_room_type`, which determines whether encryption should be enabled with the default encryption algorithm in private or public rooms upon creation. Whether the room is private or public is decided based upon the room creation preset that is used. Part of this PR is also pulling out all of the individual instances of `m.megolm.v1.aes-sha2` into a constant variable to eliminate typos ala https://github.com/matrix-org/synapse/pull/7637 Based on #7637
* | Add option to autobind user's email on registration (#51)Andrew Morgan2020-07-021-1/+84
| | | | | | | | | | Adds an option, `bind_new_user_emails_to_sydent`, which uses Sydent's [internal bind api](https://github.com/matrix-org/sydent#internal-bind-and-unbind-api) to automatically bind email addresses of users immediately after they register. This is quite enterprise-specific, but could be generally useful to multiple organizations. This aims to solve the problem of requiring users to verify their email twice when using the functionality of an identity server in a corporate deployment - where both the homeserver and identity server are controlled. It does with while eliminating the need for the `account_threepid_delegates.email` option, which historically has been a very complicated option to reason about.
* | Merge branch 'release-v1.15.0' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-06-2419-244/+1412
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.15.x * 'release-v1.15.0' of github.com:matrix-org/synapse: (55 commits) 1.15.0 Fix some attributions Update CHANGES.md 1.15.0rc1 Revert "1.15.0rc1" 1.15.0rc1 Fix bug in account data replication stream. (#7656) Convert the registration handler to async/await. (#7649) Accept device information at the login fallback endpoint. (#7629) Convert user directory handler and related classes to async/await. (#7640) Add an option to disable autojoin for guest accounts (#6637) Clarifications to the admin api documentation (#7647) Update to the stable SSO prefix for UI Auth. (#7630) Fix type information on `assert_*_is_admin` methods (#7645) Remove some unused constants. (#7644) Typo fixes. Allow new users to be registered via the admin API even if the monthly active user limit has been reached (#7263) Add device management to admin API (#7481) Attempt to fix PhoneHomeStatsTestCase.test_performance_100 being flaky. (#7634) Support CS API v0.6.0 (#6585) ...
| * Convert user directory handler and related classes to async/await. (#7640)Patrick Cloke2020-06-051-4/+4
| |
| * Add an option to disable autojoin for guest accounts (#6637)Travis Ralston2020-06-051-0/+10
| | | | | | | | Fixes https://github.com/matrix-org/synapse/issues/3177
| * Allow new users to be registered via the admin API even if the monthly ↵Dirk Klimpel2020-06-051-15/+163
| | | | | | | | active user limit has been reached (#7263)
| * Add device management to admin API (#7481)Dirk Klimpel2020-06-051-0/+541
| | | | | | | | | | | | | | | | | | | | - Admin is able to - change displaynames - delete devices - list devices - get device informations Fixes #7330
| * Add support for webp thumbnailing (#7586)WGH2020-06-051-36/+99
| | | | | | | | | | Closes #4382 Signed-off-by: Maxim Plotnikov <wgh@torlan.ru>
| * Performance improvements and refactor of Ratelimiter (#7595)Andrew Morgan2020-06-058-68/+128
| | | | | | | | | | | | | | | | | | | | While working on https://github.com/matrix-org/synapse/issues/5665 I found myself digging into the `Ratelimiter` class and seeing that it was both: * Rather undocumented, and * causing a *lot* of config checks This PR attempts to refactor and comment the `Ratelimiter` class, as well as encourage config file accesses to only be done at instantiation. Best to be reviewed commit-by-commit.
| * Fix encryption algorithm typos in tests/comments (#7637)Andrew Morgan2020-06-042-6/+6
| | | | | | | | | | | | | | | | @uhoreg has confirmed these were both typos. They are only in comments and tests though, rather than anything critical. Introduced in: * https://github.com/matrix-org/synapse/pull/7157 * https://github.com/matrix-org/synapse/pull/5726
| * Replace instances of reactor pumping with get_success. (#7619)Andrew Morgan2020-06-032-121/+151
| | | | | | | | | | Calls `self.get_success` on all deferred methods instead of abusing `self.pump()`. This has the benefit of working with coroutines, as well as checking that method execution completed successfully. There are also a few small cleanups that I made in the process.
| * Fix a bug in automatic user creation with m.login.jwt. (#7585)Olof Johansson2020-06-011-0/+153
| |
| * Process cross-signing keys when resyncing device lists (#7594)Brendan Abolivier2020-06-011-0/+56
| | | | | | It looks like `user_device_resync` was ignoring cross-signing keys from the results received from the remote server. This patch fixes this, by processing these keys using the same process `_handle_signing_key_updates` does (and effectively factor that part out of that function).
| * Email notifications for new users when creating via the Admin API. (#7267)Dirk Klimpel2020-06-011-0/+75
| |
| * Add test for Linearizer.is_queued(..)Erik Johnston2020-05-271-0/+32
| |
* | Prevent M_USER_IN_USE from being raised by registration methods until after ↵Andrew Morgan2020-06-221-8/+0
| | | | | | | | | | | | email has been verified (#48) * Just ignore the `username` parameter on registration as it's not used by DINUM * Have `/register/available` always return `true`
* | Add a bulk user info endpoint and deprecate the old one (#46)Andrew Morgan2020-06-191-1/+134
| | | | | | | | | | | | | | | | | | The current `/user/<user_id>/info` API was useful in that it could be used by any user to lookup whether another user was deactivate or expired. However, it was impractical as it only allowed for a single lookup at once. Clients trying to use this API were met with speed issues as they tried to query this information for all users in a room. This PR adds an equivalent CS and Federation API that takes a list of user IDs, and returning a mapping from user ID to info dictionary. Note that the federation in this PR was a bit trickier than in the original #12 as we can no longer use a federation query, as those don't allow for JSON bodies - which we require to pass a list of user IDs. Instead we do the whole thing of adding a method to transport/client and transport/server. This PR also adds unittests. The earlier PR used Sytest, presumably for testing across federation, but as this is Synapse-specific that felt a little gross. Unit tests for the deprecated endpoint have not been added.
* | Performance improvements to marking expired users as inactive (#47)Andrew Morgan2020-06-191-10/+27
| | | | | | This is a performance-related improvement to #13, which queried and hid active *and* already inactive users, one-by-one. This PR updates the code to query only **active**, expired users, all at once, and then mark them as inactive, all at once.
* | Merge branch 'release-v1.14.0' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-06-1042-237/+1832
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.14.x * 'release-v1.14.0' of github.com:matrix-org/synapse: (108 commits) Fix typo in PR link Update debian changelog 1.14.0 Improve changelog wording 1.14.0rc2 Fix sample config docs error (#7581) Fix up comments Fix specifying cache factors via env vars with * in name. (#7580) Don't apply cache factor to event cache. (#7578) Ensure ReplicationStreamer is always started when replication enabled. (#7579) Remove the changes to the debian changelog Not full release yet, this is rc1 Merge event persistence move changelog entries More changelog fix Changelog fixes 1.14.0 Replace device_27_unique_idx bg update with a fg one (#7562) Fix incorrect exception handling in KeyUploadServlet.on_POST (#7563) Fix recording of federation stream token (#7564) Simplify reap_monthly_active_users (#7558) ...
| * Fix specifying cache factors via env vars with * in name. (#7580)Erik Johnston2020-05-271-0/+28
| | | | | | | | | | This mostly applise to `*stateGroupCache*` and co. Broke in #6391.
| * Don't apply cache factor to event cache. (#7578)Erik Johnston2020-05-271-0/+16
| | | | | | | | This is already correctly done when we instansiate the cache, but wasn't when it got reloaded (which always happens at least once on startup).
| * Fix recording of federation stream token (#7564)Richard van der Hoff2020-05-261-0/+71
| | | | | | | | | | | | | | | | A couple of changes of significance: * remove the `_last_ack < federation_position` condition, so that updates will still be correctly processed after restart * Correctly wire up send_federation_ack to the right class.
| * Optimise some references to hs.config (#7546)Richard van der Hoff2020-05-224-117/+129
| | | | | | These are surprisingly expensive, and we only really need to do them at startup.
| * Fix missing CORS headers on OPTION responses (#7560)Erik Johnston2020-05-221-0/+28
| | | | | | Broke in #7534.
| * Return 200 OK for all OPTIONS requests (#7534)Patrick Cloke2020-05-221-0/+53
| |
| * Add ability to wait for replication streams (#7542)Erik Johnston2020-05-225-8/+15
| | | | | | | | | | | | | | The idea here is that if an instance persists an event via the replication HTTP API it can return before we receive that event over replication, which can lead to races where code assumes that persisting an event immediately updates various caches (e.g. current state of the room). Most of Synapse doesn't hit such races, so we don't do the waiting automagically, instead we do so where necessary to avoid unnecessary delays. We may decide to change our minds here if it turns out there are a lot of subtle races going on. People probably want to look at this commit by commit.
| * Convert sending mail to async/await. (#7557)Erik Johnston2020-05-221-2/+2
| | | | | | | | Mainly because sometimes the email push code raises exceptions where the stack traces have gotten lost, which is hopefully fixed by this.
| * Retry to sync out of sync device lists (#7453)Brendan Abolivier2020-05-211-1/+62
| | | | | | | | | | | | | | | | | | | | | | When a call to `user_device_resync` fails, we don't currently mark the remote user's device list as out of sync, nor do we retry to sync it. https://github.com/matrix-org/synapse/pull/6776 introduced some code infrastructure to mark device lists as stale/out of sync. This commit uses that code infrastructure to mark device lists as out of sync if processing an incoming device list update makes the device handler realise that the device list is out of sync, but we can't resync right now. It also adds a looping call to retry all failed resync every 30s. This shouldn't cause too much spam in the logs as this commit also removes the "Failed to handle device list update for..." warning logs when catching `NotRetryingDestination`. Fixes #7418
| * fix mypy for tests/replication (#7518)Richard van der Hoff2020-05-182-13/+7
| |
| * Fix limit logic for AccountDataStream (#7384)Richard van der Hoff2020-05-151-0/+117
| | | | | | | | | | | | Make sure that the AccountDataStream presents complete updates, in the right order. This is much the same fix as #7337 and #7358, but applied to a different stream.
| * Support UI Authentication for OpenID Connect accounts (#7457)Patrick Cloke2020-05-151-5/+10
| |
| * Implement room version 6 (MSC2240). (#7506)Patrick Cloke2020-05-153-15/+9
| |
| * Strictly enforce canonicaljson requirements in a new room version (#7381)Patrick Cloke2020-05-141-1/+66
| |
| * Enforce MSC2209: auth rules for notifications in power level event (#7502)Patrick Cloke2020-05-141-0/+33
| | | | | | | | In a new room version, the "notifications" key of power level events are subject to restricted auth rules.
| * Allow expired accounts to logout (#7443)Andrew Morgan2020-05-142-2/+103
| |
| * Merge tag 'v1.13.0rc2' into developRichard van der Hoff2020-05-142-46/+59
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synapse 1.13.0rc2 (2020-05-14) ============================== Bugfixes -------- - Fix a long-standing bug which could cause messages not to be sent over federation, when state events with state keys matching user IDs (such as custom user statuses) were received. ([\#7376](https://github.com/matrix-org/synapse/issues/7376)) - Restore compatibility with non-compliant clients during the user interactive authentication process, fixing a problem introduced in v1.13.0rc1. ([\#7483](https://github.com/matrix-org/synapse/issues/7483)) Internal Changes ---------------- - Fix linting errors in new version of Flake8. ([\#7470](https://github.com/matrix-org/synapse/issues/7470))
| * | Clean up replication unit tests. (#7490)Erik Johnston2020-05-137-51/+15
| | |
| * | Shuffle persist event data store functions. (#7440)Erik Johnston2020-05-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The aim here is to get to a stage where we have a `PersistEventStore` that holds all the write methods used during event persistence, so that we can take that class out of the `DataStore` mixin and instansiate it separately. This will allow us to instansiate it on processes other than master, while also ensuring it is only available on processes that are configured to write to events stream. This is a bit of an architectural change, where we end up with multiple classes per data store (rather than one per data store we have now). We end up having: 1. Storage classes that provide high level APIs that can talk to multiple data stores. 2. Data store modules that consist of classes that must point at the same database instance. 3. Classes in a data store that can be instantiated on processes depending on config.
| * | Fix new flake8 errors (#7470)Erik Johnston2020-05-121-1/+1
| | |
| * | Allow configuration of Synapse's cache without using synctl or environment ↵Amber Brown2020-05-119-18/+178
| | | | | | | | | | | | variables (#6391)
| * | Merge branch 'release-v1.13.0' into developAndrew Morgan2020-05-111-88/+216
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * release-v1.13.0: Don't UPGRADE database rows RST indenting Put rollback instructions in upgrade notes Fix changelog typo Oh yeah, RST Absolute URL it is then Fix upgrade notes link Provide summary of upgrade issues in changelog. Fix ) Move next version notes from changelog to upgrade notes Changelog fixes 1.13.0rc1 Documentation on setting up redis (#7446) Rework UI Auth session validation for registration (#7455) Fix errors from malformed log line (#7454) Drop support for redis.dbid (#7450)
| * | | Extend spam checker to allow for multiple modules (#7435)Andrew Morgan2020-05-081-2/+2
| | | |
| * | | Implement OpenID Connect-based login (#7256)Quentin Gliech2020-05-081-0/+565
| | | |
| * | | Add room details admin endpoint (#7317)Manuel Stahl2020-05-072-0/+52
| | | |
| * | | Merge branch 'release-v1.13.0' into developRichard van der Hoff2020-05-064-33/+53
| |\ \ \
| * \ \ \ Merge branch 'release-v1.13.0' into developRichard van der Hoff2020-05-062-6/+120
| |\ \ \ \
| * | | | | Fix catchup-on-reconnect for the Federation Stream (#7374)Richard van der Hoff2020-05-053-12/+94
| | | | | | | | | | | | | | | | | | | | | | | | looks like we managed to break this during the refactorathon.
| * | | | | Add MultiWriterIdGenerator. (#7281)Erik Johnston2020-05-041-0/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be used to coordinate stream IDs across multiple writers. Functions as the equivalent of both `StreamIdGenerator` and `SlavedIdTracker`.
* | | | | | Merge branch 'release-v1.13.0' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-06-1056-1041/+4321
|\ \ \ \ \ \ | | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.14.x * 'release-v1.13.0' of github.com:matrix-org/synapse: (257 commits) Update changelog based on feedback. Move warnings in the changelog and re-iterate changes to branches. 1.13.0 update dh-virtualenv (#7526) 1.13.0rc3 Hash passwords earlier in the registration process (#7523) 1.13.0rc2 1.13.0rc2 Stop `get_joined_users` corruption from custom statuses (#7376) Do not validate that the client dict is stable during UI Auth. (#7483) Fix new flake8 errors (#7489) Don't UPGRADE database rows RST indenting Put rollback instructions in upgrade notes Fix changelog typo Oh yeah, RST Absolute URL it is then Fix upgrade notes link Provide summary of upgrade issues in changelog. Fix ) Move next version notes from changelog to upgrade notes ...
| * | | | | Stop `get_joined_users` corruption from custom statuses (#7376)Richard van der Hoff2020-05-141-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where the `get_joined_users` cache could be corrupted by custom status events (or other state events with a state_key matching the user ID). The bug was introduced by #2229, but has largely gone unnoticed since then. Fixes #7099, #7373.
| * | | | | Do not validate that the client dict is stable during UI Auth. (#7483)Patrick Cloke2020-05-131-45/+10
| | | | | | | | | | | | | | | | | | | | | | | | This backs out some of the validation for the client dictionary and logs if this changes during a user interactive authentication session instead.
| * | | | | Fix new flake8 errors (#7489)Patrick Cloke2020-05-131-1/+1
| | |_|_|/ | |/| | | | | | | | | | | | | This is a cherry-pick of 1a1da60ad2c9172fe487cd38a164b39df60f4cb5 (#7470) to the release-v1.13.0 branch.
| * | | | Rework UI Auth session validation for registration (#7455)Patrick Cloke2020-05-081-88/+216
| | |_|/ | |/| | | | | | | | | | Be less strict about validation of UI authentication sessions during registration to match client expecations.
| * | | Stop Auth methods from polling the config on every req. (#7420)Andrew Morgan2020-05-064-33/+53
| | |/ | |/|
| * | Fix bug in EventContext.deserialize. (#7393)Erik Johnston2020-05-052-6/+120
| |/ | | | | | | This caused `prev_state_ids` to be incorrect if the state event was not replacing an existing state entry.
| * Convert synapse.server_notices to async/await. (#7394)Patrick Cloke2020-05-011-1/+1
| |
| * Thread through instance name to replication client. (#7369)Erik Johnston2020-05-013-6/+6
| | | | | | For in memory streams when fetching updates on workers we need to query the source of the stream, which currently is hard coded to be master. This PR threads through the source instance we received via `POSITION` through to the update function in each stream, which can then be passed to the replication client for in memory streams.
| * Use `stream.current_token()` and remove `stream_positions()` (#7172)Erik Johnston2020-05-014-34/+26
| | | | | | | | We move the processing of typing and federation replication traffic into their handlers so that `Stream.current_token()` points to a valid token. This allows us to remove `get_streams_to_replicate()` and `stream_positions()`.
| * async/await is_server_admin (#7363)Andrew Morgan2020-05-014-62/+81
| |
| * Persist user interactive authentication sessions (#7302)Patrick Cloke2020-04-302-4/+44
| | | | | | | | | | By persisting the user interactive authentication sessions to the database, this fixes situations where a user hits different works throughout their auth session and also allows sessions to persist through restarts of Synapse.
| * Add instance name to RDATA/POSITION commands (#7364)Erik Johnston2020-04-292-2/+5
| | | | | | | | | | This is primarily for allowing us to send those commands from workers, but for now simply allows us to ignore echoed RDATA/POSITION commands that we sent (we get echoes of sent commands when using redis). Currently we log a WARNING on the master process every time we receive an echoed RDATA.
| * Don't relay REMOTE_SERVER_UP cmds to same conn. (#7352)Erik Johnston2020-04-291-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For direct TCP connections we need the master to relay REMOTE_SERVER_UP commands to the other connections so that all instances get notified about it. The old implementation just relayed to all connections, assuming that sending back to the original sender of the command was safe. This is not true for redis, where commands sent get echoed back to the sender, which was causing master to effectively infinite loop sending and then re-receiving REMOTE_SERVER_UP commands that it sent. The fix is to ensure that we only relay to *other* connections and not to the connection we received the notification from. Fixes #7334.
| * Fix limit logic for EventsStream (#7358)Richard van der Hoff2020-04-298-48/+579
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Factor out functions for injecting events into database I want to add some more flexibility to the tools for injecting events into the database, and I don't want to clutter up HomeserverTestCase with them, so let's factor them out to a new file. * Rework TestReplicationDataHandler This wasn't very easy to work with: the mock wrapping was largely superfluous, and it's useful to be able to inspect the received rows, and clear out the received list. * Fix AssertionErrors being thrown by EventsStream Part of the problem was that there was an off-by-one error in the assertion, but also the limit logic was too simple. Fix it all up and add some tests.
| * Return total number of users and profile attributes in admin users endpoint ↵Manuel Stahl2020-04-282-0/+48
| | | | | | | | | | (#6881) Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
| * Add some replication tests (#7278)Erik Johnston2020-04-282-11/+298
| | | | | | | | | | | | | | Specifically some tests for the typing stream, which means we test streams that fetch missing updates via HTTP (rather than via the DB). We also shuffle things around a bit so that we create two separate `HomeServer` objects, rather than trying to insert a slaved store into places. Note: `test_typing.py` is heavily inspired by `test_receipts.py`
| * Fix collation for postgres for unit tests (#7359)Richard van der Hoff2020-04-281-1/+4
| | | | | | | | When running the UTs against a postgres deatbase, we need to set the collation correctly.
| * Revert "Revert "Merge pull request #7315 from ↵Brendan Abolivier2020-04-232-1/+62
| | | | | | | | | | | | matrix-org/babolivier/request_token"" This reverts commit 1adf6a55870aa08de272591ff49db9dc49738076.
| * Another go at fixing one-word commands (#7326)Richard van der Hoff2020-04-221-0/+42
| | | | | | I messed this up last time I tried (#7239 / e13c6c7).
| * Extend StreamChangeCache to support multiple entities per stream ID (#7303)Richard van der Hoff2020-04-221-9/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First some background: StreamChangeCache is used to keep track of what "entities" have changed since a given stream ID. So for example, we might use it to keep track of when the last to-device message for a given user was received [1], and hence whether we need to pull any to-device messages from the database on a sync [2]. Now, it turns out that StreamChangeCache didn't support more than one thing being changed at a given stream_id (this was part of the problem with #7206). However, it's entirely valid to send to-device messages to more than one user at a time. As it turns out, this did in fact work, because *some* methods of StreamChangeCache coped ok with having multiple things changing on the same stream ID, and it seems we never actually use the methods which don't work on the stream change caches where we allow multiple changes at the same stream ID. But that feels horribly fragile, hence: let's update StreamChangeCache to properly support this, and add some typing and some more tests while we're at it. [1]: https://github.com/matrix-org/synapse/blob/release-v1.12.3/synapse/storage/data_stores/main/deviceinbox.py#L301 [2]: https://github.com/matrix-org/synapse/blob/release-v1.12.3/synapse/storage/data_stores/main/deviceinbox.py#L47-L51
| * Extend room admin api with additional attributes (#7225)Dirk Klimpel2020-04-222-592/+680
| |
| * Add ability to run replication protocol over redis. (#7040)Erik Johnston2020-04-221-2/+2
| | | | | | This is configured via the `redis` config options.
| * Do not treat display names as globs for push rules. (#7271)Patrick Cloke2020-04-161-0/+65
| |
| * Convert auth handler to async/await (#7261)Patrick Cloke2020-04-154-57/+104
| |
| * Allow specifying the value of Accept-Language header for URL previews (#7265)Andrew Morgan2020-04-151-0/+55
| |
| * Fix the parameters of a test fixture (#7243)Zay11Zay2020-04-141-1/+1
| |
| * Default PL100 to enable encryption in a room (#7230)Andrew Morgan2020-04-092-4/+297
| |
| * Do not allow a deactivated user to login via SSO. (#7240)Patrick Cloke2020-04-091-3/+39
| |
| * bg update to clear out duplicate outbound_device_list_pokes (#7193)Richard van der Hoff2020-04-071-0/+52
| | | | | | | | We seem to have some duplicates, which could do with being cleared out.
| * Move client command handling out of TCP protocol (#7185)Erik Johnston2020-04-063-29/+25
| | | | | | The aim here is to move the command handling out of the TCP protocol classes and to also merge the client and server command handling (so that we can reuse them for redis protocol). This PR simply moves the client paths to the new `ReplicationCommandHandler`, a future PR will move the server paths too.
| * Server notices: Dissociate room creation/lookup from invite (#7199)Brendan Abolivier2020-04-041-12/+108
| | | | | | | | | | | | | | | | | | Fixes #6815 Before figuring out whether we should alert a user on MAU, we call get_notice_room_for_user to get some info on the existing server notices room for this user. This function, if the room doesn't exist, creates it and invites the user in it. This means that, if we decide later that no server notice is needed, the user gets invited in a room with no message in it. This happens at every restart of the server, since the room ID returned by get_notice_room_for_user is cached. This PR fixes that by moving the inviting bit to a dedicated function, that's only called when the server actually needs to send a notice to the user. A potential issue with this approach is that the room that's created by get_notice_room_for_user doesn't match how that same function looks for an existing room (i.e. it creates a room that doesn't have an invite or a join for the current user in it, so it could lead to a new room being created each time a user syncs), but I'm not sure this is a problem given it's cached until the server restarts, so that function won't run very often. It also renames get_notice_room_for_user into get_or_create_notice_room_for_user to make what it does clearer.
| * Merge pull request #7190 from matrix-org/rav/one_bg_update_at_a_timeRichard van der Hoff2020-04-032-13/+22
| |\ | | | | | | Only run one background update at a time
| | * Make do_next_background_update return a boolRichard van der Hoff2020-03-311-3/+3
| | | | | | | | | | | | returning a None or an int that we don't use is confusing.
| | * Set a logging context while running the bg updatesRichard van der Hoff2020-03-311-4/+7
| | | | | | | | | | | | | | | This mostly just reduces the amount of "running from sentinel context" spam during unittest setup.
| | * Make `has_completed_background_updates` asyncRichard van der Hoff2020-03-311-1/+3
| | | | | | | | | | | | (Almost) everywhere that uses it is happy with an awaitable.
| | * Remove unused `start_background_update`Richard van der Hoff2020-03-311-5/+9
| | | | | | | | | | | | This was only used in a unit test, so let's just inline it in the test.
| * | Fix device list update stream ids going backward (#7158)Richard van der Hoff2020-04-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Occasionally we could get a federation device list update transaction which looked like: ``` [ {'edu_type': 'm.device_list_update', 'content': {'user_id': '@user:test', 'device_id': 'D2', 'prev_id': [], 'stream_id': 12, 'deleted': True}}, {'edu_type': 'm.device_list_update', 'content': {'user_id': '@user:test', 'device_id': 'D1', 'prev_id': [12], 'stream_id': 11, 'deleted': True}}, {'edu_type': 'm.device_list_update', 'content': {'user_id': '@user:test', 'device_id': 'D3', 'prev_id': [11], 'stream_id': 13, 'deleted': True}} ] ``` Having `stream_ids` which are lower than `prev_ids` looks odd. It might work (I'm not actually sure), but in any case it doesn't seem like a reasonable thing to expect other implementations to support.
| * | Allow admins to create aliases when they are not in the room (#7191)Patrick Cloke2020-04-011-0/+62
| |/
| * Rewrite prune_old_outbound_device_pokes for efficiency (#7159)Richard van der Hoff2020-03-301-0/+92
| | | | | | | | make sure we clear out all but one update for the user
| * Merge pull request #7157 from matrix-org/rev.outbound_device_pokes_testsRichard van der Hoff2020-03-3010-22/+317
| |\ | | | | | | Add tests for outbound device pokes
| | * Add tests for outbound device pokesRichard van der Hoff2020-03-272-3/+301
| | |
| | * Remove spurious "name" parameter to `default_config`Richard van der Hoff2020-03-249-19/+16
| | | | | | | | | | | | | | | this is never set to anything other than "test", and is a source of unnecessary boilerplate.
| * | Always whitelist the login fallback for SSO (#7153)Richard van der Hoff2020-03-271-1/+8
| | | | | | | | | | | | | | | | | | | | | That fallback sets the redirect URL to itself (so it can process the login token then return gracefully to the client). This would make it pointless to ask the user for confirmation, since the URL the confirmation page would be showing wouldn't be the client's.
| * | Admin API to join users to a room. (#7051)Dirk Klimpel2020-03-271-0/+288
| | |
| * | Add options to prevent users from changing their profile. (#7096)Dirk Klimpel2020-03-272-1/+366
| | |
| * | Allow server admins to define and enforce a password policy (MSC2000). (#7118)Dirk Klimpel2020-03-261-0/+179
| | |
| * | Validate that the session is not modified during UI-Auth (#7068)Patrick Cloke2020-03-262-2/+69
| | |
| * | Move catchup of replication streams to worker. (#7024)Erik Johnston2020-03-252-23/+84
| | | | | | | | | This changes the replication protocol so that the server does not send down `RDATA` for rows that happened before the client connected. Instead, the server will send a `POSITION` and clients then query the database (or master out of band) to get up to date.
| * | Clean up some LoggingContext stuff (#7120)Richard van der Hoff2020-03-2411-56/+68
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Pull Sentinel out of LoggingContext ... and drop a few unnecessary references to it * Factor out LoggingContext.current_context move `current_context` and `set_context` out to top-level functions. Mostly this means that I can more easily trace what's actually referring to LoggingContext, but I think it's generally neater. * move copy-to-parent into `stop` this really just makes `start` and `stop` more symetric. It also means that it behaves correctly if you manually `set_log_context` rather than using the context manager. * Replace `LoggingContext.alive` with `finished` Turn `alive` into `finished` and make it a bit better defined.
| * Convert `*StreamRow` classes to inner classes (#7116)Richard van der Hoff2020-03-231-2/+2
| | | | | | | | | | This just helps keep the rows closer to their streams, so that it's easier to see what the format of each stream is.
| * Improve database configuration docs (#6988)Richard van der Hoff2020-03-201-20/+2
| | | | | | | | | | Attempts to clarify the sample config for databases, and add some stuff about tcp keepalives to `postgres.md`.
| * Change device list streams to have one row per ID (#7010)Erik Johnston2020-03-191-45/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add 'device_lists_outbound_pokes' as extra table. This makes sure we check all the relevant tables to get the current max stream ID. Currently not doing so isn't problematic as the max stream ID in `device_lists_outbound_pokes` is the same as in `device_lists_stream`, however that will change. * Change device lists stream to have one row per id. This will make it possible to process the streams more incrementally, avoiding having to process large chunks at once. * Change device list replication to match new semantics. Instead of sending down batches of user ID/host tuples, send down a row per entity (user ID or host). * Newsfile * Remove handling of multiple rows per ID * Fix worker handling * Comments from review
| | * Remove handling of multiple rows per IDErik Johnston2020-02-281-45/+0
| | |
* | | Do not treat display names as globs for push rules. (#7271)Patrick Cloke2020-05-281-0/+65
| | |
* | | apply lintingAndrew Morgan2020-05-143-12/+9
| | |
* | | Fix and refactor rewritten IS url feature. Add sample config docs (#40)Andrew Morgan2020-04-221-3/+4
| | |
* | | Merge branch 'dinsic' of github.com:matrix-org/synapse-dinsic into ↵Andrew Morgan2020-03-241-2/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.12.x * 'dinsic' of github.com:matrix-org/synapse-dinsic: Fixes an attribute error when using the default display name during registration. (#32) Share SSL contexts for non-federation requests (#30) Share SSL options for well-known requests (#29) Fix buggy condition in account validity handler (#28)
| * | | Share SSL contexts for non-federation requests (#30)Richard van der Hoff2020-03-171-3/+3
| | | | | | | | | | | | | | | | | | | | * Share SSL contexts for non-federation requests * newsfile
| * | | Share SSL options for well-known requests (#29)Andrew Morgan2020-03-161-6/+6
| | | |
* | | | Improve get auth chain difference algorithm. (#7095)Andrew Morgan2020-03-242-22/+148
|\ \ \ \ | | |/ / | |/| | | | | | | | | | * commit '4a17a647a': Improve get auth chain difference algorithm. (#7095)
| * | | Improve get auth chain difference algorithm. (#7095)Erik Johnston2020-03-182-22/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was originally implemented by pulling the full auth chain of all state sets out of the database and doing set comparison. However, that can take a lot work if the state and auth chains are large. Instead, lets try and fetch the auth chains at the same time and calculate the difference on the fly, allowing us to bail early if all the auth chains converge. Assuming that the auth chains do converge more often than not, this should improve performance. Hopefully.
* | | | Share SSL contexts for non-federation requests (#7094)Andrew Morgan2020-03-242-13/+22
|\| | | | | | | | | | | | | | | | | | | * commit 'c37db0211': Share SSL contexts for non-federation requests (#7094)
| * | | Share SSL contexts for non-federation requests (#7094)Richard van der Hoff2020-03-172-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Extends #5794 etc to the SimpleHttpClient so that it also applies to non-federation requests. Fixes #7092.
* | | | Remove special casing of `m.room.aliases` events (#7034)Andrew Morgan2020-03-242-15/+33
|\| | | | | | | | | | | | | | | | | | | * commit '60724c46b': Remove special casing of `m.room.aliases` events (#7034)
| * | | Remove special casing of `m.room.aliases` events (#7034)Patrick Cloke2020-03-172-15/+33
| | | |
| * | | Revert "Add options to disable setting profile info for prevent changes. ↵Richard van der Hoff2020-03-172-335/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#7053)" This reverts commit 54dd28621b070ca67de9f773fe9a89e1f4dc19da, reversing changes made to 6640460d054e8f4444046a34bdf638921b31c01e.
| * | | Add options to disable setting profile info for prevent changes. (#7053)Brendan Abolivier2020-03-102-1/+335
| |\ \ \
| | * | | lint, fix testsdklimpel2020-03-091-2/+2
| | | | |
| | * | | updates after reviewdklimpel2020-03-092-13/+10
| | | | |
| | * | | fix testsdklimpel2020-03-091-2/+2
| | | | |
| | * | | lintdklimpel2020-03-091-10/+8
| | | | |
| | * | | add testsdklimpel2020-03-092-3/+311
| | | | |
| | * | | Add options to disable setting profile info for prevent changes.dklimpel2020-03-081-1/+32
| | | |/ | | |/|
* | | | Remove special auth and redaction rules for aliases events in experimental ↵Andrew Morgan2020-03-242-3/+125
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | room ver. (#7037) * commit '06eb5cae0': Remove special auth and redaction rules for aliases events in experimental room ver. (#7037)
| * | | Remove special auth and redaction rules for aliases events in experimental ↵Patrick Cloke2020-03-092-3/+125
| | | | | | | | | | | | | | | | room ver. (#7037)
* | | | Break down monthly active users by appservice_id (#7030)Andrew Morgan2020-03-241-0/+42
|\| | | | | | | | | | | | | | | | | | | * commit '1d66dce83': Break down monthly active users by appservice_id (#7030)
| * | | Break down monthly active users by appservice_id (#7030)Neil Johnson2020-03-061-0/+42
| | | | | | | | | | | | | | | | | | | | * Break down monthly active users by appservice_id and emit via prometheus. Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* | | | Allow deleting an alias if the user has sufficient power level (#6986)Andrew Morgan2020-03-241-24/+104
|\| | | | | | | | | | | | | | | | | | | * commit '13892776e': Allow deleting an alias if the user has sufficient power level (#6986)