Commit Graph

149 Commits

Author SHA1 Message Date
Slavi Pantaleev
9d9e9e9177 Use docker inspect for Synapse systemd health check and lower health interval
Switch the systemd ExecStartPost health check from docker exec + curl
to polling docker inspect for container health status. This piggybacks
on the container image's built-in HEALTHCHECK instead of duplicating it.

Also add a configurable container health interval (5s for Traefik setups,
15s otherwise) to speed up startup readiness detection without affecting
non-Traefik deployments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 00:13:02 +02:00
Slavi Pantaleev
59e70b8ca9 Add systemd-healthcheck to Synapse systemd service in an effort to increase reliability (of Synapse-dependant services)
Previously, we had a 10-second magical delay.

Now we first do a healthcheck to figure out when it really is up.
Then, we do the same 10-second magical delay to account for the time it
may take for a reverse-proxy (like Traefik) to pick up Synapse's routes.
2026-02-11 23:32:33 +02:00
Slavi Pantaleev
dd26f8a12a Add systemd dependencies to s3-storage-provider-migrate service
The migrate service now declares Requires/After on matrix-synapse.service,
ensuring Synapse (and its transitive dependencies like Postgres and Docker)
are running before the migration triggers.
2026-02-11 16:50:29 +02:00
Aine
adf521f8cb add matrix_synapse_email_enable_notifs and matrix_synapse_email_notif_for_new_users 2026-02-05 19:09:51 +00:00
Slavi Pantaleev
460d46999f Make Synapse's enable_local_media_storage configurable
Ref:
- https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/4882
- https://github.com/element-hq/synapse/pull/19204
- https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html#enable_local_media_storage

We default it to `true`, keeping up with upstream and the old behavior.

s3-storage-provider users may set `matrix_synapse_enable_local_media_storage` to `false`
to disable local file caching.
This likely comes at the expense of some performance.

For matrix-media-repo users, it likely doesn't matter what this is set to,
as for a matrix-media-repo setup, all media-related API endpoints are
captured and forwarded to matrix-media-repo (before reaching Synapse).
2026-01-27 22:11:06 +02:00
Aine
484e94d493 add matrix_synapse_ext_s3_storage_provider_container_arguments var 2025-12-23 15:34:32 +00:00
Benjamin Blacher
c1bc2be7ec Bump synapse, remove some recently stabilized features 2025-10-29 18:39:31 +02:00
Slavi Pantaleev
8fd2b75756 Remove matrix_synapse_container_image_customizations_s3_storage_provider_installation_old_boto_workaround_enabled
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4637

