1
0
Commit Graph

18857 Commits

Author SHA1 Message Date
Andrew Morgan c5aaa80a96 Merge commit '7f837959e' into anoa/dinsic_release_1_21_x
* 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)
2020-10-19 17:06:53 +01:00
Andrew Morgan d84510c76a Merge commit '1048ed2af' into anoa/dinsic_release_1_21_x
* commit '1048ed2af':
  Clarify that undoing a shutdown might not be possible (#8010)
2020-10-19 17:06:49 +01:00
Andrew Morgan 152c6b20cb Merge commit 'de6f89206' into anoa/dinsic_release_1_21_x
* commit 'de6f89206':
  Add a comment about SSLv23_METHOD (#8043)
2020-10-19 17:06:44 +01:00
Andrew Morgan 5ede106d5c Merge commit '2f9fd5ab0' into anoa/dinsic_release_1_21_x
* commit '2f9fd5ab0':
  Don't log OPTIONS request at INFO (#8049)
2020-10-19 17:06:40 +01:00
Andrew Morgan a67a65afbf Merge commit '4e874ed59' into anoa/dinsic_release_1_21_x
* commit '4e874ed59':
  Remove unnecessary maybeDeferred calls (#8044)
2020-10-19 17:06:36 +01:00
Andrew Morgan 9dd3b52f1b Merge commit '7620912d8' into anoa/dinsic_release_1_21_x
* commit '7620912d8':
  Add health check endpoint (#8048)
2020-10-19 17:06:32 +01:00
Andrew Morgan 2ad098b27c Merge commit '4dd27e6d1' into anoa/dinsic_release_1_21_x
* commit '4dd27e6d1':
  Reduce unnecessary whitespace in JSON. (#7372)
2020-10-19 17:06:27 +01:00
Andrew Morgan d47db9e9e9 Merge commit '2ffd6783c' into anoa/dinsic_release_1_21_x
* commit '2ffd6783c':
  Revert #7736 (#8039)
2020-10-19 17:06:14 +01:00
Andrew Morgan 9e2cab71fe Merge commit 'fe6cfc80e' into anoa/dinsic_release_1_21_x
* commit 'fe6cfc80e':
  Convert some util functions to async (#8035)
2020-10-19 17:06:09 +01:00
Andrew Morgan 383a87e0e2 Merge commit 'd4a7829b1' into anoa/dinsic_release_1_21_x
* commit 'd4a7829b1':
  Convert synapse.api to async/await (#8031)
2020-10-19 14:59:45 +01:00
Andrew Morgan af13a4b21b Merge commit 'c36228c40' into anoa/dinsic_release_1_21_x
* commit 'c36228c40':
  Convert run_as_background_process inner function to async. (#8032)
2020-10-19 14:30:55 +01:00
Andrew Morgan 9d09ab74bb Merge commit '66f24449d' into anoa/dinsic_release_1_21_x
* commit '66f24449d':
  Improve performance of the register endpoint (#8009)
2020-10-19 14:29:04 +01:00
Andrew Morgan 0a00347c4c Merge commit '079bc3c8e' into anoa/dinsic_release_1_21_x
* commit '079bc3c8e':
  Fixup worker doc (again) (#8000)
2020-10-16 18:22:01 +01:00
Andrew Morgan d174faacc7 Merge commit 'a7bdf98d0' into anoa/dinsic_release_1_21_x
* commit 'a7bdf98d0':
  Rename database classes to make some sense (#8033)
2020-10-16 18:21:05 +01:00
Andrew Morgan 4d4770dea6 Merge commit '0a86850ba' into anoa/dinsic_release_1_21_x
* commit '0a86850ba':
  Stop the parent process flushing the logs on exit (#8012)
2020-10-16 17:27:52 +01:00
Andrew Morgan 78aa8dff69 Merge commit '8b786db32' into anoa/dinsic_release_1_21_x
* commit '8b786db32':
  bug report template: move comments into comment (#8030)
2020-10-16 17:27:48 +01:00
Andrew Morgan e219db9951 Merge commit '7cac9006d' into anoa/dinsic_release_1_21_x
* commit '7cac9006d':
  Spruce up the check-newsfragment CI output (#8024)
2020-10-16 17:27:44 +01:00
Andrew Morgan 7ca93e56da Merge commit '8ff2deda7' into anoa/dinsic_release_1_21_x
* commit '8ff2deda7':
  Fix async/await calls for broken media providers. (#8027)
2020-10-16 17:27:39 +01:00
Andrew Morgan 4c9a73835b Merge commit '88a3ff12f' into anoa/dinsic_release_1_21_x
* commit '88a3ff12f':
  Convert the SimpleHttpClient to async. (#8016)
2020-10-16 17:27:30 +01:00
Andrew Morgan 04fef33237 Merge commit 'e19de43eb' into anoa/dinsic_release_1_21_x
* commit 'e19de43eb':
  Convert streams to async. (#8014)
2020-10-16 17:27:24 +01:00
Andrew Morgan 6bd8ea3c98 Merge commit '916cf2d43' into anoa/dinsic_release_1_21_x
* commit '916cf2d43':
  re-implement daemonize (#8011)
2020-10-16 17:27:16 +01:00
Andrew Morgan 3bd6786c1a Merge commit '481f76c7a' into anoa/dinsic_release_1_21_x
* commit '481f76c7a':
  Remove signature check on v1 identity server lookups (#8001)
2020-10-16 17:26:50 +01:00
Andrew Morgan 73381abc23 Merge commit '5d92a1428' into anoa/dinsic_release_1_21_x
* commit '5d92a1428':
  Prevent join->join membership transitions changing member count (#7977)
2020-10-16 17:21:08 +01:00
Andrew Morgan 3442b28a1b Merge commit '681250980' into anoa/dinsic_release_1_21_x
* commit '681250980':
  Implement handling of HTTP HEAD requests. (#7999)
2020-10-16 17:21:03 +01:00
Andrew Morgan cb0ee5e1aa Merge commit '2a89ce8cd' into anoa/dinsic_release_1_21_x
* commit '2a89ce8cd':
  Convert the crypto module to async/await. (#8003)
2020-10-16 17:20:59 +01:00
Andrew Morgan d670be7715 Merge commit 'b6c6fb795' into anoa/dinsic_release_1_21_x
* commit 'b6c6fb795':
  Allow guests to operate in encrypted rooms (#7314)
2020-10-16 17:20:55 +01:00
Andrew Morgan 0fe6f8d3c4 Merge commit '3b415e23a' into anoa/dinsic_release_1_21_x
* commit '3b415e23a':
  Convert replication code to async/await. (#7987)
2020-10-16 17:20:47 +01:00
Andrew Morgan f2352b59b5 Merge commit 'db5970ac6' into anoa/dinsic_release_1_21_x
* commit 'db5970ac6':
  Convert ACME code to async/await. (#7989)
2020-10-16 17:20:40 +01:00
Andrew Morgan ab298b0a1d Merge commit 'd1008fe94' into anoa/dinsic_release_1_21_x
* commit 'd1008fe94':
  Fix some comments and types in service notices (#7996)
2020-10-16 17:20:34 +01:00
Andrew Morgan 479fc9d9b5 Merge commit '394be6a0e' into anoa/dinsic_release_1_21_x
* commit '394be6a0e':
  Newsfile
  Add ratelimiting on joins
  Add docs for undoing room shutdowns (#7998)
2020-10-16 17:20:16 +01:00
Andrew Morgan ed31392b8f Merge commit '6d4b79002' into anoa/dinsic_release_1_21_x
* commit '6d4b79002':
  Update workers docs (#7990)
2020-10-16 17:11:11 +01:00
Andrew Morgan 17826f414e Merge commit '0a7fb2471' into anoa/dinsic_release_1_21_x
* commit '0a7fb2471':
  Fix invite rejection when we have no forward-extremeties (#7980)
2020-10-16 17:11:04 +01:00
Andrew Morgan aa81899c14 Merge commit '606805bf0' into anoa/dinsic_release_1_21_x
* commit '606805bf0':
  Fix typo in docs/workers.md (#7992)
2020-10-16 17:11:02 +01:00
Andrew Morgan 4ae35a3c7b Merge commit 'c978f6c45' into anoa/dinsic_release_1_21_x
* commit 'c978f6c45':
  Convert federation client to async/await. (#7975)
2020-10-16 17:08:04 +01:00
Andrew Morgan 6d02e38937 Merge commit '4cce8ef74' into anoa/dinsic_release_1_21_x
* commit '4cce8ef74':
  Convert appservice to async. (#7973)
2020-10-16 17:07:55 +01:00
Andrew Morgan c078f9ee16 Merge commit 'b3a97d6da' into anoa/dinsic_release_1_21_x
* commit 'b3a97d6da':
  Convert some of the data store to async. (#7976)
2020-10-16 17:07:47 +01:00
Andrew Morgan 684991eff0 Merge commit '3950ae51e' into anoa/dinsic_release_1_21_x
* 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)
2020-10-16 17:07:28 +01:00
Andrew Morgan a2b8233a4e Remember mappings when we bind a 3pid using the internal sydent bind API (#66)
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.
2020-10-14 11:18:29 +01:00
Andrew Morgan 722e1c016a "Freeze" a room when the last admin of that room leaves (#59)
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.
2020-10-13 15:49:50 +01:00
Andrew Morgan 62c7b10ea5 Allow modules to create and send events into rooms (#8479)
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.
2020-10-12 13:24:15 +01:00
Andrew Morgan 11523b507b Only assert valid next_link params when provided (#65)
Bug introduced in https://github.com/matrix-org/synapse-dinsic/commit/ff91a451b

We were checking whether the `nextLink` param was valid, even if it wasn't provided. In that case, `nextLink` was `None`, which would clearly not be a valid URL.

This would prevent password reset and other operations if `nextLink` was not provided and the `next_link_domain_whitelist` config option was in use.
2020-09-29 12:02:21 +01:00
Mathieu Velten c3bca37e69 Don't push if an user account has expired (#58) 2020-09-18 16:49:36 +01:00
Andrew Morgan 8b234fb216 Swap method calls in RoomAccessTestCase.test_change_rules (#64)
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.
2020-09-18 11:37:21 +01:00
Mathieu Velten b8d7ca9946 Make all rooms noisy by default (#60) 2020-09-18 11:35:41 +01:00
Andrew Morgan 3fe1c8485b Make AccessRules use the public rooms directory instead of checking a room's 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.
2020-09-18 11:30:36 +01:00
Andrew Morgan 319d07373a Override the power levels defaults, enforce mod requirement for invites, 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.
2020-09-11 15:47:09 +01:00
Andrew Morgan 3d1c941a6e RoomAccessRules cleanup (#62)
Various cleanups of the DINUM-specific `RoomAccessRules` module, including:

* Type hints
* Docstring cleanups
* Some code cleanups
2020-09-10 19:04:34 +01:00
Andrew Morgan ff91a451b1 Add a config option for validating 'next_link' parameters against a domain 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.
2020-09-09 13:31:25 +01:00
Andrew Morgan fedb89a16c Remove duplicated error definitions, likely due to merge 2020-09-02 17:17:29 +01:00
Mathieu Velten f87bf7e3b9 TO REVERT: add user_id to presence response in client worker (#57)
It's currently expected by the Tchap clients, a fix will be deployed to them later on.
2020-08-18 19:17:57 +02:00