summary refs log tree commit diff
path: root/synapse/config/workers.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fixups to new push stream (#17038)Erik Johnston2024-03-281-4/+4
| | | Follow on from #17037
* Add support for moving `/push_rules` off of main process (#17037)Erik Johnston2024-03-281-0/+12
|
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+2
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update book locationErik Johnston2023-12-131-2/+2
|
* Update license headersPatrick Cloke2023-11-211-11/+16
|
* Allow multiple workers to write to receipts stream. (#16432)Erik Johnston2023-10-251-2/+2
| | | Fixes #16417
* Add support for pydantic v2 via pydantic.v1 compat module (#16332)Maxwell G2023-09-251-2/+8
| | | While maintaining support with pydantic v1.
* Re-introduce the outbound federation proxy (#15913)Eric Eastwood2023-07-181-1/+44
| | | | | Allow configuring the set of workers to proxy outbound federation traffic through (`outbound_federation_restricted_to`). This is useful when you have a worker setup with `federation_sender` instances responsible for sending outbound federation requests and want to make sure *all* outbound federation traffic goes through those instances. Before this change, the generic workers would still contact federation themselves for things like profile lookups, backfill, etc. This PR allows you to set more strict access controls/firewall for all workers and only allow the `federation_sender`'s to contact the outside world.
* Unix Sockets for HTTP Replication (#15708)Jason Little2023-07-111-2/+22
| | | | | | | | | Unix socket support for `federation` and `client` Listeners has existed now for a little while(since [1.81.0](https://github.com/matrix-org/synapse/pull/15353)), but there was one last hold out before it could be complete: HTTP Replication communication. This should finish it up. The Listeners would have always worked, but would have had no way to be talked to/at. --------- Co-authored-by: Eric Eastwood <madlittlemods@gmail.com> Co-authored-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org> Co-authored-by: Eric Eastwood <erice@element.io>
* Revert "Federation outbound proxy" (#15910)Eric Eastwood2023-07-101-39/+1
| | | | | | Revert "Federation outbound proxy (#15773)" This reverts commit b07b14b494ae1dd564b4c44f844c9a9545b3d08a.
* Remove `worker_replication_*` deprecated settings, with helpful errors on ↵Jason Little2023-07-071-21/+29
| | | | | | startup (#15860) Co-authored-by: reivilibre <oliverw@matrix.org>
* Federation outbound proxy (#15773)Eric Eastwood2023-07-051-1/+39
| | | | | | | Allow configuring the set of workers to proxy outbound federation traffic through (`outbound_federation_restricted_to`). This is useful when you have a worker setup with `federation_sender` instances responsible for sending outbound federation requests and want to make sure *all* outbound federation traffic goes through those instances. Before this change, the generic workers would still contact federation themselves for things like profile lookups, backfill, etc. This PR allows you to set more strict access controls/firewall for all workers and only allow the `federation_sender`'s to contact the outside world. The original code is from @erikjohnston's branches which I've gotten in-shape to merge.
* Fix a bug introduced in Synapse v1.84.0 where workers do not start up when ↵reivilibre2023-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | no `instance_map` was provided. (#15672) * Fix #15669: always populate instance map even if it was empty * Fix some tests * Fix more tests * Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org> * CI fix: don't forget to update apt repository sources before installing olddeps deps * Add test testing the backwards compatibility --------- Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
* Remove `worker_replication_*` settings (#15491)Jason Little2023-05-111-17/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add master to the instance_map as part of Complement, have ReplicationEndpoint look at instance_map for master. * Fix typo in drive by. * Remove unnecessary worker_replication_* bits from unit tests and add master to instance_map(hopefully in the right place) * Several updates: 1. Switch from master to main for naming the main process in the instance_map. Add useful constants for easier adjustment of names in the future. 2. Add backwards compatibility for worker_replication_* to allow time to transition to new style. Make sure to prioritize declaring main directly on the instance_map. 3. Clean up old comments/commented out code. 4. Adjust unit tests to match with new code. 5. Adjust Complement setup infrastructure to only add main to the instance_map if workers are used and remove now unused options from the worker.yaml template. * Initial Docs upload * Changelog * Missed some commented out code that can go now * Remove TODO comment that no longer holds true. * Fix links in docs * More docs * Remove debug logging * Apply suggestions from code review Co-authored-by: reivilibre <olivier@librepush.net> * Apply suggestions from code review Co-authored-by: reivilibre <olivier@librepush.net> * Update version to latest, include completeish before/after examples in upgrade notes. * Fix up and docs too --------- Co-authored-by: reivilibre <olivier@librepush.net>
* Switch `InstanceLocationConfig` to a pydantic `BaseModel` (#15431)Jason Little2023-04-171-9/+43
| | | | | * Switch InstanceLocationConfig to a pydantic BaseModel, apply Strict* types and add a few helper methods(that will make more sense in follow up work). Co-authored-by: David Robertson <davidr@element.io>
* Experimental Unix socket support (#15353)Jason Little2023-04-031-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add IReactorUNIX to ISynapseReactor type hint. * Create listen_unix(). Two options, 'path' to the file and 'mode' of permissions(not umask, recommend 666 as default as nginx/other reverse proxies write to it and it's setup as user www-data) For the moment, leave the option to always create a PID lockfile turned on by default * Create UnixListenerConfig and wire it up. Rename ListenerConfig to TCPListenerConfig, then Union them together into ListenerConfig. This spidered around a bit, but I think I got it all. Metrics and manhole have been placed behind a conditional in case of accidental putting them onto a unix socket. Use new helpers to get if a listener is configured for TLS, and to help create a site tag for logging. There are 2 TODO things in parse_listener_def() to finish up at a later point. * Refactor SynapseRequest to handle logging correctly when using a unix socket. This prevents an exception when an IP address can not be retrieved for a request. * Make the 'Synapse now listening on Unix socket' log line a little prettier. * No silent failures on generic workers when trying to use a unix socket with metrics or manhole. * Inline variables in app/_base.py * Update docstring for listen_unix() to remove reference to a hardcoded permission of 0o666 and add a few comments saying where the default IS declared. * Disallow both a unix socket and a ip/port combo on the same listener resource * Linting * Changelog * review: simplify how listen_unix returns(and get rid of a type: ignore) * review: fix typo from ConfigError in app/homeserver.py * review: roll conditional for http_options.tag into get_site_tag() helper(and add docstring) * review: enhance the conditionals for checking if a port or path is valid, remove a TODO line * review: Try updating comment in get_client_ip_if_available to clarify what is being retrieved and why * Pretty up how 'Synapse now listening on Unix Socket' looks by decoding the byte string. * review: In parse_listener_def(), raise ConfigError if neither socket_path nor port is declared(and fix a typo)
* Refactor `federation_sender` and `pusher` configuration loading. (#14496)realtyem2022-11-221-69/+70
| | | | | | To avoid duplicating the same logic for handling legacy configuration settings. This should help in applying similar logic to other worker types.
* Fix version that `worker_main_http_uri` is redundant from (#14476)David Robertson2022-11-171-1/+1
| | | | | * Fix version that `worker_main_http_uri` is redundant from * Changelog
* Remove need for `worker_main_http_uri` setting to use /keys/upload. (#14400)realtyem2022-11-161-0/+6
|
* Support using SSL on worker endpoints. (#14128)Tuomas Ojamies2022-11-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix missing SSL support in worker endpoints. * Add changelog * SSL for Replication endpoint * Remove unit test change * Refactor listener creation to reduce duplicated code * Fix the logger message * Update synapse/app/_base.py Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Update synapse/app/_base.py Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Update synapse/app/_base.py Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Add config documentation for new TLS option Co-authored-by: Tuomas Ojamies <tojamies@palantir.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
* Remove configuration options for direct TCP replication. (#13647)Patrick Cloke2022-09-061-3/+5
| | | Removes the ability to configure legacy direct TCP replication. Workers now require Redis to run.
* Remove code generating comments in configuration file (#12941)Shay2022-06-141-49/+0
|
* Add the `update_user_directory_from_worker` configuration option ↵reivilibre2022-05-101-0/+7
| | | | | (superseding `update_user_directory`) to allow a generic worker to be designated as the worker to update the user directory. (#12654) Co-authored-by: Shay <hillerys@element.io>
* Add the `notify_appservices_from_worker` configuration option (superseding ↵reivilibre2022-05-061-1/+108
| | | | `notify_appservices`) to allow a generic worker to be designated as the worker to send traffic to Application Services. (#12452)
* Add missing type hints to config classes. (#12402)Patrick Cloke2022-04-111-5/+11
|
* Use auto_attribs/native type hints for attrs classes. (#11692)Patrick Cloke2022-01-131-15/+9
|
* Additional type hints for config module. (#11465)Patrick Cloke2021-12-011-1/+3
| | | | This adds some misc. type hints to helper methods used in the `synapse.config` module.
* Enable passing typing stream writers as a list. (#11237)Nick Barrett2021-11-031-3/+15
| | | | This makes the typing stream writer config match the other stream writers that only currently support a single worker.
* Split presence out of master (#9820)Erik Johnston2021-04-231-1/+26
|
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Clean up `ShardedWorkerHandlingConfig` (#9466)Erik Johnston2021-02-241-7/+86
| | | | | | | | | | | | | | | | | * Split ShardedWorkerHandlingConfig This is so that we have a type level understanding of when it is safe to call `get_instance(..)` (as opposed to `should_handle(..)`). * Remove special cases in ShardedWorkerHandlingConfig. `ShardedWorkerHandlingConfig` tried to handle the various different ways it was possible to configure federation senders and pushers. This led to special cases that weren't hit during testing. To fix this the handling of the different cases is moved from there and `generic_worker` into the worker config class. This allows us to have the logic in one place and allows the rest of the code to ignore the different cases.
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-6/+13
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Allow moving account data and receipts streams off master (#9104)Erik Johnston2021-01-181-1/+17
|
* Allow running sendToDevice on workers (#9044)Erik Johnston2021-01-071-1/+9
|
* Add authentication to replication endpoints. (#8853)Patrick Cloke2020-12-041-0/+10
| | | | Authentication is done by checking a shared secret provided in the Synapse configuration file.
* Allow background tasks to be run on a separate worker. (#8369)Patrick Cloke2020-10-021-0/+18
|
* Add experimental support for sharding event persister. Again. (#8294)Erik Johnston2020-09-141-10/+27
| | | | | | This is *not* ready for production yet. Caveats: 1. We should write some tests... 2. The stream token that we use for events can get stalled at the minimum position of all writers. This means that new events may not be processed and e.g. sent down sync streams if a writer isn't writing or is slow.
* Revert "Add experimental support for sharding event persister. (#8170)" (#8242)Brendan Abolivier2020-09-041-27/+10
| | | | | | | * Revert "Add experimental support for sharding event persister. (#8170)" This reverts commit 82c1ee1c22a87b9e6e3179947014b0f11c0a1ac3. * Changelog
* Add experimental support for sharding event persister. (#8170)Erik Johnston2020-09-021-10/+27
| | | | | | This is *not* ready for production yet. Caveats: 1. We should write some tests... 2. The stream token that we use for events can get stalled at the minimum position of all writers. This means that new events may not be processed and e.g. sent down sync streams if a writer isn't writing or is slow.
* Update worker docs with recent enhancements (#7969)Erik Johnston2020-07-291-1/+48
|
* Allow moving typing off master (#7869)Erik Johnston2020-07-161-9/+10
|
* Create a ListenerConfig object (#7681)Richard van der Hoff2020-06-161-17/+7
| | | | | | | | | | This ended up being a bit more invasive than I'd hoped for (not helped by generic_worker duplicating some of the code from homeserver), but hopefully it's an improvement. The idea is that, rather than storing unstructured `dict`s in the config for the listener configurations, we instead parse it into a structured `ListenerConfig` object.
* Add option to move event persistence off master (#7517)Erik Johnston2020-05-221-2/+28
|
* Add `instance_map` config and route replication calls (#7495)Erik Johnston2020-05-141-0/+17
|
* Refactor HomeserverConfig so it can be typechecked (#6137)Amber Brown2019-10-101-0/+2
|
* fix broken copyrightsMatthew Hodgson2019-09-231-1/+1
|
* Fix logging in workers (#5729)Amber Brown2019-07-221-0/+1
| | | This also adds a worker blacklist.
* Remove non-dedicated logging options and command line arguments (#5678)Amber Brown2019-07-191-6/+0
|
* Pass config_dir_path and data_dir_path into Config.read_config. (#5522)Richard van der Hoff2019-06-241-1/+1
| | | | | | * Pull config_dir_path and data_dir_path calculation out of read_config_files * Pass config_dir_path and data_dir_path into read_config
* Drop support for cpu_affinity (#5525)Richard van der Hoff2019-06-221-1/+0
| | | This has no useful purpose on python3, and is generally a source of confusion.
* Run Black. (#5482)Amber Brown2019-06-201-7/+9
|
* Correctly handle all command line optionsErik Johnston2019-03-141-1/+23
|
* Allow passing --daemonize to workersErik Johnston2019-03-131-0/+4
|
* Add replication http endpoint for event sendingErik Johnston2018-02-071-0/+8
|
* Actually make it workErik Johnston2018-01-121-0/+5
|
* Allow configuration of CPU affinityRichard van der Hoff2017-08-151-0/+1
| | | | | Make it possible to set the CPU affinity in the config file, so that we don't need to remember to do it manually every time.
* Add a frontend proxyErik Johnston2017-07-071-0/+2
|
* Remove unused worker config optionErik Johnston2017-04-041-1/+0
|
* Update all the workers and master to use TCP replicationErik Johnston2017-04-031-0/+3
|
* Make worker listener config backwards compatErik Johnston2017-01-201-0/+10
|
* Use worker_ prefixes for worker config, use existing support for multiple ↵Mark Haines2016-06-161-41/+8
| | | | config files
* Access the event_cache_size directly from the server object.Mark Haines2016-06-161-14/+0
| | | | | This means that the workers can override the event_cache_size directly without clobbering the value in the main synapse config.
* Access replication_url from the worker config directlyMark Haines2016-06-161-4/+0
|
* Comment on what's going on in clobber_with_worker_configMark Haines2016-06-161-1/+12
|
* Add worker config moduleMark Haines2016-06-161-0/+71