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

Add missing worker settings to shared configuration #14748

Merged
merged 5 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/14748.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add missing worker settings to shared configuration documentation.
54 changes: 48 additions & 6 deletions docs/usage/configuration/config_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2514,18 +2514,18 @@ state events are shared with users:
- `m.room.topic`

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

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

Expand Down Expand Up @@ -2996,7 +2996,7 @@ Options for each entry include:
* `picture_claim`: name of the claim containing an url for the user's profile picture.
Defaults to 'picture', which OpenID Connect compliant providers should provide
and has to refer to a direct image file such as PNG, JPEG, or GIF image file.

Currently only supported in monolithic (single-process) server configurations
where the media repository runs within the Synapse process.

Expand Down Expand Up @@ -3840,6 +3840,48 @@ Example configuration:
```yaml
run_background_tasks_on: worker1
```
---
### `update_user_directory_from_worker`

The [worker](../../workers.md#updating-the-user-directory) that is used to
update the user directory. If not provided this defaults to the main process.

Example configuration:
```yaml
update_user_directory_from_worker: worker1
```

_Added in Synapse 1.59.0._

---
### `notify_appservices_from_worker`

The [worker](../../workers.md#notifying-application-services) that is used to
send output traffic to Application Services. If not provided this defaults
to the main process.

Example configuration:
```yaml
notify_appservices_from_worker: worker1
```

_Added in Synapse 1.59.0._

---
### `media_instance_running_background_jobs`

The [worker](../../workers.md#synapseappmedia_repository) that is used to run
background tasks for media repository. If running multiple media repositories
you must configure a single instance to run the background tasks. If not provided
this defaults to the main process or your single `media_repository` worker.

Example configuration:
```yaml
media_instance_running_background_jobs: worker1
```

_Added in Synapse 1.16.0._

---
### `redis`

Expand Down
41 changes: 36 additions & 5 deletions docs/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ An example for a dedicated background worker instance:

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

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

```yaml
update_user_directory_from_worker: worker_name
Expand All @@ -490,7 +491,8 @@ worker application type.

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

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

#### Push Notifications
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved

You can designate generic worker to sending push notifications to
a [push gateway](https://spec.matrix.org/v1.5/push-gateway-api/) such as
[sygnal](https://github.com/matrix-org/sygnal) and email.

This will stop the main process sending push notifications.

The workers responsible for sending push notifications can be defined using the
[`pusher_instances`](usage/configuration/config_documentation.md#pusher_instances)
option. For example:

```yaml
pusher_instances:
- pusher_worker1
- pusher_worker2
```

Multiple workers can be added to this map, in which case the work is balanced
across them. Ensure the main process and all pusher workers are restarted after changing
this option.

These workers don't need to accept incoming HTTP requests to send push notifications,
so no additional reverse proxy configuration is required for pusher workers.

This style of configuration supersedes the legacy `synapse.app.pusher`
worker application type.

### `synapse.app.pusher`

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

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

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

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

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

```yaml
media_instance_running_background_jobs: "media-repository-1"
Expand Down