diff --git a/CHANGELOG.md b/CHANGELOG.md index e960fd870..997574d5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The playbook will let you know if you're using any `matrix_appservice_webhooks_*` variables. You'll need to remove them from `vars.yml` and potentially [uninstall the bridge manually](./docs/configuring-playbook-bridge-appservice-webhooks.md#uninstalling-the-bridge-manually). +## mautrix-facebook has been removed from the playbook + +[mautrix-facebook](./docs/configuring-playbook-bridge-mautrix-facebook.md) has been removed from the playbook, as it has been deprecated in favor of the [mautrix-meta](https://github.com/mautrix/meta) Messenger/Instagram bridge. + +The playbook will let you know if you're using any `matrix_mautrix_facebook_*` variables. You'll need to remove them from `vars.yml` and potentially [uninstall the bridge manually](./docs/configuring-playbook-bridge-mautrix-facebook.md#uninstalling-the-bridge-manually). + # 2025-11-08 ## MatrixZulipBridge support diff --git a/docs/configuring-playbook-bridge-mautrix-bridges.md b/docs/configuring-playbook-bridge-mautrix-bridges.md index 7c2e15e80..54a9116c8 100644 --- a/docs/configuring-playbook-bridge-mautrix-bridges.md +++ b/docs/configuring-playbook-bridge-mautrix-bridges.md @@ -24,7 +24,7 @@ To enable the bridge, add the following configuration to your `inventory/host_va matrix_mautrix_SERVICENAME_enabled: true ``` -**Note**: for bridging to Meta's Messenger or Instagram, you would need to add `meta` with an underscore symbol (`_`) or hyphen (`-`) based on the context as prefix to each `SERVICENAME`; add `_` to variables (as in `matrix_mautrix_meta_messenger_configuration_extension_yaml` for example) and `-` to paths of the configuration files (as in `roles/custom/matrix-bridge-mautrix-meta-messenger/templates/config.yaml.j2`), respectively. **`matrix_mautrix_facebook_*` and `matrix_mautrix_instagram_*` variables belong to the deprecated components and do not control the new bridge** ([mautrix-meta](https://github.com/mautrix/meta)), which can be [installed using this playbook](configuring-playbook-bridge-mautrix-meta-messenger.md). +**Note**: for bridging to Meta's Messenger or Instagram, you would need to add `meta` with an underscore symbol (`_`) or hyphen (`-`) based on the context as prefix to each `SERVICENAME`; add `_` to variables (as in `matrix_mautrix_meta_messenger_configuration_extension_yaml` for example) and `-` to paths of the configuration files (as in `roles/custom/matrix-bridge-mautrix-meta-messenger/templates/config.yaml.j2`), respectively. **`matrix_mautrix_instagram_*` variables belong to the deprecated component and do not control the new bridge** ([mautrix-meta](https://github.com/mautrix/meta)), which can be [installed using this playbook](configuring-playbook-bridge-mautrix-meta-messenger.md). There are some additional things you may wish to configure about the bridge before you continue. Each bridge may have additional requirements besides `_enabled: true`. For example, the mautrix-telegram bridge (our documentation page about it is [here](configuring-playbook-bridge-mautrix-telegram.md)) requires the `matrix_mautrix_telegram_api_id` and `matrix_mautrix_telegram_api_hash` variables to be defined. Refer to each bridge's individual documentation page for details about enabling bridges. diff --git a/docs/configuring-playbook-bridge-mautrix-facebook.md b/docs/configuring-playbook-bridge-mautrix-facebook.md index d79977a7c..02ffa57c4 100644 --- a/docs/configuring-playbook-bridge-mautrix-facebook.md +++ b/docs/configuring-playbook-bridge-mautrix-facebook.md @@ -1,100 +1,32 @@ -# Setting up Mautrix Facebook bridging (optional, deprecated) +# Setting up Mautrix Facebook bridging (optional, removed) -Refer the common guide for configuring mautrix bridges: [Setting up a Generic Mautrix Bridge](configuring-playbook-bridge-mautrix-bridges.md) +🪦 The playbook used to be able to install and configure [mautrix-facebook](https://github.com/mautrix/facebook), but no longer includes this component, as it has been deprecated in favor of the [mautrix-meta](https://github.com/mautrix/meta) Messenger/Instagram bridge. -**Note**: This bridge has been deprecated in favor of the [mautrix-meta](https://github.com/mautrix/meta) Messenger/Instagram bridge, which can be [installed using this playbook](configuring-playbook-bridge-mautrix-meta-messenger.md). Consider using that bridge instead of this one. +The mautrix-meta bridge can be [installed using this playbook](configuring-playbook-bridge-mautrix-meta-messenger.md). -The playbook can install and configure [mautrix-facebook](https://github.com/mautrix/facebook) for you. +## Uninstalling the bridge manually -See the project's [documentation](https://github.com/mautrix/facebook/blob/master/README.md) to learn what it does and why it might be useful to you. - -## Prerequisite (optional) - -### Enable Shared Secret Auth - -If you want to set up [Double Puppeting](https://docs.mau.fi/bridges/general/double-puppeting.html) (hint: you most likely do) for this bridge automatically, you need to have enabled [Shared Secret Auth](configuring-playbook-shared-secret-auth.md) for this playbook. - -See [this section](configuring-playbook-bridge-mautrix-bridges.md#set-up-double-puppeting-optional) on the [common guide for configuring mautrix bridges](configuring-playbook-bridge-mautrix-bridges.md) for details about setting up Double Puppeting. - -**Note**: double puppeting with the Shared Secret Auth works at the time of writing, but is deprecated and will stop working in the future. - -## Adjusting the playbook configuration - -To enable the bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: - -```yaml -matrix_mautrix_facebook_enabled: true -``` - -### Extending the configuration - -There are some additional things you may wish to configure about the bridge. - -See [this section](configuring-playbook-bridge-mautrix-bridges.md#extending-the-configuration) on the [common guide for configuring mautrix bridges](configuring-playbook-bridge-mautrix-bridges.md) for details about variables that you can customize and the bridge's default configuration, including [bridge permissions](configuring-playbook-bridge-mautrix-bridges.md#configure-bridge-permissions-optional), [encryption support](configuring-playbook-bridge-mautrix-bridges.md#enable-encryption-optional), [relay mode](configuring-playbook-bridge-mautrix-bridges.md#enable-relay-mode-optional), [bot's username](configuring-playbook-bridge-mautrix-bridges.md#set-the-bots-username-optional), etc. - -## Installing - -After configuring the playbook, run it with [playbook tags](playbook-tags.md) as below: - - -```sh -ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start -``` - -The shortcut commands with the [`just` program](just.md) are also available: `just install-all` or `just setup-all` - -`just install-all` is useful for maintaining your setup quickly ([2x-5x faster](../CHANGELOG.md#2x-5x-performance-improvements-in-playbook-runtime) than `just setup-all`) when its components remain unchanged. If you adjust your `vars.yml` to remove other components, you'd need to run `just setup-all`, or these components will still remain installed. Note these shortcuts run the `ensure-matrix-users-created` tag too. - -## Usage - -To use the bridge, you need to start a chat with `@facebookbot:example.com` (where `example.com` is your base domain, not the `matrix.` domain). - -You then need to send `login YOUR_FACEBOOK_EMAIL_ADDRESS` to the bridge bot to enable bridging for your Facebook Messenger account. - -If you run into trouble, check the [Troubleshooting](#troubleshooting) section below. - -## Troubleshooting - -As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-mautrix-facebook`. - -### Increase logging verbosity - -The default logging level for this component is `WARNING`. If you want to increase the verbosity, add the following configuration to your `vars.yml` file and re-run the playbook: - -```yaml -matrix_mautrix_facebook_logging_level: DEBUG -``` - -### Facebook rejecting login attempts and forcing you to change password - -If your Matrix server is in a wildly different location than where you usually use your Facebook account from, the bridge's login attempts may be outright rejected by Facebook. Along with that, Facebook may even force you to change the account's password. - -If you happen to run into this problem while [setting up bridging](#usage), try to first get a successful session up by logging in to Facebook through the Matrix server's IP address. - -The easiest way to do this may be to use [sshuttle](https://sshuttle.readthedocs.io/) to proxy your traffic through the Matrix server. - -Example command for proxying your traffic through the Matrix server: +If you still have the bridge installed on your Matrix server, the playbook can no longer help you uninstall it and you will need to do it manually. To uninstall manually, run these commands on the server: ```sh -sshuttle -r root@matrix.example.com:22 0/0 +systemctl disable --now matrix-mautrix-facebook.service + +rm -rf /matrix/mautrix-facebook + +/matrix/postgres/bin/cli-non-interactive 'DROP DATABASE matrix_mautrix_facebook;' ``` - -Once connected, you should be able to verify that you're browsing the web through the Matrix server's IP by checking [icanhazip](https://icanhazip.com/). - -Then proceed to log in to [Facebook/Messenger](https://www.facebook.com/). - -Once logged in, proceed to [set up bridging](#usage). - -If that doesn't work, enable 2FA (see: [Facebook help page on enabling 2FA](https://www.facebook.com/help/148233965247823)) and try to login again with a new password, and entering the 2FA code when prompted, it may take more then one try, in between attempts, check facebook.com to see if they are requiring another password change diff --git a/docs/self-building.md b/docs/self-building.md index 997f91adb..74252dbb2 100644 --- a/docs/self-building.md +++ b/docs/self-building.md @@ -40,7 +40,6 @@ Possibly outdated list of roles where self-building the Docker image is currentl - `matrix-bridge-appservice-irc` - `matrix-bridge-appservice-slack` - `matrix-bridge-beeper-linkedin` -- `matrix-bridge-mautrix-facebook` - `matrix-bridge-mautrix-googlechat` - `matrix-bridge-mautrix-telegram` - `matrix-bridge-mautrix-signal` diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index a1c11cfde..332182073 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -122,8 +122,6 @@ matrix_homeserver_container_extra_arguments_auto: | + (['--mount type=bind,src=' + matrix_mautrix_slack_config_path + '/registration.yaml,dst=/matrix-mautrix-slack-registration.yaml,ro'] if matrix_mautrix_slack_enabled else []) + - (['--mount type=bind,src=' + matrix_mautrix_facebook_config_path + '/registration.yaml,dst=/matrix-mautrix-facebook-registration.yaml,ro'] if matrix_mautrix_facebook_enabled else []) - + (['--mount type=bind,src=' + matrix_mautrix_googlechat_config_path + '/registration.yaml,dst=/matrix-mautrix-googlechat-registration.yaml,ro'] if matrix_mautrix_googlechat_enabled else []) + (['--mount type=bind,src=' + matrix_mautrix_instagram_config_path + '/registration.yaml,dst=/matrix-mautrix-instagram-registration.yaml,ro'] if matrix_mautrix_instagram_enabled else []) @@ -187,8 +185,6 @@ matrix_homeserver_app_service_config_files_auto: | + (['/matrix-mautrix-slack-registration.yaml'] if matrix_mautrix_slack_enabled else []) + - (['/matrix-mautrix-facebook-registration.yaml'] if matrix_mautrix_facebook_enabled else []) - + (['/matrix-mautrix-googlechat-registration.yaml'] if matrix_mautrix_googlechat_enabled else []) + (['/matrix-mautrix-instagram-registration.yaml'] if matrix_mautrix_instagram_enabled else []) @@ -321,8 +317,6 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': 'matrix-mautrix-slack.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-slack']}] if matrix_mautrix_slack_enabled else []) + - ([{'name': 'matrix-mautrix-facebook.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-facebook']}] if matrix_mautrix_facebook_enabled else []) - + ([{'name': 'matrix-mautrix-googlechat.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-googlechat']}] if matrix_mautrix_googlechat_enabled else []) + ([{'name': 'matrix-mautrix-instagram.service', 'priority': 2000, 'groups': ['matrix', 'bridges', 'mautrix-instagram']}] if matrix_mautrix_instagram_enabled else []) @@ -1199,85 +1193,6 @@ matrix_mautrix_slack_public_media_signing_key: "{{ '%s' | format(matrix_homeserv # ###################################################################### - -###################################################################### -# -# matrix-bridge-mautrix-facebook -# -###################################################################### - -# We don't enable bridges by default. -matrix_mautrix_facebook_enabled: false - -matrix_mautrix_facebook_systemd_required_services_list_auto: | - {{ - matrix_addons_homeserver_systemd_services_list - + - ([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_mautrix_facebook_database_hostname == postgres_connection_hostname) else []) - }} - -matrix_mautrix_facebook_docker_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_mautrix_facebook_docker_image_registry_prefix_upstream_default }}" - -matrix_mautrix_facebook_container_image_self_build: "{{ matrix_architecture not in ['amd64', 'arm64'] }}" - -matrix_mautrix_facebook_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '9008') if matrix_playbook_service_host_bind_interface_prefix else '' }}" - -matrix_mautrix_facebook_container_network: "{{ matrix_addons_container_network }}" - -matrix_mautrix_facebook_container_additional_networks_auto: |- - {{ - ( - ([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network]) - + - ([postgres_container_network] if (postgres_enabled and matrix_mautrix_facebook_database_hostname == postgres_connection_hostname and matrix_mautrix_facebook_container_network != postgres_container_network) else []) - + - ([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_playbook_reverse_proxyable_services_additional_network and matrix_mautrix_facebook_container_labels_traefik_enabled) else []) - ) | unique - }} - -matrix_mautrix_facebook_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" -matrix_mautrix_facebook_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" -matrix_mautrix_facebook_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}" -matrix_mautrix_facebook_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}" - -matrix_mautrix_facebook_container_labels_metrics_middleware_basic_auth_enabled: "{{ matrix_metrics_exposure_http_basic_auth_enabled }}" -matrix_mautrix_facebook_container_labels_metrics_middleware_basic_auth_users: "{{ matrix_metrics_exposure_http_basic_auth_users }}" - -matrix_mautrix_facebook_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'fb.as.token', rounds=655555) | to_uuid }}" - -matrix_mautrix_facebook_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}" - -matrix_mautrix_facebook_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'fb.hs.token', rounds=655555) | to_uuid }}" - -matrix_mautrix_facebook_homeserver_async_media: "{{ matrix_homeserver_implementation in ['synapse'] }}" - -matrix_mautrix_facebook_appservice_public_enabled: true -matrix_mautrix_facebook_appservice_public_hostname: "{{ matrix_server_fqn_matrix }}" -matrix_mautrix_facebook_appservice_public_prefix: "/{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'facebook', rounds=655555) | to_uuid }}" - -matrix_mautrix_facebook_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" - -matrix_mautrix_facebook_bridge_presence: "{{ (matrix_synapse_presence_enabled if matrix_synapse_enabled else true) if matrix_homeserver_implementation == 'synapse' else true }}" - -matrix_mautrix_facebook_metrics_enabled: "{{ prometheus_enabled or matrix_metrics_exposure_enabled }}" - -matrix_mautrix_facebook_metrics_proxying_enabled: "{{ matrix_mautrix_facebook_metrics_enabled and matrix_metrics_exposure_enabled }}" -matrix_mautrix_facebook_metrics_proxying_hostname: "{{ matrix_metrics_exposure_hostname }}" -matrix_mautrix_facebook_metrics_proxying_path_prefix: "{{ matrix_metrics_exposure_path_prefix }}/mautrix-facebook" - -# We'd like to force-set people with external Postgres to SQLite, so the bridge role can complain -# and point them to a migration path. -matrix_mautrix_facebook_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}" -matrix_mautrix_facebook_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}" -matrix_mautrix_facebook_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mau.fb.db', rounds=655555) | to_uuid }}" - -###################################################################### -# -# /matrix-bridge-mautrix-facebook -# -###################################################################### - - ###################################################################### # # matrix-bridge-mautrix-googlechat @@ -4025,12 +3940,6 @@ postgres_managed_databases_auto: | 'password': matrix_mautrix_bluesky_database_password, }] if (matrix_mautrix_bluesky_enabled and matrix_mautrix_bluesky_database_engine == 'postgres' and matrix_mautrix_bluesky_database_hostname == postgres_connection_hostname) else []) + - ([{ - 'name': matrix_mautrix_facebook_database_name, - 'username': matrix_mautrix_facebook_database_username, - 'password': matrix_mautrix_facebook_database_password, - }] if (matrix_mautrix_facebook_enabled and matrix_mautrix_facebook_database_engine == 'postgres' and matrix_mautrix_facebook_database_hostname == postgres_connection_hostname) else []) - + ([{ 'name': matrix_mautrix_googlechat_database_name, 'username': matrix_mautrix_googlechat_database_username, @@ -4935,11 +4844,6 @@ matrix_synapse_admin_config_asManagedUsers_auto: | '^@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)+'$', diff --git a/roles/custom/matrix-bridge-mautrix-facebook/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-facebook/defaults/main.yml deleted file mode 100644 index 0468d92d5..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/defaults/main.yml +++ /dev/null @@ -1,227 +0,0 @@ -# SPDX-FileCopyrightText: 2019 - 2024 Slavi Pantaleev -# SPDX-FileCopyrightText: 2020 Horvath Gergely -# SPDX-FileCopyrightText: 2020 Marcel Partap -# SPDX-FileCopyrightText: 2021 - 2024 MDAD project contributors -# SPDX-FileCopyrightText: 2021 Aaron Raimist -# SPDX-FileCopyrightText: 2021 Arthur Brugière -# SPDX-FileCopyrightText: 2022 - 2023 Nikita Chernyi -# SPDX-FileCopyrightText: 2022 László Várady -# SPDX-FileCopyrightText: 2022 Marko Weltzer -# SPDX-FileCopyrightText: 2023 Adrien le Maire -# SPDX-FileCopyrightText: 2023 Samuel Meenzen -# -# SPDX-License-Identifier: AGPL-3.0-or-later - ---- -# mautrix-facebook is a Matrix <-> Facebook bridge -# Project source code URL: https://github.com/mautrix/facebook - -matrix_mautrix_facebook_enabled: true - -matrix_mautrix_facebook_container_image_self_build: false -matrix_mautrix_facebook_container_image_self_build_repo: "https://mau.dev/mautrix/facebook.git" - -# renovate: datasource=docker depName=dock.mau.dev/mautrix/facebook -matrix_mautrix_facebook_version: v0.5.1 -matrix_mautrix_facebook_docker_image: "{{ matrix_mautrix_facebook_docker_image_registry_prefix }}mautrix/facebook:{{ matrix_mautrix_facebook_version }}" -matrix_mautrix_facebook_docker_image_registry_prefix: "{{ 'localhost/' if matrix_mautrix_facebook_container_image_self_build else matrix_mautrix_facebook_docker_image_registry_prefix_upstream }}" -matrix_mautrix_facebook_docker_image_registry_prefix_upstream: "{{ matrix_mautrix_facebook_docker_image_registry_prefix_upstream_default }}" -matrix_mautrix_facebook_docker_image_registry_prefix_upstream_default: "dock.mau.dev/" -matrix_mautrix_facebook_docker_image_force_pull: "{{ matrix_mautrix_facebook_docker_image.endswith(':latest') }}" - -matrix_mautrix_facebook_base_path: "{{ matrix_base_data_path }}/mautrix-facebook" -matrix_mautrix_facebook_config_path: "{{ matrix_mautrix_facebook_base_path }}/config" -matrix_mautrix_facebook_data_path: "{{ matrix_mautrix_facebook_base_path }}/data" -matrix_mautrix_facebook_docker_src_files_path: "{{ matrix_mautrix_facebook_base_path }}/docker-src" - -matrix_mautrix_facebook_command_prefix: "!fb" - -matrix_mautrix_facebook_homeserver_address: "" -# Whether asynchronous uploads via MSC2246 should be enabled for media. -# Requires a homeserver that supports MSC2246 (https://github.com/matrix-org/matrix-spec-proposals/pull/2246). -matrix_mautrix_facebook_homeserver_async_media: false -matrix_mautrix_facebook_homeserver_domain: '{{ matrix_domain }}' - -# Whether or not the public-facing endpoints should be enabled (web-based login) -matrix_mautrix_facebook_appservice_public_enabled: false -# Mautrix Facebook public endpoint to log in to Facebook -matrix_mautrix_facebook_appservice_public_prefix: '' -matrix_mautrix_facebook_appservice_public_hostname: '' -matrix_mautrix_facebook_appservice_public_external: "{{ ('https://' + matrix_mautrix_facebook_appservice_public_hostname + matrix_mautrix_facebook_appservice_public_prefix) if matrix_mautrix_facebook_appservice_public_enabled else '' }}" - -matrix_mautrix_facebook_appservice_address: 'http://matrix-mautrix-facebook:29319' - -matrix_mautrix_facebook_container_network: "" - -matrix_mautrix_facebook_container_additional_networks: "{{ matrix_mautrix_facebook_container_additional_networks_auto + matrix_mautrix_facebook_container_additional_networks_custom }}" -matrix_mautrix_facebook_container_additional_networks_auto: [] -matrix_mautrix_facebook_container_additional_networks_custom: [] - -# matrix_mautrix_facebook_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. -# See `../templates/labels.j2` for details. -# -# To inject your own other container labels, see `matrix_mautrix_facebook_container_labels_additional_labels`. -matrix_mautrix_facebook_container_labels_traefik_enabled: true -matrix_mautrix_facebook_container_labels_traefik_docker_network: "{{ matrix_mautrix_facebook_container_network }}" -matrix_mautrix_facebook_container_labels_traefik_entrypoints: web-secure -matrix_mautrix_facebook_container_labels_traefik_tls_certResolver: default # noqa var-naming - -# Controls whether labels will be added that expose mautrix-facebook's public endpoint -matrix_mautrix_facebook_container_labels_public_endpoint_enabled: "{{ matrix_mautrix_facebook_appservice_public_enabled }}" -matrix_mautrix_facebook_container_labels_public_endpoint_traefik_rule: "Host(`{{ matrix_mautrix_facebook_appservice_public_hostname }}`) && PathPrefix(`{{ matrix_mautrix_facebook_appservice_public_prefix }}`)" -matrix_mautrix_facebook_container_labels_public_endpoint_traefik_priority: 0 -matrix_mautrix_facebook_container_labels_public_endpoint_traefik_entrypoints: "{{ matrix_mautrix_facebook_container_labels_traefik_entrypoints }}" -matrix_mautrix_facebook_container_labels_public_endpoint_traefik_tls: "{{ matrix_mautrix_facebook_container_labels_public_endpoint_traefik_entrypoints != 'web' }}" -matrix_mautrix_facebook_container_labels_public_endpoint_traefik_tls_certResolver: "{{ matrix_mautrix_facebook_container_labels_traefik_tls_certResolver }}" # noqa var-naming - -# Controls whether labels will be added that expose mautrix-facebook's metrics -matrix_mautrix_facebook_container_labels_metrics_enabled: "{{ matrix_mautrix_facebook_metrics_enabled and matrix_mautrix_facebook_metrics_proxying_enabled }}" -matrix_mautrix_facebook_container_labels_metrics_traefik_rule: "Host(`{{ matrix_mautrix_facebook_metrics_proxying_hostname }}`) && PathPrefix(`{{ matrix_mautrix_facebook_metrics_proxying_path_prefix }}`)" -matrix_mautrix_facebook_container_labels_metrics_traefik_priority: 0 -matrix_mautrix_facebook_container_labels_metrics_traefik_entrypoints: "{{ matrix_mautrix_facebook_container_labels_traefik_entrypoints }}" -matrix_mautrix_facebook_container_labels_metrics_traefik_tls: "{{ matrix_mautrix_facebook_container_labels_metrics_traefik_entrypoints != 'web' }}" -matrix_mautrix_facebook_container_labels_metrics_traefik_tls_certResolver: "{{ matrix_mautrix_facebook_container_labels_traefik_tls_certResolver }}" # noqa var-naming -matrix_mautrix_facebook_container_labels_metrics_middleware_basic_auth_enabled: false -# See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users -matrix_mautrix_facebook_container_labels_metrics_middleware_basic_auth_users: '' - -# matrix_mautrix_facebook_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file. -# See `../templates/labels.j2` for details. -# -# Example: -# matrix_mautrix_facebook_container_labels_additional_labels: | -# my.label=1 -# another.label="here" -matrix_mautrix_facebook_container_labels_additional_labels: '' - -# A list of extra arguments to pass to the container -matrix_mautrix_facebook_container_extra_arguments: [] - -# List of systemd services that matrix-mautrix-facebook.service depends on. -matrix_mautrix_facebook_systemd_required_services_list: "{{ matrix_mautrix_facebook_systemd_required_services_list_default + matrix_mautrix_facebook_systemd_required_services_list_auto + matrix_mautrix_facebook_systemd_required_services_list_custom }}" -matrix_mautrix_facebook_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" -matrix_mautrix_facebook_systemd_required_services_list_auto: [] -matrix_mautrix_facebook_systemd_required_services_list_custom: [] - -# List of systemd services that matrix-mautrix-facebook.service wants -matrix_mautrix_facebook_systemd_wanted_services_list: [] - -matrix_mautrix_facebook_appservice_token: '' -matrix_mautrix_facebook_homeserver_token: '' - -# Whether or not created rooms should have federation enabled. -# If false, created portal rooms will never be federated. -matrix_mautrix_facebook_federate_rooms: true - -# 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_facebook_metrics_proxying_enabled`. -matrix_mautrix_facebook_metrics_enabled: false - -# Controls whether metrics should be exposed on a public URL. -matrix_mautrix_facebook_metrics_proxying_enabled: false -matrix_mautrix_facebook_metrics_proxying_hostname: '' -matrix_mautrix_facebook_metrics_proxying_path_prefix: '' - -matrix_mautrix_facebook_bridge_permissions: | - {{ - {'*': 'relay', matrix_mautrix_facebook_homeserver_domain: 'user'} - | combine({matrix_admin: 'admin'} if matrix_admin else {}) - }} - -# Controls whether the matrix-mautrix-facebook container exposes its HTTP port. -# -# Takes an ":" or "" value (e.g. "127.0.0.1:9008"), or empty string to not expose. -matrix_mautrix_facebook_container_http_host_bind_port: '' - -# Database-related configuration fields. -# -# To use SQLite: -# - change the engine (`matrix_mautrix_facebook_database_engine: 'sqlite'`) -# - change to the last bridge version that supported SQLite: -# `matrix_mautrix_facebook_docker_image: "{{ matrix_mautrix_facebook_docker_image_name_prefix }}tulir/mautrix-facebook:da1b4ec596e334325a1589e70829dea46e73064b"` -# - plan your migration to Postgres, as this bridge does not support SQLite anymore (and neither will the playbook in the future). -# -# To use Postgres: -# - adjust your database credentials via the `matrix_mautrix_facebook_database_*` variables -matrix_mautrix_facebook_database_engine: 'postgres' - -matrix_mautrix_facebook_sqlite_database_path_local: "{{ matrix_mautrix_facebook_data_path }}/mautrix-facebook.db" -matrix_mautrix_facebook_sqlite_database_path_in_container: "/data/mautrix-facebook.db" - -matrix_mautrix_facebook_database_username: 'matrix_mautrix_facebook' -matrix_mautrix_facebook_database_password: 'some-password' -matrix_mautrix_facebook_database_hostname: '' -matrix_mautrix_facebook_database_port: 5432 -matrix_mautrix_facebook_database_name: 'matrix_mautrix_facebook' - -matrix_mautrix_facebook_database_connection_string: 'postgres://{{ matrix_mautrix_facebook_database_username }}:{{ matrix_mautrix_facebook_database_password }}@{{ matrix_mautrix_facebook_database_hostname }}:{{ matrix_mautrix_facebook_database_port }}/{{ matrix_mautrix_facebook_database_name }}' - -matrix_mautrix_facebook_appservice_database: "{{ - { - 'sqlite': ('sqlite:///' + matrix_mautrix_facebook_sqlite_database_path_in_container), - 'postgres': matrix_mautrix_facebook_database_connection_string, - }[matrix_mautrix_facebook_database_engine] -}}" - - -# Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth). -matrix_mautrix_facebook_login_shared_secret: '' - -matrix_mautrix_facebook_bridge_login_shared_secret_map: "{{ {matrix_mautrix_facebook_homeserver_domain: matrix_mautrix_facebook_login_shared_secret} if matrix_mautrix_facebook_login_shared_secret else {} }}" - -# Enable bridge relay bot functionality -matrix_mautrix_facebook_relay_enabled: "{{ matrix_bridges_relay_enabled }}" - -matrix_mautrix_facebook_appservice_bot_username: facebookbot - -matrix_mautrix_facebook_bridge_presence: true - -# Specifies the default log level for all bridge loggers. -matrix_mautrix_facebook_logging_level: WARNING - -# Default configuration template which covers the generic use case. -# You can customize it by controlling the various variables inside it. -# -# For a more advanced customization, you can extend the default (see `matrix_mautrix_facebook_configuration_extension_yaml`) -# or completely replace this variable with your own template. -matrix_mautrix_facebook_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" - -matrix_mautrix_facebook_configuration_extension_yaml: | - # Your custom YAML configuration goes here. - # This configuration extends the default starting configuration (`matrix_mautrix_facebook_configuration_yaml`). - # - # You can override individual variables from the default configuration, or introduce new ones. - # - # If you need something more special, you can take full control by - # completely redefining `matrix_mautrix_facebook_configuration_yaml`. - -matrix_mautrix_facebook_configuration_extension: "{{ matrix_mautrix_facebook_configuration_extension_yaml | from_yaml if matrix_mautrix_facebook_configuration_extension_yaml | from_yaml is mapping else {} }}" - -# Holds the final configuration (a combination of the default and its extension). -# You most likely don't need to touch this variable. Instead, see `matrix_mautrix_facebook_configuration_yaml`. -matrix_mautrix_facebook_configuration: "{{ matrix_mautrix_facebook_configuration_yaml | from_yaml | combine(matrix_mautrix_facebook_configuration_extension, recursive=True) }}" - -matrix_mautrix_facebook_registration_yaml: | - id: facebook - as_token: "{{ matrix_mautrix_facebook_appservice_token }}" - hs_token: "{{ matrix_mautrix_facebook_homeserver_token }}" - namespaces: - users: - - exclusive: true - regex: '^@facebook_.+:{{ matrix_mautrix_facebook_homeserver_domain | regex_escape }}$' - - exclusive: true - regex: '^@{{ matrix_mautrix_facebook_appservice_bot_username | regex_escape }}:{{ matrix_mautrix_facebook_homeserver_domain | regex_escape }}$' - url: {{ matrix_mautrix_facebook_appservice_address }} - # See https://github.com/mautrix/signal/issues/43 - sender_localpart: _bot_{{ matrix_mautrix_facebook_appservice_bot_username }} - rate_limited: false - de.sorunome.msc2409.push_ephemeral: true - receive_ephemeral: true - -matrix_mautrix_facebook_registration: "{{ matrix_mautrix_facebook_registration_yaml | from_yaml }}" - -# Enable End-to-bridge encryption -matrix_mautrix_facebook_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}" -matrix_mautrix_facebook_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}" -matrix_mautrix_facebook_bridge_encryption_key_sharing_allow: "{{ matrix_mautrix_facebook_bridge_encryption_allow }}" diff --git a/roles/custom/matrix-bridge-mautrix-facebook/tasks/main.yml b/roles/custom/matrix-bridge-mautrix-facebook/tasks/main.yml deleted file mode 100644 index c5cf1123e..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/tasks/main.yml +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-FileCopyrightText: 2019 - 2024 Slavi Pantaleev -# SPDX-FileCopyrightText: 2019 Dan Arnfield -# SPDX-FileCopyrightText: 2019 Jason Locklin -# SPDX-FileCopyrightText: 2022 Marko Weltzer -# -# SPDX-License-Identifier: AGPL-3.0-or-later - ---- - -- tags: - - setup-all - - setup-mautrix-facebook - - install-all - - install-mautrix-facebook - block: - - when: matrix_mautrix_facebook_enabled | bool - ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" - - - when: matrix_mautrix_facebook_enabled | bool - ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" - -- tags: - - setup-all - - setup-mautrix-facebook - block: - - when: not matrix_mautrix_facebook_enabled | bool - ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" diff --git a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml deleted file mode 100644 index b3b8aeabc..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_install.yml +++ /dev/null @@ -1,159 +0,0 @@ -# SPDX-FileCopyrightText: 2019 - 2024 Slavi Pantaleev -# SPDX-FileCopyrightText: 2019 Dan Arnfield -# SPDX-FileCopyrightText: 2020 Chris van Dijk -# SPDX-FileCopyrightText: 2020 Horvath Gergely -# SPDX-FileCopyrightText: 2020 MDAD project contributors -# SPDX-FileCopyrightText: 2020 Stuart Mumford -# SPDX-FileCopyrightText: 2021 Aaron Raimist -# SPDX-FileCopyrightText: 2022 Jim Myhrberg -# SPDX-FileCopyrightText: 2022 Marko Weltzer -# SPDX-FileCopyrightText: 2022 Nikita Chernyi -# SPDX-FileCopyrightText: 2022 Sebastian Gumprich -# SPDX-FileCopyrightText: 2024 David Mehren -# -# SPDX-License-Identifier: AGPL-3.0-or-later - ---- - -- ansible.builtin.set_fact: - matrix_mautrix_facebook_requires_restart: false - -- when: "matrix_mautrix_facebook_database_engine == 'postgres'" - block: - - name: Check if an SQLite database already exists - ansible.builtin.stat: - path: "{{ matrix_mautrix_facebook_sqlite_database_path_local }}" - register: matrix_mautrix_facebook_sqlite_database_path_local_stat_result - - - when: "matrix_mautrix_facebook_sqlite_database_path_local_stat_result.stat.exists | bool" - block: - - ansible.builtin.include_role: - name: galaxy/postgres - tasks_from: migrate_db_to_postgres - vars: - postgres_db_migration_request: - src: "{{ matrix_mautrix_facebook_sqlite_database_path_local }}" - dst: "{{ matrix_mautrix_facebook_database_connection_string }}" - caller: "{{ role_path | basename }}" - engine_variable_name: 'matrix_mautrix_facebook_database_engine' - engine_old: 'sqlite' - systemd_services_to_stop: ['matrix-mautrix-facebook.service'] - - - ansible.builtin.set_fact: - matrix_mautrix_facebook_requires_restart: true - -- name: Ensure Mautrix Facebook image is pulled - community.docker.docker_image: - name: "{{ matrix_mautrix_facebook_docker_image }}" - source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" - force_source: "{{ matrix_mautrix_facebook_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_facebook_docker_image_force_pull }}" - when: not matrix_mautrix_facebook_container_image_self_build - register: result - retries: "{{ devture_playbook_help_container_retries_count }}" - delay: "{{ devture_playbook_help_container_retries_delay }}" - until: result is not failed - -- name: Ensure Mautrix Facebook paths exist - ansible.builtin.file: - path: "{{ item.path }}" - state: directory - mode: 0750 - owner: "{{ matrix_user_name }}" - group: "{{ matrix_group_name }}" - with_items: - - {path: "{{ matrix_mautrix_facebook_base_path }}", when: true} - - {path: "{{ matrix_mautrix_facebook_config_path }}", when: true} - - {path: "{{ matrix_mautrix_facebook_data_path }}", when: true} - - {path: "{{ matrix_mautrix_facebook_docker_src_files_path }}", when: "{{ matrix_mautrix_facebook_container_image_self_build }}"} - when: item.when | bool - -- name: Ensure Mautrix Facebook repository is present on self-build - ansible.builtin.git: - repo: "{{ matrix_mautrix_facebook_container_image_self_build_repo }}" - dest: "{{ matrix_mautrix_facebook_docker_src_files_path }}" - version: "{{ matrix_mautrix_facebook_docker_image.split(':')[1] }}" - force: "yes" - become: true - become_user: "{{ matrix_user_name }}" - register: matrix_mautrix_facebook_git_pull_results - when: "matrix_mautrix_facebook_container_image_self_build | bool" - -- name: Ensure Mautrix Facebook Docker image is built - community.docker.docker_image: - name: "{{ matrix_mautrix_facebook_docker_image }}" - source: build - force_source: "{{ matrix_mautrix_facebook_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_facebook_git_pull_results.changed }}" - build: - dockerfile: Dockerfile - path: "{{ matrix_mautrix_facebook_docker_src_files_path }}" - pull: true - when: "matrix_mautrix_facebook_container_image_self_build | bool" - -- name: Check if an old database file already exists - ansible.builtin.stat: - path: "{{ matrix_mautrix_facebook_base_path }}/mautrix-facebook.db" - register: matrix_mautrix_facebook_stat_database - -- name: (Data relocation) Ensure matrix-mautrix-facebook.service is stopped - ansible.builtin.service: - name: matrix-mautrix-facebook - state: stopped - enabled: false - daemon_reload: true - failed_when: false - when: "matrix_mautrix_facebook_stat_database.stat.exists" - -- name: (Data relocation) Move mautrix-facebook database file to ./data directory - ansible.builtin.command: - cmd: "mv {{ matrix_mautrix_facebook_base_path }}/mautrix-facebook.db {{ matrix_mautrix_facebook_data_path }}/mautrix-facebook.db" - creates: "{{ matrix_mautrix_facebook_data_path }}/mautrix-facebook.db" - removes: "{{ matrix_mautrix_facebook_base_path }}/mautrix-facebook.db" - when: "matrix_mautrix_facebook_stat_database.stat.exists" - -- name: Ensure mautrix-facebook config.yaml installed - ansible.builtin.copy: - content: "{{ matrix_mautrix_facebook_configuration | to_nice_yaml(indent=2, width=999999) }}" - dest: "{{ matrix_mautrix_facebook_config_path }}/config.yaml" - mode: 0644 - owner: "{{ matrix_user_name }}" - group: "{{ matrix_group_name }}" - -- name: Ensure mautrix-facebook registration.yaml installed - ansible.builtin.copy: - content: "{{ matrix_mautrix_facebook_registration | to_nice_yaml(indent=2, width=999999) }}" - dest: "{{ matrix_mautrix_facebook_config_path }}/registration.yaml" - mode: 0644 - owner: "{{ matrix_user_name }}" - group: "{{ matrix_group_name }}" - -- name: Ensure mautrix-facebook support files installed - ansible.builtin.template: - src: "{{ role_path }}/templates/{{ item }}.j2" - dest: "{{ matrix_mautrix_facebook_base_path }}/{{ item }}" - mode: 0640 - owner: "{{ matrix_user_name }}" - group: "{{ matrix_group_name }}" - with_items: - - labels - -- name: Ensure matrix-mautrix-facebook container network is created - community.general.docker_network: - 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: - src: "{{ role_path }}/templates/systemd/matrix-mautrix-facebook.service.j2" - dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-facebook.service" - mode: 0644 - -- name: Ensure matrix-mautrix-facebook.service restarted, if necessary - ansible.builtin.service: - name: "matrix-mautrix-facebook.service" - state: restarted - daemon_reload: true - when: "matrix_mautrix_facebook_requires_restart | bool" diff --git a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml deleted file mode 100644 index d88c98feb..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/tasks/setup_uninstall.yml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: 2019 - 2022 Slavi Pantaleev -# SPDX-FileCopyrightText: 2020 MDAD project contributors -# SPDX-FileCopyrightText: 2022 Marko Weltzer -# -# SPDX-License-Identifier: AGPL-3.0-or-later - ---- - -- name: Check existence of matrix-mautrix-facebook service - ansible.builtin.stat: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-facebook.service" - register: matrix_mautrix_facebook_service_stat - -- when: matrix_mautrix_facebook_service_stat.stat.exists | bool - block: - - name: Ensure matrix-mautrix-facebook is stopped - ansible.builtin.service: - name: matrix-mautrix-facebook - state: stopped - enabled: false - daemon_reload: true - - - name: Ensure matrix-mautrix-facebook.service doesn't exist - ansible.builtin.file: - path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-facebook.service" - state: absent diff --git a/roles/custom/matrix-bridge-mautrix-facebook/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-facebook/tasks/validate_config.yml deleted file mode 100644 index 8d141ec08..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/tasks/validate_config.yml +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-FileCopyrightText: 2019 - 2024 Slavi Pantaleev -# SPDX-FileCopyrightText: 2019 Jason Locklin -# SPDX-FileCopyrightText: 2022 László Várady -# SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara -# -# SPDX-License-Identifier: AGPL-3.0-or-later - ---- - -- name: (Deprecation) Catch and report renamed mautrix-facebook settings - ansible.builtin.fail: - msg: >- - Your configuration contains a variable, which now has a different name. - Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). - when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" - with_items: - - {'old': 'matrix_mautrix_facebook_public_endpoint', 'new': 'matrix_mautrix_facebook_appservice_public_prefix'} - - {'old': 'matrix_mautrix_facebook_docker_image_name_prefix', 'new': 'matrix_mautrix_facebook_docker_image_registry_prefix'} - -- name: Fail if required mautrix-facebook settings not defined - ansible.builtin.fail: - msg: >- - You need to define a required configuration setting (`{{ item.name }}`). - when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" - with_items: - - {'name': 'matrix_mautrix_facebook_appservice_public_hostname', when: "{{ matrix_mautrix_facebook_appservice_public_enabled }}"} - - {'name': 'matrix_mautrix_facebook_appservice_public_prefix', when: "{{ matrix_mautrix_facebook_appservice_public_enabled }}"} - - {'name': 'matrix_mautrix_facebook_metrics_proxying_hostname', when: "{{ matrix_mautrix_facebook_metrics_proxying_enabled }}"} - - {'name': 'matrix_mautrix_facebook_metrics_proxying_path_prefix', when: "{{ matrix_mautrix_facebook_metrics_proxying_enabled }}"} - - {'name': 'matrix_mautrix_facebook_appservice_token', when: true} - - {'name': 'matrix_mautrix_facebook_homeserver_token', when: true} - - {'name': 'matrix_mautrix_facebook_container_network', when: true} - - {'name': 'matrix_mautrix_facebook_homeserver_address', when: true} - - {'name': 'matrix_mautrix_facebook_database_hostname', when: "{{ matrix_mautrix_facebook_database_engine == 'postgres' }}"} - -- when: "matrix_mautrix_facebook_database_engine == 'sqlite' and matrix_mautrix_facebook_docker_image.endswith(':da1b4ec596e334325a1589e70829dea46e73064b')" - block: - - name: Inject warning if on an old SQLite-supporting version - ansible.builtin.set_fact: - devture_playbook_runtime_messages_list: | - {{ - devture_playbook_runtime_messages_list | default([]) - + - [ - "Note: Your mautrix-facebook bridge is still on SQLite and on the last version that supported it, before support was dropped. Support has been subsequently re-added in v0.3.2, so we advise you to upgrade (by removing your `matrix_mautrix_facebook_docker_image` definition from vars.yml)" - ] - }} diff --git a/roles/custom/matrix-bridge-mautrix-facebook/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-facebook/templates/config.yaml.j2 deleted file mode 100644 index 8e3a6f2db..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/templates/config.yaml.j2 +++ /dev/null @@ -1,259 +0,0 @@ -#jinja2: lstrip_blocks: True -# Homeserver details -homeserver: - # The address that this appservice can use to connect to the homeserver. - address: {{ matrix_mautrix_facebook_homeserver_address }} - # The domain of the homeserver (for MXIDs, etc). - domain: {{ matrix_mautrix_facebook_homeserver_domain }} - # Whether or not to verify the SSL certificate of the homeserver. - # Only applies if address starts with https:// - verify_ssl: true - # Whether or not the homeserver supports asmux-specific endpoints, - # such as /_matrix/client/unstable/net.maunium.asmux/dms for atomically - # updating m.direct. - asmux: false - # Whether asynchronous uploads via MSC2246 should be enabled for media. - # Requires a media repo that supports MSC2246. - async_media: {{ matrix_mautrix_facebook_homeserver_async_media | to_json }} - -# Application service host/registration related details -# Changing these values requires regeneration of the registration. -appservice: - # The address that the homeserver can use to connect to this appservice. - address: {{ matrix_mautrix_facebook_appservice_address }} - - # The hostname and port where this appservice should listen. - hostname: 0.0.0.0 - port: 29319 - # The maximum body size of appservice API requests (from the homeserver) in mebibytes - # Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s - max_body_size: 1 - - # The full URI to the database. Only Postgres is currently supported. - database: {{ matrix_mautrix_facebook_appservice_database|to_json }} - - # Public part of web server for out-of-Matrix interaction with the bridge. - public: - # Whether or not the public-facing endpoints should be enabled. - enabled: {{ matrix_mautrix_facebook_appservice_public_enabled|to_json }} - # The prefix to use in the public-facing endpoints. - prefix: {{ matrix_mautrix_facebook_appservice_public_prefix|to_json }} - # The base URL where the public-facing endpoints are available. The prefix is not added - # implicitly. - external: {{ matrix_mautrix_facebook_appservice_public_external|to_json }} - # Allow logging in within Matrix. If false, users can only log in using the web interface. - allow_matrix_login: true - # Segment API key to enable analytics tracking for web server endpoints. Set to null to disable. - # Currently the only events are login start, success and fail. - segment_key: null - - # The unique ID of this appservice. - id: facebook - # Username of the appservice bot. - bot_username: {{ matrix_mautrix_facebook_appservice_bot_username|to_json }} - # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty - # to leave display name/avatar as-is. - bot_displayname: Facebook bridge bot - bot_avatar: mxc://maunium.net/ygtkteZsXnGJLJHRchUwYWak - - # Authentication tokens for AS <-> HS communication. - as_token: "{{ matrix_mautrix_facebook_appservice_token }}" - hs_token: "{{ matrix_mautrix_facebook_homeserver_token }}" - -# Prometheus telemetry config. Requires prometheus-client to be installed. -metrics: - enabled: {{ matrix_mautrix_facebook_metrics_enabled | to_json }} - listen_port: 8000 - -# Bridge config -bridge: - # Localpart template of MXIDs for Facebook users. - # {userid} is replaced with the user ID of the Facebook user. - username_template: "facebook_{userid}" - # Displayname template for Facebook users. - # {displayname} is replaced with the display name of the Facebook user - # as defined below in displayname_preference. - # Keys available for displayname_preference are also available here. - displayname_template: '{displayname} (FB)' - # Available keys: - # "name" (full name) - # "first_name" - # "last_name" - # "nickname" - # "own_nickname" (user-specific!) - displayname_preference: - - name - - first_name - - # The prefix for commands. Only required in non-management rooms. - command_prefix: "{{ matrix_mautrix_facebook_command_prefix }}" - - # Number of chats to sync (and create portals for) on startup/login. - # Set 0 to disable automatic syncing. - initial_chat_sync: 10 - # Whether or not the Facebook users of logged in Matrix users should be - # invited to private chats when the user sends a message from another client. - invite_own_puppet_to_pm: false - # Whether or not to use /sync to get presence, read receipts and typing notifications - # when double puppeting is enabled - sync_with_custom_puppets: true - # Whether or not to 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. - sync_direct_chat_list: false - # Servers to always allow double puppeting from - double_puppet_server_map: {} - # example.com: https://example.com - # 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 - # - # If set, custom puppets will be enabled automatically for local users - # instead of users having to find an access token and run `login-matrix` - # manually. - # If using this for other servers than the bridge's server, - # you must also set the URL in the double_puppet_server_map. - login_shared_secret_map: {{ matrix_mautrix_facebook_bridge_login_shared_secret_map|to_json }} - # Should presence from Facebook be bridged? This doesn't use the same API as the Android app, - # so it might be more suspicious to Facebook. - presence_from_facebook: {{ matrix_mautrix_facebook_bridge_presence|to_json }} - # Whether or not to update avatars when syncing all contacts at startup. - update_avatar_initial_sync: true - # End-to-bridge encryption support options. These require matrix-nio to be installed with pip - # and login_shared_secret to be configured in order to get a device for the bridge bot. - # - # Additionally, https://github.com/matrix-org/synapse/pull/5758 is required if using a normal - # application service. - encryption: - # Allow encryption, work in group chat rooms with e2ee enabled - allow: {{ matrix_mautrix_facebook_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_facebook_bridge_encryption_default|to_json }} - # Options for automatic key sharing. - key_sharing: - # 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_facebook_bridge_encryption_key_sharing_allow|to_json }} - # Require the requesting device to have a valid cross-signing signature? - # This doesn't require that the bridge has verified the device, only that the user has verified it. - # Not yet implemented. - require_cross_signing: false - # Require devices to be verified by the bridge? - # Verification by the bridge is not yet implemented. - require_verification: true - # Whether or not the bridge should send a read receipt from the bridge bot when a message has - # been sent to Facebook. - delivery_receipts: false - # Whether to allow inviting arbitrary mxids to portal rooms - allow_invites: false - # Whether or not created rooms should have federation enabled. - # If false, created portal rooms will never be federated. - federate_rooms: {{ matrix_mautrix_facebook_federate_rooms|to_json }} - # Settings for backfilling messages from Facebook. - backfill: - # Whether or not the Facebook users of logged in Matrix users should be - # invited to private chats when backfilling history from Facebook. This is - # usually needed to prevent rate limits and to allow timestamp massaging. - invite_own_puppet: true - # Maximum number of messages to backfill initially. - # Set to 0 to disable backfilling when creating portal. - initial_limit: 0 - # Maximum number of messages to backfill if messages were missed while - # the bridge was disconnected. - # Set to 0 to disable backfilling missed messages. - missed_limit: 1000 - # If using double puppeting, should notifications be disabled - # while the initial backfill is in progress? - disable_notifications: false - periodic_reconnect: - # Interval in seconds in which to automatically reconnect all users. - # This can be used to automatically mitigate the bug where Facebook stops sending messages. - # Set to -1 to disable periodic reconnections entirely. - interval: -1 - # What to do in periodic reconnects. Either "refresh" or "reconnect" - mode: refresh - # Should even disconnected users be reconnected? - always: false - # The number of seconds that a disconnection can last without triggering an automatic re-sync - # and missed message backfilling when reconnecting. - # Set to 0 to always re-sync, or -1 to never re-sync automatically. - resync_max_disconnected_time: 5 - # Should the bridge do a resync on startup? - sync_on_startup: true - # Whether or not temporary disconnections should send notices to the notice room. - # If this is false, disconnections will never send messages and connections will only send - # messages if it was disconnected for more than resync_max_disconnected_time seconds. - temporary_disconnect_notices: false - # Whether or not the bridge should try to "refresh" the connection if a normal reconnection - # attempt fails. - refresh_on_reconnection_fail: 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 - - # Permissions for using the bridge. - # Permitted values: - # user - Use the bridge with puppeting. - # admin - Use and administrate the bridge. - # Permitted keys: - # * - All Matrix users - # domain - All users on that homeserver - # mxid - Specific user - permissions: {{ matrix_mautrix_facebook_bridge_permissions|to_json }} - - relay: - # Whether relay mode should be allowed. If allowed, `!fb set-relay` can be used to turn any - # authenticated user into a relaybot for that chat. - enabled: {{ matrix_mautrix_facebook_relay_enabled }} - # The formats to use when sending messages to Messenger via a relay user. - # - # Available variables: - # $sender_displayname - The display name of the sender (e.g. Example User) - # $sender_username - The username (Matrix ID localpart) of the sender (e.g. alice) - # $sender_mxid - The Matrix ID of the sender (e.g. @alice:example.com) - # $message - The message content - message_formats: - m.text: '$sender_displayname: $message' - m.notice: '$sender_displayname: $message' - m.emote: '* $sender_displayname $message' - m.file: '$sender_displayname sent a file' - m.image: '$sender_displayname sent an image' - m.audio: '$sender_displayname sent an audio file' - m.video: '$sender_displayname sent a video' - m.location: '$sender_displayname sent a location' - -facebook: - device_seed: generate - default_region_hint: ODN - connection_type: WIFI - carrier: Verizon - hni: 311390 - -# Python logging configuration. -# -# See section 16.7.2 of the Python documentation for more info: -# https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema -logging: - version: 1 - formatters: - colored: - (): mautrix_facebook.util.ColorFormatter - format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s" - normal: - format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s" - handlers: - console: - class: logging.StreamHandler - formatter: colored - loggers: - mau: - level: {{ matrix_mautrix_facebook_logging_level|to_json }} - paho: - level: {{ matrix_mautrix_facebook_logging_level|to_json }} - aiohttp: - level: {{ matrix_mautrix_facebook_logging_level|to_json }} - root: - level: {{ matrix_mautrix_facebook_logging_level|to_json }} - handlers: [console] diff --git a/roles/custom/matrix-bridge-mautrix-facebook/templates/config.yaml.j2.license b/roles/custom/matrix-bridge-mautrix-facebook/templates/config.yaml.j2.license deleted file mode 100644 index aa26685bf..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/templates/config.yaml.j2.license +++ /dev/null @@ -1,9 +0,0 @@ -SPDX-FileCopyrightText: 2019 - 2024 Slavi Pantaleev -SPDX-FileCopyrightText: 2019 Hugues Morisset -SPDX-FileCopyrightText: 2020 - 2022 MDAD project contributors -SPDX-FileCopyrightText: 2022 - 2023 Nikita Chernyi -SPDX-FileCopyrightText: 2022 László Várady -SPDX-FileCopyrightText: 2022 Olivér Falvai -SPDX-FileCopyrightText: 2023 Adrien le Maire - -SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/roles/custom/matrix-bridge-mautrix-facebook/templates/labels.j2 b/roles/custom/matrix-bridge-mautrix-facebook/templates/labels.j2 deleted file mode 100644 index d7eecb2ec..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/templates/labels.j2 +++ /dev/null @@ -1,82 +0,0 @@ -{# -SPDX-FileCopyrightText: 2024 Slavi Pantaleev - -SPDX-License-Identifier: AGPL-3.0-or-later -#} - -{% if matrix_mautrix_facebook_container_labels_traefik_enabled %} -traefik.enable=true - -{% if matrix_mautrix_facebook_container_labels_traefik_docker_network %} -traefik.docker.network={{ matrix_mautrix_facebook_container_labels_traefik_docker_network }} -{% endif %} - -traefik.http.services.matrix-mautrix-facebook-appservice.loadbalancer.server.port=29319 -traefik.http.services.matrix-mautrix-facebook-metrics.loadbalancer.server.port=8000 - -{% if matrix_mautrix_facebook_container_labels_public_endpoint_enabled %} -############################################################ -# # -# Public # -# # -############################################################ - -traefik.http.routers.matrix-mautrix-facebook-public.rule={{ matrix_mautrix_facebook_container_labels_public_endpoint_traefik_rule }} - -{% if matrix_mautrix_facebook_container_labels_public_endpoint_traefik_priority | int > 0 %} -traefik.http.routers.matrix-mautrix-facebook-public.priority={{ matrix_mautrix_facebook_container_labels_public_endpoint_traefik_priority }} -{% endif %} - -traefik.http.routers.matrix-mautrix-facebook-public.service=matrix-mautrix-facebook-appservice -traefik.http.routers.matrix-mautrix-facebook-public.entrypoints={{ matrix_mautrix_facebook_container_labels_public_endpoint_traefik_entrypoints }} - -traefik.http.routers.matrix-mautrix-facebook-public.tls={{ matrix_mautrix_facebook_container_labels_public_endpoint_traefik_tls | to_json }} -{% if matrix_mautrix_facebook_container_labels_public_endpoint_traefik_tls %} -traefik.http.routers.matrix-mautrix-facebook-public.tls.certResolver={{ matrix_mautrix_facebook_container_labels_public_endpoint_traefik_tls_certResolver }} -{% endif %} - -############################################################ -# # -# /Public # -# # -############################################################ -{% endif %} - - -{% if matrix_mautrix_facebook_container_labels_metrics_enabled %} -############################################################ -# # -# Metrics # -# # -############################################################ - -{% if matrix_mautrix_facebook_container_labels_metrics_middleware_basic_auth_enabled %} -traefik.http.middlewares.matrix-mautrix-facebook-metrics-basic-auth.basicauth.users={{ matrix_mautrix_facebook_container_labels_metrics_middleware_basic_auth_users }} -traefik.http.routers.matrix-mautrix-facebook-metrics.middlewares=matrix-mautrix-facebook-metrics-basic-auth -{% endif %} - -traefik.http.routers.matrix-mautrix-facebook-metrics.rule={{ matrix_mautrix_facebook_container_labels_metrics_traefik_rule }} - -{% if matrix_mautrix_facebook_container_labels_metrics_traefik_priority | int > 0 %} -traefik.http.routers.matrix-mautrix-facebook-metrics.priority={{ matrix_mautrix_facebook_container_labels_metrics_traefik_priority }} -{% endif %} - -traefik.http.routers.matrix-mautrix-facebook-metrics.service=matrix-mautrix-facebook-metrics -traefik.http.routers.matrix-mautrix-facebook-metrics.entrypoints={{ matrix_mautrix_facebook_container_labels_metrics_traefik_entrypoints }} - -traefik.http.routers.matrix-mautrix-facebook-metrics.tls={{ matrix_mautrix_facebook_container_labels_metrics_traefik_tls | to_json }} -{% if matrix_mautrix_facebook_container_labels_metrics_traefik_tls %} -traefik.http.routers.matrix-mautrix-facebook-metrics.tls.certResolver={{ matrix_mautrix_facebook_container_labels_metrics_traefik_tls_certResolver }} -{% endif %} - -############################################################ -# # -# /Metrics # -# # -############################################################ -{% endif %} - - -{% endif %} - -{{ matrix_mautrix_facebook_container_labels_additional_labels }} diff --git a/roles/custom/matrix-bridge-mautrix-facebook/templates/systemd/matrix-mautrix-facebook.service.j2 b/roles/custom/matrix-bridge-mautrix-facebook/templates/systemd/matrix-mautrix-facebook.service.j2 deleted file mode 100644 index 441848a08..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/templates/systemd/matrix-mautrix-facebook.service.j2 +++ /dev/null @@ -1,51 +0,0 @@ -#jinja2: lstrip_blocks: True -[Unit] -Description=Matrix Mautrix Facebook bridge -{% for service in matrix_mautrix_facebook_systemd_required_services_list %} -Requires={{ service }} -After={{ service }} -{% endfor %} -{% for service in matrix_mautrix_facebook_systemd_wanted_services_list %} -Wants={{ service }} -{% endfor %} -DefaultDependencies=no - -[Service] -Type=simple -Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" -ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mautrix-facebook 2>/dev/null || true' -ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-facebook 2>/dev/null || true' - -ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ - --rm \ - --name=matrix-mautrix-facebook \ - --log-driver=none \ - --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ - --cap-drop=ALL \ - --network={{ matrix_mautrix_facebook_container_network }} \ - {% if matrix_mautrix_facebook_appservice_public_enabled and matrix_mautrix_facebook_container_http_host_bind_port %} - -p {{ matrix_mautrix_facebook_container_http_host_bind_port }}:29319 \ - {% endif %} - --mount type=bind,src={{ matrix_mautrix_facebook_config_path }},dst=/config \ - --mount type=bind,src={{ matrix_mautrix_facebook_data_path }},dst=/data \ - --label-file={{ matrix_mautrix_facebook_base_path }}/labels \ - {% for arg in matrix_mautrix_facebook_container_extra_arguments %} - {{ arg }} \ - {% endfor %} - {{ matrix_mautrix_facebook_docker_image }} \ - python3 -m mautrix_facebook -c /config/config.yaml --no-update - -{% for network in matrix_mautrix_facebook_container_additional_networks %} -ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-facebook -{% endfor %} - -ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-facebook - -ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mautrix-facebook 2>/dev/null || true' -ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-facebook 2>/dev/null || true' -Restart=always -RestartSec=30 -SyslogIdentifier=matrix-mautrix-facebook - -[Install] -WantedBy=multi-user.target diff --git a/roles/custom/matrix-bridge-mautrix-facebook/templates/systemd/matrix-mautrix-facebook.service.j2.license b/roles/custom/matrix-bridge-mautrix-facebook/templates/systemd/matrix-mautrix-facebook.service.j2.license deleted file mode 100644 index f74c84d94..000000000 --- a/roles/custom/matrix-bridge-mautrix-facebook/templates/systemd/matrix-mautrix-facebook.service.j2.license +++ /dev/null @@ -1,7 +0,0 @@ -SPDX-FileCopyrightText: 2019 - 2025 Slavi Pantaleev -SPDX-FileCopyrightText: 2019 Hugues Morisset -SPDX-FileCopyrightText: 2020 Chris van Dijk -SPDX-FileCopyrightText: 2020 Scott Crossen -SPDX-FileCopyrightText: 2022 László Várady - -SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/roles/custom/matrix_playbook_migration/tasks/validate_config.yml b/roles/custom/matrix_playbook_migration/tasks/validate_config.yml index bee7e89e4..5cff3f708 100644 --- a/roles/custom/matrix_playbook_migration/tasks/validate_config.yml +++ b/roles/custom/matrix_playbook_migration/tasks/validate_config.yml @@ -558,6 +558,18 @@ The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_bot_chatgpt_.+', wantlist=True) | join(', ') }} when: "lookup('ansible.builtin.varnames', '^matrix_bot_chatgpt_.+', wantlist=True) | length > 0" +- name: (Deprecation) Catch and report mautrix-facebook variables + ansible.builtin.fail: + msg: |- + mautrix-facebook was completely removed from the playbook in November 2025. + + Please remove all `matrix_mautrix_facebook_*` variables from your configuration file (vars.yml). + + You may also wish to uninstall the bridge manually. See `docs/configuring-playbook-bridge-mautrix-facebook.md` for more information. + + The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_mautrix_facebook_.+', wantlist=True) | join(', ') }} + when: "lookup('ansible.builtin.varnames', '^matrix_mautrix_facebook_.+', wantlist=True) | length > 0" + - name: (Deprecation) Catch and report mautrix-hangouts variables ansible.builtin.fail: msg: |- diff --git a/setup.yml b/setup.yml index e89b40ef3..486a60607 100644 --- a/setup.yml +++ b/setup.yml @@ -60,7 +60,6 @@ - custom/matrix-bridge-appservice-kakaotalk - custom/matrix-bridge-beeper-linkedin - custom/matrix-bridge-wechat - - custom/matrix-bridge-mautrix-facebook - custom/matrix-bridge-mautrix-twitter - custom/matrix-bridge-mautrix-googlechat - custom/matrix-bridge-mautrix-instagram