1
0

Compare commits

...

2277 Commits

Author SHA1 Message Date
Brendan Abolivier 0a3d781384 Mainline some more 2022-01-26 18:01:10 +00:00
Brendan Abolivier e3de7cf6c5 Remove old register_mxid_from_3pid setting 2022-01-26 18:01:06 +00:00
Brendan Abolivier 3d78b3ad93 Add a module callback to set username at registration (#11790)
This is in the context of mainlining the Tchap fork of Synapse. Currently in Tchap usernames are derived from the user's email address (extracted from the UIA results, more specifically the m.login.email.identity step).
This change also exports the check_username method from the registration handler as part of the module API, so that a module can check if the username it's trying to generate is correct and doesn't conflict with an existing one, and fallback gracefully if not.

Co-authored-by: David Robertson <davidr@element.io>
2022-01-26 18:00:56 +00:00
Brendan Abolivier 42905edc63 Add a config flag to inhibit M_USER_IN_USE during registration (#11743)
This is mostly motivated by the tchap use case, where usernames are automatically generated from the user's email address (in a way that allows figuring out the email address from the username). Therefore, it's an issue if we respond to requests on /register and /register/available with M_USER_IN_USE, because it can potentially leak email addresses (which include the user's real name and place of work).

This commit adds a flag to inhibit the M_USER_IN_USE errors that are raised both by /register/available, and when providing a username early into the registration process. This error will still be raised if the user completes the registration process but the username conflicts. This is particularly useful when using modules (https://github.com/matrix-org/synapse/pull/11790 adds a module callback to set the username of users at registration) or SSO, since they can ensure the username is unique.

More context is available in the PR that introduced this behaviour to synapse-dinsic: matrix-org/synapse-dinsic#48 - as well as the issue in the matrix-dinsic repo: matrix-org/matrix-dinsic#476
2022-01-26 18:00:51 +00:00
David Robertson 4336c605f8 Fix another jsonschema typecheck error (#11830)
Similar to #11817.

In `_create_power_level_validator` we
- retrieve `validator`. This is a class implementing the
  `jsonschema.protocols.Validator` interface. In other words,
  `validator: Type[jsonschema.protocols.Validator]`.
- we then create an second validator class by modifying the original
  `validator`. We return that class, which is also of type
  `Type[jsonschema.protocols.Validator]`.

So the original annotation was incorrect: it claimed we were returning
an instance of jsonSchema.Draft7Validator, not the class (or a subclass)
itself. (Strictly speaking this is incorrect, because `POWER_LEVELS_SCHEMA`
isn't pinned to a particular version of JSON Schema. But there are other
complications with the type stubs if you try to fix this; I felt like
the change herein was a decent compromise that better expresses intent).

(I suspect/hope the typeshed project would welcome an effort to improve
the jsonschema stubs. Let's see if I get some spare time.)
2022-01-26 17:40:18 +00:00
Patrick Cloke c09e2326dc Ignore the jsonschema type. (#11817) 2022-01-26 17:35:09 +00:00
David Robertson ffd8dbafd2 Avoid type annotation problems in prom-client (#11834) 2022-01-26 17:33:45 +00:00
David Robertson c360840942 Deal with mypy errors w/ type-hinted pynacl 1.5.0 (#11714)
* Deal with mypy errors w/ type-hinted pynacl 1.5.0

Fixes #11644.

I really don't like that we're monkey patching pynacl SignedKey
instances with alg and version objects. But I'm too scared to make the
changes necessary right now.

(Ideally I would replace `signedjson.types.SingingKey` with a runtime class which
wraps or inherits from `nacl.signing.SigningKey`.) C.f. https://github.com/matrix-org/python-signedjson/issues/16
2022-01-26 17:29:04 +00:00
Brendan Abolivier d1fedca096 Merge pull request #119 from matrix-org/babolivier/auth_shadow
Fix divergence with mainline in the auth code
2022-01-14 16:10:08 +01:00
Brendan Abolivier 124b6ad17f Fix divergence with mainline in the auth code 2022-01-14 15:04:39 +00:00
Brendan Abolivier df3111dfba Merge pull request #118 from matrix-org/babolivier/delete_twisted_trunk_check
Remove the CI workflow to test against the Twisted trunk
2022-01-12 11:52:15 +01:00
Brendan Abolivier 6dfb6d1cc5 Remove the CI workflow to test against the Twisted trunk
We don't care about the Twisted trunk in Tchap, and any fix would need to wait a merge from mainline anyway
2022-01-12 10:37:13 +00:00
Brendan Abolivier 410314bba9 Merge pull request #114 from matrix-org/babolivier/dinsic_1.48.0
Merge Synapse v1.48.0
2021-12-08 15:58:36 +01:00
Brendan Abolivier a469ac5008 Don't use six 2021-12-06 17:20:21 +00:00
Brendan Abolivier 94191b9151 Lint 2021-12-06 17:09:10 +00:00
Brendan Abolivier 996bed00f8 Merge tag 'v1.48.0' into babolivier/dinsic_1.48.0
Synapse 1.48.0 (2021-11-30)
===========================

This release removes support for the long-deprecated `trust_identity_server_for_password_resets` configuration flag.

This release also fixes some performance issues with some background database updates introduced in Synapse 1.47.0.

No significant changes since 1.48.0rc1.

Synapse 1.48.0rc1 (2021-11-25)
==============================

Features
--------

- Experimental support for the thread relation defined in [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440). ([\#11161](https://github.com/matrix-org/synapse/issues/11161))
- Support filtering by relation senders & types per [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440). ([\#11236](https://github.com/matrix-org/synapse/issues/11236))
- Add support for the `/_matrix/client/v3` and `/_matrix/media/v3` APIs from Matrix v1.1. ([\#11318](https://github.com/matrix-org/synapse/issues/11318), [\#11371](https://github.com/matrix-org/synapse/issues/11371))
- Support the stable version of [MSC2778](https://github.com/matrix-org/matrix-doc/pull/2778): the `m.login.application_service` login type. Contributed by @tulir. ([\#11335](https://github.com/matrix-org/synapse/issues/11335))
- Add a new version of delete room admin API `DELETE /_synapse/admin/v2/rooms/<room_id>` to run it in the background. Contributed by @dklimpel. ([\#11223](https://github.com/matrix-org/synapse/issues/11223))
- Allow the admin [Delete Room API](https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#delete-room-api) to block a room without the need to join it. ([\#11228](https://github.com/matrix-org/synapse/issues/11228))
- Add an admin API to un-shadow-ban a user. ([\#11347](https://github.com/matrix-org/synapse/issues/11347))
- Add an admin API to run background database schema updates. ([\#11352](https://github.com/matrix-org/synapse/issues/11352))
- Add an admin API for blocking a room. ([\#11324](https://github.com/matrix-org/synapse/issues/11324))
- Update the JWT login type to support custom a `sub` claim. ([\#11361](https://github.com/matrix-org/synapse/issues/11361))
- Store and allow querying of arbitrary event relations. ([\#11391](https://github.com/matrix-org/synapse/issues/11391))

Bugfixes
--------

- Fix a long-standing bug wherein display names or avatar URLs containing null bytes cause an internal server error when stored in the DB. ([\#11230](https://github.com/matrix-org/synapse/issues/11230))
- Prevent [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) historical state events from being pushed to an application service via `/transactions`. ([\#11265](https://github.com/matrix-org/synapse/issues/11265))
- Fix a long-standing bug where uploading extremely thin images (e.g. 1000x1) would fail. Contributed by @Neeeflix. ([\#11288](https://github.com/matrix-org/synapse/issues/11288))
- Fix a bug, introduced in Synapse 1.46.0, which caused the `check_3pid_auth` and `on_logged_out` callbacks in legacy password authentication provider modules to not be registered. Modules using the generic module interface were not affected. ([\#11340](https://github.com/matrix-org/synapse/issues/11340))
- Fix a bug introduced in 1.41.0 where space hierarchy responses would be incorrectly reused if multiple users were to make the same request at the same time. ([\#11355](https://github.com/matrix-org/synapse/issues/11355))
- Fix a bug introduced in 1.45.0 where the `read_templates` method of the module API would error. ([\#11377](https://github.com/matrix-org/synapse/issues/11377))
- Fix an issue introduced in 1.47.0 which prevented servers re-joining rooms they had previously left, if their signing keys were replaced. ([\#11379](https://github.com/matrix-org/synapse/issues/11379))
- Fix a bug introduced in 1.13.0 where creating and publishing a room could cause errors if `room_list_publication_rules` is configured. ([\#11392](https://github.com/matrix-org/synapse/issues/11392))
- Improve performance of various background database updates. ([\#11421](https://github.com/matrix-org/synapse/issues/11421), [\#11422](https://github.com/matrix-org/synapse/issues/11422))

Improved Documentation
----------------------

- Suggest users of the Debian packages add configuration to `/etc/matrix-synapse/conf.d/` to prevent, upon upgrade, being asked to choose between their configuration and the maintainer's. ([\#11281](https://github.com/matrix-org/synapse/issues/11281))
- Fix typos in the documentation for the `username_available` admin API. Contributed by Stanislav Motylkov. ([\#11286](https://github.com/matrix-org/synapse/issues/11286))
- Add Single Sign-On, SAML and CAS pages to the documentation. ([\#11298](https://github.com/matrix-org/synapse/issues/11298))
- Change the word 'Home server' as one word 'homeserver' in documentation. ([\#11320](https://github.com/matrix-org/synapse/issues/11320))
- Fix missing quotes for wildcard domains in `federation_certificate_verification_whitelist`. ([\#11381](https://github.com/matrix-org/synapse/issues/11381))

Deprecations and Removals
-------------------------

- Remove deprecated `trust_identity_server_for_password_resets` configuration flag. ([\#11333](https://github.com/matrix-org/synapse/issues/11333), [\#11395](https://github.com/matrix-org/synapse/issues/11395))

Internal Changes
----------------

- Add type annotations to `synapse.metrics`. ([\#10847](https://github.com/matrix-org/synapse/issues/10847))
- Split out federated PDU retrieval function into a non-cached version. ([\#11242](https://github.com/matrix-org/synapse/issues/11242))
- Clean up code relating to to-device messages and sending ephemeral events to application services. ([\#11247](https://github.com/matrix-org/synapse/issues/11247))
- Fix a small typo in the error response when a relation type other than 'm.annotation' is passed to `GET /rooms/{room_id}/aggregations/{event_id}`. ([\#11278](https://github.com/matrix-org/synapse/issues/11278))
- Drop unused database tables `room_stats_historical` and `user_stats_historical`. ([\#11280](https://github.com/matrix-org/synapse/issues/11280))
- Require all files in synapse/ and tests/ to pass mypy unless specifically excluded. ([\#11282](https://github.com/matrix-org/synapse/issues/11282), [\#11285](https://github.com/matrix-org/synapse/issues/11285), [\#11359](https://github.com/matrix-org/synapse/issues/11359))
- Add missing type hints to `synapse.app`. ([\#11287](https://github.com/matrix-org/synapse/issues/11287))
- Remove unused parameters on `FederationEventHandler._check_event_auth`. ([\#11292](https://github.com/matrix-org/synapse/issues/11292))
- Add type hints to `synapse._scripts`. ([\#11297](https://github.com/matrix-org/synapse/issues/11297))
- Fix an issue which prevented the `remove_deleted_devices_from_device_inbox` background database schema update from running when updating from a recent Synapse version. ([\#11303](https://github.com/matrix-org/synapse/issues/11303))
- Add type hints to storage classes. ([\#11307](https://github.com/matrix-org/synapse/issues/11307), [\#11310](https://github.com/matrix-org/synapse/issues/11310), [\#11311](https://github.com/matrix-org/synapse/issues/11311), [\#11312](https://github.com/matrix-org/synapse/issues/11312), [\#11313](https://github.com/matrix-org/synapse/issues/11313), [\#11314](https://github.com/matrix-org/synapse/issues/11314), [\#11316](https://github.com/matrix-org/synapse/issues/11316), [\#11322](https://github.com/matrix-org/synapse/issues/11322), [\#11332](https://github.com/matrix-org/synapse/issues/11332), [\#11339](https://github.com/matrix-org/synapse/issues/11339), [\#11342](https://github.com/matrix-org/synapse/issues/11342))
- Add type hints to `synapse.util`. ([\#11321](https://github.com/matrix-org/synapse/issues/11321), [\#11328](https://github.com/matrix-org/synapse/issues/11328))
- Improve type annotations in Synapse's test suite. ([\#11323](https://github.com/matrix-org/synapse/issues/11323), [\#11330](https://github.com/matrix-org/synapse/issues/11330))
- Test that room alias deletion works as intended. ([\#11327](https://github.com/matrix-org/synapse/issues/11327))
- Add type annotations for some methods and properties in the module API. ([\#11341](https://github.com/matrix-org/synapse/issues/11341))
- Fix running `scripts-dev/complement.sh`, which was broken in v1.47.0rc1. ([\#11368](https://github.com/matrix-org/synapse/issues/11368))
- Rename internal functions for token generation to better reflect what they do. ([\#11369](https://github.com/matrix-org/synapse/issues/11369), [\#11370](https://github.com/matrix-org/synapse/issues/11370))
- Add type hints to configuration classes. ([\#11377](https://github.com/matrix-org/synapse/issues/11377))
- Publish a `develop` image to Docker Hub. ([\#11380](https://github.com/matrix-org/synapse/issues/11380))
- Keep fallback key marked as used if it's re-uploaded. ([\#11382](https://github.com/matrix-org/synapse/issues/11382))
- Use `auto_attribs` on the `attrs` class `RefreshTokenLookupResult`. ([\#11386](https://github.com/matrix-org/synapse/issues/11386))
- Rename unstable `access_token_lifetime` configuration option to `refreshable_access_token_lifetime` to make it clear it only concerns refreshable access tokens. ([\#11388](https://github.com/matrix-org/synapse/issues/11388))
- Do not run the broken MSC2716 tests when running `scripts-dev/complement.sh`. ([\#11389](https://github.com/matrix-org/synapse/issues/11389))
- Remove dead code from supporting ACME. ([\#11393](https://github.com/matrix-org/synapse/issues/11393))
- Refactor including the bundled relations when serializing an event. ([\#11408](https://github.com/matrix-org/synapse/issues/11408))
2021-12-06 16:42:57 +00:00
Brendan Abolivier da1df89cbd Merge tag 'v1.47.1' into babolivier/dinsic_1.48.0
Synapse 1.47.1 (2021-11-23)
===========================

This release fixes a security issue in the media store, affecting all prior releases of Synapse. Server administrators are encouraged to update Synapse as soon as possible. We are not aware of these vulnerabilities being exploited in the wild.

Server administrators who are unable to update Synapse may use the workarounds described in the linked GitHub Security Advisory below.

Security advisory
-----------------

The following issue is fixed in 1.47.1.

- **[GHSA-3hfw-x7gx-437c](https://github.com/matrix-org/synapse/security/advisories/GHSA-3hfw-x7gx-437c) / [CVE-2021-41281](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41281): Path traversal when downloading remote media.**

  Synapse instances with the media repository enabled can be tricked into downloading a file from a remote server into an arbitrary directory, potentially outside the media store directory.

  The last two directories and file name of the path are chosen randomly by Synapse and cannot be controlled by an attacker, which limits the impact.

  Homeservers with the media repository disabled are unaffected. Homeservers configured with a federation whitelist are also unaffected.

  Fixed by [91f2bd090](https://github.com/matrix-org/synapse/commit/91f2bd090).
2021-12-06 16:40:55 +00:00
Brendan Abolivier 954a13b3ed Fix test 2021-12-06 16:39:36 +00:00
Brendan Abolivier bbf27eb045 Merge tag 'v1.47.0' into babolivier/dinsic_1.48.0
Synapse 1.47.0 (2021-11-17)
===========================

No significant changes since 1.47.0rc3.

Synapse 1.47.0rc3 (2021-11-16)
==============================

Bugfixes
--------

- Fix a bug introduced in 1.47.0rc1 which caused worker processes to not halt startup in the presence of outstanding database migrations. ([\#11346](https://github.com/matrix-org/synapse/issues/11346))
- Fix a bug introduced in 1.47.0rc1 which prevented the 'remove deleted devices from `device_inbox` column' background process from running when updating from a recent Synapse version. ([\#11303](https://github.com/matrix-org/synapse/issues/11303), [\#11353](https://github.com/matrix-org/synapse/issues/11353))

Synapse 1.47.0rc2 (2021-11-10)
==============================

This fixes an issue with publishing the Debian packages for 1.47.0rc1.
It is otherwise identical to 1.47.0rc1.

Synapse 1.47.0rc1 (2021-11-09)
==============================

Deprecations and Removals
-------------------------

- The `user_may_create_room_with_invites` module callback is now deprecated. Please refer to the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#upgrading-to-v1470) for more information. ([\#11206](https://github.com/matrix-org/synapse/issues/11206))
- Remove deprecated admin API to delete rooms (`POST /_synapse/admin/v1/rooms/<room_id>/delete`). ([\#11213](https://github.com/matrix-org/synapse/issues/11213))

Features
--------

- Advertise support for Client-Server API r0.6.1. ([\#11097](https://github.com/matrix-org/synapse/issues/11097))
- Add search by room ID and room alias to the List Room admin API. ([\#11099](https://github.com/matrix-org/synapse/issues/11099))
- Add an `on_new_event` third-party rules callback to allow Synapse modules to act after an event has been sent into a room. ([\#11126](https://github.com/matrix-org/synapse/issues/11126))
- Add a module API method to update a user's membership in a room. ([\#11147](https://github.com/matrix-org/synapse/issues/11147))
- Add metrics for thread pool usage. ([\#11178](https://github.com/matrix-org/synapse/issues/11178))
- Support the stable room type field for [MSC3288](https://github.com/matrix-org/matrix-doc/pull/3288). ([\#11187](https://github.com/matrix-org/synapse/issues/11187))
- Add a module API method to retrieve the current state of a room. ([\#11204](https://github.com/matrix-org/synapse/issues/11204))
- Calculate a default value for `public_baseurl` based on `server_name`. ([\#11210](https://github.com/matrix-org/synapse/issues/11210))
- Add support for serving `/.well-known/matrix/server` files, to redirect federation traffic to port 443. ([\#11211](https://github.com/matrix-org/synapse/issues/11211))
- Add admin APIs to pause, start and check the status of background updates. ([\#11263](https://github.com/matrix-org/synapse/issues/11263))

Bugfixes
--------

- Fix a long-standing bug which allowed hidden devices to receive to-device messages, resulting in unnecessary database bloat. ([\#10097](https://github.com/matrix-org/synapse/issues/10097))
- Fix a long-standing bug where messages in the `device_inbox` table for deleted devices would persist indefinitely. Contributed by @dklimpel and @JohannesKleine. ([\#10969](https://github.com/matrix-org/synapse/issues/10969), [\#11212](https://github.com/matrix-org/synapse/issues/11212))
- Do not accept events if a third-party rule `check_event_allowed` callback raises an exception. ([\#11033](https://github.com/matrix-org/synapse/issues/11033))
- Fix long-standing bug where verification requests could fail in certain cases if a federation whitelist was in place but did not include your own homeserver. ([\#11129](https://github.com/matrix-org/synapse/issues/11129))
- Allow an empty list of `state_events_at_start` to be sent when using the [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint and the author of the historical messages is already part of the current room state at the given `?prev_event_id`. ([\#11188](https://github.com/matrix-org/synapse/issues/11188))
- Fix a bug introduced in Synapse 1.45.0 which prevented the `synapse_review_recent_signups` script from running. Contributed by @samuel-p. ([\#11191](https://github.com/matrix-org/synapse/issues/11191))
- Delete `to_device` messages for hidden devices that will never be read, reducing database size. ([\#11199](https://github.com/matrix-org/synapse/issues/11199))
- Fix a long-standing bug wherein a missing `Content-Type` header when downloading remote media would cause Synapse to throw an error. ([\#11200](https://github.com/matrix-org/synapse/issues/11200))
- Fix a long-standing bug which could result in serialization errors and potentially duplicate transaction data when sending ephemeral events to application services. Contributed by @Fizzadar at Beeper. ([\#11207](https://github.com/matrix-org/synapse/issues/11207))
- Fix a bug introduced in Synapse 1.35.0 which made it impossible to join rooms that return a `send_join` response containing floats. ([\#11217](https://github.com/matrix-org/synapse/issues/11217))
- Fix long-standing bug where cross signing keys were not included in the response to `/r0/keys/query` the first time a remote user was queried. ([\#11234](https://github.com/matrix-org/synapse/issues/11234))
- Fix a long-standing bug where all requests that read events from the database could get stuck as a result of losing the database connection. ([\#11240](https://github.com/matrix-org/synapse/issues/11240))
- Fix a bug preventing Synapse from being rolled back to an earlier version when using workers. ([\#11255](https://github.com/matrix-org/synapse/issues/11255), [\#11276](https://github.com/matrix-org/synapse/issues/11276))
- Fix a bug introduced in Synapse 1.37.1 which caused a remote event being processed by a worker to not get processed on restart if the worker was killed. ([\#11262](https://github.com/matrix-org/synapse/issues/11262))
- Only allow old Element/Riot Android clients to send read receipts without a request body. All other clients must include a request body as required by the specification. Contributed by @rogersheu. ([\#11157](https://github.com/matrix-org/synapse/issues/11157))

Updates to the Docker image
---------------------------

- Avoid changing user ID when started as a non-root user, and no explicit `UID` is set. ([\#11209](https://github.com/matrix-org/synapse/issues/11209))

Improved Documentation
----------------------

- Improve example HAProxy config in the docs to properly handle HTTP `Host` headers with port information. This is required for federation over port 443 to work correctly. ([\#11128](https://github.com/matrix-org/synapse/issues/11128))
- Add documentation for using Authentik as an OpenID Connect Identity Provider. Contributed by @samip5. ([\#11151](https://github.com/matrix-org/synapse/issues/11151))
- Clarify lack of support for Windows. ([\#11198](https://github.com/matrix-org/synapse/issues/11198))
- Improve code formatting and fix a few typos in docs. Contributed by @sumnerevans at Beeper. ([\#11221](https://github.com/matrix-org/synapse/issues/11221))
- Add documentation for using LemonLDAP as an OpenID Connect Identity Provider. Contributed by @l00ptr. ([\#11257](https://github.com/matrix-org/synapse/issues/11257))

Internal Changes
----------------

- Add type annotations for the `log_function` decorator. ([\#10943](https://github.com/matrix-org/synapse/issues/10943))
- Add type hints to `synapse.events`. ([\#11098](https://github.com/matrix-org/synapse/issues/11098))
- Remove and document unnecessary `RoomStreamToken` checks in application service ephemeral event code. ([\#11137](https://github.com/matrix-org/synapse/issues/11137))
- Add type hints so that `synapse.http` passes `mypy` checks. ([\#11164](https://github.com/matrix-org/synapse/issues/11164))
- Update scripts to pass Shellcheck lints. ([\#11166](https://github.com/matrix-org/synapse/issues/11166))
- Add knock information in admin export. Contributed by Rafael Gonçalves. ([\#11171](https://github.com/matrix-org/synapse/issues/11171))
- Add tests to check that `ClientIpStore.get_last_client_ip_by_device` and `get_user_ip_and_agents` combine database and in-memory data correctly. ([\#11179](https://github.com/matrix-org/synapse/issues/11179))
- Refactor `Filter` to check different fields depending on the data type. ([\#11194](https://github.com/matrix-org/synapse/issues/11194))
- Improve type hints for the relations datastore. ([\#11205](https://github.com/matrix-org/synapse/issues/11205))
- Replace outdated links in the pull request checklist with links to the rendered documentation. ([\#11225](https://github.com/matrix-org/synapse/issues/11225))
- Fix a bug in unit test `test_block_room_and_not_purge`. ([\#11226](https://github.com/matrix-org/synapse/issues/11226))
- In `ObservableDeferred`, run observers in the order they were registered. ([\#11229](https://github.com/matrix-org/synapse/issues/11229))
- Minor speed up to start up times and getting updates for groups by adding missing index to `local_group_updates.stream_id`. ([\#11231](https://github.com/matrix-org/synapse/issues/11231))
- Add `twine` and `towncrier` as dev dependencies, as they're used by the release script. ([\#11233](https://github.com/matrix-org/synapse/issues/11233))
- Allow `stream_writers.typing` config to be a list of one worker. ([\#11237](https://github.com/matrix-org/synapse/issues/11237))
- Remove debugging statement in tests. ([\#11239](https://github.com/matrix-org/synapse/issues/11239))
- Fix [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) historical messages backfilling in random order on remote homeservers. ([\#11244](https://github.com/matrix-org/synapse/issues/11244))
- Add an additional test for the `cachedList` method decorator. ([\#11246](https://github.com/matrix-org/synapse/issues/11246))
- Make minor correction to the type of `auth_checkers` callbacks. ([\#11253](https://github.com/matrix-org/synapse/issues/11253))
- Clean up trivial aspects of the Debian package build tooling. ([\#11269](https://github.com/matrix-org/synapse/issues/11269), [\#11273](https://github.com/matrix-org/synapse/issues/11273))
- Blacklist new SyTest that checks that key uploads are valid pending the validation being implemented in Synapse. ([\#11270](https://github.com/matrix-org/synapse/issues/11270))
2021-12-06 16:26:14 +00:00
Brendan Abolivier 4bbdb0180b Merge tag 'v1.46.0' into babolivier/dinsic_1.48.0
Synapse 1.46.0 (2021-11-02)
===========================

The cause of the [performance regression affecting Synapse 1.44](https://github.com/matrix-org/synapse/issues/11049) has been identified and fixed. ([\#11177](https://github.com/matrix-org/synapse/issues/11177))

Bugfixes
--------

- Fix a bug introduced in v1.46.0rc1 where URL previews of some XML documents would fail. ([\#11196](https://github.com/matrix-org/synapse/issues/11196))

Synapse 1.46.0rc1 (2021-10-27)
==============================

Features
--------

- Add support for Ubuntu 21.10 "Impish Indri". ([\#11024](https://github.com/matrix-org/synapse/issues/11024))
- Port the Password Auth Providers module interface to the new generic interface. ([\#10548](https://github.com/matrix-org/synapse/issues/10548), [\#11180](https://github.com/matrix-org/synapse/issues/11180))
- Experimental support for the thread relation defined in [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440). ([\#11088](https://github.com/matrix-org/synapse/issues/11088), [\#11181](https://github.com/matrix-org/synapse/issues/11181), [\#11192](https://github.com/matrix-org/synapse/issues/11192))
- Users admin API can now also modify user type in addition to allowing it to be set on user creation. ([\#11174](https://github.com/matrix-org/synapse/issues/11174))

Bugfixes
--------

- Newly-created public rooms are now only assigned an alias if the room's creation has not been blocked by permission settings. Contributed by @AndrewFerr. ([\#10930](https://github.com/matrix-org/synapse/issues/10930))
- Fix a long-standing bug which meant that events received over federation were sometimes incorrectly accepted into the room state. ([\#11001](https://github.com/matrix-org/synapse/issues/11001), [\#11009](https://github.com/matrix-org/synapse/issues/11009), [\#11012](https://github.com/matrix-org/synapse/issues/11012))
- Fix 500 error on `/messages` when the server accumulates more than 5 backwards extremities at a given depth for a room. ([\#11027](https://github.com/matrix-org/synapse/issues/11027))
- Fix a bug where setting a user's `external_id` via the admin API returns 500 and deletes user's existing external mappings if that external ID is already mapped. ([\#11051](https://github.com/matrix-org/synapse/issues/11051))
- Fix a long-standing bug where users excluded from the user directory were added into the directory if they belonged to a room which became public or private. ([\#11075](https://github.com/matrix-org/synapse/issues/11075))
- Fix a long-standing bug when attempting to preview URLs which are in the `windows-1252` character encoding. ([\#11077](https://github.com/matrix-org/synapse/issues/11077), [\#11089](https://github.com/matrix-org/synapse/issues/11089))
- Fix broken export-data admin command and add test script checking the command to CI. ([\#11078](https://github.com/matrix-org/synapse/issues/11078))
- Show an error when timestamp in seconds is provided to the `/purge_media_cache` Admin API. ([\#11101](https://github.com/matrix-org/synapse/issues/11101))
- Fix local users who left all their rooms being removed from the user directory, even if the `search_all_users` config option was enabled. ([\#11103](https://github.com/matrix-org/synapse/issues/11103))
- Fix a bug which caused the module API's `get_user_ip_and_agents` function to always fail on workers. `get_user_ip_and_agents` was introduced in 1.44.0 and did not function correctly on worker processes at the time. ([\#11112](https://github.com/matrix-org/synapse/issues/11112))
- Identity server connection is no longer ignoring `ip_range_whitelist`. ([\#11120](https://github.com/matrix-org/synapse/issues/11120))
- Fix a bug introduced in Synapse 1.45.0 breaking the configuration file parsing script. ([\#11145](https://github.com/matrix-org/synapse/issues/11145))
- Fix a performance regression introduced in 1.44.0 which could cause client requests to time out when making large numbers of outbound requests. ([\#11177](https://github.com/matrix-org/synapse/issues/11177), [\#11190](https://github.com/matrix-org/synapse/issues/11190))
- Resolve and share `state_groups` for all [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) historical events in batch. ([\#10975](https://github.com/matrix-org/synapse/issues/10975))

Improved Documentation
----------------------

- Fix broken links relating to module API deprecation in the upgrade notes. ([\#11069](https://github.com/matrix-org/synapse/issues/11069))
- Add more information about what happens when a user is deactivated. ([\#11083](https://github.com/matrix-org/synapse/issues/11083))
- Clarify the the sample log config can be copied from the documentation without issue. ([\#11092](https://github.com/matrix-org/synapse/issues/11092))
- Update the admin API documentation with an updated list of the characters allowed in registration tokens. ([\#11093](https://github.com/matrix-org/synapse/issues/11093))
- Document Synapse's behaviour when dealing with multiple modules registering the same callbacks and/or handlers for the same HTTP endpoints. ([\#11096](https://github.com/matrix-org/synapse/issues/11096))
- Fix instances of `[example]{.title-ref}` in the upgrade documentation as a result of prior RST to Markdown conversion. ([\#11118](https://github.com/matrix-org/synapse/issues/11118))
- Document the version of Synapse each module callback was introduced in. ([\#11132](https://github.com/matrix-org/synapse/issues/11132))
- Document the version of Synapse that introduced each module API method. ([\#11183](https://github.com/matrix-org/synapse/issues/11183))

Internal Changes
----------------
- Fix spurious warnings about losing the logging context on the `ReplicationCommandHandler` when losing the replication connection. ([\#10984](https://github.com/matrix-org/synapse/issues/10984))
- Include rejected status when we log events. ([\#11008](https://github.com/matrix-org/synapse/issues/11008))
- Add some extra logging to the event persistence code. ([\#11014](https://github.com/matrix-org/synapse/issues/11014))
- Rearrange the internal workings of the incremental user directory updates. ([\#11035](https://github.com/matrix-org/synapse/issues/11035))
- Fix a long-standing bug where users excluded from the directory could still be added to the `users_who_share_private_rooms` table after a regular user joins a private room. ([\#11143](https://github.com/matrix-org/synapse/issues/11143))
- Add and improve type hints. ([\#10972](https://github.com/matrix-org/synapse/issues/10972), [\#11055](https://github.com/matrix-org/synapse/issues/11055), [\#11066](https://github.com/matrix-org/synapse/issues/11066), [\#11076](https://github.com/matrix-org/synapse/issues/11076), [\#11095](https://github.com/matrix-org/synapse/issues/11095), [\#11109](https://github.com/matrix-org/synapse/issues/11109), [\#11121](https://github.com/matrix-org/synapse/issues/11121), [\#11146](https://github.com/matrix-org/synapse/issues/11146))
- Mark the Synapse package as containing type annotations and fix export declarations so that Synapse pluggable modules may be type checked against Synapse. ([\#11054](https://github.com/matrix-org/synapse/issues/11054))
- Remove dead code from `MediaFilePaths`. ([\#11056](https://github.com/matrix-org/synapse/issues/11056))
- Be more lenient when parsing oEmbed response versions. ([\#11065](https://github.com/matrix-org/synapse/issues/11065))
- Create a separate module for the retention configuration. ([\#11070](https://github.com/matrix-org/synapse/issues/11070))
- Clean up some of the federation event authentication code for clarity. ([\#11115](https://github.com/matrix-org/synapse/issues/11115), [\#11116](https://github.com/matrix-org/synapse/issues/11116), [\#11122](https://github.com/matrix-org/synapse/issues/11122))
- Add docstrings and comments to the application service ephemeral event sending code. ([\#11138](https://github.com/matrix-org/synapse/issues/11138))
- Update the `sign_json` script to support inline configuration of the signing key. ([\#11139](https://github.com/matrix-org/synapse/issues/11139))
- Fix broken link in the docker image README. ([\#11144](https://github.com/matrix-org/synapse/issues/11144))
- Always dump logs from unit tests during CI runs. ([\#11068](https://github.com/matrix-org/synapse/issues/11068))
- Add tests for `MediaFilePaths` class. ([\#11057](https://github.com/matrix-org/synapse/issues/11057))
- Simplify the user admin API tests. ([\#11048](https://github.com/matrix-org/synapse/issues/11048))
- Add a test for the workaround introduced in [\#11042](https://github.com/matrix-org/synapse/pull/11042) concerning the behaviour of third-party rule modules and `SynapseError`s. ([\#11071](https://github.com/matrix-org/synapse/issues/11071))
2021-12-06 16:25:01 +00:00
Brendan Abolivier 21d74d5450 Merge tag 'v1.45.1' into babolivier/dinsic_1.48.0
Synapse 1.45.1 (2021-10-20)
===========================

Bugfixes
--------

- Revert change to counting of deactivated users towards the monthly active users limit, introduced in 1.45.0rc1. ([\#11127](https://github.com/matrix-org/synapse/issues/11127))
2021-12-06 16:23:50 +00:00
Brendan Abolivier 22630d35dd Lint 2021-12-06 16:21:14 +00:00
Brendan Abolivier 783a4c9dfe Merge tag 'v1.45.0' into babolivier/dinsic_1.48.0
Synapse 1.45.0 (2021-10-19)
===========================

No functional changes since Synapse 1.45.0rc2.

Known Issues
------------

- A suspected [performance regression](https://github.com/matrix-org/synapse/issues/11049) which was first reported after the release of 1.44.0 remains unresolved.

  We have not been able to identify a probable cause. Affected users report that setting up a federation sender worker appears to alleviate symptoms of the regression.

Improved Documentation
----------------------

- Reword changelog to clarify concerns about a suspected performance regression in 1.44.0. ([\#11117](https://github.com/matrix-org/synapse/issues/11117))

Synapse 1.45.0rc2 (2021-10-14)
==============================

This release candidate [fixes](https://github.com/matrix-org/synapse/issues/11053) a user directory [bug](https://github.com/matrix-org/synapse/issues/11025) present in 1.45.0rc1.

Known Issues
------------

- A suspected [performance regression](https://github.com/matrix-org/synapse/issues/11049) which was first reported after the release of 1.44.0 remains unresolved.

  We have not been able to identify a probable cause. Affected users report that setting up a federation sender worker appears to alleviate symptoms of the regression.

Bugfixes
--------

- Fix a long-standing bug when using multiple event persister workers where events were not correctly sent down `/sync` due to a race. ([\#11045](https://github.com/matrix-org/synapse/issues/11045))
- Fix a bug introduced in Synapse 1.45.0rc1 where the user directory would stop updating if it processed an event from a
  user not in the `users` table. ([\#11053](https://github.com/matrix-org/synapse/issues/11053))
- Fix a bug introduced in Synapse 1.44.0 when logging errors during oEmbed processing. ([\#11061](https://github.com/matrix-org/synapse/issues/11061))

Internal Changes
----------------

- Add an 'approximate difference' method to `StateFilter`. ([\#10825](https://github.com/matrix-org/synapse/issues/10825))
- Fix inconsistent behavior of `get_last_client_by_ip` when reporting data that has not been stored in the database yet. ([\#10970](https://github.com/matrix-org/synapse/issues/10970))
- Fix a bug introduced in Synapse 1.21.0 that causes opentracing and Prometheus metrics for replication requests to be measured incorrectly. ([\#10996](https://github.com/matrix-org/synapse/issues/10996))
- Ensure that cache config tests do not share state. ([\#11036](https://github.com/matrix-org/synapse/issues/11036))

Synapse 1.45.0rc1 (2021-10-12)
==============================

**Note:** Media storage providers module that read from Synapse's configuration need changes as of this version, see the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#upgrading-to-v1450) for more information.

Known Issues
------------

- We are investigating [a performance issue](https://github.com/matrix-org/synapse/issues/11049) which was reported after the release of 1.44.0.
- We are aware of [a bug](https://github.com/matrix-org/synapse/issues/11025) with the user directory when using application services. A second release candidate is expected which will resolve this.

Features
--------

- Add [MSC3069](https://github.com/matrix-org/matrix-doc/pull/3069) support to `/account/whoami`. ([\#9655](https://github.com/matrix-org/synapse/issues/9655))
- Support autodiscovery of oEmbed previews. ([\#10822](https://github.com/matrix-org/synapse/issues/10822))
- Add a `user_may_send_3pid_invite` spam checker callback for modules to allow or deny 3PID invites. ([\#10894](https://github.com/matrix-org/synapse/issues/10894))
- Add a spam checker callback to allow or deny room joins. ([\#10910](https://github.com/matrix-org/synapse/issues/10910))
- Include an `update_synapse_database` script in the distribution. Contributed by @Fizzadar at Beeper. ([\#10954](https://github.com/matrix-org/synapse/issues/10954))
- Include exception information in JSON logging output. Contributed by @Fizzadar at Beeper. ([\#11028](https://github.com/matrix-org/synapse/issues/11028))

Bugfixes
--------

- Fix a minor bug in the response to `/_matrix/client/r0/voip/turnServer`. Contributed by @lukaslihotzki. ([\#10922](https://github.com/matrix-org/synapse/issues/10922))
- Fix a bug where empty `yyyy-mm-dd/` directories would be left behind in the media store's `url_cache_thumbnails/` directory. ([\#10924](https://github.com/matrix-org/synapse/issues/10924))
- Fix a bug introduced in Synapse v1.40.0 where the signature checks for room version 8 and 9 could be applied to earlier room versions in some situations. ([\#10927](https://github.com/matrix-org/synapse/issues/10927))
- Fix a long-standing bug wherein deactivated users still count towards the monthly active users limit. ([\#10947](https://github.com/matrix-org/synapse/issues/10947))
- Fix a long-standing bug which meant that events received over federation were sometimes incorrectly accepted into the room state. ([\#10956](https://github.com/matrix-org/synapse/issues/10956))
- Fix a long-standing bug where rebuilding the user directory wouldn't exclude support and deactivated users. ([\#10960](https://github.com/matrix-org/synapse/issues/10960))
- Fix [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint rejecting subsequent batches with unknown batch ID error in existing room versions from the room creator. ([\#10962](https://github.com/matrix-org/synapse/issues/10962))
- Fix a bug that could leak local users' per-room nicknames and avatars when the user directory is rebuilt. ([\#10981](https://github.com/matrix-org/synapse/issues/10981))
- Fix a long-standing bug where the remainder of a batch of user directory changes would be silently dropped if the server left a room early in the batch. ([\#10982](https://github.com/matrix-org/synapse/issues/10982))
- Correct a bugfix introduced in Synapse v1.44.0 that would catch the wrong error if a connection is lost before a response could be written to it. ([\#10995](https://github.com/matrix-org/synapse/issues/10995))
- Fix a long-standing bug where local users' per-room nicknames/avatars were visible to anyone who could see you in the user directory. ([\#11002](https://github.com/matrix-org/synapse/issues/11002))
- Fix a long-standing bug where a user's per-room nickname/avatar would overwrite their profile in the user directory when a room was made public. ([\#11003](https://github.com/matrix-org/synapse/issues/11003))
- Work around a regression, introduced in Synapse v1.39.0, that caused `SynapseError`s raised by the experimental third-party rules module callback `check_event_allowed` to be ignored. ([\#11042](https://github.com/matrix-org/synapse/issues/11042))
- Fix a bug in [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) insertion events in rooms that could cause cross-talk/conflicts between batches. ([\#10877](https://github.com/matrix-org/synapse/issues/10877))

Improved Documentation
----------------------

- Change wording ("reference homeserver") in Synapse repository documentation. Contributed by @maxkratz. ([\#10971](https://github.com/matrix-org/synapse/issues/10971))
- Fix a dead URL in development documentation (SAML) and change wording from "Riot" to "Element". Contributed by @maxkratz. ([\#10973](https://github.com/matrix-org/synapse/issues/10973))
- Add additional content to the Welcome and Overview page of the documentation. ([\#10990](https://github.com/matrix-org/synapse/issues/10990))
- Update links to MSCs in documentation. Contributed by @dklimpel. ([\#10991](https://github.com/matrix-org/synapse/issues/10991))

Internal Changes
----------------

- Improve type hinting in `synapse.util`. ([\#10888](https://github.com/matrix-org/synapse/issues/10888))
- Add further type hints to `synapse.storage.util`. ([\#10892](https://github.com/matrix-org/synapse/issues/10892))
- Fix type hints to be compatible with an upcoming change to Twisted. ([\#10895](https://github.com/matrix-org/synapse/issues/10895))
- Update utility code to handle C implementations of frozendict. ([\#10902](https://github.com/matrix-org/synapse/issues/10902))
- Drop old functionality which maintained database compatibility with Synapse versions before v1.31. ([\#10903](https://github.com/matrix-org/synapse/issues/10903))
- Clean-up configuration helper classes for the `ServerConfig` class. ([\#10915](https://github.com/matrix-org/synapse/issues/10915))
- Use direct references to config flags. ([\#10916](https://github.com/matrix-org/synapse/issues/10916), [\#10959](https://github.com/matrix-org/synapse/issues/10959), [\#10985](https://github.com/matrix-org/synapse/issues/10985))
- Clean up some of the federation event authentication code for clarity. ([\#10926](https://github.com/matrix-org/synapse/issues/10926), [\#10940](https://github.com/matrix-org/synapse/issues/10940), [\#10986](https://github.com/matrix-org/synapse/issues/10986), [\#10987](https://github.com/matrix-org/synapse/issues/10987), [\#10988](https://github.com/matrix-org/synapse/issues/10988), [\#11010](https://github.com/matrix-org/synapse/issues/11010), [\#11011](https://github.com/matrix-org/synapse/issues/11011))
- Refactor various parts of the codebase to use `RoomVersion` objects instead of room version identifier strings. ([\#10934](https://github.com/matrix-org/synapse/issues/10934))
- Refactor user directory tests in preparation for upcoming changes. ([\#10935](https://github.com/matrix-org/synapse/issues/10935))
- Include the event id in the logcontext when handling PDUs received over federation. ([\#10936](https://github.com/matrix-org/synapse/issues/10936))
- Fix logged errors in unit tests. ([\#10939](https://github.com/matrix-org/synapse/issues/10939))
- Fix a broken test to ensure that consent configuration works during registration. ([\#10945](https://github.com/matrix-org/synapse/issues/10945))
- Add type hints to filtering classes. ([\#10958](https://github.com/matrix-org/synapse/issues/10958))
- Add type-hint to `HomeserverTestcase.setup_test_homeserver`. ([\#10961](https://github.com/matrix-org/synapse/issues/10961))
- Fix the test utility function `create_room_as` so that `is_public=True` will explicitly set the `visibility` parameter of room creation requests to `public`. Contributed by @AndrewFerr. ([\#10963](https://github.com/matrix-org/synapse/issues/10963))
- Make the release script more robust and transparent. ([\#10966](https://github.com/matrix-org/synapse/issues/10966))
- Refactor [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` mega function into smaller handler functions. ([\#10974](https://github.com/matrix-org/synapse/issues/10974))
- Log stack traces when a missing opentracing span is detected. ([\#10983](https://github.com/matrix-org/synapse/issues/10983))
- Update GHA config to run tests against Python 3.10 and PostgreSQL 14. ([\#10992](https://github.com/matrix-org/synapse/issues/10992))
- Fix a long-standing bug where `ReadWriteLock`s could drop logging contexts on exit. ([\#10993](https://github.com/matrix-org/synapse/issues/10993))
- Add a `CODEOWNERS` file to automatically request reviews from the `@matrix-org/synapse-core` team on new pull requests. ([\#10994](https://github.com/matrix-org/synapse/issues/10994))
- Add further type hints to `synapse.state`. ([\#11004](https://github.com/matrix-org/synapse/issues/11004))
- Remove the deprecated `BaseHandler` object. ([\#11005](https://github.com/matrix-org/synapse/issues/11005))
- Bump mypy version for CI to 0.910, and pull in new type stubs for dependencies. ([\#11006](https://github.com/matrix-org/synapse/issues/11006))
- Fix CI to run the unit tests without optional deps. ([\#11017](https://github.com/matrix-org/synapse/issues/11017))
- Ensure that cache config tests do not share state. ([\#11019](https://github.com/matrix-org/synapse/issues/11019))
- Add additional type hints to `synapse.server_notices`. ([\#11021](https://github.com/matrix-org/synapse/issues/11021))
- Add additional type hints for `synapse.push`. ([\#11023](https://github.com/matrix-org/synapse/issues/11023))
- When installing the optional developer dependencies, also include the dependencies needed for type-checking and unit testing. ([\#11034](https://github.com/matrix-org/synapse/issues/11034))
- Remove unnecessary list comprehension from `synapse_port_db` to satisfy code style requirements. ([\#11043](https://github.com/matrix-org/synapse/issues/11043))
2021-12-06 15:50:04 +00:00
Brendan Abolivier ad44369982 Merge tag 'v1.44.0' into babolivier/dinsic_1.48.0
Synapse 1.44.0 (2021-10-05)
===========================

No significant changes since 1.44.0rc3.

Synapse 1.44.0rc3 (2021-10-04)
==============================

Bugfixes
--------

- Fix a bug introduced in Synapse v1.40.0 where changing a user's display name or avatar in a restricted room would cause an authentication error. ([\#10933](https://github.com/matrix-org/synapse/issues/10933))
- Fix `/admin/whois/{user_id}` endpoint, which was broken in v1.44.0rc1. ([\#10968](https://github.com/matrix-org/synapse/issues/10968))

Synapse 1.44.0rc2 (2021-09-30)
==============================

Bugfixes
--------

- Fix a bug introduced in v1.44.0rc1 which caused the experimental [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint to return a 500 error. ([\#10938](https://github.com/matrix-org/synapse/issues/10938))
- Fix a bug introduced in v1.44.0rc1 which prevented sending presence events to application services. ([\#10944](https://github.com/matrix-org/synapse/issues/10944))

Improved Documentation
----------------------

- Minor updates to the installation instructions. ([\#10919](https://github.com/matrix-org/synapse/issues/10919))

Synapse 1.44.0rc1 (2021-09-29)
==============================

Features
--------

- Only allow the [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send?chunk_id=xxx` endpoint to connect to an already existing insertion event. ([\#10776](https://github.com/matrix-org/synapse/issues/10776))
- Improve oEmbed URL previews by processing the author name, photo, and video information. ([\#10814](https://github.com/matrix-org/synapse/issues/10814), [\#10819](https://github.com/matrix-org/synapse/issues/10819))
- Speed up responding with large JSON objects to requests. ([\#10868](https://github.com/matrix-org/synapse/issues/10868), [\#10905](https://github.com/matrix-org/synapse/issues/10905))
- Add a `user_may_create_room_with_invites` spam checker callback to allow modules to allow or deny a room creation request based on the invites and/or 3PID invites it includes. ([\#10898](https://github.com/matrix-org/synapse/issues/10898))

Bugfixes
--------

- Fix a long-standing bug that caused an `AssertionError` when purging history in certain rooms. Contributed by @Kokokokoka. ([\#10690](https://github.com/matrix-org/synapse/issues/10690))
- Fix a long-standing bug which caused deactivated users that were later reactivated to be missing from the user directory. ([\#10782](https://github.com/matrix-org/synapse/issues/10782))
- Fix a long-standing bug that caused unbanning a user by sending a membership event to fail. Contributed by @aaronraimist. ([\#10807](https://github.com/matrix-org/synapse/issues/10807))
- Fix a long-standing bug where logging contexts would go missing when federation requests time out. ([\#10810](https://github.com/matrix-org/synapse/issues/10810))
- Fix a long-standing bug causing an error in the deprecated `/initialSync` endpoint when using the undocumented `from` and `to` parameters. ([\#10827](https://github.com/matrix-org/synapse/issues/10827))
- Fix a bug causing the `remove_stale_pushers` background job to repeatedly fail and log errors. This bug affected Synapse servers that had been upgraded from version 1.28 or older and are using SQLite. ([\#10843](https://github.com/matrix-org/synapse/issues/10843))
- Fix a long-standing bug in Unicode support of the room search admin API breaking search for rooms with non-ASCII characters. ([\#10859](https://github.com/matrix-org/synapse/issues/10859))
- Fix a bug introduced in Synapse 1.37.0 which caused `knock` membership events which we sent to remote servers to be incorrectly stored in the local database. ([\#10873](https://github.com/matrix-org/synapse/issues/10873))
- Fix invalidating one-time key count cache after claiming keys. The bug was introduced in Synapse v1.41.0. Contributed by Tulir at Beeper. ([\#10875](https://github.com/matrix-org/synapse/issues/10875))
- Fix a long-standing bug causing application service users to be subject to MAU blocking if the MAU limit had been reached, even if configured not to be blocked. ([\#10881](https://github.com/matrix-org/synapse/issues/10881))
- Fix a long-standing bug which could cause events pulled over federation to be incorrectly rejected. ([\#10907](https://github.com/matrix-org/synapse/issues/10907))
- Fix a long-standing bug causing URL cache files to be stored in storage providers. Server admins may safely delete the `url_cache/` and `url_cache_thumbnails/` directories from any configured storage providers to reclaim space. ([\#10911](https://github.com/matrix-org/synapse/issues/10911))
- Fix a long-standing bug leading to race conditions when creating media store and config directories. ([\#10913](https://github.com/matrix-org/synapse/issues/10913))

Improved Documentation
----------------------

- Fix some crashes in the Module API example code, by adding JSON encoding/decoding. ([\#10845](https://github.com/matrix-org/synapse/issues/10845))
- Add developer documentation about experimental configuration flags. ([\#10865](https://github.com/matrix-org/synapse/issues/10865))
- Properly remove deleted files from GitHub pages when generating the documentation. ([\#10869](https://github.com/matrix-org/synapse/issues/10869))

Internal Changes
----------------

- Fix GitHub Actions config so we can run sytest on synapse from parallel branches. ([\#10659](https://github.com/matrix-org/synapse/issues/10659))
- Split out [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) meta events to their own fields in the `/batch_send` response. ([\#10777](https://github.com/matrix-org/synapse/issues/10777))
- Add missing type hints to REST servlets. ([\#10785](https://github.com/matrix-org/synapse/issues/10785), [\#10817](https://github.com/matrix-org/synapse/issues/10817))
- Simplify the internal logic which maintains the user directory database tables. ([\#10796](https://github.com/matrix-org/synapse/issues/10796))
- Use direct references to config flags. ([\#10812](https://github.com/matrix-org/synapse/issues/10812), [\#10885](https://github.com/matrix-org/synapse/issues/10885), [\#10893](https://github.com/matrix-org/synapse/issues/10893), [\#10897](https://github.com/matrix-org/synapse/issues/10897))
- Specify the type of token in generic "Invalid token" error messages. ([\#10815](https://github.com/matrix-org/synapse/issues/10815))
- Make `StateFilter` frozen so it is hashable. ([\#10816](https://github.com/matrix-org/synapse/issues/10816))
- Fix a long-standing bug where an `m.room.message` event containing a null byte would cause an internal server error. ([\#10820](https://github.com/matrix-org/synapse/issues/10820))
- Add type hints to the state database. ([\#10823](https://github.com/matrix-org/synapse/issues/10823))
- Opt out of cache expiry for `get_users_who_share_room_with_user`, to hopefully improve `/sync` performance when you
  haven't synced recently. ([\#10826](https://github.com/matrix-org/synapse/issues/10826))
- Track cache eviction rates more finely in Prometheus's monitoring. ([\#10829](https://github.com/matrix-org/synapse/issues/10829))
- Add missing type hints to `synapse.handlers`. ([\#10831](https://github.com/matrix-org/synapse/issues/10831), [\#10856](https://github.com/matrix-org/synapse/issues/10856))
- Extend the Module API to let plug-ins check whether an ID is local and to access IP + User Agent data. ([\#10833](https://github.com/matrix-org/synapse/issues/10833))
- Factor out PNG image data to a constant to be used in several tests. ([\#10834](https://github.com/matrix-org/synapse/issues/10834))
- Add a test to ensure state events sent by modules get persisted correctly. ([\#10835](https://github.com/matrix-org/synapse/issues/10835))
- Rename [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) fields and event types from `chunk` to `batch` to match the `/batch_send` endpoint. ([\#10838](https://github.com/matrix-org/synapse/issues/10838))
- Rename [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` query parameter from `?prev_event` to more obvious usage with `?prev_event_id`. ([\#10839](https://github.com/matrix-org/synapse/issues/10839))
- Add type hints to `synapse.http.site`. ([\#10867](https://github.com/matrix-org/synapse/issues/10867))
- Include outlier status when we log V2 or V3 events. ([\#10879](https://github.com/matrix-org/synapse/issues/10879))
- Break down Grafana's cache expiry time series based on reason for eviction, c.f. [\#10829](https://github.com/matrix-org/synapse/issues/10829). ([\#10880](https://github.com/matrix-org/synapse/issues/10880))
- Clean up some of the federation event authentication code for clarity. ([\#10883](https://github.com/matrix-org/synapse/issues/10883), [\#10884](https://github.com/matrix-org/synapse/issues/10884), [\#10896](https://github.com/matrix-org/synapse/issues/10896), [\#10901](https://github.com/matrix-org/synapse/issues/10901))
- Allow the `.` and `~` characters when creating registration tokens as per the change to [MSC3231](https://github.com/matrix-org/matrix-doc/pull/3231). ([\#10887](https://github.com/matrix-org/synapse/issues/10887))
- Clean up some unnecessary parentheses in places around the codebase. ([\#10889](https://github.com/matrix-org/synapse/issues/10889))
- Improve type hinting in the user directory code. ([\#10891](https://github.com/matrix-org/synapse/issues/10891))
- Update development testing script `test_postgresql.sh` to use a supported Python version and make re-runs quicker. ([\#10906](https://github.com/matrix-org/synapse/issues/10906))
- Document and summarize changes in schema version `61` – `64`. ([\#10917](https://github.com/matrix-org/synapse/issues/10917))
- Update release script to sign the newly created git tags. ([\#10925](https://github.com/matrix-org/synapse/issues/10925))
- Fix Debian builds due to `dh-virtualenv` no longer being able to build their docs. ([\#10931](https://github.com/matrix-org/synapse/issues/10931))
2021-12-06 12:36:36 +00:00
Brendan Abolivier 14656fe03f Merge tag 'v1.43.0' into babolivier/dinsic_1.48.0 2021-12-06 12:28:25 +00:00
Brendan Abolivier 1f5829dd7f Merge tag 'v1.42.0' into babolivier/dinsic_1.48.0
Synapse 1.42.0 (2021-09-07)
===========================

This version of Synapse removes deprecated room-management admin APIs, removes out-of-date email pushers, and improves error handling for fallback templates for user-interactive authentication. For more information on these points, server administrators are encouraged to read [the upgrade notes](docs/upgrade.md#upgrading-to-v1420).

No significant changes since 1.42.0rc2.

Synapse 1.42.0rc2 (2021-09-06)
==============================

Features
--------

- Support room version 9 from [MSC3375](https://github.com/matrix-org/matrix-doc/pull/3375). ([\#10747](https://github.com/matrix-org/synapse/issues/10747))

Internal Changes
----------------

- Print a warning when using one of the deprecated `template_dir` settings. ([\#10768](https://github.com/matrix-org/synapse/issues/10768))

Synapse 1.42.0rc1 (2021-09-01)
==============================

Features
--------

- Add support for [MSC3231](https://github.com/matrix-org/matrix-doc/pull/3231): Token authenticated registration. Users can be required to submit a token during registration to authenticate themselves. Contributed by Callum Brown. ([\#10142](https://github.com/matrix-org/synapse/issues/10142))
- Add support for [MSC3283](https://github.com/matrix-org/matrix-doc/pull/3283): Expose `enable_set_displayname` in capabilities. ([\#10452](https://github.com/matrix-org/synapse/issues/10452))
- Port the `PresenceRouter` module interface to the new generic interface. ([\#10524](https://github.com/matrix-org/synapse/issues/10524))
- Add pagination to the spaces summary based on updates to [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946). ([\#10613](https://github.com/matrix-org/synapse/issues/10613), [\#10725](https://github.com/matrix-org/synapse/issues/10725))

Bugfixes
--------

- Validate new `m.room.power_levels` events. Contributed by @aaronraimist. ([\#10232](https://github.com/matrix-org/synapse/issues/10232))
- Display an error on User-Interactive Authentication fallback pages when authentication fails. Contributed by Callum Brown. ([\#10561](https://github.com/matrix-org/synapse/issues/10561))
- Remove pushers when deleting an e-mail address from an account. Pushers for old unlinked emails will also be deleted. ([\#10581](https://github.com/matrix-org/synapse/issues/10581), [\#10734](https://github.com/matrix-org/synapse/issues/10734))
- Reject Client-Server `/keys/query` requests which provide `device_ids` incorrectly. ([\#10593](https://github.com/matrix-org/synapse/issues/10593))
- Rooms with unsupported room versions are no longer returned via `/sync`. ([\#10644](https://github.com/matrix-org/synapse/issues/10644))
- Enforce the maximum length for per-room display names and avatar URLs. ([\#10654](https://github.com/matrix-org/synapse/issues/10654))
- Fix a bug which caused the `synapse_user_logins_total` Prometheus metric not to be correctly initialised on restart. ([\#10677](https://github.com/matrix-org/synapse/issues/10677))
- Improve `ServerNoticeServlet` to avoid duplicate requests and add unit tests. ([\#10679](https://github.com/matrix-org/synapse/issues/10679))
- Fix long-standing issue which caused an error when a thumbnail is requested and there are multiple thumbnails with the same quality rating. ([\#10684](https://github.com/matrix-org/synapse/issues/10684))
- Fix a regression introduced in v1.41.0 which affected the performance of concurrent fetches of large sets of events, in extreme cases causing the process to hang. ([\#10703](https://github.com/matrix-org/synapse/issues/10703))
- Fix a regression introduced in Synapse 1.41 which broke email transmission on Systems using older versions of the Twisted library. ([\#10713](https://github.com/matrix-org/synapse/issues/10713))

Improved Documentation
----------------------

- Add documentation on how to connect Django with Synapse using OpenID Connect and django-oauth-toolkit. Contributed by @HugoDelval. ([\#10192](https://github.com/matrix-org/synapse/issues/10192))
- Advertise https://matrix-org.github.io/synapse documentation in the `README` and `CONTRIBUTING` files. ([\#10595](https://github.com/matrix-org/synapse/issues/10595))
- Fix some of the titles not rendering in the OpenID Connect documentation. ([\#10639](https://github.com/matrix-org/synapse/issues/10639))
- Minor clarifications to the documentation for reverse proxies. ([\#10708](https://github.com/matrix-org/synapse/issues/10708))
- Remove table of contents from the top of installation and contributing documentation pages. ([\#10711](https://github.com/matrix-org/synapse/issues/10711))

Deprecations and Removals
-------------------------

- Remove deprecated Shutdown Room and Purge Room Admin API. ([\#8830](https://github.com/matrix-org/synapse/issues/8830))

Internal Changes
----------------

- Improve type hints for the proxy agent and SRV resolver modules. Contributed by @dklimpel. ([\#10608](https://github.com/matrix-org/synapse/issues/10608))
- Clean up some of the federation event authentication code for clarity. ([\#10614](https://github.com/matrix-org/synapse/issues/10614), [\#10615](https://github.com/matrix-org/synapse/issues/10615), [\#10624](https://github.com/matrix-org/synapse/issues/10624), [\#10640](https://github.com/matrix-org/synapse/issues/10640))
- Add a comment asking developers to leave a reason when bumping the database schema version. ([\#10621](https://github.com/matrix-org/synapse/issues/10621))
- Remove not needed database updates in modify user admin API. ([\#10627](https://github.com/matrix-org/synapse/issues/10627))
- Convert room member storage tuples to `attrs` classes. ([\#10629](https://github.com/matrix-org/synapse/issues/10629), [\#10642](https://github.com/matrix-org/synapse/issues/10642))
- Use auto-attribs for the attrs classes used in sync. ([\#10630](https://github.com/matrix-org/synapse/issues/10630))
- Make `backfill` and `get_missing_events` use the same codepath. ([\#10645](https://github.com/matrix-org/synapse/issues/10645))
- Improve the performance of the `/hierarchy` API (from [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946)) by caching responses received over federation. ([\#10647](https://github.com/matrix-org/synapse/issues/10647))
- Run a nightly CI build against Twisted trunk. ([\#10651](https://github.com/matrix-org/synapse/issues/10651), [\#10672](https://github.com/matrix-org/synapse/issues/10672))
- Do not print out stack traces for network errors when fetching data over federation. ([\#10662](https://github.com/matrix-org/synapse/issues/10662))
- Simplify tests for device admin rest API. ([\#10664](https://github.com/matrix-org/synapse/issues/10664))
- Add missing type hints to REST servlets. ([\#10665](https://github.com/matrix-org/synapse/issues/10665), [\#10666](https://github.com/matrix-org/synapse/issues/10666), [\#10674](https://github.com/matrix-org/synapse/issues/10674))
- Flatten the `tests.synapse.rests` package by moving the contents of `v1` and `v2_alpha` into the parent. ([\#10667](https://github.com/matrix-org/synapse/issues/10667))
- Update `complement.sh` to rebuild the base Docker image when run with workers. ([\#10686](https://github.com/matrix-org/synapse/issues/10686))
- Split the event-processing methods in `FederationHandler` into a separate `FederationEventHandler`. ([\#10692](https://github.com/matrix-org/synapse/issues/10692))
- Remove unused `compare_digest` function. ([\#10706](https://github.com/matrix-org/synapse/issues/10706))
2021-12-06 12:00:41 +00:00
Brendan Abolivier 4737a7fd11 Remove DomainRuleChecker module (#113)
The module has now moved to https://github.com/matrix-org/synapse-domain-rule-checker

__Note to ops__:

To deploy this change, the module needs to be installed in addition to Synapse (from the aforementioned repo, or the PyPI project mentioned its readme). The configuration doesn't change besides a) `default` is renamed into `can_invite_if_not_in_domain_mapping` and b) the module's configuration has moved to the `modules` section of the configuration file (though that was already the case as of https://github.com/matrix-org/synapse-dinsic/pull/108).
2021-12-06 11:23:04 +01:00
Brendan Abolivier e713855dca Merge trust_identity_server_for_password_resets PRs 2021-11-30 11:48:06 +00:00
Brendan Abolivier f663426804 Move notices up 2021-11-30 11:26:18 +00:00
Brendan Abolivier 3d831415cc Fixup changelog 2021-11-30 11:25:11 +00:00
Brendan Abolivier 4bdad80de1 1.48.0 2021-11-30 11:24:21 +00:00
Brendan Abolivier c54c9df286 Fix docker hub name 2021-11-25 16:22:54 +00:00
Brendan Abolivier d4dcc0524f Incorporate review from synapse-dev 2021-11-25 16:21:00 +00:00
Brendan Abolivier b757b68454 Fixup changelog 2021-11-25 16:07:23 +00:00
Brendan Abolivier 946c102ac9 1.48.0rc1 2021-11-25 15:57:04 +00:00
Brendan Abolivier 0d88c4f903 Improve performance of remove_{hidden,deleted}_devices_from_device_inbox (#11421)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-11-25 15:14:54 +00:00
Brendan Abolivier 7f9841bdec Lower minumum batch size to 1 for background updates (#11422)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-11-24 19:21:44 +00:00
reivilibre f25c75d376 Rename unstable access_token_lifetime configuration option to refreshable_access_token_lifetime to make it clear it only concerns refreshable access tokens. (#11388) 2021-11-23 17:01:34 +00:00
Patrick Cloke 55669bd3de Add missing type hints to config base classes (#11377) 2021-11-23 15:21:19 +00:00
Shay 7cebaf9644 Remove code invalidated by deprecated config flag 'trust_identity_servers_for_password_resets' (#11395)
* remove background update code related to deprecated config flag

* changelog entry

* update changelog

* Delete 11394.removal

Duplicate, wrong number

* add no-op background update and change newfragment so it will be consolidated with associated work

* remove unused code

* Remove code associated with deprecated flag from legacy docker dynamic config file

Co-authored-by: reivilibre <oliverw@matrix.org>
2021-11-23 06:46:40 -08:00
Sean Quah 454c3d7694 Merge branch 'master' into develop 2021-11-23 13:06:56 +00:00
Sean Quah fcb9441791 Merge tag 'v1.47.1'
Synapse 1.47.1 (2021-11-23)
===========================

This release fixes a security issue in the media store, affecting all prior releases of Synapse. Server administrators are encouraged to update Synapse as soon as possible. We are not aware of these vulnerabilities being exploited in the wild.

Server administrators who are unable to update Synapse may use the workarounds described in the linked GitHub Security Advisory below.

Security advisory
-----------------

The following issue is fixed in 1.47.1.

- **[GHSA-3hfw-x7gx-437c](https://github.com/matrix-org/synapse/security/advisories/GHSA-3hfw-x7gx-437c) / [CVE-2021-41281](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41281): Path traversal when downloading remote media.**

  Synapse instances with the media repository enabled can be tricked into downloading a file from a remote server into an arbitrary directory, potentially outside the media store directory.

  The last two directories and file name of the path are chosen randomly by Synapse and cannot be controlled by an attacker, which limits the impact.

  Homeservers with the media repository disabled are unaffected. Homeservers configured with a federation whitelist are also unaffected.

  Fixed by [91f2bd090](https://github.com/matrix-org/synapse/commit/91f2bd090).
2021-11-23 12:39:09 +00:00
Patrick Cloke 6a5dd485bd Refactor the code to inject bundled relations during serialization. (#11408) 2021-11-23 06:43:56 -05:00
Kostas 1035663833 Add config for customizing the claim used for JWT logins. (#11361)
Allows specifying a different claim (from the default "sub") to use
when calculating the localpart of the Matrix ID used during the
JWT login.
2021-11-22 13:01:03 -05:00
Patrick Cloke 3d893b8cf2 Store arbitrary relations from events. (#11391)
Instead of only known relation types. This also reworks the background
update for thread relations to crawl events and search for any relation
type, not just threaded relations.
2021-11-22 12:01:47 -05:00
Shay d9e9771d6b Update README.md 2021-11-19 14:01:55 -08:00
Dirk Klimpel ea20937084 Add an admin API to run background jobs. (#11352)
Instead of having admins poke into the database directly.

Can currently run jobs to populate stats and to populate
the user directory.
2021-11-19 19:39:46 +00:00
Sean Quah 8fa83999d6 Add CVE number 2021-11-19 18:40:13 +00:00
Patrick Cloke 7ae559944a Fix checking whether a room can be published on creation. (#11392)
If `room_list_publication_rules` was configured with a rule with a
non-wildcard alias and a room was created with an alias then an
internal server error would have been thrown.

This fixes the error and properly applies the publication rules
during room creation.
2021-11-19 15:19:32 +00:00
Sean Quah 9c21a68995 Refer to 1.47.1 without the v 2021-11-19 14:11:35 +00:00
Sean Quah 8d4dcac7e9 Update 1.47.1 release date in CHANGES.md 2021-11-19 14:11:05 +00:00
Sean Quah 97a402302c 1.47.1 2021-11-19 14:08:59 +00:00
Sean Quah 91f2bd0907 Prevent the media store from writing outside of the configured directory
Also tighten validation of server names by forbidding invalid characters
in IPv6 addresses and empty domain labels.
2021-11-19 13:39:15 +00:00
Patrick Cloke 4d6d38ac2f Remove dead code from acme support. (#11393) 2021-11-19 07:07:22 -05:00
Patrick Cloke 5505da2109 Remove msc2716 from the list of tests for complement. (#11389)
As the tests are currently failing and not run in CI.
2021-11-19 07:06:16 -05:00
Hubert Chathi eca7cffb73 Keep fallback key marked as used if it's re-uploaded (#11382) 2021-11-19 11:40:12 +00:00
Richard van der Hoff e2e9bea1ce Publish a develop docker image (#11380)
I'd find it helpful to have a docker image corresponding to current develop,
without having to build my own.
2021-11-19 10:56:59 +00:00
Richard van der Hoff a6f7f84570 Fix verification of objects signed with old local keys (#11379)
Fixes a bug introduced in #11129: objects signed by the local server, but with
keys other than the current one, could not be successfully verified.

We need to check the key id in the signature, and track down the right key.
2021-11-19 10:55:09 +00:00
Eric Eastwood 7ffddd819c Prevent historical state from being pushed to an application service via /transactions (MSC2716) (#11265)
Mark historical state from the MSC2716 `/batch_send` endpoint as `historical` which makes it `backfilled` and have a negative `stream_ordering` so it doesn't get queried by `/transactions`.

Fix https://github.com/matrix-org/synapse/issues/11241

Complement tests: https://github.com/matrix-org/complement/pull/221
2021-11-18 14:16:08 -06:00
Shay 92b75388f5 Remove legacy code related to deprecated trust_identity_server_for_password_resets config flag (#11333)
* remove code legacy code related to deprecated config flag "trust_identity_server_for_password_resets" from synapse/config/emailconfig.py

* remove legacy code supporting depreciated config flag "trust_identity_server_for_password_resets" from synapse/config/registration.py

* remove legacy code supporting depreciated config flag "trust_identity_server_for_password_resets" from synapse/handlers/identity.py

* add tests to ensure config error is thrown and synapse refuses to start when depreciated config flag is found

* add changelog

* slightly change behavior to only check for deprecated flag if set to 'true'

* Update changelog.d/11333.misc

Co-authored-by: reivilibre <oliverw@matrix.org>

Co-authored-by: reivilibre <oliverw@matrix.org>
2021-11-18 10:56:32 -08:00
Dirk Klimpel 81b18fe5c0 Add dedicated admin API for blocking a room (#11324) 2021-11-18 17:43:49 +00:00
reivilibre 5f81c0ce9c Add/Unerase annotations to Module API (#11341) 2021-11-18 16:55:33 +00:00
reivilibre 433ee159cb Rename get_refresh_token_for_user_id to create_refresh_token_for_user_id (#11370) 2021-11-18 14:45:38 +00:00
reivilibre 539e441399 Use auto_attribs for RefreshTokenLookupResult (#11386) 2021-11-18 14:40:26 +00:00
Patrick Cloke 4bd54b263e Do not allow MSC3440 threads to fork threads (#11161)
Adds validation to the Client-Server API to ensure that
the potential thread head does not relate to another event
already. This results in not allowing a thread to "fork" into
other threads.

If the target event is unknown for some reason (maybe it isn't
visible to your homeserver), but is the target of other events
it is assumed that the thread can be created from it. Otherwise,
it is rejected as an unknown event.
2021-11-18 13:43:09 +00:00
Nicolai Søborg e2dabec996 Docs: Quote wildcard federation_certificate_verification_whitelist (#11381)
Otherwise I get this beautiful stacktrace:

```
python3 -m synapse.app.homeserver --config-path /etc/matrix/homeserver.yaml
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/root/synapse/synapse/app/homeserver.py", line 455, in <module>
    main()
  File "/root/synapse/synapse/app/homeserver.py", line 445, in main
    hs = setup(sys.argv[1:])
  File "/root/synapse/synapse/app/homeserver.py", line 345, in setup
    config = HomeServerConfig.load_or_generate_config(
  File "/root/synapse/synapse/config/_base.py", line 671, in load_or_generate_config
    config_dict = read_config_files(config_files)
  File "/root/synapse/synapse/config/_base.py", line 717, in read_config_files
    yaml_config = yaml.safe_load(file_stream)
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/__init__.py", line 125, in safe_load
    return load(stream, SafeLoader)
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/parser.py", line 379, in parse_block_sequence_first_entry
    return self.parse_block_sequence_entry()
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/parser.py", line 384, in parse_block_sequence_entry
    if not self.check_token(BlockEntryToken, BlockEndToken):
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/scanner.py", line 227, in fetch_more_tokens
    return self.fetch_alias()
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/scanner.py", line 610, in fetch_alias
    self.tokens.append(self.scan_anchor(AliasToken))
  File "/root/synapse/env/lib/python3.8/site-packages/yaml/scanner.py", line 922, in scan_anchor
    raise ScannerError("while scanning an %s" % name, start_mark,
yaml.scanner.ScannerError: while scanning an alias
  in "/etc/matrix/homeserver.yaml", line 614, column 5
expected alphabetic or numeric character, but found '.'
  in "/etc/matrix/homeserver.yaml", line 614, column 6
```

Signed-off-by: Nicolai Søborg <git@xn--sb-lka.org>
2021-11-18 12:24:40 +00:00
Sean Quah 84fac0f814 Add type annotations to synapse.metrics (#10847) 2021-11-17 19:07:02 +00:00
Aaron R d993c3bb1e Add support for /_matrix/media/v3 APIs (#11371)
* Add support for `/_matrix/media/v3` APIs

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Update `workers.md` to use v3 client and media APIs

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Add changelog

Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-11-17 15:30:24 +00:00
David Robertson b76337fdf8 Merge branch 'master' into develop 2021-11-17 14:19:56 +00:00
David Robertson 077b74929f Merge remote-tracking branch 'origin/release-v1.47' 2021-11-17 14:19:27 +00:00
reivilibre 0d86f6334a Rename get_access_token_for_user_id method to create_access_token_for_user_id (#11369) 2021-11-17 14:10:57 +00:00
Patrick Cloke 60ecb6b4d4 Fix running complement.sh script. (#11368)
By reverting changes from #11166 in this script. Specifically commit
13f084eb58.
2021-11-17 09:04:50 -05:00
David Robertson 9f9d82aa84 1.47.0 2021-11-17 13:10:12 +00:00
Patrick Cloke 319dcb955e Fix incorrect return value in tests. (#11359) 2021-11-16 16:36:46 +00:00
David Robertson 0caf20883c Merge tag 'v1.47.0rc3' into develop
Synapse 1.47.0rc3 (2021-11-16)
==============================

Bugfixes
--------

- Fix a bug introduced in 1.47.0rc1 which caused worker processes to not halt startup in the presence of outstanding database migrations. ([\#11346](https://github.com/matrix-org/synapse/issues/11346))
- Fix a bug introduced in 1.47.0rc1 which prevented the 'remove deleted devices from `device_inbox` column' background process from running when updating from a recent Synapse version. ([\#11303](https://github.com/matrix-org/synapse/issues/11303), [\#11353](https://github.com/matrix-org/synapse/issues/11353))
2021-11-16 15:46:45 +00:00
Sean Quah 88375beeaa Avoid sharing room hierarchy responses between users (#11355)
Different users may be allowed to see different rooms within a space,
so sharing responses between users is inadvisable.
2021-11-16 15:40:47 +00:00
Andrew Morgan 7baa671dc8 fix up changelog language 2021-11-16 14:42:21 +00:00
Andrew Morgan 729acd82c8 mark the migration file migration as a bug 2021-11-16 14:41:21 +00:00
Andrew Morgan edcdc5fd82 1.47.0rc3 2021-11-16 14:34:46 +00:00
Aaron R dfa536490e Add support for /_matrix/client/v3 APIs (#11318)
This is one of the changes required to support Matrix 1.1

Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-11-16 14:47:58 +01:00
Patrick Cloke 7468723697 Add most missing type hints to synapse.util (#11328) 2021-11-16 08:47:36 -05:00
Andrew Morgan 6e084b62b8 Rename remove_deleted_devices_from_device_inbox to ensure it is always run (#11353)
Co-authored-by: reivilibre <oliverw@matrix.org>
2021-11-16 13:16:43 +00:00
reivilibre 3a1462f7e0 Properly register all callback hooks for legacy password authentication providers (#11340)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-11-16 12:53:31 +00:00
Patrick Cloke 24b61f379a Add ability to un-shadow-ban via the admin API. (#11347) 2021-11-16 12:43:53 +00:00
David Robertson 0dda1a7968 Misc typing fixes for tests, part 2 of N (#11330) 2021-11-16 10:41:35 +00:00
Ashwin Nair e72135b9d3 change 'Home Server' to one word 'homeserver' (#11320)
Signed-off-by: Ashwin S. Nair <58840757+Ashwin-exe@users.noreply.github.com>
2021-11-16 10:21:01 +00:00
Andrew Morgan 9c59e117db Run _upgrade_existing_database on workers if at current schema_version (#11346)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-11-15 17:34:15 +00:00
David Robertson e605e4b8f2 Database storage profile passes mypy (#11342)
It already seems to pass mypy. I wonder what changed, given that it was
on the exclusion list. So this commit consists of me ensuring
`--disallow-untyped-defs` passes and a minor fixup to a function that
returned either `True` or `None`.
2021-11-15 12:59:33 +00:00
David Robertson 5562ce6a53 Get directory db file to pass mypy (#11339) 2021-11-15 12:59:05 +00:00
Dirk Klimpel b596a1eb80 Move sql file for remove_deleted_devices_from_device_inbox into v65 (#11303) 2021-11-15 11:47:30 +00:00
Tulir Asokan 6f862c5c28 Add support for the stable version of MSC2778 (#11335)
* Add support for the stable version of MSC2778

Signed-off-by: Tulir Asokan <tulir@maunium.net>

* Expect m.login.application_service in login and password provider tests

Signed-off-by: Tulir Asokan <tulir@maunium.net>
2021-11-15 10:31:22 +00:00
Shay 605921bc6b Remove unused tables room_stats_historical and user_stats_historical (#11280)
* remove unused tables room_stats_historical and user_stats_historical

* update changelog number

* Bump schema compat version comment

* make linter happy

* Update comment to give more info

Co-authored-by: reivilibre <oliverw@matrix.org>

Co-authored-by: reivilibre <oliverw@matrix.org>
2021-11-12 16:47:56 -08:00
David Robertson fe58672546 Annotations for state_deltas.py (#11316)
I was sad that I couldn't do better for
`_curr_state_delta_stream_cache`. At least it's explicitly called out in
a comment with #TODO.
2021-11-12 20:24:12 +00:00
Patrick Cloke 3fad4e3fe5 Rollback #11322 due to wrong syntax in mypy.ini. (#11332)
This was only checking the __init__ files in modules instead of
all files in a module, which don't pass yet.
2021-11-12 20:10:03 +00:00
David Robertson bea815cec8 Test room alias deletion (#11327)
* Prefer `HTTPStatus` over plain `int`

This is an Opinion that no-one has seemed to object to yet.

* `--disallow-untyped-defs` for `tests.rest.client.test_directory`
* Improve synapse's annotations for deleting aliases
* Test case for deleting a room alias
* Changelog
2021-11-12 19:56:00 +00:00
Shay 0bcae8ad56 Change display names/avatar URLs to None if they contain null bytes before storing in DB (#11230)
* change display names/avatar URLS to None if they contain null bytes

* add changelog

* add POC test, requested changes

* add a saner test and remove old one

* update test to verify that display name has been changed to None

* make test less fragile
2021-11-12 10:38:24 -08:00
Patrick Cloke 9b90b9454b Add type hints to media repository storage module (#11311) 2021-11-12 11:05:26 -05:00
David Robertson 6f8f3d4bc5 Attempt to annotate events_forward_extremities (#11314)
* Make DataStore inherit from EventForwardExtremitiesStore before CacheInvalidationWorkerStore

the former implicitly inherits from the latter, so they should be
ordered like this when used.
2021-11-12 15:58:17 +00:00
David Robertson 4c96ce396e Misc typing fixes for tests, part 1 of N (#11323)
* Annotate HomeserverTestCase.servlets
* Correct annotation of federation_auth_origin
* Use AnyStr custom_headers instead of a Union

This allows (str, str) and (bytes, bytes).
This disallows (str, bytes) and (bytes, str)

* DomainSpecificString.SIGIL is a ClassVar
2021-11-12 15:50:54 +00:00
Patrick Cloke 95547e5300 Generalize the disallowed_untyped_defs in mypy.ini (#11322) 2021-11-12 14:27:45 +00:00
Patrick Cloke b64b6d12d4 Add more type hints to synapse.util. (#11321) 2021-11-12 13:43:06 +00:00
Brendan Abolivier 29168d86c5 Delete local RoomAccessRules module (#112) 2021-11-12 14:19:01 +01:00
reivilibre 2fffcb24d8 Suggest using /etc/matrix-synapse/conf.d/ for configuration with Debian packages (#11281) 2021-11-12 13:17:06 +00:00
reivilibre 4ad5ee9996 Correct target of link to the modules page from the Password Auth Providers page (#11309) 2021-11-12 12:58:39 +00:00
Dirk Klimpel 8840a7b7f1 Convert delete room admin API to async endpoint (#11223)
Signed-off-by: Dirk Klimpel dirk@klimpel.org
2021-11-12 12:35:31 +00:00
David Robertson c99da2d079 Annotations for user_erasure_store (#11313)
I'm not sure why this was excluded---it seemed to be passing for me. But
it's easy enough to fixup.
2021-11-11 19:22:19 +00:00
David Robertson 6a605f4a77 Get db signatures file to pass mypy (#11312) 2021-11-11 17:04:44 +00:00
David Robertson 8dc666f785 Correct type hint for room_batch.py (#11310)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-11-11 16:49:28 +00:00
Dirk Klimpel 48278a0d09 Move sql file for remove_deleted_devices_from_device_inbox into v65 (#11303) 2021-11-11 15:01:13 +00:00
Patrick Cloke 64ef25391d Add type hints to some storage classes (#11307) 2021-11-11 08:47:31 -05:00
Brendan Abolivier cef83c759d Merge pull request #108 from matrix-org/babolivier/update_spam_checker
Bring spamchecker to parity with mainline
2021-11-11 13:52:24 +01:00
Neeeflix 6ce19b94e8 Fix error in thumbnail generation (#11288)
Signed-off-by: Jonas Zeunert <jonas@zeunert.org>
2021-11-10 20:49:43 +00:00
Patrick Cloke 5cace20bf1 Add missing type hints to synapse.app. (#11287) 2021-11-10 15:06:54 -05:00
Patrick Cloke 66c4b774fd Add type hints to synapse._scripts (#11297) 2021-11-10 17:55:32 +00:00
Andrew Morgan 5f277ffe89 Add documentation page stubs for Single Sign-On, SAML and CAS pages (#11298) 2021-11-10 17:54:56 +00:00
Richard van der Hoff 73cbb284b9 Remove redundant parameters on _check_event_auth (#11292)
as of #11012, these parameters are unused.
2021-11-10 14:16:06 +00:00
Olivier Wilkinson (reivilibre) 68c258a604 Merge tag 'v1.47.0rc2' into develop
Synapse 1.47.0rc2 (2021-11-10)
==============================

This fixes an issue with publishing the Debian packages for 1.47.0rc1.
It is otherwise identical to 1.47.0rc1.
2021-11-10 13:01:08 +00:00
Olivier Wilkinson (reivilibre) 595f28529c Changelog tweak from feedback 2021-11-10 09:54:34 +00:00
Olivier Wilkinson (reivilibre) ef7f9286d1 Move Debian changelog entries to rc2 since rc1 was not published 2021-11-10 09:48:50 +00:00
Olivier Wilkinson (reivilibre) 82e62b488a 1.47.0rc2 2021-11-10 09:44:38 +00:00
Olivier Wilkinson (reivilibre) af6374905a Correct the Debian changelog 2021-11-10 09:37:48 +00:00
Stanislav Motylkov b09d90cac9 Fix typos in the username_available admin API documentation. (#11286) 2021-11-09 21:11:05 +00:00
Eric Eastwood f1d5c2f269 Split out federated PDU retrieval into a non-cached version (#11242)
Context: https://github.com/matrix-org/synapse/pull/11114/files#r741643968
2021-11-09 15:07:57 -06:00
Patrick Cloke 0ef69ddbdc Ignore missing imports for parameterized. (#11285)
This was due to a conflict between #11282, which changed
mypy configuration, and #11228, a normal change.
2021-11-09 19:04:53 +00:00
Dan Callahan 3b951445a7 Require mypy for synapse/ & tests/ unless excluded (#11282)
Signed-off-by: Dan Callahan <danc@element.io>
2021-11-09 16:22:47 +00:00
Andrew Morgan a026695083 Clarifications and small fixes to to-device related code (#11247)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-11-09 14:31:15 +00:00
Olivier Wilkinson (reivilibre) dc5f524974 Update __init__.py 2021-11-09 13:51:08 +00:00
Olivier Wilkinson (reivilibre) a754510f28 Changelog tweaks from review 2021-11-09 13:22:36 +00:00
David Robertson b6f4d122ef Allow admins to proactively block rooms (#11228)
Co-authored-by: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2021-11-09 13:11:47 +00:00
Patrick Cloke a19d01c3d9 Support filtering by relations per MSC3440 (#11236)
Adds experimental support for `relation_types` and `relation_senders`
fields for filters.
2021-11-09 08:10:58 -05:00
Olivier Wilkinson (reivilibre) b67a7c62a2 Make Deprecations and Removals more prominent 2021-11-09 12:32:05 +00:00
Olivier Wilkinson (reivilibre) 1a4f10045f Changelog tweaks 2021-11-09 12:30:15 +00:00
Olivier Wilkinson (reivilibre) 01f61da77f 1.47.0rc1 2021-11-09 12:17:35 +00:00
Andrew Morgan 4b3e30c276 Fix typo in RelationAggregationPaginationServlet error response (#11278) 2021-11-09 12:11:50 +00:00
Erik Johnston af784644c3 Include cross-signing signatures when syncing remote devices for the first time (#11234)
When fetching remote devices for the first time, we did not correctly include the cross signing keys in the returned results.

c.f. #11159
2021-11-09 11:45:36 +00:00
rogersheu 820337e6a4 Require body for read receipts with user-agent exceptions (#11157)
Co-authored-by: reivilibre <olivier@librepush.net>
2021-11-09 10:26:07 +00:00
Eric Eastwood 84f235aea4 Rename to more clear get_insertion_event_id_by_batch_id (MSC2716) (#11244)
`get_insertion_event_by_batch_id` -> `get_insertion_event_id_by_batch_id`

Split out from https://github.com/matrix-org/synapse/pull/11114
2021-11-08 21:21:10 -06:00
Erik Johnston 4ee71b9637 Add some background update admin APIs (#11263)
Fixes #11259
2021-11-08 16:08:02 +00:00
Patrick Cloke 0c82d4aabe Fix typo in comment from #11255. (#11276) 2021-11-08 14:36:49 +00:00
Richard van der Hoff 86a497efaa Default value for public_baseurl (#11210)
We might as well use a default value for `public_baseurl` based on
`server_name` - in many cases, it will be correct.
2021-11-08 14:13:10 +00:00
Dan Callahan 556a488209 Address review feedback from #11269 (#11273)
Signed-off-by: Dan Callahan <danc@element.io>
2021-11-08 11:57:37 +00:00
Erik Johnston a55e1ec9af Blacklist new sytest validation test (#11270) 2021-11-08 10:37:43 +00:00
jmcparland 02742fd058 Wrong DTLS port in "Troubleshooting" (#11268)
Port 5349, not 5479.
2021-11-08 10:34:39 +00:00
Erik Johnston 98c8fc6ce8 Handle federation inbound instances being killed more gracefully (#11262)
* Make lock better handle process being killed

If the process gets killed and restarted (so that it didn't have a
chance to drop its locks gracefully) then there may still be locks in
the DB that are for the same instance that haven't yet timed out but are
safe to delete.

We handle this case by a) checking if the current instance already has
taken out the lock, and b) if not then ignoring locks that are for the
same instance.

* Periodically check for old staged events

This is to protect against other instances dying and their locks timing
out.
2021-11-08 09:54:47 +00:00
Dan Callahan 9799c569bb Minor cleanup to Debian packaging (#11269)
* Remove unused Vagrant scripts

* Change package Architecture to any

* Preinstall the wheel package when building venvs.

Addresses the following warnings during Debian builds:

    Using legacy 'setup.py install' for jaeger-client, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for matrix-synapse-ldap3, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for opentracing, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for psycopg2, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for systemd-python, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for pympler, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for threadloop, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for thrift, since package 'wheel' is not installed.

* Allow /etc/default/matrix-synapse to be missing

Per the systemd.exec manpage, prefixing an EnvironmentFile with "-":

> indicates that if the file does not exist, it will not be read and no
> error or warning message is logged.

Signed-off-by: Dan Callahan <danc@element.io>
2021-11-07 21:18:33 +00:00
Julian 09cb441a04 Add doc to integrate synapse with LemonLDAP OIDC (#11257)
Co-authored-by: David Robertson <david.m.robertson1@gmail.com>
Co-authored-by: Julian Vanden Broeck <julian.vandenbroeck@dalibo.com>
2021-11-05 12:08:02 +00:00
Erik Johnston a37df1b091 Fix rolling back when using workers (#11255)
Fixes #11252
2021-11-05 11:12:10 +00:00
reivilibre 499c44d696 Make minor correction to type of auth_checkers callbacks (#11253) 2021-11-04 17:10:11 +00:00
Richard van der Hoff f36434590c Additional test for cachedList (#11246)
I was trying to understand how `cachedList` works, and ended up writing this
extra test. I figure we may as well keep it.
2021-11-04 14:45:34 +00:00
Sean Quah 8eec25a1d9 Track ongoing event fetches correctly in the presence of failure (#11240)
When an event fetcher aborts due to an exception, `_event_fetch_ongoing`
must be decremented, otherwise the event fetcher would never be
replaced. If enough event fetchers were to fail, no more events would be
fetched and requests would get stuck waiting for events.
2021-11-04 10:33:53 +00:00
Brendan Abolivier d859a6adeb Merge branch 'dinsic' into babolivier/update_spam_checker 2021-11-04 10:41:43 +01:00
Brendan Abolivier ed31c6b1f8 Remove now useless config option 2021-11-04 10:37:41 +01:00
Brendan Abolivier 1e73b59126 Lint 2021-11-04 10:37:41 +01:00
Brendan Abolivier 726f13ee79 Delete custom user_may_create_room
Because we already do these checks with RoomAccessRules
2021-11-04 10:37:40 +01:00
Brendan Abolivier 58d6cdd10d Update tests 2021-11-04 10:37:40 +01:00
Brendan Abolivier 481fbb0a67 Update DomainRuleChecker to use the new interface 2021-11-04 10:37:40 +01:00
Nick Barrett a271e233e9 Add a linearizer on (appservice, stream) when handling ephemeral events. (#11207)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2021-11-03 16:51:00 +00:00
Nick Barrett af54167516 Enable passing typing stream writers as a list. (#11237)
This makes the typing stream writer config match the other stream writers
that only currently support a single worker.
2021-11-03 14:25:47 +00:00
Brendan Abolivier dd19126ae1 Fix debian package builds. (#10931) (#109)
This was due to dh-virtualenv builds being broken due to Shpinx removing
deprecated APIs.

Co-authored-by: Erik Johnston <erik@matrix.org>
2021-11-03 15:16:44 +01:00
Patrick Cloke 2735b3e6f2 Remove a debug statement from tests. (#11239) 2021-11-03 13:11:16 +00:00
Erik Johnston bcc115c28d Add twine and towncrier as dev dependencies (#11233)
We don't pin them as we execute them as commands, rather than use them
as libs.
2021-11-03 11:10:25 +00:00
Andrew Morgan d688a6dee5 fix a small typo in the delete room api docs 2021-11-03 11:09:00 +00:00
Eric Eastwood da0040785e Support sending no state_events_at_start in the MSC2716 /batch_send endpoint (#11188)
As brought up by @tulir, https://matrix.to/#/!SBYNQlpqkwJzFIdzxI:nevarro.space/$Gwnb2ZvXHc3poYXuBhho0cmoYq4KJ11Jh3m5s8kjNOM?via=nevarro.space&via=beeper.com&via=matrix.org

This use case only works if the user is already joined in the current room state
at the given `?prev_event_id`
2021-11-03 03:13:51 -05:00
Erik Johnston 6250b95efe Add index to local_group_updates.stream_id (#11231)
This should speed up startup times and generally increase performance of
groups.
2021-11-02 15:46:48 +00:00
Erik Johnston 237f7eb87a Merge remote-tracking branch 'origin/master' into develop 2021-11-02 14:28:27 +00:00
Patrick Cloke c01bc5f43d Add remaining type hints to synapse.events. (#11098) 2021-11-02 09:55:52 -04:00
Erik Johnston 2d44ee6868 Update changelog 2021-11-02 13:25:42 +00:00
Erik Johnston df84ad602b 1.46.0 2021-11-02 13:23:01 +00:00
Dirk Klimpel 4535532526 Delete messages for hidden devices from device_inbox (#11199) 2021-11-02 13:18:30 +00:00
Andrew Morgan c9c3aea9b1 Fix providing a RoomStreamToken instance to _notify_app_services_ephemeral (#11137)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-11-02 10:39:02 +00:00
Dirk Klimpel 7537201840 Add search by room ID and room alias to List Room admin API (#11099)
Fixes: #10874
Signed-off-by: Dirk Klimpel dirk@klimpel.org
2021-11-02 10:01:13 +00:00
Richard van der Hoff 46d0937447 ObservableDeferred: run observers in order (#11229) 2021-11-02 00:17:35 +00:00
Dirk Klimpel 93aa670642 Update outdated links in PULL_REQUEST_TEMPLATE.md (#11225) 2021-11-01 17:29:51 +00:00
Shay f5c6a80886 Handle missing Content-Type header when accessing remote media (#11200)
* add code to handle missing content-type header and a test to verify that it works

* add handling for missing content-type in the /upload endpoint as well

* slightly refactor test code to put private method in approriate place

* handle possible null value for content-type when pulling from the local db

* add changelog

* refactor test and add code to handle missing content-type in cached remote media

* requested changes

* Update changelog.d/11200.bugfix

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2021-11-01 10:26:02 -07:00
Shay e81fa92648 Add use_float=true to ijson calls in Synapse (#11217)
* add use_float=true to ijson calls

* lints

* add changelog

* Update changelog.d/11217.bugfix

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2021-11-01 09:28:04 -07:00
Dirk Klimpel caa706d825 Fix a bug in unit test test_block_room_and_not_purge (#11226) 2021-11-01 16:10:09 +00:00
reivilibre 69ab3dddbc Make check_event_allowed module API callback not fail open (accept events) when an exception is raised (#11033) 2021-11-01 15:45:56 +00:00
Dirk Klimpel 66bdca3e31 Remove deprecated delete room admin API (#11213)
Remove deprecated delete room admin API,
`POST /_synapse/admin/v1/rooms/<room_id>/delete`
2021-11-01 15:11:24 +00:00
Richard van der Hoff 71f9966f27 Support for serving server well-known files (#11211)
Fixes https://github.com/matrix-org/synapse/issues/8308
2021-11-01 15:10:16 +00:00
Brendan Abolivier 23e48a1f8e Add a module API method to retrieve state from a room (#11204) 2021-11-01 14:24:25 +00:00
Brett Bethke 2014098d01 Add domain specific matching for haproxy config (#11128) 2021-11-01 14:16:02 +00:00
Richard van der Hoff 0b99d4c8d2 Docker: avoid changing userid unnecessarily (#11209)
* Docker image: avoid changing user during `generate`

The intention was always that the config files get written as the initial user
(normally root) - only the data directory needs to be writable by Synapse. This
got changed in https://github.com/matrix-org/synapse/pull/5970, but that seems
to have been a mistake.

* Avoid changing user if no explicit UID is given

* changelog
2021-11-01 13:55:30 +00:00
Aaron R 3ae1464efd Support Client-Server API r0.6.1 (#11097)
Fixes #11064

Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-11-01 13:28:39 +00:00
Sumner Evans ece84f2c45 Improve code formatting and fix a few typos in docs (#11221)
* Labeled a lot more code blocks with the appropriate type
* Fixed a couple of minor typos (missing/extraneous commas)

Signed-off-by: Sumner Evans <me@sumnerevans.com>
2021-11-01 11:35:55 +00:00
Erik Johnston 82d2168a15 Add metrics to the threadpools (#11178) 2021-11-01 11:21:36 +00:00
Sean Quah 2451003f6f Test that ClientIpStore combines database and in-memory data correctly (#11179) 2021-11-01 11:20:54 +00:00
JohannesKleine 29ffd680bf Stop synapse from saving messages in device_inbox for hidden devices. (#10097)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2021-11-01 10:40:41 +00:00
Brendan Abolivier e320f5dba3 Deprecate user_may_create_room_with_invites (#11206) 2021-11-01 10:46:08 +01:00
Dirk Klimpel bfd7a9b65c Fix comments referencing v1.46.0 from PR #10969. (#11212)
#10969 was merged after 1.46.0rc1 was cut and will be included
in v1.47.0rc1 instead.
2021-10-29 13:43:51 -04:00
Brendan Abolivier ad4eab9862 Add a module API method to retrieve state from a room (#11204) 2021-10-29 16:28:29 +00:00
Sean Quah 3ed17ff651 Clarify lack of Windows support in documentation (#11198) 2021-10-29 14:03:58 +01:00
Patrick Cloke 56e281bf6c Additional type hints for relations database class. (#11205) 2021-10-28 14:35:12 -04:00
Rafael Gonçalves 0e16b418f6 Add knock information in admin exported data (#11171)
Signed-off-by: Rafael Goncalves <rafaelgoncalves@riseup.net>
2021-10-28 18:54:38 +01:00
Shay e002faee01 Fetch verify key locally rather than trying to do so over federation if origin and host are the same. (#11129)
* add tests for fetching key locally

* add logic to check if origin server is same as host and fetch verify key locally rather than over federation

* add changelog

* slight refactor, add docstring, change changelog entry

* Make changelog entry one line

* remove verify_json_locally and push locality check to process_request, add function process_request_locally

* remove leftover code reference

* refactor to add common call to 'verify_json and associated handling code

* add type hint to process_json

* add some docstrings + very slight refactor
2021-10-28 10:27:17 -07:00
Brendan Abolivier adc0d35b17 Add a ModuleApi method to update a user's membership in a room (#11147)
Co-authored-by: reivilibre <oliverw@matrix.org>
2021-10-28 16:45:53 +00:00
David Robertson 1bfd141205 Type hints for the remaining two files in synapse.http. (#11164)
* Teach MyPy that the sentinel context is False

This means that if `ctx: LoggingContextOrSentinel`
then `bool(ctx)` narrows us to `ctx:LoggingContext`, which is a really
neat find!

* Annotate RequestMetrics

- Raise errors for sentry if we use the sentinel context
- Ensure we don't raise an error and carry on, but not recording stats
- Include stack trace in the error case to lower Sean's blood pressure

* Make mypy pass for synapse.http.request_metrics

* Make synapse.http.connectproxyclient pass mypy

Co-authored-by: reivilibre <oliverw@matrix.org>
2021-10-28 14:14:42 +01:00
Skyler Mäntysaari a19bf32a03 docs/openid: Add Authentik documentation. (#11151) 2021-10-28 10:31:22 +00:00
Dan Callahan a1ba7a850a Update scripts to pass Shellcheck lints (#11166) 2021-10-27 21:36:18 +01:00
Dan Callahan 0dffa9d0e0 Merge remote-tracking branch 'origin/develop' into shellcheck
Fixes a merge conflict with debian/changelog

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-27 20:04:00 +01:00
reivilibre 75ca0a6168 Annotate log_function decorator (#10943)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-10-27 17:27:23 +01:00
Samuel Philipp 4e393af52f Fixed config parse bug in review_recent_signups (#11191) 2021-10-27 17:25:18 +01:00
Richard van der Hoff 576921c66a Force deb compression with xz. (#11197)
Fixes a problem where `impish` packages could not be processed by `reprepro`.
2021-10-27 17:06:32 +01:00
Patrick Cloke 19d5dc6931 Refactor Filter to handle fields according to data being filtered. (#11194)
This avoids filtering against fields which cannot exist on an
event source. E.g. presence updates don't have a room.
2021-10-27 11:26:30 -04:00
Dirk Klimpel 8d46fac98e Delete messages from device_inbox table when deleting device (#10969)
Fixes: #9346
2021-10-27 16:01:18 +01:00
Patrick Cloke b3e843be88 Fix URL preview errors when previewing XML documents. (#11196) 2021-10-27 14:48:02 +00:00
Patrick Cloke a930da3291 Include the stable identifier for MSC3288. (#11187)
Includes both the stable and unstable identifier to store-invite
calls to the identity server. In the future we should remove the
unstable identifier.
2021-10-27 14:19:19 +00:00
Erik Johnston 179dc8ae9e Merge remote-tracking branch 'origin/release-v1.46' into develop 2021-10-27 14:45:40 +01:00
Erik Johnston e0ef8fe58d Update release date 2021-10-27 14:44:45 +01:00
Erik Johnston b615fc35d6 Update changelog with new changes 2021-10-27 13:22:48 +01:00
Sean Quah f3a4be8700 Shut down the DNS threadpool (#11190)
The DNS threadpool must be explicitly stopped, otherwise Synapse will
hang indefinitely when asked to shut down.
2021-10-27 13:04:56 +01:00
Erik Johnston 72626b78ef Fix thread BG update to not seq scan event_json (#11192)
For some reason the query optimiser decided to seq scan both tables,
rather than index scanning `event_json`.
2021-10-27 11:33:21 +00:00
Sean Quah 2dbef6c10a Update CHANGES.md 2021-10-26 17:54:25 +01:00
Brendan Abolivier c9c1bed22c Converge with mainline
Bring other callbacks to party with mainline, and fixup code calling to
the various callbacks.
2021-10-26 17:33:27 +01:00
Sean Quah 60ad9460c4 Move #10975 to bugfix section in changelog 2021-10-26 14:26:36 +01:00
Sean Quah 400f391f71 Update CHANGES.md 2021-10-26 14:21:09 +01:00
Brendan Abolivier c7a5e49664 Implement an on_new_event callback (#11126)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2021-10-26 15:17:36 +02:00
Sean Quah 34b0222c2b Update CHANGES.md 2021-10-26 14:08:52 +01:00
Sean Quah cc75a6b1b2 1.46.0rc1 2021-10-26 14:04:51 +01:00
Erik Johnston 7004f43da1 Move DNS lookups into separate thread pool (#11177)
This is to stop large bursts of lookups starving out other users of the
thread pools.

Fixes #11049.
2021-10-26 13:45:38 +01:00
Patrick Cloke d52c58dfa3 Add a background update for updating MSC3440 relation threads. (#11181) 2021-10-26 07:38:45 -04:00
Brendan Abolivier dfcb52c24f Add a spamchecker method to allow or deny 3pid invites (#10894)
This is in the context of creating new module callbacks that modules in https://github.com/matrix-org/synapse-dinsic can use, in an effort to reconcile the spam checker API in synapse-dinsic with the one in mainline.

Note that a module callback already exists for 3pid invites (https://matrix-org.github.io/synapse/develop/modules/third_party_rules_callbacks.html#check_threepid_can_be_invited) but it doesn't check whether the sender of the invite is allowed to send it.
2021-10-26 11:29:27 +01:00
Brendan Abolivier 6bcb28bfd1 Add a spamchecker callback to allow or deny room joins (#10910)
Co-authored-by: Erik Johnston <erik@matrix.org>
2021-10-26 11:13:42 +01:00
Brendan Abolivier 262163c63c Add a spamchecker callback to allow or deny room creation based on invites (#10898)
This is in the context of creating new module callbacks that modules in https://github.com/matrix-org/synapse-dinsic can use, in an effort to reconcile the spam checker API in synapse-dinsic with the one in mainline.

This adds a callback that's fairly similar to user_may_create_room except it also allows processing based on the invites sent at room creation.
2021-10-26 11:11:31 +01:00
Brendan Abolivier 8c8e36af0d Document the version each module API method was added to Synapse (#11183) 2021-10-26 11:09:10 +02:00
Jason Robinson 63cbdd8af0 Enable changing user type via users admin API (#11174)
Users admin API can now also modify user
type in addition to allowing it to be
set on user creation.

Signed-off-by: Jason Robinson <jasonr@matrix.org>
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2021-10-26 09:01:06 +00:00
Brendan Abolivier c1510c97b5 Fix cyclic import in the module API (#11180)
Introduced in #10548

See https://github.com/matrix-org/synapse-email-account-validity/runs/3979337154?check_suite_focus=true for an example of a module's CI choking over this issue.
2021-10-25 16:45:19 +00:00
AndrewFerr 4387b791e0 Don't set new room alias before potential 403 (#10930)
Fixes: #10929 

Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
2021-10-25 15:24:49 +01:00
Richard van der Hoff da957a60e8 Ensure that we correctly auth events returned by send_join (#11012)
This is the final piece of the jigsaw for #9595. As with other changes before this one (eg #10771), we need to make sure that we auth the auth events in the right order, and actually check that their predecessors haven't been rejected.

To do this I've reused the existing code we use when persisting outliers elsewhere.

I've removed the code for attempting to fetch missing auth_events - the events should have been present in the send_join response, so the likely reason they are missing is that we couldn't verify them, so requesting them again is unlikely to help. Instead, we simply drop any state which relies on those auth events, as we do at a backwards-extremity. See also matrix-org/complement#216 for a test for this.
2021-10-25 15:21:09 +01:00
Sean Quah 85a09f8b8b Fix module API's get_user_ip_and_agents function when run on workers (#11112) 2021-10-25 13:01:04 +01:00
Dan Callahan 1afc6ecae1 Changelog
Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:21:40 +01:00
Dan Callahan d7141e0b8b Fix Shellcheck SC2006: Use $(...) notation
Use $(...) notation instead of legacy backticked `...`.

https://github.com/koalaman/shellcheck/wiki/SC2006

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:55 +01:00
Dan Callahan b5e910521b Fix Shellcheck SC2129: Consider using {..} >> file
Consider using { cmd1; cmd2; } >> file instead of individual redirects.

https://github.com/koalaman/shellcheck/wiki/SC2129

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 13f084eb58 Fix Shellcheck SC2086: Quote to prevent splitting
Double quote to prevent globbing and word splitting.

https://github.com/koalaman/shellcheck/wiki/SC2086

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 31096132c3 Fix Shellcheck SC2012: Use find instead of ls
Use find instead of ls to better handle non-alphanumeric filenames.

https://github.com/koalaman/shellcheck/wiki/SC2012

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 9d0f9d51d5 Fix Shellcheck SC2016: Single quotes don't expand
Expressions don't expand in single quotes, use double quotes for that.

https://github.com/koalaman/shellcheck/wiki/SC2016

This specifically warned about the '$aregis...' part of the sed script.
Which is a relatively obscure use of sed.

Splitting this into two commands makes its intent more obvious and
avoids contravening Shellcheck's lints.

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan bab2bc844c Fix Shellcheck SC1091: Can't follow file
Not following: (error message here)

https://github.com/koalaman/shellcheck/wiki/SC1091

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 7cf83c0aca Fix Shellcheck SC1001: Meaningless char escapes
This \o will be a regular 'o' in this context.

https://github.com/koalaman/shellcheck/wiki/SC1001

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 99e698d6ed Fix Shellcheck SC2089 and SC2090: Quotes in vars
SC2089: Quotes/backslashes will be treated literally. Use an array.

https://github.com/koalaman/shellcheck/wiki/SC2089

SC2090: Quotes/backslashes in this variable will not be respected.

https://github.com/koalaman/shellcheck/wiki/SC2090

Putting literal JSON in a variable mistakenly triggers these warnings.
Instead of adding ignore directives, this can be avoided by inlining the
JSON data into the curl invocation.

Since the variable is only used in this one location, inlining is fine.

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan dfa6143133 Fix Shellcheck SC2155: Declare + export separately
Declare and assign separately to avoid masking return values.

https://github.com/koalaman/shellcheck/wiki/SC2155

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 6a9d84a676 Fix Shellcheck SC2166: test -a is not well defined
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.

https://github.com/koalaman/shellcheck/wiki/SC2166

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 6c736fa472 Fix Shellcheck SC2154: variable possibly undefined
var is referenced but not assigned.

https://github.com/koalaman/shellcheck/wiki/SC2154

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 898e3be4c9 Fix Shellcheck SC2064: Use single quotes on traps
Use single quotes, otherwise this expands now rather than when signalled.

https://github.com/koalaman/shellcheck/wiki/SC2064

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 5eb481cd5b Fix Shellcheck SC2115: Ensure never expands to /*
Use "${var:?}" to ensure this never expands to /* .

https://github.com/koalaman/shellcheck/wiki/SC2115

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:54 +01:00
Dan Callahan 64adbb7b54 Fix Shellcheck SC2046: Quote to prevent word split
Quote this to prevent word splitting

https://www.shellcheck.net/wiki/SC2046

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:53 +01:00
Dan Callahan 12d79ff1b6 Fix Shellcheck SC2164: exit in case cd fails.
Use `cd ... || exit` in case cd fails.

https://github.com/koalaman/shellcheck/wiki/SC2164

Signed-off-by: Dan Callahan <danc@element.io>
2021-10-22 23:08:53 +01:00
Sean Quah 2b82ec425f Add type hints for most HomeServer parameters (#11095) 2021-10-22 18:15:41 +01:00
Jason Robinson b9ce53e878 Fix synapse.config module "read" command (#11145)
`synapse.config.__main__` has the possibility to read a config item. This can be used to conveniently also validate the config is valid before trying to start Synapse.

 The "read" command broke in https://github.com/matrix-org/synapse/pull/10916 as it now requires passing in "server.server_name" for example.

 Also made the read command optional so one can just call this with just the confirm file reference and get a "Config parses OK" if things are ok.

Signed-off-by: Jason Robinson <jasonr@matrix.org>
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2021-10-22 12:00:52 +02:00
Dirk Klimpel b0f03aeb6a Add more information what happens when a user is deactivated (#11083) 2021-10-22 09:00:28 +01:00
Patrick Cloke ba00e20234 Add a thread relation type per MSC3440. (#11088)
Adds experimental support for MSC3440's `io.element.thread` relation
type (and the aggregation for it).
2021-10-21 14:39:16 -04:00
David Robertson 2d91b6256e Fix adding excluded users to the private room sharing tables when joining a room (#11143)
* We only need to fetch users in private rooms

* Filter out `user_id` at the top

* Discard excluded users in the top loop

We weren't doing this in the "First, if they're our user" branch so this
is a bugfix.

* The caller must check that `user_id` is included

This is in the docstring. There are two call sites:
- one in `_handle_room_publicity_change`, which explicitly checks before calling;
- and another in `_handle_room_membership_event`, which returns early if
  the user is excluded.

So this change is safe.

* Test joining a private room with an excluded user

* Tweak an existing test

* Changelog

* test docstring

* lint
2021-10-21 17:48:59 +01:00
Andrew Morgan 6408372234 Improve docstrings for methods related to sending EDUs to application services (#11138) 2021-10-21 17:42:25 +01:00
Patrick Cloke 0f9adc99ad Add missing type hints to synapse.crypto. (#11146)
And require type hints for this module.
2021-10-21 13:07:07 +00:00
Richard van der Hoff 09eff1b3db fix relative link in docker readme (#11144)
relative links don't work when it's on dockerhub.
2021-10-21 13:50:43 +01:00
Dirk Klimpel ef7fe09778 Fix setting a user's external_id via the admin API returns 500 and deletes users existing external mappings if that external ID is already mapped (#11051)
Fixes #10846
2021-10-21 09:52:32 +01:00
Richard van der Hoff 57501d9194 Update sign_json to support inline key config (#11139)
It's been possible to configure a key inline in the homeserver.yaml since
13bc1e0746. Update `sign_json` to work with this.
2021-10-20 18:49:20 +01:00
Robert Edström 62db603fa0 Consider IP whitelist for identity server resolution (#11120)
Signed-off-by: Robert Edström <github@legogris.se>
2021-10-20 18:43:49 +01:00
Richard van der Hoff 0930e9ae12 Clean up _update_auth_events_and_context_for_auth (#11122)
Remove some redundant code, and generally simplify.
2021-10-20 18:22:40 +01:00
Aaron R 2c61a318cc Show error when timestamp in seconds is provided to the /purge_media_cache API (#11101) 2021-10-20 14:41:48 +00:00
Sean Quah ee2cee5f52 Merge branch 'master' into develop 2021-10-20 13:43:02 +01:00
Travis Ralston 106d99b8cd Remove false warning about copying the log config to a homeserver.yaml (#11092)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2021-10-20 11:48:15 +00:00
Brendan Abolivier 78d5896d19 Document the version of Synapse each module callback was introduced in (#11132)
* Mention callbacks introduced in v1.37.0

According to the documentation introduced in https://github.com/matrix-org/synapse/pull/10062

* Mention callbacks introduced in v1.39.0

According to https://github.com/matrix-org/synapse/pull/10386 and https://github.com/matrix-org/synapse/pull/9884

* Mention callbacks introduced in v1.42.0

According to https://github.com/matrix-org/synapse/pull/10524

* Mention callbacks introduced in v1.44.0 and v1.45.0

As per https://github.com/matrix-org/synapse/pull/10898, https://github.com/matrix-org/synapse/pull/10910 and https://github.com/matrix-org/synapse/pull/10894

* Mention callbacks introduced in v1.46.0

According to https://github.com/matrix-org/synapse/pull/10548
2021-10-20 11:04:27 +00:00
Sean Quah 9b016a0fb4 Remove link to #10947 from changelog 2021-10-20 12:04:20 +01:00
Sean Quah 522489fbcd 1.45.1 2021-10-20 12:00:03 +01:00
Sean Quah df95d3aec2 Revert change to counting of deactivated users towards the monthly active users limit (#11127)
Temporarily revert "Add functionality to remove deactivated users from the monthly_active_users table (#10947)".

This reverts commit eda8c88b84.
2021-10-20 11:05:29 +01:00
Patrick Cloke 0dd0c40329 Add missing type hints to event fetching. (#11121)
Updates the event rows returned from the database to be
attrs classes instead of dictionaries.
2021-10-19 14:29:03 +00:00
Andrew Morgan 5e0e683541 Fix instances of [example]{.title-ref} in the upgrade notes (#11118) 2021-10-19 14:13:56 +01:00
David Robertson a6c318735d Merge branch 'master' into develop 2021-10-19 12:44:33 +01:00
David Robertson 95813ff43c Be less inconsistent about v1.2.3 versus 1.2.3 2021-10-19 11:30:16 +01:00
David Robertson a21f8c4b41 Duplicate known issues under 1.45 release 2021-10-19 11:21:21 +01:00
David Robertson 8b1185347a 1.45.0 2021-10-19 11:19:55 +01:00
Dan Callahan 191396f4ba Reword changelog regarding a suspected regression (#11117)
Signed-off-by: Dan Callahan <danc@element.io>
2021-10-19 11:16:52 +01:00
Richard van der Hoff f3efa0036b Move _persist_auth_tree into FederationEventHandler (#11115)
This is just a lift-and-shift, because it fits more naturally here. We do
rename it to `process_remote_join` at the same time though.
2021-10-19 10:24:09 +01:00
Richard van der Hoff 0170774b19 Rename _auth_and_persist_fetched_events (#11116)
... to `_auth_and_persist_outliers`, since that reflects its purpose better.
2021-10-19 10:23:55 +01:00
Richard van der Hoff d85bc9a4a7 Include rejected status when we log events. (#11008)
If we find ourselves dealing with rejected events, we proably want to know
about it. Let's include it in the stringification of the event so that it gets
logged.
2021-10-19 10:21:50 +01:00
Patrick Cloke 3ab55d43bd Add missing type hints to synapse.api. (#11109)
* Convert UserPresenceState to attrs.
* Remove args/kwargs from error classes and explicitly pass msg/errorcode.
2021-10-18 15:01:10 -04:00
Richard van der Hoff cc33d9eee2 Check auth on received events' auth_events (#11001)
Currently, when we receive an event whose auth_events differ from those we expect, we state-resolve between the two state sets, and check that the event passes auth based on the resolved state.

This means that it's possible for us to accept events which don't pass auth at their declared auth_events (or where the auth events themselves were rejected), leading to problems down the line like #10083.

This change means we will:

 * ignore any events where we cannot find the auth events
 * reject any events whose auth events were rejected
 * reject any events which do not pass auth at their declared auth_events.

Together with a whole raft of previous work, this is a partial fix to #9595.

Fixes #6643.

Based on #11009.
2021-10-18 18:29:37 +01:00
Richard van der Hoff a5d2ea3d08 Check *all* auth events for room id and rejection (#11009)
This fixes a bug where we would accept an event whose `auth_events` include
rejected events, if the rejected event was shadowed by another `auth_event`
with same `(type, state_key)`.

The approach is to pass a list of auth events into
`check_auth_rules_for_event` instead of a dict, which of course means updating
the call sites.

This is an extension of #10956.
2021-10-18 18:28:30 +01:00
Brendan Abolivier 73743b8ad1 Document Synapse's behaviour when dealing with multiple modules (#11096)
Document Synapse's behaviour when multiple modules register the same
callback/web resource/etc.

Co-authored-by: reivilibre <oliverw@matrix.org>
2021-10-18 18:26:52 +02:00
Richard van der Hoff e8f24b6c35 _run_push_actions_and_persist_event: handle no min_depth (#11014)
Make sure that we correctly handle rooms where we do not yet have a
`min_depth`, and also add some comments and logging.
2021-10-18 17:17:15 +01:00
Hillery Shay 7d70582eb0 Fix broken export-data admin command and add a test for it to CI (#11078)
Fix broken export-data admin command and add a test for it to CI
2021-10-18 08:14:12 -07:00
David Robertson 37b845dabc Don't remove local users from dir when the leave their last room (#11103) 2021-10-18 13:20:04 +00:00
David Robertson e09be0c87a Correctly exclude users when making a room public or private (#11075)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-10-15 15:53:05 +01:00
Patrick Cloke 5573133348 Move experimental & retention config out of the server module. (#11070) 2021-10-15 14:30:48 +00:00
Sean Quah 6a67f3786a Fix logging context warnings when losing replication connection (#10984)
Instead of triggering `__exit__` manually on the replication handler's
logging context, use it as a context manager so that there is an
`__enter__` call to balance the `__exit__`.
2021-10-15 13:10:58 +01:00
Dirk Klimpel 013e0f9cae Update doc of the allowed characters for registration tokens (#11093)
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2021-10-15 09:56:39 +00:00
Eric Eastwood daf498e099 Fix 500 error on /messages when we accumulate more than 5 backward extremities (#11027)
Found while working on the Gitter backfill script and noticed
it only happened after we sent 7 batches, https://gitlab.com/gitterHQ/webapp/-/merge_requests/2229#note_665906390

When there are more than 5 backward extremities for a given depth,
backfill will throw an error because we sliced the extremity list
to 5 but then try to iterate over the full list. This causes
us to look for state that we never fetched and we get a `KeyError`.

Before when calling `/messages` when there are more than 5 backward extremities:
```
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 258, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 446, in _async_render
    callback_return = await raw_callback_return
  File "/usr/local/lib/python3.8/site-packages/synapse/rest/client/room.py", line 580, in on_GET
    msgs = await self.pagination_handler.get_messages(
  File "/usr/local/lib/python3.8/site-packages/synapse/handlers/pagination.py", line 396, in get_messages
    await self.hs.get_federation_handler().maybe_backfill(
  File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 133, in maybe_backfill
    return await self._maybe_backfill_inner(room_id, current_depth, limit)
  File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 386, in _maybe_backfill_inner
    likely_extremeties_domains = get_domains_from_state(states[e_id])
KeyError: '$zpFflMEBtZdgcMQWTakaVItTLMjLFdKcRWUPHbbSZJl'
```
2021-10-14 18:53:45 -05:00
Patrick Cloke efd0074ab7 Ensure each charset is attempted only once during media preview. (#11089)
There's no point in trying more than once since it is guaranteed to
continually fail.
2021-10-14 18:51:44 +00:00
Patrick Cloke e2f0b49b3f Attempt different character encodings when previewing a URL. (#11077)
This follows similar logic to BeautifulSoup where we attempt different
character encodings until we find one which works.
2021-10-14 10:17:20 -04:00
Patrick Cloke 1609ccf8fe Fix-up some type hints in the relations tests. (#11076) 2021-10-14 09:19:35 -04:00
reivilibre 50d8601581 Add a test for a workaround concerning the behaviour of third-party rule modules and SynapseErrors. (#11071) 2021-10-14 14:14:15 +01:00
David Robertson b3698f945c Merge tag 'v1.45.0rc2' into develop
Synapse 1.45.0rc2 (2021-10-14)
==============================

**Note:** This release candidate [fixes](https://github.com/matrix-org/synapse/issues/11053) the user directory [bug](https://github.com/matrix-org/synapse/issues/11025) present in 1.45.0rc1. However, the [performance issue](https://github.com/matrix-org/synapse/issues/11049) which appeared in v1.44.0 is yet to be resolved.

Bugfixes
--------

- Fix a long-standing bug when using multiple event persister workers where events were not correctly sent down `/sync` due to a race. ([\#11045](https://github.com/matrix-org/synapse/issues/11045))
- Fix a bug introduced in Synapse 1.45.0rc1 where the user directory would stop updating if it processed an event from a
  user not in the `users` table. ([\#11053](https://github.com/matrix-org/synapse/issues/11053))
- Fix a bug introduced in Synapse v1.44.0 when logging errors during oEmbed processing. ([\#11061](https://github.com/matrix-org/synapse/issues/11061))

Internal Changes
----------------

- Add an 'approximate difference' method to `StateFilter`. ([\#10825](https://github.com/matrix-org/synapse/issues/10825))
- Fix inconsistent behavior of `get_last_client_by_ip` when reporting data that has not been stored in the database yet. ([\#10970](https://github.com/matrix-org/synapse/issues/10970))
- Fix a bug introduced in Synapse 1.21.0 that causes opentracing and Prometheus metrics for replication requests to be measured incorrectly. ([\#10996](https://github.com/matrix-org/synapse/issues/10996))
- Ensure that cache config tests do not share state. ([\#11036](https://github.com/matrix-org/synapse/issues/11036))
2021-10-14 11:42:16 +01:00
David Robertson b1c1a34f46 it appeared in 1.44, not 45rc1 2021-10-14 11:20:02 +01:00
David Robertson 4d761d24ba mentioned -> which appeared 2021-10-14 11:18:40 +01:00
David Robertson 87c3a6dcc0 Refer to the bugs mentioned in 1.45.0rc1 note 2021-10-14 11:03:35 +01:00
David Robertson 99a4e5222d 1.45.0rc2 2021-10-14 10:59:27 +01:00
Eric Eastwood 35d6b914eb Resolve and share state_groups for all historical events in batch (MSC2716) (#10975)
Resolve and share `state_groups` for all historical events in batch.  This also helps for showing the appropriate avatar/displayname in Element and will work whenever `/messages` has one of the historical messages as the first message in the batch.

This does have the flaw where if you just insert a single historical event somewhere, it probably won't resolve the state correctly from `/messages` or `/context` since it will grab a non historical event above or below with resolved state which never included the historical state back then. For the same reasions, this also does not work in Element between the transition from actual messages to historical messages. In the Gitter case, this isn't really a problem since all of the historical messages are in one big lump at the beginning of the room.

For a future iteration, might be good to look at `/messages` and `/context` to additionally add the `state` for any historical messages in that batch.

---

How are the `state_groups` shared? To illustrate the `state_group` sharing, see this example:


**Before** (new `state_group` for every event 😬, very inefficient):
```
# Tests from https://github.com/matrix-org/complement/pull/206
$ COMPLEMENT_ALWAYS_PRINT_SERVER_LOGS=1 COMPLEMENT_DIR=../complement ./scripts-dev/complement.sh TestBackfillingHistory/parallel/should_resolve_member_state_events_for_historical_events
create_new_client_event m.room.member event=$_JXfwUDIWS6xKGG4SmZXjSFrizhARM7QblhATVWWUcA state_group=None
create_new_client_event org.matrix.msc2716.insertion event=$1ZBfmBKEjg94d-vGYymKrVYeghwBOuGJ3wubU1-I9y0 state_group=9
create_new_client_event org.matrix.msc2716.insertion event=$Mq2JvRetTyclPuozRI682SAjYp3GqRuPc8_cH5-ezPY state_group=10
create_new_client_event m.room.message event=$MfmY4rBQkxrIp8jVwVMTJ4PKnxSigpG9E2cn7S0AtTo state_group=11
create_new_client_event m.room.message event=$uYOv6V8wiF7xHwOMt-60d1AoOIbqLgrDLz6ZIQDdWUI state_group=12
create_new_client_event m.room.message event=$PAbkJRMxb0bX4A6av463faiAhxkE3FEObM1xB4D0UG4 state_group=13
create_new_client_event org.matrix.msc2716.batch event=$Oy_S7AWN7rJQe_MYwGPEy6RtbYklrI-tAhmfiLrCaKI state_group=14
```

**After** (all events in batch sharing `state_group=10`) (the base insertion event has `state_group=8` which matches the `prev_event` we're inserting next to):

```
# Tests from https://github.com/matrix-org/complement/pull/206
$ COMPLEMENT_ALWAYS_PRINT_SERVER_LOGS=1 COMPLEMENT_DIR=../complement ./scripts-dev/complement.sh TestBackfillingHistory/parallel/should_resolve_member_state_events_for_historical_events
create_new_client_event m.room.member event=$PWomJ8PwENYEYuVNoG30gqtybuQQSZ55eldBUSs0i0U state_group=None
create_new_client_event org.matrix.msc2716.insertion event=$e_mCU7Eah9ABF6nQU7lu4E1RxIWccNF05AKaTT5m3lw state_group=9
create_new_client_event org.matrix.msc2716.insertion event=$ui7A3_GdXIcJq0C8GpyrF8X7B3DTjMd_WGCjogax7xU state_group=10
create_new_client_event m.room.message event=$EnTIM5rEGVezQJiYl62uFBl6kJ7B-sMxWqe2D_4FX1I state_group=10
create_new_client_event m.room.message event=$LGx5jGONnBPuNhAuZqHeEoXChd9ryVkuTZatGisOPjk state_group=10
create_new_client_event m.room.message event=$wW0zwoN50lbLu1KoKbybVMxLbKUj7GV_olozIc5i3M0 state_group=10
create_new_client_event org.matrix.msc2716.batch event=$5ZB6dtzqFBCEuMRgpkU201Qhx3WtXZGTz_YgldL6JrQ state_group=10
```
2021-10-13 17:44:00 -05:00
David Robertson 404444260a Fix upgrade dead links (#11069) 2021-10-13 14:32:43 +01:00
David Robertson 317e9e415c Rearrange the user_directory's _handle_deltas function (#11035)
* Pull out `_handle_room_membership_event`
* Discard excluded users early
* Rearrange logic so the change is membership is effectively switched over. See PR for rationale.
2021-10-13 12:50:00 +00:00
Sean Quah b59f3281d5 Remove dead code from MediaFilePaths (#11056) 2021-10-13 13:41:24 +01:00
David Robertson b3e9b00fb2 Merge remote-tracking branch 'origin/release-v1.45' into develop 2021-10-13 12:46:30 +01:00
Patrick Cloke 1f9d0b8a7a Add type hints to synapse.events.*. (#11066)
Except `synapse/events/__init__.py`, which will be done in a follow-up.
2021-10-13 07:24:07 -04:00
Azrenbeth cdd308845b Port the Password Auth Providers module interface to the new generic interface (#10548)
Co-authored-by: Azrenbeth <7782548+Azrenbeth@users.noreply.github.com>
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2021-10-13 11:21:52 +00:00
Patrick Cloke 732bbf6737 Be more lenient when parsing the version for oEmbed responses. (#11065) 2021-10-13 07:00:07 -04:00
David Robertson b83e822556 Stop user directory from failing if it encounters users not in the users table. (#11053)
The following scenarios would halt the user directory updater:

- user joins room
- user leaves room
- user present in room which switches from private to public, or vice versa.

for two classes of users:

- appservice senders
- users missing from the user table.

If this happened, the user directory would be stuck, unable to make forward progress.

Exclude both cases from the user directory, so that we ignore them.

Co-authored-by: Eric Eastwood <erice@element.io>
Co-authored-by: reivilibre <oliverw@matrix.org>
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2021-10-13 09:38:22 +00:00
reivilibre 2a2b189130 Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
Patrick Cloke 8711e15734 Always dump logs from trial during CI. (#11068)
Instead of only dumping them if trial passes.
2021-10-12 20:09:49 +00:00
Dirk Klimpel 988de0afb0 Simplify the user admin API tests (#11048) 2021-10-12 20:38:48 +01:00
Hillery Shay 5dcacdf6d1 Add support for ubuntu 21.10 "Impish Indri" (#11024)
* support ubuntu 21.10 indri

* add changelog

* update to correct codename

Co-authored-by: Brendan Abolivier <github@brendanabolivier.com>

Co-authored-by: Brendan Abolivier <github@brendanabolivier.com>
2021-10-12 11:29:39 -07:00
Patrick Cloke 9abc5f2a05 Merge remote-tracking branch 'origin/release-v1.45' into develop 2021-10-12 14:21:05 -04:00
Sean Quah 84f5d83257 Add tests for MediaFilePaths (#11057) 2021-10-12 18:19:35 +01:00
Sean Quah 8eaffe013c Update _wrap_in_base_path type hints to preserve function arguments (#11055) 2021-10-12 18:19:21 +01:00
Patrick Cloke 1db9282dfa Fix formatting string when oEmbed errors occur. (#11061) 2021-10-12 17:15:42 +00:00
Erik Johnston 77ea03086c Merge remote-tracking branch 'origin/release-v1.45' into develop 2021-10-12 14:41:13 +01:00
Erik Johnston 333d6f4e84 Fix race in MultiWriterIdGenerator (#11045)
The race allowed the current position to advance too far when stream IDs
are still being persisted.

This happened when it received a new stream ID from a remote write
between a new stream ID being allocated and it being added to the set of
unpersisted stream IDs.

Fixes #9424.
2021-10-12 14:27:09 +01:00
Patrick Cloke 5c35074d85 Reset global cache state before cache tests. (#11036)
This reverts #11019 and structures the code a bit more like it was before #10985.

The global cache state must be reset before running the tests since other test
cases might have configured caching (and thus touched the global state).
2021-10-12 12:55:33 +00:00
Sean Quah 36224e056a Add type hints to synapse.storage.databases.main.client_ips (#10972) 2021-10-12 13:50:34 +01:00
Brendan Abolivier a18c568516 Merge tag 'v1.45.0rc1' into develop
Synapse 1.45.0rc1 (2021-10-12)
==============================

**Note:** We are aware of [a performance issue](https://github.com/matrix-org/synapse/issues/11049) introduced in Synapse v1.44.0, as well as [a bug](https://github.com/matrix-org/synapse/issues/11025) with the user directory when using application services. While this release candidate doesn't fix either of those issues, a second release candidate is expected to come out in a few days to address them.

Media storage providers module that read from Synapse's configuration need changes as of this version, see the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#upgrading-to-v1450) for more information.

Features
--------

- Add [MSC3069](https://github.com/matrix-org/matrix-doc/pull/3069) support to `/account/whoami`. ([\#9655](https://github.com/matrix-org/synapse/issues/9655))
- Support autodiscovery of oEmbed previews. ([\#10822](https://github.com/matrix-org/synapse/issues/10822))
- Add a `user_may_send_3pid_invite` spam checker callback for modules to allow or deny 3PID invites. ([\#10894](https://github.com/matrix-org/synapse/issues/10894))
- Add a spam checker callback to allow or deny room joins. ([\#10910](https://github.com/matrix-org/synapse/issues/10910))
- Include an `update_synapse_database` script in the distribution. Contributed by @Fizzadar at Beeper. ([\#10954](https://github.com/matrix-org/synapse/issues/10954))
- Include exception information in JSON logging output. Contributed by @Fizzadar at Beeper. ([\#11028](https://github.com/matrix-org/synapse/issues/11028))

Bugfixes
--------

- Fix a minor bug in the response to `/_matrix/client/r0/voip/turnServer`. Contributed by @lukaslihotzki. ([\#10922](https://github.com/matrix-org/synapse/issues/10922))
- Fix a bug where empty `yyyy-mm-dd/` directories would be left behind in the media store's `url_cache_thumbnails/` directory. ([\#10924](https://github.com/matrix-org/synapse/issues/10924))
- Fix a bug introduced in Synapse v1.40.0 where the signature checks for room version 8 and 9 could be applied to earlier room versions in some situations. ([\#10927](https://github.com/matrix-org/synapse/issues/10927))
- Fix a long-standing bug wherein deactivated users still count towards the monthly active users limit. ([\#10947](https://github.com/matrix-org/synapse/issues/10947))
- Fix a long-standing bug which meant that events received over federation were sometimes incorrectly accepted into the room state. ([\#10956](https://github.com/matrix-org/synapse/issues/10956))
- Fix a long-standing bug where rebuilding the user directory wouldn't exclude support and deactivated users. ([\#10960](https://github.com/matrix-org/synapse/issues/10960))
- Fix [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint rejecting subsequent batches with unknown batch ID error in existing room versions from the room creator. ([\#10962](https://github.com/matrix-org/synapse/issues/10962))
- Fix a bug that could leak local users' per-room nicknames and avatars when the user directory is rebuilt. ([\#10981](https://github.com/matrix-org/synapse/issues/10981))
- Fix a long-standing bug where the remainder of a batch of user directory changes would be silently dropped if the server left a room early in the batch. ([\#10982](https://github.com/matrix-org/synapse/issues/10982))
- Correct a bugfix introduced in Synapse v1.44.0 that would catch the wrong error if a connection is lost before a response could be written to it. ([\#10995](https://github.com/matrix-org/synapse/issues/10995))
- Fix a long-standing bug where local users' per-room nicknames/avatars were visible to anyone who could see you in the user directory. ([\#11002](https://github.com/matrix-org/synapse/issues/11002))
- Fix a long-standing bug where a user's per-room nickname/avatar would overwrite their profile in the user directory when a room was made public. ([\#11003](https://github.com/matrix-org/synapse/issues/11003))
- Work around a regression, introduced in Synapse v1.39.0, that caused `SynapseError`s raised by the experimental third-party rules module callback `check_event_allowed` to be ignored. ([\#11042](https://github.com/matrix-org/synapse/issues/11042))
- Fix a bug in [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) insertion events in rooms that could cause cross-talk/conflicts between batches. ([\#10877](https://github.com/matrix-org/synapse/issues/10877))

Improved Documentation
----------------------

- Change wording ("reference homeserver") in Synapse repository documentation. Contributed by @maxkratz. ([\#10971](https://github.com/matrix-org/synapse/issues/10971))
- Fix a dead URL in development documentation (SAML) and change wording from "Riot" to "Element". Contributed by @maxkratz. ([\#10973](https://github.com/matrix-org/synapse/issues/10973))
- Add additional content to the Welcome and Overview page of the documentation. ([\#10990](https://github.com/matrix-org/synapse/issues/10990))
- Update links to MSCs in documentation. Contributed by @dklimpel. ([\#10991](https://github.com/matrix-org/synapse/issues/10991))

Internal Changes
----------------

- Improve type hinting in `synapse.util`. ([\#10888](https://github.com/matrix-org/synapse/issues/10888))
- Add further type hints to `synapse.storage.util`. ([\#10892](https://github.com/matrix-org/synapse/issues/10892))
- Fix type hints to be compatible with an upcoming change to Twisted. ([\#10895](https://github.com/matrix-org/synapse/issues/10895))
- Update utility code to handle C implementations of frozendict. ([\#10902](https://github.com/matrix-org/synapse/issues/10902))
- Drop old functionality which maintained database compatibility with Synapse versions before v1.31. ([\#10903](https://github.com/matrix-org/synapse/issues/10903))
- Clean-up configuration helper classes for the `ServerConfig` class. ([\#10915](https://github.com/matrix-org/synapse/issues/10915))
- Use direct references to config flags. ([\#10916](https://github.com/matrix-org/synapse/issues/10916), [\#10959](https://github.com/matrix-org/synapse/issues/10959), [\#10985](https://github.com/matrix-org/synapse/issues/10985))
- Clean up some of the federation event authentication code for clarity. ([\#10926](https://github.com/matrix-org/synapse/issues/10926), [\#10940](https://github.com/matrix-org/synapse/issues/10940), [\#10986](https://github.com/matrix-org/synapse/issues/10986), [\#10987](https://github.com/matrix-org/synapse/issues/10987), [\#10988](https://github.com/matrix-org/synapse/issues/10988), [\#11010](https://github.com/matrix-org/synapse/issues/11010), [\#11011](https://github.com/matrix-org/synapse/issues/11011))
- Refactor various parts of the codebase to use `RoomVersion` objects instead of room version identifier strings. ([\#10934](https://github.com/matrix-org/synapse/issues/10934))
- Refactor user directory tests in preparation for upcoming changes. ([\#10935](https://github.com/matrix-org/synapse/issues/10935))
- Include the event id in the logcontext when handling PDUs received over federation. ([\#10936](https://github.com/matrix-org/synapse/issues/10936))
- Fix logged errors in unit tests. ([\#10939](https://github.com/matrix-org/synapse/issues/10939))
- Fix a broken test to ensure that consent configuration works during registration. ([\#10945](https://github.com/matrix-org/synapse/issues/10945))
- Add type hints to filtering classes. ([\#10958](https://github.com/matrix-org/synapse/issues/10958))
- Add type-hint to `HomeserverTestcase.setup_test_homeserver`. ([\#10961](https://github.com/matrix-org/synapse/issues/10961))
- Fix the test utility function `create_room_as` so that `is_public=True` will explicitly set the `visibility` parameter of room creation requests to `public`. Contributed by @AndrewFerr. ([\#10963](https://github.com/matrix-org/synapse/issues/10963))
- Make the release script more robust and transparent. ([\#10966](https://github.com/matrix-org/synapse/issues/10966))
- Refactor [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` mega function into smaller handler functions. ([\#10974](https://github.com/matrix-org/synapse/issues/10974))
- Log stack traces when a missing opentracing span is detected. ([\#10983](https://github.com/matrix-org/synapse/issues/10983))
- Update GHA config to run tests against Python 3.10 and PostgreSQL 14. ([\#10992](https://github.com/matrix-org/synapse/issues/10992))
- Fix a long-standing bug where `ReadWriteLock`s could drop logging contexts on exit. ([\#10993](https://github.com/matrix-org/synapse/issues/10993))
- Add a `CODEOWNERS` file to automatically request reviews from the `@matrix-org/synapse-core` team on new pull requests. ([\#10994](https://github.com/matrix-org/synapse/issues/10994))
- Add further type hints to `synapse.state`. ([\#11004](https://github.com/matrix-org/synapse/issues/11004))
- Remove the deprecated `BaseHandler` object. ([\#11005](https://github.com/matrix-org/synapse/issues/11005))
- Bump mypy version for CI to 0.910, and pull in new type stubs for dependencies. ([\#11006](https://github.com/matrix-org/synapse/issues/11006))
- Fix CI to run the unit tests without optional deps. ([\#11017](https://github.com/matrix-org/synapse/issues/11017))
- Ensure that cache config tests do not share state. ([\#11019](https://github.com/matrix-org/synapse/issues/11019))
- Add additional type hints to `synapse.server_notices`. ([\#11021](https://github.com/matrix-org/synapse/issues/11021))
- Add additional type hints for `synapse.push`. ([\#11023](https://github.com/matrix-org/synapse/issues/11023))
- When installing the optional developer dependencies, also include the dependencies needed for type-checking and unit testing. ([\#11034](https://github.com/matrix-org/synapse/issues/11034))
- Remove unnecessary list comprehension from `synapse_port_db` to satisfy code style requirements. ([\#11043](https://github.com/matrix-org/synapse/issues/11043))
2021-10-12 12:33:41 +01:00
Brendan Abolivier a5871f53ed Fixup changelog 2021-10-12 11:43:13 +01:00
Brendan Abolivier 8afa48f7f6 Typo 2021-10-12 11:38:33 +01:00
Brendan Abolivier f6b62bdc4d Add a link to the upgrade notes 2021-10-12 11:36:27 +01:00
Sean Quah b8b905c4ea Fix inconsistent behavior of get_last_client_by_ip (#10970)
Make `get_last_client_by_ip` return the same dictionary structure
regardless of whether the data has been persisted to the database.

This change will allow slightly cleaner type hints to be applied later
on.
2021-10-12 11:24:05 +01:00
Brendan Abolivier 9e13cd98af Update upgrade notes 2021-10-12 11:23:51 +01:00
Sean Quah 6b18eb4430 Fix opentracing and Prometheus metrics for replication requests (#10996)
This commit fixes two bugs to do with decorators not instrumenting
`ReplicationEndpoint`'s `send_request` correctly. There are two
decorators on `send_request`: Prometheus' `Gauge.track_inprogress()`
and Synapse's `opentracing.trace`.

`Gauge.track_inprogress()` does not have any support for async
functions when used as a decorator. Since async functions behave like
regular functions that return coroutines, only the creation of the
coroutine was covered by the metric and none of the actual body of
`send_request`.

`Gauge.track_inprogress()` returns a regular, non-async function
wrapping `send_request`, which is the source of the next bug.
The `opentracing.trace` decorator would normally handle async functions
correctly, but since the wrapped `send_request` is a non-async function,
the decorator ends up suffering from the same issue as
`Gauge.track_inprogress()`: the opentracing span only measures the
creation of the coroutine and none of the actual function body.

Using `Gauge.track_inprogress()` as a context manager instead of a
decorator resolves both bugs.
2021-10-12 11:23:46 +01:00
Brendan Abolivier b01e953291 Add warning about known issues 2021-10-12 10:58:26 +01:00
Brendan Abolivier 60af28c5dd Fixup changelog 2021-10-12 10:55:39 +01:00
Brendan Abolivier 8c5255b664 1.45.0rc1 2021-10-12 10:47:15 +01:00
reivilibre 406f7bfa17 Add an approximate difference method to StateFilters (#10825) 2021-10-12 10:44:59 +01:00
David Robertson e0f11ae4a5 disallow-untyped-defs for synapse.push (#11023) 2021-10-11 17:42:10 +01:00
reivilibre 5e29d417fc Include the requirements for [mypy,lint] in [dev] (#11034) 2021-10-11 16:34:31 +01:00
reivilibre 3828dd819b Pass through SynapseErrors that are raised from experimental check_event_allowed callback of the module API (#11042)
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2021-10-11 16:29:02 +01:00
reivilibre 4c838112dc Remove unnecessary list comprehension in synapse_port_db to fix linting in CI (#11043) 2021-10-11 16:28:29 +01:00
reivilibre b742cb2e4a Release script improvements (#10966)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-10-11 14:48:38 +01:00
Eric Eastwood a7d22c36db Refactor MSC2716 /batch_send endpoint into separate handler functions (#10974) 2021-10-08 18:35:00 -05:00
Patrick Cloke 1b112840d2 Autodiscover oEmbed endpoint from returned HTML (#10822)
Searches the returned HTML for an oEmbed endpoint using the
autodiscovery mechanism (`<link rel=...>`), and will request it
to generate the preview.
2021-10-08 14:14:42 -04:00
Olivier Wilkinson (reivilibre) 593eeac19e Revert accidental push to develop. 2021-10-08 17:17:22 +01:00
Olivier Wilkinson (reivilibre) d51a340019 Newsfile
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2021-10-08 17:12:40 +01:00
Olivier Wilkinson (reivilibre) 9f23ff78da Update contributing guide to use [all,dev] 2021-10-08 17:11:32 +01:00
Olivier Wilkinson (reivilibre) c576598a68 Include the requirements for [mypy,lint] in [dev] 2021-10-08 17:11:14 +01:00
David Robertson 51a5da74cc Annotate synapse.storage.util (#10892)
Also mark `synapse.streams` as having has no untyped defs

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2021-10-08 14:25:16 +00:00
David Robertson 797ee7812d Relax ignore-missing-imports for modules that have stubs now and update mypy (#11006)
Updating mypy past version 0.9 means that third-party stubs are no-longer distributed with typeshed. See http://mypy-lang.blogspot.com/2021/06/mypy-0900-released.html for details.
We therefore pull in stub packages in setup.py

Additionally, some modules that we were previously ignoring import failures for now have stubs. So let's use them.

The rest of this change consists of fixups to make the newer mypy + stubs pass CI.

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-10-08 14:49:41 +01:00
David Robertson 670a8d9a1e Fix overwriting profile when making room public (#11003)
This splits apart `handle_new_user` into a function which adds an entry to the `user_directory` and a function which updates the room sharing tables. I plan to continue doing more of this kind of refactoring to clarify the implementation.
2021-10-08 12:52:48 +01:00
Patrick Cloke eb9ddc8c2e Remove the deprecated BaseHandler. (#11005)
The shared ratelimit function was replaced with a dedicated
RequestRatelimiter class (accessible from the HomeServer
object).

Other properties were copied to each sub-class that inherited
from BaseHandler.
2021-10-08 07:44:43 -04:00
Sean Quah 49a683d871 Fix long-standing bug where ReadWriteLock could drop logging contexts (#10993)
Use `PreserveLoggingContext()` to ensure that logging contexts are not
lost when exiting a read/write lock.

When exiting a read/write lock, callbacks on a `Deferred` are triggered
as a signal to any waiting coroutines. Any waiting coroutine that
becomes runnable is likely to follow the Synapse logging context rules
and will restore its own logging context, then either run to completion
or await another `Deferred`, resetting the logging context in the
process.
2021-10-08 12:27:16 +01:00
Nick Barrett bb228f3523 Include exception in json logging (#11028) 2021-10-08 13:08:25 +02:00
Erik Johnston 0b4d5ce5e3 Fix CI to run the unit tests without optional deps (#11017)
This also turns off calculating code coverage, as we didn't use it and it was a lot of noise
2021-10-08 10:05:48 +01:00
David Robertson e79ee48313 disallow-untyped-defs for synapse.server_notices (#11021) 2021-10-07 19:55:15 +01:00
Patrick Cloke 7301019d48 Ensure each cache config test uses separate state. (#11019)
Hopefully this fixes these tests sometimes failing in CI.
2021-10-07 09:38:31 -04:00
David Robertson e0bf34dada Don't alter directory entries for local users when setting a per-room nickname (#11002)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-10-07 13:26:11 +01:00
Richard van der Hoff 96fe77c254 Improve the logging in _auth_and_persist_outliers (#11010)
Include the event ids being peristed
2021-10-07 11:43:25 +00:00
Richard van der Hoff 86af6b2f0e Add a comment in _process_received_pdu (#11011) 2021-10-07 12:20:03 +01:00
Brendan Abolivier 52aefd5086 Catch AttributeErrors when calling registerProducer (#10995)
Looks like the wrong exception type was caught in #10932.
2021-10-07 10:37:10 +00:00
David Robertson f563676c09 disallow-untyped-defs for synapse.state (#11004)
* `disallow-untyped-defs` for `synapse.state`

Much smaller than I was expecting!
2021-10-06 17:55:25 +00:00
Andrew Morgan e564bdd127 Add content to the Synapse documentation intro page (#10990)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-10-06 17:09:35 +00:00
Brendan Abolivier 4e51621064 Add a spamchecker method to allow or deny 3pid invites (#10894)
This is in the context of creating new module callbacks that modules in https://github.com/matrix-org/synapse-dinsic can use, in an effort to reconcile the spam checker API in synapse-dinsic with the one in mainline.

Note that a module callback already exists for 3pid invites (https://matrix-org.github.io/synapse/develop/modules/third_party_rules_callbacks.html#check_threepid_can_be_invited) but it doesn't check whether the sender of the invite is allowed to send it.
2021-10-06 17:18:13 +02:00
Patrick Cloke f4b1a9a527 Require direct references to configuration variables. (#10985)
This removes the magic allowing accessing configurable
variables directly from the config object. It is now required
that a specific configuration class is used (e.g. `config.foo`
must be replaced with `config.server.foo`).
2021-10-06 10:47:41 -04:00
Brendan Abolivier 829f2a82b0 Add a spamchecker callback to allow or deny room joins (#10910)
Co-authored-by: Erik Johnston <erik@matrix.org>
2021-10-06 14:32:16 +00:00
Brendan Abolivier b0460936c8 Add the synapse-core team as code owners (#10994)
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2021-10-06 16:03:17 +02:00
David Robertson 370bca32e6 Don't drop user dir deltas when server leaves room (#10982)
Fix a long-standing bug where a batch of user directory changes would be
silently dropped if the server left a room early in the batch.

* Pull out `wait_for_background_update` in tests

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-10-06 12:56:45 +00:00
Max Kratz 38b7db5885 Updated development doc on samling environment for testing. (#10973) 2021-10-06 07:20:41 -04:00
Nick Barrett c80878d22a Add --run-background-updates option to update_database script. (#10954)
Signed-off-by: Nick Barrett <nick@beeper.com>
2021-10-06 11:26:18 +01:00
David Robertson f8d0f72b27 More types for synapse.util, part 1 (#10888)
The following modules now pass `disallow_untyped_defs`:

* synapse.util.caches.cached_call 
* synapse.util.caches.lrucache
* synapse.util.caches.response_cache 
* synapse.util.caches.stream_change_cache
* synapse.util.caches.ttlcache pass
* synapse.util.daemonize
* synapse.util.patch_inline_callbacks pass `no-untyped-defs`
* synapse.util.versionstring

Additional typing in synapse.util.metrics. Didn't get this to pass `no-untyped-defs`, think I'll need to watch #10847
2021-10-06 11:20:49 +01:00
Max Kratz 6744273f0b Remove "reference" wording according Synapse homeserver (#10971) 2021-10-06 10:05:07 +00:00
David Robertson 4f00432ce1 Fix potential leak of per-room profiles when the user dir is rebuilt. (#10981)
There are two steps to rebuilding the user directory:

1. a scan over rooms, followed by
2. a scan over local users.

The former reads avatars and display names from the `room_memberships`
table and therefore contains potentially private avatars and
display names. The latter reads from the the `profiles` table which only
contains public data; moreover it will overwrite any private profiles
that the rooms scan may have written to the user directory. This means
that the rebuild could leak private user while the rebuild was in
progress, only to later cover up the leaks once the rebuild had completed.

This change skips over local users when writing user_directory rows
when scanning rooms. Doing so means that it'll take longer for a rebuild
to make local users searchable, which is unfortunate. I think a future
PR can improve this by swapping the order of the two steps above. (And
indeed there's more to do here, e.g. copying from `profiles` without
going via Python.)

Small tidy-ups while I'm here:

* Remove duplicated code from test_initial. This was meant to be pulled into `purge_and_rebuild_user_dir`.
* Move `is_public` before updating sharing tables. No functional change; it's still before the first read of `is_public`.
* Don't bother creating a set from dict keys. Slightly nicer and makes the code simpler.

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-10-05 18:35:25 +01:00
Eric Eastwood 392863fbf1 Fix logic flaw preventing tracking of MSC2716 events in existing room versions (#10962)
We correctly allowed using the MSC2716 batch endpoint for
the room creator in existing room versions but accidentally didn't track
the events because of a logic flaw.

This prevented you from connecting subsequent chunks together because it would
throw the unknown batch ID error.

We only want to process MSC2716 events when:

 - The room version supports MSC2716
 - Any room where the homeserver has the `msc2716_enabled` experimental feature enabled and the event is from the room creator
2021-10-05 11:51:57 -05:00
Brendan Abolivier 2faac70e63 Merge branch 'master' into develop 2021-10-05 14:13:25 +01:00
Richard van der Hoff 3a5b0cbe7a Ensure that we reject events which use rejected events for auth (#10956)
When we consider whether to accept events, we should not accept those which
depend on rejected events for their auth events.

This (together with earlier changes such as
https://github.com/matrix-org/synapse/pull/10771 and
https://github.com/matrix-org/synapse/pull/10896) forms a partial fix to
https://github.com/matrix-org/synapse/issues/9595. There still remain code
paths where we do not check the `auth_events` at all.
2021-10-05 13:23:29 +01:00
Richard van der Hoff 787af4a106 Host cache_joined_hosts_for_event to caller (#10986)
`_check_event_auth` is only called in two places, and only one of those sets
`send_on_behalf_of`. Warming the cache isn't really part of auth anyway, so
moving it out makes a lot more sense.
2021-10-05 13:01:41 +01:00
Richard van der Hoff d099535deb _update_auth_events_and_context_for_auth: add some comments (#10987)
Add some more comments about wtf is going on here.
2021-10-05 12:50:38 +01:00
Richard van der Hoff cb88ed912b _check_event_auth: move event validation earlier (#10988)
There's little point in doing a fancy state reconciliation dance if the event
itself is invalid.

Likewise, there's no point checking it again in `_check_for_soft_fail`.
2021-10-05 12:50:07 +01:00
David Robertson 6f6e956338 Run CI with Python 3.10 and Postgres 14 (#10992) 2021-10-05 12:43:04 +01:00
Dirk Klimpel 7036a7a60a Update links to MSCs in documentation (#10991)
Based on matrix-doc switching from master -> main and
MSCs being merged.
2021-10-05 11:35:19 +00:00
Sean Quah 660c8c1415 Log stack traces when a missing opentracing span is detected (#10983)
Make it easier to track down where opentracing spans are going missing
by including stack traces in the logs.
2021-10-05 12:23:25 +01:00
Hillery Shay eda8c88b84 Add functionality to remove deactivated users from the monthly_active_users table (#10947)
* add test

* add function to remove user from monthly active table in deactivate code

* add function to remove user from monthly active table

* add changelog entry

* update changelog number

* requested changes

* update docstring on new function

* fix lint error

* Update synapse/storage/databases/main/monthly_active_users.py

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-10-04 08:34:42 -07:00
AndrewFerr 30f0240401 Make is_public Optional[bool] for create_room_as test util (#10951) (#10963)
Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
2021-10-04 14:43:03 +00:00
Brendan Abolivier 730b40dd5e Merge tag 'v1.44.0rc3' into develop
Synapse 1.44.0rc3 (2021-10-04)
==============================

Bugfixes
--------

- Fix a bug introduced in Synapse v1.40.0 where changing a user's display name or avatar in a restricted room would cause an authentication error. ([\#10933](https://github.com/matrix-org/synapse/issues/10933))
- Fix `/admin/whois/{user_id}` endpoint, which was broken in v1.44.0rc1. ([\#10968](https://github.com/matrix-org/synapse/issues/10968))
2021-10-04 15:33:42 +01:00
David Robertson f7b034a24b Consistently exclude from user_directory (#10960)
* Introduce `should_include_local_users_in_dir`

We exclude three kinds of local users from the user_directory tables. At
present we don't consistently exclude all three in the same places. This
commit introduces a new function to gather those exclusion conditions
together. Because we have to handle local and remote users in different
ways, I've made that function only consider the case of remote users.
It's the caller's responsibility to make the local versus remote
distinction clear and correct.

A test fixup is required. The test now hits a path which makes db
queries against the users table. The expected rows were missing, because
we were using a dummy user that hadn't actually been registered.

We also add new test cases to covert the exclusion logic.

----

By my reading this makes these changes:

* When an app service user registers or changes their profile, they will
  _not_ be added to the user directory. (Previously only support and
  deactivated users were excluded). This is consistent with the logic that
  rebuilds the user directory. See also [the discussion
  here](https://github.com/matrix-org/synapse/pull/10914#discussion_r716859548).
* When rebuilding the directory, exclude support and disabled users from
  room sharing tables. Previously only appservice users were excluded.
* Exclude all three categories of local users when rebuilding the
  directory. Previously `_populate_user_directory_process_users` didn't do
  any exclusion.

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-10-04 11:45:51 +00:00
Patrick Cloke a0f48ee89d Use direct references for configuration variables (part 7). (#10959) 2021-10-04 07:18:54 -04:00
Patrick Cloke a071144a5c Merge remote-tracking branch 'origin/release-v1.44' into develop 2021-10-01 12:21:28 -04:00
David Robertson e46ac85d67 type-hint HomeserverTestcase.setup_test_homeserver (#10961)
* type-hint `HomeserverTestcase.setup_test_homeserver`

For better IDE completion. A small drive-by.
2021-10-01 12:22:47 +01:00
Patrick Cloke 7e440520c9 Add type hints to filtering classes. (#10958) 2021-10-01 07:02:32 -04:00
Patrick Cloke 9e5a429c8b Clean-up registration tests (#10945)
Uses `override_config` and fixes test_auto_create_auto_join_where_no_consent
to properly configure auto-join rooms.
2021-09-30 14:06:02 -04:00
Patrick Cloke d1bf5f7c9d Strip "join_authorised_via_users_server" from join events which do not need it. (#10933)
This fixes a "Event not signed by authorising server" error when
transition room member from join -> join, e.g. when updating a
display name or avatar URL for restricted rooms.
2021-09-30 11:13:59 -04:00
Patrick Cloke 7d84d2523a Fix errors in Synapse logs from unit tests. (#10939)
Fix some harmless errors from background processes (mostly
due to awaiting Mock objects) that occurred in the Synapse
logs during unit tests.
2021-09-30 11:03:29 -04:00
Olivier Wilkinson (reivilibre) 44dee1fe8c Merge tag 'v1.44.0rc2' into develop
Synapse 1.44.0rc2 (2021-09-30)
==============================

Bugfixes
--------

- Fix a bug introduced in v1.44.0rc1 which caused the experimental [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint to return a 500 error. ([\#10938](https://github.com/matrix-org/synapse/issues/10938))
- Fix a bug introduced in v1.44.0rc1 which prevented sending presence events to application services. ([\#10944](https://github.com/matrix-org/synapse/issues/10944))

Improved Documentation
----------------------

- Minor updates to the installation instructions. ([\#10919](https://github.com/matrix-org/synapse/issues/10919))
2021-09-30 13:40:24 +01:00
Lukas Lihotzki 145cb6d08e Fix getTurnServer response: return an integer ttl (#10922)
`ttl` must be an integer according to the OpenAPI spec:
https://github.com/matrix-org/matrix-doc/blob/old_master/data/api/client-server/voip.yaml#L70

True division (`/`) returns a float instead (`"ttl": 7200.0`).
Floor division (`//`) returns an integer, so the response is spec compliant.

Signed-off-by: Lukas Lihotzki <lukas@lihotzki.de>
2021-09-30 08:04:55 -04:00
David Robertson 29364145b2 Pass str to twisted's IReactorTCP (#10895)
This follows a correction made in twisted/twisted#1664 and should fix our Twisted Trial CI job.

Until that change is in a twisted release, we'll have to ignore the type
of the `host` argument. I've raised #10899 to remind us to review the
issue in a few months' time.
2021-09-30 12:51:47 +01:00
David Robertson 3aefc7b66d Refactor user directory tests (#10935)
* Pull out GetUserDirectoryTables helper
* Don't rebuild the dir in tests that don't need it

In #10796 I changed registering a user to add directory entries under.
This means we don't have to force a directory regbuild in to tests of
the user directory search.

* Move test_initial to tests/storage
* Add type hints to both test_user_directory files

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-09-30 11:04:40 +01:00
Richard van der Hoff 428174f902 Split event_auth.check into two parts (#10940)
Broadly, the existing `event_auth.check` function has two parts:
 * a validation section: checks that the event isn't too big, that it has the rught signatures, etc. 
   This bit is independent of the rest of the state in the room, and so need only be done once 
   for each event.
 * an auth section: ensures that the event is allowed, given the rest of the state in the room.
   This gets done multiple times, against various sets of room state, because it forms part of
   the state res algorithm.

Currently, this is implemented with `do_sig_check` and `do_size_check` parameters, but I think
that makes everything hard to follow. Instead, we split the function in two and call each part
separately where it is needed.
2021-09-29 18:59:15 +01:00
Olivier Wilkinson (reivilibre) a19aa8b162 Merge tag 'v1.44.0rc1' into develop
Synapse 1.44.0rc1 (2021-09-29)
==============================

Features
--------

- Only allow the
[MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716)
`/batch_send?chunk_id=xxx` endpoint to connect to an already existing
insertion event.
([\#10776](https://github.com/matrix-org/synapse/issues/10776))
- Improve oEmbed URL previews by processing the author name, photo, and
video information.
([\#10814](https://github.com/matrix-org/synapse/issues/10814),
[\#10819](https://github.com/matrix-org/synapse/issues/10819))
- Speed up responding with large JSON objects to requests.
([\#10868](https://github.com/matrix-org/synapse/issues/10868),
[\#10905](https://github.com/matrix-org/synapse/issues/10905))
- Add a `user_may_create_room_with_invites` spam checker callback to
allow modules to allow or deny a room creation request based on the
invites and/or 3PID invites it includes.
([\#10898](https://github.com/matrix-org/synapse/issues/10898))

Bugfixes
--------

- Fix a long-standing bug that caused an `AssertionError` when purging
history in certain rooms. Contributed by @Kokokokoka.
([\#10690](https://github.com/matrix-org/synapse/issues/10690))
- Fix a long-standing bug which caused deactivated users that were later
reactivated to be missing from the user directory.
([\#10782](https://github.com/matrix-org/synapse/issues/10782))
- Fix a long-standing bug that caused unbanning a user by sending a
membership event to fail. Contributed by @aaronraimist.
([\#10807](https://github.com/matrix-org/synapse/issues/10807))
- Fix a long-standing bug where logging contexts would go missing when
federation requests time out.
([\#10810](https://github.com/matrix-org/synapse/issues/10810))
- Fix a long-standing bug causing an error in the deprecated
`/initialSync` endpoint when using the undocumented `from` and `to`
parameters.
([\#10827](https://github.com/matrix-org/synapse/issues/10827))
- Fix a bug causing the `remove_stale_pushers` background job to
repeatedly fail and log errors. This bug affected Synapse servers that
had been upgraded from version 1.28 or older and are using SQLite.
([\#10843](https://github.com/matrix-org/synapse/issues/10843))
- Fix a long-standing bug in Unicode support of the room search admin
API breaking search for rooms with non-ASCII characters.
([\#10859](https://github.com/matrix-org/synapse/issues/10859))
- Fix a bug introduced in Synapse 1.37.0 which caused `knock` membership
events which we sent to remote servers to be incorrectly stored in the
local database.
([\#10873](https://github.com/matrix-org/synapse/issues/10873))
- Fix invalidating one-time key count cache after claiming keys. The bug
was introduced in Synapse v1.41.0. Contributed by Tulir at Beeper.
([\#10875](https://github.com/matrix-org/synapse/issues/10875))
- Fix a long-standing bug causing application service users to be
subject to MAU blocking if the MAU limit had been reached, even if
configured not to be blocked.
([\#10881](https://github.com/matrix-org/synapse/issues/10881))
- Fix a long-standing bug which could cause events pulled over
federation to be incorrectly rejected.
([\#10907](https://github.com/matrix-org/synapse/issues/10907))
- Fix a long-standing bug causing URL cache files to be stored in
storage providers. Server admins may safely delete the `url_cache/` and
`url_cache_thumbnails/` directories from any configured storage
providers to reclaim space.
([\#10911](https://github.com/matrix-org/synapse/issues/10911))
- Fix a long-standing bug leading to race conditions when creating media
store and config directories.
([\#10913](https://github.com/matrix-org/synapse/issues/10913))

Improved Documentation
----------------------

- Fix some crashes in the Module API example code, by adding JSON
encoding/decoding.
([\#10845](https://github.com/matrix-org/synapse/issues/10845))
- Add developer documentation about experimental configuration flags.
([\#10865](https://github.com/matrix-org/synapse/issues/10865))
- Properly remove deleted files from GitHub pages when generating the
documentation.
([\#10869](https://github.com/matrix-org/synapse/issues/10869))

Internal Changes
----------------

- Fix GitHub Actions config so we can run sytest on synapse from
parallel branches.
([\#10659](https://github.com/matrix-org/synapse/issues/10659))
- Split out
[MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) meta
events to their own fields in the `/batch_send` response.
([\#10777](https://github.com/matrix-org/synapse/issues/10777))
- Add missing type hints to REST servlets.
([\#10785](https://github.com/matrix-org/synapse/issues/10785),
[\#10817](https://github.com/matrix-org/synapse/issues/10817))
- Simplify the internal logic which maintains the user directory
database tables.
([\#10796](https://github.com/matrix-org/synapse/issues/10796))
- Use direct references to config flags.
([\#10812](https://github.com/matrix-org/synapse/issues/10812),
[\#10885](https://github.com/matrix-org/synapse/issues/10885),
[\#10893](https://github.com/matrix-org/synapse/issues/10893),
[\#10897](https://github.com/matrix-org/synapse/issues/10897))
- Specify the type of token in generic "Invalid token" error messages.
([\#10815](https://github.com/matrix-org/synapse/issues/10815))
- Make `StateFilter` frozen so it is hashable.
([\#10816](https://github.com/matrix-org/synapse/issues/10816))
- Fix a long-standing bug where an `m.room.message` event containing a
null byte would cause an internal server error.
([\#10820](https://github.com/matrix-org/synapse/issues/10820))
- Add type hints to the state database.
([\#10823](https://github.com/matrix-org/synapse/issues/10823))
- Opt out of cache expiry for `get_users_who_share_room_with_user`, to
hopefully improve `/sync` performance when you
haven't synced recently.
([\#10826](https://github.com/matrix-org/synapse/issues/10826))
- Track cache eviction rates more finely in Prometheus's monitoring.
([\#10829](https://github.com/matrix-org/synapse/issues/10829))
- Add missing type hints to `synapse.handlers`.
([\#10831](https://github.com/matrix-org/synapse/issues/10831),
[\#10856](https://github.com/matrix-org/synapse/issues/10856))
- Extend the Module API to let plug-ins check whether an ID is local and
to access IP + User Agent data.
([\#10833](https://github.com/matrix-org/synapse/issues/10833))
- Factor out PNG image data to a constant to be used in several tests.
([\#10834](https://github.com/matrix-org/synapse/issues/10834))
- Add a test to ensure state events sent by modules get persisted
correctly.
([\#10835](https://github.com/matrix-org/synapse/issues/10835))
- Rename [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716)
fields and event types from `chunk` to `batch` to match the
`/batch_send` endpoint.
([\#10838](https://github.com/matrix-org/synapse/issues/10838))
- Rename [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716)
`/batch_send` query parameter from `?prev_event` to more obvious usage
with `?prev_event_id`.
([\#10839](https://github.com/matrix-org/synapse/issues/10839))
- Add type hints to `synapse.http.site`.
([\#10867](https://github.com/matrix-org/synapse/issues/10867))
- Include outlier status when we log V2 or V3 events.
([\#10879](https://github.com/matrix-org/synapse/issues/10879))
- Break down Grafana's cache expiry time series based on reason for
eviction, c.f.
[\#10829](https://github.com/matrix-org/synapse/issues/10829).
([\#10880](https://github.com/matrix-org/synapse/issues/10880))
- Clean up some of the federation event authentication code for clarity.
([\#10883](https://github.com/matrix-org/synapse/issues/10883),
[\#10884](https://github.com/matrix-org/synapse/issues/10884),
[\#10896](https://github.com/matrix-org/synapse/issues/10896),
[\#10901](https://github.com/matrix-org/synapse/issues/10901))
- Allow the `.` and `~` characters when creating registration tokens as
per the change to
[MSC3231](https://github.com/matrix-org/matrix-doc/pull/3231).
([\#10887](https://github.com/matrix-org/synapse/issues/10887))
- Clean up some unnecessary parentheses in places around the codebase.
([\#10889](https://github.com/matrix-org/synapse/issues/10889))
- Improve type hinting in the user directory code.
([\#10891](https://github.com/matrix-org/synapse/issues/10891))
- Update development testing script `test_postgresql.sh` to use a
supported Python version and make re-runs quicker.
([\#10906](https://github.com/matrix-org/synapse/issues/10906))
- Document and summarize changes in schema version `61` – `64`.
([\#10917](https://github.com/matrix-org/synapse/issues/10917))
- Update release script to sign the newly created git tags.
([\#10925](https://github.com/matrix-org/synapse/issues/10925))
- Fix Debian builds due to `dh-virtualenv` no longer being able to build
their docs.
([\#10931](https://github.com/matrix-org/synapse/issues/10931))

F124520CEEE062448FE1C8442D2EFA2F32FBE047
<olivier@librepush.net>" [ultimate]
2021-09-29 14:23:39 +01:00
Richard van der Hoff 176aa55fd5 add event id to logcontext when handling incoming PDUs (#10936) 2021-09-29 11:59:43 +01:00
Patrick Cloke 94b620a5ed Use direct references for configuration variables (part 6). (#10916) 2021-09-29 06:44:15 -04:00
Travis Ralston 8cef1ab2ac Implement MSC3069: Guest support on whoami (#9655) 2021-09-29 11:32:45 +01:00
Richard van der Hoff 5279b9161b Use RoomVersion objects (#10934)
Various refactors to use `RoomVersion` objects instead of room version identifiers.
2021-09-29 10:57:10 +01:00
Sean Quah 2be0fde3d6 Fix empty url_cache_thumbnails/yyyy-mm-dd/ directories being left behind (#10924) 2021-09-29 10:24:37 +01:00
Eric Eastwood 9fd057b8c5 Ensure (room_id, next_batch_id) is unique to avoid cross-talk/conflicts between batches (MSC2716) (#10877)
Part of [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716)

Part of https://github.com/matrix-org/synapse/issues/10737
2021-09-28 21:23:16 -05:00
Hillery Shay 0f007fe009 Update utility code to handle C implementations of frozendict (#10902)
* update _handle_frozendict to work with c implementations of frozen dict

* add changelog

* add clarifying comment to _handle_frozendict
2021-09-28 09:13:23 -07:00
Richard van der Hoff 8aaa4b7b5d Drop backwards-compatibility support for "outlier" (#10903)
Before Synapse 1.31 (#9411), we relied on `outlier` being stored in the
`internal_metadata` column. We can now assume nobody will roll back their
deployment that far and drop the legacy support.
2021-09-28 15:25:36 +01:00
Richard van der Hoff 2622b28c5c Inline _check_event_auth for outliers (#10926)
* Inline `_check_event_auth` for outliers

When we are persisting an outlier, most of `_check_event_auth` is redundant:

 * `_update_auth_events_and_context_for_auth` does nothing, because the
   `input_auth_events` are (now) exactly the event's auth_events,
   which means that `missing_auth` is empty.

 * we don't care about soft-fail, kicking guest users or `send_on_behalf_of`
   for outliers

... so the only thing that matters is the auth itself, so let's just do that.

* `_auth_and_persist_fetched_events_inner`: de-async `prep`

`prep` no longer calls any `async` methods, so let's make it synchronous.

* Simplify `_check_event_auth`

We no longer need to support outliers here, which makes things rather simpler.

* changelog

* lint
2021-09-28 15:25:07 +01:00
Patrick Cloke eb2c7e51c4 Clean-up type hints in server config (#10915)
By using attrs instead of dicts to store configuration.

Also updates some of the attrs classes to use proper type
hints and auto_attribs.
2021-09-28 09:24:40 -04:00
Patrick Cloke c3ccad7785 Only do restricted join rules signature checks for room versions 8/9. (#10927)
Otherwise the presence of a (bogus, unused) field could cause
auth checks to fail.
2021-09-28 08:44:19 -04:00
Brendan Abolivier 95f29bce7f Revert shadow HS support (#104)
Revert shadow HS support added in matrix-org/synapse#4145

Fixes matrix-org/matrix-dinsic#803

Part of that PR isn't reverted because it relates to matrix-org/matrix-dinsic#793
2021-09-27 16:12:12 +02:00
Brendan Abolivier 6b439a7d65 Remove duplicate job
Forgot to include this commit in #106
2021-09-27 12:29:36 +01:00
Brendan Abolivier c16eb52571 Use correct tag for sytest (#106) 2021-09-27 13:26:50 +02:00
Brendan Abolivier d55437772d Use the BaseReporter super-class for _WrappedRustReporter (#105)
* Use  the BaseReporter super-class for _WrappedRustReporter. (#10799)

This fixes mypy errors with jaeger-client >= 4.7.0 and should be a no-op
for versions before that.

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-09-22 17:00:54 +02:00
Brendan Abolivier b8d9726b96 Merge branch 'babolivier/dinsic_1.41.0' into dinsic 2021-09-07 14:26:47 +01:00
Brendan Abolivier a45de9e8d0 Incorporate review 2021-09-03 12:08:03 +01:00
Brendan Abolivier 6355ca39ad Merge tag 'v1.41.1' into babolivier/dinsic_1.41.0
Synapse 1.41.1 (2021-08-31)
===========================

Due to the two security issues highlighted below, server administrators are encouraged to update Synapse. We are not aware of these vulnerabilities being exploited in the wild.

Security advisory
-----------------

The following issues are fixed in v1.41.1.

- **[GHSA-3x4c-pq33-4w3q](https://github.com/matrix-org/synapse/security/advisories/GHSA-3x4c-pq33-4w3q) / [CVE-2021-39164](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-39164): Enumerating a private room's list of members and their display names.**

  If an unauthorized user both knows the Room ID of a private room *and* that room's history visibility is set to `shared`, then they may be able to enumerate the room's members, including their display names.

  The unauthorized user must be on the same homeserver as a user who is a member of the target room.

  Fixed by [52c7a51cf](https://github.com/matrix-org/synapse/commit/52c7a51cf).

- **[GHSA-jj53-8fmw-f2w2](https://github.com/matrix-org/synapse/security/advisories/GHSA-jj53-8fmw-f2w2) / [CVE-2021-39163](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-39163): Disclosing a private room's name, avatar, topic, and number of members.**

  If an unauthorized user knows the Room ID of a private room, then its name, avatar, topic, and number of members may be disclosed through Group / Community features.

  The unauthorized user must be on the same homeserver as a user who is a member of the target room, and their homeserver must allow non-administrators to create groups (`enable_group_creation` in the Synapse configuration; off by default).

  Fixed by [cb35df940a](https://github.com/matrix-org/synapse/commit/cb35df940a), [\#10723](https://github.com/matrix-org/synapse/issues/10723).

Bugfixes
--------

- Fix a regression introduced in Synapse 1.41 which broke email transmission on systems using older versions of the Twisted library. ([\#10713](https://github.com/matrix-org/synapse/issues/10713))
2021-09-02 17:43:22 +01:00
Brendan Abolivier 50751a2b89 Use correct federation path for knocking 2021-09-02 17:33:43 +01:00
Brendan Abolivier ab5343c30e Lint 2021-09-02 12:12:13 +01:00
Brendan Abolivier 5eb9976a01 Import mock from unittest 2021-09-02 12:10:00 +01:00
Brendan Abolivier 5426111c31 Fix test_rewritten_id_server 2021-09-02 11:24:43 +01:00
Brendan Abolivier 0eed68c3ed Lint 2021-09-02 11:07:14 +01:00
Brendan Abolivier 660837fb9e Appease mypy 2021-09-02 11:06:45 +01:00
Brendan Abolivier 394cbd80e2 Load legacy modules in tests 2021-09-02 10:49:07 +01:00
Brendan Abolivier b3e050d283 Lint 2021-09-02 10:33:55 +01:00
Brendan Abolivier 332150ecaf Sample config 2021-09-02 10:20:49 +01:00
Brendan Abolivier 0a1eca9a57 Lint 2021-09-01 17:58:31 +01:00
Brendan Abolivier 3f8e4e787a Don't ratelimit when admin updates profile 2021-09-01 17:55:19 +01:00
Brendan Abolivier acfc9d4972 Fix one more test 2021-09-01 17:34:28 +01:00
Brendan Abolivier 925c2cdb80 Fix more tests 2021-09-01 17:30:49 +01:00
Brendan Abolivier f711c590e4 Fix tests 2021-09-01 17:05:15 +01:00
Brendan Abolivier 21d5e8c326 Fix cyclic dependency with the legacy account validity work 2021-09-01 14:42:04 +01:00
Brendan Abolivier c0adaccacc Remove account validity related schema update
Because DINUM had it before mainline, so the file names don't match.
Will need some fiddling with the database before updating to a mainlined
version.
2021-09-01 13:56:38 +01:00
Brendan Abolivier d76be83cdd Remove knock-related schema update
Because DINUM had it before mainline, so the file names don't match.
Will need some fiddling with the database before updating to a mainlined
version.
2021-09-01 13:54:51 +01:00
Brendan Abolivier 90e48ad4cd Lint 2021-09-01 13:54:26 +01:00
Brendan Abolivier 9621654d61 Remove buildkite pipeline 2021-09-01 13:45:04 +01:00
Brendan Abolivier b7814024db Add buildkite pipeline back 2021-09-01 13:40:15 +01:00
Brendan Abolivier ea37bf9bdf Merge tag 'v1.41.0' into babolivier/dinsic_1.41.0
Synapse 1.41.0 (2021-08-24)
===========================

This release adds support for Debian 12 (Bookworm), but **removes support for Ubuntu 20.10 (Groovy Gorilla)**, which reached End of Life last month.

Note that when using workers the `/_synapse/admin/v1/users/{userId}/media` must now be handled by media workers. See the [upgrade notes](https://matrix-org.github.io/synapse/latest/upgrade.html) for more information.

Features
--------

- Enable room capabilities ([MSC3244](https://github.com/matrix-org/matrix-doc/pull/3244)) by default and set room version 8 as the preferred room version when creating restricted rooms. ([\#10571](https://github.com/matrix-org/synapse/issues/10571))

Synapse 1.41.0rc1 (2021-08-18)
==============================

Features
--------

- Add `get_userinfo_by_id` method to ModuleApi. ([\#9581](https://github.com/matrix-org/synapse/issues/9581))
- Initial local support for [MSC3266](https://github.com/matrix-org/synapse/pull/10394), Room Summary over the unstable `/rooms/{roomIdOrAlias}/summary` API. ([\#10394](https://github.com/matrix-org/synapse/issues/10394))
- Experimental support for [MSC3288](https://github.com/matrix-org/matrix-doc/pull/3288), sending `room_type` to the identity server for 3pid invites over the `/store-invite` API. ([\#10435](https://github.com/matrix-org/synapse/issues/10435))
- Add support for sending federation requests through a proxy. Contributed by @Bubu and @dklimpel. See the [upgrade notes](https://matrix-org.github.io/synapse/latest/upgrade.html) for more information. ([\#10596](https://github.com/matrix-org/synapse/issues/10596)). ([\#10475](https://github.com/matrix-org/synapse/issues/10475))
- Add support for "marker" events which makes historical events discoverable for servers that already have all of the scrollback history (part of [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716)). ([\#10498](https://github.com/matrix-org/synapse/issues/10498))
- Add a configuration setting for the time a `/sync` response is cached for. ([\#10513](https://github.com/matrix-org/synapse/issues/10513))
- The default logging handler for new installations is now `PeriodicallyFlushingMemoryHandler`, a buffered logging handler which periodically flushes itself. ([\#10518](https://github.com/matrix-org/synapse/issues/10518))
- Add support for new redaction rules for historical events specified in [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716). ([\#10538](https://github.com/matrix-org/synapse/issues/10538))
- Add a setting to disable TLS when sending email. ([\#10546](https://github.com/matrix-org/synapse/issues/10546))
- Add pagination to the spaces summary based on updates to [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946). ([\#10549](https://github.com/matrix-org/synapse/issues/10549), [\#10560](https://github.com/matrix-org/synapse/issues/10560), [\#10569](https://github.com/matrix-org/synapse/issues/10569), [\#10574](https://github.com/matrix-org/synapse/issues/10574), [\#10575](https://github.com/matrix-org/synapse/issues/10575), [\#10579](https://github.com/matrix-org/synapse/issues/10579), [\#10583](https://github.com/matrix-org/synapse/issues/10583))
- Admin API to delete several media for a specific user. Contributed by @dklimpel. ([\#10558](https://github.com/matrix-org/synapse/issues/10558), [\#10628](https://github.com/matrix-org/synapse/issues/10628))
- Add support for routing `/createRoom` to workers. ([\#10564](https://github.com/matrix-org/synapse/issues/10564))
- Update the Synapse Grafana dashboard. ([\#10570](https://github.com/matrix-org/synapse/issues/10570))
- Add an admin API (`GET /_synapse/admin/username_available`) to check if a username is available (regardless of registration settings). ([\#10578](https://github.com/matrix-org/synapse/issues/10578))
- Allow editing a user's `external_ids` via the "Edit User" admin API. Contributed by @dklimpel. ([\#10598](https://github.com/matrix-org/synapse/issues/10598))
- The Synapse manhole no longer needs coroutines to be wrapped in `defer.ensureDeferred`. ([\#10602](https://github.com/matrix-org/synapse/issues/10602))
- Add option to allow modules to run periodic tasks on all instances, rather than just the one configured to run background tasks. ([\#10638](https://github.com/matrix-org/synapse/issues/10638))

Bugfixes
--------

- Add some clarification to the sample config file. Contributed by @Kentokamoto. ([\#10129](https://github.com/matrix-org/synapse/issues/10129))
- Fix a long-standing bug where protocols which are not implemented by any appservices were incorrectly returned via `GET /_matrix/client/r0/thirdparty/protocols`. ([\#10532](https://github.com/matrix-org/synapse/issues/10532))
- Fix exceptions in logs when failing to get remote room list. ([\#10541](https://github.com/matrix-org/synapse/issues/10541))
- Fix longstanding bug which caused the user's presence "status message" to be reset when the user went offline. Contributed by @dklimpel. ([\#10550](https://github.com/matrix-org/synapse/issues/10550))
- Allow public rooms to be previewed in the spaces summary APIs from [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946). ([\#10580](https://github.com/matrix-org/synapse/issues/10580))
- Fix a bug introduced in v1.37.1 where an error could occur in the asynchronous processing of PDUs when the queue was empty. ([\#10592](https://github.com/matrix-org/synapse/issues/10592))
- Fix errors on /sync when read receipt data is a string. Only affects homeservers with the experimental flag for [MSC2285](https://github.com/matrix-org/matrix-doc/pull/2285) enabled. Contributed by @SimonBrandner. ([\#10606](https://github.com/matrix-org/synapse/issues/10606))
- Additional validation for the spaces summary API to avoid errors like `ValueError: Stop argument for islice() must be None or an integer`. The missing validation has existed since v1.31.0. ([\#10611](https://github.com/matrix-org/synapse/issues/10611))
- Revert behaviour introduced in v1.38.0 that strips `org.matrix.msc2732.device_unused_fallback_key_types` from `/sync` when its value is empty. This field should instead always be present according to [MSC2732](https://github.com/matrix-org/matrix-doc/blob/master/proposals/2732-olm-fallback-keys.md). ([\#10623](https://github.com/matrix-org/synapse/issues/10623))

Improved Documentation
----------------------

- Add documentation for configuring a forward proxy. ([\#10443](https://github.com/matrix-org/synapse/issues/10443))
- Updated the reverse proxy documentation to highlight the homserver configuration that is needed to make Synapse aware that is is intentionally reverse proxied. ([\#10551](https://github.com/matrix-org/synapse/issues/10551))
- Update CONTRIBUTING.md to fix index links and the instructions for SyTest in docker. ([\#10599](https://github.com/matrix-org/synapse/issues/10599))

Deprecations and Removals
-------------------------

- No longer build `.deb` packages for Ubuntu 20.10 Groovy Gorilla, which has now EOLed. ([\#10588](https://github.com/matrix-org/synapse/issues/10588))
- The `template_dir` configuration settings in the `sso`, `account_validity` and `email` sections of the configuration file are now deprecated in favour of the global `templates.custom_template_directory` setting. See the [upgrade notes](https://matrix-org.github.io/synapse/latest/upgrade.html) for more information. ([\#10596](https://github.com/matrix-org/synapse/issues/10596))

Internal Changes
----------------

- Improve event caching mechanism to avoid having multiple copies of an event in memory at a time. ([\#10119](https://github.com/matrix-org/synapse/issues/10119))
- Reduce errors in PostgreSQL logs due to concurrent serialization errors. ([\#10504](https://github.com/matrix-org/synapse/issues/10504))
- Include room ID in ignored EDU log messages. Contributed by @ilmari. ([\#10507](https://github.com/matrix-org/synapse/issues/10507))
- Add pagination to the spaces summary based on updates to [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946). ([\#10527](https://github.com/matrix-org/synapse/issues/10527), [\#10530](https://github.com/matrix-org/synapse/issues/10530))
- Fix CI to not break when run against branches rather than pull requests. ([\#10529](https://github.com/matrix-org/synapse/issues/10529))
- Mark all events stemming from the [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint as historical. ([\#10537](https://github.com/matrix-org/synapse/issues/10537))
- Clean up some of the federation event authentication code for clarity. ([\#10539](https://github.com/matrix-org/synapse/issues/10539), [\#10591](https://github.com/matrix-org/synapse/issues/10591))
- Convert `Transaction` and `Edu` objects to attrs. ([\#10542](https://github.com/matrix-org/synapse/issues/10542))
- Update `/batch_send` endpoint to only return `state_events` created by the `state_events_from_before` passed in. ([\#10552](https://github.com/matrix-org/synapse/issues/10552))
- Update contributing.md to warn against rebasing an open PR. ([\#10563](https://github.com/matrix-org/synapse/issues/10563))
- Remove the unused public rooms replication stream. ([\#10565](https://github.com/matrix-org/synapse/issues/10565))
- Clarify error message when failing to join a restricted room. ([\#10572](https://github.com/matrix-org/synapse/issues/10572))
- Remove references to BuildKite in favour of GitHub Actions. ([\#10573](https://github.com/matrix-org/synapse/issues/10573))
- Move `/batch_send` endpoint defined by [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) to the `/v2_alpha` directory. ([\#10576](https://github.com/matrix-org/synapse/issues/10576))
- Allow multiple custom directories in `read_templates`. ([\#10587](https://github.com/matrix-org/synapse/issues/10587))
- Re-organize the `synapse.federation.transport.server` module to create smaller files. ([\#10590](https://github.com/matrix-org/synapse/issues/10590))
- Flatten the `synapse.rest.client` package by moving the contents of `v1` and `v2_alpha` into the parent. ([\#10600](https://github.com/matrix-org/synapse/issues/10600))
- Build Debian packages for Debian 12 (Bookworm). ([\#10612](https://github.com/matrix-org/synapse/issues/10612))
- Fix up a couple of links to the database schema documentation. ([\#10620](https://github.com/matrix-org/synapse/issues/10620))
- Fix a broken link to the upgrade notes. ([\#10631](https://github.com/matrix-org/synapse/issues/10631))
2021-09-01 12:18:18 +01:00
Brendan Abolivier 82af1a20f0 Merge tag 'v1.40.0' into babolivier/dinsic_1.41.0
Synapse 1.40.0 (2021-08-10)
===========================

No significant changes.

Synapse 1.40.0rc3 (2021-08-09)
==============================

Features
--------

- Support [MSC3289: room version 8](https://github.com/matrix-org/matrix-doc/pull/3289). ([\#10449](https://github.com/matrix-org/synapse/issues/10449))

Bugfixes
--------

- Mark the experimental room version from [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) as unstable. ([\#10449](https://github.com/matrix-org/synapse/issues/10449))

Improved Documentation
----------------------

- Fix broken links in `upgrade.md`. Contributed by @dklimpel. ([\#10543](https://github.com/matrix-org/synapse/issues/10543))

Synapse 1.40.0rc2 (2021-08-04)
==============================

Bugfixes
--------

- Fix the `PeriodicallyFlushingMemoryHandler` inhibiting application shutdown because of its background thread. ([\#10517](https://github.com/matrix-org/synapse/issues/10517))
- Fix a bug introduced in Synapse v1.40.0rc1 that could cause Synapse to respond with an error when clients would update read receipts. ([\#10531](https://github.com/matrix-org/synapse/issues/10531))

Internal Changes
----------------

- Fix release script to open the correct URL for the release. ([\#10516](https://github.com/matrix-org/synapse/issues/10516))

Synapse 1.40.0rc1 (2021-08-03)
==============================

Features
--------

- Add support for [MSC2033](https://github.com/matrix-org/matrix-doc/pull/2033): `device_id` on `/account/whoami`. ([\#9918](https://github.com/matrix-org/synapse/issues/9918))
- Update support for [MSC2716 - Incrementally importing history into existing rooms](https://github.com/matrix-org/matrix-doc/pull/2716). ([\#10245](https://github.com/matrix-org/synapse/issues/10245), [\#10432](https://github.com/matrix-org/synapse/issues/10432), [\#10463](https://github.com/matrix-org/synapse/issues/10463))
- Update support for [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083) to consider changes in the MSC around which servers can issue join events. ([\#10254](https://github.com/matrix-org/synapse/issues/10254), [\#10447](https://github.com/matrix-org/synapse/issues/10447), [\#10489](https://github.com/matrix-org/synapse/issues/10489))
- Initial support for [MSC3244](https://github.com/matrix-org/matrix-doc/pull/3244), Room version capabilities over the /capabilities API. ([\#10283](https://github.com/matrix-org/synapse/issues/10283))
- Add a buffered logging handler which periodically flushes itself. ([\#10407](https://github.com/matrix-org/synapse/issues/10407), [\#10515](https://github.com/matrix-org/synapse/issues/10515))
- Add support for https connections to a proxy server. Contributed by @Bubu and @dklimpel. ([\#10411](https://github.com/matrix-org/synapse/issues/10411))
- Support for [MSC2285 (hidden read receipts)](https://github.com/matrix-org/matrix-doc/pull/2285). Contributed by @SimonBrandner. ([\#10413](https://github.com/matrix-org/synapse/issues/10413))
- Email notifications now state whether an invitation is to a room or a space. ([\#10426](https://github.com/matrix-org/synapse/issues/10426))
- Allow setting transaction limit for database connections. ([\#10440](https://github.com/matrix-org/synapse/issues/10440), [\#10511](https://github.com/matrix-org/synapse/issues/10511))
- Add `creation_ts` to "list users" admin API. ([\#10448](https://github.com/matrix-org/synapse/issues/10448))

Bugfixes
--------

- Improve character set detection in URL previews by supporting underscores (in addition to hyphens). Contributed by @srividyut. ([\#10410](https://github.com/matrix-org/synapse/issues/10410))
- Fix events being incorrectly rejected over federation if they reference auth events that the server needed to fetch. ([\#10439](https://github.com/matrix-org/synapse/issues/10439))
- Fix `synapse_federation_server_oldest_inbound_pdu_in_staging` Prometheus metric to not report a max age of 51 years when the queue is empty. ([\#10455](https://github.com/matrix-org/synapse/issues/10455))
- Fix a bug which caused an explicit assignment of power-level 0 to a user to be misinterpreted in rare circumstances. ([\#10499](https://github.com/matrix-org/synapse/issues/10499))

Improved Documentation
----------------------

- Fix hierarchy of providers on the OpenID page. ([\#10445](https://github.com/matrix-org/synapse/issues/10445))
- Consolidate development documentation to `docs/development/`. ([\#10453](https://github.com/matrix-org/synapse/issues/10453))
- Add some developer docs to explain room DAG concepts like `outliers`, `state_groups`, `depth`, etc. ([\#10464](https://github.com/matrix-org/synapse/issues/10464))
- Document how to use Complement while developing a new Synapse feature. ([\#10483](https://github.com/matrix-org/synapse/issues/10483))

Internal Changes
----------------

- Prune inbound federation queues for a room if they get too large. ([\#10390](https://github.com/matrix-org/synapse/issues/10390))
- Add type hints to `synapse.federation.transport.client` module. ([\#10408](https://github.com/matrix-org/synapse/issues/10408))
- Remove shebang line from module files. ([\#10415](https://github.com/matrix-org/synapse/issues/10415))
- Drop backwards-compatibility code that was required to support Ubuntu Xenial. ([\#10429](https://github.com/matrix-org/synapse/issues/10429))
- Use a docker image cache for the prerequisites for the debian package build. ([\#10431](https://github.com/matrix-org/synapse/issues/10431))
- Improve servlet type hints. ([\#10437](https://github.com/matrix-org/synapse/issues/10437), [\#10438](https://github.com/matrix-org/synapse/issues/10438))
- Replace usage of `or_ignore` in `simple_insert` with `simple_upsert` usage, to stop spamming postgres logs with spurious ERROR messages. ([\#10442](https://github.com/matrix-org/synapse/issues/10442))
- Update the `tests-done` Github Actions status. ([\#10444](https://github.com/matrix-org/synapse/issues/10444), [\#10512](https://github.com/matrix-org/synapse/issues/10512))
- Update type annotations to work with forthcoming Twisted 21.7.0 release. ([\#10446](https://github.com/matrix-org/synapse/issues/10446), [\#10450](https://github.com/matrix-org/synapse/issues/10450))
- Cancel redundant GHA workflows when a new commit is pushed. ([\#10451](https://github.com/matrix-org/synapse/issues/10451))
- Mitigate media repo XSS attacks on IE11 via the non-standard X-Content-Security-Policy header. ([\#10468](https://github.com/matrix-org/synapse/issues/10468))
- Additional type hints in the state handler. ([\#10482](https://github.com/matrix-org/synapse/issues/10482))
- Update syntax used to run complement tests. ([\#10488](https://github.com/matrix-org/synapse/issues/10488))
- Fix up type annotations to work with Twisted 21.7. ([\#10490](https://github.com/matrix-org/synapse/issues/10490))
- Improve type annotations for `ObservableDeferred`. ([\#10491](https://github.com/matrix-org/synapse/issues/10491))
- Extend release script to also tag and create GitHub releases. ([\#10496](https://github.com/matrix-org/synapse/issues/10496))
- Fix a bug which caused production debian packages to be incorrectly marked as 'prerelease'. ([\#10500](https://github.com/matrix-org/synapse/issues/10500))
2021-09-01 11:34:56 +01:00
Brendan Abolivier 262007f049 Merge tag 'v1.39.0' into babolivier/dinsic_1.41.0
Synapse 1.39.0 (2021-07-29)
===========================

No significant changes.

Synapse 1.39.0rc3 (2021-07-28)
==============================

Bugfixes
--------

- Fix a bug introduced in Synapse 1.38 which caused an exception at startup when SAML authentication was enabled. ([\#10477](https://github.com/matrix-org/synapse/issues/10477))
- Fix a long-standing bug where Synapse would not inform clients that a device had exhausted its one-time-key pool, potentially causing problems decrypting events. ([\#10485](https://github.com/matrix-org/synapse/issues/10485))
- Fix reporting old R30 stats as R30v2 stats. Introduced in v1.39.0rc1. ([\#10486](https://github.com/matrix-org/synapse/issues/10486))

Internal Changes
----------------

- Fix an error which prevented the Github Actions workflow to build the docker images from running. ([\#10461](https://github.com/matrix-org/synapse/issues/10461))
- Fix release script to correctly version debian changelog when doing RCs. ([\#10465](https://github.com/matrix-org/synapse/issues/10465))

Synapse 1.39.0rc2 (2021-07-22)
==============================

This release also includes the changes in v1.38.1.

Internal Changes
----------------

- Move docker image build to Github Actions. ([\#10416](https://github.com/matrix-org/synapse/issues/10416))

Synapse 1.39.0rc1 (2021-07-20)
==============================

The Third-Party Event Rules module interface has been deprecated in favour of the generic module interface introduced in Synapse v1.37.0. Support for the old interface is planned to be removed in September 2021. See the [upgrade notes](https://matrix-org.github.io/synapse/latest/upgrade.html#upgrading-to-v1390) for more information.

Features
--------

- Add the ability to override the account validity feature with a module. ([\#9884](https://github.com/matrix-org/synapse/issues/9884))
- The spaces summary API now returns any joinable rooms, not only rooms which are world-readable. ([\#10298](https://github.com/matrix-org/synapse/issues/10298), [\#10305](https://github.com/matrix-org/synapse/issues/10305))
- Add a new version of the R30 phone-home metric, which removes a false impression of retention given by the old R30 metric. ([\#10332](https://github.com/matrix-org/synapse/issues/10332), [\#10427](https://github.com/matrix-org/synapse/issues/10427))
- Allow providing credentials to `http_proxy`. ([\#10360](https://github.com/matrix-org/synapse/issues/10360))

Bugfixes
--------

- Fix error while dropping locks on shutdown. Introduced in v1.38.0. ([\#10433](https://github.com/matrix-org/synapse/issues/10433))
- Add base starting insertion event when no chunk ID is specified in the historical batch send API. ([\#10250](https://github.com/matrix-org/synapse/issues/10250))
- Fix historical batch send endpoint (MSC2716) rejecting batches with messages from multiple senders. ([\#10276](https://github.com/matrix-org/synapse/issues/10276))
- Fix purging rooms that other homeservers are still sending events for. Contributed by @ilmari. ([\#10317](https://github.com/matrix-org/synapse/issues/10317))
- Fix errors during backfill caused by previously purged redaction events. Contributed by Andreas Rammhold (@andir). ([\#10343](https://github.com/matrix-org/synapse/issues/10343))
- Fix the user directory becoming broken (and noisy errors being logged) when knocking and room statistics are in use. ([\#10344](https://github.com/matrix-org/synapse/issues/10344))
- Fix newly added `synapse_federation_server_oldest_inbound_pdu_in_staging` prometheus metric to measure age rather than timestamp. ([\#10355](https://github.com/matrix-org/synapse/issues/10355))
- Fix PostgreSQL sometimes using table scans for queries against `state_groups_state` table, taking a long time and a large amount of IO. ([\#10359](https://github.com/matrix-org/synapse/issues/10359))
- Fix `make_room_admin` failing for users that have left a private room. ([\#10367](https://github.com/matrix-org/synapse/issues/10367))
- Fix a number of logged errors caused by remote servers being down. ([\#10400](https://github.com/matrix-org/synapse/issues/10400), [\#10414](https://github.com/matrix-org/synapse/issues/10414))
- Responses from `/make_{join,leave,knock}` no longer include signatures, which will turn out to be invalid after events are returned to `/send_{join,leave,knock}`. ([\#10404](https://github.com/matrix-org/synapse/issues/10404))

Improved Documentation
----------------------

- Updated installation dependencies for newer macOS versions and ARM Macs. Contributed by Luke Walsh. ([\#9971](https://github.com/matrix-org/synapse/issues/9971))
- Simplify structure of room admin API. ([\#10313](https://github.com/matrix-org/synapse/issues/10313))
- Refresh the logcontext dev documentation. ([\#10353](https://github.com/matrix-org/synapse/issues/10353)), ([\#10337](https://github.com/matrix-org/synapse/issues/10337))
- Add delegation example for caddy in the reverse proxy documentation. Contributed by @moritzdietz. ([\#10368](https://github.com/matrix-org/synapse/issues/10368))
- Fix and clarify some links in `docs` and `contrib`. ([\#10370](https://github.com/matrix-org/synapse/issues/10370)), ([\#10322](https://github.com/matrix-org/synapse/issues/10322)), ([\#10399](https://github.com/matrix-org/synapse/issues/10399))
- Make deprecation notice of the spam checker doc more obvious. ([\#10395](https://github.com/matrix-org/synapse/issues/10395))
- Add instructions on installing Debian packages for release candidates. ([\#10396](https://github.com/matrix-org/synapse/issues/10396))

Deprecations and Removals
-------------------------

- Remove functionality associated with the unused `room_stats_historical` and `user_stats_historical` tables. Contributed by @xmunoz. ([\#9721](https://github.com/matrix-org/synapse/issues/9721))
- The third-party event rules module interface is deprecated in favour of the generic module interface introduced in Synapse v1.37.0. See the [upgrade notes](https://matrix-org.github.io/synapse/latest/upgrade.html#upgrading-to-v1390) for more information. ([\#10386](https://github.com/matrix-org/synapse/issues/10386))

Internal Changes
----------------

- Convert `room_depth.min_depth` column to a `BIGINT`. ([\#10289](https://github.com/matrix-org/synapse/issues/10289))
- Add tests to characterise the current behaviour of R30 phone-home metrics. ([\#10315](https://github.com/matrix-org/synapse/issues/10315))
- Rebuild event context and auth when processing specific results from `ThirdPartyEventRules` modules. ([\#10316](https://github.com/matrix-org/synapse/issues/10316))
- Minor change to the code that populates `user_daily_visits`. ([\#10324](https://github.com/matrix-org/synapse/issues/10324))
- Re-enable Sytests that were disabled for the 1.37.1 release. ([\#10345](https://github.com/matrix-org/synapse/issues/10345), [\#10357](https://github.com/matrix-org/synapse/issues/10357))
- Run `pyupgrade` on the codebase. ([\#10347](https://github.com/matrix-org/synapse/issues/10347), [\#10348](https://github.com/matrix-org/synapse/issues/10348))
- Switch `application_services_txns.txn_id` database column to `BIGINT`. ([\#10349](https://github.com/matrix-org/synapse/issues/10349))
- Convert internal type variable syntax to reflect wider ecosystem use. ([\#10350](https://github.com/matrix-org/synapse/issues/10350), [\#10380](https://github.com/matrix-org/synapse/issues/10380), [\#10381](https://github.com/matrix-org/synapse/issues/10381), [\#10382](https://github.com/matrix-org/synapse/issues/10382), [\#10418](https://github.com/matrix-org/synapse/issues/10418))
- Make the Github Actions workflow configuration more efficient. ([\#10383](https://github.com/matrix-org/synapse/issues/10383))
- Add type hints to `get_{domain,localpart}_from_id`. ([\#10385](https://github.com/matrix-org/synapse/issues/10385))
- When building Debian packages for prerelease versions, set the Section accordingly. ([\#10391](https://github.com/matrix-org/synapse/issues/10391))
- Add type hints and comments to event auth code. ([\#10393](https://github.com/matrix-org/synapse/issues/10393))
- Stagger sending of presence update to remote servers, reducing CPU spikes caused by starting many connections to remote servers at once. ([\#10398](https://github.com/matrix-org/synapse/issues/10398))
- Remove unused `events_by_room` code (tech debt). ([\#10421](https://github.com/matrix-org/synapse/issues/10421))
- Add a github actions job which records success of other jobs. ([\#10430](https://github.com/matrix-org/synapse/issues/10430))
2021-09-01 11:26:23 +01:00
Brendan Abolivier cc633a699d Merge tag 'v1.38.1' into babolivier/dinsic_1.41.0
Synapse 1.38.1 (2021-07-22)
===========================

Bugfixes
--------

- Always include `device_one_time_keys_count` key in `/sync` response to work around a bug in Element Android that broke encryption for new devices. ([\#10457](https://github.com/matrix-org/synapse/issues/10457))
2021-09-01 11:00:00 +01:00
Brendan Abolivier fb6ff170ed Merge tag 'v1.38.0' into babolivier/dinsic_1.41.0
Synapse 1.38.0 (2021-07-13)
===========================

This release includes a database schema update which could result in elevated disk usage. See the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#upgrading-to-v1380) for more information.

No significant changes since 1.38.0rc3.

Synapse 1.38.0rc3 (2021-07-13)
==============================

Internal Changes
----------------

- Build the Debian packages in CI. ([\#10247](https://github.com/matrix-org/synapse/issues/10247), [\#10379](https://github.com/matrix-org/synapse/issues/10379))

Synapse 1.38.0rc2 (2021-07-09)
==============================

Bugfixes
--------

- Fix bug where inbound federation in a room could be delayed due to not correctly dropping a lock. Introduced in v1.37.1. ([\#10336](https://github.com/matrix-org/synapse/issues/10336))

Improved Documentation
----------------------

- Update links to documentation in the sample config. Contributed by @dklimpel. ([\#10287](https://github.com/matrix-org/synapse/issues/10287))
- Fix broken links in [INSTALL.md](INSTALL.md). Contributed by @dklimpel. ([\#10331](https://github.com/matrix-org/synapse/issues/10331))

Synapse 1.38.0rc1 (2021-07-06)
==============================

Features
--------

- Implement refresh tokens as specified by [MSC2918](https://github.com/matrix-org/matrix-doc/pull/2918). ([\#9450](https://github.com/matrix-org/synapse/issues/9450))
- Add support for evicting cache entries based on last access time. ([\#10205](https://github.com/matrix-org/synapse/issues/10205))
- Omit empty fields from the `/sync` response. Contributed by @deepbluev7. ([\#10214](https://github.com/matrix-org/synapse/issues/10214))
- Improve validation on federation `send_{join,leave,knock}` endpoints. ([\#10225](https://github.com/matrix-org/synapse/issues/10225), [\#10243](https://github.com/matrix-org/synapse/issues/10243))
- Add SSO `external_ids` to the Query User Account admin API. ([\#10261](https://github.com/matrix-org/synapse/issues/10261))
- Mark events received over federation which fail a spam check as "soft-failed". ([\#10263](https://github.com/matrix-org/synapse/issues/10263))
- Add metrics for new inbound federation staging area. ([\#10284](https://github.com/matrix-org/synapse/issues/10284))
- Add script to print information about recently registered users. ([\#10290](https://github.com/matrix-org/synapse/issues/10290))

Bugfixes
--------

- Fix a long-standing bug which meant that invite rejections and knocks were not sent out over federation in a timely manner. ([\#10223](https://github.com/matrix-org/synapse/issues/10223))
- Fix a bug introduced in v1.26.0 where only users who have set profile information could be deactivated with erasure enabled. ([\#10252](https://github.com/matrix-org/synapse/issues/10252))
- Fix a long-standing bug where Synapse would return errors after 2<sup>31</sup> events were handled by the server. ([\#10264](https://github.com/matrix-org/synapse/issues/10264), [\#10267](https://github.com/matrix-org/synapse/issues/10267), [\#10282](https://github.com/matrix-org/synapse/issues/10282), [\#10286](https://github.com/matrix-org/synapse/issues/10286), [\#10291](https://github.com/matrix-org/synapse/issues/10291), [\#10314](https://github.com/matrix-org/synapse/issues/10314), [\#10326](https://github.com/matrix-org/synapse/issues/10326))
- Fix the prometheus `synapse_federation_server_pdu_process_time` metric. Broke in v1.37.1. ([\#10279](https://github.com/matrix-org/synapse/issues/10279))
- Ensure that inbound events from federation that were being processed when Synapse was restarted get promptly processed on start up. ([\#10303](https://github.com/matrix-org/synapse/issues/10303))

Improved Documentation
----------------------

- Move the upgrade notes to [docs/upgrade.md](https://github.com/matrix-org/synapse/blob/develop/docs/upgrade.md) and convert them to markdown. ([\#10166](https://github.com/matrix-org/synapse/issues/10166))
- Choose Welcome & Overview as the default page for synapse documentation website. ([\#10242](https://github.com/matrix-org/synapse/issues/10242))
- Adjust the URL in the README.rst file to point to irc.libera.chat. ([\#10258](https://github.com/matrix-org/synapse/issues/10258))
- Fix homeserver config option name in presence router documentation. ([\#10288](https://github.com/matrix-org/synapse/issues/10288))
- Fix link pointing at the wrong section in the modules documentation page. ([\#10302](https://github.com/matrix-org/synapse/issues/10302))

Internal Changes
----------------

- Drop `Origin` and `Accept` from the value of the `Access-Control-Allow-Headers` response header. ([\#10114](https://github.com/matrix-org/synapse/issues/10114))
- Add type hints to the federation servlets. ([\#10213](https://github.com/matrix-org/synapse/issues/10213))
- Improve the reliability of auto-joining remote rooms. ([\#10237](https://github.com/matrix-org/synapse/issues/10237))
- Update the release script to use the semver terminology and determine the release branch based on the next version. ([\#10239](https://github.com/matrix-org/synapse/issues/10239))
- Fix type hints for computing auth events. ([\#10253](https://github.com/matrix-org/synapse/issues/10253))
- Improve the performance of the spaces summary endpoint by only recursing into spaces (and not rooms in general). ([\#10256](https://github.com/matrix-org/synapse/issues/10256))
- Move event authentication methods from `Auth` to `EventAuthHandler`. ([\#10268](https://github.com/matrix-org/synapse/issues/10268))
- Re-enable a SyTest after it has been fixed. ([\#10292](https://github.com/matrix-org/synapse/issues/10292))
2021-09-01 10:59:48 +01:00
Brendan Abolivier 6c9461eb41 Merge tag 'v1.37.1' into babolivier/dinsic_1.41.0
Synapse 1.37.1 (2021-06-30)
===========================

This release resolves issues (such as [#9490](https://github.com/matrix-org/synapse/issues/9490)) where one busy room could cause head-of-line blocking, starving Synapse from processing events in other rooms, and causing all federated traffic to fall behind. Synapse 1.37.1 processes inbound federation traffic asynchronously, ensuring that one busy room won't impact others. Please upgrade to Synapse 1.37.1 as soon as possible, in order to increase resilience to other traffic spikes.

No significant changes since v1.37.1rc1.

Synapse 1.37.1rc1 (2021-06-29)
==============================

Features
--------

- Handle inbound events from federation asynchronously. ([\#10269](https://github.com/matrix-org/synapse/issues/10269), [\#10272](https://github.com/matrix-org/synapse/issues/10272))
2021-09-01 10:48:08 +01:00
Brendan Abolivier cba616de41 Merge tag 'v1.37.0' into babolivier/dinsic_1.41.0
Synapse 1.37.0 (2021-06-29)
===========================

This release deprecates the current spam checker interface. See the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#deprecation-of-the-current-spam-checker-interface) for more information on how to update to the new generic module interface.

This release also removes support for fetching and renewing TLS certificates using the ACME v1 protocol, which has been fully decommissioned by Let's Encrypt on June 1st 2021. Admins previously using this feature should use a [reverse proxy](https://matrix-org.github.io/synapse/develop/reverse_proxy.html) to handle TLS termination, or use an external ACME client (such as [certbot](https://certbot.eff.org/)) to retrieve a certificate and key and provide them to Synapse using the `tls_certificate_path` and `tls_private_key_path` configuration settings.

Synapse 1.37.0rc1 (2021-06-24)
==============================

Features
--------

- Implement "room knocking" as per [MSC2403](https://github.com/matrix-org/matrix-doc/pull/2403). Contributed by @Sorunome and anoa. ([\#6739](https://github.com/matrix-org/synapse/issues/6739), [\#9359](https://github.com/matrix-org/synapse/issues/9359), [\#10167](https://github.com/matrix-org/synapse/issues/10167), [\#10212](https://github.com/matrix-org/synapse/issues/10212), [\#10227](https://github.com/matrix-org/synapse/issues/10227))
- Add experimental support for backfilling history into rooms ([MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716)). ([\#9247](https://github.com/matrix-org/synapse/issues/9247))
- Implement a generic interface for third-party plugin modules. ([\#10062](https://github.com/matrix-org/synapse/issues/10062), [\#10206](https://github.com/matrix-org/synapse/issues/10206))
- Implement config option `sso.update_profile_information` to sync SSO users' profile information with the identity provider each time they login. Currently only displayname is supported. ([\#10108](https://github.com/matrix-org/synapse/issues/10108))
- Ensure that errors during startup are written to the logs and the console. ([\#10191](https://github.com/matrix-org/synapse/issues/10191))

Bugfixes
--------

- Fix a bug introduced in Synapse v1.25.0 that prevented the `ip_range_whitelist` configuration option from working for federation and identity servers. Contributed by @mikure. ([\#10115](https://github.com/matrix-org/synapse/issues/10115))
- Remove a broken import line in Synapse's `admin_cmd` worker. Broke in Synapse v1.33.0. ([\#10154](https://github.com/matrix-org/synapse/issues/10154))
- Fix a bug introduced in Synapse v1.21.0 which could cause `/sync` to return immediately with an empty response. ([\#10157](https://github.com/matrix-org/synapse/issues/10157), [\#10158](https://github.com/matrix-org/synapse/issues/10158))
- Fix a minor bug in the response to `/_matrix/client/r0/user/{user}/openid/request_token` causing `expires_in` to be a float instead of an integer. Contributed by @lukaslihotzki. ([\#10175](https://github.com/matrix-org/synapse/issues/10175))
- Always require users to re-authenticate for dangerous operations: deactivating an account, modifying an account password, and adding 3PIDs. ([\#10184](https://github.com/matrix-org/synapse/issues/10184))
- Fix a bug introduced in Synpase v1.7.2 where remote server count metrics collection would be incorrectly delayed on startup. Found by @heftig. ([\#10195](https://github.com/matrix-org/synapse/issues/10195))
- Fix a bug introduced in Synapse v1.35.1 where an `allow` key of a `m.room.join_rules` event could be applied for incorrect room versions and configurations. ([\#10208](https://github.com/matrix-org/synapse/issues/10208))
- Fix performance regression in responding to user key requests over federation. Introduced in Synapse v1.34.0rc1. ([\#10221](https://github.com/matrix-org/synapse/issues/10221))

Improved Documentation
----------------------

- Add a new guide to decoding request logs. ([\#8436](https://github.com/matrix-org/synapse/issues/8436))
- Mention in the sample homeserver config that you may need to configure max upload size in your reverse proxy. Contributed by @aaronraimist. ([\#10122](https://github.com/matrix-org/synapse/issues/10122))
- Fix broken links in documentation. ([\#10180](https://github.com/matrix-org/synapse/issues/10180))
- Deploy a snapshot of the documentation website upon each new Synapse release. ([\#10198](https://github.com/matrix-org/synapse/issues/10198))

Deprecations and Removals
-------------------------

- The current spam checker interface is deprecated in favour of a new generic modules system. See the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#deprecation-of-the-current-spam-checker-interface) for more information on how to update to the new system. ([\#10062](https://github.com/matrix-org/synapse/issues/10062), [\#10210](https://github.com/matrix-org/synapse/issues/10210), [\#10238](https://github.com/matrix-org/synapse/issues/10238))
- Stop supporting the unstable spaces prefixes from MSC1772. ([\#10161](https://github.com/matrix-org/synapse/issues/10161))
- Remove Synapse's support for automatically fetching and renewing certificates using the ACME v1 protocol. This protocol has been fully turned off by Let's Encrypt for existing installations on June 1st 2021. Admins previously using this feature should use a [reverse proxy](https://matrix-org.github.io/synapse/develop/reverse_proxy.html) to handle TLS termination, or use an external ACME client (such as [certbot](https://certbot.eff.org/)) to retrieve a certificate and key and provide them to Synapse using the `tls_certificate_path` and `tls_private_key_path` configuration settings. ([\#10194](https://github.com/matrix-org/synapse/issues/10194))

Internal Changes
----------------

- Update the database schema versioning to support gradual migration away from legacy tables. ([\#9933](https://github.com/matrix-org/synapse/issues/9933))
- Add type hints to the federation servlets. ([\#10080](https://github.com/matrix-org/synapse/issues/10080))
- Improve OpenTracing for event persistence. ([\#10134](https://github.com/matrix-org/synapse/issues/10134), [\#10193](https://github.com/matrix-org/synapse/issues/10193))
- Clean up the interface for injecting OpenTracing over HTTP. ([\#10143](https://github.com/matrix-org/synapse/issues/10143))
- Limit the number of in-flight `/keys/query` requests from a single device. ([\#10144](https://github.com/matrix-org/synapse/issues/10144))
- Refactor EventPersistenceQueue. ([\#10145](https://github.com/matrix-org/synapse/issues/10145))
- Document `SYNAPSE_TEST_LOG_LEVEL` to see the logger output when running tests. ([\#10148](https://github.com/matrix-org/synapse/issues/10148))
- Update the Complement build tags in GitHub Actions to test currently experimental features. ([\#10155](https://github.com/matrix-org/synapse/issues/10155))
- Add a `synapse_federation_soft_failed_events_total` metric to track how often events are soft failed. ([\#10156](https://github.com/matrix-org/synapse/issues/10156))
- Fetch the corresponding complement branch when performing CI. ([\#10160](https://github.com/matrix-org/synapse/issues/10160))
- Add some developer documentation about boolean columns in database schemas. ([\#10164](https://github.com/matrix-org/synapse/issues/10164))
- Add extra logging fields to better debug where events are being soft failed. ([\#10168](https://github.com/matrix-org/synapse/issues/10168))
- Add debug logging for when we enter and exit `Measure` blocks. ([\#10183](https://github.com/matrix-org/synapse/issues/10183))
- Improve comments in structured logging code. ([\#10188](https://github.com/matrix-org/synapse/issues/10188))
- Update [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083) support with modifications from the MSC. ([\#10189](https://github.com/matrix-org/synapse/issues/10189))
- Remove redundant DNS lookup limiter. ([\#10190](https://github.com/matrix-org/synapse/issues/10190))
- Upgrade `black` linting tool to 21.6b0. ([\#10197](https://github.com/matrix-org/synapse/issues/10197))
- Expose OpenTracing trace id in response headers. ([\#10199](https://github.com/matrix-org/synapse/issues/10199))
2021-09-01 10:40:29 +01:00
Brendan Abolivier 87e978bc76 Merge tag 'v1.36.0' into babolivier/dinsic_1.41.0
Synapse 1.36.0 (2021-06-15)
===========================

No significant changes.

Synapse 1.36.0rc2 (2021-06-11)
==============================

Bugfixes
--------

- Fix a bug which caused  presence updates to stop working some time after a restart, when using a presence writer worker. Broke in v1.33.0. ([\#10149](https://github.com/matrix-org/synapse/issues/10149))
- Fix a bug when using federation sender worker where it would send out more presence updates than necessary, leading to high resource usage. Broke in v1.33.0. ([\#10163](https://github.com/matrix-org/synapse/issues/10163))
- Fix a bug where Synapse could send the same presence update to a remote twice. ([\#10165](https://github.com/matrix-org/synapse/issues/10165))

Synapse 1.36.0rc1 (2021-06-08)
==============================

Features
--------

- Add new endpoint `/_matrix/client/r0/rooms/{roomId}/aliases` from Client-Server API r0.6.1 (previously [MSC2432](https://github.com/matrix-org/matrix-doc/pull/2432)). ([\#9224](https://github.com/matrix-org/synapse/issues/9224))
- Improve performance of incoming federation transactions in large rooms. ([\#9953](https://github.com/matrix-org/synapse/issues/9953), [\#9973](https://github.com/matrix-org/synapse/issues/9973))
- Rewrite logic around verifying JSON object and fetching server keys to be more performant and use less memory. ([\#10035](https://github.com/matrix-org/synapse/issues/10035))
- Add new admin APIs for unprotecting local media from quarantine. Contributed by @dklimpel. ([\#10040](https://github.com/matrix-org/synapse/issues/10040))
- Add new admin APIs to remove media by media ID from quarantine. Contributed by @dklimpel. ([\#10044](https://github.com/matrix-org/synapse/issues/10044))
- Make reason and score parameters optional for reporting content. Implements [MSC2414](https://github.com/matrix-org/matrix-doc/pull/2414). Contributed by Callum Brown. ([\#10077](https://github.com/matrix-org/synapse/issues/10077))
- Add support for routing more requests to workers. ([\#10084](https://github.com/matrix-org/synapse/issues/10084))
- Report OpenTracing spans for database activity. ([\#10113](https://github.com/matrix-org/synapse/issues/10113), [\#10136](https://github.com/matrix-org/synapse/issues/10136), [\#10141](https://github.com/matrix-org/synapse/issues/10141))
- Significantly reduce memory usage of joining large remote rooms. ([\#10117](https://github.com/matrix-org/synapse/issues/10117))

Bugfixes
--------

- Fixed a bug causing replication requests to fail when receiving a lot of events via federation. ([\#10082](https://github.com/matrix-org/synapse/issues/10082))
- Fix a bug in the `force_tracing_for_users` option introduced in Synapse v1.35 which meant that the OpenTracing spans produced were missing most tags. ([\#10092](https://github.com/matrix-org/synapse/issues/10092))
- Fixed a bug that could cause Synapse to stop notifying application services. Contributed by Willem Mulder. ([\#10107](https://github.com/matrix-org/synapse/issues/10107))
- Fix bug where the server would attempt to fetch the same history in the room from a remote server multiple times in parallel. ([\#10116](https://github.com/matrix-org/synapse/issues/10116))
- Fix a bug introduced in Synapse 1.33.0 which caused replication requests to fail when receiving a lot of very large events via federation. ([\#10118](https://github.com/matrix-org/synapse/issues/10118))
- Fix bug when using workers where pagination requests failed if a remote server returned zero events from `/backfill`. Introduced in 1.35.0. ([\#10133](https://github.com/matrix-org/synapse/issues/10133))

Improved Documentation
----------------------

- Clarify security note regarding hosting Synapse on the same domain as other web applications. ([\#9221](https://github.com/matrix-org/synapse/issues/9221))
- Update CAPTCHA documentation to mention turning off the verify origin feature. Contributed by @aaronraimist. ([\#10046](https://github.com/matrix-org/synapse/issues/10046))
- Tweak wording of database recommendation in `INSTALL.md`. Contributed by @aaronraimist. ([\#10057](https://github.com/matrix-org/synapse/issues/10057))
- Add initial infrastructure for rendering Synapse documentation with mdbook. ([\#10086](https://github.com/matrix-org/synapse/issues/10086))
- Convert the remaining Admin API documentation files to markdown. ([\#10089](https://github.com/matrix-org/synapse/issues/10089))
- Make a link in docs use HTTPS. Contributed by @RhnSharma. ([\#10130](https://github.com/matrix-org/synapse/issues/10130))
- Fix broken link in Docker docs. ([\#10132](https://github.com/matrix-org/synapse/issues/10132))

Deprecations and Removals
-------------------------

- Remove the experimental `spaces_enabled` flag. The spaces features are always available now. ([\#10063](https://github.com/matrix-org/synapse/issues/10063))

Internal Changes
----------------

- Tell CircleCI to build Docker images from `main` branch. ([\#9906](https://github.com/matrix-org/synapse/issues/9906))
- Simplify naming convention for release branches to only include the major and minor version numbers. ([\#10013](https://github.com/matrix-org/synapse/issues/10013))
- Add `parse_strings_from_args` for parsing an array from query parameters. ([\#10048](https://github.com/matrix-org/synapse/issues/10048), [\#10137](https://github.com/matrix-org/synapse/issues/10137))
- Remove some dead code regarding TLS certificate handling. ([\#10054](https://github.com/matrix-org/synapse/issues/10054))
- Remove redundant, unmaintained `convert_server_keys` script. ([\#10055](https://github.com/matrix-org/synapse/issues/10055))
- Improve the error message printed by synctl when synapse fails to start. ([\#10059](https://github.com/matrix-org/synapse/issues/10059))
- Fix GitHub Actions lint for newsfragments. ([\#10069](https://github.com/matrix-org/synapse/issues/10069))
- Update opentracing to inject the right context into the carrier. ([\#10074](https://github.com/matrix-org/synapse/issues/10074))
- Fix up `BatchingQueue` implementation. ([\#10078](https://github.com/matrix-org/synapse/issues/10078))
- Log method and path when dropping request due to size limit. ([\#10091](https://github.com/matrix-org/synapse/issues/10091))
- In Github Actions workflows, summarize the Sytest results in an easy-to-read format. ([\#10094](https://github.com/matrix-org/synapse/issues/10094))
- Make `/sync` do fewer state resolutions. ([\#10102](https://github.com/matrix-org/synapse/issues/10102))
- Add missing type hints to the admin API servlets. ([\#10105](https://github.com/matrix-org/synapse/issues/10105))
- Improve opentracing annotations for `Notifier`. ([\#10111](https://github.com/matrix-org/synapse/issues/10111))
- Enable Prometheus metrics for the jaeger client library. ([\#10112](https://github.com/matrix-org/synapse/issues/10112))
- Work to improve the responsiveness of `/sync` requests. ([\#10124](https://github.com/matrix-org/synapse/issues/10124))
- OpenTracing: use a consistent name for background processes. ([\#10135](https://github.com/matrix-org/synapse/issues/10135))
2021-08-31 17:23:06 +01:00
Brendan Abolivier 5a33232e0f Merge tag 'v1.35.1' into babolivier/dinsic_1.41.0
Synapse 1.35.1 (2021-06-03)
===========================

Bugfixes
--------

- Fix a bug introduced in v1.35.0 where invite-only rooms would be shown to all users in a space, regardless of if the user had access to it. ([\#10109](https://github.com/matrix-org/synapse/issues/10109))
2021-08-31 17:16:21 +01:00
Brendan Abolivier 200ee12326 Merge tag 'v1.35.0' into babolivier/dinsic_1.41.0
Synapse 1.35.0 (2021-06-01)
===========================

Note that [the tag](https://github.com/matrix-org/synapse/releases/tag/v1.35.0rc3) and [docker images](https://hub.docker.com/layers/matrixdotorg/synapse/v1.35.0rc3/images/sha256-34ccc87bd99a17e2cbc0902e678b5937d16bdc1991ead097eee6096481ecf2c4?context=explore) for `v1.35.0rc3` were incorrectly built. If you are experiencing issues with either, it is recommended to upgrade to the equivalent tag or docker image for the `v1.35.0` release.

Deprecations and Removals
-------------------------

- The core Synapse development team plan to drop support for the [unstable API of MSC2858](https://github.com/matrix-org/matrix-doc/blob/master/proposals/2858-Multiple-SSO-Identity-Providers.md#unstable-prefix), including the undocumented `experimental.msc2858_enabled` config option, in August 2021. Client authors should ensure that their clients are updated to use the stable API (which has been supported since Synapse 1.30) well before that time, to give their users time to upgrade. ([\#10101](https://github.com/matrix-org/synapse/issues/10101))

Bugfixes
--------

- Fixed a bug causing replication requests to fail when receiving a lot of events via federation. Introduced in v1.33.0. ([\#10082](https://github.com/matrix-org/synapse/issues/10082))
- Fix HTTP response size limit to allow joining very large rooms over federation. Introduced in v1.33.0. ([\#10093](https://github.com/matrix-org/synapse/issues/10093))

Internal Changes
----------------

- Log method and path when dropping request due to size limit. ([\#10091](https://github.com/matrix-org/synapse/issues/10091))

Synapse 1.35.0rc2 (2021-05-27)
==============================

Bugfixes
--------

- Fix a bug introduced in v1.35.0rc1 when calling the spaces summary API via a GET request. ([\#10079](https://github.com/matrix-org/synapse/issues/10079))

Synapse 1.35.0rc1 (2021-05-25)
==============================

Features
--------

- Add experimental support to allow a user who could join a restricted room to view it in the spaces summary. ([\#9922](https://github.com/matrix-org/synapse/issues/9922), [\#10007](https://github.com/matrix-org/synapse/issues/10007), [\#10038](https://github.com/matrix-org/synapse/issues/10038))
- Reduce memory usage when joining very large rooms over federation. ([\#9958](https://github.com/matrix-org/synapse/issues/9958))
- Add a configuration option which allows enabling opentracing by user id. ([\#9978](https://github.com/matrix-org/synapse/issues/9978))
- Enable experimental support for [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946) (spaces summary API) and [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083) (restricted join rules) by default. ([\#10011](https://github.com/matrix-org/synapse/issues/10011))

Bugfixes
--------

- Fix a bug introduced in v1.26.0 which meant that `synapse_port_db` would not correctly initialise some postgres sequences, requiring manual updates afterwards. ([\#9991](https://github.com/matrix-org/synapse/issues/9991))
- Fix `synctl`'s `--no-daemonize` parameter to work correctly with worker processes. ([\#9995](https://github.com/matrix-org/synapse/issues/9995))
- Fix a validation bug introduced in v1.34.0 in the ordering of spaces in the space summary API. ([\#10002](https://github.com/matrix-org/synapse/issues/10002))
- Fixed deletion of new presence stream states from database. ([\#10014](https://github.com/matrix-org/synapse/issues/10014), [\#10033](https://github.com/matrix-org/synapse/issues/10033))
- Fixed a bug with very high resolution image uploads throwing internal server errors. ([\#10029](https://github.com/matrix-org/synapse/issues/10029))

Updates to the Docker image
---------------------------

- Fix bug introduced in Synapse 1.33.0 which caused a `Permission denied: '/homeserver.log'` error when starting Synapse with the generated log configuration. Contributed by Sergio Miguéns Iglesias. ([\#10045](https://github.com/matrix-org/synapse/issues/10045))

Improved Documentation
----------------------

- Add hardened systemd files as proposed in [#9760](https://github.com/matrix-org/synapse/issues/9760) and added them to `contrib/`. Change the docs to reflect the presence of these files. ([\#9803](https://github.com/matrix-org/synapse/issues/9803))
- Clarify documentation around SSO mapping providers generating unique IDs and localparts. ([\#9980](https://github.com/matrix-org/synapse/issues/9980))
- Updates to the PostgreSQL documentation (`postgres.md`). ([\#9988](https://github.com/matrix-org/synapse/issues/9988), [\#9989](https://github.com/matrix-org/synapse/issues/9989))
- Fix broken link in user directory documentation. Contributed by @junquera. ([\#10016](https://github.com/matrix-org/synapse/issues/10016))
- Add missing room state entry to the table of contents of room admin API. ([\#10043](https://github.com/matrix-org/synapse/issues/10043))

Deprecations and Removals
-------------------------

- Removed support for the deprecated `tls_fingerprints` configuration setting. Contributed by Jerin J Titus. ([\#9280](https://github.com/matrix-org/synapse/issues/9280))

Internal Changes
----------------

- Allow sending full presence to users via workers other than the one that called `ModuleApi.send_local_online_presence_to`. ([\#9823](https://github.com/matrix-org/synapse/issues/9823))
- Update comments in the space summary handler. ([\#9974](https://github.com/matrix-org/synapse/issues/9974))
- Minor enhancements to the `@cachedList` descriptor. ([\#9975](https://github.com/matrix-org/synapse/issues/9975))
- Split multipart email sending into a dedicated handler. ([\#9977](https://github.com/matrix-org/synapse/issues/9977))
- Run `black` on files in the `scripts` directory. ([\#9981](https://github.com/matrix-org/synapse/issues/9981))
- Add missing type hints to `synapse.util` module. ([\#9982](https://github.com/matrix-org/synapse/issues/9982))
- Simplify a few helper functions. ([\#9984](https://github.com/matrix-org/synapse/issues/9984), [\#9985](https://github.com/matrix-org/synapse/issues/9985), [\#9986](https://github.com/matrix-org/synapse/issues/9986))
- Remove unnecessary property from SQLBaseStore. ([\#9987](https://github.com/matrix-org/synapse/issues/9987))
- Remove `keylen` param on `LruCache`. ([\#9993](https://github.com/matrix-org/synapse/issues/9993))
- Update the Grafana dashboard in `contrib/`. ([\#10001](https://github.com/matrix-org/synapse/issues/10001))
- Add a batching queue implementation. ([\#10017](https://github.com/matrix-org/synapse/issues/10017))
- Reduce memory usage when verifying signatures on large numbers of events at once. ([\#10018](https://github.com/matrix-org/synapse/issues/10018))
- Properly invalidate caches for destination retry timings every (instead of expiring entries every 5 minutes). ([\#10036](https://github.com/matrix-org/synapse/issues/10036))
- Fix running complement tests with Synapse workers. ([\#10039](https://github.com/matrix-org/synapse/issues/10039))
- Fix typo in `get_state_ids_for_event` docstring where the return type was incorrect. ([\#10050](https://github.com/matrix-org/synapse/issues/10050))
2021-08-31 17:16:11 +01:00
Brendan Abolivier 05426e3b8d Merge tag 'v1.34.0' into babolivier/dinsic_1.41.0
Synapse 1.34.0 (2021-05-17)
===========================

This release deprecates the `room_invite_state_types` configuration setting. See the [upgrade notes](https://github.com/matrix-org/synapse/blob/release-v1.34.0/UPGRADE.rst#upgrading-to-v1340) for instructions on updating your configuration file to use the new `room_prejoin_state` setting.

This release also deprecates the `POST /_synapse/admin/v1/rooms/<room_id>/delete` admin API route. Server administrators are encouraged to update their scripts to use the new `DELETE /_synapse/admin/v1/rooms/<room_id>` route instead.

No significant changes since v1.34.0rc1.

Synapse 1.34.0rc1 (2021-05-12)
==============================

Features
--------

- Add experimental option to track memory usage of the caches. ([\#9881](https://github.com/matrix-org/synapse/issues/9881))
- Add support for `DELETE /_synapse/admin/v1/rooms/<room_id>`. ([\#9889](https://github.com/matrix-org/synapse/issues/9889))
- Add limits to how often Synapse will GC, ensuring that large servers do not end up GC thrashing if `gc_thresholds` has not been correctly set. ([\#9902](https://github.com/matrix-org/synapse/issues/9902))
- Improve performance of sending events for worker-based deployments using Redis. ([\#9905](https://github.com/matrix-org/synapse/issues/9905), [\#9950](https://github.com/matrix-org/synapse/issues/9950), [\#9951](https://github.com/matrix-org/synapse/issues/9951))
- Improve performance after joining a large room when presence is enabled. ([\#9910](https://github.com/matrix-org/synapse/issues/9910), [\#9916](https://github.com/matrix-org/synapse/issues/9916))
- Support stable identifiers for [MSC1772](https://github.com/matrix-org/matrix-doc/pull/1772) Spaces. `m.space.child` events will now be taken into account when populating the experimental spaces summary response. Please see [the upgrade notes](https://github.com/matrix-org/synapse/blob/release-v1.34.0/UPGRADE.rst#upgrading-to-v1340) if you have customised `room_invite_state_types` in your configuration. ([\#9915](https://github.com/matrix-org/synapse/issues/9915), [\#9966](https://github.com/matrix-org/synapse/issues/9966))
- Improve performance of backfilling in large rooms. ([\#9935](https://github.com/matrix-org/synapse/issues/9935))
- Add a config option to allow you to prevent device display names from being shared over federation. Contributed by @aaronraimist. ([\#9945](https://github.com/matrix-org/synapse/issues/9945))
- Update support for [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946): Spaces Summary. ([\#9947](https://github.com/matrix-org/synapse/issues/9947), [\#9954](https://github.com/matrix-org/synapse/issues/9954))

Bugfixes
--------

- Fix a bug introduced in v1.32.0 where the associated connection was improperly logged for SQL logging statements. ([\#9895](https://github.com/matrix-org/synapse/issues/9895))
- Correct the type hint for the `user_may_create_room_alias` method of spam checkers. It is provided a `RoomAlias`, not a `str`. ([\#9896](https://github.com/matrix-org/synapse/issues/9896))
- Fix bug where user directory could get out of sync if room visibility and membership changed in quick succession. ([\#9910](https://github.com/matrix-org/synapse/issues/9910))
- Include the `origin_server_ts` property in the experimental [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946) support to allow clients to properly sort rooms. ([\#9928](https://github.com/matrix-org/synapse/issues/9928))
- Fix bugs introduced in v1.23.0 which made the PostgreSQL port script fail when run with a newly-created SQLite database. ([\#9930](https://github.com/matrix-org/synapse/issues/9930))
- Fix a bug introduced in Synapse 1.29.0 which caused `m.room_key_request` to-device messages sent from one user to another to be dropped. ([\#9961](https://github.com/matrix-org/synapse/issues/9961), [\#9965](https://github.com/matrix-org/synapse/issues/9965))
- Fix a bug introduced in v1.27.0 preventing users and appservices exempt from ratelimiting from creating rooms with many invitees. ([\#9968](https://github.com/matrix-org/synapse/issues/9968))

Updates to the Docker image
---------------------------

- Add `startup_delay` to docker healthcheck to reduce waiting time for coming online and update the documentation with extra options. Contributed by @Maquis196. ([\#9913](https://github.com/matrix-org/synapse/issues/9913))

Improved Documentation
----------------------

- Add `port` argument to the Postgres database sample config section. ([\#9911](https://github.com/matrix-org/synapse/issues/9911))

Deprecations and Removals
-------------------------

- Mark as deprecated `POST /_synapse/admin/v1/rooms/<room_id>/delete`. ([\#9889](https://github.com/matrix-org/synapse/issues/9889))

Internal Changes
----------------

- Reduce the length of Synapse's access tokens. ([\#5588](https://github.com/matrix-org/synapse/issues/5588))
- Export jemalloc stats to Prometheus if it is being used. ([\#9882](https://github.com/matrix-org/synapse/issues/9882))
- Add type hints to presence handler. ([\#9885](https://github.com/matrix-org/synapse/issues/9885))
- Reduce memory usage of the LRU caches. ([\#9886](https://github.com/matrix-org/synapse/issues/9886))
- Add type hints to the `synapse.handlers` module. ([\#9896](https://github.com/matrix-org/synapse/issues/9896))
- Time response time for external cache requests. ([\#9904](https://github.com/matrix-org/synapse/issues/9904))
- Minor fixes to the `make_full_schema.sh` script. ([\#9931](https://github.com/matrix-org/synapse/issues/9931))
- Move database schema files into a common directory. ([\#9932](https://github.com/matrix-org/synapse/issues/9932))
- Add debug logging for lost/delayed to-device messages. ([\#9959](https://github.com/matrix-org/synapse/issues/9959))
2021-08-31 17:10:10 +01:00
Brendan Abolivier 72efaa2edd Merge tag 'v1.33.2' into babolivier/dinsic_1.41.0
Synapse 1.33.2 (2021-05-11)
===========================

Due to the security issue highlighted below, server administrators are encouraged to update Synapse. We are not aware of these vulnerabilities being exploited in the wild.

Security advisory
-----------------

This release fixes a denial of service attack ([CVE-2021-29471](https://github.com/matrix-org/synapse/security/advisories/GHSA-x345-32rc-8h85)) against Synapse's push rules implementation. Server admins are encouraged to upgrade.

Internal Changes
----------------

- Unpin attrs dependency. ([\#9946](https://github.com/matrix-org/synapse/issues/9946))
2021-08-31 14:53:42 +01:00
Brendan Abolivier 1d4f5c34d8 Merge tag 'v1.33.0' into babolivier/dinsic_1.41.0
Synapse 1.33.0 (2021-05-05)
===========================

Features
--------

- Build Debian packages for Ubuntu 21.04 (Hirsute Hippo). ([\#9909](https://github.com/matrix-org/synapse/issues/9909))

Synapse 1.33.0rc2 (2021-04-29)
==============================

Bugfixes
--------

- Fix tight loop when handling presence replication when using workers. Introduced in v1.33.0rc1. ([\#9900](https://github.com/matrix-org/synapse/issues/9900))

Synapse 1.33.0rc1 (2021-04-28)
==============================

Features
--------

- Update experimental support for [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083): restricting room access via group membership. ([\#9800](https://github.com/matrix-org/synapse/issues/9800), [\#9814](https://github.com/matrix-org/synapse/issues/9814))
- Add experimental support for handling presence on a worker. ([\#9819](https://github.com/matrix-org/synapse/issues/9819), [\#9820](https://github.com/matrix-org/synapse/issues/9820), [\#9828](https://github.com/matrix-org/synapse/issues/9828), [\#9850](https://github.com/matrix-org/synapse/issues/9850))
- Return a new template when an user attempts to renew their account multiple times with the same token, stating that their account is set to expire. This replaces the invalid token template that would previously be shown in this case. This change concerns the optional account validity feature. ([\#9832](https://github.com/matrix-org/synapse/issues/9832))

Bugfixes
--------

- Fixes the OIDC SSO flow when using a `public_baseurl` value including a non-root URL path. ([\#9726](https://github.com/matrix-org/synapse/issues/9726))
- Fix thumbnail generation for some sites with non-standard content types. Contributed by @rkfg. ([\#9788](https://github.com/matrix-org/synapse/issues/9788))
- Add some sanity checks to identity server passed to 3PID bind/unbind endpoints. ([\#9802](https://github.com/matrix-org/synapse/issues/9802))
- Limit the size of HTTP responses read over federation. ([\#9833](https://github.com/matrix-org/synapse/issues/9833))
- Fix a bug which could cause Synapse to get stuck in a loop of resyncing device lists. ([\#9867](https://github.com/matrix-org/synapse/issues/9867))
- Fix a long-standing bug where errors from federation did not propagate to the client. ([\#9868](https://github.com/matrix-org/synapse/issues/9868))

Improved Documentation
----------------------

- Add a note to the docker docs mentioning that we mirror upstream's supported Docker platforms. ([\#9801](https://github.com/matrix-org/synapse/issues/9801))

Internal Changes
----------------

- Add a dockerfile for running Synapse in worker-mode under Complement. ([\#9162](https://github.com/matrix-org/synapse/issues/9162))
- Apply `pyupgrade` across the codebase. ([\#9786](https://github.com/matrix-org/synapse/issues/9786))
- Move some replication processing out of `generic_worker`. ([\#9796](https://github.com/matrix-org/synapse/issues/9796))
- Replace `HomeServer.get_config()` with inline references. ([\#9815](https://github.com/matrix-org/synapse/issues/9815))
- Rename some handlers and config modules to not duplicate the top-level module. ([\#9816](https://github.com/matrix-org/synapse/issues/9816))
- Fix a long-standing bug which caused `max_upload_size` to not be correctly enforced. ([\#9817](https://github.com/matrix-org/synapse/issues/9817))
- Reduce CPU usage of the user directory by reusing existing calculated room membership. ([\#9821](https://github.com/matrix-org/synapse/issues/9821))
- Small speed up for joining large remote rooms. ([\#9825](https://github.com/matrix-org/synapse/issues/9825))
- Introduce flake8-bugbear to the test suite and fix some of its lint violations. ([\#9838](https://github.com/matrix-org/synapse/issues/9838))
- Only store the raw data in the in-memory caches, rather than objects that include references to e.g. the data stores. ([\#9845](https://github.com/matrix-org/synapse/issues/9845))
- Limit length of accepted email addresses. ([\#9855](https://github.com/matrix-org/synapse/issues/9855))
- Remove redundant `synapse.types.Collection` type definition. ([\#9856](https://github.com/matrix-org/synapse/issues/9856))
- Handle recently added rate limits correctly when using `--no-rate-limit` with the demo scripts. ([\#9858](https://github.com/matrix-org/synapse/issues/9858))
- Disable invite rate-limiting by default when running the unit tests. ([\#9871](https://github.com/matrix-org/synapse/issues/9871))
- Pass a reactor into `SynapseSite` to make testing easier. ([\#9874](https://github.com/matrix-org/synapse/issues/9874))
- Make `DomainSpecificString` an `attrs` class. ([\#9875](https://github.com/matrix-org/synapse/issues/9875))
- Add type hints to `synapse.api.auth` and `synapse.api.auth_blocking` modules. ([\#9876](https://github.com/matrix-org/synapse/issues/9876))
- Remove redundant `_PushHTTPChannel` test class. ([\#9878](https://github.com/matrix-org/synapse/issues/9878))
- Remove backwards-compatibility code for Python versions < 3.6. ([\#9879](https://github.com/matrix-org/synapse/issues/9879))
- Small performance improvement around handling new local presence updates. ([\#9887](https://github.com/matrix-org/synapse/issues/9887))
2021-08-31 14:53:31 +01:00
Mathieu Velten 25747d84a4 Create workflows.yml 2021-08-31 13:23:02 +02:00
Brendan Abolivier 06690b167a Merge tag 'v1.32.2' into babolivier/dinsic_1.41.0
Synapse 1.32.2 (2021-04-22)
===========================

This release includes a fix for a regression introduced in 1.32.0.

Bugfixes
--------

- Fix a regression in Synapse 1.32.0 and 1.32.1 which caused `LoggingContext` errors in plugins. ([\#9857](https://github.com/matrix-org/synapse/issues/9857))
2021-08-31 11:40:37 +01:00
Brendan Abolivier 9de3991b9e Merge tag 'v1.32.0' into babolivier/dinsic_1.41.0
Synapse 1.32.0 (2021-04-20)
===========================

**Note:** This release requires Python 3.6+ and Postgres 9.6+ or SQLite 3.22+.

This release removes the deprecated `GET /_synapse/admin/v1/users/<user_id>` admin API. Please use the [v2 API](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/user_admin_api.rst#query-user-account) instead, which has improved capabilities.

This release requires Application Services to use type `m.login.application_service` when registering users via the `/_matrix/client/r0/register` endpoint to comply with the spec. Please ensure your Application Services are up to date.

Bugfixes
--------

- Fix the log lines of nested logging contexts. Broke in 1.32.0rc1. ([\#9829](https://github.com/matrix-org/synapse/issues/9829))

Synapse 1.32.0rc1 (2021-04-13)
==============================

Features
--------

- Add a Synapse module for routing presence updates between users. ([\#9491](https://github.com/matrix-org/synapse/issues/9491))
- Add an admin API to manage ratelimit for a specific user. ([\#9648](https://github.com/matrix-org/synapse/issues/9648))
- Include request information in structured logging output. ([\#9654](https://github.com/matrix-org/synapse/issues/9654))
- Add `order_by` to the admin API `GET /_synapse/admin/v2/users`. Contributed by @dklimpel. ([\#9691](https://github.com/matrix-org/synapse/issues/9691))
- Replace the `room_invite_state_types` configuration setting with `room_prejoin_state`. ([\#9700](https://github.com/matrix-org/synapse/issues/9700))
- Add experimental support for [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083): restricting room access via group membership. ([\#9717](https://github.com/matrix-org/synapse/issues/9717), [\#9735](https://github.com/matrix-org/synapse/issues/9735))
- Update experimental support for Spaces: include `m.room.create` in the room state sent with room-invites. ([\#9710](https://github.com/matrix-org/synapse/issues/9710))
- Synapse now requires Python 3.6 or later. It also requires Postgres 9.6 or later or SQLite 3.22 or later. ([\#9766](https://github.com/matrix-org/synapse/issues/9766))

Bugfixes
--------

- Prevent `synapse_forward_extremities` and `synapse_excess_extremity_events` Prometheus metrics from initially reporting zero-values after startup. ([\#8926](https://github.com/matrix-org/synapse/issues/8926))
- Fix recently added ratelimits to correctly honour the application service `rate_limited` flag. ([\#9711](https://github.com/matrix-org/synapse/issues/9711))
- Fix longstanding bug which caused `duplicate key value violates unique constraint "remote_media_cache_thumbnails_media_origin_media_id_thumbna_key"` errors. ([\#9725](https://github.com/matrix-org/synapse/issues/9725))
- Fix bug where sharded federation senders could get stuck repeatedly querying the DB in a loop, using lots of CPU. ([\#9770](https://github.com/matrix-org/synapse/issues/9770))
- Fix duplicate logging of exceptions thrown during federation transaction processing. ([\#9780](https://github.com/matrix-org/synapse/issues/9780))

Updates to the Docker image
---------------------------

- Move opencontainers labels to the final Docker image such that users can inspect them. ([\#9765](https://github.com/matrix-org/synapse/issues/9765))

Improved Documentation
----------------------

- Make the `allowed_local_3pids` regex example in the sample config stricter. ([\#9719](https://github.com/matrix-org/synapse/issues/9719))

Deprecations and Removals
-------------------------

- Remove old admin API `GET /_synapse/admin/v1/users/<user_id>`. ([\#9401](https://github.com/matrix-org/synapse/issues/9401))
- Make `/_matrix/client/r0/register` expect a type of `m.login.application_service` when an Application Service registers a user, to align with [the relevant spec](https://spec.matrix.org/unstable/application-service-api/#server-admin-style-permissions). ([\#9548](https://github.com/matrix-org/synapse/issues/9548))

Internal Changes
----------------

- Replace deprecated `imp` module with successor `importlib`. Contributed by Cristina Muñoz. ([\#9718](https://github.com/matrix-org/synapse/issues/9718))
- Experiment with GitHub Actions for CI. ([\#9661](https://github.com/matrix-org/synapse/issues/9661))
- Introduce flake8-bugbear to the test suite and fix some of its lint violations. ([\#9682](https://github.com/matrix-org/synapse/issues/9682))
- Update `scripts-dev/complement.sh` to use a local checkout of Complement, allow running a subset of tests and have it use Synapse's Complement test blacklist. ([\#9685](https://github.com/matrix-org/synapse/issues/9685))
- Improve Jaeger tracing for `to_device` messages. ([\#9686](https://github.com/matrix-org/synapse/issues/9686))
- Add release helper script for automating part of the Synapse release process. ([\#9713](https://github.com/matrix-org/synapse/issues/9713))
- Add type hints to expiring cache. ([\#9730](https://github.com/matrix-org/synapse/issues/9730))
- Convert various testcases to `HomeserverTestCase`. ([\#9736](https://github.com/matrix-org/synapse/issues/9736))
- Start linting mypy with `no_implicit_optional`. ([\#9742](https://github.com/matrix-org/synapse/issues/9742))
- Add missing type hints to federation handler and server. ([\#9743](https://github.com/matrix-org/synapse/issues/9743))
- Check that a `ConfigError` is raised, rather than simply `Exception`, when appropriate in homeserver config file generation tests. ([\#9753](https://github.com/matrix-org/synapse/issues/9753))
- Fix incompatibility with `tox` 2.5. ([\#9769](https://github.com/matrix-org/synapse/issues/9769))
- Enable Complement tests for [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946): Spaces Summary API. ([\#9771](https://github.com/matrix-org/synapse/issues/9771))
- Use mock from the standard library instead of a separate package. ([\#9772](https://github.com/matrix-org/synapse/issues/9772))
- Update Black configuration to target Python 3.6. ([\#9781](https://github.com/matrix-org/synapse/issues/9781))
- Add option to skip unit tests when building Debian packages. ([\#9793](https://github.com/matrix-org/synapse/issues/9793))
2021-08-31 11:40:27 +01:00
Mathieu Velten 9691665147 Fix formatting 2021-08-30 16:14:35 +02:00
Mathieu Velten bf461ad7b4 Fix deactivation 2021-08-30 16:14:35 +02:00
Brendan Abolivier 1c77d90c1f Incorporate fixes from https://github.com/matrix-org/synapse-freeze-room 2021-07-29 18:09:14 +01:00
Brendan Abolivier 807f821878 Use an org.matrix namespace for the frozen state event
Otherwise it's weird to publish the extracted module to matrix-org
2021-07-27 14:49:10 +01:00
Brendan Abolivier 1a1a83abcb Rework room freeze and implement unfreezing the room (#100)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2021-07-22 17:50:07 +02:00
Brendan Abolivier fcc10d9caa Merge pull request #99 from matrix-org/anoa/fix_pipeline
Switch back to using Sytest dinsic branch
2021-07-13 15:53:19 +02:00
Andrew Morgan eedaf793b9 Note the debian version of the sytest image we're using 2021-05-21 17:28:19 +01:00
Andrew Morgan 8231769c98 Switch back to using Sytest dinsic branch
As part of the 1.31.0 mainline merge, we updated the buildkite pipeline to
more closely match mainline. Unfortunately we accidentally also updated the
sytest portion verbatim, which meant we were now running Sytest develop
against dinsic. This inevitably broke as dinsic started to fall behind
mainline again.

This commit returns us back to the dinsic tag of matrixdotorg/sytest-synapse,
as well as removes some Linux distro variations which we aren't using
for dinsic.
2021-05-21 16:28:03 +01:00
Mathieu Velten b2932910c3 Unbind using bind_new_user_emails_to_sydent if specified (#98) 2021-05-21 17:27:09 +02:00
Andrew Morgan a5575ea3cf Merge pull request #97 from matrix-org/anoa/dinsic_release_1_31_0
Merge Synapse release v1.31.0 into dinsic
2021-04-28 10:07:20 +01:00
Andrew Morgan 4d034f5389 Remove 3.6 old deps check 2021-04-27 19:01:41 +01:00
Richard van der Hoff a0f5001155 unpin olddeps build from py36 2021-04-26 17:49:14 +01:00
Andrew Morgan 2e627ecc12 Remove spaces tests from Complement 2021-04-26 17:47:48 +01:00
Andrew Morgan 5706c8ba34 fix isort and mypy linting 2021-04-26 16:24:28 +01:00
Andrew Morgan f95ec907c1 Remove old pin on mypy and mypy-zope 2021-04-26 15:08:56 +01:00
Andrew Morgan 1852e6ab6d Re-sync synapse-dinsic buildkite pipeline with matrix-org/pipelines/synapse 2021-04-26 15:00:14 +01:00
Andrew Morgan 292c80866f Merge commit '1d8863c67' into anoa/dinsic_release_1_31_0 2021-04-23 18:25:46 +01:00
Andrew Morgan 69d83ca0f0 Merge commit '78e48f61b' into anoa/dinsic_release_1_31_0 2021-04-23 18:25:38 +01:00
Andrew Morgan 141eb2b503 Merge commit 'c6f8e8086' into anoa/dinsic_release_1_31_0 2021-04-23 18:14:57 +01:00
Andrew Morgan 5a8980f224 Merge commit '12d618471' into anoa/dinsic_release_1_31_0 2021-04-23 18:14:46 +01:00
Andrew Morgan 3d08c7e63b Merge commit 'e5801db83' into anoa/dinsic_release_1_31_0 2021-04-23 18:14:38 +01:00
Andrew Morgan cb6c2caf05 Merge commit 'c73cc2c2a' into anoa/dinsic_release_1_31_0 2021-04-23 18:14:20 +01:00
Andrew Morgan 2d95fa1e57 Merge commit '4ecba9bd5' into anoa/dinsic_release_1_31_0 2021-04-23 18:11:23 +01:00
Andrew Morgan 8c358933ec Merge commit 'e2904f720' into anoa/dinsic_release_1_31_0 2021-04-23 17:52:01 +01:00
Andrew Morgan 67b2aa8b9f Merge commit '0e3558473' into anoa/dinsic_release_1_31_0 2021-04-23 17:51:52 +01:00
Andrew Morgan 55dd2951d0 Merge commit 'cc324d53f' into anoa/dinsic_release_1_31_0 2021-04-23 17:49:34 +01:00
Andrew Morgan ea35d2cddc Merge commit 'ad721fc55' into anoa/dinsic_release_1_31_0 2021-04-23 17:49:30 +01:00
Andrew Morgan cac2b54fa0 Merge commit 'd315e9644' into anoa/dinsic_release_1_31_0 2021-04-23 17:49:16 +01:00
Andrew Morgan b40e586b5b Merge commit '1c8a2541d' into anoa/dinsic_release_1_31_0 2021-04-23 17:28:43 +01:00
Andrew Morgan 8cb8c604e4 Merge commit '55da8df07' into anoa/dinsic_release_1_31_0 2021-04-23 17:28:38 +01:00
Andrew Morgan e2b996ecf3 Merge commit 'a7a379006' into anoa/dinsic_release_1_31_0 2021-04-23 17:28:34 +01:00
Andrew Morgan f9b719fcbe Merge commit '918f6ed82' into anoa/dinsic_release_1_31_0 2021-04-23 17:28:25 +01:00
Andrew Morgan 977d3dc589 Merge commit '7fdc6cefb' into anoa/dinsic_release_1_31_0 2021-04-23 17:26:38 +01:00
Andrew Morgan 7fffd3789b Merge commit '22db45bd4' into anoa/dinsic_release_1_31_0 2021-04-23 17:26:31 +01:00
Andrew Morgan 39f236f596 Merge commit '15c788e22' into anoa/dinsic_release_1_31_0 2021-04-23 16:25:02 +01:00
Andrew Morgan c8e6ac4977 Merge commit '33a02f0f5' into anoa/dinsic_release_1_31_0 2021-04-23 16:24:53 +01:00
Andrew Morgan 96f8556e08 Merge commit 'a5daae2a5' into anoa/dinsic_release_1_31_0 2021-04-23 16:24:31 +01:00
Andrew Morgan 5d4591515e Merge commit 'f00c4e7af' into anoa/dinsic_release_1_31_0 2021-04-23 16:18:51 +01:00
Andrew Morgan 7ce8d7877e Merge commit 'e12077a78' into anoa/dinsic_release_1_31_0 2021-04-23 15:44:57 +01:00
Andrew Morgan c44a5b7f17 Merge commit 'b5c4fe197' into anoa/dinsic_release_1_31_0 2021-04-23 14:38:38 +01:00
Andrew Morgan 6afa265e4e Merge commit '292792194' into anoa/dinsic_release_1_31_0 2021-04-23 14:38:31 +01:00
Andrew Morgan 1996a5f445 Merge commit '1b2d6d55c' into anoa/dinsic_release_1_31_0 2021-04-23 14:38:26 +01:00
Andrew Morgan d2b3c47ba3 Merge commit 'e22b71810' into anoa/dinsic_release_1_31_0 2021-04-23 14:12:47 +01:00
Andrew Morgan 2036503c9e Merge commit 'd9f1dccba' into anoa/dinsic_release_1_31_0 2021-04-23 13:39:50 +01:00
Andrew Morgan 9aba40a2d9 Merge commit '3d2acc930' into anoa/dinsic_release_1_31_0 2021-04-23 13:33:30 +01:00
Andrew Morgan 5a514a3e11 Merge commit '1381cd05b' into anoa/dinsic_release_1_31_0 2021-04-23 12:22:55 +01:00
Andrew Morgan 2e3baa1f49 Merge commit 'd80428513' into anoa/dinsic_release_1_31_0 2021-04-23 12:22:48 +01:00
Andrew Morgan 458add9e29 Merge commit '8ec221710' into anoa/dinsic_release_1_31_0 2021-04-23 12:22:35 +01:00
Andrew Morgan 476cc03d7a Merge commit 'd2f0ec12d' into anoa/dinsic_release_1_31_0 2021-04-23 12:22:28 +01:00
Andrew Morgan b18b51cd9d Merge commit 'a27c1fd74' into anoa/dinsic_release_1_31_0 2021-04-22 19:17:37 +01:00
Andrew Morgan 3e6a798ee7 Merge commit 'e40d88cff' into anoa/dinsic_release_1_31_0 2021-04-22 19:11:54 +01:00
Andrew Morgan 62a44bcedc Merge commit 'fb0e14ee9' into anoa/dinsic_release_1_31_0 2021-04-22 19:05:12 +01:00
Andrew Morgan d8df16e331 Merge commit '3f58fc848' into anoa/dinsic_release_1_31_0 2021-04-22 19:04:59 +01:00
Andrew Morgan 2eb003c966 Merge commit '5a9cdaa6e' into anoa/dinsic_release_1_31_0 2021-04-22 19:02:24 +01:00
Andrew Morgan ae9ce80220 Merge commit '7e8083eb4' into anoa/dinsic_release_1_31_0 2021-04-22 19:02:16 +01:00
Andrew Morgan d06a48b4be Merge commit '2ab6e67ab' into anoa/dinsic_release_1_31_0 2021-04-22 19:02:12 +01:00
Andrew Morgan 92161ae9ed Merge commit 'e288499c6' into anoa/dinsic_release_1_31_0 2021-04-22 19:02:06 +01:00
Andrew Morgan aa8555e337 Merge commit '261093072' into anoa/dinsic_release_1_31_0 2021-04-22 19:02:04 +01:00
Andrew Morgan f69315c707 Up invite ratelimiting for tests 2021-04-22 18:57:33 +01:00
Andrew Morgan 0145f103f5 Merge commit '351845452' into anoa/dinsic_release_1_31_0 2021-04-22 18:39:22 +01:00
Andrew Morgan 9273535ade Merge commit '18ab35284' into anoa/dinsic_release_1_31_0 2021-04-22 18:37:01 +01:00
Andrew Morgan 3518cc79b6 Merge commit '9c715a5f1' into anoa/dinsic_release_1_31_0 2021-04-22 18:33:37 +01:00
Andrew Morgan 27fd9474ae Merge commit 'e19396d62' into anoa/dinsic_release_1_31_0 2021-04-22 18:32:44 +01:00
Andrew Morgan 3c159e5c0c Merge commit 'a78016dad' into anoa/dinsic_release_1_31_0 2021-04-22 18:32:38 +01:00
Andrew Morgan 7bf3a6ee18 Merge commit '2e537a028' into anoa/dinsic_release_1_31_0 2021-04-22 18:31:10 +01:00
Andrew Morgan 5b03150d67 Merge commit '73ed289bd' into anoa/dinsic_release_1_31_0 2021-04-22 18:30:17 +01:00
Andrew Morgan cfa0cff6aa Merge commit '1baab2035' into anoa/dinsic_release_1_31_0 2021-04-22 18:30:10 +01:00
Andrew Morgan 159622bd9a Merge commit 'cee4010f9' into anoa/dinsic_release_1_31_0 2021-04-22 18:30:04 +01:00
Andrew Morgan f22d69bcf3 Merge commit 'fdf834694' into anoa/dinsic_release_1_31_0 2021-04-22 18:29:56 +01:00
Andrew Morgan cb444f4346 Merge commit '2547d9d4d' into anoa/dinsic_release_1_31_0 2021-04-22 18:29:51 +01:00
Andrew Morgan c68ed1c5ad Merge commit 'a01605c13' into anoa/dinsic_release_1_31_0 2021-04-22 18:29:47 +01:00
Andrew Morgan 7eb2af047c Merge commit '28f255d5f' into anoa/dinsic_release_1_31_0 2021-04-22 18:29:40 +01:00
Andrew Morgan 19dc9ec9a1 Merge commit '939ef657c' into anoa/dinsic_release_1_31_0 2021-04-22 18:29:36 +01:00
Andrew Morgan 1724f1b28e Merge commit '2506074ef' into anoa/dinsic_release_1_31_0 2021-04-22 18:29:32 +01:00
Andrew Morgan 357f84c952 Merge commit '42a8e8137' into anoa/dinsic_release_1_31_0 2021-04-22 18:27:20 +01:00
Andrew Morgan cee7d650cb Merge commit '937b849a2' into anoa/dinsic_release_1_31_0 2021-04-22 18:26:38 +01:00
Andrew Morgan 2475aedff5 Merge commit '4c37d2acd' into anoa/dinsic_release_1_31_0 2021-04-22 18:26:28 +01:00
Andrew Morgan d676da986e Merge commit 'c8e6e0584' into anoa/dinsic_release_1_31_0 2021-04-22 18:26:17 +01:00
Andrew Morgan 15f31e1ca9 Merge commit '0cd2938bc' into anoa/dinsic_release_1_31_0 2021-04-22 18:26:10 +01:00
Andrew Morgan 50e257bea1 Merge commit 'fa50e4bf4' into anoa/dinsic_release_1_31_0 2021-04-22 18:24:35 +01:00
Andrew Morgan e941c9898d Merge commit '72822e60b' into anoa/dinsic_release_1_31_0 2021-04-22 18:15:04 +01:00
Andrew Morgan 07c70a8261 Merge commit '73b03722f' into anoa/dinsic_release_1_31_0 2021-04-22 18:12:49 +01:00
Andrew Morgan 53f6ab1c34 Merge commit '2b467d0b6' into anoa/dinsic_release_1_31_0 2021-04-22 17:29:20 +01:00
Andrew Morgan 6714a091ea Merge commit '9de6b9411' into anoa/dinsic_release_1_31_0 2021-04-22 17:28:31 +01:00
Andrew Morgan a31eb4a9fd Merge commit '3e4cdfe5d' into anoa/dinsic_release_1_31_0 2021-04-22 16:34:35 +01:00
Andrew Morgan 23ce9ea383 Merge commit 'd34c6e127' into anoa/dinsic_release_1_31_0 2021-04-22 16:22:57 +01:00
Andrew Morgan 3f8b6e5091 Merge commit '20af31088' into anoa/dinsic_release_1_31_0 2021-04-22 16:22:50 +01:00
Andrew Morgan 9d9bd2bb81 Merge commit '631dd06f2' into anoa/dinsic_release_1_31_0 2021-04-22 16:22:43 +01:00
Andrew Morgan 06a99a44f7 Merge commit '12702be95' into anoa/dinsic_release_1_31_0 2021-04-22 16:22:35 +01:00
Andrew Morgan 72b2cb5460 Merge commit '420031906' into anoa/dinsic_release_1_31_0 2021-04-22 16:22:27 +01:00
Andrew Morgan 527049b71a Merge commit '233c8b9fc' into anoa/dinsic_release_1_31_0 2021-04-22 16:22:21 +01:00
Andrew Morgan dabcff44bb Merge commit 'dc3c83a93' into anoa/dinsic_release_1_31_0 2021-04-22 16:22:14 +01:00
Andrew Morgan 3f2491d6a0 Fix mypy check fail 2021-04-22 16:21:58 +01:00
Andrew Morgan 77f011b8fd Merge commit '98a64b7f7' into anoa/dinsic_release_1_31_0 2021-04-22 16:21:11 +01:00
Andrew Morgan bae39a4777 Merge commit '3dd6ba135' into anoa/dinsic_release_1_31_0 2021-04-21 16:17:14 +01:00
Andrew Morgan cbd4e6ba68 Merge commit 'fa6deb298' into anoa/dinsic_release_1_31_0 2021-04-21 16:17:10 +01:00
Andrew Morgan a01843fd88 Merge commit '2fb1c2b6e' into anoa/dinsic_release_1_31_0 2021-04-21 16:17:02 +01:00
Andrew Morgan 64150ac9ba Merge commit 'a03d71dc9' into anoa/dinsic_release_1_31_0 2021-04-21 16:16:41 +01:00
Andrew Morgan a1a9b51fd7 Merge commit '63593134a' into anoa/dinsic_release_1_31_0 2021-04-21 16:16:30 +01:00
Andrew Morgan 4c970214af Merge commit '23d701864' into anoa/dinsic_release_1_31_0 2021-04-21 16:16:22 +01:00
Andrew Morgan c7cd7b4545 Merge commit '0312266ee' into anoa/dinsic_release_1_31_0 2021-04-21 16:16:10 +01:00
Andrew Morgan 7ba1c62875 Merge commit '2fe0fb21f' into anoa/dinsic_release_1_31_0 2021-04-21 15:35:38 +01:00
Andrew Morgan 1ca3f40437 Merge commit '1c9a85056' into anoa/dinsic_release_1_31_0 2021-04-21 15:35:26 +01:00
Andrew Morgan 744f456324 Merge commit '9999eb2d0' into anoa/dinsic_release_1_31_0 2021-04-21 15:35:15 +01:00
Andrew Morgan 82b462401f Merge commit '4218473f9' into anoa/dinsic_release_1_31_0 2021-04-21 15:34:28 +01:00
Andrew Morgan 52620bdb83 Merge commit '28877fade' into anoa/dinsic_release_1_31_0 2021-04-21 15:09:52 +01:00
Andrew Morgan 995136eb38 Merge commit 'a7a913918' into anoa/dinsic_release_1_31_0 2021-04-20 17:42:58 +01:00
Andrew Morgan ed6742cb30 Merge commit 'c9c1c9d82' into anoa/dinsic_release_1_31_0 2021-04-20 16:59:59 +01:00
Andrew Morgan de2918f0cb Merge commit '7932d4e9f' into anoa/dinsic_release_1_31_0 2021-04-20 16:41:37 +01:00
Andrew Morgan 83c1c8a56b Merge commit 'ff5c4da12' into anoa/dinsic_release_1_31_0 2021-04-20 16:41:22 +01:00
Andrew Morgan 59766708cf Fix old-style uses of self.make_request in dinum test code 2021-04-16 15:46:03 +01:00
Andrew Morgan ec2cab331d Merge commit 'bd30cfe86' into anoa/dinsic_release_1_31_0 2021-04-16 15:45:40 +01:00
Andrew Morgan 7fd80c73cc Merge commit '8388a7fb3' into anoa/dinsic_release_1_31_0 2021-04-16 15:06:31 +01:00
Andrew Morgan 394e6d2c72 Merge commit '01333681b' into anoa/dinsic_release_1_31_0 2021-04-16 15:06:19 +01:00
Andrew Morgan 22927d6ee8 lint 2021-04-16 15:06:06 +01:00
Andrew Morgan cf1e0196bb Merge commit 'f14428b25' into anoa/dinsic_release_1_31_0 2021-04-16 15:02:53 +01:00
Andrew Morgan eb19dc5578 Merge commit 'c64002e1c' into anoa/dinsic_release_1_31_0 2021-04-16 14:26:36 +01:00
Andrew Morgan 8011007148 Merge commit '6ff34e00d' into anoa/dinsic_release_1_31_0 2021-04-16 14:26:27 +01:00
Andrew Morgan 93db8f1992 Merge commit 'cf7d3c90d' into dinsic 2021-04-16 12:33:45 +01:00
Andrew Morgan 0060eb332c Port "Allow providing credentials to HTTPS_PROXY (#9657)" from mainline (#95)
* Allow providing credentials to HTTPS_PROXY (#9657)

Addresses https://github.com/matrix-org/synapse-dinsic/issues/70

This PR causes `ProxyAgent` to attempt to extract credentials from an `HTTPS_PROXY` env var. If credentials are found, a `Proxy-Authorization` header ([details](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization)) is sent to the proxy server to authenticate against it. The headers are *not* passed to the remote server.

Also added some type hints.

* lint
2021-03-23 15:35:38 +01:00
Andrew Morgan 0da5273f71 Stabilise all knock-related unstable identifiers that would be in state (#96) 2021-03-23 13:44:34 +00:00
Andrew Morgan 232b324c38 Port "Add support for no_proxy and case insensitive env variables" from mainline to dinsic (#93)
This PR is simply porting https://github.com/matrix-org/synapse/pull/9372 to dinsic.

I also had to bring in https://github.com/matrix-org/synapse/pull/8821 and https://github.com/matrix-org/synapse/pull/9084 for this code to work properly - a sign that we should merge mainline into dinsic again soon.
2021-03-22 17:48:42 +00:00
Andrew Morgan 396e7d4079 Remove extraneous print (#94) 2021-03-19 17:44:40 +00:00
Andrew Morgan 815ab46f63 Fix the pipeline to use knock v7 Complement branch (#92) 2021-03-19 15:42:20 +00:00
Andrew Morgan 9aa6276c8c Cap mypy tests at twisted==20.3.0 (#90) 2021-03-19 15:10:08 +00:00
Andrew Morgan 7a61b0e752 Change knock room version to v7 (#88) 2021-03-18 17:26:13 +00:00
Andrew Morgan 934785866f Allow knock->knock transitions (#86)
Small change to the event auth rules that allows transitioning from knock->knock (in case you want to update your knock reason, or change profile information etc).

Coincides with the same commit in [the mainline PR](https://github.com/matrix-org/synapse/pull/6739) and [this update on MSC2403](https://github.com/matrix-org/matrix-doc/pull/2403/commits/49a72862a93d814219968cff814ff63926181645).
2021-03-02 11:07:20 +00:00
Mathieu Velten fe551bf15a change check_threepid_can_be_invited to async (#85) 2021-03-01 16:10:19 +01:00
Andrew Morgan 8f97c6c2da Add a config option to prioritise local users in user directory search results (#84)
* Add a config option to prioritise local users in user directory search results (#9383)

This PR adds a homeserver config option, `user_directory.prefer_local_users`, that when enabled will show local users higher in user directory search results than remote users. This option is off by default.

Note that turning this on doesn't necessarily mean that remote users will always be put below local users, but they should be assuming all other ranking factors (search query match, profile information present etc) are identical.

This is useful for, say, University networks that are openly federating, but want to prioritise local students and staff in the user directory over other random users.

* Don't mix simple and english psql query types
2021-02-19 12:11:02 +00:00
Andrew Morgan 79a213ecec Send a ver query parameter for make_knock (#83)
This informs the remote server of the room versions we support. If the room we're trying to
knock on has a version that is not one of our supported room versions, the remote server
will return an unsupported room version error.

Noticed in https://github.com/matrix-org/matrix-doc/pull/2403#discussion_r577042144

Ported from https://github.com/matrix-org/synapse/pull/6739
2021-02-17 15:29:36 +00:00
Andrew Morgan d180754623 Show knock rooms in the public room directory and inform clients they can be knocked on (#82)
This PR implements the ["Changes regarding the Public Rooms Directory"](https://github.com/Sorunome/matrix-doc/blob/soru/knock/proposals/2403-knock.md#changes-regarding-the-public-rooms-directory) section of knocking MSC2403.

Specifically, it:

* Allows rooms with `join_rule` "knock" to be returned by the query behind the public rooms directory
* Adds the field `join_rule` to each room entry returned by a public rooms directory query, so clients can know whether to attempt a join or knock on a room

This PR is a clone of [the mainline PR](https://github.com/matrix-org/synapse/pull/9359). Complement tests for this change: https://github.com/matrix-org/complement/pull/72.
2021-02-10 14:51:12 +00:00
Andrew Morgan 6bf58d8194 Add knocking support (#81)
Implement knocking as defined by https://github.com/matrix-org/matrix-doc/pull/2403

This is the base knocking stuff, taken from https://github.com/matrix-org/synapse/pull/6739
and does not include any public room directory changes.

While knocking hasn't merged yet on mainline due to waiting on getting Complement
into Synapse's CI, the code has been well-tested.
2021-02-09 19:07:00 +00:00
Andrew Morgan 2c896f1dfb Add complement running monolith synapse to buildkite pipeline (#80) 2021-02-09 12:32:55 +00:00
Andrew Morgan 28106a581f Fix Python Old-Deps CI step (#79)
* Fix the Python 3.5 old-deps build. (#9146)

setuptools 51.0.0 dropped support for Python 3.5.

* Fix Python 3.5 old deps build by using a compatible pip version. (#9217)

Co-authored-by: Dan Callahan <danc@element.io>

pip 21.0 stopped supporting Python 3.5.

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-02-09 11:47:28 +00:00
Andrew Morgan d36bfdd64d Remove riot email registration backwards compatibility hack
This was causing a LoginError to be propagated up to the registration servlet, which was
expecting a InteractiveAuthIncompleteError in order to store a password_hash from the
client for the session. DINUM relies on this happening.

More info here: https://github.com/matrix-org/synapse/issues/9263
2021-01-29 14:41:56 +00:00
Mathieu Velten d2953b3562 Add a parameter to enable/disable freeze feature (#78) 2021-01-21 15:17:40 +01:00
Andrew Morgan e97045613c Ensure we read account validity templates from custom template dir if provided (#77) 2021-01-19 10:07:15 +00:00
Mathieu Velten 09276e023b Change check_3pid_allowed to async (#76) 2021-01-18 17:58:51 +01:00
Andrew Morgan 2e0bc9804c Merge pull request #75 from matrix-org/anoa/dinsic_release_1_24_0
Updating DINUM's synapse branch from v1.21.2 -> v1.24.0.

Shouldn't be any deprecations or config file changes to worry about.

This merge is paired with one for Sytest as well: matrix-org/sytest#999
2021-01-04 02:58:27 +00:00
Andrew Morgan 088c97dd3b Better align mainline and dinsic buildkite pipelines 2021-01-03 21:09:53 -05:00
Andrew Morgan 4fd2bd67dd Merge commit '3e8292d48' into anoa/dinsic_release_1_23_1 2020-12-31 17:57:00 +00:00
Andrew Morgan 72a1c62278 Merge commit '1cec3d145' into anoa/dinsic_release_1_23_1 2020-12-31 17:21:56 +00:00
Andrew Morgan 44d62d0804 Merge commit '9b26a4ac8' into anoa/dinsic_release_1_23_1 2020-12-31 17:20:00 +00:00
Andrew Morgan 192bf29ca0 Merge commit '693dab487' into anoa/dinsic_release_1_23_1 2020-12-31 17:19:54 +00:00
Andrew Morgan b0c601e00e Merge commit '53b12688d' into anoa/dinsic_release_1_23_1 2020-12-31 17:19:48 +00:00
Andrew Morgan 945055e6f7 Merge commit 'd3ed93504' into anoa/dinsic_release_1_23_1 2020-12-31 17:19:35 +00:00
Andrew Morgan a839d0f32d Merge commit '09ac0569f' into anoa/dinsic_release_1_23_1 2020-12-31 17:19:14 +00:00
Andrew Morgan 9ab7375f9d Merge commit 'a090b8620' into anoa/dinsic_release_1_23_1 2020-12-31 17:09:21 +00:00
Andrew Morgan 0c897c7410 Merge commit '7c4344747' into anoa/dinsic_release_1_23_1 2020-12-31 17:08:54 +00:00
Andrew Morgan fce9ace555 Merge commit '8ca120df7' into anoa/dinsic_release_1_23_1 2020-12-31 16:50:13 +00:00
Andrew Morgan 3cf5e8b3f9 Merge commit '03e392f78' into anoa/dinsic_release_1_23_1 2020-12-31 16:50:11 +00:00
Andrew Morgan 56257fb995 Merge commit 'ef366720d' into anoa/dinsic_release_1_23_1 2020-12-31 16:20:49 +00:00
Andrew Morgan 1077d50c65 Merged commit 'deff8f628' into anoa/dinsic_release_1_23_1 2020-12-31 16:20:32 +00:00
Andrew Morgan 5c51806d1d Merge commit 'acfe3b306' into anoa/dinsic_release_1_23_1 2020-12-31 15:22:27 +00:00
Andrew Morgan 6ee9980843 Merge commit '129ae841e' into anoa/dinsic_release_1_23_1 2020-12-31 14:55:29 +00:00
Andrew Morgan 917d0f9250 Merge commit 'f12589547' into anoa/dinsic_release_1_23_1 2020-12-31 14:55:18 +00:00
Andrew Morgan 3dd861e6aa Merge commit '9debe657a' into anoa/dinsic_release_1_23_1 2020-12-31 14:36:00 +00:00
Andrew Morgan ca151ff0bd Merge commit '4a54b821b' into anoa/dinsic_release_1_23_1 2020-12-31 14:35:50 +00:00
Andrew Morgan 883c742960 Merge commit '89700dfb8' into anoa/dinsic_release_1_23_1 2020-12-31 14:35:45 +00:00
Andrew Morgan 551681c29d Merge commit 'c3119d153' into anoa/dinsic_release_1_23_1 2020-12-31 14:35:35 +00:00
Andrew Morgan 535afe4313 Merge commit 'f27a78969' into anoa/dinsic_release_1_23_1 2020-12-31 14:35:28 +00:00
Andrew Morgan 71289856e5 Merge commit 'b4289795e' into anoa/dinsic_release_1_23_1 2020-12-31 14:35:16 +00:00
Andrew Morgan de6773523d Merge commit 'ef2d62701' into anoa/dinsic_release_1_23_1 2020-12-31 14:34:59 +00:00
Andrew Morgan b90b34744a Merge commit 'c97da1e45' into anoa/dinsic_release_1_23_1 2020-12-31 13:40:57 +00:00
Andrew Morgan 3efa169750 Merge commit '88e1d0c52' into anoa/dinsic_release_1_23_1 2020-12-31 13:40:45 +00:00
Andrew Morgan 47c25048c5 Merge commit '24229fac0' into anoa/dinsic_release_1_23_1 2020-12-31 13:40:07 +00:00
Andrew Morgan 8c2f42374b Merge commit 'fedfdfd75' into anoa/dinsic_release_1_23_1 2020-12-31 12:07:35 +00:00
Andrew Morgan 468d7f6777 Merge commit '7a3adbd7a' into anoa/dinsic_release_1_23_1 2020-12-31 12:06:40 +00:00
Andrew Morgan a190ad61b3 Merge commit '2b7c18087' into anoa/dinsic_release_1_23_1 2020-12-31 11:58:26 +00:00
Andrew Morgan 6d1b93cf08 Merge commit '054a6b953' into anoa/dinsic_release_1_23_1 2020-12-31 11:58:10 +00:00
Andrew Morgan 7e1a0bf068 Merge commit 'b19b63e6b' into anoa/dinsic_release_1_23_1 2020-12-31 11:51:30 +00:00
Andrew Morgan 2af070196c Merge commit 'ec0e9c469' into dinsic 2020-12-31 11:44:27 +00:00
Andrew Morgan 9e11250574 Merge commit '9146a8a69' into dinsic 2020-12-31 11:44:21 +00:00
Andrew Morgan 7df02e4431 Merge commit '70259d8c' into dinsic 2020-12-31 11:44:13 +00:00
Andrew Morgan 8f05de1d97 Merge commit 'de5cafe98' into dinsic 2020-12-31 11:43:55 +00:00
Andrew Morgan 4c7d889be7 Merge commit '97647b33c' into dinsic 2020-12-31 11:24:03 +00:00
Andrew Morgan b30484ab34 Merge commit '3ee17585c' into dinsic 2020-12-31 11:23:56 +00:00
Andrew Morgan 247081274a Merge commit '654e239b2' into dinsic 2020-12-31 11:23:48 +00:00
Andrew Morgan 5fc0dd8126 Merge commit '74976a8e4' into dinsic 2020-12-31 11:23:24 +00:00
Andrew Morgan 63e8ab5481 Allow users to click account renewal links multiple times without hitting an 'Invalid Token' page (#74) 2020-12-30 17:43:08 +00:00
Patrick Cloke 0d86b11666 Support PyJWT v2.0.0. (#8986)
Tests were broken due to an API changing. The code used in Synapse
proper should be compatible with both versions already.
2020-12-29 18:41:36 +00:00
Mathieu Velten e6797e004f Allow per-room profile to be used for server notice user (#8799)
This applies even if the feature is disabled at the server level with `allow_per_room_profiles`.
The server notice not being a real user it doesn't have an user profile.
2020-12-14 10:31:27 +01:00
Andrew Morgan 903bb990b9 Remove the CI requirement for newsfiles (#73)
We don't use newsfiles for DINUM releases anyways, so a CI requirement for them
does not make sense.
2020-12-11 14:47:38 +00:00
Mathieu Velten 4d17afc255 Fix users info for remote users (#71) 2020-12-11 14:41:02 +00:00
Andrew Morgan 8a02d38ce2 Update mypy to 0.790 to resolve mypy CI errors (#72) 2020-12-11 12:32:49 +00:00
Andrew Morgan 0ebdde8739 Override any missing default power level keys with DINUM's defaults when creating a room (#68)
The createRoom flow in DINUM's Synapse (through the AccessRules module which has hooks for all of this) already rejects a power levels content dict if it doesn't have high enough power levels to satisfy DINUM's [requirements](https://github.com/matrix-org/synapse-dinsic/blob/ac50ed353b5fdbdf9f853be0d94b6fccaf33973e/synapse/third_party_rules/access_rules.py#L233-L252).

This PR ensures that any keys that aren't provided are replaced with the defaults, instead of just assuming the whole dict was correct (and thus those keys were set to mainline Synapse's default instead).
2020-10-29 10:48:29 +00:00
Brendan Abolivier e8dcadaccd Make sure a retention policy is a state event (#8527)
* Make sure a retention policy is a state event

* Changelog
2020-10-21 16:50:07 +01:00
Andrew Morgan 4d5ed3daf4 Merge pull request #67 from matrix-org/anoa/dinsic_release_1_21_x
Merge Synapse release v1.21.2 into 'dinsic'
2020-10-21 16:42:09 +01:00
Andrew Morgan 4288fe6618 Changelog 2020-10-21 15:46:43 +01:00
Andrew Morgan 8e7c4143b2 Fix type error 2020-10-21 15:43:15 +01:00
Andrew Morgan 91ce65f05d Merge commit '9b8a53c7b' into anoa/dinsic_release_1_21_x
* commit '9b8a53c7b':
  Additional tweaks.
  Clarify authlib changes.
  Fix typo.
  Add additional release notes.
2020-10-21 15:13:07 +01:00
Andrew Morgan cd50eba74b Merge commit '9991aaa49' into anoa/dinsic_release_1_21_x
* commit '9991aaa49':
  1.21.2
  Remove racey assertion in MultiWriterIDGenerator (#8530)
2020-10-21 15:12:57 +01:00
Andrew Morgan e80d7c3982 Merge commit '58e583eac' into anoa/dinsic_release_1_21_x
* commit '58e583eac':
  1.21.1
  Explicitly install test dependencies when building deb packages (#8523)
  Reverse proxies are not the only thing to change;be explicit w/ new endpoint
  Add deprecation warning for admin api under client api prefixes
2020-10-21 15:12:50 +01:00
Andrew Morgan e15cca700b Merge commit 'f76194a02' into anoa/dinsic_release_1_21_x
* commit 'f76194a02':
  1.21.0
  Update change log
  1.21.0rc3
  Reduce serialization errors in MultiWriterIdGen (#8456)
  Add Ubuntu 20.10 (Groovy Gorilla) to build scripts. (#8475)
  move #8444 to 'feature'
  linkify changelog
2020-10-21 15:12:45 +01:00
Andrew Morgan 56e2477218 Merge commit '6a8fd03ac' into anoa/dinsic_release_1_21_x
* commit '6a8fd03ac':
  1.21.0rc2
  1.21.0rc2
  Fix bug in remote thumbnail search (#8438)
  Fix DB query on startup for negative streams. (#8447)
  Convert additional templates to Jinja (#8444)
  Fix malformed log line in new federation "catch up" logic (#8442)
  Do not expose the experimental appservice login flow to clients. (#8440)
  update changelog
  fix a logging error in thumbnailer (#8435)
  changelog fixes
  fix version number
2020-10-21 15:12:31 +01:00
Andrew Morgan 854764073c Merge commit 'cc40a59b4' into anoa/dinsic_release_1_21_x
* commit 'cc40a59b4':
  1.21.0
  Add prometheus metrics to track federation delays (#8430)
  Make token serializing/deserializing async (#8427)
  Allow additional SSO properties to be passed to the client (#8413)
  changelog
  Add an improved "forward extremities" metric
  Rewrite BucketCollector
  Fix _exposition.py to stop stripping samples
  Drop support for ancient prometheus_client (#8426)
  Various clean ups to room stream tokens. (#8423)
  changelog
  Report state res metrics to Prometheus and log
  Move Measure calls into `resolve_events_with_store`
  Expose a `get_resource_usage` method in `Measure`
  Move `resolve_events_with_store` into StateResolutionHandler
2020-10-21 14:53:23 +01:00
Andrew Morgan e8ed9a6016 Merge commit '8238b55e0' into anoa/dinsic_release_1_21_x
* commit '8238b55e0':
  Update description of server_name config option (#8415)
  Discard an empty upload_name before persisting an uploaded file (#7905)
  Don't table scan events on worker startup (#8419)
  Mypy fixes for `synapse.handlers.federation` (#8422)
2020-10-21 14:53:16 +01:00
Andrew Morgan ab26b5894a Merge commit 'f43c66d23' into anoa/dinsic_release_1_21_x
* commit 'f43c66d23':
  Add support for running Complement against the local checkout (#8317)
  Filter out appservices from mau count (#8404)
  Only assert valid next_link params when provided (#8417)
  Add metrics to track success/otherwise of replication requests (#8406)
  Fix handling of connection timeouts in outgoing http requests (#8400)
  Changelog
  Don't check whether a 3pid is allowed to register during password reset
  Add checks for postgres sequence consistency (#8402)
  Create a mechanism for marking tests "logcontext clean" (#8399)
  Add `ui_auth_sessions_ips` table to `synapse_port_db` ignore list (#8410)
  A pair of tiny cleanups in the federation request code. (#8401)
  typo
2020-10-21 14:53:14 +01:00
Andrew Morgan 5b0b103521 Merge commit '31acc5c30' into anoa/dinsic_release_1_21_x
* commit '31acc5c30':
  Escape the error description on the sso_error template. (#8405)
  Fix occasional "Re-starting finished log context" from keyring (#8398)
  Allow existing users to login via OpenID Connect. (#8345)
  Fix schema delta for servers that have not backfilled (#8396)
  Fix MultiWriteIdGenerator's handling of restarts. (#8374)
  s/URLs/variables in changelog
  s/accidentally/incorrectly in changelog
  Update changelog wording
  Add type annotations to SimpleHttpClient (#8372)
  Add new sequences to port DB script (#8387)
  Add EventStreamPosition type (#8388)
  Mark the shadow_banned column as boolean in synapse_port_db. (#8386)
2020-10-21 14:51:58 +01:00
Andrew Morgan d70f909e6c Merge commit '920dd1083' into anoa/dinsic_release_1_21_x
* commit '920dd1083':
  1.20.1
  Mark the shadow_banned column as boolean in synapse_port_db. (#8386)
  Hotfix: disable autoescape by default when rendering Jinja2 templates (#8394)
2020-10-21 14:24:11 +01:00
Andrew Morgan 3729b15a64 Merge commit '2983049a7' into anoa/dinsic_release_1_21_x
* commit '2983049a7':
  Factor out `_send_dummy_event_for_room` (#8370)
  Improve logging of state resolution (#8371)
  Fix bug which caused failure on join with malformed membership events (#8385)
  Use `async with` for ID gens (#8383)
  Don't push if an user account has expired (#8353)
  Do not check lint/test dependencies at runtime. (#8377)
  Add note to reverse_proxy.md about disabling Apache's mod_security2 (#8375)
  Changelog
2020-10-21 14:15:38 +01:00
Andrew Morgan e529fa7574 Merge commit '4325be1a5' into anoa/dinsic_release_1_21_x
* commit '4325be1a5':
  Fix missing null character check on guest_access room state
  Fixed a bug with reactivating users with the admin API (#8362)
  Admin API for reported events (#8217)
  Fix wording of deprecation notice in changelog
  Deprecation warning for synapse admin api being accessible under /_matrix
  Create function to check for long names in devices (#8364)
  Add a comment re #1691
  Fix a bad merge from release-v1.20.0. (#8354)
  Admin API for querying rooms where a user is a member (#8306)
  Catch-up after Federation Outage (bonus): Catch-up on Synapse Startup (#8322)
  Simplify super() calls to Python 3 syntax. (#8344)
  Allow appservice users to /login (#8320)
  Update test logging to be able to accept braces (#8335)
  Move lint dependencies to extras_require (#8330)
2020-10-21 14:14:36 +01:00
Andrew Morgan 419595b1d9 Merge commit '55bb5fda3' into anoa/dinsic_release_1_21_x
* commit '55bb5fda3':
  1.20.0
  Add a note about including the changes from 1.19.3.
  Tweak wording in the changelog.
2020-10-21 14:13:10 +01:00
Andrew Morgan 3de9eb3529 Merge commit 'd5f7182ba' into anoa/dinsic_release_1_21_x
* commit 'd5f7182ba':
  1.20.0rc5
  1.19.3
  Use _check_sigs_and_hash_and_fetch to validate backfill requests (#8350)
2020-10-21 14:12:58 +01:00
Andrew Morgan 70783a389b Merge commit '43f2b67e4' into anoa/dinsic_release_1_21_x
* commit '43f2b67e4':
  Intelligently select extremities used in backfill. (#8349)
  Add flags to /versions about whether new rooms are encrypted by default. (#8343)
  Fix ratelimiting for federation `/send` requests. (#8342)
  blacklist MSC2753 sytests until it's implemented in synapse (#8285)
2020-10-20 20:02:39 +01:00
Andrew Morgan 7176832124 Merge commit '837293c31' into anoa/dinsic_release_1_21_x
* commit '837293c31':
  Remove obsolete __future__ imports (#8337)
  Use admin_patterns for all admin APIs. (#8331)
  Fix a potential bug of UnboundLocalError (#8329)
  Switch metaclass initialization to python 3-compatible syntax (#8326)
  Catch-up after Federation Outage (split, 4): catch-up loop (#8272)
  Use slots in attrs classes where possible (#8296)
  Fix typos in comments.
  Add the topic and avatar to the room details admin API (#8305)
  Improve SAML error messages (#8248)
  Add experimental support for sharding event persister. Again. (#8294)
  Make `StreamToken.room_key` be a `RoomStreamToken` instance. (#8281)
  Use TLSv1.2 for fake servers in tests (#8208)
  Add /_synapse/client to the reverse proxy docs (#8227)
  Clean up `Notifier.on_new_room_event` code path (#8288)
2020-10-20 19:51:28 +01:00
Andrew Morgan 66d34af127 Merge commit '7141057e8' into anoa/dinsic_release_1_21_x
* commit '7141057e8':
  1.20.0rc4
  Clarify changelog.
2020-10-20 19:43:07 +01:00
Andrew Morgan 696d4ff27c Merge commit '5ffd68dca' into anoa/dinsic_release_1_21_x
* commit '5ffd68dca':
  1.19.2
  Newsfile
  Don't assume that an event has an origin field
2020-10-20 19:41:55 +01:00
Andrew Morgan e13218756c Merge commit '2832ef5bb' into anoa/dinsic_release_1_21_x
* commit '2832ef5bb':
  1.20.0rc3
  Fix the exception that is raised when invalid JSON is encountered. (#8291)
  Remove shared rooms info from upgrade/workers doc as it's still experimental (#8290)
2020-10-20 19:28:12 +01:00
Andrew Morgan 8ee3f063a8 Merge commit 'a3a90ee03' into anoa/dinsic_release_1_21_x
* commit 'a3a90ee03':
  Show a confirmation page during user password reset (#8004)
  Do not error when thumbnailing invalid files (#8236)
  Remove some unused distributor signals (#8216)
  Fixup pusher pool notifications (#8287)
  Revert "Fixup pusher pool notifications"
  Fixup pusher pool notifications
2020-10-20 19:27:41 +01:00
Andrew Morgan ab583292f2 Merge commit '536f4a248' into anoa/dinsic_release_1_21_x
* commit '536f4a248':
  1.20.0rc2
2020-10-20 19:15:21 +01:00
Andrew Morgan 45079599ab Merge commit '453dfe210' into anoa/dinsic_release_1_21_x
* commit '453dfe210':
  blacklist MSC2753 sytests until it's implemented in synapse (#8285)
  Don't remember `enabled` of deleted push rules and properly return 404 for missing push rules in `.../actions` and `.../enabled` (#7796)
2020-10-20 19:15:10 +01:00
Andrew Morgan 82c379c20b Merge commit 'e45b83411' into anoa/dinsic_release_1_21_x
* commit 'e45b83411':
  Add types to async_helpers (#8260)
  Fix mypy error on develop (#8282)
  Include method in thumbnail media name (#7124)
  Add types to StreamToken and RoomStreamToken (#8279)
  Add a config option for validating 'next_link' parameters against a domain whitelist (#8275)
  Clean up types for PaginationConfig (#8250)
  Use the right constructor for log records (#8278)
  Fix `MultiWriterIdGenerator.current_position`. (#8257)
2020-10-20 19:12:51 +01:00
Andrew Morgan 8228b9e27d Merge commit 'd4daff9b5' into anoa/dinsic_release_1_21_x
* commit 'd4daff9b5':
  Fix /notifications and pushers misbehaving because of unread counts (#8280)
2020-10-20 18:29:17 +01:00
Andrew Morgan 061b9895eb Merge commit 'cca03dbec' into anoa/dinsic_release_1_21_x
* commit 'cca03dbec':
  fix typo
  s/fixes/fix/
  Directly import json from the standard library. (#8259)
  Allow for make_awaitable's return value to be re-used. (#8261)
  Rename 'populate_stats_process_rooms_2' background job back to 'populate_stats_process_rooms' again (#8243)
2020-10-20 18:29:12 +01:00
Andrew Morgan a12cea7a66 Merge commit '525efab61' into anoa/dinsic_release_1_21_x
* commit '525efab61':
  1.20.0rc1
  Systemd docs: configure workers to start after main process. (#8276)
  Only add rows to the push actions table if the event notifies or should be marked unread (#8274)
  Avoid table-scanning users at startup (#8271)
  Fix unread count failing on NULL values (#8270)
  Add more logging to debug slow startup (#8264)
  Refuse to upgrade database on worker processes (#8266)
2020-10-20 18:29:01 +01:00
Andrew Morgan 4fd0129683 Merge commit '77794ebc7' into anoa/dinsic_release_1_21_x
* commit '77794ebc7':
  Fix stack overflow when logging system encounters an error (#8268)
2020-10-20 18:10:31 +01:00
Andrew Morgan 4213fe1613 Merge commit '7586fdf1e' into anoa/dinsic_release_1_21_x
* commit '7586fdf1e':
  Bump canonicaljson to version 1.4.0 (#8262)
  Run database updates in a transaction (#8265)
  Add tests for `last_successful_stream_ordering` (#8258)
2020-10-20 18:10:26 +01:00
Andrew Morgan 15212f54f9 Merge commit '77b4711bc' into anoa/dinsic_release_1_21_x
* commit '77b4711bc':
  Add cross-signing sigs to the `keys` object (#8234)
  Unread counts fixes (#8254)
  Fix a regression from calling read_templates. (#8252)
2020-10-20 18:10:20 +01:00
Andrew Morgan 7059e87227 Merge commit '7513006b0' into anoa/dinsic_release_1_21_x
* commit '7513006b0':
  In light of #8255, use BIGINTs for destination_rooms (#8256)
2020-10-20 18:10:12 +01:00
Andrew Morgan 47d53b32e3 Merge commit '17fa4c7ca' into anoa/dinsic_release_1_21_x
* commit '17fa4c7ca':
  Catch up after Federation Outage (split, 2): Track last successful stream ordering after transmission (#8247)
  Catch-up after Federation Outage (split, 1) (#8230)
  Fix type signature in simple_select_one_onecol and friends (#8241)
  Stop sub-classing object (#8249)
2020-10-20 18:09:59 +01:00
Andrew Morgan 581445c629 Merge commit '9f8abdcc3' into anoa/dinsic_release_1_21_x
* commit '9f8abdcc3':
  Revert "Add experimental support for sharding event persister. (#8170)" (#8242)
2020-10-20 17:52:25 +01:00
Andrew Morgan 412a215f1b Merge commit 'be16ee59a' into anoa/dinsic_release_1_21_x
* commit 'be16ee59a':
  Add type hints to more handlers (#8244)
  Remove obsolete order field in `send_new_transaction` (#8245)
  Split fetching device keys and signatures into two transactions (#8233)
2020-10-20 17:52:20 +01:00
Andrew Morgan 255860b00a Merge commit '208e1d3eb' into anoa/dinsic_release_1_21_x
* commit '208e1d3eb':
  Fix typing for `@cached` wrapped functions (#8240)
  Remove useless changelog about reverting a #8239.
  Revert pinning of setuptools (#8239)
  Fix typing for SyncHandler (#8237)
  wrap `_get_e2e_device_keys_and_signatures_txn` in a non-txn method (#8231)
  Add an overload for simple_select_one_onecol_txn. (#8235)
2020-10-20 17:52:08 +01:00
Andrew Morgan 2df215d042 Merge commit '912e02491' into anoa/dinsic_release_1_21_x
* commit '912e02491':
  Convert runInteraction to async/await (#8156)
2020-10-20 17:51:58 +01:00
Andrew Morgan d7fd0deaf1 Merge commit '112266eaf' into anoa/dinsic_release_1_21_x
* commit '112266eaf':
  Add StreamStore to mypy (#8232)
  Re-implement unread counts (again) (#8059)
2020-10-20 17:51:52 +01:00
Andrew Morgan 56722c69c5 Merge commit '0d4f614fd' into anoa/dinsic_release_1_21_x
* commit '0d4f614fd':
  Refactor `_get_e2e_device_keys_for_federation_query_txn` (#8225)
  Add experimental support for sharding event persister. (#8170)
  Add /user/{user_id}/shared_rooms/ api (#7785)
  Do not try to store invalid data in the stats table (#8226)
  Convert the main methods run by the reactor to async. (#8213)
2020-10-20 17:51:35 +01:00
Andrew Morgan 2bd022e04c Merge commit 'abeab964d' into anoa/dinsic_release_1_21_x
* commit 'abeab964d':
  Make _get_e2e_device_keys_and_signatures_txn return an attrs (#8224)
  Fix errors when updating the user directory with invalid data (#8223)
  Explain better what GDPR-erased means (#8189)
  Convert additional databases to async/await part 3 (#8201)
  Convert appservice code to async/await. (#8207)
  Rename `_get_e2e_device_keys_txn` (#8222)
2020-10-20 17:42:37 +01:00
Andrew Morgan e85c6356ea Merge commit '54f8d73c0' into anoa/dinsic_release_1_21_x
* commit '54f8d73c0':
  Convert additional databases to async/await (#8199)
2020-10-20 17:42:33 +01:00
Andrew Morgan 059e0fdedf Merge commit '5bf8e5f55' into anoa/dinsic_release_1_21_x
* commit '5bf8e5f55':
  Convert the well known resolver to async (#8214)
  Convert additional databases to async/await part 2 (#8200)
  Make MultiWriterIDGenerator work for streams that use negative stream IDs (#8203)
  Do not install setuptools 50.0. (#8212)
  Move and rename `get_devices_with_keys_by_user` (#8204)
  Rename `get_e2e_device_keys` to better reflect its purpose (#8205)
  Add a comment about _LimitedHostnameResolver
2020-10-20 17:42:29 +01:00
Andrew Morgan d49dd2f643 Merge commit 'd2ac767de' into anoa/dinsic_release_1_21_x
* commit 'd2ac767de':
  Convert ReadWriteLock to async/await. (#8202)
  Fix incorrect return signature
  Fix `wait_for_stream_position` for multiple waiters. (#8196)
2020-10-20 17:42:24 +01:00
Andrew Morgan 531389972b Merge commit 'd58fda99f' into anoa/dinsic_release_1_21_x
* commit 'd58fda99f':
  Convert `event_push_actions`, `registration`, and `roommember` datastores to async (#8197)
  Only return devices with keys from `/federation/v1/user/devices/` (#8198)
2020-10-20 17:42:19 +01:00
Andrew Morgan b7672ff59e Merge commit 'aec708517' into anoa/dinsic_release_1_21_x
* commit 'aec708517':
  Convert state and stream stores and related code to async (#8194)
  Ensure that the OpenID Connect remote ID is a string. (#8190)
2020-10-20 17:42:15 +01:00
Andrew Morgan 41ac1232b5 Merge commit '5c03134d0' into anoa/dinsic_release_1_21_x
* commit '5c03134d0':
  Convert additional database code to async/await. (#8195)
  Define StateMap as immutable and add a MutableStateMap type. (#8183)
  Move and refactor LoginRestServlet helper methods (#8182)
2020-10-20 17:42:11 +01:00
Andrew Morgan ff8a9a6a28 Merge commit 'e00816ad9' into anoa/dinsic_release_1_21_x
* commit 'e00816ad9':
  Do not yield on awaitables in tests. (#8193)
2020-10-20 17:42:05 +01:00
Andrew Morgan ed944cb079 Merge commit 'b49a5b930' into anoa/dinsic_release_1_21_x
* commit 'b49a5b930':
  Convert stats and related calls to async/await (#8192)
2020-10-20 17:42:00 +01:00
Andrew Morgan 6961a007dd Merge commit 'b71d4a094' into anoa/dinsic_release_1_21_x
* commit 'b71d4a094':
  Convert simple_delete to async/await. (#8191)
2020-10-20 17:41:55 +01:00
Andrew Morgan ec50c99609 Merge commit '9b7ac03af' into anoa/dinsic_release_1_21_x
* commit '9b7ac03af':
  Convert calls of async database methods to async (#8166)
  simple_search_list_txn should return None, not 0. (#8187)
  Fix missing _add_persisted_position (#8179)
2020-10-20 17:41:11 +01:00
Andrew Morgan 118f41dba7 Merge commit '30426c706' into anoa/dinsic_release_1_21_x
* commit '30426c706':
  Convert additional database methods to async (select list, search, insert_many, delete_*) (#8168)
2020-10-20 17:33:58 +01:00
Andrew Morgan a89a160c17 Merge commit '4a739c73b' into anoa/dinsic_release_1_21_x
* commit '4a739c73b':
  Convert simple_update* and simple_select* to async (#8173)
2020-10-20 17:33:47 +01:00
Andrew Morgan df77da8b4d Merge commit 'a466b6797' into anoa/dinsic_release_1_21_x
* commit 'a466b6797':
  Reduce run-times of tests by advancing the reactor less (#7757)
  Update debian systemd service to use Type=notify (#8169)
  Remove remaining is_guest argument uses from get_room_data calls (#8181)
  Do not propagate typing notifications from shadow-banned users. (#8176)
  Remove unused parameter from, and add safeguard in, get_room_data (#8174)
  Add required Debian dependencies to allow docker builds on the arm platform (#8144)
  Allow running mypy directly. (#8175)
  Update the test federation client to handle streaming responses (#8130)
  Do not propagate profile changes of shadow-banned users into rooms. (#8157)
  Make SlavedIdTracker.advance have same interface as MultiWriterIDGenerator (#8171)
  Convert simple_select_one and simple_select_one_onecol to async (#8162)
2020-10-20 17:13:42 +01:00
Andrew Morgan 0b25363a0b Merge commit 'eadfda3eb' into anoa/dinsic_release_1_21_x
* commit 'eadfda3eb':
  1.19.1
2020-10-20 16:46:43 +01:00
Andrew Morgan b7bb088b84 Merge commit '56efa9ec7' into anoa/dinsic_release_1_21_x
* commit '56efa9ec7': (22 commits)
  Fix rate limiting unit tests. (#8167)
  Add functions to `MultiWriterIdGen` used by events stream (#8164)
  Do not allow send_nonmember_event to be called with shadow-banned users. (#8158)
  Changelog fixes
  Make StreamIdGen `get_next` and `get_next_mult` async  (#8161)
  Wording fixes to 'name' user admin api filter (#8163)
  Fix missing double-backtick in RST document
  Search in columns 'name' and 'displayname' in the admin users endpoint (#7377)
  Add type hints for state. (#8140)
  Stop shadow-banned users from sending non-member events. (#8142)
  Allow capping a room's retention policy (#8104)
  Add healthcheck for default localhost 8008 port on /health endpoint. (#8147)
  Fix flaky shadow-ban tests. (#8152)
  Don't fail /submit_token requests on incorrect session ID if request_token_inhibit_3pid_errors is turned on (#7991)
  Do not apply ratelimiting on joins to appservices (#8139)
  Micro-optimisations to get_auth_chain_ids (#8132)
  Allow denying or shadow banning registrations via the spam checker (#8034)
  Stop shadow-banned users from sending invites. (#8095)
  Be more tolerant of membership events in unknown rooms (#8110)
  Improve the error code when trying to register using a name reserved for guests. (#8135)
  ...
2020-10-20 16:45:58 +01:00
Andrew Morgan 385ab7a5c8 Merge commit 'b79d69796' into anoa/dinsic_release_1_21_x
* commit 'b79d69796':
  1.19.1rc1
  Fix join ratelimiter breaking profile updates and idempotency (#8153)
2020-10-20 16:21:14 +01:00
Andrew Morgan 520810ab25 Merge commit '2df82ae45' into anoa/dinsic_release_1_21_x
* commit '2df82ae45':
  Do not apply ratelimiting on joins to appservices (#8139)
2020-10-20 15:11:13 +01:00
Andrew Morgan 6b4886ec6d Merge commit '731dfff34' into anoa/dinsic_release_1_21_x
* commit '731dfff34':
  Ensure a group ID is valid before trying to get rooms for it. (#8129)
2020-10-20 15:11:08 +01:00
Andrew Morgan 0c1ddde918 Merge commit '76c43f086' into anoa/dinsic_release_1_21_x
* commit '76c43f086':
  Do not assume calls to runInteraction return Deferreds. (#8133)
2020-10-20 15:11:02 +01:00
Andrew Morgan ac743d67f2 Merge commit '12aebdfa5' into anoa/dinsic_release_1_21_x
* commit '12aebdfa5':
  Close the database connection we create during startup (#8131)
2020-10-20 15:10:57 +01:00
Andrew Morgan 687d30b2ed Merge commit 'c9c544cda' into anoa/dinsic_release_1_21_x
* commit 'c9c544cda':
  Remove `ChainedIdGenerator`. (#8123)
  Switch the JSON byte producer from a pull to a push producer. (#8116)
  Updated docs: Added note about missing 308 redirect support. (#8120)
  Be stricter about JSON that is accepted by Synapse (#8106)
  Convert runWithConnection to async. (#8121)
  Remove the unused inlineCallbacks code-paths in the caching code (#8119)
  Separate `get_current_token` into two. (#8113)
  Convert events worker database to async/await. (#8071)
  Add a link to the matrix-synapse-rest-password-provider. (#8111)
2020-10-19 19:12:39 +01:00
Andrew Morgan 1e9ec2afff Merge commit '3c01724b3' into anoa/dinsic_release_1_21_x
* commit '3c01724b3':
  Fix the return type of send_nonmember_events. (#8112)
  Remove : from allowed client_secret chars (#8101)
  Rename changelog from bugfix to misc.
  Iteratively encode JSON responses to avoid blocking the reactor. (#8013)
  Return the previous stream token if a non-member event is a duplicate. (#8093)
2020-10-19 18:35:07 +01:00
Andrew Morgan bbc77d31c7 Merge commit '8b6c176ae' into anoa/dinsic_release_1_21_x
* commit '8b6c176ae':
  Add resources.consent conditional dependency back (#8107)
2020-10-19 18:34:59 +01:00
Andrew Morgan 25b077d747 Merge commit '050e20e7c' into anoa/dinsic_release_1_21_x
* commit '050e20e7c':
  Convert some of the general database methods to async (#8100)
2020-10-19 18:34:31 +01:00
Andrew Morgan 29506f5c50 Merge commit 'e04e465b4' into anoa/dinsic_release_1_21_x
* commit 'e04e465b4':
  Use the default templates when a custom template file cannot be found (#8037)
  Changelog changes
  Convert stream database to async/await. (#8074)
  Add a shadow-banned flag to users. (#8092)
  Convert pusher databases to async/await. (#8075)
  Convert receipts and events databases to async/await. (#8076)
2020-10-19 18:27:56 +01:00
Andrew Morgan 51fe8b4a04 Merge commit 'ea4e4d2f0' into anoa/dinsic_release_1_21_x
* commit 'ea4e4d2f0':
  1.19.0
2020-10-19 18:25:09 +01:00
Andrew Morgan 8766a077d1 Merge commit 'dc22090a6' into anoa/dinsic_release_1_21_x
* commit 'dc22090a6':
  Add type hints to synapse.handlers.room (#8090)
  Remove some unused database functions. (#8085)
  Convert misc database code to async (#8087)
  Remove a space at the start of a changelog entry.
2020-10-19 18:25:03 +01:00
Andrew Morgan 1b86e6270f Merge commit 'bfd79c298' into anoa/dinsic_release_1_21_x
* commit 'bfd79c298':
  More changelog tweaks
  More changelog tweaks
  Remove unwanted changelog line
2020-10-19 18:24:58 +01:00
Andrew Morgan 7dbde03336 Merge commit '091ca3910' into anoa/dinsic_release_1_21_x
* commit '091ca3910':
  1.19.0rc1
2020-10-19 18:24:51 +01:00
Andrew Morgan 48a182c010 Merge commit '53834bb9c' into anoa/dinsic_release_1_21_x
* commit '53834bb9c':
  Run `remove_push_actions_from_staging` in foreground (#8081)
2020-10-19 18:24:46 +01:00
Andrew Morgan 1b99b00740 Merge commit 'ff0e89465' into anoa/dinsic_release_1_21_x
* commit 'ff0e89465':
  Drop federation transmission queues during a significant remote outage. (#7864)
2020-10-19 18:24:42 +01:00
Andrew Morgan 464db5f27d Merge commit 'dd8f28bd3' into anoa/dinsic_release_1_21_x
* commit 'dd8f28bd3':
  Fix unawaited coroutine error in tests. (#8072)
2020-10-19 18:24:39 +01:00
Andrew Morgan 1ab32bd9a7 Merge commit 'fbe930dad' into anoa/dinsic_release_1_21_x
* commit 'fbe930dad':
  Convert the roommember database to async/await. (#8070)
2020-10-19 18:24:35 +01:00
Andrew Morgan 78bcfa71db Merge commit '5ecc8b582' into anoa/dinsic_release_1_21_x
* commit '5ecc8b582':
  Convert devices database to async/await. (#8069)
2020-10-19 18:24:30 +01:00
Andrew Morgan 20bfb5390c Merge commit '5dd73d029' into anoa/dinsic_release_1_21_x
* commit '5dd73d029':
  Add type hints to handlers.message and events.builder (#8067)
2020-10-19 18:24:25 +01:00
Andrew Morgan 33d971bd03 Merge commit 'd68e10f30' into anoa/dinsic_release_1_21_x
* commit 'd68e10f30':
  Convert account data, device inbox, and censor events databases to async/await (#8063)
2020-10-19 18:24:11 +01:00
Andrew Morgan d872d53c4d Merge commit 'a3a59bab7' into anoa/dinsic_release_1_21_x
* commit 'a3a59bab7':
  Convert appservice, group server, profile and more databases to async (#8066)
2020-10-19 18:23:58 +01:00
Andrew Morgan db233aaa64 Merge commit '9d1e4942a' into anoa/dinsic_release_1_21_x
* commit '9d1e4942a':
  Fix typing for notifier (#8064)
  Add comment explaining cast
  Handle optional dependencies for Oidc and Saml
  Newsfile
  Change HomeServer definition to work with typing.
2020-10-19 18:23:05 +01:00
Andrew Morgan 13c1c20972 Merge commit '04faa0bfa' into anoa/dinsic_release_1_21_x
* commit '04faa0bfa':
  Convert tags and metrics databases to async/await (#8062)
2020-10-19 18:16:34 +01:00
Andrew Morgan 8857135bc6 Merge commit 'a0acdfa9e' into anoa/dinsic_release_1_21_x
* commit 'a0acdfa9e':
  Converts event_federation and registration databases to async/await (#8061)
2020-10-19 18:14:26 +01:00
Andrew Morgan 04f61d91c4 Merge commit '61d8ff0d4' into anoa/dinsic_release_1_21_x
* commit '61d8ff0d4':
  Update changelog.d/8051.misc
  Newsfile
  Move setting of Filter into code.
2020-10-19 17:42:51 +01:00
Andrew Morgan 23f262c1d6 Merge commit 'a1e9bb9ea' into anoa/dinsic_release_1_21_x
* commit 'a1e9bb9ea':
  Add typing info to Notifier (#8058)
2020-10-19 17:42:46 +01:00
Andrew Morgan ff0170ee30 Merge commit 'a0f574f3c' into anoa/dinsic_release_1_21_x
* commit 'a0f574f3c':
  Reduce INFO logging (#8050)
2020-10-19 17:09:11 +01:00
Andrew Morgan 76009833c9 update sample config 2020-10-19 17:09:01 +01:00
Andrew Morgan 70c6f5065a Merge commit 'db131b6b2' into anoa/dinsic_release_1_21_x
* commit 'db131b6b2':
  Change the default log config to reduce disk I/O and storage (#8040)
  Implement login blocking based on SAML attributes (#8052)
  Add an assertion on prev_events in create_new_client_event (#8041)
  Typo
  Lint
  why mypy why
  Lint
  Incorporate review
  Incorporate review
  Fix PUT /pushrules to use the right rule IDs
  Back out the database hack and replace it with a temporary config setting
  Fix cache name
  Fix cache invalidation calls
  Lint
  Changelog
  Implement new experimental push rules with a database hack to enable them
2020-10-19 17:08:43 +01:00
Andrew Morgan 76a6aa1227 Merge commit '39c3f6875' into anoa/dinsic_release_1_21_x
* commit '39c3f6875':
  Stop uploading -py3 docker images (#8056)
2020-10-19 17:07:00 +01:00
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
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
Andrew Morgan 24652fbdf1 Changelog 2020-08-03 18:44:01 -07:00
Andrew Morgan 5c4aa9762d Update isort to v3.8.3 2020-08-03 18:31:09 -07:00
Andrew Morgan 2ba03d740d dinsic lint
linting after the v1.18.0 mainline merge
2020-08-03 17:57:15 -07:00
Andrew Morgan 4908c95464 Merge commit '320ef9885' into anoa/dinsic_release_1_18_x
* commit '320ef9885':
  Fix formatting of changelog and upgrade notes
  Add deprecation warnings
2020-08-03 17:52:14 -07:00
Andrew Morgan 0b2c404e1a Merge commit 'a9631b7b4' into anoa/dinsic_release_1_18_x
* commit 'a9631b7b4':
  1.18.0
  Update worker docs with recent enhancements  (#7969)
2020-08-03 17:52:10 -07:00
Andrew Morgan b7c5713ce0 Merge commit '7000a215e' into anoa/dinsic_release_1_18_x
* commit '7000a215e':
  1.18.0rc2
  Typing worker needs to handle stream update requests (#7967)
  Handle replication commands synchronously where possible (#7876)
  update changelog
2020-08-03 17:52:05 -07:00
Andrew Morgan 7f2e76bef9 Merge commit 'f88c48f3b' into anoa/dinsic_release_1_18_x
* 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)
2020-08-03 17:51:46 -07:00
Andrew Morgan c7fb21fe44 Merge commit '4876af06d' into anoa/dinsic_release_1_18_x
* commit '4876af06d':
  Abort federation requests if the client disconnects early (#7930)
2020-08-03 17:39:44 -07:00
Andrew Morgan a684f57379 Merge commit 'ff22672fd' into anoa/dinsic_release_1_18_x
* commit 'ff22672fd':
  Reorder database docs to promote postgresql. (#7933)
2020-08-03 17:39:39 -07:00
Andrew Morgan 9413e26c18 Merge commit '68cd93582' into anoa/dinsic_release_1_18_x
* commit '68cd93582':
  Convert the federation agent and related code to async/await. (#7874)
2020-08-03 17:39:35 -07:00
Andrew Morgan e6f84dbf1c Merge commit '13d77464c' into anoa/dinsic_release_1_18_x
* commit '13d77464c':
  Follow-up to admin API to re-activate accounts (#7908)
2020-08-03 17:39:31 -07:00
Andrew Morgan 3b44a55096 Merge commit 'cc9bb3dc3' into anoa/dinsic_release_1_18_x
* commit 'cc9bb3dc3':
  Convert the message handler to async/await. (#7884)
2020-08-03 17:39:27 -07:00
Andrew Morgan b79c36208f Merge commit 'a4cf94a3c' into anoa/dinsic_release_1_18_x
* commit 'a4cf94a3c':
  Update the dates for ACME v1 EOL
2020-08-03 17:39:21 -07:00
Andrew Morgan 38c605a2d3 Merge commit '923c99502' into anoa/dinsic_release_1_18_x
* commit '923c99502':
  Skip serializing /sync response if client has disconnected (#7927)
2020-08-03 17:39:15 -07:00
Andrew Morgan a1893371e7 Merge commit 'b74919c72' into anoa/dinsic_release_1_18_x
* commit 'b74919c72':
  Add debugging to sync response generation (#7929)
2020-08-03 17:39:10 -07:00
Andrew Morgan e10d550d56 Merge commit '931b02684' into anoa/dinsic_release_1_18_x
* commit '931b02684':
  Remove an unused prometheus metric (#7878)
2020-08-03 17:39:03 -07:00
Andrew Morgan 195940088e Merge commit '05060e022' into anoa/dinsic_release_1_18_x
* commit '05060e022':
  Track command processing as a background process (#7879)
2020-08-03 17:38:57 -07:00
Andrew Morgan 71b6f38f03 Merge commit '15997618e' into anoa/dinsic_release_1_18_x
* commit '15997618e':
  Clean up PreserveLoggingContext (#7877)
  fix an incorrect comment
2020-08-03 17:38:53 -07:00
Andrew Morgan a567e763ea Merge commit 'de119063f' into anoa/dinsic_release_1_18_x
* 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)
  ...
2020-08-03 17:38:45 -07:00
Andrew Morgan d9e25be896 Merge commit 'a973bcb8a' into anoa/dinsic_release_1_18_x
* 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)
2020-08-03 17:31:36 -07:00
Andrew Morgan dd659047f5 Merge commit '8d0097bef' into anoa/dinsic_release_1_18_x
* commit '8d0097bef':
  Fix bug in per-room message retention policies. (#7850)
2020-08-03 17:31:29 -07:00
Andrew Morgan fd40a70ba8 Merge commit '85223106f' into anoa/dinsic_release_1_18_x
* commit '85223106f':
  Allow email subjects to be customised through Synapse's configuration (#7846)
2020-08-03 17:31:24 -07:00
Andrew Morgan 16a44cff1d Merge commit '491f0dab1' into anoa/dinsic_release_1_18_x
* commit '491f0dab1':
  Add delete room admin endpoint (#7613)
2020-08-03 17:31:18 -07:00
Andrew Morgan 61ac6e22b9 Merge commit '77d2c0541' into anoa/dinsic_release_1_18_x
* commit '77d2c0541':
  Add the option to validate the `iss` and `aud` claims for JWT logins. (#7827)
2020-08-03 17:31:14 -07:00
Andrew Morgan d249d35414 Merge commit '4db150951' into anoa/dinsic_release_1_18_x
* commit '4db150951':
  Improve the type hints of synapse.api.errors. (#7820)
2020-08-03 17:31:10 -07:00
Andrew Morgan 1a902255b4 Merge commit '93c8b077e' into anoa/dinsic_release_1_18_x
* commit '93c8b077e':
  Clearly state built-in ACME no longer works (#7824)
2020-08-03 17:31:02 -07:00
Andrew Morgan aed7f97a5c Merge commit 'f886a6991' into anoa/dinsic_release_1_18_x
* commit 'f886a6991':
  Correctly pass app_name to all email templates. (#7829)
2020-08-03 17:30:58 -07:00
Andrew Morgan 2bdf70f95c Merge commit '457096e6d' into anoa/dinsic_release_1_18_x
* commit '457096e6d':
  Support handling registration requests across multiple client readers. (#7830)
2020-08-03 17:30:54 -07:00
Andrew Morgan e57ee9d0d2 Merge commit '504c8f348' into anoa/dinsic_release_1_18_x
* commit '504c8f348':
  Fix handling of "off" in encryption_enabled_by_default_for_room_type (#7822)
  Update grafana dashboard
2020-08-03 17:30:49 -07:00
Andrew Morgan 196fdb6154 Merge commit '59e64b6d5' into anoa/dinsic_release_1_18_x
* commit '59e64b6d5':
2020-08-03 17:30:43 -07:00
Andrew Morgan 7828cd3276 Merge commit '29df3d0e9' into anoa/dinsic_release_1_18_x
* commit '29df3d0e9':
  1.17.0
2020-08-03 17:29:42 -07:00
Andrew Morgan 17cbac54f4 Merge commit '66a4af8d9' into anoa/dinsic_release_1_18_x
* commit '66a4af8d9':
  Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)
2020-08-03 17:29:38 -07:00
Andrew Morgan 4d88e6d84b Merge commit 'd9e47af61' into anoa/dinsic_release_1_18_x
* commit 'd9e47af61':
  Add types to the server code and remove unused parameter (#7813)
2020-08-03 17:29:34 -07:00
Andrew Morgan cf30af504d Merge commit '1bca21e1d' into anoa/dinsic_release_1_18_x
* commit '1bca21e1d':
  Include room states on invite events sent to ASes (#6455)
2020-08-03 17:29:28 -07:00
Andrew Morgan ab98006170 Merge commit '6cef918a4' into anoa/dinsic_release_1_18_x
* commit '6cef918a4':
2020-08-03 17:29:16 -07:00
Andrew Morgan cc8720e4af Merge commit '8ccb7f08d' into anoa/dinsic_release_1_18_x
* commit '8ccb7f08d':
  update changelog
2020-08-03 17:29:09 -07:00
Andrew Morgan bf6cf4b651 Merge commit 'f299441cc' into anoa/dinsic_release_1_18_x
* commit 'f299441cc':
  Add ability to shard the federation sender (#7798)
2020-08-03 17:28:09 -07:00
Andrew Morgan 169bbda1a5 Merge commit 'f1245dc3c' into anoa/dinsic_release_1_18_x
* commit 'f1245dc3c':
  Fix resync remote devices on receive PDU in worker mode. (#7815)
2020-08-03 17:28:03 -07:00
Andrew Morgan e8cc7b7f9c Merge commit 'b1beb3ff5' into anoa/dinsic_release_1_18_x
* commit 'b1beb3ff5':
  fix migration, again
  fix changelog
2020-08-03 17:27:51 -07:00
Andrew Morgan 80506e8081 Merge commit 'e29c44340' into anoa/dinsic_release_1_18_x
* commit 'e29c44340':
  Fix recursion error when fetching auth chain over federation (#7817)
2020-08-03 17:23:16 -07:00
Andrew Morgan c89094e11f Merge commit 'c9f7c683a' into anoa/dinsic_release_1_18_x
* commit 'c9f7c683a':
  1.16.1
  Drop incorrectly-added table `local_rejections_stream`. (#7816)
2020-08-03 17:23:13 -07:00
Andrew Morgan 530c8a5cda Merge commit '43726783e' into dinsic
* 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)
  ...
2020-08-03 17:19:26 -07:00
Andrew Morgan 229d9e57d1 Merge commit '98894341e' into dinsic
* commit '98894341e':
  1.16.0
2020-08-03 17:08:59 -07:00
Andrew Morgan 60a96e4232 Merge commit '5cdca53aa' into dinsic
* 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
2020-08-03 17:08:31 -07:00
Andrew Morgan 678f9fb88e Merge commit 'e8c36e527' into dinsic
* commit 'e8c36e527':
  1.15.2
  Correctly handle outliers as prev events over federation
  Ensure that HTML pages served from Synapse include headers to avoid embedding.
2020-08-03 16:35:24 -07:00
Andrew Morgan 87f941c3fd Merge commit 'dc80a0762' into dinsic
* 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)
2020-08-03 16:29:02 -07:00
Andrew Morgan 6ff1a109ef Merge commit '1b1489ff1' into dinsic
* commit '1b1489ff1':
  Fixed typo by adding a 'g' to PostgreSQL (#7724)
  add a comment
2020-08-03 16:24:00 -07:00
Andrew Morgan a97044a96f Merge commit 'e35d44c01' into dinsic
* commit 'e35d44c01':
2020-08-03 16:23:55 -07:00
Andrew Morgan c9239b4af4 Merge commit '363082561' into dinsic
* commit '363082561':
  Convert the typing handler to async/await. (#7679)
2020-08-03 16:23:49 -07:00
Andrew Morgan 545423f064 Merge commit '96bc110a6' into dinsic
* commit '96bc110a6':
  Require parameterized package version to be at least 0.7.0. (#7680)
2020-08-03 16:23:45 -07:00
Andrew Morgan 5662b85fc1 Merge commit '5a5cf6460' into dinsic
* commit '5a5cf6460':
  Fix unread counts in sync
2020-08-03 16:23:41 -07:00
Andrew Morgan d9a91426ba Merge commit '6418b0379' into dinsic
* commit '6418b0379':
  Ignore the UI Auth sessions when porting from sqlite to postgresql (#7711)
2020-08-03 16:23:38 -07:00
Andrew Morgan 5cf0efa05d Merge commit 'e07a8caf5' into dinsic
* commit 'e07a8caf5':
  Add support for using rust-python-jaeger-reporter (#7697)
2020-08-03 16:23:04 -07:00
Andrew Morgan 6553158b20 Merge commit 'b44bdd7f7' into dinsic
* commit 'b44bdd7f7':
  Support running multiple media repos. (#7706)
2020-08-03 16:22:58 -07:00
Andrew Morgan 3261eb71a6 Merge commit '434716e1d' into dinsic
* commit '434716e1d':
  Fetch from the r0 media path instead of the unspecced v1. (#7714)
2020-08-03 16:22:52 -07:00
Andrew Morgan 09ddede03d Merge commit '890c0c041' into dinsic
* commit '890c0c041':
  Update postgres in the Docker compose example to 12-alpine. (#7696)
2020-08-03 16:22:47 -07:00
Andrew Morgan e64449b7be Merge commit '46613aaf7' into dinsic
* 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
  ...
2020-08-03 16:22:42 -07:00
Andrew Morgan 100a7ea06e Merge commit 'e452973fd' into dinsic
* commit 'e452973fd':
  fix broken link in sample config (#7712)
2020-08-03 16:22:38 -07:00
Andrew Morgan c6011c3ce8 Merge commit 'f6f7511a4' into dinsic
* commit 'f6f7511a4':
  Refactor getting replication updates from database. (#7636)
2020-08-03 16:22:34 -07:00
Andrew Morgan 5c4e0e62bc Merge commit '231252516' into dinsic
* commit '231252516':
  Fix "argument of type 'ObservableDeferred' is not iterable" error (#7708)
2020-08-03 16:22:25 -07:00
Andrew Morgan 3017e1d21b Merge commit '5c5516f80' into dinsic
* commit '5c5516f80':
  Add instructions for authing with Keycloak via OpenID (#7659)
2020-08-03 16:22:18 -07:00
Andrew Morgan ca1ffa9e3d Merge commit 'ac51bd581' into dinsic
* commit 'ac51bd581':
  Include a user agent in federation requests. (#7677)
2020-08-03 16:22:05 -07:00
Andrew Morgan 48e7f210c6 Merge commit 'a3f11567d' into dinsic
* commit 'a3f11567d':
  Replace all remaining six usage with native Python 3 equivalents (#7704)
2020-08-03 16:15:34 -07:00
Andrew Morgan b98f60df3a Merge commit '98c4e35e3' into dinsic
* commit '98c4e35e3':
  Convert the device message and pagination handlers to async/await. (#7678)
2020-08-03 16:06:45 -07:00
Andrew Morgan 70032b3ddc Merge commit '03619324f' into dinsic
* 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)
2020-08-03 16:06:22 -07:00
Andrew Morgan 21821c076a Add option to autobind user's email on registration (#51)
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.
2020-07-02 11:01:02 +01:00
Andrew Morgan 4200f54ca7 Merge pull request #50 from matrix-org/dinsic-release-v1.15.x
Merge mainline release v1.15.1 into dinsic
2020-06-24 15:43:15 +01:00
Andrew Morgan b21331359b Changelog 2020-06-24 13:13:59 +01:00
Andrew Morgan a7d49db74f Merge branch 'release-v1.15.0' of github.com:matrix-org/synapse into 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)
  ...
2020-06-24 12:07:41 +01:00
Andrew Morgan 7da71b701e Prevent M_USER_IN_USE from being raised by registration methods until after 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`
2020-06-22 12:47:09 +01:00
Andrew Morgan 53949a908f Add a bulk user info endpoint and deprecate the old one (#46)
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.
2020-06-19 16:17:13 +01:00
Andrew Morgan 6708163271 Performance improvements to marking expired users as inactive (#47)
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.
2020-06-19 16:14:37 +01:00
Andrew Morgan f975330925 Merge pull request #45 from matrix-org/dinsic-release-v1.14.x
Merge mainline release v1.14.0 into dinsic
2020-06-17 11:55:03 +01:00
Andrew Morgan 2d7e6d4d60 Add changelog 2020-06-10 17:40:28 +01:00
Andrew Morgan cde3bda815 Merge branch 'release-v1.14.0' of github.com:matrix-org/synapse into 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)
  ...
2020-06-10 17:26:48 +01:00
Andrew Morgan e8a7a853f8 Merge branch 'release-v1.13.0' of github.com:matrix-org/synapse into 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
  ...
2020-06-10 16:58:10 +01:00
Andrew Morgan 0aa9449cd4 Merge pull request #39 from matrix-org/dinsic-release-v1.12.x
Merge Synapse release v1.12.0 into 'dinsic'

Accompanying Sytest PR: https://github.com/matrix-org/sytest/issues/843
2020-05-28 15:12:35 +01:00
Andrew Morgan f63db4f4fd Move sql schema delta files to their new location 2020-05-28 13:56:28 +01:00
Andrew Morgan b0dfadc2b0 Blacklist tests/60app-services/03passive.pl sytests 2020-05-28 13:56:28 +01:00
Andrew Morgan 68f46e07f2 Fix sytest CI
* Switch sytest-synapse to sytest-dinsic
* Be sure to invalidate our caches properly!
* Remove duplicate encryption state key definition
* Remove old config option name in comment
* Make dinsic the default in merge_base_branch
2020-05-28 13:56:07 +01:00
Andrew Morgan 6faa6521cb Add ProfileStore to synapse_port_db as it has a dinsic background update 2020-05-28 13:54:15 +01:00
Patrick Cloke 1882ffce79 1.12.4 2020-05-28 13:54:15 +01:00
Richard van der Hoff 6247ae0b38 formatting for the changelog 2020-05-28 13:54:15 +01:00
Richard van der Hoff 28207f79eb 1.12.4rc1 2020-05-28 13:54:15 +01:00
Richard van der Hoff 2141270621 1.12.4rc1 2020-05-28 13:54:15 +01:00
Patrick Cloke 8f259e883b Do not treat display names as globs for push rules. (#7271) 2020-05-28 13:54:15 +01:00
Andrew Morgan 367e95efc6 Query missing cross-signing keys on local sig upload (#7289) 2020-05-28 13:54:15 +01:00
Richard van der Hoff 455651d1cd Fix changelog file
I updated the PR and forgot to update the changelog.
2020-05-28 13:54:15 +01:00
Richard van der Hoff a84c29c54e Support GET account_data requests on a worker (#7311) 2020-05-28 13:54:10 +01:00
Richard van der Hoff 0956461b2c Revert "Query missing cross-signing keys on local sig upload"
This was incorrectly merged to the release branch before it was ready.

This reverts commit 72fe2affb6.
2020-05-28 13:53:34 +01:00
David Baker 51899b52a7 Always send the user updates to their own device list (#7160) 2020-05-28 13:53:34 +01:00
Andrew Morgan fc443e82a6 Query missing cross-signing keys on local sig upload
Add changelog

Save retrieved keys to the db

lint

Fix and de-brittle remote result dict processing

Use query_user_devices instead, assume only master, self_signing key types

Make changelog more useful

Remove very specific exception handling

Wrap get_verify_key_from_cross_signing_key in a try/except

Note that _get_e2e_cross_signing_verify_key can raise a SynapseError

lint

Add comment explaining why this is useful

Only fetch master and self_signing key types

Fix log statements, docstrings

Remove extraneous items from remote query try/except

lint

Factor key retrieval out into a separate function

Send device updates, modeled after SigningKeyEduUpdater._handle_signing_key_updates

Update method docstring
2020-05-28 13:53:34 +01:00
Andrew Morgan a6b9338ef9 Only register devices edu handler on the master process (#7255) 2020-05-28 13:53:34 +01:00
Richard van der Hoff e767ac5120 tweak changelog 2020-05-28 13:53:34 +01:00
Richard van der Hoff fc7f98d5c0 1.12.3 2020-05-28 13:53:34 +01:00
Richard van der Hoff bc465a0512 Fix the debian build in a better way. (#7212) 2020-05-28 13:53:34 +01:00
Andrew Morgan 18d5c59ac6 Fix changelog wording 2020-05-28 13:53:34 +01:00
Andrew Morgan 275df82c01 1.12.2 2020-05-28 13:53:34 +01:00
Andrew Morgan 387fb06ee7 Pin Pillow>=4.3.0,<7.1.0 to fix dep issue 2020-05-28 13:53:34 +01:00
Andrew Morgan 67fd06d6d6 1.12.1 2020-05-28 13:53:34 +01:00
Andrew Morgan ad32fad327 Note where bugs were introduced 2020-05-28 13:53:34 +01:00
Andrew Morgan 95314169e0 1.12.1rc1 2020-05-28 13:53:34 +01:00
Erik Johnston 37c9a9455f Newsfile 2020-05-28 13:53:34 +01:00
Andrew Morgan da5fe2ae0e Rewrite changelog 2020-05-28 13:53:34 +01:00
Andrew Morgan c64c6f4ed9 Add changelog 2020-05-28 13:53:34 +01:00
David Vo 3b68b16584 Only import sqlite3 when type checking
Fixes: #7127
Signed-off-by: David Vo <david@vovo.id.au>
2020-05-28 13:53:34 +01:00
Andrew Morgan 72c9302712 Fix another instance 2020-05-28 13:53:34 +01:00
Andrew Morgan 8777a08fca Only setdefault for signatures if device has key_json 2020-05-28 13:53:34 +01:00
Erik Johnston 9ed3d439df Fix starting workers when federation sending not split out. 2020-05-28 13:53:34 +01:00
Richard van der Hoff 1dd8f750a4 matrix.org was fine 2020-05-28 13:53:34 +01:00
Neil Johnson eb0a4b99ab Update CHANGES.md 2020-05-28 13:53:34 +01:00
Richard van der Hoff 1cd5683efc changelog typos 2020-05-28 13:53:34 +01:00
Richard van der Hoff e62a71c0e0 1.12.0 changelog 2020-05-28 13:53:34 +01:00
Andrew Morgan 49da3be374 Update buildkite to match mainline 2020-05-14 13:53:02 +01:00
Andrew Morgan 04f7aa5ea2 Add docker-compose files required by pipeline 2020-05-14 13:31:12 +01:00
Andrew Morgan c0faaa86e1 Bump mypy buildkite pipeline test to python3.7 to match mainline 2020-05-14 13:24:12 +01:00
Andrew Morgan 950c449cb4 Config linting 2020-05-14 13:05:46 +01:00
Andrew Morgan 75eb4c8d56 Fix versions in flake8 check-manifest commands 2020-05-14 13:00:57 +01:00
Andrew Morgan d188a66453 Remove extraneous file from merge 2020-05-14 12:59:25 +01:00
Andrew Morgan 70c494f2ad Pin the version of check_manifest to v0.41 until we merge the fix from v1.13.0 2020-05-14 12:17:42 +01:00
Andrew Morgan ab3130ecaf Add changelog 2020-05-14 12:06:59 +01:00
Andrew Morgan 627a34ad33 Pin flake8 to 3.7.9 until the v1.13.0 merge 2020-05-14 12:05:36 +01:00
Andrew Morgan 3fb2ea9932 apply linting 2020-05-14 11:51:16 +01:00
Andrew Morgan aadb7a1770 Temporarily add m.lazy_load_members to unstable_features 2020-05-04 13:51:59 +01:00
Andrew Morgan 0676d8a0b1 Add caches for get_profile_{displayname,avatar_url} 2020-05-01 11:43:19 +01:00
Andrew Morgan 2fae76c7b1 Disable _mark_expired_users_as_inactive bg job when account validity disabled 2020-04-30 18:16:45 +01:00
Andrew Morgan 677e0c721c Ensure non-federated rooms are not shown for POST /publicRooms 2020-04-29 15:53:22 +01:00
Andrew Morgan 68b310e7d0 Disable m.id_access_token, m.require_identity_server, m.separate_add_and_bind, org.matrix.e2e_cross_signing unstable_features 2020-04-28 11:53:21 +01:00
Andrew Morgan 5fc651982d Simplify auto-bind email to IS hack 2020-04-24 13:49:41 +01:00
Andrew Morgan 1e94c2be0a Remove protocol scheme from email delegate
This is an update to the commit ef8e78c1e6
2020-04-24 12:13:36 +01:00
Andrew Morgan cfcc4713ec Remove bind_email param from dinsic-specific code 2020-04-24 11:53:21 +01:00
Andrew Morgan ef8e78c1e6 HACK: Bind email to identity server when using it for 3pid delegation 2020-04-24 11:16:05 +01:00
Andrew Morgan 00831b2323 Fix some broken references 2020-04-24 10:24:10 +01:00
Andrew Morgan d77c31579a Merge branch 'dinsic-release-v1.12.x' of github.com:matrix-org/synapse-dinsic into dinsic-release-v1.12.x
* 'dinsic-release-v1.12.x' of github.com:matrix-org/synapse-dinsic:
2020-04-24 10:20:03 +01:00
Andrew Morgan 7a8324f3e5 Fix incorrect call to _map_email_to_display_name 2020-04-24 10:19:51 +01:00
Andrew Morgan c83d5ae078 Merge branch 'dinsic-release-v1.12.x' of github.com:matrix-org/synapse-dinsic into dinsic-release-v1.12.x
* 'dinsic-release-v1.12.x' of github.com:matrix-org/synapse-dinsic:
  Fix and refactor rewritten IS url feature. Add sample config docs (#40)
2020-04-23 17:17:39 +01:00
Andrew Morgan 1ccd3d0a6c Merge branch 'dinsic-release-v1.12.x' of github.com:matrix-org/synapse-dinsic into dinsic-release-v1.12.x
* 'dinsic-release-v1.12.x' of github.com:matrix-org/synapse-dinsic:
  Fix and refactor rewritten IS url feature. Add sample config docs (#40)
2020-04-23 17:16:49 +01:00
Andrew Morgan 6ab8d20479 Fix missing shadow 3pid function
I think this is where the code removed in 67c6de2caa
was supposed to go.
2020-04-23 17:15:03 +01:00
Andrew Morgan e66bbf7a9d Fix and refactor rewritten IS url feature. Add sample config docs (#40) 2020-04-22 14:23:10 +01:00
Andrew Morgan 67c6de2caa Remove unnecessary shadow server code 2020-04-21 18:58:10 +01:00
Andrew Morgan 99eb246b8a Consolidate id_server URL translation 2020-04-20 19:13:11 +01:00
Andrew Morgan 791b0e584e Don't verify signatures using re-written id_server url 2020-04-17 16:11:07 +01:00
Andrew Morgan 4a89754582 await on_user_ip 2020-04-16 16:30:31 +01:00
Andrew Morgan fa89a8c801 Remove defer.returnValue call from async function 2020-04-16 16:24:35 +01:00
Andrew Morgan 3c1646d986 Re-add third_party_rules/__init__.py
Accidentally deleted in https://github.com/matrix-org/synapse-dinsic/commit/6c058e32063b606b473f415ae6b68000f036ff94#diff-2a9df128248ff0ce75eb3f836469110a
2020-04-15 15:13:34 +01:00
Andrew Morgan 9abf2a9897 Merge branch 'dinsic' of github.com:matrix-org/synapse-dinsic into 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)
2020-03-24 18:00:23 +00:00
Andrew Morgan e598957a94 1.12.0
* commit '2fa55c0cc':
  1.12.0
  more changelog
  changelog fixes
  fix typo
2020-03-24 14:43:43 +00:00
Andrew Morgan a1be668df3 1.12.0rc1
* commit 'e43e78b98':
  1.12.0rc1
  update grafana dashboard
2020-03-24 14:42:52 +00:00
Andrew Morgan a2f183346c Fix concurrent modification errors in pusher metrics (#7106)
* commit 'e913823a2':
  Fix concurrent modification errors in pusher metrics (#7106)
2020-03-24 14:42:43 +00:00
Andrew Morgan fd4dc99b76 Add prometheus metrics for the number of active pushers (#7103)
* commit '8c75667ad':
  Add prometheus metrics for the number of active pushers (#7103)
2020-03-24 14:42:37 +00:00
Andrew Morgan 9c6c91bb48 Move pusherpool startup into _base.setup (#7104)
* commit '443162e57':
  Move pusherpool startup into _base.setup (#7104)
2020-03-24 14:42:29 +00:00
Andrew Morgan 62c75e6536 Improve get auth chain difference algorithm. (#7095)
* commit '4a17a647a':
  Improve get auth chain difference algorithm. (#7095)
2020-03-24 14:42:21 +00:00
Andrew Morgan 6ed566e52a Add an option to the set password API to choose whether to logout other devices. (#7085)
* commit '88b41986d':
  Add an option to the set password API to choose whether to logout other devices. (#7085)
2020-03-24 14:42:12 +00:00
Andrew Morgan 82bf3bdae7 Update INSTALL.md updated CentOS8 install instructions (#6925)
* commit '6d110ddea':
  Update INSTALL.md updated CentOS8 install instructions (#6925)
2020-03-24 14:39:00 +00:00
Andrew Morgan 9efb33dfde Share SSL contexts for non-federation requests (#7094)
* commit 'c37db0211':
  Share SSL contexts for non-federation requests (#7094)
2020-03-24 14:38:46 +00:00
Andrew Morgan 695cc418be Set charset to utf-8 when adding headers for certain text content types (#7044)
* commit '5e477c1de':
  Set charset to utf-8 when adding headers for certain text content types (#7044)
2020-03-24 14:38:36 +00:00
Andrew Morgan 3992f9f144 Remove unused federation endpoint (query_auth) (#7026)
* commit '7581d30e9':
  Remove unused federation endpoint (`query_auth`) (#7026)
2020-03-24 14:36:57 +00:00
Andrew Morgan 756fe3c0be Remove special casing of m.room.aliases events (#7034)
* commit '60724c46b':
  Remove special casing of `m.room.aliases` events (#7034)
2020-03-24 14:36:49 +00:00
Andrew Morgan 6095a49d4a Merge commit '6a3504636' into dinsic-release-v1.12.x
* commit '6a3504636': (29 commits)
  Revert "Add options to disable setting profile info for prevent changes. (#7053)"
  Populate the room version from state events (#7070)
  Fix buggy condition in account validity handler (#7074)
  Use innerText instead of innerHTML
  Add type annotations and comments to auth handler (#7063)
  Lint
  Put the file in the templates directory
  Update wording and config
  Changelog
  Move the default SAML2 error HTML to a dedicated file
  Refactor a bit
  Also don't fail on aliases events in this case
  Lint
  Changelog
  Also don't filter out events sent by ignored users when checking state visibility
  Fix condition
  Don't filter out dummy events when we're checking the visibility of state
  Update sample_config.yaml
  Update synapse/config/registration.py
  lint, fix tests
  ...
2020-03-24 14:36:35 +00:00
Andrew Morgan 42cbe33d33 Merge pull request #7058 from matrix-org/babolivier/saml_error_html
* commit '6640460d0':
  Rephrase default message
  Hopefully mypy is happy now
  Attempt at appeasing the gods of mypy
  Lint
  Changelog
  Update sample config
  SAML2: render a comprehensible error page if something goes wrong
2020-03-24 14:25:26 +00:00
Andrew Morgan 42e1eeffcd Merge pull request #7055 from matrix-org/babolivier/get_time_of_last_push_action_before
* commit '14b2ebe76':
  Changelog
  Fix undefined `room_id` in `make_summary_text`
  Move `get_time_of_last_push_action_before` to the `EventPushActionsWorkerStore`
2020-03-24 14:25:14 +00:00
Andrew Morgan cae4284f27 Remove special auth and redaction rules for aliases events in experimental room ver. (#7037)
* commit '06eb5cae0':
  Remove special auth and redaction rules for aliases events in experimental room ver. (#7037)
2020-03-24 14:25:05 +00:00
Andrew Morgan a95e5cc0a2 Update routing of fallback auth in the worker docs. (#7048)
* commit '66315d862':
  Update routing of fallback auth in the worker docs. (#7048)
2020-03-24 14:24:48 +00:00
Andrew Morgan c19705f4c9 Merge pull request #7045 from matrix-org/babolivier/room_keys_check
* commit 'bbf725e7d':
  Lint
  Mention the session ID in the error message
  Lint
  Changelog
  Make sure that is_verified is a boolean when processing room keys
2020-03-24 14:24:42 +00:00
Andrew Morgan 942f0482f8 Add type hints to logging/context.py (#6309)
* commit '2bff4457d':
  Add type hints to logging/context.py (#6309)
2020-03-24 14:24:34 +00:00
Andrew Morgan 5dfd887245 Break down monthly active users by appservice_id (#7030)
* commit '1d66dce83':
  Break down monthly active users by appservice_id  (#7030)
2020-03-24 14:24:25 +00:00
Andrew Morgan 003aefc48b Convert remote key resource REST layer to async/await. (#7020)
* commit '87972f07e':
  Convert remote key resource REST layer to async/await. (#7020)
2020-03-24 14:24:17 +00:00
Andrew Morgan 736bc4f428 Store room_versions in EventBase objects (#6875)
* commit '78a15b1f9':
  Store room_versions in EventBase objects (#6875)
2020-03-24 14:24:06 +00:00
Andrew Morgan 70ca85b805 Merge pull request #7035 from matrix-org/babolivier/hide_dummy_events
* commit 'fe678a090':
  Changelog
  Hide extremities dummy events from clients
2020-03-24 14:23:59 +00:00
Andrew Morgan 36bebb4c17 Allow deleting an alias if the user has sufficient power level (#6986)
* commit '13892776e':
  Allow deleting an alias if the user has sufficient power level (#6986)
2020-03-24 14:23:51 +00:00
Andrew Morgan 57d83e962d Read the room version from database when fetching events (#6874)
* commit '8ef8fb2c1':
  Read the room version from database when fetching events (#6874)
  Update debian changelog
2020-03-24 14:23:24 +00:00
Andrew Morgan 959b119d58 v1.11.1
* commit 'fd983fad9':
  v1.11.1
  Fix wrong handler being used in SAML handler
  Factor out complete_sso_login and expose it to the Module API
  Add a whitelist for the SSO confirmation step.
  Add a confirmation step to the SSO login flow
2020-03-24 13:42:54 +00:00
Andrew Morgan e87e413151 Validate the alt_aliases property of canonical alias events (#6971)
* commit '7dcbc33a1':
  Validate the alt_aliases property of canonical alias events (#6971)
2020-03-24 13:38:59 +00:00
Andrew Morgan 13cb403e0e Always return a deferred from get_current_state_deltas. (#7019)
* commit 'b29474e0a':
  Always return a deferred from `get_current_state_deltas`. (#7019)
2020-03-24 13:36:02 +00:00
Andrew Morgan 868ad41f09 Fix py35-old CI by using native tox. (#7018)
* commit '3ab8e9c29':
  Fix py35-old CI by using native tox. (#7018)
  remove spurious changelog
  rst->md
2020-03-24 13:34:03 +00:00
Andrew Morgan 8682867efc Fixed set a user as an admin with the new API (#6928)
* commit 'bbeee33d6':
  Fixed set a user as an admin with the new API (#6928)
2020-03-24 13:33:01 +00:00
Andrew Morgan 8b731d1842 Fix last date for ACMEv1 install (#7015)
* commit 'e4ffb14d5':
  Fix last date for ACMEv1 install (#7015)
2020-03-24 13:30:03 +00:00
Andrew Morgan bb32140598 Fix mounting of homeserver.yaml when it does not exist on host (#6913)
* commit 'd96ac97d2':
  Fix mounting of homeserver.yaml when it does not exist on host (#6913)
2020-03-24 13:29:54 +00:00
Andrew Morgan 3bd5d4c39e Add some type annotations to the federation base & client classes (#6995)
* commit '12d425900':
  Add some type annotations to the federation base & client classes (#6995)
2020-03-24 13:29:43 +00:00
Andrew Morgan 4c75c20fc5 Fixed set a user as an admin with the new API (#6928)
* commit '9b06d8f8a':
  Fixed set a user as an admin with the new API (#6928)
2020-03-24 13:29:30 +00:00
Andrew Morgan 637f8d9b1a Don't refuse to start worker if media listener configured. (#7002)
* commit '2201bc979':
  Don't refuse to start worker if media listener configured. (#7002)
2020-03-24 13:25:44 +00:00
Andrew Morgan 9c7554230c set worker_app for frontend proxy test (#7003)
* commit 'cab4a5253':
  set worker_app for frontend proxy test (#7003)
2020-03-24 13:25:32 +00:00
Andrew Morgan 6cea3c3d43 Expose common commands via snap run interface to allow easier invocation (#6315)
* commit 'b32ac60c2':
  Expose common commands via snap run interface to allow easier invocation (#6315)
2020-03-24 13:25:24 +00:00
Andrew Morgan 17aba0c0a3 Add some type annotations in synapse.storage (#6987)
* commit '132b673db':
  Add some type annotations in `synapse.storage` (#6987)
2020-03-24 13:25:15 +00:00
Andrew Morgan 06d54f9f8c Store room version on invite (#6983)
* commit '3e99528f2':
  Store room version on invite (#6983)
2020-03-24 13:25:08 +00:00
Andrew Morgan 1bca0d40fc Cast a coroutine into a Deferred in the federation base (#6996)
* commit '380122866':
  Cast a coroutine into a Deferred in the federation base (#6996)
2020-03-24 13:25:01 +00:00
Andrew Morgan b2e71e372e Port PresenceHandler to async/await (#6991)
* commit '1f773eec9':
  Port PresenceHandler to async/await (#6991)
2020-03-24 13:24:54 +00:00
Andrew Morgan 9b74549f83 Updated warning for incorrect database collation/ctype (#6985)
* commit '7728d87fd':
  Updated warning for incorrect database collation/ctype (#6985)
2020-03-24 13:24:42 +00:00
Andrew Morgan 4d8fa1d9c2 Ensure 'deactivated' parameter is a boolean on user admin API, Fix error handling of call to deactivate user (#6990)
* commit '8c75b621b':
  Ensure 'deactivated' parameter is a boolean on user admin API, Fix error handling of call to deactivate user (#6990)
2020-03-24 13:24:21 +00:00
Andrew Morgan 9c05d82a9d Sanity-check database before running upgrades (#6982)
* commit 'c1156d3e2':
  Sanity-check database before running upgrades (#6982)
2020-03-24 13:24:00 +00:00
Andrew Morgan 46d2b135db Sanity-check database before running upgrades (#6982)
* commit 'e66f099ca':
  Sanity-check database before running upgrades (#6982)
2020-03-24 13:23:52 +00:00
Andrew Morgan 78e43a9b68 Merge worker apps into one. (#6964)
* commit 'bbf8886a0':
  Merge worker apps into one. (#6964)
2020-03-24 13:23:45 +00:00
Andrew Morgan c5266d4366 contrib/docker: remove quotes for POSTGRES_INITDB_ARGS (#6984)
* commit '4aea0bd29':
  contrib/docker: remove quotes for POSTGRES_INITDB_ARGS (#6984)
2020-03-24 13:23:38 +00:00
Andrew Morgan 4f819f092d Remove redundant store_room call (#6979)
* commit '691659568':
  Remove redundant store_room call (#6979)
2020-03-24 13:23:30 +00:00
Andrew Morgan 698962af0a Upsert room version when we join over federation (#6968)
* commit 'a301934f4':
  Upsert room version when we join over federation (#6968)
2020-03-24 13:23:11 +00:00
Andrew Morgan 5dac67e2db Fix minor issues with email config (#6962)
* commit '4c2ed3f20':
  Fix minor issues with email config (#6962)
2020-03-24 13:23:02 +00:00
Andrew Morgan b1528ca1d7 No longer use room alias events to calculate room names for push notifications. (#6966)
* commit 'af6c38950':
  No longer use room alias events to calculate room names for push notifications. (#6966)
2020-03-24 13:22:54 +00:00
Andrew Morgan afc65ea972 Change displayname of user as admin in rooms (#6876)
* commit '7b0e2d961':
  Change displayname of user as admin in rooms (#6876)
2020-03-24 13:22:20 +00:00
Andrew Morgan 794a3d16da Stop returning aliases as part of the room list. (#6970)
* commit 'fcf459948':
  Stop returning aliases as part of the room list. (#6970)
  Publishing/removing from the directory requires a power level greater than canonical aliases.
2020-03-24 13:16:51 +00:00
Andrew Morgan 35d74a232c Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)
* commit '509e381af':
  Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)
  changelog
  Increase MAX_EVENTS_BEHIND for replication clients
2020-03-24 13:16:43 +00:00
Andrew Morgan c0d7e952fc 1.11.0
* commit '9c1b83b00':
  1.11.0
2020-03-24 13:16:29 +00:00
Andrew Morgan dc1f6d7576 Small grammar fixes to the ACME v1 deprecation notice (#6944)
* commit '8f6d9c4cf':
  Small grammar fixes to the ACME v1 deprecation notice (#6944)
2020-03-24 13:16:22 +00:00
Andrew Morgan e8693091fd Do not send alias events when creating / upgrading a room (#6941)
* commit '99eed85a7':
  Do not send alias events when creating / upgrading a room (#6941)
2020-03-24 13:16:15 +00:00
Andrew Morgan bbee32f534 don't insert into the device table for remote cross-signing keys (#6956)
* commit 'a90d0dc5c':
  don't insert into the device table for remote cross-signing keys (#6956)
2020-03-24 13:16:06 +00:00
Andrew Morgan 86502838d0 Add some clarifications to README.md in the database schema directory. (#6615)
* commit '4fb5f4d0c':
  Add some clarifications to README.md in the database schema directory. (#6615)
  Minor perf fixes to `get_auth_chain_ids`.
2020-03-24 13:16:00 +00:00
Andrew Morgan 2c6aae8071 Freeze allocated objects on startup. (#6953)
* commit 'fc87d2ffb':
  Freeze allocated objects on startup. (#6953)
2020-03-24 13:15:52 +00:00
Andrew Morgan 8fbacc7c54 Reduce auth chains fetched during v2 state res. (#6952)
* commit '2b37eabca':
  Reduce auth chains fetched during v2 state res. (#6952)
  update changes.md
2020-03-24 13:15:41 +00:00
Andrew Morgan 4b9c44b952 1.11.0rc1
* commit '197b08de3':
  1.11.0rc1
2020-03-24 13:15:31 +00:00
Andrew Morgan fca30c7737 Revert get_auth_chain_ids changes (#6951)
* commit '099c96b89':
  Revert `get_auth_chain_ids` changes (#6951)
2020-03-24 13:15:23 +00:00
Andrew Morgan 7236385fd2 Merge pull request #6949 from matrix-org/rav/list_room_aliases_peekable
* commit '2fb7794e6':
  changelog
  Make room alias lists peekable
  Add `allow_departed_users` param to `check_in_room_or_world_readable`
  Refactor the membership check methods in Auth
2020-03-24 13:15:15 +00:00
Andrew Morgan b63baf1a18 Merge pull request #6940 from matrix-org/babolivier/federate.md
* commit 'bbe39f808':
  Incorporate review
  Incorporate review
  Phrasing
  Changelog
  Add mention of SRV records as an advanced topic
  Argh trailing spaces
  Fix links in the reverse proxy doc
  Make federate.md more of a sumary of the steps to follow to set up replication
  Split the delegating documentation out of federate.md and trim it down
2020-03-24 13:15:08 +00:00
Andrew Morgan a86ad65fbd Move MSC2432 stuff onto unstable prefix (#6948)
* commit '880aaac1d':
  Move MSC2432 stuff onto unstable prefix (#6948)
2020-03-24 13:14:59 +00:00
Andrew Morgan bf123925f6 Tiny optimisation for _get_handler_for_request (#6950)
* commit 'abf1e5c52':
  Tiny optimisation for _get_handler_for_request (#6950)
2020-03-24 13:14:52 +00:00
Andrew Morgan 14ac70f225 Increase DB/CPU perf of _is_server_still_joined check. (#6936)
* commit '0d0bc3579':
  Increase DB/CPU perf of `_is_server_still_joined` check. (#6936)
2020-03-24 13:14:41 +00:00
Andrew Morgan 9261b5a7b9 Merge pull request #6945 from matrix-org/babolivier/fix-retention-debug-log
* commit '5e4a43855':
  Update changelog.d/6945.bugfix
  Changelog
  Fix log in message retention purge jobs
2020-03-24 13:14:35 +00:00
Andrew Morgan 1174a5b308 Limit size of get_auth_chain_ids query (#6947)
* commit '5a5abd55e':
  Limit size of get_auth_chain_ids query (#6947)
2020-03-24 13:14:25 +00:00
Andrew Morgan 2f7adc625e Implement GET /_matrix/client/r0/rooms/{roomId}/aliases (#6939)
* commit 'adfaea8c6':
  Implement GET /_matrix/client/r0/rooms/{roomId}/aliases (#6939)
2020-03-24 13:13:59 +00:00
Andrew Morgan 0818ea48e7 Merge pull request #6872 from matrix-org/rav/dictproperty
* commit '3f1cd1479':
  changelog
  Rewrite _EventInternalMetadata to back it with a _dict
  Replace _event_dict_property with DictProperty
2020-03-24 13:13:51 +00:00
Andrew Morgan 7534f1a7c0 Merge pull request #6907 from matrix-org/babolivier/acme-config
* commit 'd484126bf':
  Make the log more noticeable
  Print the error as an error log and raise the same exception we got
  Linters are hard but in they end they just want what's best for us
  Lint
  Changelog
  Lint
  Add a separator for the config warning
  Add a comprehensive error when failing to register for an ACME account
  Add mention and warning about ACME v1 deprecation to the Synapse config
2020-03-24 13:13:43 +00:00
Andrew Morgan 83d2923f93 Increase perf of get_auth_chain_ids used in state res v2. (#6937)
* commit '8a380d0fe':
  Increase perf of `get_auth_chain_ids` used in state res v2. (#6937)
2020-03-24 13:13:32 +00:00
Andrew Morgan 480ed7d168 Fix worker docs to point /publicised_groups API correctly. (#6938)
* commit '818def824':
  Fix worker docs to point `/publicised_groups` API correctly. (#6938)
2020-03-24 13:12:46 +00:00
Andrew Morgan bb0f2c9064 Merge pull request #6909 from matrix-org/babolivier/acme-install
* commit '7a782c32a':
  Update INSTALL.md
  Changelog
  Update INSTALL.md to recommend reverse proxying and warn about ACMEv1 deprecation
2020-03-24 13:12:39 +00:00
Andrew Morgan 688b054fc7 Stop sending events when creating or deleting aliases (#6904)
* commit 'fe3941f6e':
  Stop sending events when creating or deleting aliases (#6904)
2020-03-24 13:12:31 +00:00
Andrew Morgan 44b314b396 Kill off deprecated "config-on-the-fly" docker mode (#6918)
* commit '3be2abd0a':
  Kill off deprecated "config-on-the-fly" docker mode (#6918)
  #6924 has been released in 1.10.1
2020-03-24 13:12:19 +00:00
Andrew Morgan cf89f76ec7 1.10.1
* commit 'fd6d83ed9':
  1.10.1
2020-03-23 18:05:28 +00:00
Andrew Morgan af9e5cb4ff wait for current_state_events_membership before delete_old_current_state_events (#6924)
* commit 'd2455ec3a':
  wait for current_state_events_membership before delete_old_current_state_events (#6924)
2020-03-23 18:05:18 +00:00
Andrew Morgan ed2f00559f Raise the default power levels for invites, tombstones and server acls (#6834)
* commit '3404ad289':
  Raise the default power levels for invites, tombstones and server acls (#6834)
2020-03-23 18:01:36 +00:00
Andrew Morgan a7882c2396 wait for current_state_events_membership before delete_old_current_state_events (#6924)
* commit '46fa66bbf':
  wait for current_state_events_membership before delete_old_current_state_events (#6924)
2020-03-23 18:00:43 +00:00
Andrew Morgan a316fff074 Add type hints to the spam check module (#6915)
* commit '10027c80b':
  Add type hints to the spam check module (#6915)
2020-03-23 18:00:21 +00:00
Andrew Morgan 679da58c9c contrib/docker: Ensure correct encoding and locale settings on DB creation (#6921)
* commit '32873efa8':
  contrib/docker: Ensure correct encoding and locale settings on DB creation (#6921)
2020-03-23 17:48:23 +00:00
Andrew Morgan 1c257f8083 Add a warning about indentation to generated config (#6920)
* commit '97a42bbc3':
  Add a warning about indentation to generated config (#6920)
2020-03-23 17:48:14 +00:00
Andrew Morgan dfe1580d05 Convert the directory handler tests to use HomeserverTestCase (#6919)
* commit '02e89021f':
  Convert the directory handler tests to use HomeserverTestCase (#6919)
2020-03-23 17:48:07 +00:00
Andrew Morgan 1c4d917cc2 Have ThirdPartyEventRules return True on success 2020-03-23 17:47:33 +00:00
Andrew Morgan b683d4b07e Filter the results of user directory searching via the spam checker (#6888)
* commit '49f877d32':
  Filter the results of user directory searching via the spam checker (#6888)
2020-03-23 17:38:09 +00:00
Andrew Morgan 05b96d30be Update changelog for #6905 to group it with upcoming PRs
* commit 'df1c98c22':
  Update changelog for #6905 to group it with upcoming PRs
2020-03-23 17:16:42 +00:00
Andrew Morgan 27cad30417 Add documentation for the spam checker module (#6906)
* commit '361de49c9':
  Add documentation for the spam checker module (#6906)
2020-03-23 17:16:23 +00:00
Andrew Morgan f3fb2c3a3f Merge pull request #6905 from matrix-org/babolivier/acme.md
* commit 'f48bf4feb':
  Update docs/ACME.md
  Mention that using Synapse to serve certificates requires restarts
  Changelog
  Remove duplicated info about certbot et al
  Update ACME.md to mention ACME v1 deprecation
2020-03-23 17:16:16 +00:00
Andrew Morgan c36e468977 Remove m.lazy_load_members from unstable features since it is in CS r0.5.0 (#6877)
* commit 'dc3f99870':
  Remove m.lazy_load_members from unstable features since it is in CS r0.5.0 (#6877)
2020-03-23 17:16:02 +00:00
Andrew Morgan fe99288d55 Merge pull request #6891 from matrix-org/babolivier/retention-doc-amend
* commit '6cd34da8b':
  Rephrase
  Update the changelog file
  Also spell it out in the purge history API doc
  Changelog
  Spell out that Synapse never purges the last event sent in a room
2020-03-23 17:15:49 +00:00
Andrew Morgan dbf10b08c4 Return a 404 for admin api user lookup if user not found (#6901)
* commit 'd8994942f':
  Return a 404 for admin api user lookup if user not found (#6901)
  Move the warning at the top of the release changes
2020-03-23 17:15:20 +00:00
Andrew Morgan 279521a278 1.10.0
* commit 'fdb816713':
  1.10.0
2020-03-23 17:15:11 +00:00
Andrew Morgan 5f193a86ae bump the version of Alpine Linux used in the docker images (#6897)
* commit '3dd2b5f5e':
  bump the version of Alpine Linux used in the docker images (#6897)
2020-03-23 17:15:01 +00:00
Andrew Morgan 5e02ad6cf5 Use BSD-compatible in-place editing for sed. (#6887)
* commit 'ba547ec3a':
  Use BSD-compatible in-place editing for sed. (#6887)
2020-03-23 17:14:52 +00:00
Andrew Morgan 9f796b3d11 1.10.0rc5
* commit '856b2a955':
  1.10.0rc5
  changelog wording
  Update CHANGES.md
  changelog formatting
2020-03-23 17:14:37 +00:00
Andrew Morgan a49c5a5ce5 1.10.0rc4
* commit '3edc65dd2':
  1.10.0rc4
2020-03-23 17:12:18 +00:00
Andrew Morgan 1dbb4305e3 Reject device display names that are too long (#6882)
* commit 'a92e703ab':
  Reject device display names that are too long (#6882)
2020-03-23 17:12:09 +00:00
Andrew Morgan d83725c9dc filter out m.room.aliases from /sync state blocks (#6884)
* commit '01209382f':
  filter out m.room.aliases from /sync state blocks (#6884)
2020-03-23 17:12:00 +00:00
Andrew Morgan 40430fd1f6 Add an additional test to the SyTest blacklist for worker mode. (#6883)
* commit '3a3118f4e':
  Add an additional test to the SyTest blacklist for worker mode. (#6883)
2020-03-23 17:11:53 +00:00
Andrew Morgan 0be1d3a2e9 1.10.0rc3
* commit '3de57e706':
  1.10.0rc3
2020-03-23 17:11:46 +00:00
Andrew Morgan 92c98deb8b filter out m.room.aliases from the CS API until a better solution is specced (#6878)
* commit '8e64c5a24':
  filter out m.room.aliases from the CS API until a better solution is specced (#6878)
2020-03-23 17:11:40 +00:00
Andrew Morgan d4ba9d285a Update setuptools for python 3.5 tests (#6880)
* commit 'fe73f0d53':
  Update setuptools for python 3.5 tests (#6880)
2020-03-23 17:11:27 +00:00
Andrew Morgan ac99b4a37f Add support for putting fed user query API on workers (#6873)
* commit '21db35f77':
  Add support for putting fed user query API on workers (#6873)
2020-03-23 17:11:07 +00:00
Andrew Morgan 0e4f076892 Remove unused get_room_stats_state method. (#6869)
* commit 'e1d858984':
  Remove unused `get_room_stats_state` method. (#6869)
2020-03-23 17:10:59 +00:00
Andrew Morgan ec9d297b12 Add a make_event_from_dict method (#6858)
* commit '799001f2c':
  Add a `make_event_from_dict` method (#6858)
2020-03-23 17:10:52 +00:00
Andrew Morgan 6c970c528d Add typing to synapse.federation.sender (#6871)
* commit 'b08b0a22d':
  Add typing to synapse.federation.sender (#6871)
2020-03-23 17:10:44 +00:00
Andrew Morgan 5bb1eb6136 Allow moving group read APIs to workers (#6866)
* commit 'de2d26737':
  Allow moving group read APIs to workers (#6866)
2020-03-23 17:10:38 +00:00
Andrew Morgan 3b0ce55bf7 Admin api to add an email address (#6789)
* commit '56ca93ef5':
  Admin api to add an email address (#6789)
2020-03-23 17:10:32 +00:00
Andrew Morgan 6e8ecf93e3 remove unused room_version_to_event_format (#6857)
* commit 'f4884444c':
  remove unused room_version_to_event_format (#6857)
2020-03-23 17:10:25 +00:00
Andrew Morgan 0402b659f6 Merge pull request #6856 from matrix-org/rav/redact_changes/6
* commit 'e1b240329':
  Pass room_version into `event_from_pdu_json`
2020-03-23 17:10:18 +00:00
Andrew Morgan 99eeff7c12 Limit the number of events that can be requested when backfilling events (#6864)
* commit '7765bf398':
  Limit the number of events that can be requested when backfilling events (#6864)
2020-03-23 17:10:11 +00:00
Andrew Morgan 3e219a6ef0 pass room version into FederationClient.send_join (#6854)
* commit 'b0c8bdd49':
  pass room version into FederationClient.send_join (#6854)
2020-03-23 17:10:02 +00:00
Andrew Morgan 29102e0cd1 Allow empty federation_certificate_verification_whitelist (#6849)
* commit 'bce557175':
  Allow empty federation_certificate_verification_whitelist (#6849)
2020-03-23 17:09:54 +00:00
Andrew Morgan 693425b4ea Third party event rules Update (#6781)
* commit '99fcc9628':
  Third party event rules Update (#6781)
2020-03-23 17:09:45 +00:00
Andrew Morgan 26447c543f Reduce amount of logging at INFO level. (#6862)
* commit 'ed630ea17':
  Reduce amount of logging at INFO level. (#6862)
2020-03-23 17:09:39 +00:00
Andrew Morgan 97962c4028 Merge pull request #6823 from matrix-org/rav/redact_changes/5
* commit '9bcd37146':
  Update changelog
  Update changelog
  Update changelog
  Newsfile
  Simplify `room_version` handling in `FederationClient.send_invite`
  Pass room version object into `FederationClient.get_pdu`
2020-03-23 17:09:33 +00:00
Andrew Morgan 87f9d944dd 1.10.0rc2
* commit '6a7e90ad7':
  1.10.0rc2
2020-03-23 17:09:25 +00:00
Andrew Morgan 0057df8072 Update documentation (#6859)
* commit 'f0561fcff':
  Update documentation (#6859)
2020-03-23 17:09:18 +00:00
Andrew Morgan 62d3277719 Merge pull request #6855 from matrix-org/clokep/readme-pip-install
* commit '5e019069a':
  Add quotes around pip install target (my shell complained without them).
2020-03-23 17:09:05 +00:00
Andrew Morgan aa17b55a9b Merge pull request #6840 from matrix-org/rav/federation_client_async
* commit '577f46036':
  make FederationClient._do_send_invite async
  Apply suggestions from code review
  make FederationClient.send_invite async
  newsfile
  make FederationClient.get_missing_events async
  make FederationClient._do_send_leave async
  make FederationClient.send_leave.send_request async
  make FederationClient._do_send_join async
  make FederationClient.send_join.send_request async
  make FederationClient.make_membership_event.send_request async
  make FederationClient._try_destination_list async
  make FederationClient.send_leave async
  make FederationClient.send_join async
  make FederationClient.make_membership_event async
  make FederationClient.get_event_auth async
  make FederationClient.get_room_state_ids async
  make FederationClient.get_pdu async
  make FederationClient.backfill async
2020-03-23 17:08:58 +00:00
Andrew Morgan 00b7754fe5 Check sender_key matches on inbound encrypted events. (#6850)
* commit 'a58860e48':
  Check sender_key matches on inbound encrypted events. (#6850)
2020-03-23 17:08:51 +00:00
Andrew Morgan d867f29652 Merge pull request #6844 from matrix-org/uhoreg/cross_signing_fix_device_fed
* commit '60d067242':
  Merge pull request #6844 from matrix-org/uhoreg/cross_signing_fix_device_fed
2020-03-23 17:08:40 +00:00
Andrew Morgan 8f939e896d Reduce performance logging to DEBUG (#6833)
* commit 'a831d2e4e':
  Reduce performance logging to DEBUG (#6833)
2020-03-23 17:08:28 +00:00
Andrew Morgan 9abd8e46c1 Database updates to populate rooms.room_version (#6847)
* commit 'd88e0ec08':
  Database updates to populate rooms.room_version (#6847)
2020-03-23 17:08:21 +00:00
Andrew Morgan 85d36b62c4 Fix detecting unknown devices from remote encrypted events. (#6848)
* commit '6475382d8':
  Fix detecting unknown devices from remote encrypted events. (#6848)
2020-03-23 17:08:15 +00:00
Andrew Morgan 432d213889 Merge pull request #6844 from matrix-org/uhoreg/cross_signing_fix_device_fed
* commit '74bf3fdbb':
  add changelog
  add device signatures to device key query results
2020-03-23 17:08:09 +00:00
Andrew Morgan d26f388fa9 Update CONTRIBUTING.md about merging PRs. (#6846)
* commit 'c87572d6e':
  Update CONTRIBUTING.md about merging PRs. (#6846)
2020-03-23 17:07:57 +00:00
Andrew Morgan f275c2c195 Merge pull request #6837 from matrix-org/rav/federation_async
* commit 'c7d6d5c69': (27 commits)
  make FederationHandler.send_invite async
  make FederationHandler.on_get_missing_events async
  changelog
  make FederationHandler.user_joined_room async
  make FederationHandler._clean_room_for_join async
  make FederationHandler._notify_persisted_event async
  make FederationHandler.persist_events_and_notify async
  make FederationHandler._make_and_verify_event async
  make FederationHandler.do_remotely_reject_invite async
  make FederationHandler._check_for_soft_fail async
  make FederationHandler._persist_auth_tree async
  make FederationHandler.do_invite_join async
  make FederationHandler.on_event_auth async
  make FederationHandler.on_exchange_third_party_invite_request async
  make FederationHandler.construct_auth_difference async
  make FederationHandler._update_context_for_auth_events async
  make FederationHandler._update_auth_events_and_context_for_auth async
  make FederationHandler.do_auth async
  make FederationHandler._prep_event async
  make FederationHandler._handle_new_event async
  ...
2020-03-23 17:05:01 +00:00
Andrew Morgan ae9e55b13c Add typing to SyncHandler (#6821)
* commit 'b9391c957':
  Add typing to SyncHandler (#6821)
2020-03-23 17:04:47 +00:00
Andrew Morgan cd85afc6ec Fix stacktraces when using ObservableDeferred and async/await (#6836)
* commit 'ae5b3104f':
  Fix stacktraces when using ObservableDeferred and async/await (#6836)
2020-03-23 17:04:40 +00:00
Andrew Morgan c3b7b10c44 Allow URL-encoded user IDs on user admin api paths (#6825)
* commit '370080531':
  Allow URL-encoded user IDs on user admin api paths (#6825)
2020-03-23 17:04:33 +00:00
Andrew Morgan 61f50aec4a Fix room_version in on_invite_request flow (#6827)
* commit 'b0d112e78':
  Fix `room_version` in `on_invite_request` flow (#6827)
  Update changelog
  Fix link in upgrade.rst
2020-03-23 17:04:26 +00:00
Andrew Morgan bd89a5d743 1.10.0rc1
* commit 'ac0d45b78':
  1.10.0rc1
2020-03-23 17:04:16 +00:00
Andrew Morgan fcd6baac4d Fix deleting of stale marker for device lists (#6819)
* commit '83b0ea047':
  Fix deleting of stale marker for device lists (#6819)
2020-03-23 17:04:09 +00:00
Andrew Morgan ff9bbf6285 pass room_version into compute_event_signature (#6807)
* commit '7f93eb190':
  pass room_version into compute_event_signature (#6807)
2020-03-23 17:04:01 +00:00
Andrew Morgan 3fae9f944a Merge pull request #6806 from matrix-org/rav/redact_changes/3
* commit 'a5afdd15e':
  changelog
  Pass room_version into add_hashes_and_signatures
  Pass room_version into create_local_event_from_event_dict
  Store the room version in EventBuilder
2020-03-23 17:03:55 +00:00
Andrew Morgan 8c7c6e1b85 Merge pull request #6820 from matrix-org/rav/get_room_version_id
* commit '160522e32':
  newsfile
  Add `get_room_version` method
  s/get_room_version/get_room_version_id/
2020-03-23 17:03:49 +00:00
Andrew Morgan bea0e0df76 Fix bug with getting missing auth event during join 500'ed (#6810)
* commit '7d846e870':
  Fix bug with getting missing auth event during join 500'ed (#6810)
2020-03-23 17:03:35 +00:00
Andrew Morgan 699da5bf1d pass room version into FederationHandler.on_invite_request (#6805)
* commit '46a446828':
  pass room version into FederationHandler.on_invite_request (#6805)
2020-03-23 17:03:25 +00:00
Andrew Morgan 52814b494a Log when we delete room in bg update (#6816)
* commit 'e0992fcc5':
  Log when we delete room in bg update (#6816)
2020-03-23 17:03:18 +00:00
Andrew Morgan 35b1d7816b MSC2260: Block direct sends of m.room.aliases events (#6794)
* commit '184303b86':
  MSC2260: Block direct sends of m.room.aliases events (#6794)
2020-03-23 17:03:12 +00:00
Andrew Morgan b791fc93dd Backgroud update to clean out rooms from current state (#6802)
* commit '57ad702af':
  Backgroud update to clean out rooms from current state (#6802)
2020-03-23 17:03:05 +00:00
Andrew Morgan b60633101e Resync remote device list when detected as stale. (#6786)
* commit 'b66032705':
  Resync remote device list when detected as stale. (#6786)
2020-03-23 17:02:59 +00:00
Andrew Morgan 17292d593e Fix sending server up commands from workers (#6811)
* commit 'c3d4ad8af':
  Fix sending server up commands from workers (#6811)
2020-03-23 17:02:52 +00:00
Andrew Morgan 381f140fc0 When server leaves room check for stale device lists. (#6801)
* commit 'a5bab2d05':
  When server leaves room check for stale device lists. (#6801)
2020-03-23 17:02:44 +00:00
Andrew Morgan 916add259e When a client asks for remote keys check if should resync. (#6797)
* commit 'c80a9fe13':
  When a client asks for remote keys check if should resync. (#6797)
2020-03-23 17:02:36 +00:00
Andrew Morgan 45b330da61 Type defintions for use in refactoring for redaction changes (#6803)
* commit '5a246611e':
  Type defintions for use in refactoring for redaction changes (#6803)
2020-03-23 17:02:27 +00:00
Andrew Morgan 1310c64981 Remove unused DeviceRow class (#6800)
* commit 'a855b7c3a':
  Remove unused DeviceRow class (#6800)
2020-03-23 17:02:20 +00:00
Andrew Morgan fc0fd6e2dd Merge pull request #6790 from matrix-org/rav/msc2260.1
* commit '281551f72':
  changelog
  Make /directory/room/<alias> handle restrictive power levels
  Set the PL for aliases events to 0.
  Factor out a `copy_power_levels_contents` method
2020-03-23 17:02:14 +00:00
Andrew Morgan 70e37d50fd Fix race in federation sender that delayed device updates. (#6799)
* commit '6b9e1014c':
  Fix race in federation sender that delayed device updates. (#6799)
2020-03-23 17:02:05 +00:00
Andrew Morgan abf0e75536 Delete current state when server leaves a room (#6792)
* commit '611215a49':
  Delete current state when server leaves a room (#6792)
2020-03-23 17:01:57 +00:00
Andrew Morgan 718337e142 Fix bug when querying remote user keys that require a resync. (#6796)
* commit '2cad8baa7':
  Fix bug when querying remote user keys that require a resync. (#6796)
2020-03-23 17:01:49 +00:00
Andrew Morgan fea1e6fc73 Fix outbound federation request metrics (#6795)
* commit 'fcfb591b3':
  Fix outbound federation request metrics (#6795)
2020-03-23 17:01:42 +00:00
Andrew Morgan d115a4dcb0 Merge pull request #6787 from matrix-org/rav/msc2260
* commit 'cc109b79d':
  fix bad variable ref
  update changelog
  changelog
  Implement updated auth rules from MSC2260
2020-03-23 17:01:34 +00:00
Andrew Morgan d880d2b1cb Detect unknown remote devices and mark cache as stale (#6776)
* commit 'e17a11066':
  Detect unknown remote devices and mark cache as stale (#6776)
2020-03-23 17:01:26 +00:00
Andrew Morgan 45e098eb4c Pass room version object into event_auth.check and check_redaction (#6788)
* commit 'a8ce7aeb4':
  Pass room version object into event_auth.check and check_redaction (#6788)
2020-03-23 17:01:18 +00:00
Andrew Morgan 4f66a15d64 Warn if postgres database has non-C locale. (#6734)
* commit '02b44db92':
  Warn if postgres database has non-C locale. (#6734)
2020-03-23 17:01:09 +00:00
Andrew Morgan 1f1239d721 1.9.1
* commit '77d935722':
  1.9.1
2020-03-23 13:25:52 +00:00
Andrew Morgan 714dca387d Fix setting mau_limit_reserved_threepids config (#6793)
* commit 'bdbeeb94e':
  Fix setting `mau_limit_reserved_threepids` config (#6793)
2020-03-23 13:25:44 +00:00
Andrew Morgan 92ec7ba1fb Add rooms.room_version column (#6729)
* commit '8df862e45':
  Add `rooms.room_version` column (#6729)
2020-03-23 13:25:38 +00:00
Andrew Morgan c83cd65ddd Propagate cache invalidates from workers to other workers. (#6748)
* commit 'd5275fc55':
  Propagate cache invalidates from workers to other workers. (#6748)
2020-03-23 13:25:30 +00:00
Andrew Morgan 645a30b002 Merge pull request #6775 from matrix-org/jaywink/worker-docs-tweaks
* commit 'f74d178b1':
  Formatting of changelog
  Fix federation_reader listeners doc as per PR review
  Clarifications to the workers documentation
2020-03-23 13:25:24 +00:00
Andrew Morgan 8632f34f90 Validate client_secret parameter (#6767)
* commit '9f7aaf90b':
  Validate client_secret parameter (#6767)
2020-03-23 13:25:02 +00:00
Andrew Morgan 5a32d2941e Make 'event.redacts' never raise. (#6771)
* commit 'fa4d609e2':
  Make 'event.redacts' never raise. (#6771)
  Fixup changelog
  Fixup changelog
  Fixup changelog
2020-03-23 13:16:57 +00:00
Andrew Morgan 806204a51d 1.9.0
* commit 'f3eac2b3e':
  1.9.0
2020-03-23 13:16:51 +00:00
Andrew Morgan 308ed5fa5c a bit of debugging for media storage providers (#6757)
* commit '6b7462a13':
  a bit of debugging for media storage providers (#6757)
2020-03-23 13:16:44 +00:00
Andrew Morgan 82f535a29b Minor fixes to user admin api (#6761)
* commit '5bd3cb726':
  Minor fixes to user admin api (#6761)
2020-03-23 13:16:37 +00:00
Andrew Morgan 42732de3bc Update admin room docs with correct endpoints (#6770)
* commit 'd31f5f4d8':
  Update admin room docs with correct endpoints (#6770)
2020-03-23 13:16:30 +00:00
Andrew Morgan 0786bba611 Remove unnecessary abstractions in admin handler (#6751)
* commit 'ce84dd9e2':
  Remove unnecessary abstractions in admin handler (#6751)
  Fixup warning about workers changes
  Add deprecation headers
  Fixup changelog
2020-03-23 13:16:22 +00:00
Andrew Morgan 8aff29f76c 1.9.0rc1
* commit '0d0f32bc5':
  1.9.0rc1
2020-03-23 13:16:13 +00:00
Andrew Morgan fc43d20d9d Admin API to list, filter and sort rooms (#6720)
* commit '90a28fb47':
  Admin API to list, filter and sort rooms (#6720)
2020-03-23 13:15:24 +00:00
Andrew Morgan fdc6098c26 Merge pull request #6764 from matrix-org/babolivier/fix-thumbnail
* commit 'ae6cf586b':
  Lint + changelog
  Remove unused import
  Add tests for thumbnailing
  Fix typo in _select_thumbnail
2020-03-23 11:39:53 +00:00
Andrew Morgan 48adc5b9ce Fix and add test to deprecated quarantine media admin api (#6756)
* commit 'aa9b00fb2':
  Fix and add test to deprecated quarantine media admin api (#6756)
2020-03-23 11:39:38 +00:00
Andrew Morgan 6a6f8cf40c Allow monthly active user limiting support for worker mode, fixes #4639. (#6742)
* commit '5e52d8563':
  Allow monthly active user limiting support for worker mode, fixes #4639. (#6742)
2020-03-23 11:39:30 +00:00
Andrew Morgan 060343d534 Allow streaming cache invalidate all to workers. (#6749)
* commit '5d7a6ad22':
  Allow streaming cache invalidate all to workers. (#6749)
2020-03-23 11:39:24 +00:00
Andrew Morgan 874c98a7c7 Remove unused CI docker compose files (#6754)
* commit '2093f83ea':
  Remove unused CI docker compose files (#6754)
2020-03-23 11:39:18 +00:00
Andrew Morgan dc9c06f32b Avoid attribute error when password_config present but empty (#6753)
* commit '837f62266':
  Avoid attribute error when `password_config` present but empty (#6753)
2020-03-23 11:38:43 +00:00
Andrew Morgan 09e9ebd0d9 Port synapse_port_db to async/await (#6718)
* commit '07124d028':
  Port synapse_port_db to async/await (#6718)
2020-03-23 11:38:36 +00:00
Andrew Morgan a09011a6ab Add a DeltaState to track changes to be made to current state (#6716)
* commit '0e6876007':
  Add a DeltaState to track changes to be made to current state (#6716)
2020-03-23 11:38:29 +00:00
Andrew Morgan fd3b31dc73 Fixup synapse.rest to pass mypy (#6732)
* commit 'b0a66ab83':
  Fixup synapse.rest to pass mypy (#6732)
2020-03-23 11:38:22 +00:00
Andrew Morgan 169a5854fa Fix /events/:event_id deprecated API. (#6731)
* commit '74b74462f':
  Fix `/events/:event_id` deprecated API. (#6731)
2020-03-23 11:38:15 +00:00
Andrew Morgan a5fe87b85f Fixup synapse.api to pass mypy (#6733)
* commit '0f6e525be':
  Fixup synapse.api to pass mypy (#6733)
2020-03-23 11:38:01 +00:00
Andrew Morgan 6df0a3c48c Fix changing password via user admin API. (#6730)
* commit 'ceecedc68':
  Fix changing password via user admin API. (#6730)
2020-03-23 11:37:54 +00:00
Andrew Morgan 7ed8a68815 Fix empty account_validity config block (#6747)
* commit 'e9e066055':
  Update changelog.d/6747.bugfix
  Revert "Newsfile"
  Newsfile
  Add changelog
  Fix empty account_validity config block
2020-03-23 11:37:47 +00:00
Andrew Morgan 96b48d5bcc Add more logging around message retention policies support (#6717)
* commit 'a17f64361':
  Add more logging around message retention policies support (#6717)
  Fix up changelog
  bump version to v1.9.0.dev2
2020-03-23 11:37:40 +00:00
Andrew Morgan fbda94b8f4 Fix syntax error in run_upgrade for schema 57 (#6728)
* commit '722b4f302':
  Fix syntax error in run_upgrade for schema 57 (#6728)
2020-03-23 11:37:32 +00:00
Andrew Morgan f2df9692a9 Merge pull request #6714 from matrix-org/babolivier/retention_select_event
* commit '3b72bb780':
  bump version to v1.9.0.dev1
  Precise changelog
  Fixup diff
  Remove get_room_event_after_stream_ordering entirely
  Lint
  Rename changelog
  Changelog
  Correctly order when selecting before stream ordering
  Fix typo
  Fix instantiation of message retention purge jobs
2020-03-23 11:36:52 +00:00
Andrew Morgan f7fb31d200 Merge pull request #6724 from matrix-org/rav/log_saml_attributes
* commit '59dc87c61':
  changelog
  Log saml assertions rather than the whole response
  move batch_iter to a separate module
2020-03-23 11:36:45 +00:00
Andrew Morgan 5ba900d744 Delegate remote_user_id mapping to the saml mapping provider (#6723)
* commit '2b6a77fcd':
  Delegate remote_user_id mapping to the saml mapping provider (#6723)
2020-03-23 11:36:38 +00:00
Andrew Morgan bd6344c729 Wake up transaction queue when remote server comes back online (#6706)
* commit 'a8a50f5b5':
  Wake up transaction queue when remote server comes back online (#6706)
2020-03-23 11:36:27 +00:00
Andrew Morgan 09cdecd44d Clarify the account_validity and email sections of the sample configuration. (#6685)
* commit '5ce0b17e3':
  Clarify the `account_validity` and `email` sections of the sample configuration. (#6685)
2020-03-23 11:36:19 +00:00
Andrew Morgan ea066e5b67 Add StateMap type alias (#6715)
* commit 'd386f2f33':
  Add StateMap type alias (#6715)
2020-03-23 11:36:00 +00:00
Andrew Morgan 3af295a009 Add tips for the changelog to the pull request template (#6663)
* commit '7b14c4a01':
  Add tips for the changelog to the pull request template (#6663)
2020-03-23 11:35:52 +00:00
Andrew Morgan 5b211ae070 Add org.matrix.e2e_cross_signing to unstable_features in /versions as per MSC1756 (#6712)
* commit '38e0e59f4':
  Add org.matrix.e2e_cross_signing to unstable_features in /versions as per MSC1756 (#6712)
2020-03-23 11:35:35 +00:00
Andrew Morgan 730dac53f8 Port synapse.replication.tcp to async/await (#6666)
* commit '48c3a9688':
  Port synapse.replication.tcp to async/await (#6666)
2020-03-23 11:35:12 +00:00
Andrew Morgan 888e203aab Fix purge_room admin API (#6711)
* commit '19a1aac48':
  Fix purge_room admin API (#6711)
2020-03-23 11:35:00 +00:00
Andrew Morgan 02931b95b8 Remove duplicate session check in web fallback servlet (#6702)
* commit 'edc244eec':
  Remove duplicate session check in web fallback servlet (#6702)
2020-03-23 11:34:53 +00:00
Andrew Morgan 67ab74cb31 Merge pull request #6688 from matrix-org/rav/module_api_extensions
* commit '608bf7d74':
  changelog
  Handle `config` not being set for synapse plugin modules
  Cleanups and additions to the module API
2020-03-23 11:34:34 +00:00
Andrew Morgan 562718fe12 Implement RedirectException (#6687)
* commit '8f5d7302a':
  Implement RedirectException (#6687)
2020-03-23 11:34:26 +00:00
Andrew Morgan 1e34631d1a Add local_current_membership table (#6655)
* commit '28c98e51f':
  Add `local_current_membership` table (#6655)
2020-03-23 11:34:19 +00:00
Andrew Morgan 9edb5f944f Process EDUs in parallel with PDUs. (#6697)
* commit 'b5ce7f587':
  Process EDUs in parallel with PDUs. (#6697)
2020-03-23 11:34:11 +00:00
Andrew Morgan 09a8668751 Fixup synapse.replication to pass mypy checks (#6667)
* commit 'e8b68a4e4':
  Fixup synapse.replication to pass mypy checks (#6667)
2020-03-23 11:34:02 +00:00
Andrew Morgan 061c671c6c Quarantine media by ID or user ID (#6681)
* commit '1177d3f3a':
  Quarantine media by ID or user ID (#6681)
2020-03-23 11:33:54 +00:00
Andrew Morgan 9483cb6ced Document more supported endpoints for workers (#6698)
* commit '47f4f493f':
  Document more supported endpoints for workers (#6698)
2020-03-23 11:33:47 +00:00
Andrew Morgan 262d78a868 Kill off RegistrationError (#6691)
* commit '326c893d2':
  Kill off RegistrationError (#6691)
2020-03-23 11:33:40 +00:00
Andrew Morgan e861fd82ef Don't assign numeric IDs for empty usernames (#6690)
* commit '2d07c7377':
  Don't assign numeric IDs for empty usernames (#6690)
2020-03-23 11:33:32 +00:00
Andrew Morgan 3ad357338d Merge pull request #6689 from matrix-org/rav/saml_mapping_provider_updates
* commit '3cfac9593':
  changelog
  Pass client redirect URL into SAML mapping providers
  Pass the module_api into the SamlMappingProvider
2020-03-23 11:33:06 +00:00
Andrew Morgan 12763b513f Allow additional_resources to implement Resource directly (#6686)
* commit '803968505':
  Allow additional_resources to implement Resource directly (#6686)
2020-03-23 11:32:57 +00:00
Andrew Morgan 3cfe6ba011 Fix exceptions on requests for non-ascii urls (#6682)
* commit 'feee81997':
  Fix exceptions on requests for non-ascii urls (#6682)
  comment for run_in_background
2020-03-23 11:32:47 +00:00
Andrew Morgan e9dc7683fd Merge pull request #6675 from matrix-org/rav/die_sqlite37_die_die_die
* commit '1d16f5ea0':
  update install notes for CentOS
  changelog
  Refuse to start if sqlite is older than 3.11.0
  Check postgres version in check_database
  Modify check_database to take a connection rather than a cursor
2020-03-23 11:32:39 +00:00
Andrew Morgan bdc0007da4 Add note about log_file no longer be accepted (#6674)
* commit 'c2ba994db':
  Add note about log_file no longer be accepted (#6674)
2020-03-23 11:32:29 +00:00
Andrew Morgan 35d1ec2c8f Allow admin users to create or modify users without a shared secret (#6495)
* commit 'd2906fe66':
  Allow admin users to create or modify users without a shared secret (#6495)
  Fixup changelog
2020-03-23 11:31:22 +00:00
Andrew Morgan e8e76ea60d 1.8.0
* commit '24b2c940f':
  1.8.0
2020-03-20 17:01:35 +00:00
Andrew Morgan 61a7c534bd Merge pull request #6664 from matrix-org/erikj/media_admin_apis
* commit '7c232bd98':
  Shuffle the code
  Comments
  Do not rely on streaming events, as media repo doesn't
  Newsfile
  Import RoomStore in media worker to fix admin APIs
  Move media admin store functions to worker store
2020-03-20 17:01:29 +00:00
Andrew Morgan 27ecf74366 Merge pull request #6665 from matrix-org/babolivier/retention_doc_typo
* commit 'e16521faa':
  Changelog
  Fix typo in message retention policies doc
2020-03-20 17:01:22 +00:00
Andrew Morgan 6e7fb4cbb9 Fix GET request on /_synapse/admin/v2/users endpoint (#6563)
* commit '7caaa29da':
  Fix GET request on /_synapse/admin/v2/users endpoint (#6563)
2020-03-20 17:01:11 +00:00
Andrew Morgan f4a7449d1a Back out ill-advised notary server hackery (#6657)
* commit '573fee759':
  Back out ill-advised notary server hackery (#6657)
2020-03-20 17:00:59 +00:00
Andrew Morgan 6827282aa4 Merge pull request #6624 from matrix-org/babolivier/retention_doc
* commit 'cff1cb868':
  Fix reference
  Incorporate review
  Apply suggestions from code review
  Update changelog.d/6624.doc
  Fix vacuum instructions for sqlite
  Rename changelog
  Add a complete documentation of the message retention policies support
2020-03-20 17:00:51 +00:00
Andrew Morgan a7a73bbbd8 contrib/docker-compose: fixing mount that overrides containers' /etc (#6656)
* commit 'dd57715de':
  contrib/docker-compose: fixing mount that overrides containers' /etc (#6656)
  typo
2020-03-20 17:00:41 +00:00
Andrew Morgan 6eb4fda0a7 Correctly proxy remote group HTTP errors. (#6654)
* commit 'be29ed7ad':
  Correctly proxy remote group HTTP errors. (#6654)
2020-03-20 17:00:33 +00:00
Andrew Morgan 0450704071 Merge pull request #6621 from matrix-org/babolivier/purge_job_config_typo
* commit '2b6b7f482':
  Reword
  Change the example from 5min to 12h
  Fixup changelog
  Fixup changelog
  Fixup changelog
  Changelog
  Update sample config
  Fix a typo in the purge jobs configuration example
2020-03-20 17:00:26 +00:00
Andrew Morgan 5bf0fa4482 1.8.0rc1
* commit '7f0e706eb':
  1.8.0rc1
2020-03-20 17:00:15 +00:00
Andrew Morgan 5af50a046d Merge pull request #6652 from matrix-org/babolivier/depth_missing_events
* commit '0ab5853ec':
  Changelog
  Fix conditions failing if min_depth = 0
2020-03-20 17:00:08 +00:00
Andrew Morgan 66c36eaa8a Add a background update to clear tombstoned rooms from the directory (#6648)
* commit '85db7f73b':
  Add a background update to clear tombstoned rooms from the directory (#6648)
2020-03-20 16:59:58 +00:00
Andrew Morgan 44743d35fe Async/await for background updates (#6647)
* commit '9824a39d8':
  Async/await for background updates (#6647)
2020-03-20 16:59:44 +00:00
Andrew Morgan 0fec900aab port BackgroundUpdateTestCase to HomeserverTestCase (#6653)
* commit 'd20c34654':
  port BackgroundUpdateTestCase to HomeserverTestCase (#6653)
  changelog
  Fix exceptions in log when rejected event is replicated
  async/await for SyncReplicationHandler.process_and_notify
  Clarify documentation on get_event* methods
2020-03-20 16:59:35 +00:00
Andrew Morgan eb08accdba Merge pull request #6629 from matrix-org/rav/kill_event_reference_hashes
* commit '1807db5e7':
  changelog
  Remove unused get_latest_event_ids_and_hashes_in_room
  Remove unused get_prev_events_and_hashes_for_room
  Remove unused hashes and depths from _update_membership params
  Remove unused hashes and depths from create_event params
  Remove unused hashes and depths from create_new_client_event params
  replace get_prev_events_and_hashes_for_room with get_prev_events_for_room in create_new_client_event
  rename get_prev_events_for_room to get_prev_events_and_hashes_for_room
2020-03-20 16:59:26 +00:00
Andrew Morgan eed6f380a1 Fix some test failures when frozen_dicts are enabled (#6642)
* commit 'ba897a759':
  Fix some test failures when frozen_dicts are enabled (#6642)
2020-03-20 16:59:15 +00:00
Andrew Morgan 5343df35b5 Add experimental 'databases' config (#6580)
* commit '9f6c1befb':
  Add experimental 'databases' config (#6580)
2020-03-20 16:59:08 +00:00
Andrew Morgan 6c382fb045 Fix an error which was thrown by the PresenceHandler _on_shutdown handler. (#6640)
* commit 'ab4b4ee6a':
  Fix an error which was thrown by the PresenceHandler _on_shutdown handler. (#6640)
2020-03-20 16:59:00 +00:00
Andrew Morgan 32543333b8 Fix exception when fetching notary server's old keys (#6625)
* commit '4b36b482e':
  Fix exception when fetching notary server's old keys (#6625)
2020-03-20 16:58:37 +00:00
Andrew Morgan d6b6c64943 Workaround for error when fetching notary's own key (#6620)
* commit '18674eebb':
  Workaround for error when fetching notary's own key (#6620)
2020-03-20 16:58:30 +00:00
Andrew Morgan b87a212c49 Fix power levels being incorrectly set in old and new rooms after a room upgrade (#6633)
* commit '01c3c6c92':
  Fix power levels being incorrectly set in old and new rooms after a room upgrade (#6633)
2020-03-20 16:58:15 +00:00
Andrew Morgan 1b410419c2 Automate generation of the sample and debian log configs (#6627)
* commit '08815566b':
  Automate generation of the sample and debian log configs (#6627)
2020-03-20 16:58:07 +00:00
Andrew Morgan 34e65b909a Raise an error if someone tries to use the log_file config option (#6626)
* commit 'e48410130':
  Raise an error if someone tries to use the log_file config option (#6626)
2020-03-20 16:57:58 +00:00
Andrew Morgan 8fced9e2ac Remove unused, undocumented "content repo" resource (#6628)
* commit '98247c4a0':
  Remove unused, undocumented "content repo" resource (#6628)
2020-03-20 16:57:48 +00:00
Andrew Morgan 6d9f40cf4c Kill off redundant SynapseRequestFactory (#6619)
* commit 'b6b57ecb4':
  Kill off redundant SynapseRequestFactory (#6619)
2020-03-20 16:57:41 +00:00
Andrew Morgan a54d17c8c5 Reduce the reconnect time when replication fails. (#6617)
* commit '6964ea095':
  Reduce the reconnect time when replication fails. (#6617)
2020-03-20 16:57:33 +00:00
Andrew Morgan 10396544f5 Added the section 'Configuration' in /docs/turn-howto.md (#6614)
* commit '0495097a7':
  Added the section 'Configuration' in /docs/turn-howto.md (#6614)
2020-03-20 16:57:22 +00:00
Andrew Morgan 7dca131010 Reword sections of federate.md that explained delegation at time of Synapse 1.0 transition (#6601)
* commit '32779b59f':
  Reword sections of federate.md that explained delegation at time of Synapse 1.0 transition (#6601)
2020-03-20 16:57:12 +00:00
Andrew Morgan 6b516d7ee6 Fix small extra argument passed to get_events 2020-03-20 15:42:16 +00:00
Andrew Morgan 3505a2baac 1.7.3
* commit '77661ce81':
  1.7.3
2020-03-20 15:05:41 +00:00
Andrew Morgan 7a4b2b4883 Hacks to work around #6605 (#6608)
* commit '92eac974b':
  Hacks to work around #6605 (#6608)
  sample log config
2020-03-20 15:05:00 +00:00
Andrew Morgan 618a703b0b Update reverse proxy file name (#6590)
* commit 'b2db38284':
  Update reverse proxy file name (#6590)
2020-03-20 15:04:52 +00:00
Andrew Morgan f8d37bdf25 Update reverse proxy file name (#6590)
* commit '7c6b85355':
  Update reverse proxy file name (#6590)
2020-03-20 15:04:31 +00:00
Andrew Morgan 41107a0f1b 1.7.2
* commit '29794c6bc':
  1.7.2
2020-03-20 15:01:40 +00:00
Andrew Morgan 02a2fd0f6a Split state groups into a separate data store (#6296)
* commit '75d8f26ac':
  Split state groups into a separate data store (#6296)
2020-03-20 15:01:31 +00:00
Andrew Morgan b7059bec18 Backport fixes to sqlite upgrade from develop (#6578)
* commit '4caab0e95':
  Backport fixes to sqlite upgrade from develop (#6578)
2020-03-20 15:01:19 +00:00
Andrew Morgan efd80e0d05 Change EventContext to use the Storage class (#6564)
* commit 'fa780e972':
  Change EventContext to use the Storage class (#6564)
2020-03-20 14:55:54 +00:00
Andrew Morgan bcbc56fe21 Fix exceptions when attempting to backfill (#6576)
* commit '03d3792f3':
  Fix exceptions when attempting to backfill (#6576)
2020-03-20 14:55:31 +00:00
Andrew Morgan 8468c90dfe Explode on duplicate delta file names. (#6565)
* commit '0b5dbadd9':
  Explode on duplicate delta file names. (#6565)
2020-03-20 14:42:18 +00:00
Andrew Morgan adf1c37901 Port some admin handlers to async/await (#6559)
* commit '3d46124ad':
  Port some admin handlers to async/await (#6559)
2020-03-20 14:42:08 +00:00
Andrew Morgan 22d45b854e Improve diagnostics on database upgrade failure (#6570)
* commit 'bca30cefe':
  Improve diagnostics on database upgrade failure (#6570)
2020-03-20 14:42:00 +00:00
Andrew Morgan 5f231e3223 Fix sdnotify with acme enabled (#6571)
* commit '0b794cbd7':
  Fix sdnotify with acme enabled (#6571)
2020-03-20 14:40:41 +00:00
Andrew Morgan f1735cb718 Add an export_signing_key script (#6546)
* commit 'b95b76256':
  Add an export_signing_key script (#6546)
2020-03-20 14:40:29 +00:00
Andrew Morgan a4c9c2bb6d Clean up startup for the pusher (#6558)
* commit 'd6752ce5d':
  Clean up startup for the pusher (#6558)
2020-03-20 14:40:20 +00:00
Andrew Morgan 148c5155bd Add delta file to fix missing default table data (#6555)
* commit '7963ca83c':
  Add delta file to fix missing default table data (#6555)
2020-03-20 14:40:10 +00:00
Andrew Morgan 032fed6f42 Add database config class (#6513)
* commit '2284eb3a5':
  Add database config class (#6513)
  too many parens
2020-03-20 14:39:41 +00:00
Andrew Morgan 84cb2f7212 1.7.1
* commit 'd656e91fc':
  1.7.1
2020-03-19 19:17:44 +00:00
Andrew Morgan 4ad14317f6 Fix bug where we added duplicate event IDs as auth_events (#6560)
* commit '502942253':
  Fix bug where we added duplicate event IDs as auth_events (#6560)
2020-03-19 19:17:35 +00:00
Andrew Morgan 72f0171f37 Remove unused get_pagination_rows methods. (#6557)
* commit '02553901c':
  Remove unused `get_pagination_rows` methods. (#6557)
2020-03-19 19:17:24 +00:00
Andrew Morgan b6c674753d Add auth events as per spec. (#6556)
* commit '5ca2cfadc':
  Add auth events as per spec. (#6556)
2020-03-19 19:17:12 +00:00
Andrew Morgan 1c17a8c70d Add auth events as per spec. (#6556)
* commit '3fbe5b7ec':
  Add auth events as per spec. (#6556)
2020-03-19 19:16:57 +00:00
Andrew Morgan 194287c2ec Merge pull request #6553 from matrix-org/babolivier/fix-context-filter
* commit '631653036':
  Incorporate review
  Update changelog.d/6553.bugfix
  Lint
  Add test case
  Changelog
  Update the documentation of the filtering function
  Use the filtered version of an event when responding to /context requests for that event
2020-03-19 19:16:47 +00:00
Andrew Morgan 1964f11955 Add option to allow profile queries without sharing a room (#6523)
* commit 'bfb95654c':
  Add option to allow profile queries without sharing a room (#6523)
2020-03-19 19:15:45 +00:00
Andrew Morgan 52b74ec989 Exclude rejected state events when calculating state at backwards extrems (#6527)
* commit 'bbb75ff6e':
  Exclude rejected state events when calculating state at backwards extrems (#6527)
2020-03-19 19:05:26 +00:00
Andrew Morgan da063246b0 Persist auth/state events at backwards extremities when we fetch them (#6526)
* commit 'ff773ff72':
  Persist auth/state events at backwards extremities when we fetch them (#6526)
2020-03-19 19:05:13 +00:00
Andrew Morgan 4da896581c sanity-checking for events used in state res (#6531)
* commit '83895316d':
  sanity-checking for events used in state res (#6531)
2020-03-19 18:59:37 +00:00
Andrew Morgan 33a461808f Sanity-check room ids in event auth (#6530)
* commit '6577f2d88':
  Sanity-check room ids in event auth (#6530)
2020-03-19 18:56:50 +00:00
Andrew Morgan 5c4280dd8e Check the room_id of events when fetching room state/auth (#6524)
* commit '35bbe4ca7':
  Check the room_id of events when fetching room state/auth (#6524)
2020-03-19 18:56:41 +00:00
Andrew Morgan dface403ae Add include_event_in_state to _get_state_for_room (#6521)
* commit '20d5ba16e':
  Add `include_event_in_state` to _get_state_for_room (#6521)
2020-03-19 18:56:27 +00:00
Andrew Morgan 79c0a438ff Move get_state methods into FederationHandler (#6503)
* commit 'be294d6fd':
  Move get_state methods into FederationHandler (#6503)
2020-03-19 18:52:20 +00:00
Andrew Morgan 302af3dc7d Refactor get_events_from_store_or_dest to return a dict (#6501)
* commit '4c7b1bb6c':
  Refactor get_events_from_store_or_dest to return a dict (#6501)
2020-03-19 18:05:42 +00:00
Andrew Morgan f16334e5a7 Exclude rejected state events when calculating state at backwards extrems (#6527)
* commit '6920d8889':
  Exclude rejected state events when calculating state at backwards extrems (#6527)
2020-03-19 18:01:47 +00:00
Andrew Morgan 3fcb360860 Persist auth/state events at backwards extremities when we fetch them (#6526)
* commit 'bc7de8765':
  Persist auth/state events at backwards extremities when we fetch them (#6526)
2020-03-19 18:01:36 +00:00
Andrew Morgan 63f56c08ca Automatically delete empty groups/communities (#6453)
* commit '9d173b312':
  Automatically delete empty groups/communities (#6453)
2020-03-19 18:01:23 +00:00
Andrew Morgan 88fc911614 Document Shutdown Room admin API (#6541)
* commit '0b90fc6ed':
  Document Shutdown Room admin API (#6541)
2020-03-19 18:01:13 +00:00
Andrew Morgan fcb1c99978 sanity-checking for events used in state res (#6531)
* commit '1da15f05f':
  sanity-checking for events used in state res (#6531)
2020-03-19 18:01:02 +00:00
Andrew Morgan 3719f3fa2f Sanity-check room ids in event auth (#6530)
* commit '971a0702b':
  Sanity-check room ids in event auth (#6530)
2020-03-19 18:00:46 +00:00
Andrew Morgan fa87b96ad2 Merge pull request #6537 from matrix-org/erikj/bump_mypy_version
* commit '5cadbd9eb':
  More rewording of changelog.
  Reword changelog
  Add deprecation notes
  Newsfile
  Bump version of mypy
2020-03-19 18:00:37 +00:00
Andrew Morgan f60ca2bb56 1.7.0
* commit 'f5aeea9e8':
  1.7.0
2020-03-19 18:00:23 +00:00
Andrew Morgan 7a3fe99b16 Adjust the sytest blacklist for worker mode (#6538)
* commit '4ce05ec17':
  Adjust the sytest blacklist for worker mode (#6538)
2020-03-19 18:00:15 +00:00
Andrew Morgan 3e5e7f29d1 Merge pull request #6496 from matrix-org/erikj/initial_sync_asnyc
* commit 'caa52836e':
  Newsfile
  Port synapse.handlers.initial_sync to async/await
2020-03-19 18:00:08 +00:00
Andrew Morgan e5592ca2c1 Merge pull request #6534 from matrix-org/erikj/extend_mypy
* commit '7e67cfc87':
  Newsfile
  Include more folders in mypy
2020-03-19 17:59:57 +00:00
Andrew Morgan 1a051ca537 look up cross-signing keys from the DB in bulk (#6486)
* commit 'cb2db1799':
  look up cross-signing keys from the DB in bulk (#6486)
2020-03-19 17:59:50 +00:00
Andrew Morgan 8757a54206 Fix redacted events being returned in search results ordered by "recent" (#6522)
* commit '5bfd8855d':
  Fix redacted events being returned in search results ordered by "recent" (#6522)
2020-03-19 17:59:40 +00:00
Andrew Morgan 2d0506f1be Check the room_id of events when fetching room state/auth (#6524)
* commit '25f124432':
  Check the room_id of events when fetching room state/auth (#6524)
2020-03-19 17:59:24 +00:00
Andrew Morgan 49ba0a7434 Merge pull request #6511 from matrix-org/erikj/remove_db_config_from_apps
* commit 'b8e4b39b6':
  Add new config param to docstring and add types
  Newsfile
  Fix upgrade db script
  Remove database config parsing from apps.
2020-03-19 17:59:17 +00:00
Andrew Morgan 354e790e0d Add include_event_in_state to _get_state_for_room (#6521)
* commit '204535651':
  Add `include_event_in_state` to _get_state_for_room (#6521)
2020-03-19 17:59:08 +00:00
Andrew Morgan 050bc5bf40 Merge pull request #6517 from matrix-org/rav/event_auth/13
* commit '894d2adda':
  changelog
  convert to async: FederationHandler._process_received_pdu
  convert to async: FederationHandler._get_state_for_room
  convert to async: FederationHandler.on_receive_pdu
  Convert federation backfill to async
2020-03-19 17:58:58 +00:00
Andrew Morgan e71d3cdb7c Update workers.md to make media_repository work (again) (#6519)
* commit '58fdcbdfe':
  Update  workers.md to make media_repository work (again) (#6519)
  Remove #6369 changelog
2020-03-19 17:58:47 +00:00
Andrew Morgan fe97d69358 Merge pull request #6504 from matrix-org/erikj/account_validity_async_await
* commit '31905a518':
  Newsfile
  Port handlers.account_validity to async/await.
  Port handlers.account_data to async/await.
2020-03-19 17:57:34 +00:00
Andrew Morgan 19a2804fa4 Clean up some logging (#6515)
* commit '7c429f92d':
  Clean up some logging (#6515)
2020-03-19 17:49:14 +00:00
Andrew Morgan 82be5c38d6 1.7.0rc2
* commit 'd156912c4':
  1.7.0rc2
  Back out change preventing setting null avatar URLs
  Fixup changelogs
2020-03-19 17:49:07 +00:00
Andrew Morgan 22a602077c Prevent redacted events from appearing in message search (#6377)
* commit 'fc316a489':
  Prevent redacted events from appearing in message search (#6377)
2020-03-19 17:48:59 +00:00
Andrew Morgan b10a35db1f Add dev script to generate full SQL schema files (#6394)
* commit '6676ee9c4':
  Add dev script to generate full SQL schema files (#6394)
2020-03-19 17:48:51 +00:00
Andrew Morgan 2f42d6f846 Prevent message search in upgraded rooms we're not in (#6385)
* commit 'ea0f0ad41':
  Prevent message search in upgraded rooms we're not in (#6385)
2020-03-19 17:48:40 +00:00
Andrew Morgan 5af87590e1 Merge pull request #6349 from matrix-org/babolivier/msc1802
* commit '54ae52ba9':
  Lint
  Changelog
  Lint
  Fix prefix for v2/send_leave
  Add server-side support to the v2 API
  Implement v2 API for send_leave
  Add missing yield
  Implement v2 API for send_join
2020-03-19 17:48:28 +00:00
Andrew Morgan 200efb9d68 wMerge pull request #6512 from matrix-org/erikj/silence_mypy
* commit '239d86a13':
  Newsfile
  Silence mypy errors for files outside those specified
2020-03-19 17:48:16 +00:00
Andrew Morgan 0a48dd4d5e Move get_state methods into FederationHandler (#6503)
* commit 'f8bc2ae88':
  Move get_state methods into FederationHandler (#6503)
2020-03-19 17:48:07 +00:00
Andrew Morgan f131b1a36d Allow SAML username provider plugins (#6411)
* commit '4947de5a1':
  Allow SAML username provider plugins (#6411)
2020-03-19 17:47:57 +00:00
Andrew Morgan 32c3f7ca67 Merge pull request #6510 from matrix-org/erikj/phone_home_stats_db
* commit 'b2dcddc41':
  Newsfile
  Phone home stats DB reporting should not assume a single DB.
2020-03-19 17:47:50 +00:00
Andrew Morgan 9ccb061352 Fix race which caused deleted devices to reappear (#6514)
* commit '40eda8493':
  Fix race which caused deleted devices to reappear (#6514)
2020-03-19 17:47:40 +00:00
Andrew Morgan 0d60ea6d37 Refactor get_events_from_store_or_dest to return a dict (#6501)
* commit 'c3dda2874':
  Refactor get_events_from_store_or_dest to return a dict (#6501)
2020-03-19 17:47:31 +00:00
Andrew Morgan 5d68a2f9c9 Remove redundant code from event authorisation implementation. (#6502)
* commit '424fd5823':
  Remove redundant code from event authorisation implementation. (#6502)
2020-03-19 17:47:21 +00:00
Andrew Morgan 8c190d0b7e Merge pull request #6505 from matrix-org/erikj/make_deferred_yiedable
* commit '35f3c366e':
  Update comment
  Newsfile
  Fix make_deferred_yieldable to work with coroutines
2020-03-19 17:47:05 +00:00
Andrew Morgan 8cb2ab114d Merge pull request #6499 from matrix-org/erikj/fix_sqlite_7
* commit 'e726e1873':
  Drop unused index
  Convert _censor_redactions to async since it awaits on coroutines
  Only start censor background job after indices are created
  Newsfile
  Fix support for SQLite 3.7.
2020-03-19 17:46:58 +00:00
Andrew Morgan 9489c670a9 Merge pull request #6509 from matrix-org/babolivier/fix-room-store-config
* commit 'a964f1888':
  Changelog
  Give the server config to the RoomWorkerStore
2020-03-19 17:46:49 +00:00
Andrew Morgan 7c5aae509f Merge pull request #6506 from matrix-org/erikj/remove_snapshot_cache
* commit 'e3f528c54':
  Newsfile
  Remove SnapshotCache in favour of ResponseCache
2020-03-19 17:46:42 +00:00
Andrew Morgan 945c30e83d Merge pull request #6507 from matrix-org/babolivier/pusher-room-store
* commit '332f3b36e':
  Changelog
  Make the PusherSlaveStore inherit from the slave RoomStore
  Fix erroneous reference for new room directory defaults.
  Update CHANGES.md
2020-03-19 17:46:35 +00:00
Andrew Morgan d4a0500715 Better errors regarding changing avatar_url (#6497)
* commit '5e8abe901':
  Better errors regarding changing avatar_url (#6497)
2020-03-19 17:46:16 +00:00
Andrew Morgan b141f6cb2f 1.7.0rc1
* commit '24da1ffcb':
  1.7.0rc1
2020-03-19 17:46:09 +00:00
Andrew Morgan ac2c017421 Systemd documentation (#6490)
* commit '96d35f102':
  Systemd documentation (#6490)
2020-03-19 17:46:01 +00:00
Andrew Morgan 5069b7fbe7 Back out perf regression from get_cross_signing_keys_from_cache. (#6494)
* commit 'adfdd82b2':
  Back out perf regression from get_cross_signing_keys_from_cache. (#6494)
  Fix comment
  Fix port db script
  Newsfile
  Fixup tests
  Move start up DB checks to main data store.
  Pass Database into the data store
  Move are_all_users_on_domain checks to main data store.
  Change DataStores to accept 'database' param.
2020-03-19 17:14:53 +00:00
Andrew Morgan 7fe3852335 Merge pull request #6493 from matrix-org/erikj/invite_state_config
* commit 'e1544b0af':
  Newsfile
  Pull out room_invite_state_types config option once.
2020-03-19 17:13:38 +00:00
Andrew Morgan a1a8fe3fd3 Fix inaccurate per-block metrics (#6491)
* commit '18660a34d':
  Fix inaccurate per-block metrics (#6491)
2020-03-19 17:13:28 +00:00
Andrew Morgan a09b394dc4 Remove fallback for missing /federation/v1/state_ids API (#6488)
* commit 'e519489fc':
  Remove fallback for missing /federation/v1/state_ids API (#6488)
2020-03-19 17:13:20 +00:00
Andrew Morgan 2beae00b3b Merge pull request #6484 from matrix-org/erikj/port_sync_handler
* commit 'a9b393340':
  Fixup functions to consistently return deferreds
  Newsfile
  Port SyncHandler to async/await
2020-03-19 17:13:08 +00:00
Andrew Morgan 60baffdaa4 Merge pull request #6469 from matrix-org/erikj/make_database_class
* commit 'f3ea2f5a0':
  Remove unused var
  Fix DB scripts
  Newsfile
  Move background update handling out of store
  Comments
  Move DB pool and helper functions into dedicated Database class
2020-03-19 17:12:37 +00:00
Andrew Morgan 968c74c132 Replace /admin/v1/users_paginate endpoint with /admin/v2/users (#5925)
* commit '649b6bc08':
  Replace /admin/v1/users_paginate endpoint with /admin/v2/users (#5925)
2020-03-19 16:56:29 +00:00
Andrew Morgan 7c3883643a Merge pull request #6483 from matrix-org/erikj/port_rest_v2
* commit 'd085a8a0a':
  Newsfile
  Port rest.client.v2
2020-03-19 16:55:48 +00:00
Andrew Morgan 9120098a37 Merge pull request #6482 from matrix-org/erikj/port_rest_v1
* commit 'af5d0ebc7':
  Newsfile
  Fixup tests
  Port rest/v1 to async/await
2020-03-19 16:34:10 +00:00
Andrew Morgan 4522fbfd32 Revert "Modify systemd unit file reference to align with installation instruction (#6369)"
* commit 'ff119879d':
  Revert "Modify systemd unit file reference to align with installation instruction (#6369)"
2020-03-19 16:29:50 +00:00
Andrew Morgan bbc140161b Modify systemd unit file reference to align with installation instruction (#6369)
* commit 'dc8747895':
  Modify systemd unit file reference to align with installation instruction (#6369)
2020-03-19 16:29:37 +00:00
Andrew Morgan 10648492b4 Stronger typing in the federation handler (#6480)
* commit '63d6ad106':
  Stronger typing in the federation handler (#6480)
2020-03-19 16:29:27 +00:00
Andrew Morgan c2fa3c8821 Sanity-check the rooms of auth events before pulling them in. (#6472)
* commit 'e1f4c83f4':
  Sanity-check the rooms of auth events before pulling them in. (#6472)
2020-03-19 16:29:19 +00:00
Andrew Morgan fa3d0d96c4 Modify systemd unit file reference to align with installation instruction (#6369)
* commit 'ba7af15d4':
  Modify systemd unit file reference to align with installation instruction (#6369)
2020-03-19 16:29:10 +00:00
Andrew Morgan 237f3fe187 Merge pull request #6464 from matrix-org/erikj/make_public_sql_base
* commit 'ddbbfc951':
  Newsfile
  Remove underscore from SQLBaseStore functions
  Don't call SQLBaseStore methods from outside stores
2020-03-19 16:28:41 +00:00
Andrew Morgan f6c28ac9a4 Merge pull request #6470 from matrix-org/babolivier/port_db_ci_failure
* commit 'fe799f353':
  Fix background updates for synapse_port_db
  Changelog
  Make synapse_port_db exit with a non-0 code if something failed
2020-03-19 16:19:26 +00:00
Andrew Morgan 92d6b6caf8 get rid of (most of) have_events from _update_auth_events_and_context_for_auth (#6468)
* commit 'e203874ca':
  get rid of (most of) have_events from _update_auth_events_and_context_for_auth (#6468)
2020-03-19 16:19:17 +00:00
Andrew Morgan 663970c696 Merge pull request #6454 from matrix-org/erikj/clean_base_Store
* commit '3eb15c01d':
  Revert "Move get_user_count_txn out of base store"
  _CURRENT_STATE_CACHE_NAME is public
  Move get_user_count_txn out of base store
  Newsfile
  Move cache invalidation to main data store
  Move event fetch vars to EventWorkStore
  Move account validity bg updates to registration store
2020-03-19 16:18:57 +00:00
Andrew Morgan fe1d237338 Merge pull request #6441 from syamgk/fix-parameter-mismatch
* commit 'b9449012d':
  Add changelog file
  Issue #6406 Fix parameter mismatch
2020-03-19 16:18:49 +00:00
Andrew Morgan 00f1c3b40d Merge pull request #6329 from matrix-org/babolivier/context_filters
* commit 'c530f9af4':
  Un-remove room purge test
  Incorporate review
  Format changelog
  Update changelog since this isn't going to be featured in 1.6.0
  Also filter state events
  Only filter if a filter was provided
  Update copyright
  Lint
  Update copyrights
  Changelog
  Add tests for /search
  Merge labels tests for /context and /messages
  Add test case
  Filter events_before and events_after in /context requests
2020-03-19 16:18:41 +00:00
Andrew Morgan 0d0b33b507 Markdownification and other fixes to CONTRIBUTING (#6461)
* commit 'c1ae45393':
  Markdownification and other fixes to CONTRIBUTING (#6461)
2020-03-19 16:18:28 +00:00
Andrew Morgan 1397f83181 Fix error when using synapse_port_db on a vanilla synapse db (#6449)
* commit '85901939c':
  Update changelog.d/6449.bugfix
  Add changelog
  Fix error when using synapse_port_db on a vanilla synapse db
2020-03-19 16:18:20 +00:00
Andrew Morgan f4ae17655e Merge pull request #6451 from matrix-org/uhoreg/cross_signing_signatures_index
* commit '2aa894380':
  apply changes from review
  add changelog
  make cross signing signature index non-unique
2020-03-19 16:18:10 +00:00
Andrew Morgan 0427f070cb privacy by default for room dir (#6355)
* commit 'cb0aeb147':
  privacy by default for room dir (#6355)
2020-03-19 16:17:40 +00:00
Andrew Morgan 2d306214d3 Fix exception when a cross-signed device is deleted (#6462)
* commit '012087546':
  Fix exception when a cross-signed device is deleted (#6462)
2020-03-19 16:08:24 +00:00
Andrew Morgan e66b3e22df Add ephemeral messages support (MSC2228) (#6409)
* commit '54dd5dc12':
  Add ephemeral messages support (MSC2228) (#6409)
2020-03-19 16:08:16 +00:00
Andrew Morgan f57cfa30f4 write some docs for the quarantine_media api (#6458)
* commit '620f98b65':
  write some docs for the quarantine_media api (#6458)
2020-03-19 16:08:07 +00:00
Andrew Morgan be3e14a46a Add benchmarks for structured logging performance (#6266)
* commit 'fdec84aa4':
  Add benchmarks for structured logging performance (#6266)
2020-03-19 16:07:58 +00:00
Andrew Morgan 27a908d499 Transfer power level state events on room upgrade (#6237)
* commit '72078e4be':
  Transfer power level state events on room upgrade (#6237)
2020-03-19 16:07:49 +00:00
Andrew Morgan 84df8905a9 Use python3 packages for Ubuntu (#6443)
* commit '0ad75fd98':
  Use python3 packages for Ubuntu (#6443)
2020-03-19 16:07:40 +00:00
Andrew Morgan 603166f13c Fix: Pillow error when uploading RGBA image (#3325) (#6241)
* commit '81731c6e7':
  Fix: Pillow error when uploading RGBA image (#3325) (#6241)
  Add User-Interactive Auth to /account/3pid/add (#6119)
  Lint
  Changelog
  Discard retention policies when retrieving state
  blacklist more tests
  Newsfile
  Add tests
  Propagate reason in remotely rejected invites
  MSC2367 Allow reason field on all member events
2020-03-19 16:07:29 +00:00
Patrick Cloke e24928de99 Fixes an attribute error when using the default display name during registration. (#32) 2020-03-19 09:46:12 -04:00
Andrew Morgan 2f577412e8 1.6.1
* commit 'e7777f366':
  1.6.1
2020-03-18 17:54:43 +00:00
Andrew Morgan ebdeffcf61 Remove local threepids on account deactivation (#6426)
* commit '2030193e5':
  Remove local threepids on account deactivation (#6426)
2020-03-18 17:54:23 +00:00
Andrew Morgan 8b47cb8352 Remove local threepids on account deactivation (#6426)
* commit 'a9c44d400':
  Remove local threepids on account deactivation (#6426)
2020-03-18 17:54:14 +00:00
Andrew Morgan f724a2afba Clarifications for the email configuration settings. (#6423)
* commit 'c48ea9800':
  Clarifications for the email configuration settings. (#6423)
2020-03-18 17:54:04 +00:00
Andrew Morgan d4ac2758dd Implementation of MSC2314 (#6176)
* commit '0f87b912a':
  Implementation of MSC2314 (#6176)
2020-03-18 17:53:47 +00:00
Andrew Morgan 8c493de8e3 add etag and count to key backup endpoints (#5858)
* commit '0d27aba90':
  add etag and count to key backup endpoints (#5858)
2020-03-18 17:48:53 +00:00
Andrew Morgan 6e79e33494 Add more tests to the worker blacklist (#6429)
* commit '6f4a63df0':
  Add more tests to the worker blacklist (#6429)
2020-03-18 17:48:42 +00:00
Andrew Morgan b8344cabcd Merge pull request #6358 from matrix-org/babolivier/message_retention
* commit 'd31f69afa':
  clean up buildkite output
  Don't restrict the tests to v1 rooms
  Fix worker mode
  Fix 3PID invite exchange
  Lint again
  Lint again
  Lint
  Don't apply retention policy based filtering on state events
  Implement per-room message retention policies
2020-03-18 17:22:33 +00:00
Andrew Morgan c28edec720 Fix startup error when http proxy is defined. (#6421)
* commit '9b9ee7566':
  Fix startup error when http proxy is defined. (#6421)
2020-03-18 16:35:40 +00:00
Andrew Morgan 2de57b8969 Remove assertion and provide a clear warning on startup for missing public_baseurl (#6379)
* commit 'ce578031f':
  Remove assertion and provide a clear warning on startup for missing public_baseurl (#6379)
2020-03-18 16:35:27 +00:00
Andrew Morgan 68096ca59b Merge pull request #6343 from matrix-org/rav/event_auth/4
* commit '651d930f1':
  remove confusing fixme
  newsfile
  Use get_events_as_list rather than lots of calls to get_event
  Update some docstrings and comments
  Simplify _update_auth_events_and_context_for_auth
2020-03-18 16:35:06 +00:00
Andrew Morgan 926fc8f23e Fix startup error when http proxy is defined. (#6421)
* commit 'ef1a85e77':
  Fix startup error when http proxy is defined. (#6421)
2020-03-18 16:34:53 +00:00
Andrew Morgan cd50df35c7 Merge pull request #6420 from matrix-org/erikj/fix_find_next_generated_user_id_localpart
* commit 'f085894cd':
  Don't construct a set
  Newsfile
  Fix find_next_generated_user_id_localpart
2020-03-18 16:34:38 +00:00
Andrew Morgan d6a656674f Prevent account_data content from being sent over TCP replication (#6333)
* commit 'a8175d0f9':
  lint
  Add changelog
  Remove content from being sent for account data rdata stream
2020-03-18 16:34:15 +00:00
Andrew Morgan ab68b70ed0 1.6.0
* commit 'b98971e8a':
  1.6.0
2020-03-18 16:33:23 +00:00
Andrew Morgan fe9970a15f Fix phone home stats (#6418)
* commit '65d54c5e8':
  Fix phone home stats (#6418)
2020-03-18 16:33:14 +00:00
Andrew Morgan 5c881ddde8 Merge pull request #6332 from matrix-org/erikj/query_devices_fix
* commit 'f9f1c8acb':
  Fixup docs
  Newsfile
  Fix caching devices for remote servers in worker.
2020-03-18 16:33:06 +00:00
Andrew Morgan 70c5926d3c Make sure that we close cursors before returning from a query (#6408)
* commit 'c01d54358':
  Make sure that we close cursors before returning from a query (#6408)
2020-03-18 16:32:55 +00:00
Andrew Morgan 0f54acfe25 Improve the performance of structured logging (#6322)
* commit '9eebd4604':
  Improve the performance of structured logging (#6322)
2020-03-18 16:32:40 +00:00
Andrew Morgan a3ec405dcb 1.6.0rc2
* commit 'f9c9e1f07':
  1.6.0rc2
2020-03-18 16:32:31 +00:00
Andrew Morgan 0b5e5fa45d Fix exceptions from background database update for event labels. (#6407)
* commit 'b7367c339':
  Fix exceptions from background database update for event labels. (#6407)
2020-03-18 16:32:22 +00:00
Andrew Morgan cc7e4cb952 Merge pull request #6392 from matrix-org/babolivier/fix-1623
* commit '78cfc05fc':
  Lint
  Changelog
  Test if a purge can make /messages return 500 responses
2020-03-18 16:32:15 +00:00
Andrew Morgan 42b2a00114 Add working build command for docker image (#6390)
* commit '265c0bd2f':
  Add working build command for docker image (#6390)
2020-03-18 16:32:05 +00:00
Andrew Morgan 0d89ceb2fb Fix link to user_dir_populate.sql in the user directory docs (#6388)
* commit '24cc31ee9':
  Fix link to user_dir_populate.sql in the user directory docs (#6388)
2020-03-18 16:31:51 +00:00
Andrew Morgan 11f3cb03a3 Clean up newline quote marks around the codebase (#6362)
* commit '3916e1b97':
  Clean up newline quote marks around the codebase (#6362)
  update macOS installation instructions
2020-03-18 16:31:40 +00:00
Andrew Morgan 2001e42232 1.6.0rc1
* commit '41e456668':
  1.6.0rc1
2020-03-18 16:30:17 +00:00
Andrew Morgan 1ca2d6ac03 Docker: Change permissions for data dir before attempting to write to it (#6389)
* commit '234f55f3c':
  Docker: Change permissions for data dir before attempting to write to it (#6389)
2020-03-18 16:30:08 +00:00
Andrew Morgan a1482869da Move admin endpoints into separate files (#6308)
* commit '4f5ca455b':
  Move admin endpoints into separate files (#6308)
2020-03-18 16:29:57 +00:00
Andrew Morgan 3a63f5a1fc Merge pull request #6335 from matrix-org/erikj/rc_login_cleanups
* commit '83446a18f':
  Lint
  Apply suggestions from code review
  Newsfile
  Add failed auth ratelimiting to UIA
  Only do `rc_login` ratelimiting on succesful login.
2020-03-18 16:29:49 +00:00
Andrew Morgan dcd4162d10 Replace UPDATE with UPSERT on device_max_stream_id table (#6363)
* commit '657d614f6':
  Replace UPDATE with UPSERT on device_max_stream_id table (#6363)
2020-03-18 16:29:34 +00:00
Andrew Morgan 007481899e Add optional python dependencies to snap packaging (#6317)
* commit '53b6559a8':
  Add optional python dependencies to snap packaging (#6317)
2020-03-18 16:29:20 +00:00
Andrew Morgan 055c23cb1b Fix guest -> real account upgrade with account validity enabled (#6359)
* commit '745a48625':
  Fix guest -> real account upgrade with account validity enabled (#6359)
2020-03-18 16:29:12 +00:00
Andrew Morgan 8299874aa2 Replace instance variations of homeserver with correct case/spacing (#6357)
* commit '6e1b40dc2':
  sample config
  Add changelog
  A couple more instances
  Replace instance variations of homeserver with correct case/spacing
2020-03-18 16:29:02 +00:00
Andrew Morgan 5dde341dc3 Merge pull request #6220 from matrix-org/neilj/set_room_version_default_to_5
* commit 'a42567e4a':
  Set room version default to 5
2020-03-18 16:28:54 +00:00
Andrew Morgan c7f4de278e Blacklist PurgeRoomTestCase (#6361)
* commit 'c350bc2f9':
  Blacklist PurgeRoomTestCase (#6361)
2020-03-18 16:28:45 +00:00
Andrew Morgan 75a9b11bf9 Merge pull request #6340 from matrix-org/babolivier/pagination_query
* commit '963ffb60b':
  Incorporate review
  Lint
  Only join on event_labels if we're filtering on labels
  Handle lack of filter
  Changelog
  Fix the SQL SELECT query in _paginate_room_events_txn
2020-03-18 16:14:35 +00:00
Andrew Morgan 21fcaa872c Merge pull request #6295 from matrix-org/erikj/split_purge_history
* commit 'f713c01e2':
  Move type annotation into docstring
  Fix deleting state groups during room purge.
  Use correct type annotation
  Change to not require a state_groups.room_id index.
  Fix up comment
  Update log line to lie a little less
  Add state_groups.room_id index
  Docstrings
  Fix purge room API
  Newsfile
  Split purge API into events vs state
2020-03-18 16:14:17 +00:00
Andrew Morgan e52a1b1965 Merge pull request #6310 from matrix-org/babolivier/msc2326_bg_update
* commit '46e5db9eb':
  Update synapse/storage/data_stores/main/events_bg_updates.py
  Update synapse/storage/data_stores/main/events_bg_updates.py
  Copy results
  Revert "Back to using cursor_to_dict"
  Back to using cursor_to_dict
  Initialise value before looping
  Incorporate review
  Fix field name
  Update insert
  Update changelog
  Print out the actual number of affected rows
  Correctly order results
  TODO
  Fix exit condition
  Lint
  Changelog
  Don't try to process events we already have a label for
  Use a sensible default value for labels
  Use the right format for rows
  MSC2326: Add background update to take previous events into account
2020-03-18 16:14:07 +00:00
Andrew Morgan 42706d25d0 Python 3.8 for tox (#6341)
* commit 'c5abb67e4':
  Python 3.8 for tox (#6341)
2020-03-18 16:13:56 +00:00
Andrew Morgan 6e16ca06b4 Merge pull request #6235 from matrix-org/anoa/room_upgrade_groups
* commit 'e914cf12f':
  tweak changelog
  Re-add docstring, with caveats detailed
  Transfer upgraded rooms on groups
2020-03-18 16:13:45 +00:00
Andrew Morgan 0ceea15173 Fix LruCache callback deduplication (#6213)
* commit 'affcc2cc3':
  Fix LruCache callback deduplication (#6213)
2020-03-18 16:13:30 +00:00
Andrew Morgan 831869729e Make numeric user_id checker start at @0, and don't ratelimit on checking (#6338) 2020-03-18 16:12:48 +00:00
Richard van der Hoff 85845e048c Share SSL contexts for non-federation requests (#30)
* Share SSL contexts for non-federation requests

* newsfile
2020-03-17 16:40:37 +00:00
Andrew Morgan 327c7cad3e Merge commit 'feafd98ac' into dinsic-release-v1.5.x
* commit 'feafd98ac':
  1.5.1
2020-03-16 19:26:08 +00:00
Andrew Morgan eaabbf3f7c Fix bug which caused rejected events to be stored with the wrong room state (#6320)
* commit '807ec3bd9':
  Fix bug which caused rejected events to be stored with the wrong room state  (#6320)
2020-03-16 19:26:00 +00:00
Andrew Morgan 35768bceab Add some checks that we aren't using state from rejected events (#6330)
* commit '0e3ab8afd':
  Add some checks that we aren't using state from rejected events (#6330)
2020-03-16 19:25:51 +00:00
Andrew Morgan d732a7a531 Merge pull request #6336 from matrix-org/erikj/fix_phone_home_stats
* commit '01ba7b38a':
  Newsfile
  Fix phone home stats
2020-03-16 19:25:45 +00:00
Andrew Morgan 699d6fc2f6 Merge pull request #6334 from matrix-org/rav/url_preview_limit_title_2
* commit '5570d1c93':
  Fix exception when OpenGraph tag values are ints
2020-03-16 19:25:38 +00:00
Andrew Morgan 6e290f33e2 Merge pull request #6331 from matrix-org/rav/url_preview_limit_title
* commit '02f99906f':
  Apply suggestions from code review
  Strip overlong OpenGraph data from url preview
2020-03-16 19:25:32 +00:00
Andrew Morgan 4d024026ae Improve documentation for EventContext fields (#6319)
* commit '408600282':
  Improve documentation for EventContext fields (#6319)
2020-03-16 19:25:23 +00:00
Andrew Morgan 974d9e8e67 Remove the psutil dependency (#6318)
* commit '4e1c7b79f':
  Remove the psutil dependency (#6318)
2020-03-16 19:25:00 +00:00
Andrew Morgan 4a634efaf8 document the REPLICATE command a bit better (#6305)
* commit 'cc6243b4c':
  document the REPLICATE command a bit better (#6305)
2020-03-16 19:24:50 +00:00
Andrew Morgan b883522505 Merge pull request #6301 from matrix-org/babolivier/msc2326
* commit 'f496d2587':
  Incorporate review
  Factor out an _AsyncEventContextImpl (#6298)
  Update synapse/storage/data_stores/main/schema/delta/56/event_labels.sql
  Add more data to the event_labels table and fix the indexes
  Add unstable feature flag
  Lint
  Incorporate review
  Lint
  Changelog
  Add integration tests for /messages
  Add more integration testing
  Add integration tests for sync
  Add unit tests
  Add index on label
  Implement filtering
  Store labels for new events
  Add database table for keeping track of labels on events
2020-03-16 19:24:41 +00:00
Andrew Morgan 5514c46775 Merge pull request #6313 from matrix-org/uhoreg/cross_signing_fix_sqlite_schema
* commit 'fa7e52caf':
  add changelog
  fix hidden field in devices table for older sqlite
2020-03-16 19:24:33 +00:00
Andrew Morgan 3e66f7341e Add contributer docs for using the provided linters script (#6164)
* commit '67a65918a':
  Add contributer docs for using the provided linters script (#6164)
2020-03-16 19:24:23 +00:00
Andrew Morgan 211a149106 Support for routing outbound HTTP requests via a proxy (#6239)
* commit '1cb84c648':
  Support for routing outbound HTTP requests via a proxy (#6239)
2020-03-16 19:24:14 +00:00
Andrew Morgan e163ffda2c Remove last usages of deprecated logging.warn method (#6314)
* commit 'fe1f2b452':
  Remove last usages of deprecated logging.warn method (#6314)
2020-03-16 19:24:03 +00:00
Andrew Morgan 22f14ae26c Document lint.sh & allow application to specified files only (#6312)
* commit 'befd58f47':
  Document lint.sh & allow application to specified files only (#6312)
2020-03-16 19:23:55 +00:00
Andrew Morgan 83b92c326f Depublish a room from the public rooms list when it is upgraded (#6232)
* commit 'ace947e8d':
  Depublish a room from the public rooms list when it is upgraded (#6232)
2020-03-16 19:23:40 +00:00
Andrew Morgan 55be059f91 Merge pull request #5727 from matrix-org/uhoreg/e2e_cross-signing2-part3
* commit '53d7680e3':
  Update synapse/storage/data_stores/main/devices.py
  rename get_devices_by_remote to get_device_updates_by_remote
  black
  apply changes as a result of PR review
  don't error if federation query doesn't have cross-signing keys
  move get_e2e_cross_signing_key to EndToEndKeyWorkerStore so it works with workers
  black
  vendor-prefix the EDU name until MSC1756 is merged into the spec
  fix unit test
  add news file
  update to work with newer code, and fix formatting
  add missing param
  make black happy
  don't crash if the user doesn't have cross-signing keys
  implement federation parts of cross-signing
2020-03-16 19:23:32 +00:00
Andrew Morgan abf93b4c64 Merge pull request #6254 from matrix-org/uhoreg/cross_signing_fix_workers_notify
* commit '3b4216f96':
  clean up code a bit
  make user signatures a separate stream
  add changelog
  make notification of signatures work with workers
2020-03-16 19:23:21 +00:00
Andrew Morgan ca06104e24 rstrip slashes from url on appservice (#6306)
* commit '42e707c66':
  rstrip slashes from url on appservice (#6306)
2020-03-16 19:22:37 +00:00
Andrew Morgan 638820f571 Update black to 19.10b0 (#6304)
* commit '020add509':
  Update black to 19.10b0 (#6304)
2020-03-16 19:22:24 +00:00
Andrew Morgan 6d29b53424 Merge pull request #6294 from matrix-org/erikj/add_state_storage 2020-03-16 19:21:18 +00:00
Andrew Morgan 29f4572db4 Share SSL options for well-known requests (#29) 2020-03-16 19:07:29 +00:00
Andrew Morgan 2c80ae77a4 Expose some homeserver functionality to spam checkers (#6259)
* commit '3a74c03ff':
  Expose some homeserver functionality to spam checkers (#6259)
2020-03-16 15:44:53 +00:00
Andrew Morgan d10606afc7 Merge pull request #6307 from matrix-org/erikj/fix_purge_room 2020-03-16 15:44:39 +00:00
Andrew Morgan 99f8f078de Remove usage of deprecated logger.warn method from codebase (#6271) 2020-03-16 15:44:23 +00:00
Andrew Morgan 7f482b7b2a fix delete_existing for _persist_events (#6300) 2020-03-16 15:44:00 +00:00
Andrew Morgan 44b1bc5cc2 Merge pull request #6240 from matrix-org/erikj/split_out_persistence_store 2020-03-16 15:42:55 +00:00
Andrew Morgan bf117c452a Merge pull request #6291 from matrix-org/erikj/fix_cache_descriptor 2020-03-16 15:36:57 +00:00
Andrew Morgan 45d81c26f7 Modify doc to update Google ReCaptcha terms (#6257)
* commit '9677613e9':
2020-03-16 15:36:50 +00:00
Andrew Morgan f836584dcc Update email section of INSTALL.md about account_threepid_delegates (#6272)
* commit '7e1795998':
2020-03-16 15:36:42 +00:00
Andrew Morgan cb1692474a Fix log line that was printing undefined value (#6278)
* commit 'a2276d4d3':
2020-03-16 15:36:35 +00:00
Andrew Morgan 4f2e76e6d2 Update CI to run isort on scripts and scripts-dev (#6270)
* commit '2cab02f9d':
2020-03-16 15:36:28 +00:00
Andrew Morgan 6837c02602 Fix small typo in comment (#6269)
* commit '7955abeaa':
  Fix small typo in comment (#6269)
2020-03-16 15:36:17 +00:00
Andrew Morgan 5bbc257762 Fix typo in domain name in account_threepid_delegates config option (#6273)
* commit '46c12918a':
  Fix typo in domain name in account_threepid_delegates config option (#6273)
2020-03-16 15:36:10 +00:00
Andrew Morgan 057e4348a2 Remove redundant arguments to CI's flake8 (#6277)
* commit '9178ac1b6':
  Remove redundant arguments to CI's flake8 (#6277)
2020-03-16 15:36:03 +00:00
Andrew Morgan 3f6880d465 Handle FileNotFound error in checking git repository version (#6284)
* commit 'b39ca49db':
  Handle FileNotFound error in checking git repository version (#6284)
2020-03-16 15:35:56 +00:00
Andrew Morgan e15b1fd55c Merge pull request #6280 from matrix-org/erikj/receipts_async_await
* commit '770d1ef67':
  Newsfile
  Port receipt and read markers to async/wait
2020-03-16 15:35:42 +00:00
Andrew Morgan d57a35b175 Merge pull request #6274 from matrix-org/erikj/replication_async
* commit 'ba4cc5541':
  Newsfile
  Port replication http server endpoints to async/await
2020-03-16 15:35:15 +00:00
Andrew Morgan 5efd62956d Merge pull request #6275 from matrix-org/erikj/port_rest_events
* commit '72bc6294e':
  Newsfile
  Port room rest handlers to async/await
2020-03-16 15:35:06 +00:00
Andrew Morgan c14c890bf3 Merge pull request #6279 from matrix-org/erikj/federation_server_async_await
* commit 'b4465564c':
  Don't return coroutines
  Make concurrently_execute work with async/await
  Newsfile
  Port federation_server to async/await
2020-03-16 15:34:59 +00:00
Andrew Morgan 8be0e37203 Clarify environment variable usage when running in Docker (#6181)
* commit '213d7eb22':
  Clarify environment variable usage when running in Docker (#6181)
2020-03-16 15:34:50 +00:00
Andrew Morgan b3564c91ad Fix CI for synapse_port_db (#6276)
* commit 'd79151921':
  Fix CI for synapse_port_db (#6276)
2020-03-16 15:34:42 +00:00
Andrew Morgan 4a47ecf6ce 1.5.0
* commit '9ffcf0f7b':
  1.5.0
  update ugrade notes
  Fix changelog name
  Update UPGRADE.rst
  Update UPGRADE.rst
2020-03-16 15:34:01 +00:00
Andrew Morgan 446c957ad1 Merge pull request #6263 from matrix-org/erikj/caches_return_deferreds
* commit '561133c3c':
  Update docstring
  Newsfile
  Quick fix to ensure cache descriptors always return deferreds
2020-03-16 15:33:49 +00:00
Andrew Morgan f39a91708f Merge pull request #6268 from matrix-org/erikj/case_insensitive_room_dir
* commit '1652c8c1f':
  Add comment as to why we're pinning black in tests
  Pin black version
  Newsfile
  Make room directory search case insensitive
2020-03-16 15:33:42 +00:00
Andrew Morgan 3ac38d49ca Add CI for synapse_port_db (#6140)
* commit '14504ad57':
  Add CI for synapse_port_db (#6140)
2020-03-16 15:32:46 +00:00
Andrew Morgan 09d9886521 Fix broken URL in docker/README.md (#6264)
* commit '29207b448':
  Fix broken URL in docker/README.md (#6264)
2020-03-16 15:32:37 +00:00
Andrew Morgan 66bc1ac340 1.5.0rc2
* commit 'c482d4582':
  1.5.0rc2
2020-03-16 15:32:29 +00:00
Andrew Morgan 9528bab8fb Improve signature checking on some federation APIs (#6262)
* commit '172f264ed':
  Improve signature checking on some federation APIs (#6262)
2020-03-16 15:31:35 +00:00
Andrew Morgan 6d1e88a942 Convert EventContext to attrs (#6218)
* commit '9aee28927':
  Convert EventContext to attrs (#6218)
2020-03-16 15:31:27 +00:00
Andrew Morgan 97f1b92b56 Merge pull request #6253 from matrix-org/uhoreg/e2e_backup_delete_keys
* commit 'da78f6177':
  remove unneeded imports
  switch to using HomeserverTestCase
  remove some unnecessary lines
  add changelog
  delete keys when deleting backups
2020-03-16 15:31:19 +00:00
Andrew Morgan 1b5ea48ed2 Merge pull request #6255 from matrix-org/erikj/stats_config
* commit '87259b3a3':
  Fix tests
  Newsfile
  Remove repeated calls to config.stats_enabled.
2020-03-16 15:31:12 +00:00
Andrew Morgan c10e1b5ffd Merge pull request #6256 from matrix-org/erikj/fix_e2e_workers
* commit '67290fa03':
  Newsfile
  Fix /keys/query API on workers.
2020-03-16 15:31:01 +00:00
Andrew Morgan b6b4a11752 Merge pull request #6251 from matrix-org/michaelkaye/debug_guard_logging
* commit '44ab048cf':
  Address codestyle concerns
  Reduce impact of debug logging
  Delay printf until logging is required.
  use %r to __repr__ objects
  Don't encode object as UTF-8 string if not needed.
2020-03-16 15:30:47 +00:00
Andrew Morgan 2d9d79aace Merge pull request #6250 from matrix-org/michaelkaye/make_user_stats_less_verbose
* commit '2020f1191':
  Add missing '.'
  Add changelog.d
  Make user/room stats log line less verbose.
2020-03-16 15:30:39 +00:00
Andrew Morgan 91aede120c Merge pull request #6248 from matrix-org/erikj/move_schema_files
* commit 'e39bc62b8':
  Newsfile
  Move schema delta files to the correct data store.
2020-03-16 15:30:28 +00:00
Andrew Morgan 06a4c337b1 Merge pull request #6247 from matrix-org/babolivier/port_db_column
* commit '0ef0b09d6':
  Fix up changelog
  Changelog
  Add new boolean column to synapse_port_db
2020-03-16 15:30:17 +00:00
Andrew Morgan c57db7f832 1.5.0rc1
* commit '8831b04a5':
  1.5.0rc1
2020-03-16 15:27:13 +00:00
Andrew Morgan 759e8dd793 Option to suppress resource exceeded alerting (#6173)
* commit '2794b7905':
  Option to suppress resource exceeded alerting (#6173)
2020-03-16 15:27:03 +00:00
Andrew Morgan a00615b81c Cleanup extra quotes from IDEs (#6236)
* commit '92e88a71d':
  Cleanup extra quotes from IDEs (#6236)
2020-03-16 15:26:55 +00:00
Andrew Morgan 486605fde2 Merge pull request #6243 from matrix-org/babolivier/port_db_fix_imports
* commit 'e9a8c05be':
  Changelog
  Fix import paths in synapse_port_db
2020-03-16 15:26:48 +00:00
Andrew Morgan bc0625aae5 Make synapse_port_db correctly create indexes (#6102)
* commit 'c97ed64db':
  Make synapse_port_db correctly create indexes (#6102)
2020-03-16 15:26:35 +00:00
Andrew Morgan 3d5a537934 Add config linting script that checks for bool casing (#6203)
* commit '409c62b27':
  Add config linting script that checks for bool casing (#6203)
2020-03-16 15:26:24 +00:00
Andrew Morgan bf1fad8462 Merge pull request #6231 from matrix-org/erikj/refactor_stores 2020-03-16 15:13:49 +00:00
Andrew Morgan 8165d3c81d Merge pull request #5726 from matrix-org/uhoreg/e2e_cross-signing2-part2
* commit '276173163':
  Add changelog entry
  fix doc strings
  make isort happy
  add some comments
  drop some logger lines to debug
  make changes based on PR feedback
  add function docs
  use something that's the right type for user_id
  run black
  split out signature processing into separate functions
  avoid modifying input parameter
  fix test
  update with newer coding style
  add test
  make isort happy
  make black happy
  allow uploading signatures of master key signed by devices
  implement device signature uploading/fetching
2020-03-16 14:59:03 +00:00
Andrew Morgan 48c167afd3 Fix demo script on ipv6-supported boxes (#6229)
* commit 'b2945d267':
  Fix demo script on ipv6-supported boxes (#6229)
2020-03-16 14:56:38 +00:00
Andrew Morgan 036d8ea0da Update postgres.md (#6234)
* commit '0327a00a3':
  Update postgres.md (#6234)
2020-03-16 14:56:30 +00:00
Andrew Morgan 9d5fb564a0 Delete format_tap.py (#6219)
* commit '22a9f7509':
  Delete format_tap.py (#6219)
2020-03-16 14:56:16 +00:00
Andrew Morgan 95b332e90a Remove Auth.check method (#6217)
* commit '93eaeec75':
  Remove Auth.check method (#6217)
  add note about database upgrade
  use the right function for when we're already in runInteraction
  add user signature stream change cache to slaved device store
  black
  use stream ID generator instead of timestamp
  make isort happy
  apply PR review suggestions
  fix formatting
  add changelog
  make changes from PR review
  don't need to return the hidden column any more
  really fix queries to work with Postgres
  PostgreSQL, Y U no like?
  remove extra SQL query param
  add changelog file
  apply changes from PR review
  allow uploading keys for cross-signing
  allow devices to be marked as "hidden"
2020-03-16 14:55:37 +00:00
Andrew Morgan 6ff79e8054 Merge pull request #6214 from matrix-org/rav/event_auth/1
* commit '47ada4dff':
  changelog
  rip out some unreachable code
  Remove dead check_auth script
2020-03-16 14:55:17 +00:00
Andrew Morgan db0b6a8439 Fix logging config for the docker image (#6197)
* commit '560c12226':
  Fix logging config for the docker image (#6197)
2020-03-16 14:55:04 +00:00
Andrew Morgan fa5f5fca19 Clean up the AUTHORS file (#6215) 2020-03-16 14:54:48 +00:00
Brendan Abolivier 21c9e4d054 Fix buggy condition in account validity handler (#28) 2020-03-16 11:32:23 +00:00
Andrew Morgan 59890d1b3c Merge branch 'master' into develop 2020-02-26 12:41:35 +00:00
Andrew Morgan 409643db07 1.4.1 2020-02-26 12:41:18 +00:00
Andrew Morgan 3261565623 Fix presence timeouts when synchrotron restarts. (#6212) 2020-02-26 12:40:51 +00:00
Andrew Morgan 7f25178ac6 1.4.1rc1 2020-02-26 12:40:30 +00:00
Andrew Morgan 589903d88a Merge pull request #6185 from matrix-org/erikj/fix_censored_evnets 2020-02-26 12:38:32 +00:00
Andrew Morgan 20fccf0067 Merge pull request #6193 from matrix-org/uhoreg/interpret_device_key_in_storage 2020-02-26 12:37:22 +00:00
Andrew Morgan 4b2d706900 Merge pull request #6189 from matrix-org/uhoreg/e2e_backup_optional_version 2020-02-26 12:37:13 +00:00
Andrew Morgan 1b032df99f Merge pull request #6195 from matrix-org/erikj/opentracing_preview_url 2020-02-26 12:37:06 +00:00
Andrew Morgan 23f22d8b3e cas: support setting display name (#6114) 2020-02-26 12:36:57 +00:00
Andrew Morgan 20893707bf Fix MAU reaping where reserved users are specified. (#6168) 2020-02-26 12:36:45 +00:00
Andrew Morgan 0d542b03de Merge pull request #6156 from matrix-org/erikj/postgres_any 2020-02-26 12:36:30 +00:00
Andrew Morgan 22fc7597f7 Merge pull request #6186 from matrix-org/erikj/disable_sql_bytes 2020-02-26 12:36:21 +00:00
Andrew Morgan 3030ec1d79 Merge pull request #6191 from matrix-org/rav/fix_packaging 2020-02-26 12:36:03 +00:00
Andrew Morgan aac22dc0d4 Merge pull request #6127 from matrix-org/erikj/patch_inner 2020-02-26 12:34:14 +00:00
Andrew Morgan 846f1c0593 Add domain validation when creating room with list of invitees (#6121) 2020-02-26 12:33:59 +00:00
Andrew Morgan fc7c7ee69e before fulfilling a group invite,check if user is already joined/invited (#3436) 2020-02-26 12:33:45 +00:00
Andrew Morgan f29da285bc send 404 as http-status when filter-id is unknown to the server (#2380) 2020-02-26 12:33:37 +00:00
Andrew Morgan 886da3e376 Add snapcraft packaging information (#6084) 2020-02-26 12:33:28 +00:00
Andrew Morgan aa4590795a Fix races in room stats (and other) updates. (#6187) 2020-02-26 12:33:19 +00:00
Andrew Morgan 8900657282 Rewrite the user_filter migration again (#6184) 2020-02-26 12:33:12 +00:00
Andrew Morgan c86dd8a035 Move tag/push rules room upgrade checking ealier (#6155) 2020-02-26 12:32:59 +00:00
Andrew Morgan 19099efcfb Refactor HomeserverConfig so it can be typechecked (#6137) 2020-02-26 12:32:49 +00:00
Andrew Morgan 77e2efbc5c Merge pull request #6185 from matrix-org/erikj/fix_censored_evnets 2020-02-26 12:29:53 +00:00
Andrew Morgan 8ea11f49ea Merge pull request #6178 from matrix-org/babolivier/factor_out_bg_updates 2020-02-26 12:29:45 +00:00
Andrew Morgan 0e00cb35b3 add M_TOO_LARGE error code for uploading a too large file (#6151) 2020-02-26 12:29:33 +00:00
Andrew Morgan 2351bbefbe Remove unused public room list timeout param (#6179) 2020-02-26 12:29:24 +00:00
Andrew Morgan 6b9f0e9332 Fix /federation/v1/state for recent room versions (#6170) 2020-02-26 12:29:17 +00:00
Andrew Morgan f822f3baab Merge pull request #6161 from matrix-org/erikj/dont_regen_user_id_on_failure 2020-02-26 12:28:51 +00:00
Andrew Morgan 020999d35b Log responder we are using. (#6139) 2020-02-26 12:27:07 +00:00
Andrew Morgan 4f64e73b8c add some logging to the rooms stats updates, to try to track down a flaky test (#6167) 2020-02-26 12:26:38 +00:00
Andrew Morgan 9abce22cc9 Merge pull request #6175 from matrix-org/babolivier/fix_unique_user_filter_index 2020-02-26 12:26:31 +00:00
Andrew Morgan cbe3c2c16b Merge pull request #6159 from matrix-org/erikj/cache_memberships 2020-02-26 12:26:23 +00:00
Andrew Morgan f8baba9c54 Merge pull request #6147 from matrix-org/babolivier/3pid-invite-revoked 2020-02-26 12:26:11 +00:00
Andrew Morgan 5fbd93c21f Update user_filters table to have a unique index, and non-null columns (#1172) 2020-02-26 12:20:00 +00:00
Andrew Morgan d0ddfb50ad media/thumbnailer: Better quality for 1-bit / 8-bit color palette images (#2142) 2020-02-26 12:19:51 +00:00
Andrew Morgan 1ac54c6dc1 add some metrics on the federation sender (#6160) 2020-02-26 12:19:21 +00:00
Andrew Morgan ad13b621a6 Merge branch 'master' into develop 2020-02-26 12:18:56 +00:00
Andrew Morgan 36bea23e2a 1.4.0 2020-02-26 12:18:44 +00:00
Andrew Morgan d5982cd687 Replace client_secret with <redacted> in server logs (#6158) 2020-02-26 12:18:26 +00:00
Andrew Morgan bebf75666a Merge pull request #6154 from matrix-org/erikj/fix_appservice_pagination 2020-02-26 12:13:06 +00:00
Andrew Morgan 4d48fbaa52 Merge pull request #6153 from matrix-org/erikj/fix_room_list_non_federatable 2020-02-26 12:12:58 +00:00
Andrew Morgan dc68d85817 Merge pull request #6148 from matrix-org/erikj/find_next_generated 2020-02-26 12:12:51 +00:00
Andrew Morgan 9f7acf69db Merge pull request #6152 from matrix-org/erikj/fix_room_list 2020-02-26 12:12:43 +00:00
Andrew Morgan 4ab5cf88a2 Land improved room list based on room stats (#6019) 2020-02-26 12:12:33 +00:00
Andrew Morgan 3a2008d23b 1.4.0rc2 2020-02-26 12:12:22 +00:00
Andrew Morgan fba32b84d2 Fix up some typechecking (#6150) 2020-02-26 12:12:14 +00:00
Andrew Morgan 5d00e62224 Fix yields and copy instead of move push rules on room upgrade (#6144) 2020-02-26 12:09:49 +00:00
Andrew Morgan f5a623f070 Merge pull request #6146 from matrix-org/erikj/fix_destination_retry_timings 2020-02-26 12:09:38 +00:00
Andrew Morgan 2ac458d86d Merge pull request #6145 from matrix-org/erikj/fix_censored_redactions 2020-02-26 12:08:58 +00:00
Andrew Morgan c6fed9e8cf Merge pull request #6141 from matrix-org/erikj/censor_redactions_fix 2020-02-26 12:08:49 +00:00
Andrew Morgan 22dfe57bc1 Merge pull request #6135 from matrix-org/erikj/fixup_devices_last_seen_query 2020-02-26 12:08:38 +00:00
Andrew Morgan 9b3ffa880b Drop unused tables (#6115) 2020-02-26 12:08:27 +00:00
Andrew Morgan 6eb622846a Edit SimpleHttpClient to reference that header keys can be passed as str or bytes (#6077) 2020-02-26 12:08:03 +00:00
Andrew Morgan 31c75f338a Merge pull request #6125 from matrix-org/babolivier/deactivation-invite 2020-02-26 12:07:37 +00:00
Andrew Morgan 90900898ad Move lookup-related functions from RoomMemberHandler to IdentityHandler (#5978) 2020-02-26 12:03:29 +00:00
Andrew Morgan 4bd6778bb8 Merge pull request #6108 from matrix-org/erikj/remove_get_user_by_req-span 2020-02-25 17:58:19 +00:00
Andrew Morgan 6e620befc7 Merge pull request #6117 from matrix-org/erikj/fix_sample_config 2020-02-25 17:58:12 +00:00
Andrew Morgan 27b0cab129 Kill off half-implemented password-reset via sms (#6101) 2020-02-25 17:58:00 +00:00
Andrew Morgan 629a343c55 Explicitly log when a homeserver does not have a trusted key server configured (#6090) 2020-02-25 17:55:36 +00:00
Andrew Morgan 03bcf475af Merge commit '1b23f991a' into release-v1.4.0 2020-02-25 17:55:22 +00:00
Andrew Morgan e4e113aebf bump version 2020-02-25 17:55:06 +00:00
Andrew Morgan eba1b9c156 Fix dummy event insertion consent bug (#6053) 2020-02-25 17:54:48 +00:00
Andrew Morgan f6d3b67360 Merge pull request #6098 from matrix-org/erikj/cleanup_user_ips_2 2020-02-25 17:54:41 +00:00
Andrew Morgan 41e59e6ac3 Merge pull request #6089 from matrix-org/erikj/cleanup_user_ips 2020-02-25 17:54:30 +00:00
Andrew Morgan ba03d648c9 Enable cleaning up extremities with dummy events by default to prevent undue build up of forward extremities. (#5884) 2020-02-25 17:54:12 +00:00
Andrew Morgan 4c42e1a042 Stop advertising unsupported flows for registration (#6107) 2020-02-25 17:53:48 +00:00
Andrew Morgan e9387cea79 Refactor the user-interactive auth handling (#6105) 2020-02-25 17:53:22 +00:00
Andrew Morgan b979833dbc Refactor code for calculating registration flows (#6106) 2020-02-25 17:50:27 +00:00
Andrew Morgan 1573e9aec1 Merge pull request #6092 from matrix-org/babolivier/background_update_deactivated_return 2020-02-25 17:47:27 +00:00
Andrew Morgan c36cf3c159 Merge pull request #6037 from matrix-org/rav/saml_mapping_work 2020-02-25 17:47:19 +00:00
Andrew Morgan 6d09abcd6e remove unused parameter to get_user_id_by_threepid (#6099) 2020-02-25 17:47:07 +00:00
Andrew Morgan c8561e51b3 Merge pull request #6069 from matrix-org/rav/fix_attribute_mapping 2020-02-25 17:46:58 +00:00
Andrew Morgan c1dad6483d Add sid to next_link for email validation (#6097) 2020-02-25 17:46:48 +00:00
Andrew Morgan cb063ade7c Add submit_url response parameter to msisdn /requestToken (#6079) 2020-02-25 17:46:40 +00:00
Andrew Morgan 64c058b206 Add an unstable feature flag for separate add/bind 3pid APIs (#6044) 2020-02-25 17:46:30 +00:00
Andrew Morgan 838c0ab9d4 Merge pull request #6064 from matrix-org/rav/saml_config_cleanup 2020-02-25 17:46:22 +00:00
Andrew Morgan e034f14fca Use the federation blacklist for requests to untrusted Identity Servers (#6000) 2020-02-25 17:46:09 +00:00
Andrew Morgan eab8a2e57c Add m.id_access_token to /versions unstable_features (MSC2264) (#5974) 2020-02-25 16:40:50 +00:00
Andrew Morgan 4087bf2c37 Add m.require_identity_server to /versions unstable_flags (#5972) 2020-02-25 16:40:41 +00:00
Andrew Morgan 50f6a18eaf Add POST submit_token endpoint for MSISDN (#6078) 2020-02-25 16:40:13 +00:00
Andrew Morgan b4c2acd7af Implement MSC2290 (#6043) 2020-02-25 15:42:28 +00:00
Andrew Morgan 7011048d37 Disable /register/available if registration is disabled (#6082) 2020-02-25 15:21:39 +00:00
Andrew Morgan ca70d6abd8 Generalize email sending logging (#6075) 2020-02-25 15:21:31 +00:00
Andrew Morgan 12af344241 Return timeout error to user for identity server calls (#6073) 2020-02-25 15:21:15 +00:00
Andrew Morgan c1700df2d7 Merge pull request #6072 from matrix-org/rav/fix_retry_reset 2020-02-25 15:21:05 +00:00
Andrew Morgan 89c6910adb Allow HS to send emails when adding an email to the HS (#6042) 2020-02-25 15:19:43 +00:00
Andrew Morgan 3dbfba03f9 Remove trailing slash ability from password reset's submit_token endpoint (#6074) 2020-02-25 14:45:00 +00:00
Andrew Morgan 9887aea599 Ensure email validation link parameters are URL-encoded (#6063) 2020-02-25 14:44:44 +00:00
Andrew Morgan 3fbf00399d Drop support for bind param on POST /account/3pid (MSC2290) (#6067) 2020-02-25 14:44:14 +00:00
Andrew Morgan b8072a612b Docker: support SYNAPSE_WORKER envvar (#6058) 2020-02-25 14:41:25 +00:00
Andrew Morgan cf4daf2c56 Use unstable prefix for 3PID unbind API (#6062) 2020-02-25 14:41:16 +00:00
Andrew Morgan 058d7671b8 Update the upgrade notes (#6050) 2020-02-25 14:41:04 +00:00
Andrew Morgan 5cb42aa08d Update the issue template for new way of getting server version (#6051) 2020-02-25 14:40:53 +00:00
Andrew Morgan 6cd724afa9 Add some notes on rolling back to v1.3.1. (#6049) 2020-02-25 14:40:43 +00:00
Andrew Morgan f74639cf07 Undo the deletion of some tables (#6047) 2020-02-25 14:40:36 +00:00
Andrew Morgan bd3a6f66a8 Remove POST method from password reset submit_token endpoint (#6056) 2020-02-25 14:40:12 +00:00
Andrew Morgan 3d05c29909 Update INSTALL.md with void-linux (#5873) 2020-02-25 14:35:13 +00:00
Andrew Morgan 8fb18d87a1 Fix typo in account_threepid_delegates config (#6028) 2020-02-25 14:35:05 +00:00
Andrew Morgan 132c86751f Give appropriate exit codes when synctl fails (#5992) 2020-02-25 14:34:55 +00:00
Andrew Morgan a8c8d1f64d Fix logcontext spam on non-Linux platforms (#6059) 2020-02-25 14:34:47 +00:00
Andrew Morgan 57967fc805 v2 3PID Invites (part of MSC2140) (#5979) 2020-02-25 14:34:23 +00:00
Andrew Morgan 672f630a1e (#5849) Convert rst to markdown (#6040) 2020-02-25 14:28:41 +00:00
Andrew Morgan c0648d6842 Fix race condition in room stats. (#6029) 2020-02-25 14:28:34 +00:00
Andrew Morgan 74912d4eab Add 'failure_ts' column to 'destinations' table (#6016) 2020-02-25 14:28:24 +00:00
Andrew Morgan e1f4c52e88 Fix well-known lookups with the federation certificate whitelist (#5997) 2020-02-25 14:28:16 +00:00
Andrew Morgan 1f510be000 Add developer docs for using SAML without a server (#6032) 2020-02-25 14:28:06 +00:00
Andrew Morgan 9a784c90de add explanations on how to actually include an access_token (#6031) 2020-02-25 14:27:56 +00:00
Andrew Morgan e31b7a5126 README: link to reverse_proxy.rst (#6027) 2020-02-25 14:27:46 +00:00
Andrew Morgan 15a9ca24aa Fix for structured logging tests stomping on logs (#6023) 2020-02-25 14:27:36 +00:00
Andrew Morgan 7cb31695ea Remove the cap on federation retry interval. (#6026) 2020-02-25 14:27:28 +00:00
Andrew Morgan d8e34ad17f Fix bug in calculating the federation retry backoff period (#6025) 2020-02-25 14:27:19 +00:00
Andrew Morgan 1b2c568aaa Merge pull request #6024 from matrix-org/dbkr/fix_sso_fallback_login 2020-02-25 14:27:10 +00:00
Andrew Morgan 057be54878 add report_stats_endpoint config option (#6012) 2020-02-25 14:26:42 +00:00
Andrew Morgan 7fcffa3bf3 Blow up config if opentracing is missing (#5985) 2020-02-25 14:22:34 +00:00
Andrew Morgan 9b9dfc2766 Merge pull request #6020 from matrix-org/jaywink/allow-support-users-to-register 2020-02-25 14:22:17 +00:00
Andrew Morgan dd6151170b Use the v2 Identity Service API for lookups (MSC2134 + MSC2140) (#5976) 2020-02-25 14:22:01 +00:00
Andrew Morgan 1dfbad8f10 Merge pull request #6015 from matrix-org/erikj/ratelimit_admin_redaction 2020-02-25 13:57:56 +00:00
Andrew Morgan df6b12008a Clean up some code in the retry logic (#6017) 2020-02-25 13:47:01 +00:00
Andrew Morgan 16bf01bf7d Add note about extra arg to send_membership_event, remove arg in remote_reject_invite (#6009) 2020-02-25 13:46:16 +00:00
Andrew Morgan c5d6fcc949 Check dependencies on setup in the nicer way. (#5989) 2020-02-25 13:45:58 +00:00
Andrew Morgan 136caf4221 Fix existing v2 identity server calls (MSC2140) (#6013) 2020-02-25 13:45:26 +00:00
Andrew Morgan a2e8eede64 Remove origin parameter from add_display_name_to_third_party_invite and add params to docstring (#6010) 2020-02-25 12:16:00 +00:00
Andrew Morgan b36ecd4687 Merge pull request #6011 from matrix-org/anoa/fix_3pid_validation 2020-02-25 12:14:38 +00:00
Andrew Morgan e75de4107d Merge pull request #6004 from matrix-org/jaywink/autojoin-create-real-users 2020-02-25 11:53:22 +00:00
Andrew Morgan 6bedb3fe1c Merge pull request #5934 from matrix-org/erikj/censor_redactions 2020-02-25 11:41:35 +00:00
Andrew Morgan 0a3f3e30c4 Add a build info metric to Prometheus (#6005) 2020-02-25 11:37:27 +00:00
Andrew Morgan f7ae2c7070 Merge pull request #6003 from matrix-org/erikj/push_opentracing 2020-02-25 11:37:18 +00:00
Andrew Morgan 87856c6aa9 Servers-known-about statistic (#5981) 2020-02-25 11:37:02 +00:00
Andrew Morgan d071a1c6d8 Ensure a sid parameter is passed to bind_threepid (#5995) 2020-02-25 11:36:52 +00:00
Andrew Morgan 4f378819eb Merge pull request #5998 from matrix-org/erikj/fixup_federate_flag 2020-02-25 11:36:42 +00:00
Andrew Morgan 5a1bdf2e90 Merge pull request #5993 from matrix-org/anoa/worker_store_reg 2020-02-25 11:36:29 +00:00
Andrew Morgan df5db3f293 Merge pull request #5994 from matrix-org/anoa/html_template_fix 2020-02-25 11:36:21 +00:00
Andrew Morgan 89f544ffd5 Merge pull request #5991 from matrix-org/erikj/fix_tracing_funcs 2020-02-25 11:36:11 +00:00
Andrew Morgan 3c34ddab01 Remove extraneous unittest.DEBUG's 2020-02-25 11:36:04 +00:00
Andrew Morgan 3c9aa144c1 Allow Synapse to send registration emails + choose Synapse or an external server to handle 3pid validation (#5987) 2020-02-25 11:34:32 +00:00
Andrew Morgan 6f0aa971a6 Trace how long it takes for the send trasaction to complete, including retrys (#5986) 2020-02-25 11:20:57 +00:00
Andrew Morgan e7f1f2a02d Gracefully handle log context slips and missing opentracing import errors. (#5988) 2020-02-25 11:20:47 +00:00
Andrew Morgan f4ac131ec1 Merge pull request #5984 from matrix-org/joriks/opentracing_link_send_to_edu_contexts 2020-02-25 11:20:24 +00:00
Andrew Morgan 256e9fd38d Add opentracing to all client servlets (#5983) 2020-02-25 11:14:21 +00:00
Andrew Morgan 476932cdef Increase expected state events in tests for new room by one 2020-02-25 11:14:11 +00:00
Andrew Morgan e7ad777c84 Switch to using v2 Identity Service APIs other than lookup (MSC 2140) (#5892) 2020-02-25 10:43:23 +00:00
Andrew Morgan f9dfe7f048 Fix opentracing contexts missing from outbound replication requests (#5982) 2020-02-25 10:17:27 +00:00
Andrew Morgan d7252d98bd Add POST /_matrix/client/r0/account/3pid/unbind (MSC2140) (#5980) 2020-02-25 10:17:18 +00:00
Andrew Morgan 394ec9c509 Remove bind_email and bind_msisdn (#5964) 2020-02-25 10:17:07 +00:00
Andrew Morgan 92625177c7 Cleanup event auth type initialisation (#5975) 2020-02-25 10:16:58 +00:00
Andrew Morgan 91e030ae12 Fix and refactor room and user stats (#5971) 2020-02-25 10:16:48 +00:00
Andrew Morgan 48cea251cf Ensure the list media admin API is always available (#5966) 2020-02-25 10:16:35 +00:00
Andrew Morgan e400097f69 Docker packaging should not su-exec or chmod if already running as UID/GID (#5970) 2020-02-25 10:16:26 +00:00
Andrew Morgan a8c2c547ce Ensure an auth instance is available to ListMediaInRoom (#5967) 2020-02-25 10:16:17 +00:00
Andrew Morgan bf7b7a8e23 Remove double return statements (#5962) 2020-02-25 10:10:57 +00:00
Andrew Morgan 2b3f54ae90 Opentrace device lists (#5853) 2020-02-25 10:10:45 +00:00
Andrew Morgan 5a60a5399e Remove unused methods from c/s api v1 in register.py (#5963) 2020-02-24 18:03:45 +00:00
Andrew Morgan 49758a1f67 fix thumbnail storage location (#5915) 2020-02-24 17:55:25 +00:00
Andrew Morgan b30e486587 Update INSTALL.md to say that Python 2 is no longer supported (#5953) 2020-02-24 17:55:15 +00:00
Andrew Morgan 0b2375dbbb Revert "Add m.id_access_token flag (#5930)" (#5945) 2020-02-24 17:55:03 +00:00
Andrew Morgan 6c058e3206 Remove unnecessary parentheses around return statements (#5931) 2020-02-24 17:54:53 +00:00
Amber Brown 470d4e220c Move buildkite config to the pipelines repo (#5943)
Note: I kept it in the repo for now ~anoa
2020-02-24 17:32:38 +00:00
Andrew Morgan 403e359702 Add m.id_access_token flag (#5930)
Adds a flag to `/versions`' `unstable_features` section indicating that this Synapse understands what an `id_access_token` is, as per https://github.com/matrix-org/synapse/issues/5927#issuecomment-523566043

Fixes #5927
2020-02-24 17:30:49 +00:00
Amber Brown bcb1cf6401 Removed unused jenkins/ folder and script (#5938) 2020-02-24 17:30:17 +00:00
Andrew Morgan 3a59bd253e Revert "Use the v2 lookup API for 3PID invites (#5897)"
This reverts commit 978f263e7c, reversing
changes made to 4f6ee99818.
2020-02-24 17:23:46 +00:00
Andrew Morgan 686d3d6213 Fix coverage in sytest and use plugins for buildkite (#5922) 2020-02-24 17:19:36 +00:00
Andrew Morgan 88c5b43d13 Add a link to python's logging config schema (#5926) 2020-02-24 17:19:20 +00:00
Andrew Morgan 3d5f1ebf06 Merge pull request #5902 from matrix-org/hs/exempt-support-users-from-consent 2020-02-24 17:19:09 +00:00
Andrew Morgan 122d08b6ff Let synctl use a config directory. (#5904) 2020-02-24 17:18:53 +00:00
Andrew Morgan 978f263e7c Use the v2 lookup API for 3PID invites (#5897) 2020-02-24 17:15:16 +00:00
Andrew Morgan 4f6ee99818 Config templating (#5900) 2020-02-21 11:38:45 +00:00
Andrew Morgan 35a521bd6f Implement a structured logging output system. (#5680) 2020-02-21 11:38:13 +00:00
Andrew Morgan 41992a2e00 Fix a cache-invalidation bug for worker-based deployments (#5920) 2020-02-21 11:32:54 +00:00
Andrew Morgan 587b9c25b1 Merge pull request #5914 from matrix-org/rei/admin_getadmin 2020-02-21 11:32:47 +00:00
Andrew Morgan 74a90a04d3 Typographical corrections in docker/README (#5921) 2020-02-21 11:32:39 +00:00
Andrew Morgan 563e169345 Merge pull request #5859 from matrix-org/rei/msc2197 2020-02-21 11:32:29 +00:00
Andrew Morgan 0c67c66e4f Merge pull request #5864 from matrix-org/erikj/reliable_lookups 2020-02-21 11:32:21 +00:00
Andrew Morgan e052861173 Allow schema deltas to be engine-specific (#5911) 2020-02-21 11:32:11 +00:00
Andrew Morgan 3df534ca40 Merge pull request #5906 from matrix-org/neilj/increase_display_name_limit 2020-02-21 11:32:00 +00:00
Andrew Morgan 265bcb1e68 Merge pull request #5895 from matrix-org/erikj/notary_key 2020-02-21 11:31:53 +00:00
Andrew Morgan 2b62e3ffba Merge pull request #5909 from aaronraimist/public_base_url 2020-02-21 11:31:45 +00:00
Andrew Morgan a7a669b4de Add Admin API capability to set adminship of a user (#5878) 2020-02-21 11:31:28 +00:00
Andrew Morgan cd2c684dbb Propagate opentracing contexts through EDUs (#5852) 2020-02-21 11:24:51 +00:00
Andrew Morgan d0cde0f655 Merge pull request #5877 from Awesome-Technologies/remove_shared_secret_registration 2020-02-21 11:22:20 +00:00
Andrew Morgan 3a80d39f93 Opentracing across workers (#5771) 2020-02-21 11:01:58 +00:00
Andrew Morgan 12e21b5a80 Merge pull request #5850 from matrix-org/erikj/retry_well_known_on_fail 2020-02-21 11:01:35 +00:00
Andrew Morgan a34d22c4d0 Opentrace e2e keys (#5855) 2020-02-21 11:01:23 +00:00
Andrew Morgan 5152882b32 Add missing index on users_in_public_rooms. (#5894) 2020-02-21 11:01:16 +00:00
Andrew Morgan 5a60e070fe Servlet to purge old rooms (#5845) 2020-02-21 11:01:08 +00:00
Andrew Morgan 51a0fa50ce Improve error msg when key-fetch fails (#5896) 2020-02-21 11:00:59 +00:00
Andrew Morgan 959ce07be4 Drop some unused tables. (#5893) 2020-02-21 11:00:47 +00:00
Andrew Morgan 7d03cd449e Refactor the Appservice scheduler code (#5886) 2020-02-21 10:51:25 +00:00
Andrew Morgan d0418ba466 Avoid deep recursion in appservice recovery (#5885) 2020-02-21 10:51:17 +00:00
Andrew Morgan 6d64000d4c Opentracing doc update (#5776) 2020-02-21 10:51:09 +00:00
Andrew Morgan b32ae21dcb Merge pull request #5860 from matrix-org/erikj/update_5704_comments 2020-02-21 10:50:42 +00:00
Andrew Morgan 01479bd552 Merge branch 'master' into develop 2020-02-20 16:07:31 +00:00
Andrew Morgan e1656b07e3 1.3.1 2020-02-20 16:07:13 +00:00
Andrew Morgan d8b348cdd2 Drop dependency on sdnotify (#5871) 2020-02-20 16:07:05 +00:00
Andrew Morgan 57b004574d Merge pull request #5857 from matrix-org/uhoreg/fix_e2e_room_keys_index 2020-02-20 16:06:58 +00:00
Andrew Morgan cdf750805a Opentracing misc (#5856) 2020-02-20 16:06:47 +00:00
Andrew Morgan 6cb514c1a6 Fix up password reset template config names (#5863) 2020-02-20 16:06:38 +00:00
Andrew Morgan 7a9236a71c 1.3.0 2020-02-20 16:06:23 +00:00
Andrew Morgan 4f729a7419 Remove libsqlite3-dev from required build dependencies. (#5766) 2020-02-20 16:06:15 +00:00
Andrew Morgan 0b57f0de3f Merge pull request #5851 from matrix-org/rei/roomdir_maybedeferred 2020-02-20 16:05:55 +00:00
Andrew Morgan 96efc4d179 Don't create broken room when power_level_content_override.users does not contain creator_id. (#5633) 2020-02-20 16:05:22 +00:00
Andrew Morgan 480d7e2cac Merge pull request #5844 from matrix-org/erikj/retry_well_known_lookup 2020-02-20 16:00:11 +00:00
Andrew Morgan c08ce16b00 1.3.0rc1 2020-02-20 16:00:02 +00:00
Andrew Morgan d3d29fd596 Merge pull request #5848 from matrix-org/hawkowl/fix-mediarepo-worker-startup 2020-02-20 15:59:54 +00:00
Andrew Morgan 65c59f31bb Merge pull request #5809 from matrix-org/erikj/handle_pusher_stop 2020-02-20 15:59:46 +00:00
Andrew Morgan 57c2254daa Don't load the media repo when configured to use an external media repo (#5754) 2020-02-20 15:59:36 +00:00
Andrew Morgan 2a2111708f Merge pull request #5836 from matrix-org/erikj/lower_bound_ttl_well_known 2020-02-20 15:59:29 +00:00
Andrew Morgan ba68fd2ccc Merge pull request #5826 from matrix-org/erikj/reduce_event_pauses 2020-02-20 15:59:20 +00:00
Andrew Morgan 6eb66cd7b9 Cross-signing [1/4] -- hidden devices (#5759) 2020-02-20 15:59:10 +00:00
Andrew Morgan 59ad464464 Merge pull request #5843 from matrix-org/erikj/workers_hist_vis 2020-02-20 15:59:01 +00:00
Andrew Morgan b8c92399b9 Merge pull request #5839 from tcitworld/fix-purge-remote-media-script 2020-02-20 15:58:54 +00:00
Andrew Morgan 408959c9d9 Merge pull request #5788 from matrix-org/rav/metaredactions 2020-02-20 15:58:43 +00:00
Andrew Morgan c24b899d5a Merge pull request #5825 from matrix-org/erikj/fix_empty_limited_sync 2020-02-20 15:58:17 +00:00
Andrew Morgan e0333c9bcd Return 404 instead of 403 when retrieving an event without perms (#5798) 2020-02-20 15:58:09 +00:00
Andrew Morgan 27251dbbe6 Account validity: allow defining HTML templates to serve the us… (#5807) 2020-02-20 15:57:39 +00:00
Andrew Morgan 7fbc573c4a Merge pull request #5810 from matrix-org/erikj/no_server_reachable 2020-02-20 15:49:40 +00:00
Andrew Morgan 0d0b430410 Have ClientReaderSlavedStore inherit RegistrationStore (#5806) 2020-02-20 15:49:32 +00:00
Andrew Morgan 6e7f378644 Merge pull request #5808 from matrix-org/erikj/parse_decode_error 2020-02-20 15:49:23 +00:00
Andrew Morgan e7ffd4a783 Merge pull request #5805 from matrix-org/erikj/validate_state 2020-02-20 15:49:15 +00:00
Andrew Morgan 233743a408 Merge pull request #5801 from matrix-org/erikj/recursive_tombstone 2020-02-20 15:49:08 +00:00
Andrew Morgan d6f7efaa0c Merge pull request #5802 from matrix-org/erikj/deny_redacting_different_room 2020-02-20 15:48:59 +00:00
Andrew Morgan 9d0cc25ba9 Merge pull request #5790 from matrix-org/erikj/groups_request_errors 2020-02-20 15:48:52 +00:00
Andrew Morgan ee0bb90a23 Merge pull request #5804 from matrix-org/erikj/match_against_state_key 2020-02-20 15:48:44 +00:00
Andrew Morgan 83ff056228 Change user deactivated errcode to USER_DEACTIVATED and use it (#5686) 2020-02-20 15:47:36 +00:00
Andrew Morgan d3e927bcbb Merge pull request #5794 from matrix-org/erikj/share_ssl_options_for_well_known 2020-02-20 15:44:08 +00:00
Andrew Morgan f04902acb8 Remove DelayedCall debugging from test runs (#5787) 2020-02-20 15:43:32 +00:00
Andrew Morgan 6067698906 Merge pull request #5796 from matrix-org/erikj/disable_codecov_report 2020-02-20 15:43:23 +00:00
Andrew Morgan 7f38706f18 Merge pull request #5793 from matrix-org/erikj/fix_bg_update 2020-02-20 15:43:10 +00:00
Andrew Morgan d0b8e90ac7 Merge pull request #5792 from matrix-org/erikj/fix_bg_update 2020-02-20 15:43:01 +00:00
Andrew Morgan e6b6281122 Merge pull request #5789 from matrix-org/erikj/fix_error_handling_keys 2020-02-20 15:41:49 +00:00
Andrew Morgan bab6f6052c Merge pull request #5746 from matrix-org/erikj/test_bg_update_currnet_state 2020-02-20 15:41:31 +00:00
Andrew Morgan b7424f4943 Remove non-functional 'expire_access_token' setting (#5782) 2020-02-20 15:41:21 +00:00
Andrew Morgan d478a36ae4 Room Complexity Client Implementation (#5783) 2020-02-20 15:41:08 +00:00
Andrew Morgan 2765c80376 Merge pull request #5774 from matrix-org/erikj/fix_rejected_membership 2020-02-20 15:40:59 +00:00
Andrew Morgan e18528a059 Merge pull request #5752 from matrix-org/erikj/forgotten_user 2020-02-20 15:40:51 +00:00
Andrew Morgan cfa8e2c554 Merge pull request #5770 from matrix-org/erikj/fix_current_state_event_sqlite 2020-02-20 15:39:22 +00:00
Andrew Morgan 1fb5b9c09d Update the device list cache when keys/query is called (#5693) 2020-02-20 15:38:32 +00:00
Andrew Morgan 5a4f72ab94 Fix debian packages for sid being called buster. (#5775) 2020-02-20 15:18:36 +00:00
Andrew Morgan 1ab4dac3d7 Merge pull request #5780 from matrix-org/baboliver/loopingcall-args 2020-02-20 15:18:26 +00:00
Andrew Morgan 6aea5db0a2 Merge branch 'master' into develop 2020-02-19 16:07:20 +00:00
Andrew Morgan bdcb8f47fc yet more changelog attribution fixes 2020-02-19 16:07:13 +00:00
Andrew Morgan 0d163652e9 1.2.1 2020-02-19 16:06:57 +00:00
Andrew Morgan c89770f0e6 Merge branch 'erikj/log_leave_origin_mismatch' into release-v1.2.1 2020-02-19 16:06:06 +00:00
Andrew Morgan 471a6b1b56 Convert RedactionTestCase to modern test style (#5768) 2020-02-19 16:05:44 +00:00
Andrew Morgan f945474952 Merge pull request #5767 from matrix-org/rav/redactions/cross_room_id 2020-02-19 16:05:34 +00:00
Andrew Morgan c544308db4 Fix some error cases in the caching layer. (#5749) 2020-02-19 16:05:16 +00:00
Andrew Morgan f7bf143f5d Merge branch 'master' into develop 2020-02-19 15:14:59 +00:00
Andrew Morgan 2569fdf82b 1.2.0 2020-02-19 15:14:49 +00:00
Andrew Morgan 01d1c028e0 Merge tag 'v1.2.0rc2' into develop 2020-02-19 15:13:44 +00:00
Andrew Morgan 39c3119c69 1.2.0rc2 2020-02-19 15:13:36 +00:00
Andrew Morgan 915d3d680a Merge pull request #5743 from matrix-org/erikj/log_origin_receipts_mismatch 2020-02-19 15:13:27 +00:00
Andrew Morgan 88c330362e Stop trying to fetch events with event_id=None. (#5753) 2020-02-19 15:13:17 +00:00
Andrew Morgan bc34ac53ec Fix servlet metric names (#5734) 2020-02-19 15:13:08 +00:00
Andrew Morgan 4b9bb9eeeb Add a prometheus metric for active cache lookups. (#5750) 2020-02-19 15:12:58 +00:00
Andrew Morgan ab051a1555 Make Jaeger fully configurable (#5694) 2020-02-19 15:12:49 +00:00
Andrew Morgan f590f77a16 Replace returnValue with return (#5736) 2020-02-19 15:11:59 +00:00
Andrew Morgan 2f270e23d3 Opentracing Utils (#5722) 2020-02-19 11:51:40 +00:00
Andrew Morgan 12d48e5ffa Merge pull request #5732 from matrix-org/erikj/sdnotify 2020-02-19 11:51:33 +00:00
Andrew Morgan b073cb7d7e Merge pull request #5740 from matrix-org/erikj/worker_flakey_tests 2020-02-19 11:51:25 +00:00
Andrew Morgan 812138addd Merge pull request #5738 from matrix-org/erikj/faster_update 2020-02-19 11:51:14 +00:00
Andrew Morgan eddeb3bb4b Merge pull request #5733 from matrix-org/erikj/exlude_sytest_blacklist 2020-02-19 11:51:05 +00:00
Andrew Morgan 383acba5b6 Fix logging in workers (#5729) 2020-02-19 11:50:54 +00:00
Andrew Morgan 925b74c109 Merge pull request #5730 from matrix-org/erikj/cache_versions 2020-02-19 11:50:45 +00:00
Andrew Morgan a47d9525c7 Merge pull request #5731 from matrix-org/jaywink/admin-user-list-user-type 2020-02-19 11:50:36 +00:00
Andrew Morgan 1e37fbb316 Update changelog.d/5730.misc 2020-02-19 11:50:29 +00:00
Andrew Morgan bf6300e0a1 Fix stack overflow in Keyring (#5724) 2020-02-19 11:50:18 +00:00
Andrew Morgan b7dfd5637f Merge tag 'v1.2.0rc1' into develop 2020-02-19 11:49:57 +00:00
Andrew Morgan 79ce67660b Newsfile 2020-02-19 11:49:46 +00:00
Andrew Morgan b58caf0d0b Make changelog slightly more readable 2020-02-19 11:49:40 +00:00
Andrew Morgan 1459bed82a Cache get_version_string. 2020-02-19 11:49:32 +00:00
Andrew Morgan 6a38d246a8 1.2.0rc1 2020-02-19 11:49:16 +00:00
Andrew Morgan fb74f1d5ea Demo uses deprecated cli option (#5725) 2020-02-19 11:49:07 +00:00
Andrew Morgan 6a955cea2b Merge branch 'release-v1.2.0' into develop 2020-02-19 11:48:59 +00:00
Andrew Morgan 60d4ad3943 Revert "Remove deprecated 'verbose' cli arg" 2020-02-19 11:48:43 +00:00
Andrew Morgan a35758cde3 Opentracing Documentation (#5703) 2020-02-19 11:48:29 +00:00
Andrew Morgan 4f5f2a715b Merge pull request #5720 from matrix-org/erikj/transactions_upsert 2020-02-19 11:48:18 +00:00
Andrew Morgan 6c704197df Merge pull request #5713 from matrix-org/erikj/use_cache_for_filtered_state 2020-02-19 11:48:07 +00:00
Andrew Morgan 04d4c31447 Merge pull request #5706 from matrix-org/erikj/add_memberships_to_current_state 2020-02-19 11:47:39 +00:00
Andrew Morgan 11d91ee1bc Don't accept opentracing data from clients. (#5715) 2020-02-19 11:47:29 +00:00
Andrew Morgan b93f684205 Add 'rel' attribute to default welcome page. (#5695) 2020-02-19 11:47:18 +00:00
Andrew Morgan 4f890463af Update the coding style doc (#5719) 2020-02-19 11:47:08 +00:00
Andrew Morgan 3aafecf3fe Speed up the PostgreSQL unit tests (#5717) 2020-02-19 11:47:00 +00:00
Andrew Morgan 60af6ec568 Remove non-dedicated logging options and command line arguments (#5678) 2020-02-19 11:46:52 +00:00
Andrew Morgan 782bd79170 Clean up opentracing configuration options (#5712) 2020-02-19 11:46:38 +00:00
Andrew Morgan adb043107f Support Prometheus_client 0.4.0+ (#5636) 2020-02-19 11:46:23 +00:00
Andrew Morgan 005c26556b Remove the ability to query relations when the original event was redacted. (#5629) 2020-02-19 11:45:42 +00:00
Andrew Morgan 1b055eb24f Add background update for current_state_events.membership column 2020-02-19 11:45:25 +00:00
Andrew Morgan e11e02b84e Add membership column to current_state_events table. 2020-02-19 11:45:17 +00:00
Andrew Morgan a98f17a226 Convert synapse.federation.transport.server to async (#5689) 2020-02-19 11:45:08 +00:00
Andrew Morgan b194ac056c Ignore redactions of m.room.create events (#5701) 2020-02-19 11:44:59 +00:00
Andrew Morgan ae84a5146e Improve Depends specs in debian package. (#5675) 2020-02-19 11:44:48 +00:00
Andrew Morgan a27e991693 More refactoring in get_events_as_list (#5707) 2020-02-19 11:44:37 +00:00
Andrew Morgan 495616504e Fix redaction authentication (#5700) 2020-02-19 11:24:47 +00:00
Andrew Morgan 635af298b5 Refactor get_events_as_list (#5699) 2020-02-17 17:38:19 +00:00
Andrew Morgan 8c226ce0f9 Merge pull request #5597 from matrix-org/erikj/admin_api_cmd 2020-02-17 17:29:10 +00:00
Andrew Morgan e6ae24ec8b Return a different error from Invalid Password when a user is deactivated (#5674) 2020-02-17 17:28:38 +00:00
Andrew Morgan 29adbe8546 Merge pull request #5589 from matrix-org/erikj/admin_exfiltrate_data 2020-02-17 17:17:59 +00:00
Andrew Morgan 5c0ae4aa1a Add a docker type to the towncrier configuration (#5673) 2020-02-17 17:17:11 +00:00
Andrew Morgan 2f450fa149 Implement access token expiry (#5660) 2020-02-17 17:17:02 +00:00
Andrew Morgan 2ff678780d Update reverse_proxy.rst (#5397) 2020-02-17 17:16:48 +00:00
Andrew Morgan 2ee7b9bfee Add missing space in default logging file format generated by the Docker image (#5620) 2020-02-17 17:16:21 +00:00
Andrew Morgan 5667a24623 Upgrade Alpine Linux used in the Docker image (3.8 -> 3.10) (#5619) 2020-02-17 17:16:13 +00:00
Andrew Morgan f51c674437 Add a mechanism for per-test configs (#5657) 2020-02-17 17:16:03 +00:00
Andrew Morgan 333ae763d4 Use /src for checking out synapse during sytests (#5664) 2020-02-17 17:15:54 +00:00
Andrew Morgan d9dddad7f5 Improved docs on setting up Postgresql (#5661) 2020-02-17 17:15:41 +00:00
Andrew Morgan 32dd8ab9d9 small typo fix (#5655) 2020-02-17 17:14:50 +00:00
Andrew Morgan b5844ad699 Clean up exception handling for access_tokens (#5656) 2020-02-17 17:13:41 +00:00
Andrew Morgan 619b3cd875 Add basic opentracing support (#5544) 2020-02-17 16:51:09 +00:00
Andrew Morgan ade1224b84 Inline issue_access_token (#5659) 2020-02-17 16:50:59 +00:00
Andrew Morgan 84a1465332 Merge pull request #5658 from matrix-org/babolivier/is-json 2020-02-17 16:50:01 +00:00
Andrew Morgan ee2de6734b Remove access-token support from RegistrationStore.register (#5642) 2020-02-17 16:36:11 +00:00
Andrew Morgan 432e087c77 Don't bundle aggregations when retrieving the original event (#5654) 2020-02-17 16:35:58 +00:00
Andrew Morgan e88fb44997 Add a linting script (#5627) 2020-02-17 16:35:48 +00:00
Andrew Morgan bcf1aad7f1 Correct pep517 flag in readme (#5651) 2020-02-17 16:35:38 +00:00
Andrew Morgan d246c99947 Merge pull request #5638 from matrix-org/babolivier/invite-json 2020-02-17 16:35:24 +00:00
Andrew Morgan 69cdd5976c remove unused and unnecessary check for FederationDeniedError (#5645) 2020-02-17 13:54:03 +00:00
Andrew Morgan 748ebe2fd5 Include the original event in /relations (#5626) 2020-02-17 13:53:53 +00:00
Andrew Morgan 2a59569a28 Merge pull request #5644 from matrix-org/babolivier/profile-allow-self 2020-02-17 13:53:37 +00:00
Andrew Morgan 5e752310be Remove access-token support from RegistrationHandler.register (#5641) 2020-02-17 13:41:58 +00:00
Andrew Morgan 07ca82cb7c Unblacklist some user_directory sytests (#5637) 2020-02-17 13:32:11 +00:00
Andrew Morgan a6118f0ccf Better logging for auto-join. (#5643) 2020-02-17 13:32:00 +00:00
Andrew Morgan 4ede3f07ad Update ModuleApi to avoid register(generate_token=True) (#5640) 2020-02-17 13:31:51 +00:00
Andrew Morgan 1af97bb33d Factor out some redundant code in the login impl (#5639) 2020-02-17 13:31:41 +00:00
Andrew Morgan 0f0c74493a Move get_or_create_user to test code (#5628) 2020-02-17 13:31:16 +00:00
Andrew Morgan 3a90f51534 Add a few more common environment directory names to black exclusion (#5630) 2020-02-17 13:22:14 +00:00
Andrew Morgan 0218fda167 Add default push rule to ignore reactions (#5623) 2020-02-17 13:22:06 +00:00
Andrew Morgan 4eb0bbad04 Add origin_server_ts and sender fields to m.replace (#5613) 2020-02-17 13:21:58 +00:00
Andrew Morgan dc0fdb86ba Remove support for invite_3pid_guest. (#5625) 2020-02-17 13:21:48 +00:00
Andrew Morgan 941322db9d remove dead transaction persist code (#5622) 2020-02-17 13:21:35 +00:00
Andrew Morgan 1a23d184e9 Fixes to the federation rate limiter (#5621) 2020-02-17 13:21:25 +00:00
Andrew Morgan 0e75150ae7 Make errors about email password resets much clearer (#5616) 2020-02-17 13:21:13 +00:00
Andrew Morgan 02ecaded47 Improve the backwards compatibility re-exports of synapse.logging.context (#5617) 2020-02-17 13:20:49 +00:00
Andrew Morgan e5aece85c5 Add a sytest blacklist file (#5611) 2020-02-17 11:45:44 +00:00
Andrew Morgan ca1d07362f Blacklist some flaky tests 2020-02-14 15:15:29 +00:00
Andrew Morgan e8761d7c7b Pin black to 19.3b0 2020-02-14 14:27:15 +00:00
Andrew Morgan 622d0be1b3 Fix with isort==4.3.21 and black==19.3b0 2020-02-14 14:27:12 +00:00
Andrew Morgan 018c7c40c2 Delete duplicate user deactivation 2020-02-14 12:55:49 +00:00
Andrew Morgan bc42b6e3f7 Fix account_validity incorrect email response content 2020-02-14 12:04:04 +00:00
Andrew Morgan a93027d3f0 Fix incorrect run_in_background import statement 2020-02-14 12:03:39 +00:00
Andrew Morgan c9aab2de34 Fix signedjson deleted method 2020-02-14 12:03:12 +00:00
Andrew Morgan 9ebf9fa32e Merge branch 'master' of github.com:matrix-org/synapse into develop 2020-02-14 11:06:21 +00:00
Andrew Morgan 0592e8c4c1 Update changelog 2020-02-14 11:06:12 +00:00
Andrew Morgan f56ac7e6be 1.1.0 2020-02-14 11:05:59 +00:00
Andrew Morgan 01b43c828b Merge pull request #5615 from matrix-org/anoa/fix_changelog_email_resets 2020-02-14 11:03:35 +00:00
Andrew Morgan 9abc8833c6 Suggest people use a config file for Docker instead of env vars 2020-02-14 11:03:25 +00:00
Andrew Morgan 41120db159 Move logging utilities out of the side drawer of util/ and into logging/ (#5606) 2020-02-14 11:02:55 +00:00
Andrew Morgan 4358b8dae4 Fix 'utime went backwards' errors on daemonization. (#5609) 2020-02-14 11:00:18 +00:00
Andrew Morgan 381afb6ef6 1.1.0rc2 2020-02-14 11:00:10 +00:00
Andrew Morgan 47b03318d1 Fix a number of "Starting txn from sentinel context" warnings (#5605) 2020-02-14 11:00:02 +00:00
Andrew Morgan e38aa86ac1 Remove SMTP_* env var functionality from docker conf (#5596) 2020-02-14 10:59:53 +00:00
Andrew Morgan 3c29cee8e9 Fix media repo breaking (#5593) 2020-02-14 10:59:44 +00:00
Andrew Morgan 2d1a546966 tweak changelog 2020-02-14 10:59:34 +00:00
Andrew Morgan 9f1ce7974a Merge remote-tracking branch 'origin/master' into release-v1.1.0 2020-02-14 10:59:24 +00:00
Andrew Morgan 908f93970e prepare v1.1.0rc1 2020-02-14 10:59:11 +00:00
Andrew Morgan 7d2d2a13fe Complete the SAML2 implementation (#5422) 2020-02-14 10:58:47 +00:00
Andrew Morgan a79563dc36 Merge pull request #5587 from matrix-org/erikj/fix_synctl 2020-02-14 10:58:39 +00:00
Andrew Morgan 48524d7bf6 Add ability to set timezone for Docker container (#5383) 2020-02-14 10:58:27 +00:00
Andrew Morgan 047abb9cd0 Fix JWT login with new users (#5586) 2020-02-14 10:58:18 +00:00
Andrew Morgan f7a85a4eeb fix async/await consentresource (#5585) 2020-02-14 10:58:09 +00:00
Andrew Morgan cca9f581b4 Merge pull request #5507 from matrix-org/erikj/presence_sync_tighloop 2020-02-14 10:57:57 +00:00
Andrew Morgan 65787fe811 Make the http server handle coroutine-making REST servlets (#5475) 2020-02-14 10:57:48 +00:00
Andrew Morgan 57199ee134 Merge pull request #5576 from matrix-org/babolivier/3pid-invite-ratelimit 2020-02-14 10:57:40 +00:00
Andrew Morgan 40d6f870b5 Don't log GC 0s at INFO (#5557) 2020-02-14 10:57:30 +00:00
Andrew Morgan 38e09af420 Update the TLS cipher string and provide configurability for TLS on outgoing federation (#5550) 2020-02-14 10:57:04 +00:00
Andrew Morgan 673d3f88fa Added possibilty to disable local password authentication (#5092) 2020-02-14 10:56:35 +00:00
Andrew Morgan d4d92ec88d Include systemd-python in Debian package to allow logging to journal (#5261) 2020-02-14 10:54:19 +00:00
Andrew Morgan 1dc4724059 Make it clearer that the template dir is relative to synapse's root dir (#5543) 2020-02-14 10:53:53 +00:00
Andrew Morgan 9b3dc0191b Merge pull request #5559 from matrix-org/erikj/refactor_changed_devices 2020-02-14 10:53:45 +00:00
Andrew Morgan 619ccfdabc Docker image: Add a migrate_config mode (#5567) 2020-02-14 10:53:35 +00:00
Andrew Morgan 39a9361704 Docker image: open the non-TLS port by default. (#5568) 2020-02-14 10:53:25 +00:00
Andrew Morgan 00b45cb704 Deprecate the env var way of running the docker image (#5566) 2020-02-14 10:53:15 +00:00
Andrew Morgan c2e1e0986e Fix JWT login (#5555) 2020-02-14 10:53:07 +00:00
Andrew Morgan d123aa866a Merge pull request #5565 from matrix-org/rav/docker/fix_log_config 2020-02-14 10:53:00 +00:00
Andrew Morgan bc56f9bc79 Reduce the amount of stuff we send in the docker context (#5564) 2020-02-14 10:52:51 +00:00
Andrew Morgan a51d866036 Merge pull request #5563 from matrix-org/rav/docker/data_dir 2020-02-14 10:52:43 +00:00
Andrew Morgan d7d827f57c Merge pull request #5562 from matrix-org/rav/docker/no-generate-keys 2020-02-14 10:52:35 +00:00
Andrew Morgan dc6de5302f Merge pull request #5561 from matrix-org/rav/docker/refactor 2020-02-14 10:52:21 +00:00
Andrew Morgan 2abb2e6448 Merge pull request #5570 from almereyda/patch-2 2020-02-14 10:52:12 +00:00
Andrew Morgan ef1e418034 Merge pull request #5313 from twrist/patch-1 2020-02-14 10:52:05 +00:00
Andrew Morgan 8f78803898 Merge pull request #5552 from matrix-org/rav/github_templates 2020-02-14 10:51:51 +00:00
Andrew Morgan 7094150931 Improve docs on choosing server_name (#5558) 2020-02-14 10:51:18 +00:00
Andrew Morgan bbb39634d6 Remove & changelog (#5548) 2020-02-14 10:51:03 +00:00
Andrew Morgan e44d102ee0 Prevent multiple upgrades on the same room at once (#5051) 2020-02-14 10:50:54 +00:00
Andrew Morgan 9178e5e2c1 Increase default log level for docker image to INFO. (#5547) 2020-02-14 10:48:14 +00:00
Andrew Morgan 575090b656 Update docker image to use Python 3.7. (#5546) 2020-02-14 10:48:03 +00:00
Andrew Morgan 03c6084025 Update changelog to better expain password reset change (#5545 2020-02-14 10:47:54 +00:00
Andrew Morgan bac9fa13dc Add info about black to code_style.rst (#5537) 2020-02-14 10:47:39 +00:00
Andrew Morgan ca2c8ea35a Merge pull request #5524 from matrix-org/rav/new_cmdline_options 2020-02-14 10:47:29 +00:00
Andrew Morgan 8ef47a3c54 Merge pull request #5523 from matrix-org/rav/arg_defaults 2020-02-14 10:47:06 +00:00
Andrew Morgan cb161ba137 Merge pull request #5499 from matrix-org/rav/cleanup_metrics 2020-02-14 10:32:18 +00:00
Andrew Morgan e7cd7d63e9 Merge pull request #5534 from matrix-org/babolivier/federation-publicrooms 2020-02-13 12:27:32 +00:00
Andrew Morgan bb298f378c Merge pull request #5531 from matrix-org/erikj/workers_pagination_token 2020-02-13 12:23:36 +00:00
Andrew Morgan 09deace1ca Merge pull request #5516 from matrix-org/rav/acme_key_path 2020-02-13 12:23:24 +00:00
Andrew Morgan 634f6a65cb Pass config_dir_path and data_dir_path into Config.read_config. (#5522) 2020-02-13 12:04:46 +00:00
Andrew Morgan c968e97b47 Factor acme bits out to a separate file (#5521) 2020-02-13 12:02:42 +00:00
Andrew Morgan 7f87ee1cb6 Merge pull request #5498 from matrix-org/rav/fix_clock_reversal 2020-02-13 12:02:26 +00:00
Andrew Morgan 975bf2c255 Drop support for cpu_affinity (#5525) 2020-02-13 11:59:56 +00:00
Andrew Morgan 28e3f9c234 Improve help and cmdline option names for --generate-config options (#5512) 2020-02-13 11:59:45 +00:00
Andrew Morgan 970e59fd9f Refactor Config parser and add some comments. (#5511) 2020-02-13 11:59:32 +00:00
Andrew Morgan a7686af1dd Improve logging when generating config files (#5510) 2020-02-13 11:59:23 +00:00
Andrew Morgan 7feac0e553 Only import jinja2 when needed (#5514) 2020-02-13 11:59:08 +00:00
Andrew Morgan 071b7ebb72 Fix "Unexpected entry in 'full_schemas'" log warning (#5509) 2020-02-13 11:58:59 +00:00
Andrew Morgan f6905719cf Fix logging error when a tampered event is detected. (#5500) 2020-02-13 11:58:46 +00:00
Andrew Morgan 22796d620f Merge pull request #5513 from matrix-org/erikj/fix_messages_token 2020-02-13 11:58:29 +00:00
Andrew Morgan 9523a4e05d Merge pull request #5505 from matrix-org/erikj/messages_worker 2020-02-13 11:58:08 +00:00
Andrew Morgan 09291d36dd Support pagination API in client_reader worker 2020-02-13 11:57:01 +00:00
Andrew Morgan 648c585977 Merge pull request #5476 from matrix-org/erikj/histogram_extremities 2020-02-13 11:56:51 +00:00
Andrew Morgan cbb10abd63 Improve email notification logging (#5502) 2020-02-13 11:56:40 +00:00
Andrew Morgan 0776f6529b Black 2020-02-13 11:42:49 +00:00
Andrew Morgan 28eba8747e Run Black. (#5482) 2020-02-13 11:30:15 +00:00
Andrew Morgan 0295abdcf7 Dinsic Blacking with black==18.6b2 2020-02-11 16:18:29 +00:00
Andrew Morgan acd9cf937b Merge pull request #5042 from matrix-org/erikj/fix_get_missing_events_error 2020-02-10 18:57:00 +00:00
Andrew Morgan f98c652b4e Merge pull request #5480 from matrix-org/erikj/extremities_dummy_events 2020-02-10 18:56:49 +00:00
Andrew Morgan 537fe5e331 Merge pull request #5490 from matrix-org/rav/xmlsec_in_docker 2020-02-10 18:56:30 +00:00
Andrew Morgan 801c40c5a5 Merge pull request #5493 from matrix-org/babolivier/deactivate_bg_job_typo 2020-02-10 18:55:43 +00:00
Andrew Morgan 2986f6de64 Merge pull request #4276 from Ralith/performance-advice 2020-02-10 18:55:30 +00:00
Andrew Morgan 104d23b853 Add some logging to 3pid invite sig verification (#5015) 2020-02-10 18:55:13 +00:00
Andrew Morgan 2649c99cf1 changelog 2020-02-10 18:55:05 +00:00
Andrew Morgan 71d52cca59 Include xmlsec in the docker image 2020-02-10 18:54:56 +00:00
Andrew Morgan a1e421affd README.rst: fix header level 2020-02-10 18:54:49 +00:00
Andrew Morgan 4b51f2d0f1 Fix logline 2020-02-10 18:54:41 +00:00
Andrew Morgan 36e848cd56 Merge branch 'develop' of github.com:matrix-org/synapse into erikj/fix_get_missing_events_error 2020-02-10 18:54:24 +00:00
Andrew Morgan e7fb671b7b Newsfile 2020-02-10 18:54:13 +00:00
Andrew Morgan c9eb99d25b Add experimental option to reduce extremities. 2020-02-10 18:54:03 +00:00
Andrew Morgan c38b54a802 Only count non-cache state resolution 2020-02-10 18:53:54 +00:00
Andrew Morgan 9b998d1d29 Use consistent buckets 2020-02-10 18:53:43 +00:00
Andrew Morgan bde5a6b0cc Fix seven contrib files with Python syntax errors (#5446) 2020-02-10 18:47:16 +00:00
Andrew Morgan 3c9b5d5903 Merge pull request #5477 from matrix-org/babolivier/third_party_rules_3pid 2020-02-10 18:35:45 +00:00
Andrew Morgan 1bce7212ee Merge pull request #5479 from matrix-org/erikj/add_create_room_hook_develop 2020-02-10 18:35:16 +00:00
Andrew Morgan 6e4b75ab69 Merge pull request #5478 from matrix-org/joriks/demo_python3 2020-02-10 17:57:28 +00:00
Andrew Morgan 1fc5a6e048 Merge commit '839f9b923' into dinsic-release-v1.1.0 2020-02-10 17:57:05 +00:00
Andrew Morgan 1114a42739 Remove Postgres 9.4 support (#5448) 2020-02-10 17:52:09 +00:00
Andrew Morgan 4c2ba4ef3a Merge pull request #5385 from matrix-org/erikj/reduce_http_exceptions 2020-02-10 17:01:20 +00:00
Andrew Morgan ecdc5752d4 Merge commit 'dd927b29e' into dinsic-release-v1.1.0 2020-02-10 16:53:36 +00:00
Andrew Morgan 9a269724a5 Merge pull request #5389 from matrix-org/erikj/renew_attestations_on_master 2020-02-10 16:53:23 +00:00
Andrew Morgan 8396268752 Move SyTest to Buildkite (#5459) 2020-02-10 16:53:11 +00:00
Andrew Morgan 29b4ea2fc4 Merge pull request #5464 from matrix-org/erikj/3pid_remote_invite_state 2020-02-10 16:47:16 +00:00
Andrew Morgan 0300c033e0 Merge pull request #5440 from matrix-org/babolivier/third_party_event_rules 2020-02-10 16:47:02 +00:00
Andrew Morgan 72c14cb133 Merge pull request #5461 from matrix-org/erikj/histograms_are_cumalitive 2020-02-10 16:39:29 +00:00
Andrew Morgan dd486836f7 Merge remote-tracking branch 'dinsic/dinsic' into dinsic-release-v1.1.0 2020-02-10 16:37:49 +00:00
Andrew Morgan 5f3fb66b57 Merge pull request #5465 from matrix-org/babolivier/fix_deactivation_bg_job 2020-02-10 16:00:39 +00:00
Andrew Morgan 49e9dc2600 Merge pull request #5462 from matrix-org/babolivier/account_validity_deactivated_accounts_2 2020-02-10 16:00:01 +00:00
Andrew Morgan 3ae03c7ed2 Merge pull request #5460 from matrix-org/joriks/demo_python3 2020-02-10 15:58:33 +00:00
Andrew Morgan e6a0f56811 Don't send renewal emails to deactivated users 2020-02-10 15:54:20 +00:00
Andrew Morgan 07d0da8922 Merge pull request #5390 from matrix-org/erikj/dont_log_on_fail_to_get_file 2020-02-10 15:09:47 +00:00
Andrew Morgan 979f3a5e03 Track deactivated accounts in the database (#5378) 2020-02-10 15:08:10 +00:00
Andrew Morgan fab5140c9d Use python3 in the demo 2020-02-10 14:51:10 +00:00
Andrew Morgan 0ed71e4e4b Merge pull request #5458 from matrix-org/hawkowl/fix-prometheus 2020-02-10 14:48:37 +00:00
Andrew Morgan 1dd17ff39f Updates to the federation_client script (#5447) 2020-02-10 14:43:47 +00:00
Andrew Morgan a27e00eb32 Clean up code for sending federation EDUs. (#5381) 2020-02-10 14:43:23 +00:00
Andrew Morgan 9efcd2da53 Expose statistics on extrems to prometheus (#5384) 2020-02-10 14:42:57 +00:00
Andrew Morgan 8ea4191636 Remove Python 2.7 support. (#5425) 2020-02-10 14:41:41 +00:00
Andrew Morgan cafeb5e0e7 Fix resetting password via a phone number (#21) 2020-01-24 15:23:31 +00:00
Andrew Morgan 0cc2594966 Validate client_secret parameter according to spec (#20) 2020-01-22 15:52:46 +00:00
Andrew Morgan f4d1ab0027 Add the ability to restrict max avatar filesize and content-type (#19) 2019-12-12 13:51:25 +00:00
Andrew Morgan c7e206b69b Add some flaky sytests to a sytest-blacklist (#17) 2019-12-09 15:17:07 +00:00
Andrew Morgan d49933470d Add limit_profile_requests_to_known_users option (#18) 2019-12-05 11:55:12 +00:00
Andrew Morgan 32b7e20d41 Fix scripts/generate_signing_key.py import statement (#15) 2019-12-03 10:49:29 +00:00
Andrew Morgan b69732705d Capatilise letters after a - in new user displaynames (#14) 2019-12-02 15:10:23 +00:00
Brendan Abolivier c3a2c8c768 Merge pull request #16 from matrix-org/babolivier/dinsic-state-retrieval
Discard retention policies when retrieving state
2019-11-29 14:25:52 +00:00
Brendan Abolivier 9cd241d070 Changelog 2019-11-29 11:37:11 +00:00
Brendan Abolivier f7b12c955b Discard retention policies when retrieving state
Purge jobs don't delete the latest event in a room in order to keep the forward extremity and not break the room. On the other hand, get_state_events, when given an at_token argument calls filter_events_for_client to know if the user can see the event that matches that (sync) token. That function uses the retention policies of the events it's given to filter out those that are too old from a client's view.

Some clients, such as Riot, when loading a room, request the list of members for the latest sync token it knows about, and get confused to the point of refusing to send any message if the server tells it that it can't get that information. This can happen very easily with the message retention feature turned on and a room with low activity so that the last event sent becomes too old according to the room's retention policy.

An easy and clean fix for that issue is to discard the room's retention policies when retrieving state.
2019-11-29 11:35:09 +00:00
Andrew Morgan c446f59047 Hide expired users from user directory, optionally show on renewal (#13) 2019-11-14 18:42:55 +00:00
Andrew Morgan 28578e7568 Add a /user/:user_id/info servlet to give user deactivated/expired information (#12) 2019-11-14 14:22:58 +00:00
Andrew Morgan d6b7606e07 Create configurable ratelimiter for 3pid invites (#11) 2019-11-12 11:38:35 +00:00
Brendan Abolivier b77369079c Merge pull request #10 from matrix-org/babolivier/dinsic-retention-visibility
Don't apply retention policy based filtering on state events
2019-11-11 13:44:01 +00:00
Brendan Abolivier f93e4b6a39 Changelog 2019-11-06 15:53:31 +00:00
Brendan Abolivier dfa60504af Don't apply retention policy based filtering on state events
As per MSC1763, 'Retention is only considered for non-state events.', so don't filter out state events based on the room's retention policy.
2019-11-06 15:47:40 +00:00
Richard van der Hoff 85f15ac592 Support for routing outbound HTTP requests via a proxy (#6239)
The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy.

The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`.

The proxy will then be used for
 * push
 * url previews
 * phone-home stats
 * recaptcha validation
 * CAS auth validation

It will *not* be used for:
 * Application Services
 * Identity servers
 * Outbound federation
 * In worker configurations, connections from workers to masters

Fixes #4198.
2019-11-01 14:22:46 +00:00
Brendan Abolivier 3e4527d796 Merge pull request #9 from matrix-org/babolivier/ci
Add SyTest to the BuildKite CI
2019-10-31 23:09:23 +00:00
Brendan Abolivier e6f0536de1 Remove python TAP script 2019-10-31 16:16:25 +00:00
Brendan Abolivier 0559c87007 Don't use test image 2019-10-31 15:49:15 +00:00
Brendan Abolivier 7467a8090c Remove CircleCI configuration 2019-10-23 17:37:50 +01:00
Brendan Abolivier 0263c044ff Move sytest jobs to the right location 2019-10-23 17:37:28 +01:00
Brendan Abolivier a4e4a9c93b Try running the workers job on bigger agents 2019-10-21 17:35:16 +01:00
Brendan Abolivier 73147f44fc Add py3 jobs on BuildKite 2019-10-18 15:25:45 +01:00
Brendan Abolivier c3c1add9f3 Add TAP formatting script 2019-10-18 14:52:57 +01:00
Brendan Abolivier 7a50b07bb4 Add workers to buildkite 2019-10-09 11:34:20 +01:00
Brendan Abolivier 1a58f6196f Try to run stuff on buildkite 2019-10-09 11:17:36 +01:00
Brendan Abolivier d6371916cc Actually use the right image 2019-10-09 11:08:30 +01:00
Brendan Abolivier c29182ce8a Add python3 jobs 2019-10-09 11:06:29 +01:00
Brendan Abolivier 7123f50c44 fix 2019-10-08 18:15:47 +01:00
Brendan Abolivier 9398f55982 Try to fix CircleCI 2019-10-08 17:38:03 +01:00
Brendan Abolivier 4d52ccf41f peek 2019-10-08 17:09:14 +01:00
Brendan Abolivier b77d92514e peek 2019-10-08 17:07:58 +01:00
Brendan Abolivier 60b4585403 peek 2019-10-08 16:51:18 +01:00
Brendan Abolivier 6bf5dbc5f2 peek 2019-10-08 16:47:18 +01:00
Brendan Abolivier 4150508759 peek 2019-10-08 16:45:04 +01:00
Brendan Abolivier a093ac6d86 peek 2019-10-08 16:40:15 +01:00
Brendan Abolivier 9ec8072a87 Temporarily move the sytest job before the wait 2019-10-08 16:35:08 +01:00
Brendan Abolivier 078c0638e3 peek 2019-10-08 16:33:17 +01:00
Brendan Abolivier c5eb8342b2 Try adding workers to CircleCI instead 2019-10-07 15:35:49 +01:00
Brendan Abolivier f38ad87384 Use mainline's merge_base_branch.sh 2019-10-07 13:03:08 +01:00
Brendan Abolivier 90f1eb3ee5 Changelog 2019-10-07 12:54:20 +01:00
Brendan Abolivier 9e1e5f8ed5 First attempt at running SyTest in buildkite 2019-10-07 12:52:02 +01:00
Brendan Abolivier 6b59493dfa Merge pull request #8 from matrix-org/babolivier/3pid-invite-revoked
Don't 500 when trying to exchange a revoked 3PID invite
2019-10-04 13:12:01 +01:00
Brendan Abolivier c49ba3677c Fixup tests 2019-10-04 12:21:33 +01:00
Brendan Abolivier 04d4fff806 Typo 2019-10-04 12:10:20 +01:00
Brendan Abolivier b0a350ef48 Lint 2019-10-04 12:10:20 +01:00
Brendan Abolivier eaec1d4ce7 Incorporate review 2019-10-04 12:10:20 +01:00
Brendan Abolivier d694546453 Lint (again) 2019-10-04 12:10:19 +01:00
Brendan Abolivier 06159a0ee7 Lint 2019-10-04 12:10:19 +01:00
Brendan Abolivier a6a55039a4 Add test case 2019-10-04 12:10:19 +01:00
Brendan Abolivier 1a01ca0774 Changelog 2019-10-04 12:10:19 +01:00
Brendan Abolivier 78d9b4a6e6 Lint 2019-10-04 12:10:19 +01:00
Brendan Abolivier dfcf4ba406 Don't 500 code when trying to exchange a revoked 3PID invite
While this is not documented in the spec (but should be), Riot (and other clients) revoke 3PID invites by sending a m.room.third_party_invite event with an empty ({}) content to the room's state.
When the invited 3PID gets associated with a MXID, the identity server (which doesn't know about revocations) sends down to the MXID's homeserver all of the undelivered invites it has for this 3PID. The homeserver then tries to talk to the inviting homeserver in order to exchange these invite for m.room.member events.
When one of the invite is revoked, the inviting homeserver responds with a 500 error because it tries to extract a 'display_name' property from the content, which is empty. This might cause the invited server to consider that the server is down and not try to exchange other, valid invites (or at least delay it).

This fix handles the case of revoked invites by avoiding trying to fetch a 'display_name' from the original invite's content, and letting the m.room.member event fail the auth rules (because, since the original invite's content is empty, it doesn't have public keys), which results in sending a 403 with the correct error message to the invited server.
2019-10-04 12:10:14 +01:00
Brendan Abolivier cd858afea6 Merge pull request #7 from matrix-org/babolivier/deactivation-invite
Reject pending invites on deactivation
2019-09-27 17:52:41 +01:00
Brendan Abolivier ce2448efbe Fix git messing up 2019-09-27 17:18:10 +01:00
Brendan Abolivier 04b779a6ac s/return/defer.returnValue/ 2019-09-27 17:06:12 +01:00
Brendan Abolivier 42409b3022 Incorporate review 2019-09-27 17:03:34 +01:00
Brendan Abolivier 5a207c1113 Update synapse/handlers/deactivate_account.py
Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2019-09-27 17:03:34 +01:00
Brendan Abolivier 0ae6c8efc1 Update synapse/handlers/deactivate_account.py
Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2019-09-27 17:03:34 +01:00
Brendan Abolivier 318fed18da Update changelog.d/6125.feature
Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2019-09-27 17:03:10 +01:00
Brendan Abolivier 97672c03e2 ok 2019-09-27 16:57:19 +01:00
Brendan Abolivier acf6b2388e Lint 2019-09-27 16:57:19 +01:00
Brendan Abolivier 4c6d9408d3 Merge pull request #6 from matrix-org/babolivier/access-rules-membership
Allow membership events which membership isn't join or invite in restricted rooms
2019-09-26 12:07:54 +01:00
Brendan Abolivier 0d069e4407 Changelog 2019-09-26 11:15:49 +01:00
Brendan Abolivier e6a7f8964f Allow membership events which membership isn't join or invite in restricted rooms 2019-09-26 11:12:21 +01:00
Michael Kaye efaf8038e2 Merge pull request #5 from matrix-org/babolivier/get-retention-worker
Fix room retention policy management in worker mode
2019-09-25 12:43:46 +01:00
Brendan Abolivier f3dfbc82d5 Typo 2019-09-24 17:25:13 +01:00
Brendan Abolivier 25815841b1 Consider every room as having no retention policy if the feature is disabled 2019-09-24 17:24:28 +01:00
Brendan Abolivier 32bc69d0f5 Changelog 2019-09-24 17:19:59 +01:00
Brendan Abolivier af597b1eb6 Move get_retention_policy_for_room to RoomWorkerStore 2019-09-24 17:19:59 +01:00
Brendan Abolivier 07eb311b11 Merge pull request #4 from matrix-org/babolivier/strip_invalid_mxid_characters
Fix handling of filtered strings in Python 3 when processing MXIDs
2019-09-20 10:57:07 +01:00
Brendan Abolivier 736394d46b Remove unnecessary cast to list 2019-09-20 10:07:55 +01:00
Brendan Abolivier 6f364634ee Changelog 2019-09-19 13:02:23 +01:00
Brendan Abolivier 8bc39401fe Lint 2019-09-19 13:01:05 +01:00
Brendan Abolivier 30c085fbc3 Use six.moves.filter when filtering out from MXID
Python 2's filter() function and Python 3's don't return the same type when processing a string (respectively str and filter), therefore use six's compatibility mapping (which resolves to itertools.ifilter() if using Python2), then generate a string from the filtered list, in order to ensure consistent behaviour between Python 2 and Python 3.
2019-09-19 12:03:10 +01:00
Brendan Abolivier ae036ed636 Add unit tests for strip_invalid_mxid_characters 2019-09-19 11:58:06 +01:00
Brendan Abolivier 27b982269e Merge pull request #2 from matrix-org/babolivier/dinsic-3pid-invite
Don't treat 3PID revocation as a new 3PID invite
2019-09-10 11:32:31 +01:00
Brendan Abolivier 0b993427e1 Update changelog.d/2.bugfix
Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2019-09-10 10:18:37 +01:00
Brendan Abolivier 66be293c79 Process revocations in _on_membership_or_invite_direct 2019-09-09 17:52:41 +01:00
Brendan Abolivier 43c1a10e91 Merge pull request #3 from matrix-org/babolivier/password-reset-template-unicode
Ensure the password reset template is correctly converted to binary
2019-09-09 17:52:05 +01:00
Brendan Abolivier c8f03a8fb0 Rename io.open import to limite side-effects 2019-09-09 17:13:37 +01:00
Brendan Abolivier b0eec085bd Lint 2019-09-09 16:41:46 +01:00
Brendan Abolivier 76f70779f1 Revert "Merge pull request #5932 from matrix-org/babolivier/account_validity_template_encode"
This reverts commit 84e695f506, reversing
changes made to 99eec6d2d5.
2019-09-09 16:36:00 +01:00
Brendan Abolivier 21a6f0b12c Read all files as UTF-8 2019-09-09 16:34:47 +01:00
Brendan Abolivier 6ceaf90e13 Revert "Ensure the password reset template is correctly converted to binary"
This reverts commit 665dd9f7f8.
2019-09-09 16:33:09 +01:00
Brendan Abolivier a8c7c26e7d Changelog 2019-09-09 11:49:42 +01:00
Brendan Abolivier 665dd9f7f8 Ensure the password reset template is correctly converted to binary
Regardless of the Python version
2019-09-09 11:35:56 +01:00
Brendan Abolivier 5076c2ebf6 Typo 2019-09-06 17:48:42 +01:00
Brendan Abolivier 6a78a0ce9b Lint 2019-09-06 15:51:52 +01:00
Brendan Abolivier 160a0c767d Changelog 2019-09-06 15:51:30 +01:00
Brendan Abolivier e1c4d2c8ba Only filter on 3PID invite tokens 2019-09-06 15:48:02 +01:00
Brendan Abolivier e35c30ed4b Fix bogus conflict resolution 2019-09-06 15:44:48 +01:00
Brendan Abolivier e163df4c20 Merge branch 'dinsic' into babolivier/dinsic-3pid-invite 2019-09-06 15:41:37 +01:00
Brendan Abolivier b2ec4467c9 Don't process revoked/redacted events as part of the room's membership info 2019-09-06 15:36:43 +01:00
Brendan Abolivier b15557cd46 Don't treat 3PID revokation as a new 3PID invite 2019-09-06 15:32:11 +01:00
Brendan Abolivier e9f2925292 Merge pull request #1 from matrix-org/babolivier/direct-avatar-name
Forbid changing the name, avatar or topic of a direct room
2019-09-06 11:46:17 +01:00
Brendan Abolivier 6cf60da6e9 Fix CI 2019-09-05 16:40:55 +01:00
Brendan Abolivier d1d464388a Lint 2019-09-05 16:35:13 +01:00
Brendan Abolivier 9ef4e90be7 Changelog 2019-09-05 16:35:00 +01:00
Brendan Abolivier 2477f1f7aa Add tests 2019-09-05 16:25:37 +01:00
Brendan Abolivier eddc6d8855 Forbid changing the name, avatar or topic of a direct room 2019-09-05 16:25:22 +01:00
Brendan Abolivier 84e695f506 Merge pull request #5932 from matrix-org/babolivier/account_validity_template_encode
Fix encoding for account validity HTML files on Python 2
2019-08-29 16:50:10 +01:00
Brendan Abolivier 91694227b6 Bump requirement for six to 1.12 2019-08-29 16:20:21 +01:00
Brendan Abolivier 7a95d8fff9 Fix encoding for account validity HTML files on Python 2 2019-08-29 16:03:59 +01:00
Brendan Abolivier 99eec6d2d5 Merge pull request #5815 from matrix-org/babolivier/dinsic-message-retention
Message retention policies at the room and server levels
2019-08-28 18:49:13 +01:00
Brendan Abolivier e5df12ad16 Merge branch 'dinsic' into babolivier/dinsic-message-retention 2019-08-28 18:17:26 +01:00
Brendan Abolivier 70714595bc Implement per-room message retention policies 2019-08-28 18:16:17 +01:00
Michael Kaye 62f5e3bc4c Merge pull request #5812 from matrix-org/babolivier/account-validity-messages
Account validity: allow defining HTML templates to serve the user on account renewal attempt
2019-08-12 13:26:49 +01:00
Michael Kaye 63d0d21a28 Merge pull request #5781 from matrix-org/baboliver/loopingcall-args
Add ability to pass arguments to looping calls
2019-08-08 12:10:36 +01:00
Michael Kaye 8551b4f336 Merge pull request #5760 from matrix-org/babolivier/access-rules-public-restricted
Force the access rule to be "restricted" if the join rule is "public"
2019-08-08 12:10:22 +01:00
Brendan Abolivier 359aed4168 Lint 2019-08-01 16:08:39 +02:00
Brendan Abolivier cd47482257 Sample config 2019-08-01 16:08:39 +02:00
Brendan Abolivier a9567ee1a6 Changelog 2019-08-01 16:08:38 +02:00
Brendan Abolivier 9502bd8d78 Add tests 2019-08-01 16:08:38 +02:00
Brendan Abolivier 235271be4f Allow defining HTML templates to serve the user on account renewal 2019-08-01 16:08:38 +02:00
Brendan Abolivier 0c6500a08b Explain rationale 2019-08-01 10:19:04 +02:00
Brendan Abolivier c862d5baf6 Check room ID and type of redacted event (#5784)
Check room ID and type of redacted event
2019-07-31 16:44:19 +02:00
Brendan Abolivier 35ec13baab Ignore redactions of redactions in get_events_as_list 2019-07-31 15:48:57 +02:00
Brendan Abolivier c4e56a8ee9 Ignore invalid redactions in _get_event_from_row 2019-07-31 15:11:27 +02:00
Brendan Abolivier d2bb51080e Incorporate review 2019-07-30 16:15:01 +02:00
Brendan Abolivier 0fda4e2e50 Should now work, unless we can't find the redaction event which happens for some reason (need to investigate) 2019-07-30 15:56:02 +02:00
Brendan Abolivier 8ced9a2f58 Don't make the checks depend on recheck_redaction 2019-07-30 15:55:18 +02:00
Brendan Abolivier bbd6208b3e Do checks sooner 2019-07-29 17:22:42 +02:00
Brendan Abolivier 36c61df659 Check room ID and type of redacted event 2019-07-29 16:07:12 +02:00
Brendan Abolivier 132887db8c Changelog 2019-07-29 11:06:43 +02:00
Brendan Abolivier bec6d9e090 Add kwargs and doc 2019-07-29 11:06:43 +02:00
Brendan Abolivier 8a47155763 Add ability to pass arguments to looping calls 2019-07-29 11:06:43 +02:00
Brendan Abolivier ffa30b507f Fix changelog 2019-07-25 10:19:13 +02:00
Brendan Abolivier 00b47fdfc7 Changelog 2019-07-25 10:17:07 +02:00
Brendan Abolivier 2526b79ce6 Merge ifs 2019-07-25 10:15:44 +02:00
Brendan Abolivier aea03c9d73 Doc 2019-07-25 10:14:41 +02:00
Brendan Abolivier ddf256c77f Fix status code for forbidden events 2019-07-25 10:03:59 +02:00
Brendan Abolivier dd92685179 Only check the join rule on room creation if an access rule is also provided 2019-07-25 10:03:36 +02:00
Brendan Abolivier 0bb375c124 Turns out the default preset is public_chat 2019-07-24 17:29:17 +02:00
Brendan Abolivier ea5f86304e Implement restrictions on new events 2019-07-24 17:27:07 +02:00
Brendan Abolivier d1a78ba2a3 Implement restriction on public room creation 2019-07-24 17:06:23 +02:00
Brendan Abolivier dcdfdb3f17 Add test case 2019-07-24 16:38:49 +02:00
Brendan Abolivier 4dc2eda1d3 Merge pull request #5702 from matrix-org/babolivier/3pid-invite
Fix check of the association between a 3PID invite and the subsequent m.room.member event in the 3rd party rules
2019-07-18 13:38:05 +02:00
Brendan Abolivier 13ad3f5ab1 Fix changelog 2019-07-17 15:10:16 +02:00
Brendan Abolivier 28803ad56a Merge branch 'dinsic' into babolivier/3pid-invite 2019-07-17 15:06:41 +02:00
Brendan Abolivier 446fb64d50 Changelog 2019-07-17 15:05:35 +02:00
Brendan Abolivier 34dd738e4b There's no third_party_signed property in an invite's content 2019-07-17 15:03:23 +02:00
Brendan Abolivier 048f86ef5d Fix check of the association between a 3PID invite and the subsequent m.room.member event in the 3rd party rules 2019-07-17 14:54:58 +02:00
Brendan Abolivier 3bc4ea841d Merge pull request #5646 from matrix-org/babolivier/profile-allow-self
Port #5644 to dinsic
2019-07-09 13:19:57 +01:00
Amber H. Brown 4e954f4bbd make the base branch dinsic for dinsic 2019-07-09 20:53:38 +10:00
Amber H. Brown f10b6f7385 cut down circleci config to just what dinsic needs 2019-07-09 20:38:24 +10:00
Brendan Abolivier 9fc40f7b3f Lint 2019-07-09 10:30:43 +01:00
Brendan Abolivier cf22aae355 Add test case 2019-07-09 10:27:53 +01:00
Brendan Abolivier 6b9d27d793 Changelog 2019-07-09 10:27:53 +01:00
Brendan Abolivier 25fff95448 Allow newly-registered users to lookup their own profiles
When a user creates an account and the 'require_auth_for_profile_requests' config flag is set, and a client that performed the registration wants to lookup the newly-created profile, the request will be denied because the user doesn't share a room with themselves yet.
2019-07-09 10:27:53 +01:00
Brendan Abolivier 5fe0cea37e Merge pull request #5610 from matrix-org/babolivier/power-levels
Implement new restrictions on power levels
2019-07-04 11:12:47 +01:00
Brendan Abolivier 95b5d4ad54 Merge branch 'babolivier/power-levels' of github.com:matrix-org/synapse into babolivier/power-levels 2019-07-03 18:30:13 +01:00
Brendan Abolivier 4dd7de17b7 Incorporate review 2019-07-03 18:26:48 +01:00
Brendan Abolivier 8b44097771 Update synapse/third_party_rules/access_rules.py
Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2019-07-03 18:21:42 +01:00
Brendan Abolivier 6b83a1826c Incorporate review 2019-07-03 17:32:52 +01:00
Brendan Abolivier aeda7fde78 Changelog 2019-07-03 15:47:58 +01:00
Brendan Abolivier d085e0df2a Change the rule for applying PL restrictions 2019-07-03 15:44:22 +01:00
Brendan Abolivier 8d28817eac Add tests 2019-07-03 15:43:52 +01:00
Brendan Abolivier aa3ba41933 Default return value for events we're not interested in 2019-07-03 12:05:56 +01:00
Brendan Abolivier 724ddaddb3 Refactor part of the access rules module
Since we're not processing only membership events and 3PID invites anymore, it's nice to know which function is supposed to process what.
2019-07-03 12:03:22 +01:00
Brendan Abolivier 8636ec042b Implement restrictions for power levels 2019-07-03 11:45:07 +01:00
Brendan Abolivier 78b737ff71 Merge pull request #5577 from matrix-org/babolivier/3pid-invite-ratelimit
Port #5576 to dinsic
2019-06-28 18:23:53 +01:00
Brendan Abolivier a7a8bbf502 Only ratelimit when sending the email
If we do the opposite, an event can arrive after or while sending the email and the 3PID invite event will get ratelimited.
2019-06-28 17:47:38 +01:00
Brendan Abolivier f304996c61 Changelog 2019-06-28 17:44:28 +01:00
Brendan Abolivier 7c644198c8 Don't update the ratelimiter before sending a 3PID invite
This would cause emails being sent, but Synapse responding with a 429 when creating the event. The client would then retry, and with bad timing the same scenario would happen again. Some testing I did ended up sending me 10 emails for one single invite because of this.
2019-06-28 17:44:28 +01:00
Brendan Abolivier ee0ee97447 Add test case for #5574
There's no test that makes sure #5574 didn't break things or works correctly (my bad), so this PR adds a test case that makes sure of it.
2019-06-28 10:29:02 +01:00
Brendan Abolivier f370fd01ec Merge pull request #5574 from matrix-org/babolivier/fix-3pid-bind
Fix new 3PID bindings being associated with rewritten IS's server names instead of the original one
2019-06-27 15:17:15 +01:00
Brendan Abolivier 1ef3627b05 Fix new 3PID bindings being associated with rewritten IS's server names instead of the original one
This would make unbind requests fail because Synapse is using the server name it has in DB as destination_is to generate signature, and Sydent uses its own server name there when verifying it, so if a mismatch happens, which is the case if the name gets rewritten for routing purposes, the unbind requests fail on the signature verification.
2019-06-27 14:53:10 +01:00
Brendan Abolivier fbc5b58d21 Merge pull request #5542 from matrix-org/babolivier/federation-publicrooms
Port "Split public rooms directory auth config in two" to dinsic
2019-06-24 16:42:21 +01:00
Brendan Abolivier 84875301b6 Split public rooms directory auth config in two 2019-06-24 16:41:48 +01:00
Brendan Abolivier 18f0b69c49 Merge pull request #5495 from matrix-org/babolivier/deactivate_bg_job_typo
Port "Fix typo in deactivation background job" to dinsic
2019-06-19 11:58:52 +01:00
Brendan Abolivier 4875746d82 Fix typo in deactivation background job 2019-06-19 11:39:18 +01:00
Brendan Abolivier fa4efb5967 Merge pull request #5484 from matrix-org/babolivier/dinsic_access_rules
Implement custom access rules
2019-06-19 10:41:37 +01:00
Brendan Abolivier c1bc48f9d4 Add tests for constraints on changing the rule for a room 2019-06-18 18:07:05 +01:00
Brendan Abolivier 9b3c69f661 Add tests for 3PID invites 2019-06-18 17:59:07 +01:00
Brendan Abolivier 7157276124 Don't process 3PIDs in _apply_restricted 2019-06-18 17:43:34 +01:00
Brendan Abolivier 1532369dcd Remove unused import 2019-06-18 16:46:57 +01:00
Brendan Abolivier 145291108d Add tests for inviting with access rules 2019-06-18 16:32:54 +01:00
Brendan Abolivier cefc5542fb Lint 2019-06-18 14:59:05 +01:00
Brendan Abolivier 2a1f35193b Remove unused imports 2019-06-18 14:57:04 +01:00
Brendan Abolivier a09767d57d Lint 2019-06-18 14:55:24 +01:00
Brendan Abolivier bc0fd8f170 Add tests for room creation hook 2019-06-18 14:54:19 +01:00
Brendan Abolivier d36a876d2d Incorporate review 2019-06-18 14:53:33 +01:00
Brendan Abolivier f7339d42ee Fixes 2019-06-18 11:28:33 +01:00
Brendan Abolivier 8aea2c3be1 Docstrings 2019-06-17 20:24:36 +01:00
Brendan Abolivier 1cd0ecc1f2 Rename into RoomAccessRules 2019-06-17 20:24:30 +01:00
Brendan Abolivier 19a4298a51 Fix function call 2019-06-17 20:24:26 +01:00
Brendan Abolivier 073dd7778e Implement rules change 2019-06-17 20:24:22 +01:00
Brendan Abolivier 00736c8935 Improve doc 2019-06-17 20:24:16 +01:00
Brendan Abolivier 112a48a5aa Implement 3PID invite hook 2019-06-17 20:24:07 +01:00
Brendan Abolivier 53aff08ebe Implement restricted rules and room creation hook 2019-06-17 20:22:53 +01:00
Brendan Abolivier 8b2f655589 Implement rules for direct 2019-06-17 20:22:27 +01:00
Brendan Abolivier bd8448ccb2 Backbone 2019-06-17 20:19:12 +01:00
Brendan Abolivier 110608d1d6 Base 2019-06-17 20:19:08 +01:00
Brendan Abolivier 5a28504c08 Merge pull request #5481 from matrix-org/babolivier/third_party_rules_3pid
Port "Add third party rules hook for 3PID invites" to dinsic
2019-06-17 18:35:54 +01:00
Brendan Abolivier 9bb7cec90f Make check_threepid_can_be_invited async 2019-06-17 18:10:00 +01:00
Brendan Abolivier 8a8644045f Changelog 2019-06-17 18:10:00 +01:00
Brendan Abolivier 08d4534771 Add third party rules hook for 3PID invites 2019-06-17 18:10:00 +01:00
Erik Johnston c8349787b7 Merge pull request #5474 from matrix-org/erikj/add_create_room_hook
Add third party rules hook into create room
2019-06-17 17:30:08 +01:00
Erik Johnston e5e690041d Newsfile 2019-06-17 15:52:15 +01:00
Erik Johnston fb1b76ff4c Add third party rules hook into create room 2019-06-17 15:48:57 +01:00
Brendan Abolivier 40ea934de0 Merge pull request #5471 from matrix-org/erikj/3pid_remote_invite_state
Port "Fix 3PID invite room state over federation" to dinsic
2019-06-17 11:43:02 +01:00
Brendan Abolivier 5c4296b47a Merge branch 'babolivier/third_party_event_rules' into dinsic 2019-06-14 19:38:44 +01:00
Brendan Abolivier 8b2543c0ec Merge pull request #5466 from matrix-org/babolivier/fix_deactivation_bg_job
Port "Fix background job for deactivated flag" to dinsic
2019-06-14 19:22:56 +01:00
Brendan Abolivier bd59e154c1 Fix changelog 2019-06-14 18:29:13 +01:00
Brendan Abolivier 66378d13ce Changelog 2019-06-14 18:29:13 +01:00
Brendan Abolivier 65d3652cb7 Fix background job for deactivated flag 2019-06-14 18:29:13 +01:00
Brendan Abolivier c644755123 Merge pull request #5463 from matrix-org/babolivier/account_validity_deactivated_accounts_2
Port "Don't send renewal emails to deactivated users" to dinsic
2019-06-14 17:19:57 +01:00
Brendan Abolivier c7964e7430 Fix test 2019-06-14 16:25:18 +01:00
Brendan Abolivier aded5cfb72 Don't send renewal emails to deactivated users 2019-06-14 15:39:18 +01:00
Brendan Abolivier 57bd5cfc9a Track deactivated accounts in the database (#5378) 2019-06-14 13:45:36 +01:00
Brendan Abolivier ad566df746 Merge pull request #5420 from matrix-org/babolivier/userdir_hide_users
Add configuration option to hide new users from the user directory
2019-06-14 10:59:45 +01:00
Brendan Abolivier c4759cd041 Merge branch 'dinsic' into babolivier/userdir_hide_users 2019-06-14 10:37:43 +01:00
Brendan Abolivier 4dda68da9a Make index unique 2019-06-14 10:37:12 +01:00
Brendan Abolivier adf3eee668 Merge branch 'babolivier/fix_profile_replication' into babolivier/userdir_hide_users 2019-06-13 18:11:11 +01:00
Brendan Abolivier a6cf1e079e Merge pull request #5416 from matrix-org/babolivier/fix_profile_replication
Add unique index to the profile_replication_status table.
2019-06-13 18:10:14 +01:00
Brendan Abolivier 996cf15d42 Lint 2019-06-13 17:41:13 +01:00
Brendan Abolivier 27cd0b3037 Fix snafu 2019-06-13 17:40:14 +01:00
Brendan Abolivier 26a27e06b9 Create the index in a background update 2019-06-13 15:57:55 +01:00
Brendan Abolivier 5283f65316 Fix bogus changelog 2019-06-12 16:49:10 +01:00
Brendan Abolivier 4a1b749582 Lint 2019-06-12 16:48:51 +01:00
Brendan Abolivier e0c56d6527 Merge branch 'dinsic' into babolivier/fix_profile_replication 2019-06-12 16:41:08 +01:00
Brendan Abolivier 7c2d936802 Fix bogus changelog 2019-06-12 16:38:00 +01:00
Brendan Abolivier 1c7628eb3a Lint 2019-06-12 16:36:28 +01:00
Brendan Abolivier 8400e5f624 Merge branch 'dinsic' into babolivier/userdir_hide_users 2019-06-12 16:29:56 +01:00
Brendan Abolivier 02a659ae30 Regenerate full schemas 2019-06-12 15:51:59 +01:00
Brendan Abolivier a55b2efca1 Fix path for password policy endpoints 2019-06-12 15:51:42 +01:00
Brendan Abolivier d907e8f599 Merge branch 'master' into dinsic 2019-06-12 14:36:44 +01:00
Brendan Abolivier 3c8262b181 Merge branch 'master' into dinsic 2019-06-11 10:55:53 +01:00
Brendan Abolivier 389aa20170 Generate sample config 2019-06-10 17:31:45 +01:00
Brendan Abolivier c10226581a Lint 2019-06-10 17:25:42 +01:00
Brendan Abolivier 10510f1e7e Lint 2019-06-10 17:23:11 +01:00
Brendan Abolivier 9ece96f5c8 Changelog 2019-06-10 17:17:18 +01:00
Brendan Abolivier 1924848dfa Add test case 2019-06-10 17:16:17 +01:00
Brendan Abolivier deee82aebc Fix variable definition 2019-06-10 17:16:03 +01:00
Brendan Abolivier 0e63dd89a4 Fix condition 2019-06-10 16:56:53 +01:00
Brendan Abolivier d331119758 Hide new users from the user directory if enabled in the server config. 2019-06-10 16:56:53 +01:00
Brendan Abolivier 9cce175bf0 Move schema update to 54 and add a warning comment 2019-06-10 15:34:41 +01:00
Brendan Abolivier 4f0e9a3f01 New line 2019-06-10 15:22:55 +01:00
Brendan Abolivier 35eea39c8c Add unique index to the profile_replication_status table. 2019-06-10 15:18:22 +01:00
Brendan Abolivier 8d16321edc Merge branch 'babolivier/account_validity_send_mail_auth' into dinsic 2019-06-10 11:59:20 +01:00
Brendan Abolivier 116f7778f4 Merge branch 'babolivier/email_config' into dinsic 2019-06-04 14:49:55 +01:00
Erik Johnston d8fdba7bfb Merge branch 'babolivier/account_validity_job_delta' of github.com:matrix-org/synapse into dinsic 2019-05-31 12:12:24 +01:00
Brendan Abolivier dde07c6859 Merge branch 'babolivier/account_validity_fix_schema' into dinsic 2019-05-28 11:36:11 +01:00
Brendan Abolivier 64365fcbdd Merge pull request #5214 from matrix-org/babolivier/password-policy
Allow server admins to define and enforce a password policy (MSC2000)
2019-05-22 11:09:42 +01:00
Brendan Abolivier 4a9eba9576 Test whole dict instead of individual fields 2019-05-22 10:43:23 +01:00
Brendan Abolivier 50cd07a836 Merge branch 'babolivier/account_validity_expiration_date' into dinsic 2019-05-21 14:56:05 +01:00
Brendan Abolivier 7dfc3c327c Improve documentation on generated configuration 2019-05-21 10:49:44 +01:00
Brendan Abolivier 42cea6b437 Make error messages more explicit 2019-05-21 10:21:27 +01:00
Brendan Abolivier d9105b5ed8 Also test the /password client route 2019-05-21 09:55:32 +01:00
Brendan Abolivier 6fbf2ae9a8 Remove unused import 2019-05-20 19:49:19 +01:00
Brendan Abolivier ed2b5b77f2 Config and changelog 2019-05-20 19:44:37 +01:00
Brendan Abolivier 6d54f1534a First implementation of MSC2000 2019-05-20 19:42:39 +01:00
Brendan Abolivier d6e2f9f9da Merge branch 'babolivier/per_room_profiles' into dinsic 2019-05-17 15:07:41 +01:00
Brendan Abolivier f608ddbe5c Merge branch 'release-v0.99.4' into dinsic 2019-05-14 11:43:03 +01:00
Brendan Abolivier 38e3d9ed67 Merge pull request #5115 from matrix-org/babolivier/lookup_path
[DINSIC] Move 3PID lookup endpoint to CS API and proxy bulk lookups
2019-05-09 15:02:21 +01:00
Brendan Abolivier aa5c42f5bc Fix failing test 2019-05-09 13:59:57 +01:00
Brendan Abolivier 8bcb78891e Merge branch 'babolivier/lookup_path' of github.com:matrix-org/synapse into babolivier/lookup_path 2019-05-09 13:09:19 +01:00
Brendan Abolivier f304f1a574 Incorporate review 2019-05-09 13:07:43 +01:00
Brendan Abolivier 532ba44add Fix test 2019-05-09 13:01:40 +01:00
Brendan Abolivier 10e3ed83e9 Check if Synapse should check given ISs 2019-05-09 12:53:24 +01:00
Richard van der Hoff 622ecec24b Merge remote-tracking branch 'origin/dinsic' into babolivier/lookup_path 2019-05-09 11:06:02 +01:00
Richard van der Hoff 09ea63ae7a Merge pull request #5098 from matrix-org/rav/fix_pep_517
Workarounds for pep-517 errors
2019-05-08 18:13:15 +01:00
Brendan Abolivier f059a91085 /bulk_lookup doesn't return a signature 2019-05-07 14:16:26 +01:00
Brendan Abolivier 66f7588f87 Fix expected key in bulk lookup response 2019-05-07 12:06:24 +01:00
Brendan Abolivier b4f3d70b21 Incorporate review 2019-05-07 11:47:37 +01:00
Brendan Abolivier 3d031c211d Fix error message 2019-05-01 10:10:38 +01:00
Andrew Morgan 371296443f Update synapse/handlers/identity.py
Co-Authored-By: babolivier <contact@brendanabolivier.com>
2019-05-01 10:03:46 +01:00
Andrew Morgan 1973eb11d2 Update synapse/rest/client/v2_alpha/account.py
Co-Authored-By: babolivier <contact@brendanabolivier.com>
2019-05-01 10:02:18 +01:00
Andrew Morgan 26c004129f Update synapse/rest/client/v2_alpha/account.py
Co-Authored-By: babolivier <contact@brendanabolivier.com>
2019-05-01 10:01:57 +01:00
Richard van der Hoff 0cc91efd6a Merge pull request #5098 from matrix-org/rav/fix_pep_517
Workarounds for pep-517 errors
2019-04-30 18:33:19 +01:00
Brendan Abolivier fe6ac9c5d7 Fixed return value 2019-04-30 18:28:01 +01:00
Brendan Abolivier 96bd70f6d0 Bunch of tests 2019-04-30 18:22:52 +01:00
Brendan Abolivier 3a9c405a0f Fix url and method 2019-04-30 18:22:42 +01:00
Brendan Abolivier 909ceecc28 Tests 2019-04-30 17:27:58 +01:00
Brendan Abolivier 70da5202ba Fixes 2019-04-30 17:27:47 +01:00
Brendan Abolivier 34bbbe81a6 Fix method 2019-04-30 16:59:46 +01:00
Brendan Abolivier 2d979e639d Register servlets 2019-04-30 16:51:50 +01:00
Brendan Abolivier d296cdc9dd Add bulk lookup 2019-04-30 15:15:02 +01:00
Brendan Abolivier 8df16a8aee Move lookup endpoint to CS API (and s/is_server/id_server/) 2019-04-30 15:11:21 +01:00
Matthew Hodgson 15b7a84aa8 changelog 2019-04-21 01:01:40 +01:00
Andrew Morgan 2f61dd058d [DINSIC] Add ability to proxy identity lookups (#5048) 2019-04-16 17:41:01 +01:00
Andrew Morgan e6218e4880 [DINSIC] Block internal users from inviting external users to a public room (#5061)
Co-Authored-By: babolivier <contact@brendanabolivier.com>
2019-04-16 16:41:01 +01:00
Andrew Morgan 7d71975e6a Merge branch 'develop' into dinsic 2019-04-15 15:22:14 +01:00
Brendan Abolivier 0fcf7e5c57 Add config option to block users from looking up 3PIDs (#5010) 2019-04-05 14:25:27 +01:00
Erik Johnston 9bf49abc07 Merge branch 'master' of github.com:matrix-org/synapse into dinsic 2019-04-05 14:10:16 +01:00
Michael Kaye dd747ba045 Prevent exception when hs or shadow_hs missing (#5012)
* Prevent exception when hs or shadow_hs missing
2019-04-04 17:45:12 +01:00
Erik Johnston b00a8d870c Fix registration with register_mxid_from_3pid enabled (#5011) 2019-04-04 16:45:15 +01:00
Michael Kaye 8fa09c7479 Rewrite more internal IS urls. (#5006)
* Rewrite more internal IS urls.
2019-04-04 15:28:37 +01:00
Erik Johnston d94873d525 Merge pull request #4997 from matrix-org/erikj/dinsic_email_display_name
Add config option to use email as display name for new users
2019-04-03 10:57:20 +01:00
Erik Johnston f2fa172375 Sample config 2019-04-03 10:40:40 +01:00
Erik Johnston 8c0ebe3026 Add config option to use email as display name for new users 2019-04-03 10:26:56 +01:00
Erik Johnston 53dd358c83 Merge pull request #4910 from matrix-org/erikj/third_party_invite_create_spam
Add third party invite support to spam checker
2019-03-21 16:07:27 +00:00
Erik Johnston f5c944c7f2 Fix comments 2019-03-21 15:31:34 +00:00
Erik Johnston aefb7a1146 Update sample config 2019-03-21 12:52:22 +00:00
Erik Johnston 479b7b1eff Add another test 2019-03-21 12:48:37 +00:00
Erik Johnston f04ee0b351 Run black on tests/rulecheck/ 2019-03-21 12:48:37 +00:00
Erik Johnston 164798ec32 Add 3PID invite support to spam checker 2019-03-21 12:48:37 +00:00
Erik Johnston b7d7d20a38 Correctly handle 3PID invites in create room spam check
We also add an option to outright deny third party invites
2019-03-21 12:48:37 +00:00
Erik Johnston 2bb6d85736 Turn off newsfile check 2019-03-21 12:48:25 +00:00
Erik Johnston 0f0671e5e0 Merge branch 'develop' of github.com:matrix-org/synapse into erikj/dinsic-merged 2019-03-21 12:41:42 +00:00
Erik Johnston 8eb9f37a01 Merge pull request #4875 from matrix-org/erikj/spam_checker
Extend spam checking rules
2019-03-18 16:28:46 +00:00
Erik Johnston ea89e73ebf Add unit tests 2019-03-18 15:56:08 +00:00
Erik Johnston 68a9d1fc34 Add rules to DomainRuleChecker 2019-03-18 15:56:04 +00:00
Erik Johnston feae387576 Don't spam check actions by admins 2019-03-18 15:51:00 +00:00
Erik Johnston e64f7c0188 Run black on tests/rulecheck/test_domainrulecheck.py 2019-03-18 15:51:00 +00:00
Erik Johnston b85ff4b894 Add user_may_join_room spam check 2019-03-18 15:51:00 +00:00
Erik Johnston 4eca8d3fb3 Add invite_list and cloning param to create room rule 2019-03-18 15:50:55 +00:00
Michael Kaye aa3dc78f65 Merge pull request #4862 from matrix-org/erikj/dinsic-merged-master
Merge master into dinsic
2019-03-15 17:21:22 +01:00
Erik Johnston de874364e7 Fixup config 2019-03-15 14:41:27 +00:00
Erik Johnston 7e94e2ad94 Disable changelog CI checks 2019-03-15 14:40:28 +00:00
Erik Johnston e7ec6f78ca Manifest 2019-03-15 14:39:25 +00:00
Erik Johnston 7a9aa4b81b Isort 2019-03-15 14:39:25 +00:00
Erik Johnston 5827e976fe Fixups 2019-03-15 14:39:25 +00:00
Erik Johnston 44c0661d97 Merge branch 'master' of github.com:matrix-org/synapse into erikj/dinsic-merged-master 2019-03-15 14:36:44 +00:00
Erik Johnston 85db96cc81 Add some debug logging for device list handling 2019-03-08 12:31:41 +00:00
Andrew Morgan 3271742905 Merge pull request #4681 from matrix-org/dinsic_anoa/info_split
[DINSIC] Use internal-info for identity server
2019-02-28 11:28:55 +00:00
Andrew Morgan 0a23bf442f Merge branch 'dinsic_anoa/info_split' of github.com:matrix-org/synapse into dinsic_anoa/info_split 2019-02-27 15:23:19 +00:00
Andrew Morgan 9b13038d05 Check shadow_hs as well as hs during 3pid reg 2019-02-27 15:22:41 +00:00
Andrew Morgan dfe09ec313 Merge pull request #4747 from matrix-org/anoa/public_rooms_federate
[DINSIC] Prevent showing non-fed rooms in fed /publicRooms
2019-02-26 14:40:45 +00:00
Richard van der Hoff 13bc1e5307 Update synapse/util/threepids.py
Co-Authored-By: anoadragon453 <1342360+anoadragon453@users.noreply.github.com>
2019-02-25 16:08:58 +00:00
Andrew Morgan 70e039c7ae Use internal-info for identity server. Block reg on fields 2019-02-19 15:29:49 +00:00
Michael Kaye 2712a9ef8f Fix to keep the signature valid for the request. (#4480) 2019-01-28 14:24:28 +00:00
Michael Kaye da757b7759 Rewrite identity server URLs as required. (#4393)
This takes a mapping of <old> -> <new> and looks up and replaces as
required.
2019-01-21 15:48:15 +00:00
Michael Kaye 59bc7debf0 When performing shadow registration, don't inhibit login. (#4385) 2019-01-14 18:01:34 +00:00
Matthew Hodgson cf68593544 Synchronise account metadata onto another server. (#4145)
* implement shadow registration via AS (untested)
* shadow support for 3pid binding/unbinding (untested)
2019-01-11 15:50:28 +00:00
Michael Kaye 9cc95fd0a5 Merge pull request #4148 from matrix-org/matthew/red_list
add im.vector.hide_profile to user account_data
2018-12-19 15:42:19 +00:00
Matthew Hodgson 82886e4c8f hide_profile: false should mean not to hide the profile :/ 2018-12-12 00:57:39 +00:00
Matthew Hodgson 08919847c1 fix sense of 'hide' 2018-11-04 23:49:57 +00:00
Matthew Hodgson c3acc45a87 pull in profile_handler correctly 2018-11-04 23:49:19 +00:00
Matthew Hodgson ae5bb32ad0 add im.vector.hide_profile to user account_data 2018-11-04 23:46:11 +00:00
Matthew Hodgson 7ed3232b08 fix tests 2018-11-03 12:58:25 +00:00
Matthew Hodgson 6e7488ce11 merge master into dinsic, again... 2018-11-03 12:14:24 +00:00
Michael Kaye 41585e1340 Merge pull request #4047 from matrix-org/michaelkaye/dinsic_allow_user_directory_url
user_directory.defer_to_id_server should be an URL, not a hostname
2018-11-02 12:00:18 +00:00
Matthew Hodgson 9498cd3e7b fix conflict and reinstate 6372dff771 2018-10-22 20:27:25 +02:00
Matthew Hodgson c7503f8f33 merge in master 2018-10-22 20:19:40 +02:00
Michael Kaye 9d8baa1595 Allow us to configure http vs https for user_directory 2018-10-17 11:38:48 +01:00
Matthew Hodgson 4ff8486f0f fix missing import and run isort 2018-07-20 11:29:18 +01:00
David Baker 2669e494e0 Merge remote-tracking branch 'origin/master' into dinsic 2018-07-19 18:25:25 +01:00
David Baker b6d8a808a4 Merge pull request #3557 from matrix-org/dbkr/delete_profiles
Remove deactivated users from profile search
2018-07-19 15:58:40 +01:00
David Baker 0cb5d34756 Hopefully fix postgres 2018-07-19 15:12:48 +01:00
David Baker 650761666d More run_on_reactor 2018-07-19 14:52:35 +01:00
David Baker aa2a4b4b42 run_on_reactor is dead 2018-07-19 14:48:24 +01:00
David Baker 022469d819 Change column def so it works on pgsql & sqlite
Now I remember discovering previously there was no way to make boolean
columns work
2018-07-19 10:28:26 +01:00
David Baker 45d06c754a Add hopefully enlightening comment 2018-07-18 20:52:21 +01:00
David Baker dbd0821c43 Oops, didn't mean to commit that 2018-07-18 20:50:20 +01:00
David Baker 0476852fc6 Remove deactivated users from profile search 2018-07-18 18:05:29 +01:00
David Baker 1d11d9323d Merge remote-tracking branch 'origin/master' into dinsic 2018-07-17 15:43:33 +01:00
Michael Kaye 261e4f2542 Merge pull request #3502 from matrix-org/matthew/dinsic-tweak-display-names
tweak dinsic display names
2018-07-10 15:59:26 +01:00
Matthew Hodgson 11728561f3 improve domain matches 2018-07-10 15:21:14 +01:00
Matthew Hodgson 9d57abcadd fix bounds error 2018-07-10 13:58:01 +01:00
Matthew Hodgson cb0bbde981 tweak dinsic display names 2018-07-10 13:56:32 +01:00
Matthew Hodgson abc97bd1de Merge pull request #3487 from matrix-org/matthew/dinsic-encrypt-for-invited-users
Query the device lists of users when they are invited to a room.
2018-07-10 12:21:57 +01:00
Matthew Hodgson ee238254a0 Query the device lists of users when they are invited to a room.
Previously we only queried the device list when the user joined the room; now we
do it when they are invited too.  This means that new messages can be encrypted
for the devices of the invited user as of the point they were invited.

WARNING: This commit has two major problems however:
 1. If the invited user adds devices after being invited but before joining, the
    device-list will not be updated to the other servers in the room (as we don't
    know who those servers are).
 2. This introduces a regression, as previously the device-list would be correctly
    updated when when user joined the room.  However, this resync doesn't happen
    now, so devices which joined after the invite and before the join may never
    be added to the device-list.

This is being merged for DINSIC given the edge case of adding devices between
invite & join is pretty rare in their use case, but before it can be merged to
synapse in general we need to at least re-sync the devicelist when the user joins
or to implement some kind of pubsub mechanism to let interested servers subscribe
to devicelist updates on other servers irrespective of user join/invite membership.

This was originally https://github.com/matrix-org/synapse/pull/3484
2018-07-06 16:29:08 +02:00
Matthew Hodgson 0125b5d002 typos 2018-06-25 17:37:00 +01:00
Michael Kaye fe265fe990 Merge tag 'v0.31.2' into dinsic 2018-06-22 17:04:50 +01:00
David Baker 7735eee41d Merge pull request #3426 from matrix-org/dbkr/e2e_by_default
Server-enforced e2e for private rooms
2018-06-22 16:49:42 +01:00
David Baker 3d0faa39fb Add m.encryption to event types 2018-06-22 16:47:49 +01:00
David Baker fd28d13e19 Server-enforced e2e for private rooms 2018-06-22 13:54:17 +01:00
Michael Kaye d18731e252 Merge pull request #3202 from matrix-org/michaelkaye/domain_based_rule_checker
DomainRuleChecker
2018-05-21 09:32:47 +01:00
Michael Kaye 81beae30b8 Update with documentation suggestions 2018-05-18 16:12:22 +01:00
Michael Kaye 11f1bace3c Address PR feedback
- add code and test to handle configuration of an empty array
- move docstrings around and update class level documentation
2018-05-11 12:51:03 +01:00
Michael Kaye 1e8cfc9e77 pep8 style fixes 2018-05-09 15:11:19 +01:00
Michael Kaye 488ed3e444 Generic "are users in domain X allowed to invite users in domain Y" logic 2018-05-09 14:50:48 +01:00
Matthew Hodgson c3ec84dbcd Merge pull request #3096 from matrix-org/matthew/derive-mxid-from-3pid
add the register_mxid_from_3pid setting (untested)
2018-05-04 02:26:46 +01:00
Matthew Hodgson 0783801659 unbreak tests 2018-05-04 02:18:01 +01:00
Matthew Hodgson 9f2fd29c14 fix double negative 2018-05-04 02:11:22 +01:00
Matthew Hodgson 6372dff771 remove create_profile from tests 2018-05-04 01:58:45 +01:00
Matthew Hodgson b3e346f40c don't pass a requester if we don't have one to set_displayname 2018-05-04 01:56:01 +01:00
Matthew Hodgson fb47ce3e6a make set_profile_* an upsert rather than update, now create_profile is gone 2018-05-04 01:46:26 +01:00
Matthew Hodgson debf04556b fix user in user regexp 2018-05-04 01:15:33 +01:00
Matrix 907a62df28 fix strip_invalid_mxid_characters 2018-05-03 23:54:36 +00:00
Matrix 41b987cbc5 unbreak 3pid deletion 2018-05-03 23:54:36 +00:00
Matthew Hodgson 5c74ab4064 fix user_id / user confusion 2018-05-04 00:53:56 +01:00
Matrix 06820250c9 unbreak 3pid deletion 2018-05-03 23:27:34 +00:00
Matthew Hodgson 383c4ae59c Merge branch 'dinsic' into matthew/derive-mxid-from-3pid 2018-05-03 23:39:08 +01:00
Matthew Hodgson f639ac143d Merge pull request #3180 from matrix-org/matthew/disable-3pid-changes
add option to disable changes to the 3PIDs for an account.
2018-05-03 18:19:58 +01:00
Matthew Hodgson ad0424bab0 Merge pull request #3179 from matrix-org/matthew/disable-set-profile
options to disable setting profile info
2018-05-03 18:19:48 +01:00
Matthew Hodgson 2992125561 special case msisdns when deriving mxids from 3pids 2018-05-03 17:52:46 +01:00
David Baker ef56b6e27c Merge pull request #3185 from matrix-org/dbkr/change_profile_replication_uri
Change profile replication URI
2018-05-03 15:17:51 +01:00
David Baker 53d6245529 Change profile replication URI 2018-05-03 14:55:40 +01:00
Matthew Hodgson 25e471dac3 fix defaults in config example 2018-05-03 11:46:56 +01:00
Matthew Hodgson 76fca1730e fix defaults in example config 2018-05-03 11:46:11 +01:00
Matthew Hodgson 32e4420a66 improve mxid & displayname selection for register_mxid_from_3pid
* [x] strip invalid characters from generated mxid
* [x] append numbers to disambiguate clashing mxids
* [x] generate displayanames from 3pids using a dodgy heuristic
* [x] get rid of the create_profile_with_localpart and instead
      explicitly set displaynames so they propagate correctly
2018-05-03 04:21:20 +01:00
Matthew Hodgson 79b2583f1b Merge branch 'dinsic' into matthew/derive-mxid-from-3pid 2018-05-03 02:51:49 +01:00
Matthew Hodgson 8a24c4eee5 add option to disable changes to the 3PIDs for an account.
This only considers the /account/3pid API, which should be sufficient
as currently we can't change emails associated with push notifs
(which are provisioned at registration), and we can't directly create
mappings for accounts in an IS other than by answering an invite
2018-05-03 02:47:55 +01:00
Matthew Hodgson f93cb7410d options to disable setting profile info 2018-05-03 01:29:12 +01:00
Matthew Hodgson 50d5a97c1b Merge branch 'master' into dinsic 2018-05-03 00:26:33 +01:00
David Baker c06932a029 Merge pull request #3166 from matrix-org/dbkr/postgres_doesnt_have_ifnull
Use COALESCE rather than IFNULL
2018-05-01 18:15:28 +01:00
David Baker 3a62cacfb0 Use COALESCE rather than IFNULL
as this works on sqlite and postgres (postgres doesn't have IFNULL)
2018-05-01 17:54:03 +01:00
David Baker 4d55b16faa Fix python synatx 2018-05-01 14:32:30 +01:00
David Baker 105709bf32 Fix profile repl 2018-05-01 14:27:14 +01:00
David Baker d7fad867fa Merge pull request #3123 from matrix-org/dbkr/user_directory_defer_to_is
Option to defer user_directory search to an ID server
2018-04-27 17:18:13 +01:00
David Baker 8fddcf703e Merge remote-tracking branch 'origin/dinsic' into dbkr/user_directory_defer_to_is 2018-04-26 10:23:12 +01:00
David Baker e2adb360eb Merge pull request #3112 from matrix-org/dbkr/profile_replication
Option to replicate user profiles to another server
2018-04-26 10:22:28 +01:00
David Baker 47ed4a4aa7 PR feedback
Unnecessary inlineCallbacks, missing yield, SQL comments & trailing
commas.
2018-04-25 13:58:37 +01:00
David Baker 7fafa838ae Comment why the looping call loops 2018-04-25 11:59:22 +01:00
David Baker de341bec1b Add 'ex[erimental API' comment 2018-04-25 11:51:57 +01:00
David Baker 643c89d497 Fix spelling & add experimental API comment 2018-04-25 11:40:37 +01:00
David Baker 6554253f48 Option to defer to an ID server for user_directory 2018-04-19 19:28:12 +01:00
David Baker 3add16df49 pep8 again 2018-04-17 13:23:16 +01:00
David Baker dde01efbcb Don't do profile repl if no repl targets 2018-04-17 12:26:45 +01:00
David Baker 22e416b726 Update profile cache only on master
and same for the profile replication
2018-04-17 12:17:16 +01:00
David Baker b4b7c80181 Fix other tests 2018-04-17 11:03:10 +01:00
David Baker 5fc3477fd3 Fix tests 2018-04-17 10:46:49 +01:00
David Baker 8743f42b49 pep8 2018-04-17 10:34:04 +01:00
David Baker 7285afa4be Handle current batch number being null 2018-04-17 10:28:00 +01:00
Matthew Hodgson b22a53e357 turn @'s to -'s rather than .'s 2018-04-17 09:32:42 +01:00
David Baker 3c446d0a81 Merge remote-tracking branch 'origin/dinsic' into dbkr/profile_replication 2018-04-16 18:35:25 +01:00
Matthew Hodgson 240e940c3f handle medium checks correctly 2018-04-12 18:30:32 +01:00
Matthew Hodgson 969ed2e49d add the register_mxid_from_3pid setting (untested) 2018-04-12 18:20:51 +01:00
David Baker 1147ce7e18 Include origin_server in the sig!
Also be consistent with underscores
2018-04-12 17:59:37 +01:00
Matthew Hodgson 0d2b7fdcec Merge branch 'develop' into dinsic 2018-04-12 13:29:57 +01:00
David Baker 4e12b10c7c Trigger profile replication on profile change 2018-04-11 10:17:07 +01:00
David Baker e654230a51 Written but untested profile replication 2018-04-10 17:41:58 +01:00
Matthew Hodgson ef5193e0cb Merge pull request #2973 from matrix-org/matthew/dinsic_3pid_check
Delegate 3PID registration determination to experimental IS API
2018-03-14 22:35:58 +00:00
Matthew Hodgson 7b3959c7f3 Merge branch 'develop' into dinsic 2018-03-14 22:31:34 +00:00
Matthew Hodgson 2e4a6c5aab incorporate PR feedback and rename URL 2018-03-14 22:09:08 +00:00
Matthew Hodgson e3eb2cfe8b Merge branch 'develop' into matthew/dinsic_3pid_check 2018-03-14 21:56:58 +00:00
Matthew Hodgson 5c341c99f6 add 'allow_invited_3pids' option to invited 3PIDs to register 2018-03-13 21:15:14 +00:00
Matthew Hodgson 739d3500fe pep8 2018-03-13 01:50:32 +00:00
Matthew Hodgson 0e2d70e101 typos 2018-03-13 01:41:20 +00:00
Matthew Hodgson 82c4fd7226 add yields 2018-03-13 01:38:02 +00:00
Matthew Hodgson e446077478 delegate to the IS to check 3PID signup eligibility 2018-03-13 01:34:20 +00:00
Matthew Hodgson d82c89ac22 fix thinko on 3pid whitelisting 2018-01-24 11:07:24 +01:00
Matthew Hodgson 75b25b3f1f Merge branch 'develop' into dinsic 2018-01-23 10:00:53 +01:00
AmandineLP 1df10d8814 Fixed translation 2018-01-22 21:18:44 +01:00
AmandineLP 8f9340d248 Fixed translation 2018-01-22 21:17:36 +01:00
AmandineLP c5034cd4b0 More translation 2018-01-22 21:16:46 +01:00
AmandineLP f7f937d051 Translate to FR 2018-01-22 21:14:13 +01:00
AmandineLP e52b5d94a9 Translate to FR 2018-01-22 21:13:03 +01:00
AmandineLP d90f27a21f Translate to FR 2018-01-22 21:12:06 +01:00
AmandineLP 03cf9710e3 Translate to FR 2018-01-22 21:10:00 +01:00
AmandineLP 1dcdd8d568 Translate to FR 2018-01-22 20:02:47 +01:00
AmandineLP 4344fb1faf translate to FR 2018-01-22 20:01:00 +01:00
Matthew Hodgson 846577ebde fork notif templates 2018-01-22 19:55:27 +01:00
Matthew Hodgson 3869981227 remove unreachable except block 2018-01-22 18:43:41 +01:00
Matthew Hodgson fa80b492a5 fix thinko 2018-01-22 18:43:41 +01:00
Richard van der Hoff c776c52eed Back out unrelated changes 2018-01-22 16:44:39 +00:00
Matthew Hodgson b424c16f50 fix tests 2018-01-22 15:25:25 +01:00
Matthew Hodgson 313a489fc9 incorporate PR feedback 2018-01-22 14:54:46 +01:00
Matthew Hodgson 4b090cb273 add federation_domain_whitelist
gives a way to restrict which domains your HS is allowed to federate with.
useful mainly for gracefully preventing a private but internet-connected HS from trying to federate to the wider public Matrix network
2018-01-22 12:13:41 +01:00
Matthew Hodgson 3f79378d4b make replication tests pass on OSX 2018-01-20 17:23:27 +00:00
556 changed files with 24270 additions and 7294 deletions
+13
View File
@@ -0,0 +1,13 @@
CI
BUILDKITE
BUILDKITE_BUILD_NUMBER
BUILDKITE_BRANCH
BUILDKITE_BUILD_NUMBER
BUILDKITE_JOB_ID
BUILDKITE_BUILD_URL
BUILDKITE_PROJECT_SLUG
BUILDKITE_COMMIT
BUILDKITE_PULL_REQUEST
BUILDKITE_TAG
CODECOV_TOKEN
TRIAL_FLAGS
+23
View File
@@ -0,0 +1,23 @@
version: '3.1'
services:
postgres:
image: postgres:${POSTGRES_VERSION?}
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: "--lc-collate C --lc-ctype C --encoding UTF8"
command: -c fsync=off
testenv:
image: python:${PYTHON_VERSION?}
depends_on:
- postgres
env_file: docker-compose-env
environment:
SYNAPSE_POSTGRES_HOST: postgres
SYNAPSE_POSTGRES_USER: postgres
SYNAPSE_POSTGRES_PASSWORD: postgres
working_dir: /src
volumes:
- ${BUILDKITE_BUILD_CHECKOUT_PATH}:/src
+497
View File
@@ -0,0 +1,497 @@
# This is just a dummy entry (the `x-yaml-aliases` key is not an official pipeline key, and will be ignored by BuildKite)
# that we use only to store YAML anchors (`&xxx`), that we plan to use and reference later in the YAML file (using `*xxx`)
# without having to copy/paste the same values over and over.
# Note: keys like `agent`, `env`, … used here are totally arbitrary; the only point is to define various separate `&xxx` anchors there.
#
x-yaml-aliases:
commands:
- &trial_setup |
# Install additional packages that are not part of buildpack-deps / python images.
apt-get update && apt-get install -y xmlsec1
python -m pip install tox
retry: &retry_setup
automatic:
- exit_status: -1
limit: 2
- exit_status: 2
limit: 2
env:
COVERALLS_REPO_TOKEN: wsJWOby6j0uCYFiCes3r0XauxO27mx8lD
steps:
- label: "\U0001F9F9 Check Style"
command:
- "python -m pip install tox"
- "tox -e check_codestyle"
plugins:
- docker#v3.7.0:
image: "python:3.6"
mount-buildkite-agent: false
- label: "\U0001F9F9 packaging"
command:
- "python -m pip install tox"
- "tox -e packaging"
plugins:
- docker#v3.7.0:
image: "python:3.6"
mount-buildkite-agent: false
- label: "\U0001F9F9 isort"
command:
- "python -m pip install tox"
- "tox -e check_isort"
plugins:
- docker#v3.7.0:
image: "python:3.6"
mount-buildkite-agent: false
- label: "\U0001F9F9 check-sample-config"
command:
- "python -m pip install tox"
- "tox -e check-sampleconfig"
plugins:
- docker#v3.7.0:
image: "python:3.6"
mount-buildkite-agent: false
- label: "\U0001F5A5 check unix line-endings"
command:
- "scripts-dev/check_line_terminators.sh"
plugins:
- docker#v3.7.0:
image: "python:3.6"
mount-buildkite-agent: false
- label: ":mypy: mypy"
command:
- "python -m pip install tox"
- "tox -e mypy"
plugins:
- docker#v3.7.0:
image: "python:3.7"
mount-buildkite-agent: false
- label: ":package: build distribution files"
branches: "release-*"
agents:
queue: ephemeral-small
command:
- python setup.py sdist bdist_wheel
plugins:
- docker#v3.7.0:
image: "python:3.7"
mount-buildkite-agent: false
- artifacts#v1.3.0:
upload:
- dist/*
- wait
################################################################################
#
# Twisted `trial` tests
#
# Our Intent is to test:
# - All supported Python versions (using SQLite) with current dependencies
# - The oldest and newest supported pairings of Python and PostgreSQL
#
# We also test two special cases:
# - The newest supported Python, without any optional dependencies
# - The oldest supported Python, with its oldest supported dependency versions
#
################################################################################
# -- Special Case: Oldest Python w/ Oldest Deps
# anoa: I've commented this out for DINUM as it was breaking on the 1.31.0 merge
# and it was taking way too long to solve. DINUM aren't even using Python 3.6
# anyways.
# - label: ":python: 3.6 (Old Deps)"
# command:
# - ".buildkite/scripts/test_old_deps.sh"
# env:
# TRIAL_FLAGS: "-j 2"
# plugins:
# - docker#v3.7.0:
# # We use bionic to get an old python (3.6.5) and sqlite (3.22)
# image: "ubuntu:bionic"
# workdir: "/src"
# mount-buildkite-agent: false
# propagate-environment: true
# - artifacts#v1.3.0:
# upload: [ "_trial_temp/*/*.log" ]
# retry: *retry_setup
# -- Special Case: Newest Python w/o Optional Deps
- label: ":python: 3.9 (No Extras)"
command:
- *trial_setup
- "tox -e py39-noextras,combine"
env:
TRIAL_FLAGS: "-j 2"
plugins:
- docker#v3.7.0:
image: "python:3.9"
workdir: "/src"
mount-buildkite-agent: false
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup
# -- All Supported Python Versions (SQLite)
- label: ":python: 3.6"
command:
- *trial_setup
- "tox -e py36,combine"
env:
TRIAL_FLAGS: "-j 2"
plugins:
- docker#v3.7.0:
image: "python:3.6"
workdir: "/src"
mount-buildkite-agent: false
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup
- label: ":python: 3.7"
command:
- *trial_setup
- "tox -e py37,combine"
env:
TRIAL_FLAGS: "-j 2"
plugins:
- docker#v3.7.0:
image: "python:3.7"
workdir: "/src"
mount-buildkite-agent: false
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup
- label: ":python: 3.8"
command:
- *trial_setup
- "tox -e py38,combine"
env:
TRIAL_FLAGS: "-j 2"
plugins:
- docker#v3.7.0:
image: "python:3.8"
workdir: "/src"
mount-buildkite-agent: false
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup
- label: ":python: 3.9"
command:
- *trial_setup
- "tox -e py39,combine"
env:
TRIAL_FLAGS: "-j 2"
plugins:
- docker#v3.7.0:
image: "python:3.9"
workdir: "/src"
mount-buildkite-agent: false
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup
# -- Oldest and Newest Supported Python and Postgres Pairings
- label: ":python: 3.6 :postgres: 9.6"
agents:
queue: "medium"
env:
TRIAL_FLAGS: "-j 8"
PYTHON_VERSION: "3.6"
POSTGRES_VERSION: "9.6"
command:
- *trial_setup
- "python -m tox -e py36-postgres,combine"
plugins:
- matrix-org/download#v1.1.0:
urls:
- https://raw.githubusercontent.com/matrix-org/pipelines/master/synapse/docker-compose.yaml
- https://raw.githubusercontent.com/matrix-org/pipelines/master/synapse/docker-compose-env
- docker-compose#v3.7.0:
run: testenv
config:
- /tmp/download-${BUILDKITE_BUILD_ID}/docker-compose.yaml
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup
- label: ":python: 3.9 :postgres: 13"
agents:
queue: "medium"
env:
TRIAL_FLAGS: "-j 8"
PYTHON_VERSION: "3.9"
POSTGRES_VERSION: "13"
command:
- *trial_setup
- "python -m tox -e py39-postgres,combine"
plugins:
- matrix-org/download#v1.1.0:
urls:
- https://raw.githubusercontent.com/matrix-org/pipelines/master/synapse/docker-compose.yaml
- https://raw.githubusercontent.com/matrix-org/pipelines/master/synapse/docker-compose-env
- docker-compose#v3.7.0:
run: testenv
config:
- /tmp/download-${BUILDKITE_BUILD_ID}/docker-compose.yaml
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup
# -- Experimentally test against PyPy
# Only runs when the build message includes the string "pypy"
# This step is allowed to fail
- label: ":python: PyPy3.6"
if: "build.message =~ /pypy/i || build.branch =~ /pypy/i"
soft_fail: true
command:
# No *trial_setup due to docker-library/pypy#52
- "apt-get update && apt-get install -y xmlsec1"
- "pypy -m pip install tox"
- "tox -e pypy36,combine"
env:
TRIAL_FLAGS: "-j 2"
plugins:
- docker#v3.7.0:
image: "pypy:3.6"
workdir: "/src"
mount-buildkite-agent: false
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup
################################################################################
#
# Sytest
#
# Our tests have three dimensions:
# 1. Topology (Monolith, Workers, Workers w/ Redis)
# 2. Database (SQLite, PostgreSQL)
# 3. Python Version
#
# Tests can run against either a single or multiple PostgreSQL databases.
# This is configured by setting `MULTI_POSTGRES=1` in the environment.
#
# We mostly care about testing each topology.
# For DINSIC specifically, we currently test across one Linux distribution,
# Debian buster (10), which has Python 3.7 and Postgres 11
#
# TODO: this leaves us without sytests for Postgres 9.6. How much do we care
# about that?
#
# Our intent is to test:
# - Monolith:
# - Older Distro + SQLite
# - Older Python + Older PostgreSQL
# - Newer Python + Newer PostgreSQL
# - Workers:
# - Older Python + Older PostgreSQL (MULTI_POSTGRES)
# - Newer Python + Newer PostgreSQL (MULTI_POSTGRES)
# - Workers w/ Redis:
# - Newer Python + Newer PostgreSQL
#
################################################################################
- label: "SyTest Monolith :postgres::debian: 10"
agents:
queue: "medium"
env:
POSTGRES: "1"
command:
- "bash .buildkite/merge_base_branch.sh"
- "bash /bootstrap.sh synapse"
plugins:
- docker#v3.7.0:
image: "matrixdotorg/sytest-synapse:dinsic"
propagate-environment: true
always-pull: true
workdir: "/src"
entrypoint: "/bin/sh"
init: false
shell: ["-x", "-c"]
mount-buildkite-agent: false
volumes: ["./logs:/logs"]
- artifacts#v1.3.0:
upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
- matrix-org/annotate:
path: "logs/annotate.md"
style: "error"
retry: *retry_setup
- label: "SyTest Workers :postgres::debian: 10"
agents:
queue: "xlarge"
env:
MULTI_POSTGRES: "1" # Test with split out databases
POSTGRES: "1"
WORKERS: "1"
BLACKLIST: "synapse-blacklist-with-workers"
command:
- "bash .buildkite/merge_base_branch.sh"
- "bash -c 'cat /src/sytest-blacklist /src/.buildkite/worker-blacklist > /src/synapse-blacklist-with-workers'"
- "bash /bootstrap.sh synapse"
plugins:
- docker#v3.7.0:
image: "matrixdotorg/sytest-synapse:dinsic"
propagate-environment: true
always-pull: true
workdir: "/src"
entrypoint: "/bin/sh"
init: false
shell: ["-x", "-c"]
mount-buildkite-agent: false
volumes: ["./logs:/logs"]
- artifacts#v1.3.0:
upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
- matrix-org/annotate:
path: "logs/annotate.md"
style: "error"
retry: *retry_setup
- label: "SyTest Workers :redis::postgres::debian: 10"
agents:
# this one seems to need a lot of memory.
queue: "xlarge"
env:
POSTGRES: "1"
WORKERS: "1"
REDIS: "1"
BLACKLIST: "synapse-blacklist-with-workers"
command:
- "bash .buildkite/merge_base_branch.sh"
- "bash -c 'cat /src/sytest-blacklist /src/.buildkite/worker-blacklist > /src/synapse-blacklist-with-workers'"
- "bash /bootstrap.sh synapse"
plugins:
- docker#v3.7.0:
image: "matrixdotorg/sytest-synapse:dinsic"
propagate-environment: true
always-pull: true
workdir: "/src"
entrypoint: "/bin/sh"
init: false
shell: ["-x", "-c"]
mount-buildkite-agent: false
volumes: ["./logs:/logs"]
- artifacts#v1.3.0:
upload: [ "logs/**/*.log", "logs/**/*.log.*", "logs/results.tap" ]
- matrix-org/annotate:
path: "logs/annotate.md"
style: "error"
retry: *retry_setup
################################################################################
#
# synapse_port_db
#
# Tests the oldest and newest supported pairings of Python and PostgreSQL
#
################################################################################
- label: "Port DB :python: 3.6 :postgres: 9.6"
agents:
queue: "medium"
env:
PYTHON_VERSION: "3.6"
POSTGRES_VERSION: "9.6"
command:
- "bash .buildkite/scripts/test_synapse_port_db.sh"
plugins:
- matrix-org/download#v1.1.0:
urls:
- https://raw.githubusercontent.com/matrix-org/synapse-dinsic/anoa/dinsic_release_1_31_0/.buildkite/docker-compose.yaml
- https://raw.githubusercontent.com/matrix-org/synapse-dinsic/anoa/dinsic_release_1_31_0/.buildkite/docker-compose-env
- docker-compose#v2.1.0:
run: testenv
config:
- /tmp/download-${BUILDKITE_BUILD_ID}/docker-compose.yaml
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
- label: "Port DB :python: 3.9 :postgres: 13"
agents:
queue: "medium"
env:
PYTHON_VERSION: "3.9"
POSTGRES_VERSION: "13"
command:
- "bash .buildkite/scripts/test_synapse_port_db.sh"
plugins:
- matrix-org/download#v1.1.0:
urls:
- https://raw.githubusercontent.com/matrix-org/synapse-dinsic/anoa/dinsic_release_1_31_0/.buildkite/docker-compose.yaml
- https://raw.githubusercontent.com/matrix-org/synapse-dinsic/anoa/dinsic_release_1_31_0/.buildkite/docker-compose-env
- docker-compose#v2.1.0:
run: testenv
config:
- /tmp/download-${BUILDKITE_BUILD_ID}/docker-compose.yaml
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - wait: ~
# continue_on_failure: true
#
# - label: Trigger webhook
# command: "curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d \"payload[build_num]=$BUILDKITE_BUILD_NUMBER&payload[status]=done\""
################################################################################
#
# Complement Test Suite
#
################################################################################
- command:
# Build a docker image from the checked out Synapse source
- "docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile ."
# We use the complement:latest image to provide Complement's dependencies, but want
# to actually run against the latest version of Complement, so download it here.
# NOTE: We use the `anoa/knock_room_v7` branch here while knocking is still experimental on mainline.
# This branch essentially uses the stable identifiers for all knock-related room state so that things
# don't clash when rooms created on dinsic's Synapse potentially federate with mainline Synapse's in
# the future.
- "wget https://github.com/matrix-org/complement/archive/anoa/knock_room_v7.tar.gz"
- "tar -xzf knock_room_v7.tar.gz"
# Build a second docker image on top of the above image. This one sets up Synapse with a generated config file,
# signing and SSL keys so Synapse can run and federate
- "docker build -t complement-synapse -f complement-anoa-knock_room_v7/dockerfiles/Synapse.Dockerfile complement-anoa-knock_room_v7/dockerfiles"
# Finally, compile and run the tests.
- "cd complement-anoa-knock_room_v7"
- "COMPLEMENT_BASE_IMAGE=complement-synapse:latest go test -v -tags synapse_blacklist,msc2403 ./tests"
label: "\U0001F9EA Complement"
agents:
queue: "medium"
plugins:
- docker#v3.7.0:
# The dockerfile for this image is at https://github.com/matrix-org/complement/blob/master/dockerfiles/ComplementCIBuildkite.Dockerfile.
image: "matrixdotorg/complement:latest"
mount-buildkite-agent: false
# Complement needs to know if it is running under CI
environment:
- "CI=true"
publish: [ "8448:8448" ]
# Complement uses Docker so pass through the docker socket. This means Complement shares
# the hosts Docker.
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Test for the export-data admin command against sqlite and postgres
set -xe
cd "$(dirname "$0")/../.."
echo "--- Install dependencies"
# Install dependencies for this test.
pip install psycopg2
# Install Synapse itself. This won't update any libraries.
pip install -e .
echo "--- Generate the signing key"
# Generate the server's signing key.
python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
echo "--- Prepare test database"
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
# Run the export-data command on the sqlite test database
python -m synapse.app.admin_cmd -c .ci/sqlite-config.yaml export-data @anon-20191002_181700-832:localhost:8800 \
--output-directory /tmp/export_data
# Test that the output directory exists and contains the rooms directory
dir="/tmp/export_data/rooms"
if [ -d "$dir" ]; then
echo "Command successful, this test passes"
else
echo "No output directories found, the command fails against a sqlite database."
exit 1
fi
# Create the PostgreSQL database.
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
# Port the SQLite databse to postgres so we can check command works against postgres
echo "+++ Port SQLite3 databse to postgres"
scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
# Run the export-data command on postgres database
python -m synapse.app.admin_cmd -c .ci/postgres-config.yaml export-data @anon-20191002_181700-832:localhost:8800 \
--output-directory /tmp/export_data2
# Test that the output directory exists and contains the rooms directory
dir2="/tmp/export_data2/rooms"
if [ -d "$dir2" ]; then
echo "Command successful, this test passes"
else
echo "No output directories found, the command fails against a postgres database."
exit 1
fi
+3 -3
View File
@@ -7,7 +7,7 @@
set -xe
cd `dirname $0`/../..
cd "$(dirname "$0")/../.."
echo "--- Install dependencies"
@@ -25,7 +25,7 @@ python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
echo "--- Prepare test database"
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
scripts-dev/update_database --database-config .ci/sqlite-config.yaml
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
# Create the PostgreSQL database.
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
@@ -46,7 +46,7 @@ echo "--- Prepare empty SQLite database"
# we do this by deleting the sqlite db, and then doing the same again.
rm .ci/test_db.db
scripts-dev/update_database --database-config .ci/sqlite-config.yaml
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
# re-create the PostgreSQL database.
.ci/scripts/postgres_exec.py \
+2
View File
@@ -0,0 +1,2 @@
# Automatically request reviews from the synapse-core team when a pull request comes in.
* @matrix-org/synapse-core
+5 -4
View File
@@ -1,12 +1,13 @@
### Pull Request Checklist
<!-- Please read CONTRIBUTING.md before submitting your pull request -->
<!-- Please read https://matrix-org.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request -->
* [ ] Pull request is based on the develop branch
* [ ] Pull request includes a [changelog file](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#changelog). The entry should:
* [ ] Pull request includes a [changelog file](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should:
- Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
- Use markdown where necessary, mostly for `code blocks`.
- End with either a period (.) or an exclamation mark (!).
- Start with a capital letter.
* [ ] Pull request includes a [sign off](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#sign-off)
* [ ] Code style is correct (run the [linters](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#code-style))
* [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
* [ ] [Code style](https://matrix-org.github.io/synapse/latest/code_style.html) is correct
(run the [linters](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
+16
View File
@@ -0,0 +1,16 @@
name: "Assign Reviewers"
on:
pull_request:
types: [opened, ready_for_review]
jobs:
assign-reviewers:
runs-on: ubuntu-latest
steps:
- name: "Assign Team and Persons"
uses: rowi1de/auto-assign-review-teams@v1.0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
teams: synapse-core # only works for GitHub Organisation/Teams
include-draft: false # Draft PRs will be skipped (default: false)
skip-with-manual-reviewers: 1 # Skip this action, if the number of reviwers was already assigned (default: 0)
+4 -1
View File
@@ -5,7 +5,7 @@ name: Build docker images
on:
push:
tags: ["v*"]
branches: [ master, main ]
branches: [ master, main, develop ]
workflow_dispatch:
permissions:
@@ -38,6 +38,9 @@ jobs:
id: set-tag
run: |
case "${GITHUB_REF}" in
refs/heads/develop)
tag=develop
;;
refs/heads/master|refs/heads/main)
tag=latest
;;
+52 -21
View File
@@ -76,22 +76,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
database: ["sqlite"]
toxenv: ["py"]
include:
# Newest Python without optional deps
- python-version: "3.9"
toxenv: "py-noextras,combine"
- python-version: "3.10"
toxenv: "py-noextras"
# Oldest Python with PostgreSQL
- python-version: "3.6"
database: "postgres"
postgres-version: "9.6"
toxenv: "py"
# Newest Python with PostgreSQL
- python-version: "3.9"
# Newest Python with newest PostgreSQL
- python-version: "3.10"
database: "postgres"
postgres-version: "13"
postgres-version: "14"
toxenv: "py"
steps:
- uses: actions/checkout@v2
@@ -111,7 +114,7 @@ jobs:
if: ${{ matrix.postgres-version }}
timeout-minutes: 2
run: until pg_isready -h localhost; do sleep 1; done
- run: tox -e py,combine
- run: tox -e ${{ matrix.toxenv }}
env:
TRIAL_FLAGS: "--jobs=2"
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }}
@@ -119,6 +122,8 @@ jobs:
SYNAPSE_POSTGRES_USER: postgres
SYNAPSE_POSTGRES_PASSWORD: postgres
- name: Dump logs
# Logs are most useful when the command fails, always include them.
if: ${{ always() }}
# Note: Dumps to workflow logs instead of using actions/upload-artifact
# This keeps logs colocated with failing jobs
# It also ignores find's exit code; this is a best effort affair
@@ -143,6 +148,8 @@ jobs:
env:
TRIAL_FLAGS: "--jobs=2"
- name: Dump logs
# Logs are most useful when the command fails, always include them.
if: ${{ always() }}
# Note: Dumps to workflow logs instead of using actions/upload-artifact
# This keeps logs colocated with failing jobs
# It also ignores find's exit code; this is a best effort affair
@@ -169,10 +176,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- run: pip install tox
- run: tox -e py,combine
- run: tox -e py
env:
TRIAL_FLAGS: "--jobs=2"
- name: Dump logs
# Logs are most useful when the command fails, always include them.
if: ${{ always() }}
# Note: Dumps to workflow logs instead of using actions/upload-artifact
# This keeps logs colocated with failing jobs
# It also ignores find's exit code; this is a best effort affair
@@ -204,23 +213,16 @@ jobs:
fail-fast: false
matrix:
include:
- sytest-tag: bionic
- sytest-tag: dinsic
- sytest-tag: bionic
- sytest-tag: dinsic
postgres: postgres
- sytest-tag: testing
postgres: postgres
- sytest-tag: bionic
- sytest-tag: dinsic
postgres: multi-postgres
workers: workers
- sytest-tag: buster
postgres: multi-postgres
workers: workers
- sytest-tag: buster
- sytest-tag: dinsic
postgres: postgres
workers: workers
redis: redis
@@ -244,6 +246,35 @@ jobs:
/logs/results.tap
/logs/**/*.log*
export-data:
if: ${{ !failure() && !cancelled() }} # Allow previous steps to be skipped, but not fail
needs: [linting-done, portdb]
runs-on: ubuntu-latest
env:
TOP: ${{ github.workspace }}
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: "postgres"
POSTGRES_INITDB_ARGS: "--lc-collate C --lc-ctype C --encoding UTF8"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- run: sudo apt-get -qq install xmlsec1
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- run: .ci/scripts/test_export_data_command.sh
portdb:
if: ${{ !failure() && !cancelled() }} # Allow previous steps to be skipped, but not fail
needs: linting-done
@@ -256,8 +287,8 @@ jobs:
- python-version: "3.6"
postgres-version: "9.6"
- python-version: "3.9"
postgres-version: "13"
- python-version: "3.10"
postgres-version: "14"
services:
postgres:
-90
View File
@@ -1,90 +0,0 @@
name: Twisted Trunk
on:
schedule:
- cron: 0 8 * * *
workflow_dispatch:
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: .ci/patch_for_twisted_trunk.sh
- run: pip install tox
- run: tox -e mypy
trial:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo apt-get -qq install xmlsec1
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: .ci/patch_for_twisted_trunk.sh
- run: pip install tox
- run: tox -e py
env:
TRIAL_FLAGS: "--jobs=2"
- name: Dump logs
# Note: Dumps to workflow logs instead of using actions/upload-artifact
# This keeps logs colocated with failing jobs
# It also ignores find's exit code; this is a best effort affair
run: >-
find _trial_temp -name '*.log'
-exec echo "::group::{}" \;
-exec cat {} \;
-exec echo "::endgroup::" \;
|| true
sytest:
runs-on: ubuntu-latest
container:
image: matrixdotorg/sytest-synapse:buster
volumes:
- ${{ github.workspace }}:/src
steps:
- uses: actions/checkout@v2
- name: Patch dependencies
run: .ci/patch_for_twisted_trunk.sh
working-directory: /src
- name: Run SyTest
run: /bootstrap.sh synapse
working-directory: /src
- name: Summarise results.tap
if: ${{ always() }}
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap
- name: Upload SyTest logs
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: Sytest Logs - ${{ job.status }} - (${{ join(matrix.*, ', ') }})
path: |
/logs/results.tap
/logs/**/*.log*
# open an issue if the build fails, so we know about it.
open-issue:
if: failure()
needs:
- mypy
- trial
- sytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: JasonEtco/create-an-issue@5d9504915f79f9cc6d791934b8ef34f2353dd74d # v2.5.0, 2020-12-06
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
update_existing: true
filename: .ci/twisted_trunk_build_failed_issue_template.md
+445 -4
View File
@@ -1,3 +1,444 @@
Synapse 1.48.0 (2021-11-30)
===========================
This release removes support for the long-deprecated `trust_identity_server_for_password_resets` configuration flag.
This release also fixes some performance issues with some background database updates introduced in Synapse 1.47.0.
No significant changes since 1.48.0rc1.
Synapse 1.48.0rc1 (2021-11-25)
==============================
Features
--------
- Experimental support for the thread relation defined in [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440). ([\#11161](https://github.com/matrix-org/synapse/issues/11161))
- Support filtering by relation senders & types per [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440). ([\#11236](https://github.com/matrix-org/synapse/issues/11236))
- Add support for the `/_matrix/client/v3` and `/_matrix/media/v3` APIs from Matrix v1.1. ([\#11318](https://github.com/matrix-org/synapse/issues/11318), [\#11371](https://github.com/matrix-org/synapse/issues/11371))
- Support the stable version of [MSC2778](https://github.com/matrix-org/matrix-doc/pull/2778): the `m.login.application_service` login type. Contributed by @tulir. ([\#11335](https://github.com/matrix-org/synapse/issues/11335))
- Add a new version of delete room admin API `DELETE /_synapse/admin/v2/rooms/<room_id>` to run it in the background. Contributed by @dklimpel. ([\#11223](https://github.com/matrix-org/synapse/issues/11223))
- Allow the admin [Delete Room API](https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#delete-room-api) to block a room without the need to join it. ([\#11228](https://github.com/matrix-org/synapse/issues/11228))
- Add an admin API to un-shadow-ban a user. ([\#11347](https://github.com/matrix-org/synapse/issues/11347))
- Add an admin API to run background database schema updates. ([\#11352](https://github.com/matrix-org/synapse/issues/11352))
- Add an admin API for blocking a room. ([\#11324](https://github.com/matrix-org/synapse/issues/11324))
- Update the JWT login type to support custom a `sub` claim. ([\#11361](https://github.com/matrix-org/synapse/issues/11361))
- Store and allow querying of arbitrary event relations. ([\#11391](https://github.com/matrix-org/synapse/issues/11391))
Bugfixes
--------
- Fix a long-standing bug wherein display names or avatar URLs containing null bytes cause an internal server error when stored in the DB. ([\#11230](https://github.com/matrix-org/synapse/issues/11230))
- Prevent [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) historical state events from being pushed to an application service via `/transactions`. ([\#11265](https://github.com/matrix-org/synapse/issues/11265))
- Fix a long-standing bug where uploading extremely thin images (e.g. 1000x1) would fail. Contributed by @Neeeflix. ([\#11288](https://github.com/matrix-org/synapse/issues/11288))
- Fix a bug, introduced in Synapse 1.46.0, which caused the `check_3pid_auth` and `on_logged_out` callbacks in legacy password authentication provider modules to not be registered. Modules using the generic module interface were not affected. ([\#11340](https://github.com/matrix-org/synapse/issues/11340))
- Fix a bug introduced in 1.41.0 where space hierarchy responses would be incorrectly reused if multiple users were to make the same request at the same time. ([\#11355](https://github.com/matrix-org/synapse/issues/11355))
- Fix a bug introduced in 1.45.0 where the `read_templates` method of the module API would error. ([\#11377](https://github.com/matrix-org/synapse/issues/11377))
- Fix an issue introduced in 1.47.0 which prevented servers re-joining rooms they had previously left, if their signing keys were replaced. ([\#11379](https://github.com/matrix-org/synapse/issues/11379))
- Fix a bug introduced in 1.13.0 where creating and publishing a room could cause errors if `room_list_publication_rules` is configured. ([\#11392](https://github.com/matrix-org/synapse/issues/11392))
- Improve performance of various background database updates. ([\#11421](https://github.com/matrix-org/synapse/issues/11421), [\#11422](https://github.com/matrix-org/synapse/issues/11422))
Improved Documentation
----------------------
- Suggest users of the Debian packages add configuration to `/etc/matrix-synapse/conf.d/` to prevent, upon upgrade, being asked to choose between their configuration and the maintainer's. ([\#11281](https://github.com/matrix-org/synapse/issues/11281))
- Fix typos in the documentation for the `username_available` admin API. Contributed by Stanislav Motylkov. ([\#11286](https://github.com/matrix-org/synapse/issues/11286))
- Add Single Sign-On, SAML and CAS pages to the documentation. ([\#11298](https://github.com/matrix-org/synapse/issues/11298))
- Change the word 'Home server' as one word 'homeserver' in documentation. ([\#11320](https://github.com/matrix-org/synapse/issues/11320))
- Fix missing quotes for wildcard domains in `federation_certificate_verification_whitelist`. ([\#11381](https://github.com/matrix-org/synapse/issues/11381))
Deprecations and Removals
-------------------------
- Remove deprecated `trust_identity_server_for_password_resets` configuration flag. ([\#11333](https://github.com/matrix-org/synapse/issues/11333), [\#11395](https://github.com/matrix-org/synapse/issues/11395))
Internal Changes
----------------
- Add type annotations to `synapse.metrics`. ([\#10847](https://github.com/matrix-org/synapse/issues/10847))
- Split out federated PDU retrieval function into a non-cached version. ([\#11242](https://github.com/matrix-org/synapse/issues/11242))
- Clean up code relating to to-device messages and sending ephemeral events to application services. ([\#11247](https://github.com/matrix-org/synapse/issues/11247))
- Fix a small typo in the error response when a relation type other than 'm.annotation' is passed to `GET /rooms/{room_id}/aggregations/{event_id}`. ([\#11278](https://github.com/matrix-org/synapse/issues/11278))
- Drop unused database tables `room_stats_historical` and `user_stats_historical`. ([\#11280](https://github.com/matrix-org/synapse/issues/11280))
- Require all files in synapse/ and tests/ to pass mypy unless specifically excluded. ([\#11282](https://github.com/matrix-org/synapse/issues/11282), [\#11285](https://github.com/matrix-org/synapse/issues/11285), [\#11359](https://github.com/matrix-org/synapse/issues/11359))
- Add missing type hints to `synapse.app`. ([\#11287](https://github.com/matrix-org/synapse/issues/11287))
- Remove unused parameters on `FederationEventHandler._check_event_auth`. ([\#11292](https://github.com/matrix-org/synapse/issues/11292))
- Add type hints to `synapse._scripts`. ([\#11297](https://github.com/matrix-org/synapse/issues/11297))
- Fix an issue which prevented the `remove_deleted_devices_from_device_inbox` background database schema update from running when updating from a recent Synapse version. ([\#11303](https://github.com/matrix-org/synapse/issues/11303))
- Add type hints to storage classes. ([\#11307](https://github.com/matrix-org/synapse/issues/11307), [\#11310](https://github.com/matrix-org/synapse/issues/11310), [\#11311](https://github.com/matrix-org/synapse/issues/11311), [\#11312](https://github.com/matrix-org/synapse/issues/11312), [\#11313](https://github.com/matrix-org/synapse/issues/11313), [\#11314](https://github.com/matrix-org/synapse/issues/11314), [\#11316](https://github.com/matrix-org/synapse/issues/11316), [\#11322](https://github.com/matrix-org/synapse/issues/11322), [\#11332](https://github.com/matrix-org/synapse/issues/11332), [\#11339](https://github.com/matrix-org/synapse/issues/11339), [\#11342](https://github.com/matrix-org/synapse/issues/11342))
- Add type hints to `synapse.util`. ([\#11321](https://github.com/matrix-org/synapse/issues/11321), [\#11328](https://github.com/matrix-org/synapse/issues/11328))
- Improve type annotations in Synapse's test suite. ([\#11323](https://github.com/matrix-org/synapse/issues/11323), [\#11330](https://github.com/matrix-org/synapse/issues/11330))
- Test that room alias deletion works as intended. ([\#11327](https://github.com/matrix-org/synapse/issues/11327))
- Add type annotations for some methods and properties in the module API. ([\#11341](https://github.com/matrix-org/synapse/issues/11341))
- Fix running `scripts-dev/complement.sh`, which was broken in v1.47.0rc1. ([\#11368](https://github.com/matrix-org/synapse/issues/11368))
- Rename internal functions for token generation to better reflect what they do. ([\#11369](https://github.com/matrix-org/synapse/issues/11369), [\#11370](https://github.com/matrix-org/synapse/issues/11370))
- Add type hints to configuration classes. ([\#11377](https://github.com/matrix-org/synapse/issues/11377))
- Publish a `develop` image to Docker Hub. ([\#11380](https://github.com/matrix-org/synapse/issues/11380))
- Keep fallback key marked as used if it's re-uploaded. ([\#11382](https://github.com/matrix-org/synapse/issues/11382))
- Use `auto_attribs` on the `attrs` class `RefreshTokenLookupResult`. ([\#11386](https://github.com/matrix-org/synapse/issues/11386))
- Rename unstable `access_token_lifetime` configuration option to `refreshable_access_token_lifetime` to make it clear it only concerns refreshable access tokens. ([\#11388](https://github.com/matrix-org/synapse/issues/11388))
- Do not run the broken MSC2716 tests when running `scripts-dev/complement.sh`. ([\#11389](https://github.com/matrix-org/synapse/issues/11389))
- Remove dead code from supporting ACME. ([\#11393](https://github.com/matrix-org/synapse/issues/11393))
- Refactor including the bundled relations when serializing an event. ([\#11408](https://github.com/matrix-org/synapse/issues/11408))
Synapse 1.47.1 (2021-11-23)
===========================
This release fixes a security issue in the media store, affecting all prior releases of Synapse. Server administrators are encouraged to update Synapse as soon as possible. We are not aware of these vulnerabilities being exploited in the wild.
Server administrators who are unable to update Synapse may use the workarounds described in the linked GitHub Security Advisory below.
Security advisory
-----------------
The following issue is fixed in 1.47.1.
- **[GHSA-3hfw-x7gx-437c](https://github.com/matrix-org/synapse/security/advisories/GHSA-3hfw-x7gx-437c) / [CVE-2021-41281](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41281): Path traversal when downloading remote media.**
Synapse instances with the media repository enabled can be tricked into downloading a file from a remote server into an arbitrary directory, potentially outside the media store directory.
The last two directories and file name of the path are chosen randomly by Synapse and cannot be controlled by an attacker, which limits the impact.
Homeservers with the media repository disabled are unaffected. Homeservers configured with a federation whitelist are also unaffected.
Fixed by [91f2bd090](https://github.com/matrix-org/synapse/commit/91f2bd090).
Synapse 1.47.0 (2021-11-17)
===========================
No significant changes since 1.47.0rc3.
Synapse 1.47.0rc3 (2021-11-16)
==============================
Bugfixes
--------
- Fix a bug introduced in 1.47.0rc1 which caused worker processes to not halt startup in the presence of outstanding database migrations. ([\#11346](https://github.com/matrix-org/synapse/issues/11346))
- Fix a bug introduced in 1.47.0rc1 which prevented the 'remove deleted devices from `device_inbox` column' background process from running when updating from a recent Synapse version. ([\#11303](https://github.com/matrix-org/synapse/issues/11303), [\#11353](https://github.com/matrix-org/synapse/issues/11353))
Synapse 1.47.0rc2 (2021-11-10)
==============================
This fixes an issue with publishing the Debian packages for 1.47.0rc1.
It is otherwise identical to 1.47.0rc1.
Synapse 1.47.0rc1 (2021-11-09)
==============================
Deprecations and Removals
-------------------------
- The `user_may_create_room_with_invites` module callback is now deprecated. Please refer to the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#upgrading-to-v1470) for more information. ([\#11206](https://github.com/matrix-org/synapse/issues/11206))
- Remove deprecated admin API to delete rooms (`POST /_synapse/admin/v1/rooms/<room_id>/delete`). ([\#11213](https://github.com/matrix-org/synapse/issues/11213))
Features
--------
- Advertise support for Client-Server API r0.6.1. ([\#11097](https://github.com/matrix-org/synapse/issues/11097))
- Add search by room ID and room alias to the List Room admin API. ([\#11099](https://github.com/matrix-org/synapse/issues/11099))
- Add an `on_new_event` third-party rules callback to allow Synapse modules to act after an event has been sent into a room. ([\#11126](https://github.com/matrix-org/synapse/issues/11126))
- Add a module API method to update a user's membership in a room. ([\#11147](https://github.com/matrix-org/synapse/issues/11147))
- Add metrics for thread pool usage. ([\#11178](https://github.com/matrix-org/synapse/issues/11178))
- Support the stable room type field for [MSC3288](https://github.com/matrix-org/matrix-doc/pull/3288). ([\#11187](https://github.com/matrix-org/synapse/issues/11187))
- Add a module API method to retrieve the current state of a room. ([\#11204](https://github.com/matrix-org/synapse/issues/11204))
- Calculate a default value for `public_baseurl` based on `server_name`. ([\#11210](https://github.com/matrix-org/synapse/issues/11210))
- Add support for serving `/.well-known/matrix/server` files, to redirect federation traffic to port 443. ([\#11211](https://github.com/matrix-org/synapse/issues/11211))
- Add admin APIs to pause, start and check the status of background updates. ([\#11263](https://github.com/matrix-org/synapse/issues/11263))
Bugfixes
--------
- Fix a long-standing bug which allowed hidden devices to receive to-device messages, resulting in unnecessary database bloat. ([\#10097](https://github.com/matrix-org/synapse/issues/10097))
- Fix a long-standing bug where messages in the `device_inbox` table for deleted devices would persist indefinitely. Contributed by @dklimpel and @JohannesKleine. ([\#10969](https://github.com/matrix-org/synapse/issues/10969), [\#11212](https://github.com/matrix-org/synapse/issues/11212))
- Do not accept events if a third-party rule `check_event_allowed` callback raises an exception. ([\#11033](https://github.com/matrix-org/synapse/issues/11033))
- Fix long-standing bug where verification requests could fail in certain cases if a federation whitelist was in place but did not include your own homeserver. ([\#11129](https://github.com/matrix-org/synapse/issues/11129))
- Allow an empty list of `state_events_at_start` to be sent when using the [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint and the author of the historical messages is already part of the current room state at the given `?prev_event_id`. ([\#11188](https://github.com/matrix-org/synapse/issues/11188))
- Fix a bug introduced in Synapse 1.45.0 which prevented the `synapse_review_recent_signups` script from running. Contributed by @samuel-p. ([\#11191](https://github.com/matrix-org/synapse/issues/11191))
- Delete `to_device` messages for hidden devices that will never be read, reducing database size. ([\#11199](https://github.com/matrix-org/synapse/issues/11199))
- Fix a long-standing bug wherein a missing `Content-Type` header when downloading remote media would cause Synapse to throw an error. ([\#11200](https://github.com/matrix-org/synapse/issues/11200))
- Fix a long-standing bug which could result in serialization errors and potentially duplicate transaction data when sending ephemeral events to application services. Contributed by @Fizzadar at Beeper. ([\#11207](https://github.com/matrix-org/synapse/issues/11207))
- Fix a bug introduced in Synapse 1.35.0 which made it impossible to join rooms that return a `send_join` response containing floats. ([\#11217](https://github.com/matrix-org/synapse/issues/11217))
- Fix long-standing bug where cross signing keys were not included in the response to `/r0/keys/query` the first time a remote user was queried. ([\#11234](https://github.com/matrix-org/synapse/issues/11234))
- Fix a long-standing bug where all requests that read events from the database could get stuck as a result of losing the database connection. ([\#11240](https://github.com/matrix-org/synapse/issues/11240))
- Fix a bug preventing Synapse from being rolled back to an earlier version when using workers. ([\#11255](https://github.com/matrix-org/synapse/issues/11255), [\#11276](https://github.com/matrix-org/synapse/issues/11276))
- Fix a bug introduced in Synapse 1.37.1 which caused a remote event being processed by a worker to not get processed on restart if the worker was killed. ([\#11262](https://github.com/matrix-org/synapse/issues/11262))
- Only allow old Element/Riot Android clients to send read receipts without a request body. All other clients must include a request body as required by the specification. Contributed by @rogersheu. ([\#11157](https://github.com/matrix-org/synapse/issues/11157))
Updates to the Docker image
---------------------------
- Avoid changing user ID when started as a non-root user, and no explicit `UID` is set. ([\#11209](https://github.com/matrix-org/synapse/issues/11209))
Improved Documentation
----------------------
- Improve example HAProxy config in the docs to properly handle HTTP `Host` headers with port information. This is required for federation over port 443 to work correctly. ([\#11128](https://github.com/matrix-org/synapse/issues/11128))
- Add documentation for using Authentik as an OpenID Connect Identity Provider. Contributed by @samip5. ([\#11151](https://github.com/matrix-org/synapse/issues/11151))
- Clarify lack of support for Windows. ([\#11198](https://github.com/matrix-org/synapse/issues/11198))
- Improve code formatting and fix a few typos in docs. Contributed by @sumnerevans at Beeper. ([\#11221](https://github.com/matrix-org/synapse/issues/11221))
- Add documentation for using LemonLDAP as an OpenID Connect Identity Provider. Contributed by @l00ptr. ([\#11257](https://github.com/matrix-org/synapse/issues/11257))
Internal Changes
----------------
- Add type annotations for the `log_function` decorator. ([\#10943](https://github.com/matrix-org/synapse/issues/10943))
- Add type hints to `synapse.events`. ([\#11098](https://github.com/matrix-org/synapse/issues/11098))
- Remove and document unnecessary `RoomStreamToken` checks in application service ephemeral event code. ([\#11137](https://github.com/matrix-org/synapse/issues/11137))
- Add type hints so that `synapse.http` passes `mypy` checks. ([\#11164](https://github.com/matrix-org/synapse/issues/11164))
- Update scripts to pass Shellcheck lints. ([\#11166](https://github.com/matrix-org/synapse/issues/11166))
- Add knock information in admin export. Contributed by Rafael Gonçalves. ([\#11171](https://github.com/matrix-org/synapse/issues/11171))
- Add tests to check that `ClientIpStore.get_last_client_ip_by_device` and `get_user_ip_and_agents` combine database and in-memory data correctly. ([\#11179](https://github.com/matrix-org/synapse/issues/11179))
- Refactor `Filter` to check different fields depending on the data type. ([\#11194](https://github.com/matrix-org/synapse/issues/11194))
- Improve type hints for the relations datastore. ([\#11205](https://github.com/matrix-org/synapse/issues/11205))
- Replace outdated links in the pull request checklist with links to the rendered documentation. ([\#11225](https://github.com/matrix-org/synapse/issues/11225))
- Fix a bug in unit test `test_block_room_and_not_purge`. ([\#11226](https://github.com/matrix-org/synapse/issues/11226))
- In `ObservableDeferred`, run observers in the order they were registered. ([\#11229](https://github.com/matrix-org/synapse/issues/11229))
- Minor speed up to start up times and getting updates for groups by adding missing index to `local_group_updates.stream_id`. ([\#11231](https://github.com/matrix-org/synapse/issues/11231))
- Add `twine` and `towncrier` as dev dependencies, as they're used by the release script. ([\#11233](https://github.com/matrix-org/synapse/issues/11233))
- Allow `stream_writers.typing` config to be a list of one worker. ([\#11237](https://github.com/matrix-org/synapse/issues/11237))
- Remove debugging statement in tests. ([\#11239](https://github.com/matrix-org/synapse/issues/11239))
- Fix [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) historical messages backfilling in random order on remote homeservers. ([\#11244](https://github.com/matrix-org/synapse/issues/11244))
- Add an additional test for the `cachedList` method decorator. ([\#11246](https://github.com/matrix-org/synapse/issues/11246))
- Make minor correction to the type of `auth_checkers` callbacks. ([\#11253](https://github.com/matrix-org/synapse/issues/11253))
- Clean up trivial aspects of the Debian package build tooling. ([\#11269](https://github.com/matrix-org/synapse/issues/11269), [\#11273](https://github.com/matrix-org/synapse/issues/11273))
- Blacklist new SyTest that checks that key uploads are valid pending the validation being implemented in Synapse. ([\#11270](https://github.com/matrix-org/synapse/issues/11270))
Synapse 1.46.0 (2021-11-02)
===========================
The cause of the [performance regression affecting Synapse 1.44](https://github.com/matrix-org/synapse/issues/11049) has been identified and fixed. ([\#11177](https://github.com/matrix-org/synapse/issues/11177))
Bugfixes
--------
- Fix a bug introduced in v1.46.0rc1 where URL previews of some XML documents would fail. ([\#11196](https://github.com/matrix-org/synapse/issues/11196))
Synapse 1.46.0rc1 (2021-10-27)
==============================
Features
--------
- Add support for Ubuntu 21.10 "Impish Indri". ([\#11024](https://github.com/matrix-org/synapse/issues/11024))
- Port the Password Auth Providers module interface to the new generic interface. ([\#10548](https://github.com/matrix-org/synapse/issues/10548), [\#11180](https://github.com/matrix-org/synapse/issues/11180))
- Experimental support for the thread relation defined in [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440). ([\#11088](https://github.com/matrix-org/synapse/issues/11088), [\#11181](https://github.com/matrix-org/synapse/issues/11181), [\#11192](https://github.com/matrix-org/synapse/issues/11192))
- Users admin API can now also modify user type in addition to allowing it to be set on user creation. ([\#11174](https://github.com/matrix-org/synapse/issues/11174))
Bugfixes
--------
- Newly-created public rooms are now only assigned an alias if the room's creation has not been blocked by permission settings. Contributed by @AndrewFerr. ([\#10930](https://github.com/matrix-org/synapse/issues/10930))
- Fix a long-standing bug which meant that events received over federation were sometimes incorrectly accepted into the room state. ([\#11001](https://github.com/matrix-org/synapse/issues/11001), [\#11009](https://github.com/matrix-org/synapse/issues/11009), [\#11012](https://github.com/matrix-org/synapse/issues/11012))
- Fix 500 error on `/messages` when the server accumulates more than 5 backwards extremities at a given depth for a room. ([\#11027](https://github.com/matrix-org/synapse/issues/11027))
- Fix a bug where setting a user's `external_id` via the admin API returns 500 and deletes user's existing external mappings if that external ID is already mapped. ([\#11051](https://github.com/matrix-org/synapse/issues/11051))
- Fix a long-standing bug where users excluded from the user directory were added into the directory if they belonged to a room which became public or private. ([\#11075](https://github.com/matrix-org/synapse/issues/11075))
- Fix a long-standing bug when attempting to preview URLs which are in the `windows-1252` character encoding. ([\#11077](https://github.com/matrix-org/synapse/issues/11077), [\#11089](https://github.com/matrix-org/synapse/issues/11089))
- Fix broken export-data admin command and add test script checking the command to CI. ([\#11078](https://github.com/matrix-org/synapse/issues/11078))
- Show an error when timestamp in seconds is provided to the `/purge_media_cache` Admin API. ([\#11101](https://github.com/matrix-org/synapse/issues/11101))
- Fix local users who left all their rooms being removed from the user directory, even if the `search_all_users` config option was enabled. ([\#11103](https://github.com/matrix-org/synapse/issues/11103))
- Fix a bug which caused the module API's `get_user_ip_and_agents` function to always fail on workers. `get_user_ip_and_agents` was introduced in 1.44.0 and did not function correctly on worker processes at the time. ([\#11112](https://github.com/matrix-org/synapse/issues/11112))
- Identity server connection is no longer ignoring `ip_range_whitelist`. ([\#11120](https://github.com/matrix-org/synapse/issues/11120))
- Fix a bug introduced in Synapse 1.45.0 breaking the configuration file parsing script. ([\#11145](https://github.com/matrix-org/synapse/issues/11145))
- Fix a performance regression introduced in 1.44.0 which could cause client requests to time out when making large numbers of outbound requests. ([\#11177](https://github.com/matrix-org/synapse/issues/11177), [\#11190](https://github.com/matrix-org/synapse/issues/11190))
- Resolve and share `state_groups` for all [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) historical events in batch. ([\#10975](https://github.com/matrix-org/synapse/issues/10975))
Improved Documentation
----------------------
- Fix broken links relating to module API deprecation in the upgrade notes. ([\#11069](https://github.com/matrix-org/synapse/issues/11069))
- Add more information about what happens when a user is deactivated. ([\#11083](https://github.com/matrix-org/synapse/issues/11083))
- Clarify the the sample log config can be copied from the documentation without issue. ([\#11092](https://github.com/matrix-org/synapse/issues/11092))
- Update the admin API documentation with an updated list of the characters allowed in registration tokens. ([\#11093](https://github.com/matrix-org/synapse/issues/11093))
- Document Synapse's behaviour when dealing with multiple modules registering the same callbacks and/or handlers for the same HTTP endpoints. ([\#11096](https://github.com/matrix-org/synapse/issues/11096))
- Fix instances of `[example]{.title-ref}` in the upgrade documentation as a result of prior RST to Markdown conversion. ([\#11118](https://github.com/matrix-org/synapse/issues/11118))
- Document the version of Synapse each module callback was introduced in. ([\#11132](https://github.com/matrix-org/synapse/issues/11132))
- Document the version of Synapse that introduced each module API method. ([\#11183](https://github.com/matrix-org/synapse/issues/11183))
Internal Changes
----------------
- Fix spurious warnings about losing the logging context on the `ReplicationCommandHandler` when losing the replication connection. ([\#10984](https://github.com/matrix-org/synapse/issues/10984))
- Include rejected status when we log events. ([\#11008](https://github.com/matrix-org/synapse/issues/11008))
- Add some extra logging to the event persistence code. ([\#11014](https://github.com/matrix-org/synapse/issues/11014))
- Rearrange the internal workings of the incremental user directory updates. ([\#11035](https://github.com/matrix-org/synapse/issues/11035))
- Fix a long-standing bug where users excluded from the directory could still be added to the `users_who_share_private_rooms` table after a regular user joins a private room. ([\#11143](https://github.com/matrix-org/synapse/issues/11143))
- Add and improve type hints. ([\#10972](https://github.com/matrix-org/synapse/issues/10972), [\#11055](https://github.com/matrix-org/synapse/issues/11055), [\#11066](https://github.com/matrix-org/synapse/issues/11066), [\#11076](https://github.com/matrix-org/synapse/issues/11076), [\#11095](https://github.com/matrix-org/synapse/issues/11095), [\#11109](https://github.com/matrix-org/synapse/issues/11109), [\#11121](https://github.com/matrix-org/synapse/issues/11121), [\#11146](https://github.com/matrix-org/synapse/issues/11146))
- Mark the Synapse package as containing type annotations and fix export declarations so that Synapse pluggable modules may be type checked against Synapse. ([\#11054](https://github.com/matrix-org/synapse/issues/11054))
- Remove dead code from `MediaFilePaths`. ([\#11056](https://github.com/matrix-org/synapse/issues/11056))
- Be more lenient when parsing oEmbed response versions. ([\#11065](https://github.com/matrix-org/synapse/issues/11065))
- Create a separate module for the retention configuration. ([\#11070](https://github.com/matrix-org/synapse/issues/11070))
- Clean up some of the federation event authentication code for clarity. ([\#11115](https://github.com/matrix-org/synapse/issues/11115), [\#11116](https://github.com/matrix-org/synapse/issues/11116), [\#11122](https://github.com/matrix-org/synapse/issues/11122))
- Add docstrings and comments to the application service ephemeral event sending code. ([\#11138](https://github.com/matrix-org/synapse/issues/11138))
- Update the `sign_json` script to support inline configuration of the signing key. ([\#11139](https://github.com/matrix-org/synapse/issues/11139))
- Fix broken link in the docker image README. ([\#11144](https://github.com/matrix-org/synapse/issues/11144))
- Always dump logs from unit tests during CI runs. ([\#11068](https://github.com/matrix-org/synapse/issues/11068))
- Add tests for `MediaFilePaths` class. ([\#11057](https://github.com/matrix-org/synapse/issues/11057))
- Simplify the user admin API tests. ([\#11048](https://github.com/matrix-org/synapse/issues/11048))
- Add a test for the workaround introduced in [\#11042](https://github.com/matrix-org/synapse/pull/11042) concerning the behaviour of third-party rule modules and `SynapseError`s. ([\#11071](https://github.com/matrix-org/synapse/issues/11071))
Synapse 1.45.1 (2021-10-20)
===========================
Bugfixes
--------
- Revert change to counting of deactivated users towards the monthly active users limit, introduced in 1.45.0rc1. ([\#11127](https://github.com/matrix-org/synapse/issues/11127))
Synapse 1.45.0 (2021-10-19)
===========================
No functional changes since Synapse 1.45.0rc2.
Known Issues
------------
- A suspected [performance regression](https://github.com/matrix-org/synapse/issues/11049) which was first reported after the release of 1.44.0 remains unresolved.
We have not been able to identify a probable cause. Affected users report that setting up a federation sender worker appears to alleviate symptoms of the regression.
Improved Documentation
----------------------
- Reword changelog to clarify concerns about a suspected performance regression in 1.44.0. ([\#11117](https://github.com/matrix-org/synapse/issues/11117))
Synapse 1.45.0rc2 (2021-10-14)
==============================
This release candidate [fixes](https://github.com/matrix-org/synapse/issues/11053) a user directory [bug](https://github.com/matrix-org/synapse/issues/11025) present in 1.45.0rc1.
Known Issues
------------
- A suspected [performance regression](https://github.com/matrix-org/synapse/issues/11049) which was first reported after the release of 1.44.0 remains unresolved.
We have not been able to identify a probable cause. Affected users report that setting up a federation sender worker appears to alleviate symptoms of the regression.
Bugfixes
--------
- Fix a long-standing bug when using multiple event persister workers where events were not correctly sent down `/sync` due to a race. ([\#11045](https://github.com/matrix-org/synapse/issues/11045))
- Fix a bug introduced in Synapse 1.45.0rc1 where the user directory would stop updating if it processed an event from a
user not in the `users` table. ([\#11053](https://github.com/matrix-org/synapse/issues/11053))
- Fix a bug introduced in Synapse 1.44.0 when logging errors during oEmbed processing. ([\#11061](https://github.com/matrix-org/synapse/issues/11061))
Internal Changes
----------------
- Add an 'approximate difference' method to `StateFilter`. ([\#10825](https://github.com/matrix-org/synapse/issues/10825))
- Fix inconsistent behavior of `get_last_client_by_ip` when reporting data that has not been stored in the database yet. ([\#10970](https://github.com/matrix-org/synapse/issues/10970))
- Fix a bug introduced in Synapse 1.21.0 that causes opentracing and Prometheus metrics for replication requests to be measured incorrectly. ([\#10996](https://github.com/matrix-org/synapse/issues/10996))
- Ensure that cache config tests do not share state. ([\#11036](https://github.com/matrix-org/synapse/issues/11036))
Synapse 1.45.0rc1 (2021-10-12)
==============================
**Note:** Media storage providers module that read from Synapse's configuration need changes as of this version, see the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#upgrading-to-v1450) for more information.
Known Issues
------------
- We are investigating [a performance issue](https://github.com/matrix-org/synapse/issues/11049) which was reported after the release of 1.44.0.
- We are aware of [a bug](https://github.com/matrix-org/synapse/issues/11025) with the user directory when using application services. A second release candidate is expected which will resolve this.
Features
--------
- Add [MSC3069](https://github.com/matrix-org/matrix-doc/pull/3069) support to `/account/whoami`. ([\#9655](https://github.com/matrix-org/synapse/issues/9655))
- Support autodiscovery of oEmbed previews. ([\#10822](https://github.com/matrix-org/synapse/issues/10822))
- Add a `user_may_send_3pid_invite` spam checker callback for modules to allow or deny 3PID invites. ([\#10894](https://github.com/matrix-org/synapse/issues/10894))
- Add a spam checker callback to allow or deny room joins. ([\#10910](https://github.com/matrix-org/synapse/issues/10910))
- Include an `update_synapse_database` script in the distribution. Contributed by @Fizzadar at Beeper. ([\#10954](https://github.com/matrix-org/synapse/issues/10954))
- Include exception information in JSON logging output. Contributed by @Fizzadar at Beeper. ([\#11028](https://github.com/matrix-org/synapse/issues/11028))
Bugfixes
--------
- Fix a minor bug in the response to `/_matrix/client/r0/voip/turnServer`. Contributed by @lukaslihotzki. ([\#10922](https://github.com/matrix-org/synapse/issues/10922))
- Fix a bug where empty `yyyy-mm-dd/` directories would be left behind in the media store's `url_cache_thumbnails/` directory. ([\#10924](https://github.com/matrix-org/synapse/issues/10924))
- Fix a bug introduced in Synapse v1.40.0 where the signature checks for room version 8 and 9 could be applied to earlier room versions in some situations. ([\#10927](https://github.com/matrix-org/synapse/issues/10927))
- Fix a long-standing bug wherein deactivated users still count towards the monthly active users limit. ([\#10947](https://github.com/matrix-org/synapse/issues/10947))
- Fix a long-standing bug which meant that events received over federation were sometimes incorrectly accepted into the room state. ([\#10956](https://github.com/matrix-org/synapse/issues/10956))
- Fix a long-standing bug where rebuilding the user directory wouldn't exclude support and deactivated users. ([\#10960](https://github.com/matrix-org/synapse/issues/10960))
- Fix [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint rejecting subsequent batches with unknown batch ID error in existing room versions from the room creator. ([\#10962](https://github.com/matrix-org/synapse/issues/10962))
- Fix a bug that could leak local users' per-room nicknames and avatars when the user directory is rebuilt. ([\#10981](https://github.com/matrix-org/synapse/issues/10981))
- Fix a long-standing bug where the remainder of a batch of user directory changes would be silently dropped if the server left a room early in the batch. ([\#10982](https://github.com/matrix-org/synapse/issues/10982))
- Correct a bugfix introduced in Synapse v1.44.0 that would catch the wrong error if a connection is lost before a response could be written to it. ([\#10995](https://github.com/matrix-org/synapse/issues/10995))
- Fix a long-standing bug where local users' per-room nicknames/avatars were visible to anyone who could see you in the user directory. ([\#11002](https://github.com/matrix-org/synapse/issues/11002))
- Fix a long-standing bug where a user's per-room nickname/avatar would overwrite their profile in the user directory when a room was made public. ([\#11003](https://github.com/matrix-org/synapse/issues/11003))
- Work around a regression, introduced in Synapse v1.39.0, that caused `SynapseError`s raised by the experimental third-party rules module callback `check_event_allowed` to be ignored. ([\#11042](https://github.com/matrix-org/synapse/issues/11042))
- Fix a bug in [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) insertion events in rooms that could cause cross-talk/conflicts between batches. ([\#10877](https://github.com/matrix-org/synapse/issues/10877))
Improved Documentation
----------------------
- Change wording ("reference homeserver") in Synapse repository documentation. Contributed by @maxkratz. ([\#10971](https://github.com/matrix-org/synapse/issues/10971))
- Fix a dead URL in development documentation (SAML) and change wording from "Riot" to "Element". Contributed by @maxkratz. ([\#10973](https://github.com/matrix-org/synapse/issues/10973))
- Add additional content to the Welcome and Overview page of the documentation. ([\#10990](https://github.com/matrix-org/synapse/issues/10990))
- Update links to MSCs in documentation. Contributed by @dklimpel. ([\#10991](https://github.com/matrix-org/synapse/issues/10991))
Internal Changes
----------------
- Improve type hinting in `synapse.util`. ([\#10888](https://github.com/matrix-org/synapse/issues/10888))
- Add further type hints to `synapse.storage.util`. ([\#10892](https://github.com/matrix-org/synapse/issues/10892))
- Fix type hints to be compatible with an upcoming change to Twisted. ([\#10895](https://github.com/matrix-org/synapse/issues/10895))
- Update utility code to handle C implementations of frozendict. ([\#10902](https://github.com/matrix-org/synapse/issues/10902))
- Drop old functionality which maintained database compatibility with Synapse versions before v1.31. ([\#10903](https://github.com/matrix-org/synapse/issues/10903))
- Clean-up configuration helper classes for the `ServerConfig` class. ([\#10915](https://github.com/matrix-org/synapse/issues/10915))
- Use direct references to config flags. ([\#10916](https://github.com/matrix-org/synapse/issues/10916), [\#10959](https://github.com/matrix-org/synapse/issues/10959), [\#10985](https://github.com/matrix-org/synapse/issues/10985))
- Clean up some of the federation event authentication code for clarity. ([\#10926](https://github.com/matrix-org/synapse/issues/10926), [\#10940](https://github.com/matrix-org/synapse/issues/10940), [\#10986](https://github.com/matrix-org/synapse/issues/10986), [\#10987](https://github.com/matrix-org/synapse/issues/10987), [\#10988](https://github.com/matrix-org/synapse/issues/10988), [\#11010](https://github.com/matrix-org/synapse/issues/11010), [\#11011](https://github.com/matrix-org/synapse/issues/11011))
- Refactor various parts of the codebase to use `RoomVersion` objects instead of room version identifier strings. ([\#10934](https://github.com/matrix-org/synapse/issues/10934))
- Refactor user directory tests in preparation for upcoming changes. ([\#10935](https://github.com/matrix-org/synapse/issues/10935))
- Include the event id in the logcontext when handling PDUs received over federation. ([\#10936](https://github.com/matrix-org/synapse/issues/10936))
- Fix logged errors in unit tests. ([\#10939](https://github.com/matrix-org/synapse/issues/10939))
- Fix a broken test to ensure that consent configuration works during registration. ([\#10945](https://github.com/matrix-org/synapse/issues/10945))
- Add type hints to filtering classes. ([\#10958](https://github.com/matrix-org/synapse/issues/10958))
- Add type-hint to `HomeserverTestcase.setup_test_homeserver`. ([\#10961](https://github.com/matrix-org/synapse/issues/10961))
- Fix the test utility function `create_room_as` so that `is_public=True` will explicitly set the `visibility` parameter of room creation requests to `public`. Contributed by @AndrewFerr. ([\#10963](https://github.com/matrix-org/synapse/issues/10963))
- Make the release script more robust and transparent. ([\#10966](https://github.com/matrix-org/synapse/issues/10966))
- Refactor [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` mega function into smaller handler functions. ([\#10974](https://github.com/matrix-org/synapse/issues/10974))
- Log stack traces when a missing opentracing span is detected. ([\#10983](https://github.com/matrix-org/synapse/issues/10983))
- Update GHA config to run tests against Python 3.10 and PostgreSQL 14. ([\#10992](https://github.com/matrix-org/synapse/issues/10992))
- Fix a long-standing bug where `ReadWriteLock`s could drop logging contexts on exit. ([\#10993](https://github.com/matrix-org/synapse/issues/10993))
- Add a `CODEOWNERS` file to automatically request reviews from the `@matrix-org/synapse-core` team on new pull requests. ([\#10994](https://github.com/matrix-org/synapse/issues/10994))
- Add further type hints to `synapse.state`. ([\#11004](https://github.com/matrix-org/synapse/issues/11004))
- Remove the deprecated `BaseHandler` object. ([\#11005](https://github.com/matrix-org/synapse/issues/11005))
- Bump mypy version for CI to 0.910, and pull in new type stubs for dependencies. ([\#11006](https://github.com/matrix-org/synapse/issues/11006))
- Fix CI to run the unit tests without optional deps. ([\#11017](https://github.com/matrix-org/synapse/issues/11017))
- Ensure that cache config tests do not share state. ([\#11019](https://github.com/matrix-org/synapse/issues/11019))
- Add additional type hints to `synapse.server_notices`. ([\#11021](https://github.com/matrix-org/synapse/issues/11021))
- Add additional type hints for `synapse.push`. ([\#11023](https://github.com/matrix-org/synapse/issues/11023))
- When installing the optional developer dependencies, also include the dependencies needed for type-checking and unit testing. ([\#11034](https://github.com/matrix-org/synapse/issues/11034))
- Remove unnecessary list comprehension from `synapse_port_db` to satisfy code style requirements. ([\#11043](https://github.com/matrix-org/synapse/issues/11043))
Synapse 1.44.0 (2021-10-05)
===========================
@@ -8364,14 +8805,14 @@ General:
Federation:
- Add key distribution mechanisms for fetching public keys of unavailable remote home servers. See [Retrieving Server Keys](https://github.com/matrix-org/matrix-doc/blob/6f2698/specification/30_server_server_api.rst#retrieving-server-keys) in the spec.
- Add key distribution mechanisms for fetching public keys of unavailable remote homeservers. See [Retrieving Server Keys](https://github.com/matrix-org/matrix-doc/blob/6f2698/specification/30_server_server_api.rst#retrieving-server-keys) in the spec.
Configuration:
- Add support for multiple config files.
- Add support for dictionaries in config files.
- Remove support for specifying config options on the command line, except for:
- `--daemonize` - Daemonize the home server.
- `--daemonize` - Daemonize the homeserver.
- `--manhole` - Turn on the twisted telnet manhole service on the given port.
- `--database-path` - The path to a sqlite database to use.
- `--verbose` - The verbosity level.
@@ -8576,7 +9017,7 @@ This version adds support for using a TURN server. See docs/turn-howto.rst on ho
Homeserver:
- Add support for redaction of messages.
- Fix bug where inviting a user on a remote home server could take up to 20-30s.
- Fix bug where inviting a user on a remote homeserver could take up to 20-30s.
- Implement a get current room state API.
- Add support specifying and retrieving turn server configuration.
@@ -8666,7 +9107,7 @@ Changes in synapse 0.2.3 (2014-09-12)
Homeserver:
- Fix bug where we stopped sending events to remote home servers if a user from that home server left, even if there were some still in the room.
- Fix bug where we stopped sending events to remote homeservers if a user from that homeserver left, even if there were some still in the room.
- Fix bugs in the state conflict resolution where it was incorrectly rejecting events.
Webclient:
+10
View File
@@ -1,4 +1,5 @@
include synctl
include sytest-blacklist
include LICENSE
include VERSION
include *.rst
@@ -8,6 +9,7 @@ include demo/demo.tls.dh
include demo/*.py
include demo/*.sh
include synapse/py.typed
recursive-include synapse/storage *.sql
recursive-include synapse/storage *.sql.postgres
recursive-include synapse/storage *.sql.sqlite
@@ -53,3 +55,11 @@ prune demo/etc
prune docker
prune snap
prune stubs
exclude jenkins*
recursive-exclude jenkins *.sh
# FIXME: we shouldn't have these templates here
recursive-include res/templates-dinsic *.css
recursive-include res/templates-dinsic *.html
recursive-include res/templates-dinsic *.txt
+3 -6
View File
@@ -55,11 +55,8 @@ solutions. The hope is for Matrix to act as the building blocks for a new
generation of fully open and interoperable messaging and VoIP apps for the
internet.
Synapse is a reference "homeserver" implementation of Matrix from the core
development team at matrix.org, written in Python/Twisted. It is intended to
showcase the concept of Matrix and let folks see the spec in the context of a
codebase and let you run your own homeserver and generally help bootstrap the
ecosystem.
Synapse is a Matrix "homeserver" implementation developed by the matrix.org core
team, written in Python 3/Twisted.
In Matrix, every user runs one or more Matrix clients, which connect through to
a Matrix homeserver. The homeserver stores all their personal chat history and
@@ -301,7 +298,7 @@ to install using pip and a virtualenv::
python3 -m venv ./env
source ./env/bin/activate
pip install -e ".[all,test]"
pip install -e ".[all,dev]"
This will run a process of downloading and installing all the needed
dependencies into a virtual env. If any dependencies fail to install,
+1
View File
@@ -0,0 +1 @@
Forbid changing the name, avatar or topic of a direct room.
+1
View File
@@ -0,0 +1 @@
Don't apply retention policy based filtering on state events.
+1
View File
@@ -0,0 +1 @@
Remove shadow HS support.
+1
View File
@@ -0,0 +1 @@
Ensure the Rust reporter passes type checking with jaeger-client 4.7's type annotations.
+1
View File
@@ -0,0 +1 @@
Use correct image for sytest.
+1
View File
@@ -0,0 +1 @@
Add a `user_may_send_3pid_invite` spam checker callback for modules to allow or deny 3PID invites.
+1
View File
@@ -0,0 +1 @@
Add a `user_may_create_room_with_invites` spam checker callback to allow modules to allow or deny a room creation request based on the invites and/or 3PID invites it includes.
+1
View File
@@ -0,0 +1 @@
Add a spam checker callback to allow or deny room joins.
+1
View File
@@ -0,0 +1 @@
Fix debian builds due to dh-virtualenv no longer being able to build their docs.
+1
View File
@@ -0,0 +1 @@
Allow server admins to configure a custom global rate-limiting for third party invites.
+1
View File
@@ -0,0 +1 @@
Add a module API method to retrieve the current state of a room.
+1
View File
@@ -0,0 +1 @@
Fix a typechecker problem related to our (ab)use of `nacl.signing.SigningKey`s.
+1
View File
@@ -0,0 +1 @@
Add a config flag to inhibit M_USER_IN_USE during registration.
+1
View File
@@ -0,0 +1 @@
Add a module callback to set username at registration.
+1
View File
@@ -0,0 +1 @@
Correct a type annotation in the event validation logic.
+1
View File
@@ -0,0 +1 @@
Correct a type annotation in the event validation logic.
+1
View File
@@ -0,0 +1 @@
Workaround a type annotation problem in `prometheus_client` 0.13.0.
+1
View File
@@ -0,0 +1 @@
Add `/user/:user_id/info` CS servlet and to give user deactivated/expired information.
+1
View File
@@ -0,0 +1 @@
Hide expired users from the user directory, and optionally re-add them on renewal.
+1
View File
@@ -0,0 +1 @@
User displaynames now have capitalised letters after - symbols.
+1
View File
@@ -0,0 +1 @@
Fix the ordering on `scripts/generate_signing_key.py`'s import statement.
+1
View File
@@ -0,0 +1 @@
Blacklist some flaky sytests until they're fixed.
+1
View File
@@ -0,0 +1 @@
Add option `limit_profile_requests_to_known_users` to prevent requirement of a user sharing a room with another user to query their profile information.
+1
View File
@@ -0,0 +1 @@
Add `max_avatar_size` and `allowed_avatar_mimetypes` to restrict the size of user avatars and their file type respectively.
+1
View File
@@ -0,0 +1 @@
Don't treat 3PID revocation as a new 3PID invite.
+1
View File
@@ -0,0 +1 @@
Validate `client_secret` parameter against the regex provided by the C-S spec.
+1
View File
@@ -0,0 +1 @@
Fix resetting user passwords via a phone number.
+1
View File
@@ -0,0 +1 @@
Fix a bug causing account validity renewal emails to be sent even if the feature is turned off in some cases.
+1
View File
@@ -0,0 +1 @@
Improve performance when making `.well-known` requests by sharing the SSL options between requests.
+1
View File
@@ -0,0 +1 @@
Fix encoding on password reset HTML responses in Python 2.
+1
View File
@@ -0,0 +1 @@
Improve performance when making HTTP requests to sygnal, sydent, etc, by sharing the SSL context object between connections.
+1
View File
@@ -0,0 +1 @@
Fixes a bug when using the default display name during registration.
+1
View File
@@ -0,0 +1 @@
Merge Synapse v1.12.4 `master` into the `dinsic` branch.
+1
View File
@@ -0,0 +1 @@
Fix handling of filtered strings in Python 3.
+1
View File
@@ -0,0 +1 @@
Merge Synapse mainline releases v1.13.0 through v1.14.0 into the `dinsic` branch.
+1
View File
@@ -0,0 +1 @@
Add a bulk version of the User Info API. Deprecate the single-use version.
+1
View File
@@ -0,0 +1 @@
Improve performance of `mark_expired_users_as_inactive` background job.
+1
View File
@@ -0,0 +1 @@
Prevent `/register` from raising `M_USER_IN_USE` until UI Auth has been completed. Have `/register/available` always return true.
+1
View File
@@ -0,0 +1 @@
Fix room retention policy management in worker mode.
+1
View File
@@ -0,0 +1 @@
Merge Synapse mainline v1.15.1 into the `dinsic` branch.
+1
View File
@@ -0,0 +1 @@
Adds auth_profile_reqs option to require access_token to GET /profile endpoints on CS API.
+1
View File
@@ -0,0 +1 @@
Add workarounds for pep-517 install errors.
+1
View File
@@ -0,0 +1 @@
Add `bind_new_user_emails_to_sydent` option for automatically binding user's emails after registration.
+1
View File
@@ -0,0 +1 @@
Allow server admins to define and enforce a password policy (MSC2000).
+1
View File
@@ -0,0 +1 @@
Merge mainline Synapse v1.18.0 into the `dinsic` branch.
+1
View File
@@ -0,0 +1 @@
Add unique index to the profile_replication_status table.
+1
View File
@@ -0,0 +1 @@
Add configuration option to hide new users from the user directory.
+1
View File
@@ -0,0 +1 @@
Temporarily revert commit a3fbc23.
+1
View File
@@ -0,0 +1 @@
Implement new custom event rules for power levels.
+1
View File
@@ -0,0 +1 @@
Add user_id back to presence in worker too https://github.com/matrix-org/synapse/commit/0bbbd10513008d30c17eb1d1e7ba1d091fb44ec7 .
+1
View File
@@ -0,0 +1 @@
Fix 3PID invite to invite association detection in the Tchap room access rules.
+1
View File
@@ -0,0 +1 @@
Force the access rule to be "restricted" if the join rule is "public".
+1
View File
@@ -0,0 +1 @@
Don't push if an user account has expired.
+1
View File
@@ -0,0 +1 @@
Freeze a room when the last administrator in the room leaves.
+1
View File
@@ -0,0 +1 @@
Don't forbid membership events which membership isn't 'join' or 'invite' in restricted rooms, so that users who got into these rooms before the access rules started to be enforced can leave them.
+1
View File
@@ -0,0 +1 @@
Make all rooms noisy by default.
+1
View File
@@ -0,0 +1 @@
Change the minimum power levels for invites and other state events in new rooms.
+1
View File
@@ -0,0 +1 @@
Type hinting and other cleanups for `synapse.third_party_rules.access_rules`.
+1
View File
@@ -0,0 +1 @@
Make AccessRules use the public rooms directory instead of checking a room's join rules on rule change.
+1
View File
@@ -0,0 +1 @@
Ensure a `RoomAccessRules` test doesn't accidentally modify a room's access rule and then test that room assuming its access rule has not changed.
+1
View File
@@ -0,0 +1 @@
Fix `nextLink` parameters being checked on validation endpoints even if they weren't provided by the client.
+1
View File
@@ -0,0 +1 @@
Create a mapping between user ID and threepid when binding via the internal Sydent bind API.
+1
View File
@@ -0,0 +1 @@
Merge mainline Synapse v1.21.2 into 'dinsic'.
+1
View File
@@ -0,0 +1 @@
Implement "room knocking" as per [MSC2403](https://github.com/matrix-org/matrix-doc/pull/2403). Contributed by Sorunome and anoa.
+1
View File
@@ -0,0 +1 @@
Override any missing default power level keys with DINUM's defaults when creating a room.
+1
View File
@@ -0,0 +1 @@
Fix users info for remote users.
+1
View File
@@ -0,0 +1 @@
Update the version of mypy to 0.790.
+1
View File
@@ -0,0 +1 @@
Add SyTest to the BuildKite CI.
+1
View File
@@ -0,0 +1 @@
Don't blacklist connections to the configured proxy. Contributed by @Bubu.
+4 -2
View File
@@ -84,7 +84,9 @@ AUTH="Authorization: Bearer $TOKEN"
###################################################################################################
# finally start pruning the room:
###################################################################################################
POSTDATA='{"delete_local_events":"true"}' # this will really delete local events, so the messages in the room really disappear unless they are restored by remote federation
# this will really delete local events, so the messages in the room really
# disappear unless they are restored by remote federation. This is because
# we pass {"delete_local_events":true} to the curl invocation below.
for ROOM in "${ROOMS_ARRAY[@]}"; do
echo "########################################### $(date) ################# "
@@ -104,7 +106,7 @@ for ROOM in "${ROOMS_ARRAY[@]}"; do
SLEEP=2
set -x
# call purge
OUT=$(curl --header "$AUTH" -s -d $POSTDATA POST "$API_URL/admin/purge_history/$ROOM/$EVENT_ID")
OUT=$(curl --header "$AUTH" -s -d '{"delete_local_events":true}' POST "$API_URL/admin/purge_history/$ROOM/$EVENT_ID")
PURGE_ID=$(echo "$OUT" |grep purge_id|cut -d'"' -f4 )
if [ "$PURGE_ID" == "" ]; then
# probably the history purge is already in progress for $ROOM
+6 -5
View File
@@ -15,7 +15,7 @@ export DH_VIRTUALENV_INSTALL_ROOT=/opt/venvs
# python won't look in the right directory. At least this way, the error will
# be a *bit* more obvious.
#
SNAKE=`readlink -e /usr/bin/python3`
SNAKE=$(readlink -e /usr/bin/python3)
# try to set the CFLAGS so any compiled C extensions are compiled with the most
# generic as possible x64 instructions, so that compiling it on a new Intel chip
@@ -24,7 +24,7 @@ SNAKE=`readlink -e /usr/bin/python3`
# TODO: add similar things for non-amd64, or figure out a more generic way to
# do this.
case `dpkg-architecture -q DEB_HOST_ARCH` in
case $(dpkg-architecture -q DEB_HOST_ARCH) in
amd64)
export CFLAGS=-march=x86-64
;;
@@ -40,6 +40,7 @@ dh_virtualenv \
--upgrade-pip \
--preinstall="lxml" \
--preinstall="mock" \
--preinstall="wheel" \
--extra-pip-arg="--no-cache-dir" \
--extra-pip-arg="--compile" \
--extras="all,systemd,test"
@@ -56,8 +57,8 @@ case "$DEB_BUILD_OPTIONS" in
*)
# Copy tests to a temporary directory so that we can put them on the
# PYTHONPATH without putting the uninstalled synapse on the pythonpath.
tmpdir=`mktemp -d`
trap "rm -r $tmpdir" EXIT
tmpdir=$(mktemp -d)
trap 'rm -r $tmpdir' EXIT
cp -r tests "$tmpdir"
@@ -98,7 +99,7 @@ esac
--output-file="${PACKAGE_BUILD_DIR}/etc/matrix-synapse/log.yaml"
# add a dependency on the right version of python to substvars.
PYPKG=`basename $SNAKE`
PYPKG=$(basename "$SNAKE")
echo "synapse:pydepends=$PYPKG" >> debian/matrix-synapse-py3.substvars
+88
View File
@@ -1,3 +1,91 @@
matrix-synapse-py3 (1.48.0) stable; urgency=medium
* New synapse release 1.48.0.
-- Synapse Packaging team <packages@matrix.org> Tue, 30 Nov 2021 11:24:15 +0000
matrix-synapse-py3 (1.48.0~rc1) stable; urgency=medium
* New synapse release 1.48.0~rc1.
-- Synapse Packaging team <packages@matrix.org> Thu, 25 Nov 2021 15:56:03 +0000
matrix-synapse-py3 (1.47.1) stable; urgency=medium
* New synapse release 1.47.1.
-- Synapse Packaging team <packages@matrix.org> Fri, 19 Nov 2021 13:44:32 +0000
matrix-synapse-py3 (1.47.0) stable; urgency=medium
* New synapse release 1.47.0.
-- Synapse Packaging team <packages@matrix.org> Wed, 17 Nov 2021 13:09:43 +0000
matrix-synapse-py3 (1.47.0~rc3) stable; urgency=medium
* New synapse release 1.47.0~rc3.
-- Synapse Packaging team <packages@matrix.org> Tue, 16 Nov 2021 14:32:47 +0000
matrix-synapse-py3 (1.47.0~rc2) stable; urgency=medium
[ Dan Callahan ]
* Update scripts to pass Shellcheck lints.
* Remove unused Vagrant scripts from debian/ directory.
* Allow building Debian packages for any architecture, not just amd64.
* Preinstall the "wheel" package when building virtualenvs.
* Do not error if /etc/default/matrix-synapse is missing.
[ Synapse Packaging team ]
* New synapse release 1.47.0~rc2.
-- Synapse Packaging team <packages@matrix.org> Wed, 10 Nov 2021 09:41:01 +0000
matrix-synapse-py3 (1.46.0) stable; urgency=medium
[ Richard van der Hoff ]
* Compress debs with xz, to fix incompatibility of impish debs with reprepro.
[ Synapse Packaging team ]
* New synapse release 1.46.0.
-- Synapse Packaging team <packages@matrix.org> Tue, 02 Nov 2021 13:22:53 +0000
matrix-synapse-py3 (1.46.0~rc1) stable; urgency=medium
* New synapse release 1.46.0~rc1.
-- Synapse Packaging team <packages@matrix.org> Tue, 26 Oct 2021 14:04:04 +0100
matrix-synapse-py3 (1.45.1) stable; urgency=medium
* New synapse release 1.45.1.
-- Synapse Packaging team <packages@matrix.org> Wed, 20 Oct 2021 11:58:27 +0100
matrix-synapse-py3 (1.45.0) stable; urgency=medium
* New synapse release 1.45.0.
-- Synapse Packaging team <packages@matrix.org> Tue, 19 Oct 2021 11:18:53 +0100
matrix-synapse-py3 (1.45.0~rc2) stable; urgency=medium
* New synapse release 1.45.0~rc2.
-- Synapse Packaging team <packages@matrix.org> Thu, 14 Oct 2021 10:58:24 +0100
matrix-synapse-py3 (1.45.0~rc1) stable; urgency=medium
[ Nick @ Beeper ]
* Include an `update_synapse_database` script in the distribution.
[ Synapse Packaging team ]
* New synapse release 1.45.0~rc1.
-- Synapse Packaging team <packages@matrix.org> Tue, 12 Oct 2021 10:46:27 +0100
matrix-synapse-py3 (1.44.0) stable; urgency=medium
* New synapse release 1.44.0.
+1 -1
View File
@@ -19,7 +19,7 @@ Standards-Version: 3.9.8
Homepage: https://github.com/matrix-org/synapse
Package: matrix-synapse-py3
Architecture: amd64
Architecture: any
Provides: matrix-synapse
Conflicts:
matrix-synapse (<< 0.34.0.1-0matrix2),
+1
View File
@@ -2,6 +2,7 @@
set -e
# shellcheck disable=SC1091
. /usr/share/debconf/confmodule
# try to update the debconf db according to whatever is in the config files
+1
View File
@@ -3,3 +3,4 @@ opt/venvs/matrix-synapse/bin/register_new_matrix_user usr/bin/register_new_matri
opt/venvs/matrix-synapse/bin/synapse_port_db usr/bin/synapse_port_db
opt/venvs/matrix-synapse/bin/synapse_review_recent_signups usr/bin/synapse_review_recent_signups
opt/venvs/matrix-synapse/bin/synctl usr/bin/synctl
opt/venvs/matrix-synapse/bin/update_synapse_database usr/bin/update_synapse_database
+1
View File
@@ -1,5 +1,6 @@
#!/bin/sh -e
# shellcheck disable=SC1091
. /usr/share/debconf/confmodule
CONFIGFILE_SERVERNAME="/etc/matrix-synapse/conf.d/server_name.yaml"
+1 -1
View File
@@ -5,7 +5,7 @@ Description=Synapse Matrix homeserver
Type=notify
User=matrix-synapse
WorkingDirectory=/var/lib/matrix-synapse
EnvironmentFile=/etc/default/matrix-synapse
EnvironmentFile=-/etc/default/matrix-synapse
ExecStartPre=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/ --generate-keys
ExecStart=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/
ExecReload=/bin/kill -HUP $MAINPID
+6
View File
@@ -51,5 +51,11 @@ override_dh_shlibdeps:
override_dh_virtualenv:
./debian/build_virtualenv
override_dh_builddeb:
# force the compression to xzip, to stop dpkg-deb on impish defaulting to zstd
# (which requires reprepro 5.3.0-1.3, which is currently only in 'experimental' in Debian:
# https://metadata.ftp-master.debian.org/changelogs/main/r/reprepro/reprepro_5.3.0-1.3_changelog)
dh_builddeb -- -Zxz
%:
dh $@ --with python-virtualenv
-2
View File
@@ -1,2 +0,0 @@
.vagrant
*.log
-23
View File
@@ -1,23 +0,0 @@
#!/bin/bash
#
# provisioning script for vagrant boxes for testing the matrix-synapse debs.
#
# Will install the most recent matrix-synapse-py3 deb for this platform from
# the /debs directory.
set -e
apt-get update
apt-get install -y lsb-release
deb=`ls /debs/matrix-synapse-py3_*+$(lsb_release -cs)*.deb | sort | tail -n1`
debconf-set-selections <<EOF
matrix-synapse matrix-synapse/report-stats boolean false
matrix-synapse matrix-synapse/server-name string localhost:18448
EOF
dpkg -i "$deb"
sed -i -e '/port: 8...$/{s/8448/18448/; s/8008/18008/}' -e '$aregistration_shared_secret: secret' /etc/matrix-synapse/homeserver.yaml
systemctl restart matrix-synapse
-13
View File
@@ -1,13 +0,0 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
ver = `cd ../../..; dpkg-parsechangelog -S Version`.strip()
Vagrant.configure("2") do |config|
config.vm.box = "debian/stretch64"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "../../../../debs", "/debs", type: "nfs"
config.vm.provision "shell", path: "../provision.sh"
end
-10
View File
@@ -1,10 +0,0 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "../../../../debs", "/debs"
config.vm.provision "shell", path: "../provision.sh"
end
+4 -4
View File
@@ -6,14 +6,14 @@ DIR="$( cd "$( dirname "$0" )" && pwd )"
PID_FILE="$DIR/servers.pid"
if [ -f $PID_FILE ]; then
if [ -f "$PID_FILE" ]; then
echo "servers.pid exists!"
exit 1
fi
for port in 8080 8081 8082; do
rm -rf $DIR/$port
rm -rf $DIR/media_store.$port
rm -rf "${DIR:?}/$port"
rm -rf "$DIR/media_store.$port"
done
rm -rf $DIR/etc
rm -rf "${DIR:?}/etc"
+77 -73
View File
@@ -4,21 +4,22 @@ DIR="$( cd "$( dirname "$0" )" && pwd )"
CWD=$(pwd)
cd "$DIR/.."
cd "$DIR/.." || exit
mkdir -p demo/etc
export PYTHONPATH=$(readlink -f $(pwd))
PYTHONPATH=$(readlink -f "$(pwd)")
export PYTHONPATH
echo $PYTHONPATH
echo "$PYTHONPATH"
for port in 8080 8081 8082; do
echo "Starting server on port $port... "
https_port=$((port + 400))
mkdir -p demo/$port
pushd demo/$port
pushd demo/$port || exit
#rm $DIR/etc/$port.config
python3 -m synapse.app.homeserver \
@@ -27,75 +28,78 @@ for port in 8080 8081 8082; do
--config-path "$DIR/etc/$port.config" \
--report-stats no
if ! grep -F "Customisation made by demo/start.sh" -q $DIR/etc/$port.config; then
printf '\n\n# Customisation made by demo/start.sh\n' >> $DIR/etc/$port.config
echo "public_baseurl: http://localhost:$port/" >> $DIR/etc/$port.config
echo 'enable_registration: true' >> $DIR/etc/$port.config
# Warning, this heredoc depends on the interaction of tabs and spaces. Please don't
# accidentaly bork me with your fancy settings.
listeners=$(cat <<-PORTLISTENERS
# Configure server to listen on both $https_port and $port
# This overides some of the default settings above
listeners:
- port: $https_port
type: http
tls: true
resources:
- names: [client, federation]
- port: $port
tls: false
bind_addresses: ['::1', '127.0.0.1']
type: http
x_forwarded: true
resources:
- names: [client, federation]
compress: false
PORTLISTENERS
)
echo "${listeners}" >> $DIR/etc/$port.config
# Disable tls for the servers
printf '\n\n# Disable tls on the servers.' >> $DIR/etc/$port.config
echo '# DO NOT USE IN PRODUCTION' >> $DIR/etc/$port.config
echo 'use_insecure_ssl_client_just_for_testing_do_not_use: true' >> $DIR/etc/$port.config
echo 'federation_verify_certificates: false' >> $DIR/etc/$port.config
# Set tls paths
echo "tls_certificate_path: \"$DIR/etc/localhost:$https_port.tls.crt\"" >> $DIR/etc/$port.config
echo "tls_private_key_path: \"$DIR/etc/localhost:$https_port.tls.key\"" >> $DIR/etc/$port.config
if ! grep -F "Customisation made by demo/start.sh" -q "$DIR/etc/$port.config"; then
# Generate tls keys
openssl req -x509 -newkey rsa:4096 -keyout $DIR/etc/localhost\:$https_port.tls.key -out $DIR/etc/localhost\:$https_port.tls.crt -days 365 -nodes -subj "/O=matrix"
openssl req -x509 -newkey rsa:4096 -keyout "$DIR/etc/localhost:$https_port.tls.key" -out "$DIR/etc/localhost:$https_port.tls.crt" -days 365 -nodes -subj "/O=matrix"
# Ignore keys from the trusted keys server
echo '# Ignore keys from the trusted keys server' >> $DIR/etc/$port.config
echo 'trusted_key_servers:' >> $DIR/etc/$port.config
echo ' - server_name: "matrix.org"' >> $DIR/etc/$port.config
echo ' accept_keys_insecurely: true' >> $DIR/etc/$port.config
# Regenerate configuration
{
printf '\n\n# Customisation made by demo/start.sh\n'
echo "public_baseurl: http://localhost:$port/"
echo 'enable_registration: true'
# Reduce the blacklist
blacklist=$(cat <<-BLACK
# Set the blacklist so that it doesn't include 127.0.0.1, ::1
federation_ip_range_blacklist:
- '10.0.0.0/8'
- '172.16.0.0/12'
- '192.168.0.0/16'
- '100.64.0.0/10'
- '169.254.0.0/16'
- 'fe80::/64'
- 'fc00::/7'
BLACK
)
echo "${blacklist}" >> $DIR/etc/$port.config
# Warning, this heredoc depends on the interaction of tabs and spaces.
# Please don't accidentaly bork me with your fancy settings.
listeners=$(cat <<-PORTLISTENERS
# Configure server to listen on both $https_port and $port
# This overides some of the default settings above
listeners:
- port: $https_port
type: http
tls: true
resources:
- names: [client, federation]
- port: $port
tls: false
bind_addresses: ['::1', '127.0.0.1']
type: http
x_forwarded: true
resources:
- names: [client, federation]
compress: false
PORTLISTENERS
)
echo "${listeners}"
# Disable tls for the servers
printf '\n\n# Disable tls on the servers.'
echo '# DO NOT USE IN PRODUCTION'
echo 'use_insecure_ssl_client_just_for_testing_do_not_use: true'
echo 'federation_verify_certificates: false'
# Set tls paths
echo "tls_certificate_path: \"$DIR/etc/localhost:$https_port.tls.crt\""
echo "tls_private_key_path: \"$DIR/etc/localhost:$https_port.tls.key\""
# Ignore keys from the trusted keys server
echo '# Ignore keys from the trusted keys server'
echo 'trusted_key_servers:'
echo ' - server_name: "matrix.org"'
echo ' accept_keys_insecurely: true'
# Reduce the blacklist
blacklist=$(cat <<-BLACK
# Set the blacklist so that it doesn't include 127.0.0.1, ::1
federation_ip_range_blacklist:
- '10.0.0.0/8'
- '172.16.0.0/12'
- '192.168.0.0/16'
- '100.64.0.0/10'
- '169.254.0.0/16'
- 'fe80::/64'
- 'fc00::/7'
BLACK
)
echo "${blacklist}"
} >> "$DIR/etc/$port.config"
fi
# Check script parameters
if [ $# -eq 1 ]; then
if [ $1 = "--no-rate-limit" ]; then
if [ "$1" = "--no-rate-limit" ]; then
# Disable any rate limiting
ratelimiting=$(cat <<-RC
@@ -137,22 +141,22 @@ for port in 8080 8081 8082; do
burst_count: 1000
RC
)
echo "${ratelimiting}" >> $DIR/etc/$port.config
echo "${ratelimiting}" >> "$DIR/etc/$port.config"
fi
fi
if ! grep -F "full_twisted_stacktraces" -q $DIR/etc/$port.config; then
echo "full_twisted_stacktraces: true" >> $DIR/etc/$port.config
if ! grep -F "full_twisted_stacktraces" -q "$DIR/etc/$port.config"; then
echo "full_twisted_stacktraces: true" >> "$DIR/etc/$port.config"
fi
if ! grep -F "report_stats" -q $DIR/etc/$port.config ; then
echo "report_stats: false" >> $DIR/etc/$port.config
if ! grep -F "report_stats" -q "$DIR/etc/$port.config" ; then
echo "report_stats: false" >> "$DIR/etc/$port.config"
fi
python3 -m synapse.app.homeserver \
--config-path "$DIR/etc/$port.config" \
-D \
popd
popd || exit
done
cd "$CWD"
cd "$CWD" || exit
+1 -1
View File
@@ -8,7 +8,7 @@ for pid_file in $FILES; do
pid=$(cat "$pid_file")
if [[ $pid ]]; then
echo "Killing $pid_file with $pid"
kill $pid
kill "$pid"
fi
done
+9 -5
View File
@@ -65,7 +65,8 @@ The following environment variables are supported in `generate` mode:
* `SYNAPSE_DATA_DIR`: where the generated config will put persistent data
such as the database and media store. Defaults to `/data`.
* `UID`, `GID`: the user id and group id to use for creating the data
directories. Defaults to `991`, `991`.
directories. If unset, and no user is set via `docker run --user`, defaults
to `991`, `991`.
## Running synapse
@@ -97,7 +98,9 @@ The following environment variables are supported in `run` mode:
`<SYNAPSE_CONFIG_DIR>/homeserver.yaml`.
* `SYNAPSE_WORKER`: module to execute, used when running synapse with workers.
Defaults to `synapse.app.homeserver`, which is suitable for non-worker mode.
* `UID`, `GID`: the user and group id to run Synapse as. Defaults to `991`, `991`.
* `UID`, `GID`: the user and group id to run Synapse as. If unset, and no user
is set via `docker run --user`, defaults to `991`, `991`. Note that this user
must have permission to read the config files, and write to the data directories.
* `TZ`: the [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) the container will run with. Defaults to `UTC`.
For more complex setups (e.g. for workers) you can also pass your args directly to synapse using `run` mode. For example like this:
@@ -186,7 +189,7 @@ point to another Dockerfile.
## Disabling the healthcheck
If you are using a non-standard port or tls inside docker you can disable the healthcheck
whilst running the above `docker run` commands.
whilst running the above `docker run` commands.
```
--no-healthcheck
@@ -212,7 +215,7 @@ If you wish to point the healthcheck at a different port with docker command, ad
## Setting the healthcheck in docker-compose file
You can add the following to set a custom healthcheck in a docker compose file.
You will need docker-compose version >2.1 for this to work.
You will need docker-compose version >2.1 for this to work.
```
healthcheck:
@@ -226,4 +229,5 @@ healthcheck:
## Using jemalloc
Jemalloc is embedded in the image and will be used instead of the default allocator.
You can read about jemalloc by reading the Synapse [README](../README.rst).
You can read about jemalloc by reading the Synapse
[README](https://github.com/matrix-org/synapse/blob/HEAD/README.rst#help-synapse-is-slow-and-eats-all-my-ram-cpu).

Some files were not shown because too many files have changed in this diff Show More