Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 3479599

Browse files
Add missing worker settings to shared configuration (matrix-org#14748)
* Add missing worker settings to shared configuration * newsfile * update docs after review * more update for doc * This -> These Co-authored-by: David Robertson <[email protected]>
1 parent 54a7228 commit 3479599

File tree

3 files changed

+85
-11
lines changed

3 files changed

+85
-11
lines changed

changelog.d/14748.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add missing worker settings to shared configuration documentation.

docs/usage/configuration/config_documentation.md

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2623,18 +2623,18 @@ state events are shared with users:
26232623
- `m.room.topic`
26242624

26252625
To change the default behavior, use the following sub-options:
2626-
* `disable_default_event_types`: boolean. Set to `true` to disable the above
2626+
* `disable_default_event_types`: boolean. Set to `true` to disable the above
26272627
defaults. If this is enabled, only the event types listed in
26282628
`additional_event_types` are shared. Defaults to `false`.
2629-
* `additional_event_types`: A list of additional state events to include in the
2630-
events to be shared. By default, this list is empty (so only the default event
2629+
* `additional_event_types`: A list of additional state events to include in the
2630+
events to be shared. By default, this list is empty (so only the default event
26312631
types are shared).
26322632

26332633
Each entry in this list should be either a single string or a list of two
2634-
strings.
2634+
strings.
26352635
* A standalone string `t` represents all events with type `t` (i.e.
26362636
with no restrictions on state keys).
2637-
* A pair of strings `[t, s]` represents a single event with type `t` and
2637+
* A pair of strings `[t, s]` represents a single event with type `t` and
26382638
state key `s`. The same type can appear in two entries with different state
26392639
keys: in this situation, both state keys are included in prejoin state.
26402640

@@ -3126,7 +3126,7 @@ Options for each entry include:
31263126
* `picture_claim`: name of the claim containing an url for the user's profile picture.
31273127
Defaults to 'picture', which OpenID Connect compliant providers should provide
31283128
and has to refer to a direct image file such as PNG, JPEG, or GIF image file.
3129-
3129+
31303130
Currently only supported in monolithic (single-process) server configurations
31313131
where the media repository runs within the Synapse process.
31323132

@@ -3864,6 +3864,48 @@ Example configuration:
38643864
```yaml
38653865
run_background_tasks_on: worker1
38663866
```
3867+
---
3868+
### `update_user_directory_from_worker`
3869+
3870+
The [worker](../../workers.md#updating-the-user-directory) that is used to
3871+
update the user directory. If not provided this defaults to the main process.
3872+
3873+
Example configuration:
3874+
```yaml
3875+
update_user_directory_from_worker: worker1
3876+
```
3877+
3878+
_Added in Synapse 1.59.0._
3879+
3880+
---
3881+
### `notify_appservices_from_worker`
3882+
3883+
The [worker](../../workers.md#notifying-application-services) that is used to
3884+
send output traffic to Application Services. If not provided this defaults
3885+
to the main process.
3886+
3887+
Example configuration:
3888+
```yaml
3889+
notify_appservices_from_worker: worker1
3890+
```
3891+
3892+
_Added in Synapse 1.59.0._
3893+
3894+
---
3895+
### `media_instance_running_background_jobs`
3896+
3897+
The [worker](../../workers.md#synapseappmedia_repository) that is used to run
3898+
background tasks for media repository. If running multiple media repositories
3899+
you must configure a single instance to run the background tasks. If not provided
3900+
this defaults to the main process or your single `media_repository` worker.
3901+
3902+
Example configuration:
3903+
```yaml
3904+
media_instance_running_background_jobs: worker1
3905+
```
3906+
3907+
_Added in Synapse 1.16.0._
3908+
38673909
---
38683910
### `redis`
38693911

docs/workers.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,8 @@ An example for a dedicated background worker instance:
465465

466466
You can designate one generic worker to update the user directory.
467467

468-
Specify its name in the shared configuration as follows:
468+
Specify its name in the [shared configuration](usage/configuration/config_documentation.md#update_user_directory_from_worker)
469+
as follows:
469470

470471
```yaml
471472
update_user_directory_from_worker: worker_name
@@ -490,7 +491,8 @@ worker application type.
490491

491492
You can designate one generic worker to send output traffic to Application Services.
492493
Doesn't handle any REST endpoints itself, but you should specify its name in the
493-
shared configuration as follows:
494+
[shared configuration](usage/configuration/config_documentation.md#notify_appservices_from_worker)
495+
as follows:
494496

495497
```yaml
496498
notify_appservices_from_worker: worker_name
@@ -502,11 +504,38 @@ after setting this option in the shared configuration!
502504
This style of configuration supersedes the legacy `synapse.app.appservice`
503505
worker application type.
504506

507+
#### Push Notifications
508+
509+
You can designate generic worker to sending push notifications to
510+
a [push gateway](https://spec.matrix.org/v1.5/push-gateway-api/) such as
511+
[sygnal](https://github.com/matrix-org/sygnal) and email.
512+
513+
This will stop the main process sending push notifications.
514+
515+
The workers responsible for sending push notifications can be defined using the
516+
[`pusher_instances`](usage/configuration/config_documentation.md#pusher_instances)
517+
option. For example:
518+
519+
```yaml
520+
pusher_instances:
521+
- pusher_worker1
522+
- pusher_worker2
523+
```
524+
525+
Multiple workers can be added to this map, in which case the work is balanced
526+
across them. Ensure the main process and all pusher workers are restarted after changing
527+
this option.
528+
529+
These workers don't need to accept incoming HTTP requests to send push notifications,
530+
so no additional reverse proxy configuration is required for pusher workers.
531+
532+
This style of configuration supersedes the legacy `synapse.app.pusher`
533+
worker application type.
505534

506535
### `synapse.app.pusher`
507536

508537
It is likely this option will be deprecated in the future and is not recommended for new
509-
installations. Instead, [use `synapse.app.generic_worker` with the `pusher_instances`](usage/configuration/config_documentation.md#pusher_instances).
538+
installations. Instead, [use `synapse.app.generic_worker` with the `pusher_instances`](#push-notifications).
510539

511540
Handles sending push notifications to sygnal and email. Doesn't handle any
512541
REST endpoints itself, but you should set
@@ -547,7 +576,7 @@ Note this worker cannot be load-balanced: only one instance should be active.
547576
### `synapse.app.federation_sender`
548577

549578
It is likely this option will be deprecated in the future and not recommended for
550-
new installations. Instead, [use `synapse.app.generic_worker` with the `federation_sender_instances`](usage/configuration/config_documentation.md#federation_sender_instances).
579+
new installations. Instead, [use `synapse.app.generic_worker` with the `federation_sender_instances`](usage/configuration/config_documentation.md#federation_sender_instances).
551580

552581
Handles sending federation traffic to other servers. Doesn't handle any
553582
REST endpoints itself, but you should set
@@ -606,7 +635,9 @@ expose the `media` resource. For example:
606635
```
607636

608637
Note that if running multiple media repositories they must be on the same server
609-
and you must configure a single instance to run the background tasks, e.g.:
638+
and you must specify a single instance to run the background tasks in the
639+
[shared configuration](usage/configuration/config_documentation.md#media_instance_running_background_jobs),
640+
e.g.:
610641

611642
```yaml
612643
media_instance_running_background_jobs: "media-repository-1"

0 commit comments

Comments
 (0)