From 71abb52d5913102f127b8b36f5ecfb9ceb1564eb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:39:54 +0000 Subject: [PATCH 01/27] Update matrixdotorg/dendrite-monolith Docker tag to v0.13.8 --- roles/custom/matrix-dendrite/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-dendrite/defaults/main.yml b/roles/custom/matrix-dendrite/defaults/main.yml index 0d78ebbea..48aa21ada 100644 --- a/roles/custom/matrix-dendrite/defaults/main.yml +++ b/roles/custom/matrix-dendrite/defaults/main.yml @@ -13,7 +13,7 @@ matrix_dendrite_docker_image_path: "matrixdotorg/dendrite-monolith" matrix_dendrite_docker_image: "{{ matrix_dendrite_docker_image_name_prefix }}{{ matrix_dendrite_docker_image_path }}:{{ matrix_dendrite_docker_image_tag }}" matrix_dendrite_docker_image_name_prefix: "{{ 'localhost/' if matrix_dendrite_container_image_self_build else matrix_container_global_registry_prefix }}" # renovate: datasource=docker depName=matrixdotorg/dendrite-monolith -matrix_dendrite_docker_image_tag: "v0.13.7" +matrix_dendrite_docker_image_tag: "v0.13.8" matrix_dendrite_docker_image_force_pull: "{{ matrix_dendrite_docker_image.endswith(':latest') }}" matrix_dendrite_base_path: "{{ matrix_base_data_path }}/dendrite" From 11e241e30ab32ace6a852aff889b8652704e9f9c Mon Sep 17 00:00:00 2001 From: comeUpWithItLater Date: Sat, 14 Sep 2024 14:06:40 +0800 Subject: [PATCH 02/27] Added an example of fronting the playbook's integrated Traefik reverse-proxy with the existing Caddy container (#3514) * Added an example of fronting the playbook's integrated Traefik reverse-proxy with the existing Caddy container (not the `apt-get` or `yum` installed Caddy). Helpful for folks who have an existing server with a Caddy container already serving multiple applications. * Update examples/reverse-proxies/caddy2-in-container/README.md Co-authored-by: Slavi Pantaleev * Update examples/reverse-proxies/caddy2-in-container/README.md Co-authored-by: Slavi Pantaleev * Update examples/reverse-proxies/caddy2-in-container/README.md Co-authored-by: Slavi Pantaleev * Code formatted, linted with yamllint * README.md updated * docs/configuring-playbook-own-webserver-caddy.md removed --------- Co-authored-by: Slavi Pantaleev --- .../caddy2-in-container/Caddyfile | 43 +++++++++++++++++++ .../caddy2-in-container/README.md | 19 ++++++++ .../caddy2-in-container/docker-compose.yaml | 23 ++++++++++ 3 files changed, 85 insertions(+) create mode 100644 examples/reverse-proxies/caddy2-in-container/Caddyfile create mode 100644 examples/reverse-proxies/caddy2-in-container/README.md create mode 100644 examples/reverse-proxies/caddy2-in-container/docker-compose.yaml diff --git a/examples/reverse-proxies/caddy2-in-container/Caddyfile b/examples/reverse-proxies/caddy2-in-container/Caddyfile new file mode 100644 index 000000000..9f1128c2f --- /dev/null +++ b/examples/reverse-proxies/caddy2-in-container/Caddyfile @@ -0,0 +1,43 @@ +matrix.example.tld { + + handle { + encode zstd gzip + + # Use the docker service name instead of localhost or 127.0.0.1 here + matrix-traefik:8080 { + header_up X-Forwarded-Port {http.request.port} + header_up X-Forwarded-TlsProto {tls_protocol} + header_up X-Forwarded-TlsCipher {tls_cipher} + header_up X-Forwarded-HttpsProto {proto} + } + } +} + +# Put `https://` at the beginning to enforce https protocol as 8448 is not the default https port (which is 443) +https://matrix.example.tld:8448 { + handle { + encode zstd gzip + + # Use the docker service name instead of localhost or 127.0.0.1 here + reverse_proxy matrix-traefik:8448 { + header_up X-Forwarded-Port {http.request.port} + header_up X-Forwarded-TlsProto {tls_protocol} + header_up X-Forwarded-TlsCipher {tls_cipher} + header_up X-Forwarded-HttpsProto {proto} + } + } +} + + +example.tld { +# Uncomment this if you are following "(Option 3): Setting up reverse-proxying of the well-known files from the base domain's server to the Matrix server" of https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md#option-3-setting-up-reverse-proxying-of-the-well-known-files-from-the-base-domains-server-to-the-matrix-server + @wellknown { + path /.well-known/matrix/* + } + + handle @wellknown { + reverse_proxy https://matrix.example.tld { + header_up Host {http.reverse_proxy.upstream.hostport} + } + } +} diff --git a/examples/reverse-proxies/caddy2-in-container/README.md b/examples/reverse-proxies/caddy2-in-container/README.md new file mode 100644 index 000000000..783145de7 --- /dev/null +++ b/examples/reverse-proxies/caddy2-in-container/README.md @@ -0,0 +1,19 @@ +# Caddy reverse-proxy fronting the playbook's integrated Traefik reverse-proxy + +This directory contains a sample config that shows you how to front the integrated [Traefik](https://traefik.io/) reverse-proxy webserver with your own **containerized** [Caddy](https://caddyserver.com/) reverse-proxy. If you have a server with a Caddy container already serving several applications and you want to install Matrix on it (with no changes to existing traffic routing), then this guide is for you. + +Note: if you're running Caddy on the host itself (not in a container), refer to the [caddy2](../caddy2/README.md) example instead. + + +## Prerequisite configuration + +To get started, first follow the [front the integrated reverse-proxy webserver with another reverse-proxy](../../../docs/configuring-playbook-own-webserver.md#fronting-the-integrated-reverse-proxy-webserver-with-another-reverse-proxy) instructions and update your playbook's configuration (`inventory/host_vars/matrix./vars.yml`). + +Then, adjust your Caddy `docker-compose.yaml` file (if you're using docker-compose for running your Caddy container). See [examples/reverse-proxies/caddy2-in-container/docker-compose.yaml](./docker-compose.yaml). + +## Using the Caddyfile + +You can either just use the [Caddyfile](Caddyfile) directly or append its content to your own Caddyfile. +In both cases make sure to replace all the `example.tld` domains with your own domain. + +This example does not include additional services like Element, but you should be able copy the first block and replace the `matrix.` subdomain with the subdomain of the some other service (e.g. `element.`). diff --git a/examples/reverse-proxies/caddy2-in-container/docker-compose.yaml b/examples/reverse-proxies/caddy2-in-container/docker-compose.yaml new file mode 100644 index 000000000..5884018dd --- /dev/null +++ b/examples/reverse-proxies/caddy2-in-container/docker-compose.yaml @@ -0,0 +1,23 @@ +--- +version: "3.9" + +services: + caddy: + image: caddy:2.5.1-alpine + networks: + # add this, so that caddy can talk to the playbook-managed-traefik + - traefik + ports: + - "80:80" + - "443:443" + - "8448:8448" + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile + # - ./site:/var/www + # Other configurations ... + +networks: + # add this as well + traefik: + name: traefik + external: true From 97cf596683fe0123505946a32ce09ec757472e7d Mon Sep 17 00:00:00 2001 From: Aine <97398200+aine-etke@users.noreply.github.com> Date: Sat, 14 Sep 2024 11:06:33 +0300 Subject: [PATCH 03/27] Synapse-Admin: Add UI option to block deleted rooms from being rejoined --- roles/custom/matrix-synapse-admin/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-synapse-admin/defaults/main.yml b/roles/custom/matrix-synapse-admin/defaults/main.yml index a8de79947..d12e50ba4 100644 --- a/roles/custom/matrix-synapse-admin/defaults/main.yml +++ b/roles/custom/matrix-synapse-admin/defaults/main.yml @@ -14,7 +14,7 @@ matrix_synapse_admin_container_image_self_build: false matrix_synapse_admin_container_image_self_build_repo: "https://github.com/etkecc/synapse-admin.git" # renovate: datasource=docker depName=ghcr.io/etkecc/synapse-admin -matrix_synapse_admin_version: v0.10.3-etke12 +matrix_synapse_admin_version: v0.10.3-etke13 matrix_synapse_admin_docker_image: "{{ matrix_synapse_admin_docker_image_name_prefix }}etkecc/synapse-admin:{{ matrix_synapse_admin_version }}" matrix_synapse_admin_docker_image_name_prefix: "{{ 'localhost/' if matrix_synapse_admin_container_image_self_build else 'ghcr.io/' }}" matrix_synapse_admin_docker_image_force_pull: "{{ matrix_synapse_admin_docker_image.endswith(':latest') }}" From 3622d71d09190f4a8fce1e198a8cbdb80d4a645f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 15:40:47 +0000 Subject: [PATCH 04/27] Update ajbura/cinny Docker tag to v4.2.1 --- roles/custom/matrix-client-cinny/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-client-cinny/defaults/main.yml b/roles/custom/matrix-client-cinny/defaults/main.yml index 88dafd3c5..1a067e14b 100644 --- a/roles/custom/matrix-client-cinny/defaults/main.yml +++ b/roles/custom/matrix-client-cinny/defaults/main.yml @@ -7,7 +7,7 @@ matrix_client_cinny_container_image_self_build: false matrix_client_cinny_container_image_self_build_repo: "https://github.com/ajbura/cinny.git" # renovate: datasource=docker depName=ajbura/cinny -matrix_client_cinny_version: v4.2.0 +matrix_client_cinny_version: v4.2.1 matrix_client_cinny_docker_image: "{{ matrix_client_cinny_docker_image_name_prefix }}ajbura/cinny:{{ matrix_client_cinny_version }}" matrix_client_cinny_docker_image_name_prefix: "{{ 'localhost/' if matrix_client_cinny_container_image_self_build else matrix_container_global_registry_prefix }}" matrix_client_cinny_docker_image_force_pull: "{{ matrix_client_cinny_docker_image.endswith(':latest') }}" From 7507383a90f866cfcdf46d7ea4c09563c4d0f9df Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:07:37 +0000 Subject: [PATCH 05/27] Update dock.mau.dev/mautrix/signal Docker tag to v0.7.1 --- roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml index 2ee54fe8a..3181fd52a 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml @@ -9,7 +9,7 @@ matrix_mautrix_signal_container_image_self_build_repo: "https://mau.dev/mautrix/ matrix_mautrix_signal_container_image_self_build_branch: "{{ 'main' if matrix_mautrix_signal_version == 'latest' else matrix_mautrix_signal_version }}" # renovate: datasource=docker depName=dock.mau.dev/mautrix/signal -matrix_mautrix_signal_version: v0.7.0 +matrix_mautrix_signal_version: v0.7.1 # See: https://mau.dev/mautrix/signal/container_registry matrix_mautrix_signal_docker_image: "{{ matrix_mautrix_signal_docker_image_name_prefix }}mautrix/signal:{{ matrix_mautrix_signal_docker_image_tag }}" From ca0abda5815ac730d2f527fea11a027bfe48ab47 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:07:41 +0000 Subject: [PATCH 06/27] Update dock.mau.dev/mautrix/slack Docker tag to v0.1.1 --- roles/custom/matrix-bridge-mautrix-slack/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-bridge-mautrix-slack/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-slack/defaults/main.yml index 060f3defc..0ebdae27f 100644 --- a/roles/custom/matrix-bridge-mautrix-slack/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-slack/defaults/main.yml @@ -9,7 +9,7 @@ matrix_mautrix_slack_container_image_self_build_repo: "https://mau.dev/mautrix/s matrix_mautrix_slack_container_image_self_build_branch: "{{ 'main' if matrix_mautrix_slack_version == 'latest' else matrix_mautrix_slack_version }}" # renovate: datasource=docker depName=dock.mau.dev/mautrix/slack -matrix_mautrix_slack_version: v0.1.0 +matrix_mautrix_slack_version: v0.1.1 # See: https://mau.dev/mautrix/slack/container_registry matrix_mautrix_slack_docker_image: "{{ matrix_mautrix_slack_docker_image_name_prefix }}mautrix/slack:{{ matrix_mautrix_slack_version }}" matrix_mautrix_slack_docker_image_name_prefix: "{{ 'localhost/' if matrix_mautrix_slack_container_image_self_build else 'dock.mau.dev/' }}" From 626a851c8267e49446fe29ae0bd624a8fcab3957 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 17 Sep 2024 08:28:12 +0300 Subject: [PATCH 07/27] Fix username_template potentially not being taken into account for mautrix-slack While working on upgrading the Meta bridges to bridgev2, I've noticed that {% raw %} and {% endraw %} on lines like that (immediately preceding `username_template` may cause YAML indentation issues. --- .../matrix-bridge-mautrix-slack/templates/config.yaml.j2 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/roles/custom/matrix-bridge-mautrix-slack/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-slack/templates/config.yaml.j2 index a0b860bf2..ed3b9c0c2 100644 --- a/roles/custom/matrix-bridge-mautrix-slack/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-slack/templates/config.yaml.j2 @@ -244,9 +244,7 @@ appservice: hs_token: {{ matrix_mautrix_slack_homeserver_token | to_json }} # Localpart template of MXIDs for remote users. - # {% raw %} - # {{.}} is replaced with the internal ID of the user. - # {% endraw %} + # {% raw %}{{.}}{% endraw %} is replaced with the internal ID of the user. username_template: "{% raw %}slack_{{.}}{% endraw %}" # Config options that affect the Matrix connector of the bridge. From 01e5514c4b6c7304ae90fd8dbeedbf7929b8da75 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 17 Sep 2024 08:34:44 +0300 Subject: [PATCH 08/27] Upgrade mautrix-meta (v0.3.2 -> v0.4.0) and adapt configuration Related to: - https://github.com/mautrix/meta/releases/tag/v0.4.0 - https://mau.fi/blog/2024-09-mautrix-release/ It seems like the new version does not support a `/metrics` endpoint. We skip keep the Ansible variables, but they're not doing anything. --- ...-playbook-bridge-mautrix-meta-instagram.md | 6 +- ...-playbook-bridge-mautrix-meta-messenger.md | 6 +- group_vars/matrix_servers | 24 +- .../defaults/main.yml | 25 +- .../tasks/validate_config.yml | 2 + .../templates/config.yaml.j2 | 630 ++++++++++-------- .../defaults/main.yml | 25 +- .../tasks/validate_config.yml | 2 + .../templates/config.yaml.j2 | 630 ++++++++++-------- 9 files changed, 778 insertions(+), 572 deletions(-) diff --git a/docs/configuring-playbook-bridge-mautrix-meta-instagram.md b/docs/configuring-playbook-bridge-mautrix-meta-instagram.md index cb2a8638d..efcdf2281 100644 --- a/docs/configuring-playbook-bridge-mautrix-meta-instagram.md +++ b/docs/configuring-playbook-bridge-mautrix-meta-instagram.md @@ -66,14 +66,12 @@ You may wish to look at `roles/custom/matrix-bridge-mautrix-meta-instagram/templ If you'd like to use [Double Puppeting](https://docs.mau.fi/bridges/general/double-puppeting.html) (hint: you most likely do), you have 2 ways of going about it. -### Method 1: automatically, by enabling Appservice Double Puppet or Shared Secret Auth +### Method 1: automatically, by enabling Appservice Double Puppet -The bridge will automatically perform Double Puppeting if you enable the [Appservice Double Puppet](configuring-playbook-appservice-double-puppet.md) service or the [Shared Secret Auth](configuring-playbook-shared-secret-auth.md) service for this playbook. +The bridge will automatically perform Double Puppeting if you enable the [Appservice Double Puppet](configuring-playbook-appservice-double-puppet.md) service for this playbook. Enabling [Appservice Double Puppet](configuring-playbook-appservice-double-puppet.md) is the recommended way of setting up Double Puppeting, as it's easier to accomplish, works for all your users automatically, and has less of a chance of breaking in the future. -Enabling double puppeting by enabling the [Shared Secret Auth](configuring-playbook-shared-secret-auth.md) service works at the time of writing, but is deprecated and will stop working in the future. - ### Method 2: manually, by asking each user to provide a working access token **Note**: This method for enabling Double Puppeting can be configured only after you've already set up bridging (see [Usage](#usage)). diff --git a/docs/configuring-playbook-bridge-mautrix-meta-messenger.md b/docs/configuring-playbook-bridge-mautrix-meta-messenger.md index b28eee279..ceb8def91 100644 --- a/docs/configuring-playbook-bridge-mautrix-meta-messenger.md +++ b/docs/configuring-playbook-bridge-mautrix-meta-messenger.md @@ -77,14 +77,12 @@ You may wish to look at `roles/custom/matrix-bridge-mautrix-meta-messenger/templ If you'd like to use [Double Puppeting](https://docs.mau.fi/bridges/general/double-puppeting.html) (hint: you most likely do), you have 2 ways of going about it. -### Method 1: automatically, by enabling Appservice Double Puppet or Shared Secret Auth +### Method 1: automatically, by enabling Appservice Double Puppet -The bridge will automatically perform Double Puppeting if you enable the [Appservice Double Puppet](configuring-playbook-appservice-double-puppet.md) service or the [Shared Secret Auth](configuring-playbook-shared-secret-auth.md) service for this playbook. +The bridge will automatically perform Double Puppeting if you enable the [Appservice Double Puppet](configuring-playbook-appservice-double-puppet.md) service for this playbook. Enabling [Appservice Double Puppet](configuring-playbook-appservice-double-puppet.md) is the recommended way of setting up Double Puppeting, as it's easier to accomplish, works for all your users automatically, and has less of a chance of breaking in the future. -Enabling double puppeting by enabling the [Shared Secret Auth](configuring-playbook-shared-secret-auth.md) service works at the time of writing, but is deprecated and will stop working in the future. - ### Method 2: manually, by asking each user to provide a working access token **Note**: This method for enabling Double Puppeting can be configured only after you've already set up bridging (see [Usage](#usage)). diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index c6682be41..027cf8d11 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -1497,17 +1497,13 @@ matrix_mautrix_meta_messenger_homeserver_address: "{{ matrix_addons_homeserver_c matrix_mautrix_meta_messenger_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mau.meta.fb.hs', rounds=655555) | to_uuid }}" -matrix_mautrix_meta_messenger_bridge_login_shared_secret_map_auto: |- +matrix_mautrix_meta_messenger_double_puppet_secrets_auto: |- {{ - ({ + { matrix_mautrix_meta_messenger_homeserver_domain: ("as_token:" + matrix_appservice_double_puppet_registration_as_token) - }) + } if matrix_appservice_double_puppet_enabled - else ( - {matrix_mautrix_meta_messenger_homeserver_domain: matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret} - if matrix_synapse_ext_password_provider_shared_secret_auth_enabled - else {} - ) + else {} }} matrix_mautrix_meta_messenger_metrics_enabled: "{{ prometheus_enabled or matrix_metrics_exposure_enabled }}" @@ -1575,17 +1571,13 @@ matrix_mautrix_meta_instagram_homeserver_address: "{{ matrix_addons_homeserver_c matrix_mautrix_meta_instagram_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mau.meta.ig.hs', rounds=655555) | to_uuid }}" -matrix_mautrix_meta_instagram_bridge_login_shared_secret_map_auto: |- +matrix_mautrix_meta_instagram_double_puppet_secrets_auto: |- {{ - ({ + { matrix_mautrix_meta_instagram_homeserver_domain: ("as_token:" + matrix_appservice_double_puppet_registration_as_token) - }) + } if matrix_appservice_double_puppet_enabled - else ( - {matrix_mautrix_meta_instagram_homeserver_domain: matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret} - if matrix_synapse_ext_password_provider_shared_secret_auth_enabled - else {} - ) + else {} }} matrix_mautrix_meta_instagram_metrics_enabled: "{{ prometheus_enabled or matrix_metrics_exposure_enabled }}" diff --git a/roles/custom/matrix-bridge-mautrix-meta-instagram/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-meta-instagram/defaults/main.yml index 2dc27f0f5..c5f306c7c 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-instagram/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-instagram/defaults/main.yml @@ -13,7 +13,7 @@ matrix_mautrix_meta_instagram_enabled: true matrix_mautrix_meta_instagram_identifier: matrix-mautrix-meta-instagram # renovate: datasource=docker depName=dock.mau.dev/mautrix/meta -matrix_mautrix_meta_instagram_version: v0.3.2 +matrix_mautrix_meta_instagram_version: v0.4.0 matrix_mautrix_meta_instagram_base_path: "{{ matrix_base_data_path }}/mautrix-meta-instagram" matrix_mautrix_meta_instagram_config_path: "{{ matrix_mautrix_meta_instagram_base_path }}/config" @@ -214,9 +214,9 @@ matrix_mautrix_meta_instagram_bridge_encryption_allow_key_sharing: "{{ matrix_ma matrix_mautrix_meta_instagram_bridge_encryption_appservice: false matrix_mautrix_meta_instagram_bridge_encryption_require: false -matrix_mautrix_meta_instagram_bridge_login_shared_secret_map: "{{ matrix_mautrix_meta_instagram_bridge_login_shared_secret_map_auto | combine(matrix_mautrix_meta_instagram_bridge_login_shared_secret_map_custom) }}" -matrix_mautrix_meta_instagram_bridge_login_shared_secret_map_auto: {} -matrix_mautrix_meta_instagram_bridge_login_shared_secret_map_custom: {} +matrix_mautrix_meta_instagram_double_puppet_secrets: "{{ matrix_mautrix_meta_instagram_double_puppet_secrets_auto | combine(matrix_mautrix_meta_instagram_double_puppet_secrets_custom) }}" +matrix_mautrix_meta_instagram_double_puppet_secrets_auto: {} +matrix_mautrix_meta_instagram_double_puppet_secrets_custom: {} matrix_mautrix_meta_instagram_bridge_permissions: "{{ matrix_mautrix_meta_instagram_bridge_permissions_default | combine(matrix_mautrix_meta_instagram_bridge_permissions_custom) }}" @@ -231,16 +231,15 @@ matrix_mautrix_meta_instagram_bridge_permissions_custom: {} # Enable bridge relay bot functionality matrix_mautrix_meta_instagram_bridge_relay_enabled: "{{ matrix_bridges_relay_enabled }}" matrix_mautrix_meta_instagram_bridge_relay_admin_only: true +matrix_mautrix_meta_instagram_bridge_relay_default_relays: [] -matrix_mautrix_meta_instagram_bridge_management_room_text_welcome: |- - {{ - ({ - 'facebook': "Hello, I'm a Facebook bridge bot.", - 'facebook-tor': "Hello, I'm a Facebook bridge bot which uses Tor.", - 'messenger': "Hello, I'm a Messenger bridge bot.", - 'instagram': "Hello, I'm an Instagram bridge bot.", - })[matrix_mautrix_meta_instagram_meta_mode] - }} +matrix_mautrix_meta_instagram_backfill_enabled: true +matrix_mautrix_meta_instagram_backfill_max_initial_messages: 50 +matrix_mautrix_meta_instagram_backfill_max_catchup_messages: 500 +matrix_mautrix_meta_instagram_backfill_unread_hours_threshold: 720 +matrix_mautrix_meta_instagram_backfill_threads_max_initial_messages: 50 + +matrix_mautrix_meta_instagram_public_media_signing_key: '' # Specifies the default log level. # This bridge uses zerolog, so valid levels are: panic, fatal, error, warn, info, debug, trace diff --git a/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/validate_config.yml index 20b8b53fc..fbaa3da1c 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/validate_config.yml @@ -23,3 +23,5 @@ when: "item.old in vars" with_items: - {'old': 'matrix_mautrix_meta_instagram_bridge_login_shared_secret', 'new': ''} + - {'old': 'matrix_mautrix_meta_instagram_bridge_login_shared_secret_map_custom', 'new': ''} + - {'old': 'matrix_mautrix_meta_instagram_bridge_management_room_text_welcome', 'new': ''} diff --git a/roles/custom/matrix-bridge-mautrix-meta-instagram/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-meta-instagram/templates/config.yaml.j2 index e48adf4b5..0bd5a7b9f 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-instagram/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-meta-instagram/templates/config.yaml.j2 @@ -1,7 +1,168 @@ #jinja2: lstrip_blocks: "True" +# Network-specific config options +network: + # Which service is this bridge for? Available options: + # * unset - allow users to pick any service when logging in (except facebook-tor) + # * facebook - connect to FB Messenger via facebook.com + # * facebook-tor - connect to FB Messenger via facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion + # (note: does not currently proxy media downloads) + # * messenger - connect to FB Messenger via messenger.com (can be used with the facebook side deactivated) + # * instagram - connect to Instagram DMs via instagram.com + # + # Remember to change the appservice id, bot profile info, bridge username_template and management_room_text too. + mode: {{ matrix_mautrix_meta_instagram_meta_mode | to_json }} + + # When in Instagram mode, should the bridge connect to WhatsApp servers for encrypted chats? + # In FB/Messenger mode encryption is always enabled, this option only affects Instagram mode. + ig_e2ee: {{ matrix_mautrix_meta_instagram_meta_ig_e2ee | to_json }} + + # Displayname template for FB/IG users. Available variables: + # .DisplayName - The display name set by the user. + # .Username - The username set by the user. + # .ID - The internal user ID of the user. + displayname_template: {{ matrix_mautrix_meta_instagram_bridge_displayname_template | to_json }} + + # Static proxy address (HTTP or SOCKS5) for connecting to Meta. + proxy: + # HTTP endpoint to request new proxy address from, for dynamically assigned proxies. + # The endpoint must return a JSON body with a string field called proxy_url. + get_proxy_from: + # Minimum interval between full reconnects in seconds, default is 1 hour + min_full_reconnect_interval_seconds: 3600 + # Interval to force refresh the connection (full reconnect), default is 20 hours. Set 0 to disable force refreshes. + force_refresh_interval_seconds: 72000 + # Disable fetching XMA media (reels, stories, etc) when backfilling. + disable_xma_backfill: true + # Disable fetching XMA media entirely. + disable_xma_always: false + + +# Config options that affect the central bridge module. +bridge: + # The prefix for commands. Only required in non-management rooms. + command_prefix: {{ matrix_mautrix_meta_instagram_bridge_command_prefix | to_json }} + # Should the bridge create a space for each login containing the rooms that account is in? + personal_filtering_spaces: {{ matrix_mautrix_meta_instagram_bridge_personal_filtering_spaces | to_json }} + # Whether the bridge should set names and avatars explicitly for DM portals. + # This is only necessary when using clients that don't support MSC4171. + private_chat_portal_meta: false + # Should events be handled asynchronously within portal rooms? + # If true, events may end up being out of order, but slow events won't block other ones. + async_events: false + # Should every user have their own portals rather than sharing them? + # By default, users who are in the same group on the remote network will be + # in the same Matrix room bridged to that group. If this is set to true, + # every user will get their own Matrix room instead. + split_portals: false + # Should the bridge resend `m.bridge` events to all portals on startup? + resend_bridge_info: false + + # Should leaving Matrix rooms be bridged as leaving groups on the remote network? + bridge_matrix_leave: false + # Should room tags only be synced when creating the portal? Tags mean things like favorite/pin and archive/low priority. + # Tags currently can't be synced back to the remote network, so a continuous sync means tagging from Matrix will be undone. + tag_only_on_create: true + # Should room mute status only be synced when creating the portal? + # Like tags, mutes can't currently be synced back to the remote network. + mute_only_on_create: true + + # What should be done to portal rooms when a user logs out or is logged out? + # Permitted values: + # nothing - Do nothing, let the user stay in the portals + # kick - Remove the user from the portal rooms, but don't delete them + # unbridge - Remove all ghosts in the room and disassociate it from the remote chat + # delete - Remove all ghosts and users from the room (i.e. delete it) + cleanup_on_logout: + # Should cleanup on logout be enabled at all? + enabled: false + # Settings for manual logouts (explicitly initiated by the Matrix user) + manual: + # Action for private portals which will never be shared with other Matrix users. + private: nothing + # Action for portals with a relay user configured. + relayed: nothing + # Action for portals which may be shared, but don't currently have any other Matrix users. + shared_no_users: nothing + # Action for portals which have other logged-in Matrix users. + shared_has_users: nothing + # Settings for credentials being invalidated (initiated by the remote network, possibly through user action). + # Keys have the same meanings as in the manual section. + bad_credentials: + private: nothing + relayed: nothing + shared_no_users: nothing + shared_has_users: nothing + + # Settings for relay mode + relay: + # Whether relay mode should be allowed. If allowed, the set-relay command can be used to turn any + # authenticated user into a relaybot for that chat. + enabled: {{ matrix_mautrix_meta_instagram_bridge_relay_enabled | to_json }} + # Should only admins be allowed to set themselves as relay users? + # If true, non-admins can only set users listed in default_relays as relays in a room. + admin_only: {{ matrix_mautrix_meta_instagram_bridge_relay_admin_only | to_json }} + # List of user login IDs which anyone can set as a relay, as long as the relay user is in the room. + default_relays: {{ matrix_mautrix_meta_instagram_bridge_relay_default_relays | to_json }} + # The formats to use when sending messages via the relaybot. + # Available variables: + # .Sender.UserID - The Matrix user ID of the sender. + # .Sender.Displayname - The display name of the sender (if set). + # .Sender.RequiresDisambiguation - Whether the sender's name may be confused with the name of another user in the room. + # .Sender.DisambiguatedName - The disambiguated name of the sender. This will be the displayname if set, + # plus the user ID in parentheses if the displayname is not unique. + # If the displayname is not set, this is just the user ID. + # .Message - The `formatted_body` field of the message. + # .Caption - The `formatted_body` field of the message, if it's a caption. Otherwise an empty string. + # .FileName - The name of the file being sent. + message_formats: + m.text: "{% raw %}{{ .Sender.DisambiguatedName }}: {{ .Message }}{% endraw %}" + m.notice: "{% raw %}{{ .Sender.DisambiguatedName }}: {{ .Message }}{% endraw %}" + m.emote: "{% raw %}* {{ .Sender.DisambiguatedName }} {{ .Message }}{% endraw %}" + m.file: "{% raw %}{{ .Sender.DisambiguatedName }} sent a file{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.image: "{% raw %}{{ .Sender.DisambiguatedName }} sent an image{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.audio: "{% raw %}{{ .Sender.DisambiguatedName }} sent an audio file{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.video: "{% raw %}{{ .Sender.DisambiguatedName }} sent a video{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.location: "{% raw %}{{ .Sender.DisambiguatedName }} sent a location{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + # For networks that support per-message displaynames (i.e. Slack and Discord), the template for those names. + # This has all the Sender variables available under message_formats (but without the .Sender prefix). + # Note that you need to manually remove the displayname from message_formats above. + displayname_format: "{% raw %}{{ .DisambiguatedName }}{% endraw %}" + + # Permissions for using the bridge. + # Permitted values: + # relay - Talk through the relaybot (if enabled), no access otherwise + # commands - Access to use commands in the bridge, but not login. + # user - Access to use the bridge with puppeting. + # admin - Full access, user level with some additional administration tools. + # Permitted keys: + # * - All Matrix users + # domain - All users on that homeserver + # mxid - Specific user + permissions: {{ matrix_mautrix_meta_instagram_bridge_permissions | to_json }} + +# Config for the bridge's database. +database: + # The database type. "sqlite3-fk-wal" and "postgres" are supported. + type: {{ matrix_mautrix_meta_instagram_appservice_database_type | to_json }} + # The database URI. + # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended. + # https://github.com/mattn/go-sqlite3#connection-string + # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable + # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql + uri: {{ matrix_mautrix_meta_instagram_appservice_database_uri | to_json }} + # Maximum number of connections. + max_open_conns: 5 + max_idle_conns: 1 + # Maximum connection idle time and lifetime before they're closed. Disabled if null. + # Parsed with https://pkg.go.dev/time#ParseDuration + max_conn_idle_time: null + max_conn_lifetime: null + # Homeserver details. homeserver: # The address that this appservice can use to connect to the homeserver. + # Local addresses without HTTPS are generally recommended when the bridge is running on the same machine, + # but https also works if they run on different machines. address: {{ matrix_mautrix_meta_instagram_homeserver_address | to_json }} # The domain of the homeserver (also known as server_name, used for MXIDs, etc). domain: {{ matrix_mautrix_meta_instagram_homeserver_domain | to_json }} @@ -10,11 +171,15 @@ homeserver: # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here. software: standard # The URL to push real-time bridge status to. - # If set, the bridge will make POST requests to this URL whenever a user's meta connection state changes. + # If set, the bridge will make POST requests to this URL whenever a user's remote network connection state changes. # The bridge will use the appservice as_token to authorize requests. - status_endpoint: null + status_endpoint: # Endpoint for reporting per-message status. - message_send_checkpoint_endpoint: null + # If set, the bridge will make POST requests to this URL when processing a message from Matrix. + # It will make one request when receiving the message (step BRIDGE), one after decrypting if applicable + # (step DECRYPTED) and one after sending to the remote network (step REMOTE). Errors will also be reported. + # The bridge will use the appservice as_token to authorize requests. + message_send_checkpoint_endpoint: # Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246? async_media: false @@ -26,33 +191,19 @@ homeserver: ping_interval_seconds: 0 # Application service host/registration related details. -# Changing these values requires regeneration of the registration. +# Changing these values requires regeneration of the registration (except when noted otherwise) appservice: # The address that the homeserver can use to connect to this appservice. address: {{ matrix_mautrix_meta_instagram_appservice_address | to_json }} + # A public address that external services can use to reach this appservice. + # This value doesn't affect the registration file. + public_address: https://bridge.example.com # The hostname and port where this appservice should listen. + # For Docker, you generally have to change the hostname to 0.0.0.0. hostname: 0.0.0.0 port: 29319 - # Database config. - database: - # The database type. "sqlite3-fk-wal" and "postgres" are supported. - type: {{ matrix_mautrix_meta_instagram_appservice_database_type | to_json }} - # The database URI. - # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended. - # https://github.com/mattn/go-sqlite3#connection-string - # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable - # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql - uri: {{ matrix_mautrix_meta_instagram_appservice_database_uri | to_json }} - # Maximum number of connections. Mostly relevant for Postgres. - max_open_conns: 20 - max_idle_conns: 2 - # Maximum connection idle time and lifetime before they're closed. Disabled if null. - # Parsed with https://pkg.go.dev/time#ParseDuration - max_conn_idle_time: null - max_conn_lifetime: null - # The unique ID of this appservice. id: {{ matrix_mautrix_meta_instagram_appservice_id | to_json }} # Appservice bot details. @@ -62,268 +213,225 @@ appservice: # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty # to leave display name/avatar as-is. displayname: {{ matrix_mautrix_meta_instagram_appservice_displayname | to_json }} - # You can use mxc://maunium.net/JxjlbZUlCPULEeHZSwleUXQv for an Instagram avatar, - # or mxc://maunium.net/ygtkteZsXnGJLJHRchUwYWak for Facebook Messenger avatar: {{ matrix_mautrix_meta_instagram_appservice_avatar | to_json }} - # Whether or not to receive ephemeral events via appservice transactions. - # Requires MSC2409 support (i.e. Synapse 1.22+). + # Whether to receive ephemeral events via appservice transactions. ephemeral_events: true # Should incoming events be handled asynchronously? # This may be necessary for large public instances with lots of messages going through. # However, messages will not be guaranteed to be bridged in the same order they were sent in. + # This value doesn't affect the registration file. async_transactions: false # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. as_token: {{ matrix_mautrix_meta_instagram_appservice_token | to_json }} hs_token: {{ matrix_mautrix_meta_instagram_homeserver_token | to_json }} -# Prometheus config. -metrics: - # Enable prometheus metrics? - enabled: {{ matrix_mautrix_meta_instagram_metrics_enabled | to_json }} - # IP and port where the metrics listener should be. The path is always /metrics - listen: "0.0.0.0.0:8000" - -meta: - # Which service is this bridge for? Available options: - # * facebook - connect to FB Messenger via facebook.com - # * facebook-tor - connect to FB Messenger via facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion - # (note: does not currently proxy media downloads) - # * messenger - connect to FB Messenger via messenger.com (can be used with the facebook side deactivated) - # * instagram - connect to Instagram DMs via instagram.com - # - # Remember to change the appservice id, bot profile info, bridge username_template and management_room_text too. - mode: {{ matrix_mautrix_meta_instagram_meta_mode | to_json }} - # When in Instagram mode, should the bridge connect to WhatsApp servers for encrypted chats? - # In FB/Messenger mode encryption is always enabled, this option only affects Instagram mode. - ig_e2ee: {{ matrix_mautrix_meta_instagram_meta_ig_e2ee | to_json }} - # Static proxy address (HTTP or SOCKS5) for connecting to Meta. - proxy: - # HTTP endpoint to request new proxy address from, for dynamically assigned proxies. - # The endpoint must return a JSON body with a string field called proxy_url. - get_proxy_from: - -# Bridge config -bridge: - # Localpart template of MXIDs for FB/IG users. - # {% raw %}{{.}}{% endraw %} is replaced with the internal ID of the FB/IG user. + # Localpart template of MXIDs for remote users. + # {% raw %}{{.}}{% endraw %} is replaced with the internal ID of the user. username_template: {{ matrix_mautrix_meta_instagram_bridge_username_template | to_json }} - # Displayname template for FB/IG users. This is also used as the room name in DMs if private_chat_portal_meta is enabled. - # {% raw %}{{.DisplayName}}{% endraw %} - The display name set by the user. - # {% raw %}{{.Username}}{% endraw %} - The username set by the user. - # {% raw %}{{.ID}}{% endraw %} - The internal user ID of the user. - displayname_template: {{ matrix_mautrix_meta_instagram_bridge_displayname_template | to_json }} - # Whether to explicitly set the avatar and room name for private chat portal rooms. - # If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms. - # If set to `always`, all DM rooms will have explicit names and avatars set. - # If set to `never`, DM rooms will never have names and avatars set. - private_chat_portal_meta: default - portal_message_buffer: 128 - - # Should the bridge create a space for each logged-in user and add bridged rooms to it? - # Users who logged in before turning this on should run `!meta sync-space` to create and fill the space for the first time. - personal_filtering_spaces: {{ matrix_mautrix_meta_instagram_bridge_personal_filtering_spaces | to_json }} - # Should Matrix m.notice-type messages be bridged? - bridge_notices: true - # Should the bridge send a read receipt from the bridge bot when a message has been sent to FB/IG? - delivery_receipts: false +# Config options that affect the Matrix connector of the bridge. +matrix: # Whether the bridge should send the message status as a custom com.beeper.message_send_status event. message_status_events: false + # Whether the bridge should send a read receipt after successfully bridging a message. + delivery_receipts: false # Whether the bridge should send error notices via m.notice events when a message fails to bridge. message_error_notices: true - # Should the bridge never send alerts to the bridge management room? - # These are mostly things like the user being logged out. - disable_bridge_alerts: false - # Should the bridge update the m.direct account data event when double puppeting is enabled. - # Note that updating the m.direct event is not atomic and is therefore prone to race conditions. + # Whether the bridge should update the m.direct account data event when double puppeting is enabled. sync_direct_chat_list: false - # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run. - # This field will automatically be changed back to false after it, except if the config file is not writable. - resend_bridge_info: false - # Send captions in the same message as images. This will send data compatible with both MSC2530. - # This is currently not supported in most clients. - caption_in_message: false - # Whether or not created rooms should have federation enabled. - # If false, created portal rooms will never be federated. + # Whether created rooms should have federation enabled. If false, created portal rooms + # will never be federated. Changing this option requires recreating rooms. federate_rooms: {{ matrix_mautrix_meta_instagram_bridge_federate_rooms | to_json }} - # Should mute status be bridged? Allowed options: always, on-create, never - mute_bridging: on-create - # Servers to always allow double puppeting from - double_puppet_server_map: {} - # Allow using double puppeting from any server with a valid client .well-known file. - double_puppet_allow_discovery: false - # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth + # The threshold as bytes after which the bridge should roundtrip uploads via the disk + # rather than keeping the whole file in memory. + upload_file_threshold: 5242880 + +# Segment-compatible analytics endpoint for tracking some events, like provisioning API login and encryption errors. +analytics: + # API key to send with tracking requests. Tracking is disabled if this is null. + token: null + # Address to send tracking requests to. + url: https://api.segment.io/v1/track + # Optional user ID for tracking events. If null, defaults to using Matrix user ID. + user_id: null + +# Settings for provisioning API +provisioning: + # Prefix for the provisioning API paths. + prefix: /_matrix/provision + # Shared secret for authentication. If set to "generate" or null, a random secret will be generated, + # or if set to "disable", the provisioning API will be disabled. + shared_secret: disable + # Whether to allow provisioning API requests to be authed using Matrix access tokens. + # This follows the same rules as double puppeting to determine which server to contact to check the token, + # which means that by default, it only works for users on the same server as the bridge. + allow_matrix_auth: true + # Enable debug API at /debug with provisioning authentication. + debug_endpoints: false + +# Some networks require publicly accessible media download links (e.g. for user avatars when using Discord webhooks). +# These settings control whether the bridge will provide such public media access. +public_media: + # Should public media be enabled at all? + # The public_address field under the appservice section MUST be set when enabling public media. + enabled: false + # A key for signing public media URLs. + # If set to "generate", a random key will be generated. + signing_key: {{ matrix_mautrix_meta_instagram_public_media_signing_key | to_json }} + # Number of seconds that public media URLs are valid for. + # If set to 0, URLs will never expire. + expiry: 0 + # Length of hash to use for public media URLs. Must be between 0 and 32. + hash_length: 32 + +# Settings for converting remote media to custom mxc:// URIs instead of reuploading. +# More details can be found at https://docs.mau.fi/bridges/go/discord/direct-media.html +direct_media: + # Should custom mxc:// URIs be used instead of reuploading media? + enabled: false + # The server name to use for the custom mxc:// URIs. + # This server name will effectively be a real Matrix server, it just won't implement anything other than media. + # You must either set up .well-known delegation from this domain to the bridge, or proxy the domain directly to the bridge. + server_name: media.example.com + # Optionally a custom .well-known response. This defaults to `server_name:443` + well_known_response: + # Optionally specify a custom prefix for the media ID part of the MXC URI. + media_id_prefix: + # If the remote network supports media downloads over HTTP, then the bridge will use MSC3860/MSC3916 + # media download redirects if the requester supports it. Optionally, you can force redirects + # and not allow proxying at all by setting this to false. + # This option does nothing if the remote network does not support media downloads over HTTP. + allow_proxy: true + # Matrix server signing key to make the federation tester pass, same format as synapse's .signing.key file. + # This key is also used to sign the mxc:// URIs to ensure only the bridge can generate them. + server_key: "" + +# Settings for backfilling messages. +# Note that the exact way settings are applied depends on the network connector. +# See https://docs.mau.fi/bridges/general/backfill.html for more details. +backfill: + # Whether to do backfilling at all. + enabled: {{ matrix_mautrix_meta_instagram_backfill_enabled | to_json }} + # Maximum number of messages to backfill in empty rooms. + max_initial_messages: {{ matrix_mautrix_meta_instagram_backfill_max_initial_messages | to_json}} + # Maximum number of missed messages to backfill after bridge restarts. + max_catchup_messages: {{ matrix_mautrix_meta_instagram_backfill_max_catchup_messages | to_json }} + # If a backfilled chat is older than this number of hours, + # mark it as read even if it's unread on the remote network. + unread_hours_threshold: {{ matrix_mautrix_meta_instagram_backfill_unread_hours_threshold | to_json }} + # Settings for backfilling threads within other backfills. + threads: + # Maximum number of messages to backfill in a new thread. + max_initial_messages: {{ matrix_mautrix_meta_instagram_backfill_threads_max_initial_messages | to_json }} + # Settings for the backwards backfill queue. This only applies when connecting to + # Beeper as standard Matrix servers don't support inserting messages into history. + queue: + # Should the backfill queue be enabled? + enabled: false + # Number of messages to backfill in one batch. + batch_size: 100 + # Delay between batches in seconds. + batch_delay: 20 + # Maximum number of batches to backfill per portal. + # If set to -1, all available messages will be backfilled. + max_batches: -1 + # Optional network-specific overrides for max batches. + # Interpretation of this field depends on the network connector. + max_batches_override: {} + +# Settings for enabling double puppeting +double_puppet: + # Servers to always allow double puppeting from. + # This is only for other servers and should NOT contain the server the bridge is on. + servers: {} + # Whether to allow client API URL discovery for other servers. When using this option, + # users on other servers can use double puppeting even if their server URLs aren't + # explicitly added to the servers map above. + allow_discovery: false + # Shared secrets for automatic double puppeting. + # See https://docs.mau.fi/bridges/general/double-puppeting.html for instructions. + secrets: {{ matrix_mautrix_meta_instagram_double_puppet_secrets | to_json }} + +# End-to-bridge encryption support options. +# +# See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. +encryption: + # Whether to enable encryption at all. If false, the bridge will not function in encrypted rooms. + allow: {{ matrix_mautrix_meta_instagram_bridge_encryption_allow | to_json }} + # Whether to force-enable encryption in all bridged rooms. + default: {{ matrix_mautrix_meta_instagram_bridge_encryption_default | to_json }} + # Whether to require all messages to be encrypted and drop any unencrypted messages. + require: {{ matrix_mautrix_meta_instagram_bridge_encryption_require | to_json }} + # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data. + # This option is not yet compatible with standard Matrix servers like Synapse and should not be used. + appservice: {{ matrix_mautrix_meta_instagram_bridge_encryption_appservice | to_json }} + # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. + # You must use a client that supports requesting keys from other users to use this feature. + allow_key_sharing: {{ matrix_mautrix_meta_instagram_bridge_encryption_allow_key_sharing | to_json }} + # Pickle key for encrypting encryption keys in the bridge database. + # If set to generate, a random key will be generated. + pickle_key: mautrix.bridge.e2ee + # Options for deleting megolm sessions from the bridge. + delete_keys: + # Beeper-specific: delete outbound sessions when hungryserv confirms + # that the user has uploaded the key to key backup. + delete_outbound_on_ack: false + # Don't store outbound sessions in the inbound table. + dont_store_outbound: false + # Ratchet megolm sessions forward after decrypting messages. + ratchet_on_decrypt: false + # Delete fully used keys (index >= max_messages) after decrypting messages. + delete_fully_used_on_decrypt: false + # Delete previous megolm sessions from same device when receiving a new one. + delete_prev_on_new_session: false + # Delete megolm sessions received from a device when the device is deleted. + delete_on_device_delete: false + # Periodically delete megolm sessions when 2x max_age has passed since receiving the session. + periodically_delete_expired: false + # Delete inbound megolm sessions that don't have the received_at field used for + # automatic ratcheting and expired session deletion. This is meant as a migration + # to delete old keys prior to the bridge update. + delete_outdated_inbound: false + # What level of device verification should be required from users? # - # If set, double puppeting will be enabled automatically for local users - # instead of users having to find an access token and run `login-matrix` - # manually. - login_shared_secret_map: {{ matrix_mautrix_meta_instagram_bridge_login_shared_secret_map | to_json }} - - # The prefix for commands. Only required in non-management rooms. - # If set to "default", will be determined based on meta -> mode, "!ig" for instagram and "!fb" for facebook - command_prefix: {{ matrix_mautrix_meta_instagram_bridge_command_prefix | to_json }} - - backfill: - # If disabled, old messages will never be bridged. - enabled: true - # By default, Meta sends info about approximately 20 recent threads. If this is set to something else than 0, - # the bridge will request more threads on first login, until it reaches the specified number of pages - # or the end of the inbox. - inbox_fetch_pages: 0 - # By default, Meta only sends one old message per thread. If this is set to a something else than 0, - # the bridge will delay handling the one automatically received message and request more messages to backfill. - # One page usually contains 20 messages. This can technically be set to -1 to fetch all messages, - # but that will block bridging messages until the entire backfill is completed. - history_fetch_pages: 0 - # Same as above, but for catchup backfills (i.e. when the bridge is restarted). - catchup_fetch_pages: 5 - # Maximum age of chats to leave as unread when backfilling. 0 means all chats can be left as unread. - # If non-zero, chats that are older than this will be marked as read, even if they're still unread on Meta. - unread_hours_threshold: 0 - # Backfill queue settings. Only relevant for Beeper, because standard Matrix servers - # don't support inserting messages into room history. - queue: - # How many pages of messages to request in one go (without sleeping between requests)? - pages_at_once: 5 - # Maximum number of pages to fetch. -1 to fetch all pages until the start of the chat. - max_pages: -1 - # How long to sleep after fetching a bunch of pages ("bunch" defined by pages_at_once). - sleep_between_tasks: 20s - # Disable fetching XMA media (reels, stories, etc) when backfilling. - dont_fetch_xma: true - - # Messages sent upon joining a management room. - # Markdown is supported. The defaults are listed below. - management_room_text: - # Sent when joining a room. - welcome: {{ matrix_mautrix_meta_instagram_bridge_management_room_text_welcome | to_json }} - # Sent when joining a management room and the user is already logged in. - welcome_connected: "Use `help` for help." - # Sent when joining a management room and the user is not logged in. - welcome_unconnected: "Use `help` for help or `login` to log in." - # Optional extra text sent when joining a management room. - additional_help: "" - - # End-to-bridge encryption support options. - # - # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. - encryption: - # Allow encryption, work in group chat rooms with e2ee enabled - allow: {{ matrix_mautrix_meta_instagram_bridge_encryption_allow | to_json }} - # Default to encryption, force-enable encryption in all portals the bridge creates - # This will cause the bridge bot to be in private chats for the encryption to work properly. - default: {{ matrix_mautrix_meta_instagram_bridge_encryption_default | to_json }} - # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data. - appservice: {{ matrix_mautrix_meta_instagram_bridge_encryption_appservice | to_json }} - # Require encryption, drop any unencrypted messages. - require: {{ matrix_mautrix_meta_instagram_bridge_encryption_require | to_json }} - # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. - # You must use a client that supports requesting keys from other users to use this feature. - allow_key_sharing: {{ matrix_mautrix_meta_instagram_bridge_encryption_allow_key_sharing | to_json }} - # Options for deleting megolm sessions from the bridge. - delete_keys: - # Beeper-specific: delete outbound sessions when hungryserv confirms - # that the user has uploaded the key to key backup. - delete_outbound_on_ack: false - # Don't store outbound sessions in the inbound table. - dont_store_outbound: false - # Ratchet megolm sessions forward after decrypting messages. - ratchet_on_decrypt: false - # Delete fully used keys (index >= max_messages) after decrypting messages. - delete_fully_used_on_decrypt: false - # Delete previous megolm sessions from same device when receiving a new one. - delete_prev_on_new_session: false - # Delete megolm sessions received from a device when the device is deleted. - delete_on_device_delete: false - # Periodically delete megolm sessions when 2x max_age has passed since receiving the session. - periodically_delete_expired: false - # Delete inbound megolm sessions that don't have the received_at field used for - # automatic ratcheting and expired session deletion. This is meant as a migration - # to delete old keys prior to the bridge update. - delete_outdated_inbound: false - # What level of device verification should be required from users? - # - # Valid levels: - # unverified - Send keys to all device in the room. - # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys. - # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes). - # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot. - # Note that creating user signatures from the bridge bot is not currently possible. - # verified - Require manual per-device verification - # (currently only possible by modifying the `trust` column in the `crypto_device` database table). - verification_levels: - # Minimum level for which the bridge should send keys to when bridging messages from FB/IG to Matrix. - receive: unverified - # Minimum level that the bridge should accept for incoming Matrix messages. - send: unverified - # Minimum level that the bridge should require for accepting key requests. - share: cross-signed-tofu - # Options for Megolm room key rotation. These options allow you to - # configure the m.room.encryption event content. See: - # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for - # more information about that event. - rotation: - # Enable custom Megolm room key rotation settings. Note that these - # settings will only apply to rooms created after this option is - # set. - enable_custom: false - # The maximum number of milliseconds a session should be used - # before changing it. The Matrix spec recommends 604800000 (a week) - # as the default. - milliseconds: 604800000 - # The maximum number of messages that should be sent with a given a - # session before changing it. The Matrix spec recommends 100 as the - # default. - messages: 100 - - # Disable rotating keys when a user's devices change? - # You should not enable this option unless you understand all the implications. - disable_device_change_key_rotation: false - - # Settings for provisioning API - provisioning: - # Prefix for the provisioning API paths. - prefix: /_matrix/provision - # Shared secret for authentication. If set to "generate", a random secret will be generated, - # or if set to "disable", the provisioning API will be disabled. - shared_secret: disable - # Enable debug API at /debug with provisioning authentication. - debug_endpoints: false - - # Permissions for using the bridge. - # Permitted values: - # relay - Talk through the relaybot (if enabled), no access otherwise - # user - Access to use the bridge to chat with a Meta account. - # admin - User level and some additional administration tools - # Permitted keys: - # * - All Matrix users - # domain - All users on that homeserver - # mxid - Specific user - permissions: {{ matrix_mautrix_meta_instagram_bridge_permissions | to_json }} - - # Settings for relay mode - relay: - # Whether relay mode should be allowed. If allowed, `!wa set-relay` can be used to turn any - # authenticated user into a relaybot for that chat. - enabled: {{ matrix_mautrix_meta_instagram_bridge_relay_enabled | to_json }} - # Should only admins be allowed to set themselves as relay users? - admin_only: {{ matrix_mautrix_meta_instagram_bridge_relay_admin_only | to_json }} - # The formats to use when sending messages to Meta via the relaybot. - message_formats: - m.text: "{% raw %}{{ .Sender.Displayname }}: {{ .Message }}{% endraw %}" - m.notice: "{% raw %}{{ .Sender.Displayname }}: {{ .Message }}{% endraw %}" - m.emote: "{% raw %}* {{ .Sender.Displayname }} {{ .Message }}{% endraw %}" - m.file: "{% raw %}{{ .Sender.Displayname }} sent a file{% endraw %}" - m.image: "{% raw %}{{ .Sender.Displayname }} sent an image{% endraw %}" - m.audio: "{% raw %}{{ .Sender.Displayname }} sent an audio file{% endraw %}" - m.video: "{% raw %}{{ .Sender.Displayname }} sent a video{% endraw %}" - m.location: "{% raw %}{{ .Sender.Displayname }} sent a location{% endraw %}" + # Valid levels: + # unverified - Send keys to all device in the room. + # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys. + # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes). + # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot. + # Note that creating user signatures from the bridge bot is not currently possible. + # verified - Require manual per-device verification + # (currently only possible by modifying the `trust` column in the `crypto_device` database table). + verification_levels: + # Minimum level for which the bridge should send keys to when bridging messages from the remote network to Matrix. + receive: unverified + # Minimum level that the bridge should accept for incoming Matrix messages. + send: unverified + # Minimum level that the bridge should require for accepting key requests. + share: cross-signed-tofu + # Options for Megolm room key rotation. These options allow you to configure the m.room.encryption event content. + # See https://spec.matrix.org/v1.10/client-server-api/#mroomencryption for more information about that event. + rotation: + # Enable custom Megolm room key rotation settings. Note that these + # settings will only apply to rooms created after this option is set. + enable_custom: false + # The maximum number of milliseconds a session should be used + # before changing it. The Matrix spec recommends 604800000 (a week) + # as the default. + milliseconds: 604800000 + # The maximum number of messages that should be sent with a given a + # session before changing it. The Matrix spec recommends 100 as the + # default. + messages: 100 + # Disable rotating keys when a user's devices change? + # You should not enable this option unless you understand all the implications. + disable_device_change_key_rotation: false # Logging config. See https://github.com/tulir/zeroconfig for details. logging: min_level: {{ matrix_mautrix_meta_instagram_logging_min_level | to_json }} writers: - - type: stdout - format: pretty + - type: stdout + format: pretty diff --git a/roles/custom/matrix-bridge-mautrix-meta-messenger/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-meta-messenger/defaults/main.yml index 09a40531f..944da8be7 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-messenger/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-messenger/defaults/main.yml @@ -13,7 +13,7 @@ matrix_mautrix_meta_messenger_enabled: true matrix_mautrix_meta_messenger_identifier: matrix-mautrix-meta-messenger # renovate: datasource=docker depName=dock.mau.dev/mautrix/meta -matrix_mautrix_meta_messenger_version: v0.3.2 +matrix_mautrix_meta_messenger_version: v0.4.0 matrix_mautrix_meta_messenger_base_path: "{{ matrix_base_data_path }}/mautrix-meta-messenger" matrix_mautrix_meta_messenger_config_path: "{{ matrix_mautrix_meta_messenger_base_path }}/config" @@ -214,9 +214,9 @@ matrix_mautrix_meta_messenger_bridge_encryption_allow_key_sharing: "{{ matrix_ma matrix_mautrix_meta_messenger_bridge_encryption_appservice: false matrix_mautrix_meta_messenger_bridge_encryption_require: false -matrix_mautrix_meta_messenger_bridge_login_shared_secret_map: "{{ matrix_mautrix_meta_messenger_bridge_login_shared_secret_map_auto | combine(matrix_mautrix_meta_messenger_bridge_login_shared_secret_map_custom) }}" -matrix_mautrix_meta_messenger_bridge_login_shared_secret_map_auto: {} -matrix_mautrix_meta_messenger_bridge_login_shared_secret_map_custom: {} +matrix_mautrix_meta_messenger_double_puppet_secrets: "{{ matrix_mautrix_meta_messenger_double_puppet_secrets_auto | combine(matrix_mautrix_meta_messenger_double_puppet_secrets_custom) }}" +matrix_mautrix_meta_messenger_double_puppet_secrets_auto: {} +matrix_mautrix_meta_messenger_double_puppet_secrets_custom: {} matrix_mautrix_meta_messenger_bridge_permissions: "{{ matrix_mautrix_meta_messenger_bridge_permissions_default | combine(matrix_mautrix_meta_messenger_bridge_permissions_custom) }}" @@ -231,16 +231,15 @@ matrix_mautrix_meta_messenger_bridge_permissions_custom: {} # Enable bridge relay bot functionality matrix_mautrix_meta_messenger_bridge_relay_enabled: "{{ matrix_bridges_relay_enabled }}" matrix_mautrix_meta_messenger_bridge_relay_admin_only: true +matrix_mautrix_meta_messenger_bridge_relay_default_relays: [] -matrix_mautrix_meta_messenger_bridge_management_room_text_welcome: |- - {{ - ({ - 'facebook': "Hello, I'm a Facebook bridge bot.", - 'facebook-tor': "Hello, I'm a Facebook bridge bot which uses Tor.", - 'messenger': "Hello, I'm a Messenger bridge bot.", - 'instagram': "Hello, I'm an Instagram bridge bot.", - })[matrix_mautrix_meta_messenger_meta_mode] - }} +matrix_mautrix_meta_messenger_backfill_enabled: true +matrix_mautrix_meta_messenger_backfill_max_initial_messages: 50 +matrix_mautrix_meta_messenger_backfill_max_catchup_messages: 500 +matrix_mautrix_meta_messenger_backfill_unread_hours_threshold: 720 +matrix_mautrix_meta_messenger_backfill_threads_max_initial_messages: 50 + +matrix_mautrix_meta_messenger_public_media_signing_key: '' # Specifies the default log level. # This bridge uses zerolog, so valid levels are: panic, fatal, error, warn, info, debug, trace diff --git a/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/validate_config.yml index 4ce27a3cb..d9f40022f 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/validate_config.yml @@ -23,3 +23,5 @@ when: "item.old in vars" with_items: - {'old': 'matrix_mautrix_meta_messenger_bridge_login_shared_secret', 'new': ''} + - {'old': 'matrix_mautrix_meta_messenger_bridge_login_shared_secret_map_custom', 'new': ''} + - {'old': 'matrix_mautrix_meta_messenger_bridge_management_room_text_welcome', 'new': ''} diff --git a/roles/custom/matrix-bridge-mautrix-meta-messenger/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-meta-messenger/templates/config.yaml.j2 index e2562c367..74b20aeaa 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-messenger/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-meta-messenger/templates/config.yaml.j2 @@ -1,7 +1,168 @@ #jinja2: lstrip_blocks: "True" +# Network-specific config options +network: + # Which service is this bridge for? Available options: + # * unset - allow users to pick any service when logging in (except facebook-tor) + # * facebook - connect to FB Messenger via facebook.com + # * facebook-tor - connect to FB Messenger via facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion + # (note: does not currently proxy media downloads) + # * messenger - connect to FB Messenger via messenger.com (can be used with the facebook side deactivated) + # * instagram - connect to Instagram DMs via instagram.com + # + # Remember to change the appservice id, bot profile info, bridge username_template and management_room_text too. + mode: {{ matrix_mautrix_meta_messenger_meta_mode | to_json }} + + # When in Instagram mode, should the bridge connect to WhatsApp servers for encrypted chats? + # In FB/Messenger mode encryption is always enabled, this option only affects Instagram mode. + ig_e2ee: {{ matrix_mautrix_meta_messenger_meta_ig_e2ee | to_json }} + + # Displayname template for FB/IG users. Available variables: + # .DisplayName - The display name set by the user. + # .Username - The username set by the user. + # .ID - The internal user ID of the user. + displayname_template: {{ matrix_mautrix_meta_messenger_bridge_displayname_template | to_json }} + + # Static proxy address (HTTP or SOCKS5) for connecting to Meta. + proxy: + # HTTP endpoint to request new proxy address from, for dynamically assigned proxies. + # The endpoint must return a JSON body with a string field called proxy_url. + get_proxy_from: + # Minimum interval between full reconnects in seconds, default is 1 hour + min_full_reconnect_interval_seconds: 3600 + # Interval to force refresh the connection (full reconnect), default is 20 hours. Set 0 to disable force refreshes. + force_refresh_interval_seconds: 72000 + # Disable fetching XMA media (reels, stories, etc) when backfilling. + disable_xma_backfill: true + # Disable fetching XMA media entirely. + disable_xma_always: false + + +# Config options that affect the central bridge module. +bridge: + # The prefix for commands. Only required in non-management rooms. + command_prefix: {{ matrix_mautrix_meta_messenger_bridge_command_prefix | to_json }} + # Should the bridge create a space for each login containing the rooms that account is in? + personal_filtering_spaces: {{ matrix_mautrix_meta_messenger_bridge_personal_filtering_spaces | to_json }} + # Whether the bridge should set names and avatars explicitly for DM portals. + # This is only necessary when using clients that don't support MSC4171. + private_chat_portal_meta: false + # Should events be handled asynchronously within portal rooms? + # If true, events may end up being out of order, but slow events won't block other ones. + async_events: false + # Should every user have their own portals rather than sharing them? + # By default, users who are in the same group on the remote network will be + # in the same Matrix room bridged to that group. If this is set to true, + # every user will get their own Matrix room instead. + split_portals: false + # Should the bridge resend `m.bridge` events to all portals on startup? + resend_bridge_info: false + + # Should leaving Matrix rooms be bridged as leaving groups on the remote network? + bridge_matrix_leave: false + # Should room tags only be synced when creating the portal? Tags mean things like favorite/pin and archive/low priority. + # Tags currently can't be synced back to the remote network, so a continuous sync means tagging from Matrix will be undone. + tag_only_on_create: true + # Should room mute status only be synced when creating the portal? + # Like tags, mutes can't currently be synced back to the remote network. + mute_only_on_create: true + + # What should be done to portal rooms when a user logs out or is logged out? + # Permitted values: + # nothing - Do nothing, let the user stay in the portals + # kick - Remove the user from the portal rooms, but don't delete them + # unbridge - Remove all ghosts in the room and disassociate it from the remote chat + # delete - Remove all ghosts and users from the room (i.e. delete it) + cleanup_on_logout: + # Should cleanup on logout be enabled at all? + enabled: false + # Settings for manual logouts (explicitly initiated by the Matrix user) + manual: + # Action for private portals which will never be shared with other Matrix users. + private: nothing + # Action for portals with a relay user configured. + relayed: nothing + # Action for portals which may be shared, but don't currently have any other Matrix users. + shared_no_users: nothing + # Action for portals which have other logged-in Matrix users. + shared_has_users: nothing + # Settings for credentials being invalidated (initiated by the remote network, possibly through user action). + # Keys have the same meanings as in the manual section. + bad_credentials: + private: nothing + relayed: nothing + shared_no_users: nothing + shared_has_users: nothing + + # Settings for relay mode + relay: + # Whether relay mode should be allowed. If allowed, the set-relay command can be used to turn any + # authenticated user into a relaybot for that chat. + enabled: {{ matrix_mautrix_meta_messenger_bridge_relay_enabled | to_json }} + # Should only admins be allowed to set themselves as relay users? + # If true, non-admins can only set users listed in default_relays as relays in a room. + admin_only: {{ matrix_mautrix_meta_messenger_bridge_relay_admin_only | to_json }} + # List of user login IDs which anyone can set as a relay, as long as the relay user is in the room. + default_relays: {{ matrix_mautrix_meta_messenger_bridge_relay_default_relays | to_json }} + # The formats to use when sending messages via the relaybot. + # Available variables: + # .Sender.UserID - The Matrix user ID of the sender. + # .Sender.Displayname - The display name of the sender (if set). + # .Sender.RequiresDisambiguation - Whether the sender's name may be confused with the name of another user in the room. + # .Sender.DisambiguatedName - The disambiguated name of the sender. This will be the displayname if set, + # plus the user ID in parentheses if the displayname is not unique. + # If the displayname is not set, this is just the user ID. + # .Message - The `formatted_body` field of the message. + # .Caption - The `formatted_body` field of the message, if it's a caption. Otherwise an empty string. + # .FileName - The name of the file being sent. + message_formats: + m.text: "{% raw %}{{ .Sender.DisambiguatedName }}: {{ .Message }}{% endraw %}" + m.notice: "{% raw %}{{ .Sender.DisambiguatedName }}: {{ .Message }}{% endraw %}" + m.emote: "{% raw %}* {{ .Sender.DisambiguatedName }} {{ .Message }}{% endraw %}" + m.file: "{% raw %}{{ .Sender.DisambiguatedName }} sent a file{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.image: "{% raw %}{{ .Sender.DisambiguatedName }} sent an image{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.audio: "{% raw %}{{ .Sender.DisambiguatedName }} sent an audio file{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.video: "{% raw %}{{ .Sender.DisambiguatedName }} sent a video{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.location: "{% raw %}{{ .Sender.DisambiguatedName }} sent a location{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + # For networks that support per-message displaynames (i.e. Slack and Discord), the template for those names. + # This has all the Sender variables available under message_formats (but without the .Sender prefix). + # Note that you need to manually remove the displayname from message_formats above. + displayname_format: "{% raw %}{{ .DisambiguatedName }}{% endraw %}" + + # Permissions for using the bridge. + # Permitted values: + # relay - Talk through the relaybot (if enabled), no access otherwise + # commands - Access to use commands in the bridge, but not login. + # user - Access to use the bridge with puppeting. + # admin - Full access, user level with some additional administration tools. + # Permitted keys: + # * - All Matrix users + # domain - All users on that homeserver + # mxid - Specific user + permissions: {{ matrix_mautrix_meta_messenger_bridge_permissions | to_json }} + +# Config for the bridge's database. +database: + # The database type. "sqlite3-fk-wal" and "postgres" are supported. + type: {{ matrix_mautrix_meta_messenger_appservice_database_type | to_json }} + # The database URI. + # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended. + # https://github.com/mattn/go-sqlite3#connection-string + # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable + # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql + uri: {{ matrix_mautrix_meta_messenger_appservice_database_uri | to_json }} + # Maximum number of connections. + max_open_conns: 5 + max_idle_conns: 1 + # Maximum connection idle time and lifetime before they're closed. Disabled if null. + # Parsed with https://pkg.go.dev/time#ParseDuration + max_conn_idle_time: null + max_conn_lifetime: null + # Homeserver details. homeserver: # The address that this appservice can use to connect to the homeserver. + # Local addresses without HTTPS are generally recommended when the bridge is running on the same machine, + # but https also works if they run on different machines. address: {{ matrix_mautrix_meta_messenger_homeserver_address | to_json }} # The domain of the homeserver (also known as server_name, used for MXIDs, etc). domain: {{ matrix_mautrix_meta_messenger_homeserver_domain | to_json }} @@ -10,11 +171,15 @@ homeserver: # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here. software: standard # The URL to push real-time bridge status to. - # If set, the bridge will make POST requests to this URL whenever a user's meta connection state changes. + # If set, the bridge will make POST requests to this URL whenever a user's remote network connection state changes. # The bridge will use the appservice as_token to authorize requests. - status_endpoint: null + status_endpoint: # Endpoint for reporting per-message status. - message_send_checkpoint_endpoint: null + # If set, the bridge will make POST requests to this URL when processing a message from Matrix. + # It will make one request when receiving the message (step BRIDGE), one after decrypting if applicable + # (step DECRYPTED) and one after sending to the remote network (step REMOTE). Errors will also be reported. + # The bridge will use the appservice as_token to authorize requests. + message_send_checkpoint_endpoint: # Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246? async_media: false @@ -26,33 +191,19 @@ homeserver: ping_interval_seconds: 0 # Application service host/registration related details. -# Changing these values requires regeneration of the registration. +# Changing these values requires regeneration of the registration (except when noted otherwise) appservice: # The address that the homeserver can use to connect to this appservice. address: {{ matrix_mautrix_meta_messenger_appservice_address | to_json }} + # A public address that external services can use to reach this appservice. + # This value doesn't affect the registration file. + public_address: https://bridge.example.com # The hostname and port where this appservice should listen. + # For Docker, you generally have to change the hostname to 0.0.0.0. hostname: 0.0.0.0 port: 29319 - # Database config. - database: - # The database type. "sqlite3-fk-wal" and "postgres" are supported. - type: {{ matrix_mautrix_meta_messenger_appservice_database_type | to_json }} - # The database URI. - # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended. - # https://github.com/mattn/go-sqlite3#connection-string - # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable - # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql - uri: {{ matrix_mautrix_meta_messenger_appservice_database_uri | to_json }} - # Maximum number of connections. Mostly relevant for Postgres. - max_open_conns: 20 - max_idle_conns: 2 - # Maximum connection idle time and lifetime before they're closed. Disabled if null. - # Parsed with https://pkg.go.dev/time#ParseDuration - max_conn_idle_time: null - max_conn_lifetime: null - # The unique ID of this appservice. id: {{ matrix_mautrix_meta_messenger_appservice_id | to_json }} # Appservice bot details. @@ -62,268 +213,225 @@ appservice: # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty # to leave display name/avatar as-is. displayname: {{ matrix_mautrix_meta_messenger_appservice_displayname | to_json }} - # You can use mxc://maunium.net/JxjlbZUlCPULEeHZSwleUXQv for an Instagram avatar, - # or mxc://maunium.net/ygtkteZsXnGJLJHRchUwYWak for Facebook Messenger avatar: {{ matrix_mautrix_meta_messenger_appservice_avatar | to_json }} - # Whether or not to receive ephemeral events via appservice transactions. - # Requires MSC2409 support (i.e. Synapse 1.22+). + # Whether to receive ephemeral events via appservice transactions. ephemeral_events: true # Should incoming events be handled asynchronously? # This may be necessary for large public instances with lots of messages going through. # However, messages will not be guaranteed to be bridged in the same order they were sent in. + # This value doesn't affect the registration file. async_transactions: false # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. as_token: {{ matrix_mautrix_meta_messenger_appservice_token | to_json }} hs_token: {{ matrix_mautrix_meta_messenger_homeserver_token | to_json }} -# Prometheus config. -metrics: - # Enable prometheus metrics? - enabled: {{ matrix_mautrix_meta_messenger_metrics_enabled | to_json }} - # IP and port where the metrics listener should be. The path is always /metrics - listen: "0.0.0.0.0:8000" - -meta: - # Which service is this bridge for? Available options: - # * facebook - connect to FB Messenger via facebook.com - # * facebook-tor - connect to FB Messenger via facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion - # (note: does not currently proxy media downloads) - # * messenger - connect to FB Messenger via messenger.com (can be used with the facebook side deactivated) - # * instagram - connect to Instagram DMs via instagram.com - # - # Remember to change the appservice id, bot profile info, bridge username_template and management_room_text too. - mode: {{ matrix_mautrix_meta_messenger_meta_mode | to_json }} - # When in Instagram mode, should the bridge connect to WhatsApp servers for encrypted chats? - # In FB/Messenger mode encryption is always enabled, this option only affects Instagram mode. - ig_e2ee: {{ matrix_mautrix_meta_messenger_meta_ig_e2ee | to_json }} - # Static proxy address (HTTP or SOCKS5) for connecting to Meta. - proxy: - # HTTP endpoint to request new proxy address from, for dynamically assigned proxies. - # The endpoint must return a JSON body with a string field called proxy_url. - get_proxy_from: - -# Bridge config -bridge: - # Localpart template of MXIDs for FB/IG users. - # {% raw %}{{.}}{% endraw %} is replaced with the internal ID of the FB/IG user. + # Localpart template of MXIDs for remote users. + # {% raw %}{{.}}{% endraw %} is replaced with the internal ID of the user. username_template: {{ matrix_mautrix_meta_messenger_bridge_username_template | to_json }} - # Displayname template for FB/IG users. This is also used as the room name in DMs if private_chat_portal_meta is enabled. - # {% raw %}{{.DisplayName}}{% endraw %} - The display name set by the user. - # {% raw %}{{.Username}}{% endraw %} - The username set by the user. - # {% raw %}{{.ID}}{% endraw %} - The internal user ID of the user. - displayname_template: {{ matrix_mautrix_meta_messenger_bridge_displayname_template | to_json }} - # Whether to explicitly set the avatar and room name for private chat portal rooms. - # If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms. - # If set to `always`, all DM rooms will have explicit names and avatars set. - # If set to `never`, DM rooms will never have names and avatars set. - private_chat_portal_meta: default - portal_message_buffer: 128 - - # Should the bridge create a space for each logged-in user and add bridged rooms to it? - # Users who logged in before turning this on should run `!meta sync-space` to create and fill the space for the first time. - personal_filtering_spaces: {{ matrix_mautrix_meta_messenger_bridge_personal_filtering_spaces | to_json }} - # Should Matrix m.notice-type messages be bridged? - bridge_notices: true - # Should the bridge send a read receipt from the bridge bot when a message has been sent to FB/IG? - delivery_receipts: false +# Config options that affect the Matrix connector of the bridge. +matrix: # Whether the bridge should send the message status as a custom com.beeper.message_send_status event. message_status_events: false + # Whether the bridge should send a read receipt after successfully bridging a message. + delivery_receipts: false # Whether the bridge should send error notices via m.notice events when a message fails to bridge. message_error_notices: true - # Should the bridge never send alerts to the bridge management room? - # These are mostly things like the user being logged out. - disable_bridge_alerts: false - # Should the bridge update the m.direct account data event when double puppeting is enabled. - # Note that updating the m.direct event is not atomic and is therefore prone to race conditions. + # Whether the bridge should update the m.direct account data event when double puppeting is enabled. sync_direct_chat_list: false - # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run. - # This field will automatically be changed back to false after it, except if the config file is not writable. - resend_bridge_info: false - # Send captions in the same message as images. This will send data compatible with both MSC2530. - # This is currently not supported in most clients. - caption_in_message: false - # Whether or not created rooms should have federation enabled. - # If false, created portal rooms will never be federated. + # Whether created rooms should have federation enabled. If false, created portal rooms + # will never be federated. Changing this option requires recreating rooms. federate_rooms: {{ matrix_mautrix_meta_messenger_bridge_federate_rooms | to_json }} - # Should mute status be bridged? Allowed options: always, on-create, never - mute_bridging: on-create - # Servers to always allow double puppeting from - double_puppet_server_map: {} - # Allow using double puppeting from any server with a valid client .well-known file. - double_puppet_allow_discovery: false - # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth + # The threshold as bytes after which the bridge should roundtrip uploads via the disk + # rather than keeping the whole file in memory. + upload_file_threshold: 5242880 + +# Segment-compatible analytics endpoint for tracking some events, like provisioning API login and encryption errors. +analytics: + # API key to send with tracking requests. Tracking is disabled if this is null. + token: null + # Address to send tracking requests to. + url: https://api.segment.io/v1/track + # Optional user ID for tracking events. If null, defaults to using Matrix user ID. + user_id: null + +# Settings for provisioning API +provisioning: + # Prefix for the provisioning API paths. + prefix: /_matrix/provision + # Shared secret for authentication. If set to "generate" or null, a random secret will be generated, + # or if set to "disable", the provisioning API will be disabled. + shared_secret: disable + # Whether to allow provisioning API requests to be authed using Matrix access tokens. + # This follows the same rules as double puppeting to determine which server to contact to check the token, + # which means that by default, it only works for users on the same server as the bridge. + allow_matrix_auth: true + # Enable debug API at /debug with provisioning authentication. + debug_endpoints: false + +# Some networks require publicly accessible media download links (e.g. for user avatars when using Discord webhooks). +# These settings control whether the bridge will provide such public media access. +public_media: + # Should public media be enabled at all? + # The public_address field under the appservice section MUST be set when enabling public media. + enabled: false + # A key for signing public media URLs. + # If set to "generate", a random key will be generated. + signing_key: {{ matrix_mautrix_meta_messenger_public_media_signing_key | to_json }} + # Number of seconds that public media URLs are valid for. + # If set to 0, URLs will never expire. + expiry: 0 + # Length of hash to use for public media URLs. Must be between 0 and 32. + hash_length: 32 + +# Settings for converting remote media to custom mxc:// URIs instead of reuploading. +# More details can be found at https://docs.mau.fi/bridges/go/discord/direct-media.html +direct_media: + # Should custom mxc:// URIs be used instead of reuploading media? + enabled: false + # The server name to use for the custom mxc:// URIs. + # This server name will effectively be a real Matrix server, it just won't implement anything other than media. + # You must either set up .well-known delegation from this domain to the bridge, or proxy the domain directly to the bridge. + server_name: media.example.com + # Optionally a custom .well-known response. This defaults to `server_name:443` + well_known_response: + # Optionally specify a custom prefix for the media ID part of the MXC URI. + media_id_prefix: + # If the remote network supports media downloads over HTTP, then the bridge will use MSC3860/MSC3916 + # media download redirects if the requester supports it. Optionally, you can force redirects + # and not allow proxying at all by setting this to false. + # This option does nothing if the remote network does not support media downloads over HTTP. + allow_proxy: true + # Matrix server signing key to make the federation tester pass, same format as synapse's .signing.key file. + # This key is also used to sign the mxc:// URIs to ensure only the bridge can generate them. + server_key: "" + +# Settings for backfilling messages. +# Note that the exact way settings are applied depends on the network connector. +# See https://docs.mau.fi/bridges/general/backfill.html for more details. +backfill: + # Whether to do backfilling at all. + enabled: {{ matrix_mautrix_meta_messenger_backfill_enabled | to_json }} + # Maximum number of messages to backfill in empty rooms. + max_initial_messages: {{ matrix_mautrix_meta_messenger_backfill_max_initial_messages | to_json}} + # Maximum number of missed messages to backfill after bridge restarts. + max_catchup_messages: {{ matrix_mautrix_meta_messenger_backfill_max_catchup_messages | to_json }} + # If a backfilled chat is older than this number of hours, + # mark it as read even if it's unread on the remote network. + unread_hours_threshold: {{ matrix_mautrix_meta_messenger_backfill_unread_hours_threshold | to_json }} + # Settings for backfilling threads within other backfills. + threads: + # Maximum number of messages to backfill in a new thread. + max_initial_messages: {{ matrix_mautrix_meta_messenger_backfill_threads_max_initial_messages | to_json }} + # Settings for the backwards backfill queue. This only applies when connecting to + # Beeper as standard Matrix servers don't support inserting messages into history. + queue: + # Should the backfill queue be enabled? + enabled: false + # Number of messages to backfill in one batch. + batch_size: 100 + # Delay between batches in seconds. + batch_delay: 20 + # Maximum number of batches to backfill per portal. + # If set to -1, all available messages will be backfilled. + max_batches: -1 + # Optional network-specific overrides for max batches. + # Interpretation of this field depends on the network connector. + max_batches_override: {} + +# Settings for enabling double puppeting +double_puppet: + # Servers to always allow double puppeting from. + # This is only for other servers and should NOT contain the server the bridge is on. + servers: {} + # Whether to allow client API URL discovery for other servers. When using this option, + # users on other servers can use double puppeting even if their server URLs aren't + # explicitly added to the servers map above. + allow_discovery: false + # Shared secrets for automatic double puppeting. + # See https://docs.mau.fi/bridges/general/double-puppeting.html for instructions. + secrets: {{ matrix_mautrix_meta_messenger_double_puppet_secrets | to_json }} + +# End-to-bridge encryption support options. +# +# See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. +encryption: + # Whether to enable encryption at all. If false, the bridge will not function in encrypted rooms. + allow: {{ matrix_mautrix_meta_messenger_bridge_encryption_allow | to_json }} + # Whether to force-enable encryption in all bridged rooms. + default: {{ matrix_mautrix_meta_messenger_bridge_encryption_default | to_json }} + # Whether to require all messages to be encrypted and drop any unencrypted messages. + require: {{ matrix_mautrix_meta_messenger_bridge_encryption_require | to_json }} + # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data. + # This option is not yet compatible with standard Matrix servers like Synapse and should not be used. + appservice: {{ matrix_mautrix_meta_messenger_bridge_encryption_appservice | to_json }} + # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. + # You must use a client that supports requesting keys from other users to use this feature. + allow_key_sharing: {{ matrix_mautrix_meta_messenger_bridge_encryption_allow_key_sharing | to_json }} + # Pickle key for encrypting encryption keys in the bridge database. + # If set to generate, a random key will be generated. + pickle_key: mautrix.bridge.e2ee + # Options for deleting megolm sessions from the bridge. + delete_keys: + # Beeper-specific: delete outbound sessions when hungryserv confirms + # that the user has uploaded the key to key backup. + delete_outbound_on_ack: false + # Don't store outbound sessions in the inbound table. + dont_store_outbound: false + # Ratchet megolm sessions forward after decrypting messages. + ratchet_on_decrypt: false + # Delete fully used keys (index >= max_messages) after decrypting messages. + delete_fully_used_on_decrypt: false + # Delete previous megolm sessions from same device when receiving a new one. + delete_prev_on_new_session: false + # Delete megolm sessions received from a device when the device is deleted. + delete_on_device_delete: false + # Periodically delete megolm sessions when 2x max_age has passed since receiving the session. + periodically_delete_expired: false + # Delete inbound megolm sessions that don't have the received_at field used for + # automatic ratcheting and expired session deletion. This is meant as a migration + # to delete old keys prior to the bridge update. + delete_outdated_inbound: false + # What level of device verification should be required from users? # - # If set, double puppeting will be enabled automatically for local users - # instead of users having to find an access token and run `login-matrix` - # manually. - login_shared_secret_map: {{ matrix_mautrix_meta_messenger_bridge_login_shared_secret_map | to_json }} - - # The prefix for commands. Only required in non-management rooms. - # If set to "default", will be determined based on meta -> mode, "!ig" for instagram and "!fb" for facebook - command_prefix: {{ matrix_mautrix_meta_messenger_bridge_command_prefix | to_json }} - - backfill: - # If disabled, old messages will never be bridged. - enabled: true - # By default, Meta sends info about approximately 20 recent threads. If this is set to something else than 0, - # the bridge will request more threads on first login, until it reaches the specified number of pages - # or the end of the inbox. - inbox_fetch_pages: 0 - # By default, Meta only sends one old message per thread. If this is set to a something else than 0, - # the bridge will delay handling the one automatically received message and request more messages to backfill. - # One page usually contains 20 messages. This can technically be set to -1 to fetch all messages, - # but that will block bridging messages until the entire backfill is completed. - history_fetch_pages: 0 - # Same as above, but for catchup backfills (i.e. when the bridge is restarted). - catchup_fetch_pages: 5 - # Maximum age of chats to leave as unread when backfilling. 0 means all chats can be left as unread. - # If non-zero, chats that are older than this will be marked as read, even if they're still unread on Meta. - unread_hours_threshold: 0 - # Backfill queue settings. Only relevant for Beeper, because standard Matrix servers - # don't support inserting messages into room history. - queue: - # How many pages of messages to request in one go (without sleeping between requests)? - pages_at_once: 5 - # Maximum number of pages to fetch. -1 to fetch all pages until the start of the chat. - max_pages: -1 - # How long to sleep after fetching a bunch of pages ("bunch" defined by pages_at_once). - sleep_between_tasks: 20s - # Disable fetching XMA media (reels, stories, etc) when backfilling. - dont_fetch_xma: true - - # Messages sent upon joining a management room. - # Markdown is supported. The defaults are listed below. - management_room_text: - # Sent when joining a room. - welcome: {{ matrix_mautrix_meta_messenger_bridge_management_room_text_welcome | to_json }} - # Sent when joining a management room and the user is already logged in. - welcome_connected: "Use `help` for help." - # Sent when joining a management room and the user is not logged in. - welcome_unconnected: "Use `help` for help or `login` to log in." - # Optional extra text sent when joining a management room. - additional_help: "" - - # End-to-bridge encryption support options. - # - # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. - encryption: - # Allow encryption, work in group chat rooms with e2ee enabled - allow: {{ matrix_mautrix_meta_messenger_bridge_encryption_allow | to_json }} - # Default to encryption, force-enable encryption in all portals the bridge creates - # This will cause the bridge bot to be in private chats for the encryption to work properly. - default: {{ matrix_mautrix_meta_messenger_bridge_encryption_default | to_json }} - # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data. - appservice: {{ matrix_mautrix_meta_messenger_bridge_encryption_appservice | to_json }} - # Require encryption, drop any unencrypted messages. - require: {{ matrix_mautrix_meta_messenger_bridge_encryption_require | to_json }} - # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. - # You must use a client that supports requesting keys from other users to use this feature. - allow_key_sharing: {{ matrix_mautrix_meta_messenger_bridge_encryption_allow_key_sharing | to_json }} - # Options for deleting megolm sessions from the bridge. - delete_keys: - # Beeper-specific: delete outbound sessions when hungryserv confirms - # that the user has uploaded the key to key backup. - delete_outbound_on_ack: false - # Don't store outbound sessions in the inbound table. - dont_store_outbound: false - # Ratchet megolm sessions forward after decrypting messages. - ratchet_on_decrypt: false - # Delete fully used keys (index >= max_messages) after decrypting messages. - delete_fully_used_on_decrypt: false - # Delete previous megolm sessions from same device when receiving a new one. - delete_prev_on_new_session: false - # Delete megolm sessions received from a device when the device is deleted. - delete_on_device_delete: false - # Periodically delete megolm sessions when 2x max_age has passed since receiving the session. - periodically_delete_expired: false - # Delete inbound megolm sessions that don't have the received_at field used for - # automatic ratcheting and expired session deletion. This is meant as a migration - # to delete old keys prior to the bridge update. - delete_outdated_inbound: false - # What level of device verification should be required from users? - # - # Valid levels: - # unverified - Send keys to all device in the room. - # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys. - # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes). - # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot. - # Note that creating user signatures from the bridge bot is not currently possible. - # verified - Require manual per-device verification - # (currently only possible by modifying the `trust` column in the `crypto_device` database table). - verification_levels: - # Minimum level for which the bridge should send keys to when bridging messages from FB/IG to Matrix. - receive: unverified - # Minimum level that the bridge should accept for incoming Matrix messages. - send: unverified - # Minimum level that the bridge should require for accepting key requests. - share: cross-signed-tofu - # Options for Megolm room key rotation. These options allow you to - # configure the m.room.encryption event content. See: - # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for - # more information about that event. - rotation: - # Enable custom Megolm room key rotation settings. Note that these - # settings will only apply to rooms created after this option is - # set. - enable_custom: false - # The maximum number of milliseconds a session should be used - # before changing it. The Matrix spec recommends 604800000 (a week) - # as the default. - milliseconds: 604800000 - # The maximum number of messages that should be sent with a given a - # session before changing it. The Matrix spec recommends 100 as the - # default. - messages: 100 - - # Disable rotating keys when a user's devices change? - # You should not enable this option unless you understand all the implications. - disable_device_change_key_rotation: false - - # Settings for provisioning API - provisioning: - # Prefix for the provisioning API paths. - prefix: /_matrix/provision - # Shared secret for authentication. If set to "generate", a random secret will be generated, - # or if set to "disable", the provisioning API will be disabled. - shared_secret: disable - # Enable debug API at /debug with provisioning authentication. - debug_endpoints: false - - # Permissions for using the bridge. - # Permitted values: - # relay - Talk through the relaybot (if enabled), no access otherwise - # user - Access to use the bridge to chat with a Meta account. - # admin - User level and some additional administration tools - # Permitted keys: - # * - All Matrix users - # domain - All users on that homeserver - # mxid - Specific user - permissions: {{ matrix_mautrix_meta_messenger_bridge_permissions | to_json }} - - # Settings for relay mode - relay: - # Whether relay mode should be allowed. If allowed, `!wa set-relay` can be used to turn any - # authenticated user into a relaybot for that chat. - enabled: {{ matrix_mautrix_meta_messenger_bridge_relay_enabled | to_json }} - # Should only admins be allowed to set themselves as relay users? - admin_only: {{ matrix_mautrix_meta_messenger_bridge_relay_admin_only | to_json }} - # The formats to use when sending messages to Meta via the relaybot. - message_formats: - m.text: "{% raw %}{{ .Sender.Displayname }}: {{ .Message }}{% endraw %}" - m.notice: "{% raw %}{{ .Sender.Displayname }}: {{ .Message }}{% endraw %}" - m.emote: "{% raw %}* {{ .Sender.Displayname }} {{ .Message }}{% endraw %}" - m.file: "{% raw %}{{ .Sender.Displayname }} sent a file{% endraw %}" - m.image: "{% raw %}{{ .Sender.Displayname }} sent an image{% endraw %}" - m.audio: "{% raw %}{{ .Sender.Displayname }} sent an audio file{% endraw %}" - m.video: "{% raw %}{{ .Sender.Displayname }} sent a video{% endraw %}" - m.location: "{% raw %}{{ .Sender.Displayname }} sent a location{% endraw %}" + # Valid levels: + # unverified - Send keys to all device in the room. + # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys. + # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes). + # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot. + # Note that creating user signatures from the bridge bot is not currently possible. + # verified - Require manual per-device verification + # (currently only possible by modifying the `trust` column in the `crypto_device` database table). + verification_levels: + # Minimum level for which the bridge should send keys to when bridging messages from the remote network to Matrix. + receive: unverified + # Minimum level that the bridge should accept for incoming Matrix messages. + send: unverified + # Minimum level that the bridge should require for accepting key requests. + share: cross-signed-tofu + # Options for Megolm room key rotation. These options allow you to configure the m.room.encryption event content. + # See https://spec.matrix.org/v1.10/client-server-api/#mroomencryption for more information about that event. + rotation: + # Enable custom Megolm room key rotation settings. Note that these + # settings will only apply to rooms created after this option is set. + enable_custom: false + # The maximum number of milliseconds a session should be used + # before changing it. The Matrix spec recommends 604800000 (a week) + # as the default. + milliseconds: 604800000 + # The maximum number of messages that should be sent with a given a + # session before changing it. The Matrix spec recommends 100 as the + # default. + messages: 100 + # Disable rotating keys when a user's devices change? + # You should not enable this option unless you understand all the implications. + disable_device_change_key_rotation: false # Logging config. See https://github.com/tulir/zeroconfig for details. logging: min_level: {{ matrix_mautrix_meta_messenger_logging_min_level | to_json }} writers: - - type: stdout - format: pretty + - type: stdout + format: pretty From f9705b3323863bfcb85426b2f2f74cf982fbf263 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 17 Sep 2024 09:29:30 +0300 Subject: [PATCH 09/27] Upgrade mautrix-gmessages (v0.4.3 -> v0.5.0) and adapt configuration Related to: - https://github.com/mautrix/gmessages/releases/tag/v0.5.0 - https://mau.fi/blog/2024-09-mautrix-release/ It seems like the new version does not support a `/metrics` endpoint. We skip keep the Ansible variables, but they're not doing anything. --- ...uring-playbook-bridge-mautrix-gmessages.md | 6 +- group_vars/matrix_servers | 12 +- .../defaults/main.yml | 23 +- .../tasks/validate_config.yml | 3 + .../templates/config.yaml.j2 | 588 +++++++++++------- 5 files changed, 387 insertions(+), 245 deletions(-) diff --git a/docs/configuring-playbook-bridge-mautrix-gmessages.md b/docs/configuring-playbook-bridge-mautrix-gmessages.md index 35eb16841..e8dbfeade 100644 --- a/docs/configuring-playbook-bridge-mautrix-gmessages.md +++ b/docs/configuring-playbook-bridge-mautrix-gmessages.md @@ -14,14 +14,12 @@ matrix_mautrix_gmessages_enabled: true If you'd like to use [Double Puppeting](https://docs.mau.fi/bridges/general/double-puppeting.html) (hint: you most likely do), you have 2 ways of going about it. -### Method 1: automatically, by enabling Appservice Double Puppet or Shared Secret Auth +### Method 1: automatically, by enabling Appservice Double Puppet -The bridge will automatically perform Double Puppeting if you enable the [Appservice Double Puppet](configuring-playbook-appservice-double-puppet.md) service or the [Shared Secret Auth](configuring-playbook-shared-secret-auth.md) service for this playbook. +The bridge will automatically perform Double Puppeting if you enable the [Appservice Double Puppet](configuring-playbook-appservice-double-puppet.md) service for this playbook. Enabling [Appservice Double Puppet](configuring-playbook-appservice-double-puppet.md) is the recommended way of setting up Double Puppeting, as it's easier to accomplish, works for all your users automatically, and has less of a chance of breaking in the future. -Enabling double puppeting by enabling the [Shared Secret Auth](configuring-playbook-shared-secret-auth.md) service works at the time of writing, but is deprecated and will stop working in the future. - ### Method 2: manually, by asking each user to provide a working access token **Note**: This method for enabling Double Puppeting can be configured only after you've already set up bridging (see [Usage](#usage)). diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 027cf8d11..e6686c253 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -1798,15 +1798,13 @@ matrix_mautrix_gmessages_appservice_token: "{{ '%s' | format(matrix_homeserver_g matrix_mautrix_gmessages_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}" matrix_mautrix_gmessages_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'gmessa.hs.token', rounds=655555) | to_uuid }}" -matrix_mautrix_gmessages_login_shared_secret: |- +matrix_mautrix_gmessages_double_puppet_secrets_auto: |- {{ - ("as_token:" + matrix_appservice_double_puppet_registration_as_token) + { + matrix_mautrix_gmessages_homeserver_domain: ("as_token:" + matrix_appservice_double_puppet_registration_as_token) + } if matrix_appservice_double_puppet_enabled - else ( - matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled - if matrix_synapse_ext_password_provider_shared_secret_auth_enabled - else "" - ) + else {} }} matrix_mautrix_gmessages_metrics_enabled: "{{ prometheus_enabled or matrix_metrics_exposure_enabled }}" diff --git a/roles/custom/matrix-bridge-mautrix-gmessages/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-gmessages/defaults/main.yml index 5d493b705..1dd535d4a 100644 --- a/roles/custom/matrix-bridge-mautrix-gmessages/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-gmessages/defaults/main.yml @@ -9,7 +9,7 @@ matrix_mautrix_gmessages_container_image_self_build_repo: "https://github.com/ma matrix_mautrix_gmessages_container_image_self_build_branch: "{{ 'main' if matrix_mautrix_gmessages_version == 'latest' else matrix_mautrix_gmessages_version }}" # renovate: datasource=docker depName=dock.mau.dev/mautrix/gmessages -matrix_mautrix_gmessages_version: v0.4.3 +matrix_mautrix_gmessages_version: v0.5.0 # See: https://mau.dev/mautrix/gmessages/container_registry matrix_mautrix_gmessages_docker_image: "{{ matrix_mautrix_gmessages_docker_image_name_prefix }}mautrix/gmessages:{{ matrix_mautrix_gmessages_version }}" @@ -25,6 +25,12 @@ matrix_mautrix_gmessages_homeserver_address: "" matrix_mautrix_gmessages_homeserver_domain: "{{ matrix_domain }}" matrix_mautrix_gmessages_appservice_address: "http://matrix-mautrix-gmessages:8080" +matrix_mautrix_gmessages_backfill_enabled: false +matrix_mautrix_gmessages_backfill_max_initial_messages: 50 +matrix_mautrix_gmessages_backfill_max_catchup_messages: 500 +matrix_mautrix_gmessages_backfill_unread_hours_threshold: 720 +matrix_mautrix_gmessages_backfill_threads_max_initial_messages: 50 + matrix_mautrix_gmessages_command_prefix: "!gm" matrix_mautrix_gmessages_container_network: "" @@ -132,18 +138,23 @@ matrix_mautrix_gmessages_appservice_database_uri: "{{ }[matrix_mautrix_gmessages_database_engine] }}" -# Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth) or Appservice Double Puppet. -matrix_mautrix_gmessages_login_shared_secret: '' -matrix_mautrix_gmessages_bridge_login_shared_secret_map: - "{{ {matrix_mautrix_gmessages_homeserver_domain: matrix_mautrix_gmessages_login_shared_secret} if matrix_mautrix_gmessages_login_shared_secret else {} }}" +matrix_mautrix_gmessages_double_puppet_secrets: "{{ matrix_mautrix_gmessages_double_puppet_secrets_auto | combine(matrix_mautrix_gmessages_double_puppet_secrets_custom) }}" +matrix_mautrix_gmessages_double_puppet_secrets_auto: {} +matrix_mautrix_gmessages_double_puppet_secrets_custom: {} # Enable End-to-bridge encryption matrix_mautrix_gmessages_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}" matrix_mautrix_gmessages_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}" +matrix_mautrix_gmessages_bridge_encryption_require: false +matrix_mautrix_gmessages_bridge_encryption_appservice: false matrix_mautrix_gmessages_bridge_encryption_key_sharing_allow: "{{ matrix_mautrix_gmessages_bridge_encryption_allow }}" +matrix_mautrix_gmessages_network_displayname_template: "{% raw %}{{or .FullName .PhoneNumber}}{% endraw %}" +matrix_mautrix_gmessages_appservice_username_template: "{% raw %}gmessages_{{.}}{% endraw %}" + +matrix_mautrix_gmessages_public_media_signing_key: '' + matrix_mautrix_gmessages_bridge_personal_filtering_spaces: true -matrix_mautrix_gmessages_bridge_mute_bridging: true matrix_mautrix_gmessages_bridge_permissions: | {{ diff --git a/roles/custom/matrix-bridge-mautrix-gmessages/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-gmessages/tasks/validate_config.yml index dcf5b7a29..7f2510a1f 100644 --- a/roles/custom/matrix-bridge-mautrix-gmessages/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-gmessages/tasks/validate_config.yml @@ -22,3 +22,6 @@ when: "item.old in vars" with_items: - {'old': 'matrix_mautrix_gmessages_log_level', 'new': 'matrix_mautrix_gmessages_logging_level'} + - {'old': 'matrix_mautrix_gmessages_bridge_mute_bridging', 'new': ''} + - {'old': 'matrix_mautrix_gmessages_login_shared_secret', 'new': ''} + - {'old': 'matrix_mautrix_gmessages_bridge_login_shared_secret_map', 'new': 'matrix_mautrix_gmessages_double_puppet_secrets_custom'} diff --git a/roles/custom/matrix-bridge-mautrix-gmessages/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-gmessages/templates/config.yaml.j2 index e49998dd9..89000de86 100644 --- a/roles/custom/matrix-bridge-mautrix-gmessages/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-gmessages/templates/config.yaml.j2 @@ -1,20 +1,172 @@ #jinja2: lstrip_blocks: "True" +# Network-specific config options +network: + # Displayname template for SMS users. + # {% raw %}{{.FullName}}{% endraw %} - Full name provided by the phone + # {% raw %}{{.FirstName}}{% endraw %} - First name provided by the phone + # {% raw %}{{.PhoneNumber}}{% endraw %} - Formatted phone number provided by the phone + displayname_template: {{ matrix_mautrix_gmessages_network_displayname_template | to_json }} + # Settings for how the bridge appears to the phone. + device_meta: + # OS name to tell the phone. This is the name that shows up in the paired devices list. + os: mautrix-gmessages + # Browser type to tell the phone. This decides which icon is shown. + # Valid types: OTHER, CHROME, FIREFOX, SAFARI, OPERA, IE, EDGE + browser: OTHER + # Device type to tell the phone. This also affects the icon, as well as how many sessions are allowed simultaneously. + # One web, two tablets and one PWA should be able to connect at the same time. + # Valid types: WEB, TABLET, PWA + type: TABLET + # Should the bridge aggressively set itself as the active device if the user opens Google Messages in a browser? + # If this is disabled, the user must manually use the `set-active` command to reactivate the bridge. + aggressive_reconnect: false + # Number of chats to sync when connecting to Google Messages. + initial_chat_sync_count: 25 + + +# Config options that affect the central bridge module. +bridge: + # The prefix for commands. Only required in non-management rooms. + command_prefix: '!gm' + # Should the bridge create a space for each login containing the rooms that account is in? + personal_filtering_spaces: {{ matrix_mautrix_gmessages_bridge_personal_filtering_spaces | to_json }} + # Whether the bridge should set names and avatars explicitly for DM portals. + # This is only necessary when using clients that don't support MSC4171. + private_chat_portal_meta: false + # Should events be handled asynchronously within portal rooms? + # If true, events may end up being out of order, but slow events won't block other ones. + async_events: false + # Should every user have their own portals rather than sharing them? + # By default, users who are in the same group on the remote network will be + # in the same Matrix room bridged to that group. If this is set to true, + # every user will get their own Matrix room instead. + split_portals: false + # Should the bridge resend `m.bridge` events to all portals on startup? + resend_bridge_info: false + + # Should leaving Matrix rooms be bridged as leaving groups on the remote network? + bridge_matrix_leave: false + # Should room tags only be synced when creating the portal? Tags mean things like favorite/pin and archive/low priority. + # Tags currently can't be synced back to the remote network, so a continuous sync means tagging from Matrix will be undone. + tag_only_on_create: true + # Should room mute status only be synced when creating the portal? + # Like tags, mutes can't currently be synced back to the remote network. + mute_only_on_create: true + + # What should be done to portal rooms when a user logs out or is logged out? + # Permitted values: + # nothing - Do nothing, let the user stay in the portals + # kick - Remove the user from the portal rooms, but don't delete them + # unbridge - Remove all ghosts in the room and disassociate it from the remote chat + # delete - Remove all ghosts and users from the room (i.e. delete it) + cleanup_on_logout: + # Should cleanup on logout be enabled at all? + enabled: false + # Settings for manual logouts (explicitly initiated by the Matrix user) + manual: + # Action for private portals which will never be shared with other Matrix users. + private: nothing + # Action for portals with a relay user configured. + relayed: nothing + # Action for portals which may be shared, but don't currently have any other Matrix users. + shared_no_users: nothing + # Action for portals which have other logged-in Matrix users. + shared_has_users: nothing + # Settings for credentials being invalidated (initiated by the remote network, possibly through user action). + # Keys have the same meanings as in the manual section. + bad_credentials: + private: nothing + relayed: nothing + shared_no_users: nothing + shared_has_users: nothing + + # Settings for relay mode + relay: + # Whether relay mode should be allowed. If allowed, the set-relay command can be used to turn any + # authenticated user into a relaybot for that chat. + enabled: false + # Should only admins be allowed to set themselves as relay users? + # If true, non-admins can only set users listed in default_relays as relays in a room. + admin_only: true + # List of user login IDs which anyone can set as a relay, as long as the relay user is in the room. + default_relays: [] + # The formats to use when sending messages via the relaybot. + # Available variables: + # .Sender.UserID - The Matrix user ID of the sender. + # .Sender.Displayname - The display name of the sender (if set). + # .Sender.RequiresDisambiguation - Whether the sender's name may be confused with the name of another user in the room. + # .Sender.DisambiguatedName - The disambiguated name of the sender. This will be the displayname if set, + # plus the user ID in parentheses if the displayname is not unique. + # If the displayname is not set, this is just the user ID. + # .Message - The `formatted_body` field of the message. + # .Caption - The `formatted_body` field of the message, if it's a caption. Otherwise an empty string. + # .FileName - The name of the file being sent. + message_formats: + m.text: "{% raw %}{{ .Sender.DisambiguatedName }}: {{ .Message }}{% endraw %}" + m.notice: "{% raw %}{{ .Sender.DisambiguatedName }}: {{ .Message }}{% endraw %}" + m.emote: "{% raw %}* {{ .Sender.DisambiguatedName }} {{ .Message }}{% endraw %}" + m.file: "{% raw %}{{ .Sender.DisambiguatedName }} sent a file{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.image: "{% raw %}{{ .Sender.DisambiguatedName }} sent an image{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.audio: "{% raw %}{{ .Sender.DisambiguatedName }} sent an audio file{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.video: "{% raw %}{{ .Sender.DisambiguatedName }} sent a video{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + m.location: "{% raw %}{{ .Sender.DisambiguatedName }} sent a location{{ if .Caption }}: {{ .Caption }}{{ end }}{% endraw %}" + # For networks that support per-message displaynames (i.e. Slack and Discord), the template for those names. + # This has all the Sender variables available under message_formats (but without the .Sender prefix). + # Note that you need to manually remove the displayname from message_formats above. + displayname_format: "{% raw %}{{ .DisambiguatedName }}{% endraw %}" + + # Permissions for using the bridge. + # Permitted values: + # relay - Talk through the relaybot (if enabled), no access otherwise + # commands - Access to use commands in the bridge, but not login. + # user - Access to use the bridge with puppeting. + # admin - Full access, user level with some additional administration tools. + # Permitted keys: + # * - All Matrix users + # domain - All users on that homeserver + # mxid - Specific user + permissions: {{ matrix_mautrix_gmessages_bridge_permissions|to_json }} + +# Config for the bridge's database. +database: + # The database type. "sqlite3-fk-wal" and "postgres" are supported. + type: postgres + # The database URI. + # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended. + # https://github.com/mattn/go-sqlite3#connection-string + # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable + # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql + uri: {{ matrix_mautrix_gmessages_appservice_database_uri|to_json }} + # Maximum number of connections. + max_open_conns: 5 + max_idle_conns: 1 + # Maximum connection idle time and lifetime before they're closed. Disabled if null. + # Parsed with https://pkg.go.dev/time#ParseDuration + max_conn_idle_time: null + max_conn_lifetime: null + # Homeserver details. homeserver: # The address that this appservice can use to connect to the homeserver. - address: {{ matrix_mautrix_gmessages_homeserver_address }} + # Local addresses without HTTPS are generally recommended when the bridge is running on the same machine, + # but https also works if they run on different machines. + address: http://example.localhost:8008 # The domain of the homeserver (also known as server_name, used for MXIDs, etc). - domain: {{ matrix_mautrix_gmessages_homeserver_domain }} + domain: example.com # What software is the homeserver running? # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here. software: standard # The URL to push real-time bridge status to. - # If set, the bridge will make POST requests to this URL whenever a user's google messages connection state changes. + # If set, the bridge will make POST requests to this URL whenever a user's remote network connection state changes. # The bridge will use the appservice as_token to authorize requests. - status_endpoint: null + status_endpoint: # Endpoint for reporting per-message status. - message_send_checkpoint_endpoint: null + # If set, the bridge will make POST requests to this URL when processing a message from Matrix. + # It will make one request when receiving the message (step BRIDGE), one after decrypting if applicable + # (step DECRYPTED) and one after sending to the remote network (step REMOTE). Errors will also be reported. + # The bridge will use the appservice as_token to authorize requests. + message_send_checkpoint_endpoint: # Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246? async_media: false @@ -26,33 +178,19 @@ homeserver: ping_interval_seconds: 0 # Application service host/registration related details. -# Changing these values requires regeneration of the registration. +# Changing these values requires regeneration of the registration (except when noted otherwise) appservice: # The address that the homeserver can use to connect to this appservice. address: {{ matrix_mautrix_gmessages_appservice_address }} + # A public address that external services can use to reach this appservice. + # This value doesn't affect the registration file. + public_address: https://bridge.example.com # The hostname and port where this appservice should listen. + # For Docker, you generally have to change the hostname to 0.0.0.0. hostname: 0.0.0.0 port: 8080 - # Database config. - database: - # The database type. "sqlite3-fk-wal" and "postgres" are supported. - type: postgres - # The database URI. - # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended. - # https://github.com/mattn/go-sqlite3#connection-string - # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable - # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql - uri: {{ matrix_mautrix_gmessages_appservice_database_uri|to_json }} - # Maximum number of connections. Mostly relevant for Postgres. - max_open_conns: 20 - max_idle_conns: 2 - # Maximum connection idle time and lifetime before they're closed. Disabled if null. - # Parsed with https://pkg.go.dev/time#ParseDuration - max_conn_idle_time: null - max_conn_lifetime: null - # The unique ID of this appservice. id: gmessages # Appservice bot details. @@ -64,229 +202,223 @@ appservice: displayname: Google Messages bridge bot avatar: mxc://maunium.net/yGOdcrJcwqARZqdzbfuxfhzb - # Whether or not to receive ephemeral events via appservice transactions. - # Requires MSC2409 support (i.e. Synapse 1.22+). + # Whether to receive ephemeral events via appservice transactions. ephemeral_events: true - # Should incoming events be handled asynchronously? # This may be necessary for large public instances with lots of messages going through. # However, messages will not be guaranteed to be bridged in the same order they were sent in. + # This value doesn't affect the registration file. async_transactions: false # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. - as_token: "{{ matrix_mautrix_gmessages_appservice_token }}" - hs_token: "{{ matrix_mautrix_gmessages_homeserver_token }}" + as_token: {{ matrix_mautrix_gmessages_appservice_token | to_json }} + hs_token: {{ matrix_mautrix_gmessages_homeserver_token | to_json }} -# Segment API key to track some events, like provisioning API login and encryption errors. -segment_key: null -# Optional user_id to use when sending Segment events. If null, defaults to using mxID. -segment_user_id: null + # Localpart template of MXIDs for remote users. + # {% raw %}{{.}}{% endraw %} is replaced with the internal ID of the user. + username_template: {{ matrix_mautrix_gmessages_appservice_username_template | to_json }} -# Prometheus config. -metrics: - # Enable prometheus metrics? - enabled: {{ matrix_mautrix_gmessages_metrics_enabled | to_json }} - # IP and port where the metrics listener should be. The path is always /metrics - listen: 0.0.0.0:8001 - -google_messages: - # OS name to tell the phone. This is the name that shows up in the paired devices list. - os: mautrix-gmessages - # Browser type to tell the phone. This decides which icon is shown. - # Valid types: OTHER, CHROME, FIREFOX, SAFARI, OPERA, IE, EDGE - browser: OTHER - - # Should the bridge aggressively set itself as the active device if the user opens Google Messages in a browser? - # If this is disabled, the user must manually use the `reconnect` command to reactivate the bridge. - aggressive_reconnect: false - -# Bridge config -bridge: - # Localpart template of MXIDs for SMS users. - # {{ '{{.}}' }} is replaced with an identifier of the recipient. - username_template: "{{ 'gmessages_{{.}}' }}" - # Displayname template for SMS users. - # {{ '{{.FullName}}' }} - Full name provided by the phone - # {{ '{{.FirstName}}' }} - First name provided by the phone - # {{ '{{.PhoneNumber}}' }} - Formatted phone number provided by the phone - displayname_template: "{{ '{{or .FullName .PhoneNumber}}' }}" - # Should the bridge create a space for each logged-in user and add bridged rooms to it? - personal_filtering_spaces: {{ matrix_mautrix_gmessages_bridge_personal_filtering_spaces | to_json }} - # Should the bridge send a read receipt from the bridge bot when a message has been sent to the phone? - delivery_receipts: false +# Config options that affect the Matrix connector of the bridge. +matrix: # Whether the bridge should send the message status as a custom com.beeper.message_send_status event. message_status_events: false + # Whether the bridge should send a read receipt after successfully bridging a message. + delivery_receipts: false # Whether the bridge should send error notices via m.notice events when a message fails to bridge. message_error_notices: true - - portal_message_buffer: 128 - - # Should the bridge update the m.direct account data event when double puppeting is enabled. - # Note that updating the m.direct event is not atomic (except with mautrix-asmux) - # and is therefore prone to race conditions. + # Whether the bridge should update the m.direct account data event when double puppeting is enabled. sync_direct_chat_list: false - # Number of chats to sync when connecting to Google Messages. - initial_chat_sync_count: 25 - # Backfill settings - backfill: - # Number of messages to backfill in new chats. - initial_limit: 50 - # Number of messages to backfill on startup if the last message ID in the chat sync doesn't match the last bridged message. - missed_limit: 100 + # Whether created rooms should have federation enabled. If false, created portal rooms + # will never be federated. Changing this option requires recreating rooms. + federate_rooms: {{ matrix_mautrix_gmessages_federate_rooms | to_json }} + # The threshold as bytes after which the bridge should roundtrip uploads via the disk + # rather than keeping the whole file in memory. + upload_file_threshold: 5242880 - # Servers to always allow double puppeting from - double_puppet_server_map: - "{{ matrix_mautrix_gmessages_homeserver_domain }}": {{ matrix_mautrix_gmessages_homeserver_address }} - # Allow using double puppeting from any server with a valid client .well-known file. - double_puppet_allow_discovery: false - # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth +# Segment-compatible analytics endpoint for tracking some events, like provisioning API login and encryption errors. +analytics: + # API key to send with tracking requests. Tracking is disabled if this is null. + token: null + # Address to send tracking requests to. + url: https://api.segment.io/v1/track + # Optional user ID for tracking events. If null, defaults to using Matrix user ID. + user_id: null + +# Settings for provisioning API +provisioning: + # Prefix for the provisioning API paths. + prefix: /_matrix/provision + # Shared secret for authentication. If set to "generate" or null, a random secret will be generated, + # or if set to "disable", the provisioning API will be disabled. + shared_secret: disable + # Whether to allow provisioning API requests to be authed using Matrix access tokens. + # This follows the same rules as double puppeting to determine which server to contact to check the token, + # which means that by default, it only works for users on the same server as the bridge. + allow_matrix_auth: true + # Enable debug API at /debug with provisioning authentication. + debug_endpoints: false + +# Some networks require publicly accessible media download links (e.g. for user avatars when using Discord webhooks). +# These settings control whether the bridge will provide such public media access. +public_media: + # Should public media be enabled at all? + # The public_address field under the appservice section MUST be set when enabling public media. + enabled: false + # A key for signing public media URLs. + # If set to "generate", a random key will be generated. + signing_key: {{ matrix_mautrix_gmessages_public_media_signing_key | to_json }} + # Number of seconds that public media URLs are valid for. + # If set to 0, URLs will never expire. + expiry: 0 + # Length of hash to use for public media URLs. Must be between 0 and 32. + hash_length: 32 + +# Settings for converting remote media to custom mxc:// URIs instead of reuploading. +# More details can be found at https://docs.mau.fi/bridges/go/discord/direct-media.html +direct_media: + # Should custom mxc:// URIs be used instead of reuploading media? + enabled: false + # The server name to use for the custom mxc:// URIs. + # This server name will effectively be a real Matrix server, it just won't implement anything other than media. + # You must either set up .well-known delegation from this domain to the bridge, or proxy the domain directly to the bridge. + server_name: media.example.com + # Optionally a custom .well-known response. This defaults to `server_name:443` + well_known_response: + # Optionally specify a custom prefix for the media ID part of the MXC URI. + media_id_prefix: + # If the remote network supports media downloads over HTTP, then the bridge will use MSC3860/MSC3916 + # media download redirects if the requester supports it. Optionally, you can force redirects + # and not allow proxying at all by setting this to false. + # This option does nothing if the remote network does not support media downloads over HTTP. + allow_proxy: true + # Matrix server signing key to make the federation tester pass, same format as synapse's .signing.key file. + # This key is also used to sign the mxc:// URIs to ensure only the bridge can generate them. + server_key: "" + +# Settings for backfilling messages. +# Note that the exact way settings are applied depends on the network connector. +# See https://docs.mau.fi/bridges/general/backfill.html for more details. +backfill: + # Whether to do backfilling at all. + enabled: {{ matrix_mautrix_gmessages_backfill_enabled | to_json }} + # Maximum number of messages to backfill in empty rooms. + max_initial_messages: {{ matrix_mautrix_gmessages_backfill_max_initial_messages | to_json }} + # Maximum number of missed messages to backfill after bridge restarts. + max_catchup_messages: {{ matrix_mautrix_gmessages_backfill_max_catchup_messages | to_json }} + # If a backfilled chat is older than this number of hours, + # mark it as read even if it's unread on the remote network. + unread_hours_threshold: {{ matrix_mautrix_gmessages_backfill_unread_hours_threshold | to_json }} + # Settings for backfilling threads within other backfills. + threads: + # Maximum number of messages to backfill in a new thread. + max_initial_messages: {{ matrix_mautrix_gmessages_backfill_threads_max_initial_messages | to_json }} + # Settings for the backwards backfill queue. This only applies when connecting to + # Beeper as standard Matrix servers don't support inserting messages into history. + queue: + # Should the backfill queue be enabled? + enabled: false + # Number of messages to backfill in one batch. + batch_size: 100 + # Delay between batches in seconds. + batch_delay: 20 + # Maximum number of batches to backfill per portal. + # If set to -1, all available messages will be backfilled. + max_batches: -1 + # Optional network-specific overrides for max batches. + # Interpretation of this field depends on the network connector. + max_batches_override: {} + +# Settings for enabling double puppeting +double_puppet: + # Servers to always allow double puppeting from. + # This is only for other servers and should NOT contain the server the bridge is on. + servers: {} + # Whether to allow client API URL discovery for other servers. When using this option, + # users on other servers can use double puppeting even if their server URLs aren't + # explicitly added to the servers map above. + allow_discovery: false + # Shared secrets for automatic double puppeting. + # See https://docs.mau.fi/bridges/general/double-puppeting.html for instructions. + secrets: {{ matrix_mautrix_gmessages_double_puppet_secrets | to_json }} + +# End-to-bridge encryption support options. +# +# See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. +encryption: + # Whether to enable encryption at all. If false, the bridge will not function in encrypted rooms. + allow: {{ matrix_mautrix_gmessages_bridge_encryption_allow | to_json }} + # Whether to force-enable encryption in all bridged rooms. + default: {{ matrix_mautrix_gmessages_bridge_encryption_default | to_json }} + # Whether to require all messages to be encrypted and drop any unencrypted messages. + require: {{ matrix_mautrix_gmessages_bridge_encryption_require | to_json }} + # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data. + # This option is not yet compatible with standard Matrix servers like Synapse and should not be used. + appservice: {{ matrix_mautrix_gmessages_bridge_encryption_appservice | to_json }} + # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. + # You must use a client that supports requesting keys from other users to use this feature. + allow_key_sharing: {{ matrix_mautrix_gmessages_bridge_encryption_key_sharing_allow | to_json }} + # Pickle key for encrypting encryption keys in the bridge database. + # If set to generate, a random key will be generated. + pickle_key: mautrix.bridge.e2ee + # Options for deleting megolm sessions from the bridge. + delete_keys: + # Beeper-specific: delete outbound sessions when hungryserv confirms + # that the user has uploaded the key to key backup. + delete_outbound_on_ack: false + # Don't store outbound sessions in the inbound table. + dont_store_outbound: false + # Ratchet megolm sessions forward after decrypting messages. + ratchet_on_decrypt: false + # Delete fully used keys (index >= max_messages) after decrypting messages. + delete_fully_used_on_decrypt: false + # Delete previous megolm sessions from same device when receiving a new one. + delete_prev_on_new_session: false + # Delete megolm sessions received from a device when the device is deleted. + delete_on_device_delete: false + # Periodically delete megolm sessions when 2x max_age has passed since receiving the session. + periodically_delete_expired: false + # Delete inbound megolm sessions that don't have the received_at field used for + # automatic ratcheting and expired session deletion. This is meant as a migration + # to delete old keys prior to the bridge update. + delete_outdated_inbound: false + # What level of device verification should be required from users? # - # If set, double puppeting will be enabled automatically for local users - # instead of users having to find an access token and run `login-matrix` - # manually. - login_shared_secret_map: {{ matrix_mautrix_gmessages_bridge_login_shared_secret_map|to_json }} - - # Whether to explicitly set the avatar and room name for private chat portal rooms. - # If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms. - # If set to `always`, all DM rooms will have explicit names and avatars set. - # If set to `never`, DM rooms will never have names and avatars set. - private_chat_portal_meta: default - # Should Matrix m.notice-type messages be bridged? - bridge_notices: true - # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run. - # This field will automatically be changed back to false after it, except if the config file is not writable. - resend_bridge_info: false - # When using double puppeting, should muted chats be muted in Matrix? - mute_bridging: {{ matrix_mautrix_gmessages_bridge_mute_bridging | to_json }} - # When using double puppeting, should archived chats be moved to a specific tag in Matrix? - # This can be set to a tag (e.g. m.lowpriority), or null to disable. - archive_tag: null - # Same as above, but for pinned chats. The favorite tag is called m.favourite - pinned_tag: null - # Should mute status and tags only be bridged when the portal room is created? - tag_only_on_create: true - # Whether or not created rooms should have federation enabled. - # If false, created portal rooms will never be federated. - federate_rooms: {{ matrix_mautrix_gmessages_federate_rooms|to_json }} - # Should the bridge never send alerts to the bridge management room? - # These are mostly things like the user being logged out. - disable_bridge_alerts: false - # Send captions in the same message as images. This will send data compatible with both MSC2530 and MSC3552. - # This is currently not supported in most clients. - caption_in_message: false - - # The prefix for commands. Only required in non-management rooms. - command_prefix: "!gm" - - # Messages sent upon joining a management room. - # Markdown is supported. The defaults are listed below. - management_room_text: - # Sent when joining a room. - welcome: "Hello, I'm a Google Messages bridge bot." - # Sent when joining a management room and the user is already logged in. - welcome_connected: "Use `help` for help." - # Sent when joining a management room and the user is not logged in. - welcome_unconnected: "Use `help` for help or `login` to log in." - # Optional extra text sent when joining a management room. - additional_help: "" - - # End-to-bridge encryption support options. - # - # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. - encryption: - # Allow encryption, work in group chat rooms with e2ee enabled - allow: {{ matrix_mautrix_gmessages_bridge_encryption_allow|to_json }} - # Default to encryption, force-enable encryption in all portals the bridge creates - # This will cause the bridge bot to be in private chats for the encryption to work properly. - default: {{ matrix_mautrix_gmessages_bridge_encryption_default|to_json }} - # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data. - appservice: false - # Require encryption, drop any unencrypted messages. - require: false - # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. - # You must use a client that supports requesting keys from other users to use this feature. - allow_key_sharing: {{ matrix_mautrix_gmessages_bridge_encryption_key_sharing_allow|to_json }} - # Options for deleting megolm sessions from the bridge. - delete_keys: - # Beeper-specific: delete outbound sessions when hungryserv confirms - # that the user has uploaded the key to key backup. - delete_outbound_on_ack: false - # Don't store outbound sessions in the inbound table. - dont_store_outbound: false - # Ratchet megolm sessions forward after decrypting messages. - ratchet_on_decrypt: false - # Delete fully used keys (index >= max_messages) after decrypting messages. - delete_fully_used_on_decrypt: false - # Delete previous megolm sessions from same device when receiving a new one. - delete_prev_on_new_session: false - # Delete megolm sessions received from a device when the device is deleted. - delete_on_device_delete: false - # Periodically delete megolm sessions when 2x max_age has passed since receiving the session. - periodically_delete_expired: false - # Delete inbound megolm sessions that don't have the received_at field used for - # automatic ratcheting and expired session deletion. This is meant as a migration - # to delete old keys prior to the bridge update. - delete_outdated_inbound: false - # What level of device verification should be required from users? - # - # Valid levels: - # unverified - Send keys to all device in the room. - # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys. - # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes). - # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot. - # Note that creating user signatures from the bridge bot is not currently possible. - # verified - Require manual per-device verification - # (currently only possible by modifying the `trust` column in the `crypto_device` database table). - verification_levels: - # Minimum level for which the bridge should send keys to when bridging messages from SMS to Matrix. - receive: unverified - # Minimum level that the bridge should accept for incoming Matrix messages. - send: unverified - # Minimum level that the bridge should require for accepting key requests. - share: cross-signed-tofu - # Options for Megolm room key rotation. These options allow you to - # configure the m.room.encryption event content. See: - # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for - # more information about that event. - rotation: - # Enable custom Megolm room key rotation settings. Note that these - # settings will only apply to rooms created after this option is - # set. - enable_custom: false - # The maximum number of milliseconds a session should be used - # before changing it. The Matrix spec recommends 604800000 (a week) - # as the default. - milliseconds: 604800000 - # The maximum number of messages that should be sent with a given a - # session before changing it. The Matrix spec recommends 100 as the - # default. - messages: 100 - - # Disable rotating keys when a user's devices change? - # You should not enable this option unless you understand all the implications. - disable_device_change_key_rotation: false - - # Settings for provisioning API - provisioning: - # Prefix for the provisioning API paths. - prefix: /_matrix/provision - # Shared secret for authentication. If set to "generate", a random secret will be generated, - # or if set to "disable", the provisioning API will be disabled. - shared_secret: generate - - # Permissions for using the bridge. - # Permitted values: - # user - Access to use the bridge to link their own Google Messages on android. - # admin - User level and some additional administration tools - # Permitted keys: - # * - All Matrix users - # domain - All users on that homeserver - # mxid - Specific user - permissions: {{ matrix_mautrix_gmessages_bridge_permissions|to_json }} + # Valid levels: + # unverified - Send keys to all device in the room. + # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys. + # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes). + # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot. + # Note that creating user signatures from the bridge bot is not currently possible. + # verified - Require manual per-device verification + # (currently only possible by modifying the `trust` column in the `crypto_device` database table). + verification_levels: + # Minimum level for which the bridge should send keys to when bridging messages from the remote network to Matrix. + receive: unverified + # Minimum level that the bridge should accept for incoming Matrix messages. + send: unverified + # Minimum level that the bridge should require for accepting key requests. + share: cross-signed-tofu + # Options for Megolm room key rotation. These options allow you to configure the m.room.encryption event content. + # See https://spec.matrix.org/v1.10/client-server-api/#mroomencryption for more information about that event. + rotation: + # Enable custom Megolm room key rotation settings. Note that these + # settings will only apply to rooms created after this option is set. + enable_custom: false + # The maximum number of milliseconds a session should be used + # before changing it. The Matrix spec recommends 604800000 (a week) + # as the default. + milliseconds: 604800000 + # The maximum number of messages that should be sent with a given a + # session before changing it. The Matrix spec recommends 100 as the + # default. + messages: 100 + # Disable rotating keys when a user's devices change? + # You should not enable this option unless you understand all the implications. + disable_device_change_key_rotation: false # Logging config. See https://github.com/tulir/zeroconfig for details. logging: min_level: {{ matrix_mautrix_gmessages_logging_level }} writers: - type: stdout - format: pretty-colored + format: pretty From 53f3c94bef59f34924c1e5e5d6777d64f9c8c3d9 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 17 Sep 2024 09:37:36 +0300 Subject: [PATCH 10/27] Enable backfilling for mautrix-gmessages, mautrix-signal and mautrix-slack We'be already been going against upstream defaults and have been enabling backfilling for a few other bridges (Messenger, Instagram, Telegram, Twitter). Now I'm enabling backfilling by default for the remaining ones, for consistency. --- .../matrix-bridge-mautrix-gmessages/defaults/main.yml | 2 +- .../matrix-bridge-mautrix-signal/defaults/main.yml | 6 ++++++ .../templates/config.yaml.j2 | 10 +++++----- .../matrix-bridge-mautrix-slack/defaults/main.yml | 6 ++++++ .../templates/config.yaml.j2 | 10 +++++----- .../matrix-bridge-mautrix-telegram/defaults/main.yml | 7 +------ 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/roles/custom/matrix-bridge-mautrix-gmessages/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-gmessages/defaults/main.yml index 1dd535d4a..0cea11e08 100644 --- a/roles/custom/matrix-bridge-mautrix-gmessages/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-gmessages/defaults/main.yml @@ -25,7 +25,7 @@ matrix_mautrix_gmessages_homeserver_address: "" matrix_mautrix_gmessages_homeserver_domain: "{{ matrix_domain }}" matrix_mautrix_gmessages_appservice_address: "http://matrix-mautrix-gmessages:8080" -matrix_mautrix_gmessages_backfill_enabled: false +matrix_mautrix_gmessages_backfill_enabled: true matrix_mautrix_gmessages_backfill_max_initial_messages: 50 matrix_mautrix_gmessages_backfill_max_catchup_messages: 500 matrix_mautrix_gmessages_backfill_unread_hours_threshold: 720 diff --git a/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml index 3181fd52a..72e1ae830 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml @@ -100,6 +100,12 @@ matrix_mautrix_signal_logging_level: 'warn' # If false, created portal rooms will never be federated. matrix_mautrix_signal_federate_rooms: true +matrix_mautrix_signal_backfill_enabled: true +matrix_mautrix_signal_backfill_max_initial_messages: 50 +matrix_mautrix_signal_backfill_max_catchup_messages: 500 +matrix_mautrix_signal_backfill_unread_hours_threshold: 720 +matrix_mautrix_signal_backfill_threads_max_initial_messages: 50 + # Whether or not metrics endpoint should be enabled. # Enabling them is usually enough for a local (in-container) Prometheus to consume them. # If metrics need to be consumed by another (external) Prometheus server, consider exposing them via `matrix_mautrix_signal_metrics_proxying_enabled`. diff --git a/roles/custom/matrix-bridge-mautrix-signal/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-signal/templates/config.yaml.j2 index 9151335af..e4af6d962 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-signal/templates/config.yaml.j2 @@ -280,18 +280,18 @@ direct_media: # See https://docs.mau.fi/bridges/general/backfill.html for more details. backfill: # Whether to do backfilling at all. - enabled: false + enabled: {{ matrix_mautrix_signal_backfill_enabled | to_json }} # Maximum number of messages to backfill in empty rooms. - max_initial_messages: 50 + max_initial_messages: {{ matrix_mautrix_signal_backfill_max_initial_messages | to_json }} # Maximum number of missed messages to backfill after bridge restarts. - max_catchup_messages: 500 + max_catchup_messages: {{ matrix_mautrix_signal_backfill_max_catchup_messages | to_json }} # If a backfilled chat is older than this number of hours, # mark it as read even if it's unread on the remote network. - unread_hours_threshold: 720 + unread_hours_threshold: {{ matrix_mautrix_signal_backfill_unread_hours_threshold| to_json }} # Settings for backfilling threads within other backfills. threads: # Maximum number of messages to backfill in a new thread. - max_initial_messages: 50 + max_initial_messages: {{ matrix_mautrix_signal_backfill_threads_max_initial_messages | to_json }} # Settings for the backwards backfill queue. This only applies when connecting to # Beeper as standard Matrix servers don't support inserting messages into history. queue: diff --git a/roles/custom/matrix-bridge-mautrix-slack/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-slack/defaults/main.yml index 0ebdae27f..213b1e1f1 100644 --- a/roles/custom/matrix-bridge-mautrix-slack/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-slack/defaults/main.yml @@ -55,6 +55,12 @@ matrix_mautrix_slack_homeserver_token: '' matrix_mautrix_slack_appservice_bot_username: slackbot +matrix_mautrix_slack_backfill_enabled: true +matrix_mautrix_slack_backfill_max_initial_messages: 50 +matrix_mautrix_slack_backfill_max_catchup_messages: 500 +matrix_mautrix_slack_backfill_unread_hours_threshold: 720 +matrix_mautrix_slack_backfill_threads_max_initial_messages: 50 + # Minimum severity of journal log messages. # Options: debug, info, warn, error, fatal matrix_mautrix_slack_logging_level: 'warn' diff --git a/roles/custom/matrix-bridge-mautrix-slack/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-slack/templates/config.yaml.j2 index ed3b9c0c2..f1ce5dbe0 100644 --- a/roles/custom/matrix-bridge-mautrix-slack/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-slack/templates/config.yaml.j2 @@ -317,18 +317,18 @@ direct_media: # See https://docs.mau.fi/bridges/general/backfill.html for more details. backfill: # Whether to do backfilling at all. - enabled: false + enabled: {{ matrix_mautrix_slack_backfill_enabled | to_json }} # Maximum number of messages to backfill in empty rooms. - max_initial_messages: 50 + max_initial_messages: {{ matrix_mautrix_slack_backfill_max_initial_messages | to_json }} # Maximum number of missed messages to backfill after bridge restarts. - max_catchup_messages: 500 + max_catchup_messages: {{ matrix_mautrix_slack_backfill_max_catchup_messages | to_json }} # If a backfilled chat is older than this number of hours, # mark it as read even if it's unread on the remote network. - unread_hours_threshold: 720 + unread_hours_threshold: {{ matrix_mautrix_slack_backfill_unread_hours_threshold| to_json }} # Settings for backfilling threads within other backfills. threads: # Maximum number of messages to backfill in a new thread. - max_initial_messages: 50 + max_initial_messages: {{ matrix_mautrix_slack_backfill_threads_max_initial_messages | to_json }} # Settings for the backwards backfill queue. This only applies when connecting to # Beeper as standard Matrix servers don't support inserting messages into history. queue: diff --git a/roles/custom/matrix-bridge-mautrix-telegram/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-telegram/defaults/main.yml index 4ad48c81c..3c5989b44 100644 --- a/roles/custom/matrix-bridge-mautrix-telegram/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-telegram/defaults/main.yml @@ -1,10 +1,5 @@ -# File : roles/custom/matrix-bridge-mautrix-telegram/defaults/main.yml -# Author : Pierre (McFly) Marty -# Date : 17.01.2024 -# Last Modified Date: 17.01.2024 -# Last Modified By : Pierre (McFly) Marty -# ----- --- + # mautrix-telegram is a Matrix <-> Telegram bridge # Project source code URL: https://github.com/mautrix/telegram From 67df140ef4ebe2e65355bb39fbe8d864e8941e72 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 17 Sep 2024 10:42:27 +0300 Subject: [PATCH 11/27] Upgrade Traefik (v3.1.2-1 -> v3.1.3-0) --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 1a5d5f597..acb556736 100644 --- a/requirements.yml +++ b/requirements.yml @@ -70,7 +70,7 @@ version: v1.0.0-0 name: timesync - src: git+https://github.com/devture/com.devture.ansible.role.traefik.git - version: v3.1.2-1 + version: v3.1.3-0 name: traefik - src: git+https://github.com/devture/com.devture.ansible.role.traefik_certs_dumper.git version: v2.8.3-4 From 239c7eddf83c3cb5e9aa163fb1b96bf4eca36426 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 17 Sep 2024 13:28:40 +0200 Subject: [PATCH 12/27] Update maintenance-upgrading-services.md --- docs/maintenance-upgrading-services.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/maintenance-upgrading-services.md b/docs/maintenance-upgrading-services.md index 9c10a8ca8..ea7ffb4d7 100644 --- a/docs/maintenance-upgrading-services.md +++ b/docs/maintenance-upgrading-services.md @@ -9,7 +9,7 @@ To upgrade services: - update your playbook directory and all upstream Ansible roles (defined in the `requirements.yml` file) using: - either: `just update` - - or: a combination of `git pull` and `just role` (or `make roles`) + - or: a combination of `git pull` and `just roles` (or `make roles`) - take a look at [the changelog](../CHANGELOG.md) to see if there have been any backward-incompatible changes that you need to take care of From d3b1060428aed69f934835d56a954fc9545070f6 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 17 Sep 2024 16:04:06 +0300 Subject: [PATCH 13/27] Fix Gmessages regression (missing homeserver.address and homeserver.domain configuration) f9705b3323863bfcb85426 reworked the configuration and missed wiring these to the existing variables. --- .../matrix-bridge-mautrix-gmessages/templates/config.yaml.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-bridge-mautrix-gmessages/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-gmessages/templates/config.yaml.j2 index 89000de86..a645d6d0f 100644 --- a/roles/custom/matrix-bridge-mautrix-gmessages/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-gmessages/templates/config.yaml.j2 @@ -150,9 +150,9 @@ homeserver: # The address that this appservice can use to connect to the homeserver. # Local addresses without HTTPS are generally recommended when the bridge is running on the same machine, # but https also works if they run on different machines. - address: http://example.localhost:8008 + address: {{ matrix_mautrix_gmessages_homeserver_address | to_json }} # The domain of the homeserver (also known as server_name, used for MXIDs, etc). - domain: example.com + domain: {{ matrix_mautrix_gmessages_homeserver_domain | to_json }} # What software is the homeserver running? # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here. From aee7d2ca6cddbbbaee769937f37a54b3b5a9eca3 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 17 Sep 2024 16:16:48 +0300 Subject: [PATCH 14/27] Do not use command_prefix = default for Meta bridges anymore Seems like `default` is not a supported value and will not make the bridge autoconfigure itself with the correct prefix anymore. A value of `default` would be taken literally. --- .../defaults/main.yml | 13 +++++++++---- .../defaults/main.yml | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/roles/custom/matrix-bridge-mautrix-meta-instagram/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-meta-instagram/defaults/main.yml index c5f306c7c..b2b0e02a0 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-instagram/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-instagram/defaults/main.yml @@ -194,10 +194,15 @@ matrix_mautrix_meta_instagram_bridge_displayname_suffix: |- matrix_mautrix_meta_instagram_bridge_displayname_template: '{% raw %}{{or .DisplayName .Username "Unknown user"}}{% endraw %}{{ (" " ~ matrix_mautrix_meta_instagram_bridge_displayname_suffix) if matrix_mautrix_meta_instagram_bridge_displayname_suffix else "" }}' # The prefix for commands. Only required in non-management rooms. -# If set to "default", will be determined based on meta -> mode (`matrix_mautrix_meta_instagram_meta_mode`): -# - "!ig" for instagram -# - "!fb" for facebook -matrix_mautrix_meta_instagram_bridge_command_prefix: default +matrix_mautrix_meta_instagram_bridge_command_prefix: |- + {{ + ({ + 'facebook': '!fb', + 'facebook-tor': '!fb', + 'messenger': '!fb', + 'instagram': '!ig', + })[matrix_mautrix_meta_instagram_meta_mode] + }} # Whether or not created rooms should have federation enabled. # If false, created portal rooms will never be federated. diff --git a/roles/custom/matrix-bridge-mautrix-meta-messenger/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-meta-messenger/defaults/main.yml index 944da8be7..c4abf337c 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-messenger/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-messenger/defaults/main.yml @@ -194,10 +194,15 @@ matrix_mautrix_meta_messenger_bridge_displayname_suffix: |- matrix_mautrix_meta_messenger_bridge_displayname_template: '{% raw %}{{or .DisplayName .Username "Unknown user"}}{% endraw %}{{ (" " ~ matrix_mautrix_meta_messenger_bridge_displayname_suffix) if matrix_mautrix_meta_messenger_bridge_displayname_suffix else "" }}' # The prefix for commands. Only required in non-management rooms. -# If set to "default", will be determined based on meta -> mode (`matrix_mautrix_meta_messenger_meta_mode`): -# - "!ig" for instagram -# - "!fb" for facebook -matrix_mautrix_meta_messenger_bridge_command_prefix: default +matrix_mautrix_meta_messenger_bridge_command_prefix: |- + {{ + ({ + 'facebook': '!fb', + 'facebook-tor': '!fb', + 'messenger': '!fb', + 'instagram': '!ig', + })[matrix_mautrix_meta_messenger_meta_mode] + }} # Whether or not created rooms should have federation enabled. # If false, created portal rooms will never be federated. From 605d0545490cd17ef1f0ceef3f882baa41f23d3d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:15:35 +0000 Subject: [PATCH 15/27] Update ghcr.io/element-hq/synapse Docker tag to v1.115.0 --- roles/custom/matrix-synapse/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index d2c8f0818..45366b0f2 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -16,7 +16,7 @@ matrix_synapse_enabled: true matrix_synapse_github_org_and_repo: element-hq/synapse # renovate: datasource=docker depName=ghcr.io/element-hq/synapse -matrix_synapse_version: v1.114.0 +matrix_synapse_version: v1.115.0 matrix_synapse_username: '' matrix_synapse_uid: '' From cf5763978bc04e26764fad6b36ce24d1aae77498 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 17 Sep 2024 21:25:15 +0300 Subject: [PATCH 16/27] Upgrade synapse-s3-storage-provider (1.3.0 -> 1.5.0) and adapt configuration 1.3.0 fails to work against the new Synapse (v1.115.0) image. See: https://github.com/matrix-org/synapse-s3-storage-provider/pull/114 Related to: https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3535 --- roles/custom/matrix-synapse/defaults/main.yml | 6 +++++- .../templates/synapse/ext/s3-storage-provider/env.j2 | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index 45366b0f2..6569e6172 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -1231,7 +1231,7 @@ matrix_synapse_ext_encryption_config_yaml: | # Installing it requires building a customized Docker image for Synapse (see `matrix_synapse_container_image_customizations_enabled`). # Enabling this will enable customizations and inject the appropriate Dockerfile clauses for installing synapse-s3-storage-provider. matrix_synapse_ext_synapse_s3_storage_provider_enabled: false -matrix_synapse_ext_synapse_s3_storage_provider_version: 1.3.0 +matrix_synapse_ext_synapse_s3_storage_provider_version: 1.5.0 # Controls whether media from this (local) server is stored in s3-storage-provider matrix_synapse_ext_synapse_s3_storage_provider_store_local: true # Controls whether media from remote servers is stored in s3-storage-provider @@ -1242,6 +1242,10 @@ matrix_synapse_ext_synapse_s3_storage_provider_store_remote: true # because the local filesystem is a reliable data store anyway. matrix_synapse_ext_synapse_s3_storage_provider_store_synchronous: false matrix_synapse_ext_synapse_s3_storage_provider_config_bucket: '' +# Prefix for all media in bucket, can't be changed once media has been uploaded. +# Useful if sharing the bucket between Synapses +# Example value: prefix/to/files/in/bucket +matrix_synapse_ext_synapse_s3_storage_provider_config_prefix: '' matrix_synapse_ext_synapse_s3_storage_provider_config_region_name: '' matrix_synapse_ext_synapse_s3_storage_provider_config_endpoint_url: '' matrix_synapse_ext_synapse_s3_storage_provider_config_access_key_id: '' diff --git a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/env.j2 b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/env.j2 index 227fd89e4..e50bf7e54 100644 --- a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/env.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/env.j2 @@ -7,6 +7,10 @@ AWS_DEFAULT_REGION={{ matrix_synapse_ext_synapse_s3_storage_provider_config_regi ENDPOINT={{ matrix_synapse_ext_synapse_s3_storage_provider_config_endpoint_url }} BUCKET={{ matrix_synapse_ext_synapse_s3_storage_provider_config_bucket }} +{% if matrix_synapse_ext_synapse_s3_storage_provider_config_prefix %} +PREFIX={{ matrix_synapse_ext_synapse_s3_storage_provider_config_prefix }} +{% endif %} + {% if matrix_synapse_ext_synapse_s3_storage_provider_config_sse_customer_enabled %} SSE_CUSTOMER_KEY={{ matrix_synapse_ext_synapse_s3_storage_provider_config_sse_customer_key }} SSE_CUSTOMER_ALGO={{ matrix_synapse_ext_synapse_s3_storage_provider_config_sse_customer_algo }} From 34634f144cf860b6f8abf3b57e62d34ff470eb9e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:06:37 +0000 Subject: [PATCH 17/27] Update joseluisq/static-web-server Docker tag to v2.33.0 --- roles/custom/matrix-cactus-comments-client/defaults/main.yml | 2 +- roles/custom/matrix-static-files/defaults/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-cactus-comments-client/defaults/main.yml b/roles/custom/matrix-cactus-comments-client/defaults/main.yml index 80bc793fd..f044a0cc8 100644 --- a/roles/custom/matrix-cactus-comments-client/defaults/main.yml +++ b/roles/custom/matrix-cactus-comments-client/defaults/main.yml @@ -13,7 +13,7 @@ matrix_cactus_comments_client_public_path: "{{ matrix_cactus_comments_client_bas matrix_cactus_comments_client_public_path_file_permissions: "0644" # renovate: datasource=docker depName=joseluisq/static-web-server -matrix_cactus_comments_client_version: 2.32.2 +matrix_cactus_comments_client_version: 2.33.0 matrix_cactus_comments_client_container_image: "{{ matrix_container_global_registry_prefix }}joseluisq/static-web-server:{{ matrix_cactus_comments_client_container_image_tag }}" matrix_cactus_comments_client_container_image_tag: "{{ 'latest' if matrix_cactus_comments_client_version == 'latest' else (matrix_cactus_comments_client_version + '-alpine') }}" diff --git a/roles/custom/matrix-static-files/defaults/main.yml b/roles/custom/matrix-static-files/defaults/main.yml index 4381a5dcd..51a996dc0 100644 --- a/roles/custom/matrix-static-files/defaults/main.yml +++ b/roles/custom/matrix-static-files/defaults/main.yml @@ -8,7 +8,7 @@ matrix_static_files_enabled: true matrix_static_files_identifier: matrix-static-files # renovate: datasource=docker depName=joseluisq/static-web-server -matrix_static_files_version: 2.32.2 +matrix_static_files_version: 2.33.0 matrix_static_files_base_path: "{{ matrix_base_data_path }}/{{ 'static-files' if matrix_static_files_identifier == 'matrix-static-files' else matrix_static_files_identifier }}" matrix_static_files_config_path: "{{ matrix_static_files_base_path }}/config" From 14a31e3e40c8e5d1b439f3e9a9c4ec60959dd852 Mon Sep 17 00:00:00 2001 From: Aine <97398200+aine-etke@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:19:39 +0300 Subject: [PATCH 18/27] synapse-admin v0.10.3-etke14: bulk registration works again, add ability to change avatars --- roles/custom/matrix-synapse-admin/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-synapse-admin/defaults/main.yml b/roles/custom/matrix-synapse-admin/defaults/main.yml index d12e50ba4..d02d65a6f 100644 --- a/roles/custom/matrix-synapse-admin/defaults/main.yml +++ b/roles/custom/matrix-synapse-admin/defaults/main.yml @@ -14,7 +14,7 @@ matrix_synapse_admin_container_image_self_build: false matrix_synapse_admin_container_image_self_build_repo: "https://github.com/etkecc/synapse-admin.git" # renovate: datasource=docker depName=ghcr.io/etkecc/synapse-admin -matrix_synapse_admin_version: v0.10.3-etke13 +matrix_synapse_admin_version: v0.10.3-etke14 matrix_synapse_admin_docker_image: "{{ matrix_synapse_admin_docker_image_name_prefix }}etkecc/synapse-admin:{{ matrix_synapse_admin_version }}" matrix_synapse_admin_docker_image_name_prefix: "{{ 'localhost/' if matrix_synapse_admin_container_image_self_build else 'ghcr.io/' }}" matrix_synapse_admin_docker_image_force_pull: "{{ matrix_synapse_admin_docker_image.endswith(':latest') }}" From 4d528801701ce192a5fa357f5a1556717b3a9a54 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 18 Sep 2024 14:47:57 +0300 Subject: [PATCH 19/27] Upgrade matrix-alertmanager-receiver (2024.8.28 -> 2024.9.18) Supersedes https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3539 Related to https://github.com/metio/matrix-alertmanager-receiver/pull/42 --- roles/custom/matrix-alertmanager-receiver/defaults/main.yml | 2 +- roles/custom/matrix-alertmanager-receiver/tasks/install.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-alertmanager-receiver/defaults/main.yml b/roles/custom/matrix-alertmanager-receiver/defaults/main.yml index 0d108a3bc..57aa252de 100644 --- a/roles/custom/matrix-alertmanager-receiver/defaults/main.yml +++ b/roles/custom/matrix-alertmanager-receiver/defaults/main.yml @@ -6,7 +6,7 @@ matrix_alertmanager_receiver_enabled: true # renovate: datasource=docker depName=docker.io/metio/matrix-alertmanager-receiver -matrix_alertmanager_receiver_version: 2024.8.28 +matrix_alertmanager_receiver_version: 2024.9.18 matrix_alertmanager_receiver_scheme: https diff --git a/roles/custom/matrix-alertmanager-receiver/tasks/install.yml b/roles/custom/matrix-alertmanager-receiver/tasks/install.yml index de946bb5a..58ef65796 100644 --- a/roles/custom/matrix-alertmanager-receiver/tasks/install.yml +++ b/roles/custom/matrix-alertmanager-receiver/tasks/install.yml @@ -63,7 +63,7 @@ cmd: |- {{ devture_systemd_docker_base_host_command_docker }} buildx build --tag={{ matrix_alertmanager_receiver_container_image }} - --file={{ matrix_alertmanager_receiver_container_src_path }}/contrib/Dockerfile + --file={{ matrix_alertmanager_receiver_container_src_path }}/Dockerfile {{ matrix_alertmanager_receiver_container_src_path }} changed_when: true From c89c356e53e733dc713e2b6d2b38dc15db0ea979 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Wed, 18 Sep 2024 15:20:27 +0200 Subject: [PATCH 20/27] Add a global config option for Docker network MTU (#3502) * Add a global config option for Docker network MTU * Upgrade systemd_docker_base (v1.2.0-0 -> v1.3.0-0) The new version includes `devture_systemd_docker_base_container_networks_driver_options` due to https://github.com/devture/com.devture.ansible.role.systemd_docker_base/commit/3cc7d1239654752da3e8f65760783a280a2b92f7 Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3502 * Switch from passing matrix_playbook_docker_network_mtu to respecting devture_systemd_docker_base_container_networks_driver_options Related to: - https://github.com/devture/com.devture.ansible.role.systemd_docker_base/commit/3cc7d1239654752da3e8f65760783a280a2b92f7 - https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3502 * Update all roles to versions that respect `devture_systemd_docker_base_container_networks_driver_options` --------- Co-authored-by: Slavi Pantaleev --- requirements.yml | 28 +++++++++---------- .../tasks/install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../matrix-bot-chatgpt/tasks/install.yml | 1 + .../tasks/setup_install.yml | 1 + .../matrix-bot-go-neb/tasks/install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../matrix-bot-maubot/tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/install.yml | 1 + .../tasks/install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../matrix-bridge-sms/tasks/setup_install.yml | 1 + .../matrix-bridge-wechat/tasks/install.yml | 1 + .../tasks/install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../matrix-conduit/tasks/setup_install.yml | 1 + .../matrix-corporal/tasks/setup_install.yml | 1 + .../matrix-coturn/tasks/setup_install.yml | 1 + .../matrix-dendrite/tasks/setup_install.yml | 1 + .../matrix-dimension/tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../matrix-ma1sd/tasks/setup_install.yml | 1 + .../matrix-media-repo/tasks/setup_install.yml | 1 + .../matrix-pantalaimon/tasks/install.yml | 1 + .../tasks/setup_install.yml | 1 + .../custom/matrix-rageshake/tasks/install.yml | 1 + .../tasks/setup_install.yml | 1 + .../matrix-sliding-sync/tasks/install.yml | 1 + .../matrix-static-files/tasks/install.yml | 1 + roles/custom/matrix-sygnal/tasks/install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + .../tasks/synapse/setup_install.yml | 1 + .../tasks/setup_install.yml | 1 + 72 files changed, 85 insertions(+), 14 deletions(-) diff --git a/requirements.yml b/requirements.yml index acb556736..11058a53e 100644 --- a/requirements.yml +++ b/requirements.yml @@ -16,22 +16,22 @@ version: 129c8590e106b83e6f4c259649a613c6279e937a name: docker_sdk_for_python - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-etherpad.git - version: v2.2.2-0 + version: v2.2.2-1 name: etherpad - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-exim-relay.git - version: v4.98-r0-1-0 + version: v4.98-r0-1-1 name: exim_relay - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-grafana.git - version: v11.1.4-0 + version: v11.1.4-1 name: grafana - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-jitsi.git - version: v9646-0 + version: v9646-1 name: jitsi - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-keydb.git - version: v6.3.4-2 + version: v6.3.4-3 name: keydb - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-ntfy.git - version: v2.10.0-1 + version: v2.10.0-2 name: ntfy - src: git+https://github.com/devture/com.devture.ansible.role.playbook_help.git version: 201c939eed363de269a83ba29784fc3244846048 @@ -43,25 +43,25 @@ version: ff2fd42e1c1a9e28e3312bbd725395f9c2fc7f16 name: playbook_state_preserver - src: git+https://github.com/devture/com.devture.ansible.role.postgres.git - version: v16.3-2 + version: v16.3-3 name: postgres - src: git+https://github.com/devture/com.devture.ansible.role.postgres_backup.git - version: 8c3585fb4857dbac026b2974bb6525289240effb + version: ccfd8db07fd8725119f0e06ba5144b8f58a67890 name: postgres_backup - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus.git - version: v2.54.1-0 + version: v2.54.1-1 name: prometheus - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-node-exporter.git - version: v1.8.2-0 + version: v1.8.2-1 name: prometheus_node_exporter - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-postgres-exporter.git - version: v0.14.0-5 + version: v0.14.0-6 name: prometheus_postgres_exporter - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-redis.git - version: v7.2.5-0 + version: v7.2.5-1 name: redis - src: git+https://github.com/devture/com.devture.ansible.role.systemd_docker_base.git - version: v1.2.0-0 + version: v1.3.0-0 name: systemd_docker_base - src: git+https://github.com/devture/com.devture.ansible.role.systemd_service_manager.git version: v1.0.0-4 @@ -70,7 +70,7 @@ version: v1.0.0-0 name: timesync - src: git+https://github.com/devture/com.devture.ansible.role.traefik.git - version: v3.1.3-0 + version: v3.1.3-1 name: traefik - src: git+https://github.com/devture/com.devture.ansible.role.traefik_certs_dumper.git version: v2.8.3-4 diff --git a/roles/custom/matrix-alertmanager-receiver/tasks/install.yml b/roles/custom/matrix-alertmanager-receiver/tasks/install.yml index 58ef65796..50bb44627 100644 --- a/roles/custom/matrix-alertmanager-receiver/tasks/install.yml +++ b/roles/custom/matrix-alertmanager-receiver/tasks/install.yml @@ -72,6 +72,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_alertmanager_receiver_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-alertmanager-receiver.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml b/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml index e54956a2e..1e716f264 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml +++ b/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml @@ -80,6 +80,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_draupnir_for_all_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-appservice-draupnir-for-all.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml b/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml index e3b792bf5..53723c625 100644 --- a/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml @@ -97,6 +97,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_buscarron_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-buscarron.service restarted, if necessary ansible.builtin.service: diff --git a/roles/custom/matrix-bot-chatgpt/tasks/install.yml b/roles/custom/matrix-bot-chatgpt/tasks/install.yml index 68eaf7443..af9550f15 100644 --- a/roles/custom/matrix-bot-chatgpt/tasks/install.yml +++ b/roles/custom/matrix-bot-chatgpt/tasks/install.yml @@ -61,6 +61,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_chatgpt_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-chatgpt.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bot-draupnir/tasks/setup_install.yml b/roles/custom/matrix-bot-draupnir/tasks/setup_install.yml index a549ad513..48fc2039c 100644 --- a/roles/custom/matrix-bot-draupnir/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-draupnir/tasks/setup_install.yml @@ -75,6 +75,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_draupnir_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-draupnir.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bot-go-neb/tasks/install.yml b/roles/custom/matrix-bot-go-neb/tasks/install.yml index 96178ddb9..10002904c 100644 --- a/roles/custom/matrix-bot-go-neb/tasks/install.yml +++ b/roles/custom/matrix-bot-go-neb/tasks/install.yml @@ -48,6 +48,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_go_neb_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-go-neb.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml b/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml index 438612eb7..fb495420a 100644 --- a/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml @@ -91,6 +91,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_honoroit_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-honoroit.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml b/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml index 652e2d4bb..d50c0f860 100644 --- a/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml @@ -61,6 +61,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_matrix_registration_bot_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-matrix-registration-bot.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml index 0489187cd..ccda0f634 100644 --- a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml @@ -89,6 +89,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_matrix_reminder_bot_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-matrix-reminder-bot.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bot-maubot/tasks/setup_install.yml b/roles/custom/matrix-bot-maubot/tasks/setup_install.yml index bceab14ec..318879f9b 100644 --- a/roles/custom/matrix-bot-maubot/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-maubot/tasks/setup_install.yml @@ -75,6 +75,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_maubot_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-maubot.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bot-mjolnir/tasks/setup_install.yml b/roles/custom/matrix-bot-mjolnir/tasks/setup_install.yml index 5fe1f4306..082948344 100644 --- a/roles/custom/matrix-bot-mjolnir/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-mjolnir/tasks/setup_install.yml @@ -64,6 +64,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_mjolnir_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-mjolnir.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bot-postmoogle/tasks/setup_install.yml b/roles/custom/matrix-bot-postmoogle/tasks/setup_install.yml index a14718289..b771dbbae 100644 --- a/roles/custom/matrix-bot-postmoogle/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-postmoogle/tasks/setup_install.yml @@ -84,6 +84,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_postmoogle_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-bot-postmoogle.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml b/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml index ccfc3bad7..fed72d1e1 100644 --- a/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml @@ -109,6 +109,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_discord_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-appservice-discord.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml b/roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml index 77eb3bf8c..4e91e073f 100644 --- a/roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml @@ -193,6 +193,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_irc_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-appservice-irc.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_install.yml b/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_install.yml index 8235d550e..1cb1e6026 100644 --- a/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_install.yml @@ -102,6 +102,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_kakaotalk_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-appservice-kakaotalk-node.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-appservice-slack/tasks/setup_install.yml b/roles/custom/matrix-bridge-appservice-slack/tasks/setup_install.yml index 7ad2b26d6..619276bdb 100644 --- a/roles/custom/matrix-bridge-appservice-slack/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-appservice-slack/tasks/setup_install.yml @@ -87,6 +87,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_slack_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-appservice-slack support files installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-appservice-webhooks/tasks/setup_install.yml b/roles/custom/matrix-bridge-appservice-webhooks/tasks/setup_install.yml index 145bf2165..2896c7580 100644 --- a/roles/custom/matrix-bridge-appservice-webhooks/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-appservice-webhooks/tasks/setup_install.yml @@ -86,6 +86,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_webhooks_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-appservice-webhooks support files installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_install.yml b/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_install.yml index 4a0f88f0f..1c8bfe965 100644 --- a/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_install.yml @@ -88,6 +88,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_beeper_linkedin_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-beeper-linkedin.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_install.yml b/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_install.yml index 304d55039..81bd439e9 100644 --- a/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-go-skype-bridge/tasks/setup_install.yml @@ -131,6 +131,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_go_skype_bridge_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-go-skype-bridge.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-heisenbridge/tasks/setup_install.yml b/roles/custom/matrix-bridge-heisenbridge/tasks/setup_install.yml index b8918cb79..c854689da 100644 --- a/roles/custom/matrix-bridge-heisenbridge/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-heisenbridge/tasks/setup_install.yml @@ -44,6 +44,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_heisenbridge_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-heisenbridge.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml b/roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml index 05b3005e5..f76ae653c 100644 --- a/roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml @@ -112,6 +112,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_hookshot_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure mautrix-hookshot support files installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml index e160bc9f6..d8732329a 100644 --- a/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml @@ -98,6 +98,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_discord_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-discord.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml index d17488ee0..17a846374 100644 --- a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml @@ -128,6 +128,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_facebook_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-facebook.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-gmessages/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-gmessages/tasks/setup_install.yml index f9387eb4a..cd414a43a 100644 --- a/roles/custom/matrix-bridge-mautrix-gmessages/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-gmessages/tasks/setup_install.yml @@ -147,6 +147,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_gmessages_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-gmessages.service restarted, if necessary ansible.builtin.service: diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml index 3b3a55803..fb0e41c38 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml @@ -128,6 +128,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_googlechat_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-googlechat.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml index eca5cc260..d14bb55f3 100644 --- a/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml @@ -128,6 +128,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_hangouts_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-hangouts.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-instagram/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-instagram/tasks/setup_install.yml index 9ad03a5a6..f355edc3b 100644 --- a/roles/custom/matrix-bridge-mautrix-instagram/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-instagram/tasks/setup_install.yml @@ -80,6 +80,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_instagram_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-instagram.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/install.yml b/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/install.yml index b0240e298..5a16120ac 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/install.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/install.yml @@ -107,6 +107,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_meta_instagram_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure mautrix-meta-instagram.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/install.yml b/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/install.yml index 2b5738c90..c70f5cd44 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/install.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/install.yml @@ -107,6 +107,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_meta_messenger_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure mautrix-meta-messenger.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_install.yml index a04757499..7c70d4a47 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_install.yml @@ -141,6 +141,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_signal_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-signal.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-slack/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-slack/tasks/setup_install.yml index 15a54d426..f22bb83de 100644 --- a/roles/custom/matrix-bridge-mautrix-slack/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-slack/tasks/setup_install.yml @@ -98,6 +98,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_slack_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-slack.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml index 410ee2022..b377897fc 100644 --- a/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml @@ -153,6 +153,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_telegram_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-telegram.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_install.yml index bf7c3fa1a..f89ef1994 100644 --- a/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_install.yml @@ -82,6 +82,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_twitter_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-twitter.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml index 9e9a583b2..737b2e48d 100644 --- a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml @@ -141,6 +141,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_whatsapp_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-whatsapp.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml index d7d24cf4a..c14b03e82 100644 --- a/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml @@ -96,6 +96,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_wsproxy_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mautrix-wsproxy.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml index c3037d8c6..c95cd530c 100644 --- a/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-discord/tasks/setup_install.yml @@ -117,6 +117,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mx_puppet_discord_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mx-puppet-discord.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml index 55bb29aa3..28e80446c 100644 --- a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml @@ -118,6 +118,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mx_puppet_groupme_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mx-puppet-groupme.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml index 238ea1f2b..aab15cb49 100644 --- a/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-instagram/tasks/setup_install.yml @@ -97,6 +97,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mx_puppet_instagram_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mx-puppet-instagram.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml index 9524f338c..e296cb96d 100644 --- a/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-slack/tasks/setup_install.yml @@ -128,6 +128,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mx_puppet_slack_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mx-puppet-slack.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml index 24ef30b59..17f42b605 100644 --- a/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml @@ -118,6 +118,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mx_puppet_steam_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mx-puppet-steam.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml index e5e051841..d30d4ee7e 100644 --- a/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-twitter/tasks/setup_install.yml @@ -128,6 +128,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mx_puppet_twitter_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-mx-puppet-twitter.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-sms/tasks/setup_install.yml b/roles/custom/matrix-bridge-sms/tasks/setup_install.yml index 6d0cfd08f..1fc34b9ca 100644 --- a/roles/custom/matrix-bridge-sms/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-sms/tasks/setup_install.yml @@ -51,6 +51,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_sms_bridge_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-sms-bridge.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-wechat/tasks/install.yml b/roles/custom/matrix-bridge-wechat/tasks/install.yml index 8a2d0694b..36d530c75 100644 --- a/roles/custom/matrix-bridge-wechat/tasks/install.yml +++ b/roles/custom/matrix-bridge-wechat/tasks/install.yml @@ -113,6 +113,7 @@ community.general.docker_network: name: "{{ matrix_wechat_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-wechat.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-cactus-comments-client/tasks/install.yml b/roles/custom/matrix-cactus-comments-client/tasks/install.yml index 53eaee90c..16fdde5e2 100644 --- a/roles/custom/matrix-cactus-comments-client/tasks/install.yml +++ b/roles/custom/matrix-cactus-comments-client/tasks/install.yml @@ -76,6 +76,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_cactus_comments_client_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-cactus-comments-client.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-client-cinny/tasks/setup_install.yml b/roles/custom/matrix-client-cinny/tasks/setup_install.yml index 162514f52..ab3dcbf64 100644 --- a/roles/custom/matrix-client-cinny/tasks/setup_install.yml +++ b/roles/custom/matrix-client-cinny/tasks/setup_install.yml @@ -69,6 +69,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_client_cinny_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-client-cinny.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-client-element/tasks/setup_install.yml b/roles/custom/matrix-client-element/tasks/setup_install.yml index 0e5053d35..974e3d421 100644 --- a/roles/custom/matrix-client-element/tasks/setup_install.yml +++ b/roles/custom/matrix-client-element/tasks/setup_install.yml @@ -103,6 +103,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_client_element_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-client-element.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-client-hydrogen/tasks/setup_install.yml b/roles/custom/matrix-client-hydrogen/tasks/setup_install.yml index 42cfd563a..08727586c 100644 --- a/roles/custom/matrix-client-hydrogen/tasks/setup_install.yml +++ b/roles/custom/matrix-client-hydrogen/tasks/setup_install.yml @@ -81,6 +81,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_client_hydrogen_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-client-hydrogen.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-client-schildichat/tasks/setup_install.yml b/roles/custom/matrix-client-schildichat/tasks/setup_install.yml index f6bd61a17..870b640a6 100644 --- a/roles/custom/matrix-client-schildichat/tasks/setup_install.yml +++ b/roles/custom/matrix-client-schildichat/tasks/setup_install.yml @@ -102,6 +102,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_client_schildichat_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-client-schildichat.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-conduit/tasks/setup_install.yml b/roles/custom/matrix-conduit/tasks/setup_install.yml index 00d8a1330..5db1ba225 100644 --- a/roles/custom/matrix-conduit/tasks/setup_install.yml +++ b/roles/custom/matrix-conduit/tasks/setup_install.yml @@ -39,6 +39,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_conduit_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure Conduit container image is pulled community.docker.docker_image: diff --git a/roles/custom/matrix-corporal/tasks/setup_install.yml b/roles/custom/matrix-corporal/tasks/setup_install.yml index 3213fc9f4..a8633ffc9 100644 --- a/roles/custom/matrix-corporal/tasks/setup_install.yml +++ b/roles/custom/matrix-corporal/tasks/setup_install.yml @@ -71,6 +71,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_corporal_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-corporal.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-coturn/tasks/setup_install.yml b/roles/custom/matrix-coturn/tasks/setup_install.yml index 0969260a6..6bed10492 100644 --- a/roles/custom/matrix-coturn/tasks/setup_install.yml +++ b/roles/custom/matrix-coturn/tasks/setup_install.yml @@ -99,6 +99,7 @@ community.docker.docker_network: name: "{{ matrix_coturn_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-coturn.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-dendrite/tasks/setup_install.yml b/roles/custom/matrix-dendrite/tasks/setup_install.yml index 248a15dd7..acc2558f7 100644 --- a/roles/custom/matrix-dendrite/tasks/setup_install.yml +++ b/roles/custom/matrix-dendrite/tasks/setup_install.yml @@ -112,6 +112,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_dendrite_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure Dendrite support files installed ansible.builtin.template: diff --git a/roles/custom/matrix-dimension/tasks/setup_install.yml b/roles/custom/matrix-dimension/tasks/setup_install.yml index 04c2248f9..3f4e3f021 100644 --- a/roles/custom/matrix-dimension/tasks/setup_install.yml +++ b/roles/custom/matrix-dimension/tasks/setup_install.yml @@ -133,6 +133,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_dimension_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-dimension.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-dynamic-dns/tasks/setup_install.yml b/roles/custom/matrix-dynamic-dns/tasks/setup_install.yml index f8ce0c48e..8440d791b 100644 --- a/roles/custom/matrix-dynamic-dns/tasks/setup_install.yml +++ b/roles/custom/matrix-dynamic-dns/tasks/setup_install.yml @@ -61,6 +61,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_dynamic_dns_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-dynamic-dns.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-email2matrix/tasks/setup_install.yml b/roles/custom/matrix-email2matrix/tasks/setup_install.yml index 5d49e7d47..5cf88c002 100644 --- a/roles/custom/matrix-email2matrix/tasks/setup_install.yml +++ b/roles/custom/matrix-email2matrix/tasks/setup_install.yml @@ -61,6 +61,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_email2matrix_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-email2matrix.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-ldap-registration-proxy/tasks/setup_install.yml b/roles/custom/matrix-ldap-registration-proxy/tasks/setup_install.yml index 760d4728f..43f16292e 100644 --- a/roles/custom/matrix-ldap-registration-proxy/tasks/setup_install.yml +++ b/roles/custom/matrix-ldap-registration-proxy/tasks/setup_install.yml @@ -56,6 +56,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_ldap_registration_proxy_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-ldap-registration-proxy.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-ma1sd/tasks/setup_install.yml b/roles/custom/matrix-ma1sd/tasks/setup_install.yml index 0fcdb8c0a..9e363fc0f 100644 --- a/roles/custom/matrix-ma1sd/tasks/setup_install.yml +++ b/roles/custom/matrix-ma1sd/tasks/setup_install.yml @@ -137,6 +137,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_ma1sd_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-ma1sd.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-media-repo/tasks/setup_install.yml b/roles/custom/matrix-media-repo/tasks/setup_install.yml index e4e5962c1..67bf8bec2 100755 --- a/roles/custom/matrix-media-repo/tasks/setup_install.yml +++ b/roles/custom/matrix-media-repo/tasks/setup_install.yml @@ -139,6 +139,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_media_repo_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure media-repo service installed ansible.builtin.template: diff --git a/roles/custom/matrix-pantalaimon/tasks/install.yml b/roles/custom/matrix-pantalaimon/tasks/install.yml index 74a90cce2..9a9b9a38c 100644 --- a/roles/custom/matrix-pantalaimon/tasks/install.yml +++ b/roles/custom/matrix-pantalaimon/tasks/install.yml @@ -59,6 +59,7 @@ community.general.docker_network: name: "{{ matrix_pantalaimon_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-pantalaimon.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/setup_install.yml b/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/setup_install.yml index 2133e54a0..f7a0ee213 100644 --- a/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/setup_install.yml +++ b/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/setup_install.yml @@ -45,6 +45,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_prometheus_nginxlog_exporter_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-prometheus-nginxlog-exporter.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-rageshake/tasks/install.yml b/roles/custom/matrix-rageshake/tasks/install.yml index f19304b8a..572f03f1f 100644 --- a/roles/custom/matrix-rageshake/tasks/install.yml +++ b/roles/custom/matrix-rageshake/tasks/install.yml @@ -70,6 +70,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_rageshake_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-rageshake.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-registration/tasks/setup_install.yml b/roles/custom/matrix-registration/tasks/setup_install.yml index 9c6791365..b29a05e60 100644 --- a/roles/custom/matrix-registration/tasks/setup_install.yml +++ b/roles/custom/matrix-registration/tasks/setup_install.yml @@ -112,6 +112,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_registration_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-registration.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-sliding-sync/tasks/install.yml b/roles/custom/matrix-sliding-sync/tasks/install.yml index 7e7f2569c..3526aa644 100644 --- a/roles/custom/matrix-sliding-sync/tasks/install.yml +++ b/roles/custom/matrix-sliding-sync/tasks/install.yml @@ -63,6 +63,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_sliding_sync_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-sliding-sync.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-static-files/tasks/install.yml b/roles/custom/matrix-static-files/tasks/install.yml index 8d715de78..3cbd9d4c6 100644 --- a/roles/custom/matrix-static-files/tasks/install.yml +++ b/roles/custom/matrix-static-files/tasks/install.yml @@ -86,6 +86,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_static_files_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-static-files systemd service is installed ansible.builtin.template: diff --git a/roles/custom/matrix-sygnal/tasks/install.yml b/roles/custom/matrix-sygnal/tasks/install.yml index a3015a385..7ac656819 100644 --- a/roles/custom/matrix-sygnal/tasks/install.yml +++ b/roles/custom/matrix-sygnal/tasks/install.yml @@ -44,6 +44,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_sygnal_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-sygnal.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-synapse-admin/tasks/setup_install.yml b/roles/custom/matrix-synapse-admin/tasks/setup_install.yml index 6e7b8160b..2dcdd0cfb 100644 --- a/roles/custom/matrix-synapse-admin/tasks/setup_install.yml +++ b/roles/custom/matrix-synapse-admin/tasks/setup_install.yml @@ -69,6 +69,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_synapse_admin_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-synapse-admin.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-synapse-auto-compressor/tasks/install.yml b/roles/custom/matrix-synapse-auto-compressor/tasks/install.yml index 4baeb3fb4..2f51b5a0b 100644 --- a/roles/custom/matrix-synapse-auto-compressor/tasks/install.yml +++ b/roles/custom/matrix-synapse-auto-compressor/tasks/install.yml @@ -81,6 +81,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_synapse_auto_compressor_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-synapse-auto-compressor systemd service and timer are installed ansible.builtin.template: diff --git a/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/setup_install.yml b/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/setup_install.yml index 8af00cf67..edfa7c212 100644 --- a/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/setup_install.yml +++ b/roles/custom/matrix-synapse-reverse-proxy-companion/tasks/setup_install.yml @@ -44,6 +44,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_synapse_reverse_proxy_companion_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-synapse-reverse-proxy-companion.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml b/roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml index 06945a56e..72cdbd37c 100644 --- a/roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml +++ b/roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml @@ -69,6 +69,7 @@ community.general.docker_network: name: "{{ matrix_synapse_usage_exporter_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure synapse-usage-exporter service installed ansible.builtin.template: diff --git a/roles/custom/matrix-synapse/tasks/synapse/setup_install.yml b/roles/custom/matrix-synapse/tasks/synapse/setup_install.yml index c22e9d04a..1181fd7c8 100644 --- a/roles/custom/matrix-synapse/tasks/synapse/setup_install.yml +++ b/roles/custom/matrix-synapse/tasks/synapse/setup_install.yml @@ -120,6 +120,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_synapse_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure Synapse support files installed ansible.builtin.template: diff --git a/roles/custom/matrix-user-verification-service/tasks/setup_install.yml b/roles/custom/matrix-user-verification-service/tasks/setup_install.yml index d42401f4e..8fa4b670e 100644 --- a/roles/custom/matrix-user-verification-service/tasks/setup_install.yml +++ b/roles/custom/matrix-user-verification-service/tasks/setup_install.yml @@ -60,6 +60,7 @@ enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_user_verification_service_container_network }}" driver: bridge + driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure matrix-user-verification-service.service installed ansible.builtin.template: From 2b8d7e30f7a9b85646f070b98fa372c4a261abd6 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 20 Sep 2024 15:08:04 +0300 Subject: [PATCH 21/27] Upgrade Postgres (v16.3-3 -> v16.4-0) --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 11058a53e..07ee67cdd 100644 --- a/requirements.yml +++ b/requirements.yml @@ -43,7 +43,7 @@ version: ff2fd42e1c1a9e28e3312bbd725395f9c2fc7f16 name: playbook_state_preserver - src: git+https://github.com/devture/com.devture.ansible.role.postgres.git - version: v16.3-3 + version: v16.4-0 name: postgres - src: git+https://github.com/devture/com.devture.ansible.role.postgres_backup.git version: ccfd8db07fd8725119f0e06ba5144b8f58a67890 From b670d0f3880bcc4c04f3be74f3f2d4e23759d8ff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:19:52 +0000 Subject: [PATCH 22/27] Update dependency etherpad to v2.2.5-0 --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 07ee67cdd..8a8054f7c 100644 --- a/requirements.yml +++ b/requirements.yml @@ -16,7 +16,7 @@ version: 129c8590e106b83e6f4c259649a613c6279e937a name: docker_sdk_for_python - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-etherpad.git - version: v2.2.2-1 + version: v2.2.5-0 name: etherpad - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-exim-relay.git version: v4.98-r0-1-1 From be96be8b3c1234ac8cbe58160d8ef9c76a325884 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 22 Sep 2024 11:59:14 +0300 Subject: [PATCH 23/27] Pin baibot to v1.1.1 and add default prompt for all statically-defined agents The playbook did not use to define a prompt for statically-defined agents. Since prompt variables support landed in v1.1.0 (see https://github.com/etkecc/baibot/commit/2a5a2d6a4dbf5fd7cb504ac07d4187fdc32ae395) it makes sense to make use of it for a better out-of-the-box experience (see https://github.com/etkecc/baibot/issues/10). --- docs/configuring-playbook-bot-baibot.md | 24 +++++++++++++++++-- .../matrix-bot-baibot/defaults/main.yml | 15 ++++++------ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/docs/configuring-playbook-bot-baibot.md b/docs/configuring-playbook-bot-baibot.md index e39d8ee52..6024015e5 100644 --- a/docs/configuring-playbook-bot-baibot.md +++ b/docs/configuring-playbook-bot-baibot.md @@ -154,6 +154,11 @@ matrix_bot_baibot_config_agents_static_definitions_anthropic_config_api_key: "YO # If you'd like to use another text-generation agent, uncomment and adjust: # matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_model_id: claude-3-5-sonnet-20240620 +# The playbook defines a default prompt for all statically-defined agents. +# You can adjust it in the `matrix_bot_baibot_config_agents_static_definitions_prompt` variable, +# or you can adjust it below only for the Anthropic agent. +# matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" + # See `defaults/main.yml` in the baibot role for more configuration options. ``` @@ -176,6 +181,11 @@ matrix_bot_baibot_config_agents_static_definitions_groq_config_api_key: "YOUR_AP # Specify the text-generation agent you'd like to use matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_model_id: "llama3-70b-8192" +# The playbook defines a default prompt for all statically-defined agents. +# You can adjust it in the `matrix_bot_baibot_config_agents_static_definitions_prompt` variable, +# or you can adjust it below only for the Groq agent. +# matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" + # Uncomment and adjust if you're not happy with these speech-to-text defaults: # # matrix_bot_baibot_config_agents_static_definitions_groq_config_speech_to_text_enabled: true @@ -202,6 +212,11 @@ matrix_bot_baibot_config_agents_static_definitions_mistral_enabled: true matrix_bot_baibot_config_agents_static_definitions_mistral_config_api_key: "YOUR_API_KEY_HERE" +# The playbook defines a default prompt for all statically-defined agents. +# You can adjust it in the `matrix_bot_baibot_config_agents_static_definitions_prompt` variable, +# or you can adjust it below only for the Mistral agent. +# matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" + # Uncomment and adjust if you're not happy with these defaults: # matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_model_id: mistral-large-latest @@ -228,6 +243,11 @@ matrix_bot_baibot_config_agents_static_definitions_openai_enabled: true matrix_bot_baibot_config_agents_static_definitions_openai_config_api_key: "YOUR_API_KEY_HERE" +# The playbook defines a default prompt for all statically-defined agents. +# You can adjust it in the `matrix_bot_baibot_config_agents_static_definitions_prompt` variable, +# or you can adjust it below only for the OpenAI agent. +# matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" + # If you'd like to use another text-generation agent, uncomment and adjust: # matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_model_id: gpt-4o @@ -273,7 +293,7 @@ matrix_bot_baibot_config_agents_static_definitions_custom: api_key: "YOUR_API_KEY_HERE" text_generation: model_id: gpt-3.5-turbo-0125 - prompt: You are a brief, but helpful bot. + prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" temperature: 1.0 max_response_tokens: 4096 max_context_tokens: 16385 @@ -290,7 +310,7 @@ matrix_bot_baibot_config_agents_static_definitions_custom: api_key: "" text_generation: model_id: "llama3.1:8b" - prompt: "You are an assistant based on the Llama3.1:8b model. Be brief in your responses." + prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" temperature: 1.0 max_response_tokens: 4096 max_context_tokens: 128000 diff --git a/roles/custom/matrix-bot-baibot/defaults/main.yml b/roles/custom/matrix-bot-baibot/defaults/main.yml index b07a2f906..4b4401ace 100644 --- a/roles/custom/matrix-bot-baibot/defaults/main.yml +++ b/roles/custom/matrix-bot-baibot/defaults/main.yml @@ -11,7 +11,7 @@ matrix_bot_baibot_container_repo_version: "{{ 'main' if matrix_bot_baibot_versio matrix_bot_baibot_container_src_files_path: "{{ matrix_base_data_path }}/baibot/container-src" # renovate: datasource=docker depName=ghcr.io/etkecc/baibot -matrix_bot_baibot_version: latest +matrix_bot_baibot_version: v1.1.1 matrix_bot_baibot_container_image: "{{ matrix_bot_baibot_container_image_name_prefix }}etkecc/baibot:{{ matrix_bot_baibot_version }}" matrix_bot_baibot_container_image_name_prefix: "{{ 'localhost/' if matrix_bot_baibot_container_image_self_build else 'ghcr.io/' }}" matrix_bot_baibot_container_image_force_pull: "{{ matrix_bot_baibot_container_image.endswith(':latest') }}" @@ -155,6 +155,7 @@ matrix_bot_baibot_config_agents_static_definitions_auto: |- }} matrix_bot_baibot_config_agents_static_definitions_custom: [] +matrix_bot_baibot_config_agents_static_definitions_prompt: "{% raw %}You are a brief, but helpful bot called {{ baibot_name }} powered by the {{ baibot_model_id }} model. The date/time now is: {{ baibot_now_utc }}.{% endraw %}" ######################################################################################## # # @@ -195,7 +196,7 @@ matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generat matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_model_id: claude-3-5-sonnet-20240620 # The prompt text to use (can be null or empty to not use a prompt). # See: https://huggingface.co/docs/transformers/en/tasks/prompting -matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_prompt: null +matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" # The temperature parameter controls the randomness of the generated text. # See: https://blogs.novita.ai/what-are-large-language-model-settings-temperature-top-p-and-max-tokens/#what-is-llm-temperature matrix_bot_baibot_config_agents_static_definitions_anthropic_config_text_generation_temperature: 1.0 @@ -248,7 +249,7 @@ matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_e matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_model_id: "" # The prompt text to use (can be null or empty to not use a prompt). # See: https://huggingface.co/docs/transformers/en/tasks/prompting -matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_prompt: null +matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" # The temperature parameter controls the randomness of the generated text. # See: https://blogs.novita.ai/what-are-large-language-model-settings-temperature-top-p-and-max-tokens/#what-is-llm-temperature matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_temperature: 1.0 @@ -267,7 +268,7 @@ matrix_bot_baibot_config_agents_static_definitions_groq_config_speech_to_text_mo ######################################################################################## # # -# Mistral agent configuration # +# Mistral agent configuration # # # ######################################################################################## @@ -304,7 +305,7 @@ matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generatio matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_model_id: mistral-large-latest # The prompt text to use (can be null or empty to not use a prompt). # See: https://huggingface.co/docs/transformers/en/tasks/prompting -matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_prompt: null +matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" # The temperature parameter controls the randomness of the generated text. # See: https://blogs.novita.ai/what-are-large-language-model-settings-temperature-top-p-and-max-tokens/#what-is-llm-temperature matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_temperature: 1.0 @@ -313,7 +314,7 @@ matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generatio ######################################################################################## # # -# /Mistral agent configuration # +# /Mistral agent configuration # # # ######################################################################################## @@ -358,7 +359,7 @@ matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_model_id: gpt-4o # The prompt text to use (can be null or empty to not use a prompt). # See: https://huggingface.co/docs/transformers/en/tasks/prompting -matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_prompt: null +matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" # The temperature parameter controls the randomness of the generated text. # See: https://blogs.novita.ai/what-are-large-language-model-settings-temperature-top-p-and-max-tokens/#what-is-llm-temperature matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_temperature: 1.0 From 032809a053ed38974114cee1e24af6daf2bbf92b Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 22 Sep 2024 12:20:26 +0300 Subject: [PATCH 24/27] Adjust default openai model id for baibot (`gpt-4o` -> gpt-4o-2024-08-06) `gpt-4o` will point to `gpt-4o-2024-08-06` after 2nd of October 2024 anyway. At that time, we can revert to pointing to `gpt-4o`. The reason `gpt-4o-2024-08-06` was chosen now instead of `gpt-4o`: - the `max_response_tokens` configuration was set to 16k, which matches `gpt-4o-2024-08-06`, but is too large for `gpt-4o` (max 4k) - baibot's own configs for dynamically created agents, as well as static config examples use `gpt-4o-2024-08-06` and the larger `max_response_tokens` value --- docs/configuring-playbook-bot-baibot.md | 2 +- roles/custom/matrix-bot-baibot/defaults/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/configuring-playbook-bot-baibot.md b/docs/configuring-playbook-bot-baibot.md index 6024015e5..6397584fe 100644 --- a/docs/configuring-playbook-bot-baibot.md +++ b/docs/configuring-playbook-bot-baibot.md @@ -249,7 +249,7 @@ matrix_bot_baibot_config_agents_static_definitions_openai_config_api_key: "YOUR_ # matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" # If you'd like to use another text-generation agent, uncomment and adjust: -# matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_model_id: gpt-4o +# matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_model_id: gpt-4o-2024-08-06 # See `defaults/main.yml` in the baibot role for more configuration options. ``` diff --git a/roles/custom/matrix-bot-baibot/defaults/main.yml b/roles/custom/matrix-bot-baibot/defaults/main.yml index 4b4401ace..d8005b4f7 100644 --- a/roles/custom/matrix-bot-baibot/defaults/main.yml +++ b/roles/custom/matrix-bot-baibot/defaults/main.yml @@ -356,7 +356,7 @@ matrix_bot_baibot_config_agents_static_definitions_openai_config_api_key: "" matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_enabled: true # For valid model choices, see: https://platform.openai.com/docs/models -matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_model_id: gpt-4o +matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_model_id: gpt-4o-2024-08-06 # The prompt text to use (can be null or empty to not use a prompt). # See: https://huggingface.co/docs/transformers/en/tasks/prompting matrix_bot_baibot_config_agents_static_definitions_openai_config_text_generation_prompt: "{{ matrix_bot_baibot_config_agents_static_definitions_prompt }}" From 7cbef06c4f4102a48c22a60f2c9f9afb560b8b0b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:18:25 +0000 Subject: [PATCH 25/27] Update vectorim/element-web Docker tag to v1.11.78 --- roles/custom/matrix-client-element/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-client-element/defaults/main.yml b/roles/custom/matrix-client-element/defaults/main.yml index b3c1449e7..01c062a83 100644 --- a/roles/custom/matrix-client-element/defaults/main.yml +++ b/roles/custom/matrix-client-element/defaults/main.yml @@ -11,7 +11,7 @@ matrix_client_element_container_image_self_build_repo: "https://github.com/eleme matrix_client_element_container_image_self_build_low_memory_system_patch_enabled: "{{ ansible_memtotal_mb < 4096 }}" # renovate: datasource=docker depName=vectorim/element-web -matrix_client_element_version: v1.11.77 +matrix_client_element_version: v1.11.78 matrix_client_element_docker_image: "{{ matrix_client_element_docker_image_name_prefix }}vectorim/element-web:{{ matrix_client_element_version }}" matrix_client_element_docker_image_name_prefix: "{{ 'localhost/' if matrix_client_element_container_image_self_build else matrix_container_global_registry_prefix }}" From 338e6d91c31af737fd636fccc6b6183bee8500b1 Mon Sep 17 00:00:00 2001 From: Aine <97398200+aine-etke@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:58:17 +0300 Subject: [PATCH 26/27] synapse-admin v0.10.3-etke16: Upgrade to react-admin v5, restrict actions on specific users (#3543) * synapse-admin v0.10.3-etke15: Upgrade to react-admin v5 * v0.10.3-etke16 * fix linter * add _auto and _custom vars * Use 2 spaces before #noqa var-naming --------- Co-authored-by: Slavi Pantaleev --- .../matrix-synapse-admin/defaults/main.yml | 22 ++++++++++++++++++- .../templates/config.json.j2 | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-synapse-admin/defaults/main.yml b/roles/custom/matrix-synapse-admin/defaults/main.yml index d02d65a6f..ea4edabb0 100644 --- a/roles/custom/matrix-synapse-admin/defaults/main.yml +++ b/roles/custom/matrix-synapse-admin/defaults/main.yml @@ -14,7 +14,7 @@ matrix_synapse_admin_container_image_self_build: false matrix_synapse_admin_container_image_self_build_repo: "https://github.com/etkecc/synapse-admin.git" # renovate: datasource=docker depName=ghcr.io/etkecc/synapse-admin -matrix_synapse_admin_version: v0.10.3-etke14 +matrix_synapse_admin_version: v0.10.3-etke16 matrix_synapse_admin_docker_image: "{{ matrix_synapse_admin_docker_image_name_prefix }}etkecc/synapse-admin:{{ matrix_synapse_admin_version }}" matrix_synapse_admin_docker_image_name_prefix: "{{ 'localhost/' if matrix_synapse_admin_container_image_self_build else 'ghcr.io/' }}" matrix_synapse_admin_docker_image_force_pull: "{{ matrix_synapse_admin_docker_image.endswith(':latest') }}" @@ -174,3 +174,23 @@ matrix_synapse_admin_configuration: "{{ matrix_synapse_admin_configuration_defau # Controls the restrictBaseUrl configuration setting, which, if defined, # restricts the homeserver(s), so that the user can no longer define a homeserver manually during login. matrix_synapse_admin_config_restrictBaseUrl: "{{ [matrix_homeserver_url] }}" # noqa var-naming + +# Controls the asManagedUsers configuration setting (managed by playbook), which, if defined, +# restricts modifications of the specified users (e.g., bridge-managed). +# You should use JS regex syntax to match the user IDs. +# Example for mautrix-telegram: ["^@telegram_[a-zA-Z0-9]+:example\\.com$"] +# WARNING: you want to use matrix_synapse_admin_config_asManagedUsers_custom instead of this variable. +matrix_synapse_admin_config_asManagedUsers_auto: [] # noqa var-naming + +# Controls the asManagedUsers configuration setting (managed per host), which, if defined, +# restricts modifications of the specified users (e.g., bridge-managed). +# You should use JS regex syntax to match the user IDs. +# Example for mautrix-telegram: ["^@telegram_[a-zA-Z0-9]+:example\\.com$"] +matrix_synapse_admin_config_asManagedUsers_custom: [] # noqa var-naming + +# Controls the asManagedUsers configuration setting, which, if defined, +# restricts modifications of the specified users (e.g., bridge-managed). +# You should use JS regex syntax to match the user IDs. +# Example for mautrix-telegram: ["^@telegram_[a-zA-Z0-9]+:example\\.com$"] +# WARNING: you want to use matrix_synapse_admin_config_asManagedUsers_custom instead of this variable. +matrix_synapse_admin_config_asManagedUsers: "{{ matrix_synapse_admin_config_asManagedUsers_auto + matrix_synapse_admin_config_asManagedUsers_custom }}" # noqa var-naming diff --git a/roles/custom/matrix-synapse-admin/templates/config.json.j2 b/roles/custom/matrix-synapse-admin/templates/config.json.j2 index dbd32d6d4..dcf44aeb6 100644 --- a/roles/custom/matrix-synapse-admin/templates/config.json.j2 +++ b/roles/custom/matrix-synapse-admin/templates/config.json.j2 @@ -1,3 +1,4 @@ { - "restrictBaseUrl": {{ matrix_synapse_admin_config_restrictBaseUrl | to_json }} + "restrictBaseUrl": {{ matrix_synapse_admin_config_restrictBaseUrl | to_json }}, + "asManagedUsers": {{ matrix_synapse_admin_config_asManagedUsers | to_json }} } From f657273cc84880057136517e7d086b2770e7d83c Mon Sep 17 00:00:00 2001 From: Aine <97398200+aine-etke@users.noreply.github.com> Date: Tue, 24 Sep 2024 21:37:03 +0300 Subject: [PATCH 27/27] add system-managed users to synapse-admin (#3546) * WIP: add system-managed users to synapse-admin * add missing users --- group_vars/matrix_servers | 185 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index e6686c253..7d3223ab9 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -4791,6 +4791,191 @@ matrix_synapse_admin_container_labels_traefik_docker_network: "{{ matrix_playboo matrix_synapse_admin_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" matrix_synapse_admin_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" +matrix_synapse_admin_config_asManagedUsers_auto: | + {{ + ([ + '^@'+(matrix_alertmanager_receiver_config_matrix_user_id_localpart | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_alertmanager_receiver_enabled else []) + + + ([ + '^@'+(matrix_appservice_draupnir_for_all_user_prefix | default('') | regex_escape) +'_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_appservice_draupnir_for_all_enabled else []) + + + ([ + '^@'+(matrix_bot_baibot_config_user_mxid_localpart | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_bot_baibot_enabled else []) + + + ([ + '^@'+(matrix_bot_buscarron_login | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_bot_buscarron_enabled else []) + + + ([ + '^@'+(matrix_bot_chatgpt_matrix_bot_username_localpart | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_bot_chatgpt_enabled else []) + + + ([ + '^@'+(matrix_bot_honoroit_login | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_bot_honoroit_enabled else []) + + + ([ + '^@'+(matrix_bot_matrix_registration_bot_matrix_user_id_localpart | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_bot_matrix_registration_bot_enabled else []) + + + ([ + '^@'+(matrix_bot_matrix_reminder_bot_matrix_user_id_localpart | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_bot_matrix_reminder_bot_enabled else []) + + + ([ + '^@'+(matrix_bot_maubot_login | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_bot_maubot_enabled else []) + + + ([ + '^@'+(matrix_bot_postmoogle_login | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$', + ] if matrix_bot_postmoogle_enabled else []) + + + ([ + '^@_discord_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_appservice_discord_enabled else []) + + + ([ + '^@'+(matrix_appservice_slack_bot_name | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@'+(matrix_appservice_slack_user_prefix | default('') | regex_escape)+'[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_appservice_slack_enabled else []) + + + ([ + '^@'+(matrix_appservice_webhooks_bot_name | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@'+(matrix_appservice_webhooks_user_prefix | default('') | regex_escape)+'[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_appservice_webhooks_enabled else []) + + + ([ + '^@'+(matrix_beeper_linkedin_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@linkedin_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_beeper_linkedin_enabled else []) + + + ([ + '^@'+(matrix_go_skype_bridge_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@skype_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_go_skype_bridge_enabled else []) + + + ([ + '^@heisenbridge:'+(matrix_domain | regex_escape)+'$', + '^@hbirc_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_heisenbridge_enabled else []) + + + ([ + '^@hookshot:'+(matrix_domain | regex_escape)+'$', + '^@_github_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + '^@_gitlab_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + '^@_jira_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + '^@'+(matrix_hookshot_generic_userIdPrefix | default('') | regex_escape)+'[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_hookshot_enabled else []) + + + ([ + '^@'+(matrix_mautrix_discord_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@discord_[0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_discord_enabled else []) + + + ([ + '^@'+(matrix_mautrix_facebook_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@facebook_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_facebook_enabled else []) + + + ([ + '^@'+(matrix_mautrix_gmessages_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@gmessages_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_gmessages_enabled else []) + + + ([ + '^@'+(matrix_mautrix_googlechat_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@googlechat_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_googlechat_enabled else []) + + + ([ + '^@'+(matrix_mautrix_hangouts_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@hangouts_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_hangouts_enabled else []) + + + ([ + '^@'+(matrix_mautrix_instagram_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@instagram_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_instagram_enabled else []) + + + ([ + '^@'+(matrix_mautrix_meta_instagram_appservice_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@'+(matrix_mautrix_meta_instagram_bridge_username_prefix | default('') | regex_escape)+'[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_meta_instagram_enabled else []) + + + ([ + '^@'+(matrix_mautrix_meta_messenger_appservice_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@'+(matrix_mautrix_meta_messenger_bridge_username_prefix | default('') | regex_escape)+'[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_meta_messenger_enabled else []) + + + ([ + '^@'+(matrix_mautrix_signal_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@signal_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_signal_enabled else []) + + + ([ + '^@'+(matrix_mautrix_slack_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@slack_[a-zA-Z0-9\-]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_slack_enabled else []) + + + ([ + '^@'+(matrix_mautrix_telegram_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@telegram_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_telegram_enabled else []) + + + ([ + '^@'+(matrix_mautrix_twitter_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@twitter_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_twitter_enabled else []) + + + ([ + '^@'+(matrix_mautrix_whatsapp_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@whatsapp_[0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_whatsapp_enabled else []) + + + ([ + '^@'+(matrix_mautrix_imessage_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@imessage_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mautrix_wsproxy_enabled else []) + + + ([ + '^@_discordpuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mx_puppet_discord_enabled else []) + + + ([ + '^@_groupmepuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mx_puppet_groupme_enabled else []) + + + ([ + '^@_instagrampuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mx_puppet_instagram_enabled else []) + + + ([ + '^@_slackpuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mx_puppet_slack_enabled else []) + + + ([ + '^@_steampuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mx_puppet_steam_enabled else []) + + + ([ + '^@'+(matrix_mx_puppet_twitter_bot_localpart | default('') | regex_escape)+':'+ (matrix_domain | regex_escape)+'$', + '^@'+(matrix_mx_puppet_twitter_namespace_prefix | default('') | regex_escape)+'[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_mx_puppet_twitter_enabled else []) + + + ([ + '^@smsbot:'+(matrix_domain | regex_escape)+'$', + '^@sms_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_sms_bridge_enabled else []) + + + ([ + '^@'+(matrix_wechat_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@_wechat_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', + ] if matrix_wechat_enabled else []) + }} + ###################################################################### # # /matrix-synapse-admin