330 Commits

Author SHA1 Message Date
renovate[bot] 7587b8f099 Update ghcr.io/element-hq/synapse Docker tag to v1.157.2 (#5477)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-28 13:51:42 +00:00
renovate[bot] a791983760 Update ghcr.io/element-hq/synapse Docker tag to v1.157.1 2026-07-23 06:18:56 +03:00
Slavi Pantaleev dd1e3ea46d Fix Synapse usage statistics reporting when synapse-usage-exporter is not used
Since the introduction of the synapse-usage-exporter role (55f869254, #3442), group_vars/matrix_servers was overriding matrix_synapse_report_stats_endpoint with an empty string whenever synapse-usage-exporter was disabled, clobbering the role's matrix.org default.

For deployments that enable matrix_synapse_report_stats, Synapse would then try reporting statistics to an empty URL, failing with:

> synapse.app.homeserver - 210 - WARNING - phone_stats_home-0 - Error reporting stats: Invalid URI b''

The default endpoint URL now lives in a dedicated matrix_synapse_report_stats_endpoint_default variable, which group_vars/matrix_servers falls back to when synapse-usage-exporter is not enabled.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 08:16:13 +03:00
Slavi Pantaleev 654aea79b2 Remove obsolete Synapse experimental feature flags (msc3266, msc4140, msc4429)
None of these flags exist in current Synapse:

- msc3266_enabled: MSC3266 support was stabilized in Synapse v1.153.0 and the room summary API is now always enabled

- msc4140_enabled: this was never a Synapse configuration setting in any released version. Delayed events have always been controlled by the `max_event_delay_duration` setting, which the playbook was emitting alongside the flag. The toggle is now named `matrix_synapse_delayed_events_enabled`.

- msc4429_enabled: MSC4429 support has not landed in any released Synapse version, so this flag never had any effect

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 07:56:17 +03:00
Slavi Pantaleev 6b0a635454 Ensure experimental_features is never null in the Synapse configuration (Synapse v1.157.0 compatibility)
When no experimental features were enabled (e.g. Matrix RTC and Matrix Authentication Service both disabled), the generated homeserver.yaml contained `experimental_features: null`, which Synapse v1.157.0+ does not tolerate and crashes on startup.

The `experimental_features` configuration is now constructed via a dedicated `matrix_synapse_experimental_features` variable (split into `_default`, `_auto` and `_custom`, as is customary), which always yields a mapping (potentially an empty one).

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5455

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 07:46:49 +03:00
renovate[bot] 37b1a36a53 Update ghcr.io/element-hq/synapse Docker tag to v1.157.0 2026-07-21 21:47:49 +03:00
Slavi Pantaleev 73a52c8a24 Make postgres_max_connections scale with the Synapse worker count
With workers enabled, every Synapse process (the main one and each
worker) maintains its own database connection pool of up to
matrix_synapse_database_cp_max (default: 10) connections. The previous
fixed limit of 500 left little headroom on setups running many workers,
where exhausting it manifests as degraded performance and, reportedly,
E2EE misbehavior.

Size the limit as a 200-connection baseline (for everything else that
talks to Postgres) plus cp_max connections per Synapse process, never
going below the previous value of 500. The stock worker presets stay at
500; setups that raise worker counts (or cp_max) get a limit that grows
accordingly. The new matrix_synapse_workers_total_count variable
reflects what the matrix_synapse_workers_*_count variables ask for; it
does not reflect a manually populated
matrix_synapse_workers_enabled_list, and such setups should override
postgres_max_connections themselves.

Fixes #4442

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 14:20:12 +03:00
renovate[bot] dd6b4444de Update nginx Docker tag to v1.31.3 2026-07-16 07:10:06 +03:00
renovate[bot] 373bf99c86 Update ghcr.io/element-hq/synapse Docker tag to v1.156.0 2026-07-07 21:59:51 +03:00
renovate[bot] 6b76368a9c Update nginx Docker tag to v1.31.2 2026-06-18 09:56:48 +03:00
renovate[bot] 4bf6093a5d Update ghcr.io/element-hq/synapse Docker tag to v1.155.0 2026-06-17 06:20:05 +03:00
renovate[bot] 47a4037ea2 Update ghcr.io/element-hq/synapse Docker tag to v1.154.0 2026-06-04 22:12:03 +03:00
Norman Ziegner 971c5b954c Add Synapse support for MSC4429
Introduces the `matrix_synapse_experimental_features_msc4429_enabled`
variable (disabled by default), allowing Synapse to notify clients
using the legacy /sync endpoint of profile changes for other users.

See <https://github.com/matrix-org/matrix-spec-proposals/pull/4429>

Signed-off-by: Norman Ziegner <n.ziegner@hzdr.de>
2026-05-29 13:41:11 +03:00
renovate[bot] b5e1fb8e30 Update nginx Docker tag to v1.31.1 2026-05-23 08:20:02 +03:00
renovate[bot] 9c447242f2 Update ghcr.io/element-hq/synapse Docker tag to v1.153.0 2026-05-19 21:52:59 +03:00
renovate[bot] 5186360194 Update nginx Docker tag to v1.31.0 2026-05-14 08:30:16 +03:00
renovate[bot] 401dfe6c86 Update dependency matrix-org/synapse-s3-storage-provider to v1.6.1 2026-05-13 21:10:43 +03:00
renovate[bot] a0d056d160 Update ghcr.io/element-hq/synapse Docker tag to v1.152.1 2026-05-07 23:57:49 +03:00
Slavi Pantaleev 152a3bbc2a matrix-synapse: switch to modern community.docker docker_image modules
Replaces `community.docker.docker_image` with the modern
`docker_image_pull` and `docker_image_build` split modules across all
four task files (synapse, reverse_proxy_companion, goofys,
rust-synapse-compress-state). Drops the `ansible_version` compatibility
ladder and removes four `_container_image_force_pull` variables (the new
pull module handles registry refresh natively via `pull: always`).

The Synapse self-build path uses `ansible.builtin.shell` for BuildKit
support and is left as-is. The customizations image build (which builds
on top of the locally-tagged synapse image) is converted to
`docker_image_build` with `pull: false`, preserving its existing
rebuild-trigger semantics.

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5191.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 22:25:44 +03:00
Slavi Pantaleev 5901f491f4 matrix-synapse: support quarantined_media_changes stream writers
Synapse v1.152 introduces a new `quarantined_media_changes` stream and
requires that any worker serving `/_synapse/admin/v1/quarantine_media/`
be declared as a writer for that stream. Otherwise quarantining media
fails on the worker.

Add `quarantined_media_changes` as a web-facing stream writer alongside
the other stream-backed APIs and route the admin endpoint via the same
explicit writer-or-main model used for `device_lists`, `thread_subscriptions`,
etc. The endpoint is removed from `matrix_synapse_workers_media_repository_endpoints`
so the old media-repository route does not shadow (or conflict with) the
new writer-or-main route. Without that move, the previously-shipping
default of routing `/quarantine_media` to the `media_repository` worker
would silently break after the v1.152.0 image bump.

Default count is 1 in the `one-of-each` and `specialized-workers` presets
(matching `device_lists`), and 0 in `little-federation-helper` (which
also has no media-repository worker, so falling back to main is fine).

Refs:
- https://github.com/element-hq/synapse/blob/develop/docs/upgrade.md#upgrading-to-v11520
- https://element-hq.github.io/synapse/latest/workers.html#the-quarantined_media_changes-stream

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 14:12:25 +03:00
renovate[bot] e59e6682be Update ghcr.io/element-hq/synapse Docker tag to v1.152.0 2026-04-30 14:00:49 +03:00
Sid Manat cf71cb64c4 feat(synapse): support Postgres database keepalive options 2026-04-17 21:50:44 +03:00
renovate[bot] d369b288d4 chore(deps): update nginx docker tag to v1.30.0 2026-04-15 09:42:32 +03:00
renovate[bot] 2f4e76c453 chore(deps): update ghcr.io/element-hq/synapse docker tag to v1.151.0 2026-04-08 19:25:19 +03:00
renovate[bot] be8fc7e8ba chore(deps): update nginx docker tag to v1.29.8 2026-04-08 07:15:05 +03:00
renovate[bot] 3400769336 chore(deps): update nginx docker tag to v1.29.7 2026-03-25 09:40:14 +02:00
renovate[bot] e5dbd51b46 chore(deps): update ghcr.io/element-hq/synapse docker tag to v1.150.0 2026-03-24 23:55:29 +02:00
Slavi Pantaleev 63c4fffe65 Add Synapse support for MSC4143 2026-03-23 21:45:13 +02:00
Slavi Pantaleev b3a0f52824 Add conditional restart support to matrix-synapse-s3-storage-provider-migrate
Register env, database config, scripts, and systemd service/timer results,
compute matrix_synapse_s3_storage_provider_restart_necessary, and wire it
into group_vars/matrix_servers instead of hardcoding restart_necessary: true.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:21:59 +02:00
Slavi Pantaleev 27a2b126bc Add conditional restart support to matrix-goofys
Register image pull, env, and systemd service results, compute
matrix_goofys_restart_necessary, and wire it into group_vars/matrix_servers
instead of hardcoding restart_necessary: true.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:19:45 +02:00
Slavi Pantaleev 68aca96cbd docs: clarify database_host ignored when postgres sockets are enabled 2026-03-18 15:21:03 +02:00
Norman Ziegner 19423864f0 synapse: add missing server_notices configuration variables
Add support for all server_notices settings documented by Synapse:
- room_avatar_url: optional avatar for the server notices room
- room_topic: optional topic for the server notices room
- auto_join: whether users are auto-joined instead of invited (default: false)

Signed-off-by: Norman Ziegner <n.ziegner@hzdr.de>
2026-03-17 16:43:14 +02:00
Slavi Pantaleev 5df7e678f7 matrix-synapse: add an explicit msc4306 feature toggle
Expose Synapse's `msc4306_enabled` experimental flag as a first-class MDAD
variable and wire it into `homeserver.yaml` alongside the other experimental
feature toggles.

This makes thread-subscriptions support explicit in playbook configuration,
rather than requiring operators to inject the upstream flag via raw
`matrix_synapse_configuration_extension_yaml`.

The variable intentionally controls only the Synapse feature flag. It does not
change the default `thread_subscriptions` worker count, which remains `0` in the
standard presets. Keeping those as separate choices avoids auto-starting an
experimental worker just because the upstream feature toggle is enabled.

Refs:
- https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/config/experimental.py#L600-L602
- https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/client/versions.py#L183-L184
2026-03-15 01:26:53 +02:00
Slavi Pantaleev 9af79ce4d2 matrix-synapse: support thread_subscriptions stream writers
Add `thread_subscriptions` as a supported web-facing stream writer in MDAD and
route its unstable client endpoints via the same explicit writer-or-main model
used for the other web-facing stream-backed APIs.

This is not just another generic worker route. Current Synapse gives thread
subscriptions their own `writers.thread_subscriptions` configuration, backs them
with a multi-writer stream, and asserts on store writes that the current
instance is an allowed thread-subscriptions writer.

Explicit early routing is also required here because the subscription endpoint is
room-scoped. In MDAD's specialized-worker model, the existing room-worker regex
would otherwise match `/_matrix/client/unstable/io.element.msc4306/rooms/...`
and steal the request before it reached the correct writer-or-main fallback.

Unlike `device_lists`, support is added without enabling a thread-subscriptions
worker by default in the standard presets. The underlying MSC4306/4308 feature
remains unstable and disabled by default upstream, so the conservative default
is to keep the worker count at `0` and let the new explicit routes fall back to
`main` unless an operator opts in.

Refs:
- https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/config/workers.py#L175-L182
- https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/client/thread_subscriptions.py#L38-L247
- https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/storage/databases/main/thread_subscriptions.py#L66-L83
- https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/storage/databases/main/thread_subscriptions.py#L192-L322
2026-03-15 01:16:24 +02:00
Slavi Pantaleev 0f687a69c5 matrix-synapse: simplify redundant SSO main-override regexes
MDAD keeps `/_synapse/client/*` out of the broad worker-routing model.
Those paths are mounted by current Synapse on client-serving workers, but MDAD's
worker route buckets only match `/_matrix/client/*`, so `/_synapse/client/*`
requests already fall through to the main-process default.

That made the `/_synapse/client/*` branches in the dedicated SSO override regex
redundant. Remove those branches and leave the explicit SSO override focused on
the real `/_matrix/client/.../login/sso/redirect` path family, which would
otherwise be caught by the broad `/login` client-reader routing.

This also removes duplicated ownership of `login/sso/redirect` from the generic
main-override regex so the dedicated SSO override is the single place that
models that path.

Refs:
- https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/app/generic_worker.py#L197-L203
- https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/synapse/client/__init__.py#L39-L90
- https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/client/login.py#L636-L643
2026-03-15 01:02:19 +02:00
Slavi Pantaleev dfe8628fbf matrix-synapse: add routing-focused reverse-proxy access log preset 2026-03-14 02:56:48 +02:00
Slavi Pantaleev a3ff72ebff matrix-synapse: enable push_rules writer in worker presets 2026-03-14 01:50:07 +02:00
Slavi Pantaleev df76b1cd5b matrix-synapse: enable device_lists writer in worker presets 2026-03-14 01:49:45 +02:00
Slavi Pantaleev dafac35a0e matrix-synapse: route stream-backed client endpoints explicitly and add device_lists stream writer support
Some client API endpoints (e.g. keys/upload) are backed by Synapse stream writers and
should not rely on broad worker regexes or route-order fallthrough for correctness.

When explicit per-stream routing is missing, requests may be captured by generic, room, or client_reader workers, instead of:
- going to the configured stream writer
- or to `main` when that stream writer is not enabled

This refactors synapse-reverse-proxy-companion's routing so that web-facing stream-backed endpoint families
are handled explicitly and early, with deterministic writer-or-main fallback.

Add first-class support for the missing `device_lists` stream writer,
generalize the same routing model to `push_rules`,
and remove stale broad-route ownership for device-list-sensitive endpoints.
2026-03-14 01:42:08 +02:00
renovate[bot] 79a4156a78 chore(deps): update ghcr.io/element-hq/synapse docker tag to v1.149.1 2026-03-11 12:26:30 +02:00
renovate[bot] 0320e671e3 chore(deps): update nginx docker tag to v1.29.6 2026-03-11 01:47:55 +02:00
renovate[bot] 4e3658bb98 chore(deps): update ghcr.io/element-hq/synapse docker tag to v1.149.0 2026-03-10 22:43:44 +02:00
Aine 12d8015bc4 optional postgres unix socket with synapse 2026-03-10 17:38:16 +00:00
renovate[bot] 81b944540b chore(deps): update matrixdotorg/mjolnir docker tag to v1.12.1 2026-03-10 07:38:57 +02:00
Benjamin Blacher df5b84588b Add support for sticky events (experimental) 2026-03-09 15:51:38 +02:00
Aine 82caf3a7d3 improve synapse redis socket mounting 2026-03-08 09:56:26 +00:00
Aine 45d5ebd008 fix comments 2026-03-08 08:09:17 +00:00
Aine 0c40a03efc allow synapse to use redis unix socket instead of tcp 2026-03-08 07:24:33 +00:00
mikhail.sarnov 1ee5c1f416 feat(synapse): add ca_certs_file support for LDAP TLS
Add matrix_synapse_ext_password_provider_ldap_tls_options_ca_certs_file
variable to allow specifying a custom CA certificate file for LDAP TLS
verification. Useful when Synapse is running in a container that does not
trust a private/internal CA by default.

Example usage:
matrix_synapse_ext_password_provider_ldap_tls_options_ca_certs_file: /etc/ssl/certs/my-ca.crt
2026-03-05 14:06:52 +02:00
Slavi Pantaleev a949605518 Remove duplicate "Project source code URL" from roles/custom/matrix-synapse/defaults/main.yml
This was causing issues when it's parsed out by certain tools.

Regression since 28afbde971
2026-02-26 12:40:45 +02:00