We no longer need to boto workaround since s3-storage-provider got
upgraded to v1.6.0 in https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/4635
2025-10-14 21:09:22 +03:00
Aleksandrs Jansons
8511d4dfc4 Add matrix_synapse_url_preview_url_blacklist var (#4641)
* synapse - introduce matrix_synapse_url_preview_url_blacklist var

* Preserve original comments around `url_preview_url_blacklist`

---------

Co-authored-by: Aleksandrs Jansons <alex@peledu.casa>
Co-authored-by: Slavi Pantaleev <slavi@devture.com>
2025-10-14 07:32:40 +03:00
Slavi Pantaleev
b54eadb9e0 Revert "Remove matrix_synapse_container_image_customizations_s3_storage_provider_installation_old_boto_workaround_enabled"
This reverts commit 2b0ea94a72.

We're going back to s3-storage-provider=v1.5.0

Ref: https://github.com/matrix-org/synapse-s3-storage-provider/pull/134#issuecomment-3396609289
2025-10-13 12:24:58 +03:00
Slavi Pantaleev
2b0ea94a72 Remove matrix_synapse_container_image_customizations_s3_storage_provider_installation_old_boto_workaround_enabled
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4637

We no longer need to boto workaround since s3-storage-provider got
upgraded to v1.6.0 in https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/4635
2025-10-13 10:16:56 +03:00
Aine
58688bf538 synapse - introduce vars to control server notices 2025-10-06 16:41:48 +01:00
Slavi Pantaleev
d8eed6bfd3 Add some variables for controlling x_forwarded settings for Synapse listeners 2025-09-16 18:17:35 +03:00
Aine
071b5789f2 add matrix_synapse_user_directory_exclude_remote_users var 2025-09-10 16:38:42 +01:00
Slavi Pantaleev
ec8a7a4934 Stabilize Matrix Authentication Service integration for Synapse
Related to https://github.com/element-hq/synapse/pull/18759

Currently problematic (leading to failures to start for Synapse) because of:
https://github.com/element-hq/synapse/pull/18759#issuecomment-3172744530
2025-08-26 15:12:26 +03:00
Aine
8ff8e435c0 add matrix_synapse_admin_contact var 2025-08-25 09:58:34 +01:00
Slavi Pantaleev
51ab9ed9ff Adjust lstrip_blocks to use a bool value for compatibility with ansible-core>=2.19.0
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4445
2025-07-26 17:58:12 +03:00
Aine
7261be5537 add matrix_synapse_ext_password_provider_ldap_tls_options_validate var 2025-07-23 08:46:08 +01:00
Suguru Hirahara
3653f9f89b Run codespell --write-changes
Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-06-03 10:36:00 +03:00
Slavi Pantaleev
95ef383ef7 Add matrix_synapse_cas_config_enabled variable to make cas_confg non-null
This works around an issue with Matrix Authentication Service's `syn2mas` sub-command (at version v0.16.0),
which chokes with an error:

> Error: Failed to load Synapse configuration
> Caused by:
> invalid type: found unit, expected struct EnableableSection for key "default.cas_config" in homeserver.yaml YAML file

This issue is likely to be fixed in MAS v0.16.1 or v0.17.0.
2025-05-07 16:37:41 +03:00
Slavi Pantaleev
e1a2d427c6 Use multi-stage Dockerfile for building customized Synape
This also reverts e5574a405e because:
- it was causing issues on some servers (not clear why)
- such workarounds are no longer necessary when doing multi-stage building.
2025-03-29 08:01:27 +02:00
Slavi Pantaleev
e5574a405e Install libldap-2.5 explicitly when installing synapse-s3-storage-provider to satisfy its psycopg2 dependency 2025-03-29 06:42:28 +02:00
Catalan Lover
cd60cf1199 Internal Admin API and Draupnir Hjack Command Config (#3389)
* Enable Internal Admin API Access separately from Public access.

* Add Config variable for Draupnir Hijack command

And also make the internal admin API be automatically  activated when this capability is used.

* Apply suggestions from code review

Co-authored-by: Slavi Pantaleev <slavi@devture.com>

* Further Refine Internal Admin API

* Add Non Worker Labels for Internal Admin API

* Variable Rename

* Add validation rules for Internal Synapse admin API

* Add Draupnir Admin API required config validation.

* Override `matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_traefik_entrypoints` via group vars

* Wire `matrix_bot_draupnir_admin_api_enabled` to `matrix_bot_draupnir_config_admin_enableMakeRoomAdminCommand` in Draupnir's `defaults/main.yml`

* Remove unnecessary `matrix_bot_draupnir_admin_api_enabled` override from `group_vars/matrix_servers`

The same value is now (more appropriately) defined in Draupnir's `defaults/main.yml` file anyway.

* Add additional condition (`matrix_bot_draupnir_enabled`) for enabling `matrix_synapse_container_labels_internal_client_synapse_admin_api_enabled`

* Use a separate task for validating `matrix_bot_draupnir_admin_api_enabled` when `matrix_bot_draupnir_config_admin_enableMakeRoomAdminCommand`

The other task deals with checking for null and not-blank and can't handle booleans properly.

---------

Co-authored-by: Slavi Pantaleev <slavi@devture.com>
2025-03-15 09:14:55 +02:00
Aine
1c53f8dd1d introduce new synapse vars 2025-03-14 22:44:35 +02:00
Slavi Pantaleev
60e2e035a2 Add matrix_synapse_rc_delayed_event_mgmt variable
Ref:
- c4747dd177/docs/self-hosting.md (a-matrix-homeserver)
- e39fe3bc7f
2025-03-14 22:29:08 +02:00
Benjamin Blacher
bf1efda094 Add support for configuring Synapse's MSC4133 (Custom Profile Fields) (#4171)
* Add support for configuring Synapse's MSC4133 (Custom Profile Fields) experimental feature

* Reorder experimental_features in homeserver.yaml.j2 alphabetically

---------

Co-authored-by: Slavi Pantaleev <slavi@devture.com>
2025-03-13 21:28:23 +02:00
Slavi Pantaleev
63f81bf268 Add support for configuring Synapse's MSC4222 (adding state_after to sync v2) experimental feature
This is required by Element Call.

Ref:

- 93ae2aed98/docs/self-hosting.md (a-matrix-homeserver)
- https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3562
2025-03-12 09:12:39 +02:00
Slavi Pantaleev
f5a0be0a7b Add support for configuring Synapse's MSC4140 (Delayed Events) experimental feature
This is required by Element Call.

Ref:

- 93ae2aed98/docs/self-hosting.md (a-matrix-homeserver)
- https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3562
2025-03-12 09:10:35 +02:00
Slavi Pantaleev
4fb0b75942 Reorder Synapse config's experimental_features alphabetically 2025-03-12 09:05:59 +02:00
Iruwen
55e47d69db Enable room summary API (MSC3266) support for Synapse to support Element X clients 2025-03-06 14:48:23 +01:00
Suguru Hirahara
2eb952201c Add license information to files in matrix-synapse/templates/synapse
Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-03-04 19:22:38 +09:00
Suguru Hirahara
431d4c414b Add license information to files in matrix-synapse/templates/goofys
Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-03-04 19:22:26 +09:00
Slavi Pantaleev
1eea92ba56 Add a matrix_synapse_redis_use_tls variable
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4113
2025-02-26 20:47:47 +02:00
Slavi Pantaleev
d12643eb91 Do not use docker stop --time (deprecated in Docker v28 in favor of --timeout or just -t)
`-t` works on both old and new Docker versions, so it's best to use that.
2025-02-22 21:42:18 +02:00
Slavi Pantaleev
72280bbbb2 Add a matrix_synapse_url_preview_ip_range_whitelist variable 2025-02-21 23:05:14 +02:00
Slavi Pantaleev
0d7d5e6a19 Do not define url_preview_ip_range_blacklist in Synapse's homeserver.yaml if URL preview is disabled
It's useless and just makes the config longer.
2025-02-21 23:03:26 +02:00
Slavi Pantaleev
d9eabc49e6 Add a matrix_synapse_url_preview_ip_range_blacklist variable 2025-02-21 22:21:06 +02:00
Suguru Hirahara
c27fb2a832 Fix capitalization: postgres → Postgres
Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-02-13 14:00:41 +09:00
Slavi Pantaleev
7232d2b6d5 Pin boto3 and botocore to an old version when installing synapse-s3-storage-provider to prevent issues with non-AWS S3 providers
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3964

Related to https://github.com/aws/aws-cli/issues/9214
2025-01-19 10:32:07 +02:00
Slavi Pantaleev
75026d8c3d Update a few incorrect comments 2024-12-25 16:42:19 +02:00
Suguru Hirahara
f0cc5da229 Edit user identifier examples: to @alice and @bob
Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2024-12-09 14:40:41 +09:00
Suguru Hirahara
c1c1b3ada0 Replace triple dots with horizontal ellipsis (U+2026)
Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2024-12-06 13:34:50 +09:00
Suguru Hirahara
8a18cc946d Replace "@user1" with "@alice" and "@user2" with "@bob" (#3833)
* Replace "@user1" with "@alice"

Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>

* Replace "@user2" with "@bob"

Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>

---------

Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
Co-authored-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2024-11-28 13:53:11 +02:00
Aine
769a31d3ca adjust synapse purge jobs template 2024-11-18 10:00:12 +02:00
Aine
7fc8509f04 synapse - update retention purge jobs template 2024-11-17 18:34:22 +02:00
Aine
5bf09f5fdc add new variables to control message retention in Synapse 2024-11-17 13:47:06 +02:00
Slavi Pantaleev
609cf5940e Enable (Traefik compression middleware)-assisted compression for Synapse
This likely breaks QR code login for non-worker Synapse setups.

See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3749
2024-11-14 16:24:30 +02:00
Slavi Pantaleev
509542ccaf Enable QR code login (MSC4108) support for Synapse when Matrix Authentication Service is enabled
Related to 8a6b822bbd

Related to https://github.com/matrix-org/matrix-spec-proposals/pull/4108

Potential (unconfirmed) fix for https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3749
2024-11-09 21:19:40 +02:00
Aine
95aaf76d0d add matrix_synapse_oembed_additional_providers var 2024-11-07 11:08:40 +02:00
Suguru Hirahara
aaa6335053 Replace !someRoom with !qporfwt
!qporfwt is used as an example of a room ID on https://spec.matrix.org/v1.12/#room-structure

Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2024-10-21 21:47:52 +09:00