1
0
Commit Graph

18830 Commits

Author SHA1 Message Date
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
Brendan Abolivier
cdc67dfdc0 Merge pull request #56 from matrix-org/babolivier/dinsic_presence_user_id
Revert "Remove "user_id" from GET /presence. (#7606)"
2020-08-18 12:21:30 +01:00
Brendan Abolivier
3ab19a7d40 Update changelog.d/56.misc
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2020-08-18 11:41:23 +01:00
Brendan Abolivier
6414405034 Changelog 2020-08-18 11:30:11 +01:00
Brendan Abolivier
5fbc0362b5 Revert "Remove "user_id" from GET /presence. (#7606)"
This reverts commit a3fbc23c39.
2020-08-18 11:22:30 +01:00
Andrew Morgan
b90ecbe9e5 Merge pull request #53 from matrix-org/anoa/dinsic_release_1_18_x
Merge Synapse release v1.18.0 into 'dinsic'
2020-08-18 09:27:39 +01:00
Erik Johnston
a7bdf98d01 Rename database classes to make some sense (#8033) 2020-08-05 21:38:57 +01:00
Richard van der Hoff
0a86850ba3 Stop the parent process flushing the logs on exit (#8012)
This solves the problem that the first few lines are logged twice on matrix.org. Hopefully the comments explain it.
2020-08-05 09:35:17 +01:00
Richard van der Hoff
8b786db323 bug report template: move comments into comment (#8030) 2020-08-05 09:34:42 +01:00
Andrew Morgan
7cac9006d6 Spruce up the check-newsfragment CI output (#8024)
This PR:

* Reduces the amount of noise in the `check-newsfragment` CI output by hiding the dependency installation output by default.
* Prints a link to the changelog/debian changelog section of the contributing guide if an error is found.
2020-08-04 22:10:23 +01:00
Patrick Cloke
8ff2deda72 Fix async/await calls for broken media providers. (#8027) 2020-08-04 09:44:25 -04:00
Patrick Cloke
88a3ff12f0 Convert the SimpleHttpClient to async. (#8016) 2020-08-04 07:22:04 -04:00
Patrick Cloke
e19de43eb5 Convert streams to async. (#8014) 2020-08-04 07:21:47 -04:00
Richard van der Hoff
916cf2d439 re-implement daemonize (#8011)
This has long been something I've wanted to do. Basically the `Daemonize` code
is both too flexible and not flexible enough, in that it offers a bunch of
features that we don't use (changing UID, closing FDs in the child, logging to
syslog) and doesn't offer a bunch that we could do with (redirecting stdout/err
to a file instead of /dev/null; having the parent not exit until the child is
running).

As a first step, I've lifted the Daemonize code and removed the bits we don't
use. This should be a non-functional change. Fixing everything else will come
later.
2020-08-04 10:03:41 +01:00