From b2fb403d310f75c3ac75c4632565f287091e9d41 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 16 Jul 2026 14:51:33 +0300 Subject: [PATCH] Rename matrix_mautrix_googlechat_* variables to matrix_bridge_mautrix_googlechat_* Part of adopting a uniform naming policy for bridge variables, where the variable prefix matches the role directory name. Co-Authored-By: Claude Fable 5 --- ...ring-playbook-bridge-mautrix-googlechat.md | 4 +- group_vars/matrix_servers | 74 +++---- .../defaults/main.yml | 204 +++++++++--------- .../tasks/main.yml | 6 +- .../tasks/setup_install.yml | 108 +++++----- .../tasks/setup_uninstall.yml | 4 +- .../tasks/validate_config.yml | 36 ++-- .../templates/config.yaml.j2 | 40 ++-- .../templates/labels.j2 | 44 ++-- .../matrix-mautrix-googlechat.service.j2 | 24 +-- 10 files changed, 272 insertions(+), 272 deletions(-) diff --git a/docs/configuring-playbook-bridge-mautrix-googlechat.md b/docs/configuring-playbook-bridge-mautrix-googlechat.md index cc0f58e22..00f192073 100644 --- a/docs/configuring-playbook-bridge-mautrix-googlechat.md +++ b/docs/configuring-playbook-bridge-mautrix-googlechat.md @@ -30,7 +30,7 @@ See [this section](configuring-playbook-bridge-mautrix-bridges.md#set-up-double- To enable the [Google Chat](https://chat.google.com/) bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: ```yaml -matrix_mautrix_googlechat_enabled: true +matrix_bridge_mautrix_googlechat_enabled: true ``` ### Extending the configuration @@ -70,5 +70,5 @@ As with all other services, you can find the logs in [systemd-journald](https:// 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_googlechat_logging_level: DEBUG +matrix_bridge_mautrix_googlechat_logging_level: DEBUG ``` diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 2a2e9ffb1..a92681f08 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -118,7 +118,7 @@ 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_googlechat_config_path + '/registration.yaml,dst=/matrix-mautrix-googlechat-registration.yaml,ro'] if matrix_mautrix_googlechat_enabled else []) + (['--mount type=bind,src=' + matrix_bridge_mautrix_googlechat_config_path + '/registration.yaml,dst=/matrix-mautrix-googlechat-registration.yaml,ro'] if matrix_bridge_mautrix_googlechat_enabled else []) + (['--mount type=bind,src=' + matrix_mautrix_signal_config_path + '/registration.yaml,dst=/matrix-mautrix-signal-registration.yaml,ro'] if matrix_mautrix_signal_enabled else []) + @@ -177,7 +177,7 @@ matrix_homeserver_app_service_config_files_auto: | + (['/matrix-mautrix-slack-registration.yaml'] if matrix_mautrix_slack_enabled else []) + - (['/matrix-mautrix-googlechat-registration.yaml'] if matrix_mautrix_googlechat_enabled else []) + (['/matrix-mautrix-googlechat-registration.yaml'] if matrix_bridge_mautrix_googlechat_enabled else []) + (['/matrix-mautrix-signal-registration.yaml'] if matrix_mautrix_signal_enabled else []) + @@ -443,9 +443,9 @@ devture_systemd_service_manager_services_list_auto: | ([{ 'name': 'matrix-mautrix-googlechat.service', 'priority': 2000, - 'restart_necessary': (matrix_mautrix_googlechat_restart_necessary | bool), + 'restart_necessary': (matrix_bridge_mautrix_googlechat_restart_necessary | bool), 'groups': ['matrix', 'bridges', 'mautrix-googlechat'], - }] if matrix_mautrix_googlechat_enabled else []) + }] if matrix_bridge_mautrix_googlechat_enabled else []) + ([{ 'name': 'matrix-mautrix-signal.service', @@ -1647,50 +1647,50 @@ matrix_mautrix_slack_exposure_path_prefix: "{{ matrix_bridges_exposure_path_pref ###################################################################### # We don't enable bridges by default. -matrix_mautrix_googlechat_enabled: false +matrix_bridge_mautrix_googlechat_enabled: false -matrix_mautrix_googlechat_systemd_required_services_list_auto: | +matrix_bridge_mautrix_googlechat_systemd_required_services_list_auto: | {{ matrix_addons_homeserver_systemd_services_list + - ([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_mautrix_googlechat_database_hostname == postgres_connection_hostname) else []) + ([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_bridge_mautrix_googlechat_database_hostname == postgres_connection_hostname) else []) }} -matrix_mautrix_googlechat_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_mautrix_googlechat_container_image_registry_prefix_upstream_default }}" +matrix_bridge_mautrix_googlechat_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_bridge_mautrix_googlechat_container_image_registry_prefix_upstream_default }}" -matrix_mautrix_googlechat_container_image_self_build: "{{ matrix_architecture not in ['amd64', 'arm64'] }}" +matrix_bridge_mautrix_googlechat_container_image_self_build: "{{ matrix_architecture not in ['amd64', 'arm64'] }}" -matrix_mautrix_googlechat_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '9007') if matrix_playbook_service_host_bind_interface_prefix else '' }}" +matrix_bridge_mautrix_googlechat_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '9007') if matrix_playbook_service_host_bind_interface_prefix else '' }}" -matrix_mautrix_googlechat_container_network: "{{ matrix_addons_container_network }}" +matrix_bridge_mautrix_googlechat_container_network: "{{ matrix_addons_container_network }}" -matrix_mautrix_googlechat_container_additional_networks_auto: |- +matrix_bridge_mautrix_googlechat_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_googlechat_database_hostname == postgres_connection_hostname and matrix_mautrix_googlechat_container_network != postgres_container_network) else []) + ([postgres_container_network] if (postgres_enabled and matrix_bridge_mautrix_googlechat_database_hostname == postgres_connection_hostname and matrix_bridge_mautrix_googlechat_container_network != postgres_container_network) else []) + ([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_playbook_reverse_proxyable_services_additional_network and matrix_bridge_mautrix_gmessages_container_labels_traefik_enabled) else []) ) | unique }} -matrix_mautrix_googlechat_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" -matrix_mautrix_googlechat_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" -matrix_mautrix_googlechat_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}" -matrix_mautrix_googlechat_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}" +matrix_bridge_mautrix_googlechat_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}" +matrix_bridge_mautrix_googlechat_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" +matrix_bridge_mautrix_googlechat_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}" +matrix_bridge_mautrix_googlechat_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}" -matrix_mautrix_googlechat_container_labels_public_endpoint_hostname: "{{ matrix_server_fqn_matrix }}" +matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_hostname: "{{ matrix_server_fqn_matrix }}" -matrix_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_enabled: "{{ matrix_metrics_exposure_http_basic_auth_enabled }}" -matrix_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_users: "{{ matrix_metrics_exposure_http_basic_auth_users }}" +matrix_bridge_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_enabled: "{{ matrix_metrics_exposure_http_basic_auth_enabled }}" +matrix_bridge_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_users: "{{ matrix_metrics_exposure_http_basic_auth_users }}" -matrix_mautrix_googlechat_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':gc.as.token') | hash('sha512') | to_uuid }}" +matrix_bridge_mautrix_googlechat_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':gc.as.token') | hash('sha512') | to_uuid }}" -matrix_mautrix_googlechat_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}" -matrix_mautrix_googlechat_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':gc.hs.token') | hash('sha512') | to_uuid }}" +matrix_bridge_mautrix_googlechat_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}" +matrix_bridge_mautrix_googlechat_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':gc.hs.token') | hash('sha512') | to_uuid }}" -matrix_mautrix_googlechat_login_shared_secret: |- +matrix_bridge_mautrix_googlechat_login_shared_secret: |- {{ ("as_token:" + matrix_appservice_double_puppet_registration_as_token) if matrix_appservice_double_puppet_enabled @@ -1701,16 +1701,16 @@ matrix_mautrix_googlechat_login_shared_secret: |- ) }} -matrix_mautrix_googlechat_metrics_enabled: "{{ prometheus_enabled or matrix_metrics_exposure_enabled }}" +matrix_bridge_mautrix_googlechat_metrics_enabled: "{{ prometheus_enabled or matrix_metrics_exposure_enabled }}" -matrix_mautrix_googlechat_metrics_proxying_enabled: "{{ matrix_mautrix_googlechat_metrics_enabled and matrix_metrics_exposure_enabled }}" -matrix_mautrix_googlechat_metrics_proxying_hostname: "{{ matrix_metrics_exposure_hostname }}" -matrix_mautrix_googlechat_metrics_proxying_path_prefix: "{{ matrix_metrics_exposure_path_prefix }}/mautrix-googlechat" +matrix_bridge_mautrix_googlechat_metrics_proxying_enabled: "{{ matrix_bridge_mautrix_googlechat_metrics_enabled and matrix_metrics_exposure_enabled }}" +matrix_bridge_mautrix_googlechat_metrics_proxying_hostname: "{{ matrix_metrics_exposure_hostname }}" +matrix_bridge_mautrix_googlechat_metrics_proxying_path_prefix: "{{ matrix_metrics_exposure_path_prefix }}/mautrix-googlechat" # Postgres is the default, except if not using internal Postgres server -matrix_mautrix_googlechat_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}" -matrix_mautrix_googlechat_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}" -matrix_mautrix_googlechat_database_password: "{{ (matrix_homeserver_generic_secret_key + ':mau.gc.db') | hash('sha512') | to_uuid }}" +matrix_bridge_mautrix_googlechat_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}" +matrix_bridge_mautrix_googlechat_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}" +matrix_bridge_mautrix_googlechat_database_password: "{{ (matrix_homeserver_generic_secret_key + ':mau.gc.db') | hash('sha512') | to_uuid }}" ###################################################################### # @@ -4183,10 +4183,10 @@ postgres_managed_databases_auto: | }] if (matrix_rustpush_bridge_enabled and matrix_rustpush_bridge_database_engine == 'postgres' and matrix_rustpush_bridge_database_hostname == postgres_connection_hostname) else []) + ([{ - 'name': matrix_mautrix_googlechat_database_name, - 'username': matrix_mautrix_googlechat_database_username, - 'password': matrix_mautrix_googlechat_database_password, - }] if (matrix_mautrix_googlechat_enabled and matrix_mautrix_googlechat_database_engine == 'postgres' and matrix_mautrix_googlechat_database_hostname == postgres_connection_hostname) else []) + 'name': matrix_bridge_mautrix_googlechat_database_name, + 'username': matrix_bridge_mautrix_googlechat_database_username, + 'password': matrix_bridge_mautrix_googlechat_database_password, + }] if (matrix_bridge_mautrix_googlechat_enabled and matrix_bridge_mautrix_googlechat_database_engine == 'postgres' and matrix_bridge_mautrix_googlechat_database_hostname == postgres_connection_hostname) else []) + ([{ 'name': matrix_mautrix_signal_database_name, @@ -5146,9 +5146,9 @@ matrix_ketesa_config_asManagedUsers_auto: | ] if matrix_mautrix_gvoice_enabled else []) + ([ - '^@'+(matrix_mautrix_googlechat_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', + '^@'+(matrix_bridge_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 []) + ] if matrix_bridge_mautrix_googlechat_enabled else []) + ([ '^@'+(matrix_mautrix_meta_instagram_appservice_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-googlechat/defaults/main.yml index 5d2945d13..9553dd747 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/defaults/main.yml @@ -13,115 +13,115 @@ # mautrix-googlechat is a Matrix <-> googlechat bridge # Project source code URL: https://github.com/mautrix/googlechat -matrix_mautrix_googlechat_enabled: true +matrix_bridge_mautrix_googlechat_enabled: true -matrix_mautrix_googlechat_container_image_self_build: false -matrix_mautrix_googlechat_container_image_self_build_repo: "https://github.com/mautrix/googlechat.git" -matrix_mautrix_googlechat_container_image_self_build_repo_version: "{{ 'master' if matrix_mautrix_googlechat_version == 'latest' else matrix_mautrix_googlechat_version }}" +matrix_bridge_mautrix_googlechat_container_image_self_build: false +matrix_bridge_mautrix_googlechat_container_image_self_build_repo: "https://github.com/mautrix/googlechat.git" +matrix_bridge_mautrix_googlechat_container_image_self_build_repo_version: "{{ 'master' if matrix_bridge_mautrix_googlechat_version == 'latest' else matrix_bridge_mautrix_googlechat_version }}" # renovate: datasource=docker depName=dock.mau.dev/mautrix/googlechat -matrix_mautrix_googlechat_version: v0.5.2 +matrix_bridge_mautrix_googlechat_version: v0.5.2 # See: https://mau.dev/mautrix/googlechat/container_registry -matrix_mautrix_googlechat_container_image: "{{ matrix_mautrix_googlechat_container_image_registry_prefix }}mautrix/googlechat:{{ matrix_mautrix_googlechat_version }}" -matrix_mautrix_googlechat_container_image_registry_prefix: "{{ 'localhost/' if matrix_mautrix_googlechat_container_image_self_build else matrix_mautrix_googlechat_container_image_registry_prefix_upstream }}" -matrix_mautrix_googlechat_container_image_registry_prefix_upstream: "{{ matrix_mautrix_googlechat_container_image_registry_prefix_upstream_default }}" -matrix_mautrix_googlechat_container_image_registry_prefix_upstream_default: "dock.mau.dev/" +matrix_bridge_mautrix_googlechat_container_image: "{{ matrix_bridge_mautrix_googlechat_container_image_registry_prefix }}mautrix/googlechat:{{ matrix_bridge_mautrix_googlechat_version }}" +matrix_bridge_mautrix_googlechat_container_image_registry_prefix: "{{ 'localhost/' if matrix_bridge_mautrix_googlechat_container_image_self_build else matrix_bridge_mautrix_googlechat_container_image_registry_prefix_upstream }}" +matrix_bridge_mautrix_googlechat_container_image_registry_prefix_upstream: "{{ matrix_bridge_mautrix_googlechat_container_image_registry_prefix_upstream_default }}" +matrix_bridge_mautrix_googlechat_container_image_registry_prefix_upstream_default: "dock.mau.dev/" -matrix_mautrix_googlechat_base_path: "{{ matrix_base_data_path }}/mautrix-googlechat" -matrix_mautrix_googlechat_config_path: "{{ matrix_mautrix_googlechat_base_path }}/config" -matrix_mautrix_googlechat_data_path: "{{ matrix_mautrix_googlechat_base_path }}/data" -matrix_mautrix_googlechat_container_src_files_path: "{{ matrix_mautrix_googlechat_base_path }}/docker-src" +matrix_bridge_mautrix_googlechat_base_path: "{{ matrix_base_data_path }}/mautrix-googlechat" +matrix_bridge_mautrix_googlechat_config_path: "{{ matrix_bridge_mautrix_googlechat_base_path }}/config" +matrix_bridge_mautrix_googlechat_data_path: "{{ matrix_bridge_mautrix_googlechat_base_path }}/data" +matrix_bridge_mautrix_googlechat_container_src_files_path: "{{ matrix_bridge_mautrix_googlechat_base_path }}/docker-src" -matrix_mautrix_googlechat_public_endpoint: '/mautrix-googlechat' +matrix_bridge_mautrix_googlechat_public_endpoint: '/mautrix-googlechat' -matrix_mautrix_googlechat_homeserver_address: "" -matrix_mautrix_googlechat_homeserver_domain: '{{ matrix_domain }}' -matrix_mautrix_googlechat_appservice_address: 'http://matrix-mautrix-googlechat:8080' +matrix_bridge_mautrix_googlechat_homeserver_address: "" +matrix_bridge_mautrix_googlechat_homeserver_domain: '{{ matrix_domain }}' +matrix_bridge_mautrix_googlechat_appservice_address: 'http://matrix-mautrix-googlechat:8080' -matrix_mautrix_googlechat_command_prefix: "!gc" +matrix_bridge_mautrix_googlechat_command_prefix: "!gc" # Controls whether the matrix-mautrix-googlechat container exposes its HTTP port (tcp/8080 in the container). # # Takes an ":" or "" value (e.g. "127.0.0.1:9007"), or empty string to not expose. -matrix_mautrix_googlechat_container_http_host_bind_port: '' +matrix_bridge_mautrix_googlechat_container_http_host_bind_port: '' -matrix_mautrix_googlechat_container_network: "" +matrix_bridge_mautrix_googlechat_container_network: "" -matrix_mautrix_googlechat_container_additional_networks: "{{ matrix_mautrix_googlechat_container_additional_networks_auto + matrix_mautrix_googlechat_container_additional_networks_custom }}" -matrix_mautrix_googlechat_container_additional_networks_auto: [] -matrix_mautrix_googlechat_container_additional_networks_custom: [] +matrix_bridge_mautrix_googlechat_container_additional_networks: "{{ matrix_bridge_mautrix_googlechat_container_additional_networks_auto + matrix_bridge_mautrix_googlechat_container_additional_networks_custom }}" +matrix_bridge_mautrix_googlechat_container_additional_networks_auto: [] +matrix_bridge_mautrix_googlechat_container_additional_networks_custom: [] -# matrix_mautrix_googlechat_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container. +# matrix_bridge_mautrix_googlechat_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_googlechat_container_labels_additional_labels`. -matrix_mautrix_googlechat_container_labels_traefik_enabled: true -matrix_mautrix_googlechat_container_labels_traefik_docker_network: "{{ matrix_mautrix_googlechat_container_network }}" -matrix_mautrix_googlechat_container_labels_traefik_entrypoints: web-secure -matrix_mautrix_googlechat_container_labels_traefik_tls_certResolver: default # noqa var-naming +# To inject your own other container labels, see `matrix_bridge_mautrix_googlechat_container_labels_additional_labels`. +matrix_bridge_mautrix_googlechat_container_labels_traefik_enabled: true +matrix_bridge_mautrix_googlechat_container_labels_traefik_docker_network: "{{ matrix_bridge_mautrix_googlechat_container_network }}" +matrix_bridge_mautrix_googlechat_container_labels_traefik_entrypoints: web-secure +matrix_bridge_mautrix_googlechat_container_labels_traefik_tls_certResolver: default # noqa var-naming # Controls whether labels will be added that expose mautrix-googlechat's public endpoint -matrix_mautrix_googlechat_container_labels_public_endpoint_enabled: true -matrix_mautrix_googlechat_container_labels_public_endpoint_hostname: "" -matrix_mautrix_googlechat_container_labels_public_endpoint_path_prefix: "{{ matrix_mautrix_googlechat_public_endpoint }}" -matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_rule: "Host(`{{ matrix_mautrix_googlechat_container_labels_public_endpoint_hostname }}`) && PathPrefix(`{{ matrix_mautrix_googlechat_container_labels_public_endpoint_path_prefix }}`)" -matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_priority: 0 -matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_entrypoints: "{{ matrix_mautrix_googlechat_container_labels_traefik_entrypoints }}" -matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_tls: "{{ matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_entrypoints != 'web' }}" -matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_tls_certResolver: "{{ matrix_mautrix_googlechat_container_labels_traefik_tls_certResolver }}" # noqa var-naming +matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_enabled: true +matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_hostname: "" +matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_path_prefix: "{{ matrix_bridge_mautrix_googlechat_public_endpoint }}" +matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_rule: "Host(`{{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_hostname }}`) && PathPrefix(`{{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_path_prefix }}`)" +matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_priority: 0 +matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_entrypoints: "{{ matrix_bridge_mautrix_googlechat_container_labels_traefik_entrypoints }}" +matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_tls: "{{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_entrypoints != 'web' }}" +matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_tls_certResolver: "{{ matrix_bridge_mautrix_googlechat_container_labels_traefik_tls_certResolver }}" # noqa var-naming # Controls whether labels will be added that expose mautrix-googlechat's metrics -matrix_mautrix_googlechat_container_labels_metrics_enabled: "{{ matrix_mautrix_googlechat_metrics_enabled and matrix_mautrix_googlechat_metrics_proxying_enabled }}" -matrix_mautrix_googlechat_container_labels_metrics_traefik_rule: "Host(`{{ matrix_mautrix_googlechat_metrics_proxying_hostname }}`) && PathPrefix(`{{ matrix_mautrix_googlechat_metrics_proxying_path_prefix }}`)" -matrix_mautrix_googlechat_container_labels_metrics_traefik_priority: 0 -matrix_mautrix_googlechat_container_labels_metrics_traefik_entrypoints: "{{ matrix_mautrix_googlechat_container_labels_traefik_entrypoints }}" -matrix_mautrix_googlechat_container_labels_metrics_traefik_tls: "{{ matrix_mautrix_googlechat_container_labels_metrics_traefik_entrypoints != 'web' }}" -matrix_mautrix_googlechat_container_labels_metrics_traefik_tls_certResolver: "{{ matrix_mautrix_googlechat_container_labels_traefik_tls_certResolver }}" # noqa var-naming -matrix_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_enabled: false +matrix_bridge_mautrix_googlechat_container_labels_metrics_enabled: "{{ matrix_bridge_mautrix_googlechat_metrics_enabled and matrix_bridge_mautrix_googlechat_metrics_proxying_enabled }}" +matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_rule: "Host(`{{ matrix_bridge_mautrix_googlechat_metrics_proxying_hostname }}`) && PathPrefix(`{{ matrix_bridge_mautrix_googlechat_metrics_proxying_path_prefix }}`)" +matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_priority: 0 +matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_entrypoints: "{{ matrix_bridge_mautrix_googlechat_container_labels_traefik_entrypoints }}" +matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_tls: "{{ matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_entrypoints != 'web' }}" +matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_tls_certResolver: "{{ matrix_bridge_mautrix_googlechat_container_labels_traefik_tls_certResolver }}" # noqa var-naming +matrix_bridge_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_enabled: false # See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users -matrix_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_users: '' +matrix_bridge_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_users: '' -# matrix_mautrix_googlechat_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file. +# matrix_bridge_mautrix_googlechat_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_googlechat_container_labels_additional_labels: | +# matrix_bridge_mautrix_googlechat_container_labels_additional_labels: | # my.label=1 # another.label="here" -matrix_mautrix_googlechat_container_labels_additional_labels: '' +matrix_bridge_mautrix_googlechat_container_labels_additional_labels: '' # A list of extra arguments to pass to the container -matrix_mautrix_googlechat_container_extra_arguments: [] +matrix_bridge_mautrix_googlechat_container_extra_arguments: [] # List of systemd services that matrix-mautrix-googlechat.service depends on. -matrix_mautrix_googlechat_systemd_required_services_list: "{{ matrix_mautrix_googlechat_systemd_required_services_list_default + matrix_mautrix_googlechat_systemd_required_services_list_auto + matrix_mautrix_googlechat_systemd_required_services_list_custom }}" -matrix_mautrix_googlechat_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" -matrix_mautrix_googlechat_systemd_required_services_list_auto: [] -matrix_mautrix_googlechat_systemd_required_services_list_custom: [] +matrix_bridge_mautrix_googlechat_systemd_required_services_list: "{{ matrix_bridge_mautrix_googlechat_systemd_required_services_list_default + matrix_bridge_mautrix_googlechat_systemd_required_services_list_auto + matrix_bridge_mautrix_googlechat_systemd_required_services_list_custom }}" +matrix_bridge_mautrix_googlechat_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" +matrix_bridge_mautrix_googlechat_systemd_required_services_list_auto: [] +matrix_bridge_mautrix_googlechat_systemd_required_services_list_custom: [] # List of systemd services that matrix-mautrix-googlechat.service wants -matrix_mautrix_googlechat_systemd_wanted_services_list: [] +matrix_bridge_mautrix_googlechat_systemd_wanted_services_list: [] -matrix_mautrix_googlechat_appservice_token: '' -matrix_mautrix_googlechat_homeserver_token: '' +matrix_bridge_mautrix_googlechat_appservice_token: '' +matrix_bridge_mautrix_googlechat_homeserver_token: '' # 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_googlechat_metrics_proxying_enabled`. -matrix_mautrix_googlechat_metrics_enabled: false +# If metrics need to be consumed by another (external) Prometheus server, consider exposing them via `matrix_bridge_mautrix_googlechat_metrics_proxying_enabled`. +matrix_bridge_mautrix_googlechat_metrics_enabled: false # Controls whether metrics should be proxied (exposed) on a public URL. -matrix_mautrix_googlechat_metrics_proxying_enabled: false -matrix_mautrix_googlechat_metrics_proxying_hostname: '' -matrix_mautrix_googlechat_metrics_proxying_path_prefix: '' +matrix_bridge_mautrix_googlechat_metrics_proxying_enabled: false +matrix_bridge_mautrix_googlechat_metrics_proxying_hostname: '' +matrix_bridge_mautrix_googlechat_metrics_proxying_path_prefix: '' # Whether or not created rooms should have federation enabled. # If false, created portal rooms will never be federated. -matrix_mautrix_googlechat_federate_rooms: true +matrix_bridge_mautrix_googlechat_federate_rooms: true -matrix_mautrix_googlechat_bridge_permissions: | +matrix_bridge_mautrix_googlechat_bridge_permissions: | {{ - {matrix_mautrix_googlechat_homeserver_domain: 'user'} + {matrix_bridge_mautrix_googlechat_homeserver_domain: 'user'} | combine({matrix_admin: 'admin'} if matrix_admin else {}) }} @@ -130,81 +130,81 @@ matrix_mautrix_googlechat_bridge_permissions: | # To use SQLite, stick to these defaults. # # To use Postgres: -# - change the engine (`matrix_mautrix_googlechat_database_engine: 'postgres'`) -# - adjust your database credentials via the `matrix_mautrix_googlechat_database_*` variables -matrix_mautrix_googlechat_database_engine: 'sqlite' +# - change the engine (`matrix_bridge_mautrix_googlechat_database_engine: 'postgres'`) +# - adjust your database credentials via the `matrix_bridge_mautrix_googlechat_database_*` variables +matrix_bridge_mautrix_googlechat_database_engine: 'sqlite' -matrix_mautrix_googlechat_sqlite_database_path_local: "{{ matrix_mautrix_googlechat_data_path }}/mautrix-googlechat.db" -matrix_mautrix_googlechat_sqlite_database_path_in_container: "/data/mautrix-googlechat.db" +matrix_bridge_mautrix_googlechat_sqlite_database_path_local: "{{ matrix_bridge_mautrix_googlechat_data_path }}/mautrix-googlechat.db" +matrix_bridge_mautrix_googlechat_sqlite_database_path_in_container: "/data/mautrix-googlechat.db" -matrix_mautrix_googlechat_database_username: 'matrix_mautrix_googlechat' -matrix_mautrix_googlechat_database_password: 'some-password' -matrix_mautrix_googlechat_database_hostname: '' -matrix_mautrix_googlechat_database_port: 5432 -matrix_mautrix_googlechat_database_name: 'matrix_mautrix_googlechat' +matrix_bridge_mautrix_googlechat_database_username: 'matrix_mautrix_googlechat' +matrix_bridge_mautrix_googlechat_database_password: 'some-password' +matrix_bridge_mautrix_googlechat_database_hostname: '' +matrix_bridge_mautrix_googlechat_database_port: 5432 +matrix_bridge_mautrix_googlechat_database_name: 'matrix_mautrix_googlechat' -matrix_mautrix_googlechat_database_connection_string: 'postgres://{{ matrix_mautrix_googlechat_database_username }}:{{ matrix_mautrix_googlechat_database_password }}@{{ matrix_mautrix_googlechat_database_hostname }}:{{ matrix_mautrix_googlechat_database_port }}/{{ matrix_mautrix_googlechat_database_name }}' +matrix_bridge_mautrix_googlechat_database_connection_string: 'postgres://{{ matrix_bridge_mautrix_googlechat_database_username }}:{{ matrix_bridge_mautrix_googlechat_database_password }}@{{ matrix_bridge_mautrix_googlechat_database_hostname }}:{{ matrix_bridge_mautrix_googlechat_database_port }}/{{ matrix_bridge_mautrix_googlechat_database_name }}' -matrix_mautrix_googlechat_appservice_database: "{{ { - 'sqlite': ('sqlite:///' + matrix_mautrix_googlechat_sqlite_database_path_in_container), - 'postgres': matrix_mautrix_googlechat_database_connection_string, -}[matrix_mautrix_googlechat_database_engine] }}" +matrix_bridge_mautrix_googlechat_appservice_database: "{{ { + 'sqlite': ('sqlite:///' + matrix_bridge_mautrix_googlechat_sqlite_database_path_in_container), + 'postgres': matrix_bridge_mautrix_googlechat_database_connection_string, +}[matrix_bridge_mautrix_googlechat_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_googlechat_login_shared_secret: '' +matrix_bridge_mautrix_googlechat_login_shared_secret: '' -matrix_mautrix_googlechat_appservice_bot_username: googlechatbot +matrix_bridge_mautrix_googlechat_appservice_bot_username: googlechatbot # Specifies the default log level for all bridge loggers. -matrix_mautrix_googlechat_logging_level: WARNING +matrix_bridge_mautrix_googlechat_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_googlechat_configuration_extension_yaml`) +# For a more advanced customization, you can extend the default (see `matrix_bridge_mautrix_googlechat_configuration_extension_yaml`) # or completely replace this variable with your own template. -matrix_mautrix_googlechat_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" +matrix_bridge_mautrix_googlechat_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" -matrix_mautrix_googlechat_configuration_extension_yaml: | +matrix_bridge_mautrix_googlechat_configuration_extension_yaml: | # Your custom YAML configuration goes here. - # This configuration extends the default starting configuration (`matrix_mautrix_googlechat_configuration_yaml`). + # This configuration extends the default starting configuration (`matrix_bridge_mautrix_googlechat_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_googlechat_configuration_yaml`. + # completely redefining `matrix_bridge_mautrix_googlechat_configuration_yaml`. -matrix_mautrix_googlechat_configuration_extension: "{{ matrix_mautrix_googlechat_configuration_extension_yaml | from_yaml if matrix_mautrix_googlechat_configuration_extension_yaml | from_yaml is mapping else {} }}" +matrix_bridge_mautrix_googlechat_configuration_extension: "{{ matrix_bridge_mautrix_googlechat_configuration_extension_yaml | from_yaml if matrix_bridge_mautrix_googlechat_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_googlechat_configuration_yaml`. -matrix_mautrix_googlechat_configuration: "{{ matrix_mautrix_googlechat_configuration_yaml | from_yaml | combine(matrix_mautrix_googlechat_configuration_extension, recursive=True) }}" +# You most likely don't need to touch this variable. Instead, see `matrix_bridge_mautrix_googlechat_configuration_yaml`. +matrix_bridge_mautrix_googlechat_configuration: "{{ matrix_bridge_mautrix_googlechat_configuration_yaml | from_yaml | combine(matrix_bridge_mautrix_googlechat_configuration_extension, recursive=True) }}" -matrix_mautrix_googlechat_registration_yaml: | +matrix_bridge_mautrix_googlechat_registration_yaml: | id: googlechat - as_token: "{{ matrix_mautrix_googlechat_appservice_token }}" - hs_token: "{{ matrix_mautrix_googlechat_homeserver_token }}" + as_token: "{{ matrix_bridge_mautrix_googlechat_appservice_token }}" + hs_token: "{{ matrix_bridge_mautrix_googlechat_homeserver_token }}" namespaces: users: - exclusive: true - regex: '^@googlechat_.+:{{ matrix_mautrix_googlechat_homeserver_domain | regex_escape }}$' + regex: '^@googlechat_.+:{{ matrix_bridge_mautrix_googlechat_homeserver_domain | regex_escape }}$' - exclusive: true - regex: '^@{{ matrix_mautrix_googlechat_appservice_bot_username | regex_escape }}:{{ matrix_mautrix_googlechat_homeserver_domain | regex_escape }}$' - url: {{ matrix_mautrix_googlechat_appservice_address }} + regex: '^@{{ matrix_bridge_mautrix_googlechat_appservice_bot_username | regex_escape }}:{{ matrix_bridge_mautrix_googlechat_homeserver_domain | regex_escape }}$' + url: {{ matrix_bridge_mautrix_googlechat_appservice_address }} # See https://github.com/mautrix/signal/issues/43 - sender_localpart: _bot_{{ matrix_mautrix_googlechat_appservice_bot_username }} + sender_localpart: _bot_{{ matrix_bridge_mautrix_googlechat_appservice_bot_username }} rate_limited: false de.sorunome.msc2409.push_ephemeral: true receive_ephemeral: true -matrix_mautrix_googlechat_registration: "{{ matrix_mautrix_googlechat_registration_yaml | from_yaml }}" +matrix_bridge_mautrix_googlechat_registration: "{{ matrix_bridge_mautrix_googlechat_registration_yaml | from_yaml }}" # Enable End-to-bridge encryption -matrix_mautrix_googlechat_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}" -matrix_mautrix_googlechat_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}" +matrix_bridge_mautrix_googlechat_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}" +matrix_bridge_mautrix_googlechat_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}" -# matrix_mautrix_googlechat_restart_necessary controls whether the service +# matrix_bridge_mautrix_googlechat_restart_necessary controls whether the service # will be restarted (when true) or merely started (when false) by the # systemd service manager role (when conditional restart is enabled). # @@ -212,4 +212,4 @@ matrix_mautrix_googlechat_bridge_encryption_default: "{{ matrix_bridges_encrypti # any configuration files, the systemd service file, or the container image changed. # The default of `false` means "no restart needed" — appropriate when the role's # installation tasks haven't run (e.g., due to --tags skipping them). -matrix_mautrix_googlechat_restart_necessary: false +matrix_bridge_mautrix_googlechat_restart_necessary: false diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/main.yml b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/main.yml index 3cdc701da..06d619770 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/main.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/main.yml @@ -12,15 +12,15 @@ - install-all - install-mautrix-googlechat block: - - when: matrix_mautrix_googlechat_enabled | bool + - when: matrix_bridge_mautrix_googlechat_enabled | bool ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" - - when: matrix_mautrix_googlechat_enabled | bool + - when: matrix_bridge_mautrix_googlechat_enabled | bool ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" - tags: - setup-all - setup-mautrix-googlechat block: - - when: not matrix_mautrix_googlechat_enabled | bool + - when: not matrix_bridge_mautrix_googlechat_enabled | bool ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" 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 6ba44f709..6e2bfefb1 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml @@ -11,41 +11,41 @@ --- - ansible.builtin.set_fact: - matrix_mautrix_googlechat_migration_requires_restart: false + matrix_bridge_mautrix_googlechat_migration_requires_restart: false -- when: "matrix_mautrix_googlechat_database_engine == 'postgres'" +- when: "matrix_bridge_mautrix_googlechat_database_engine == 'postgres'" block: - name: Check if an SQLite database already exists ansible.builtin.stat: - path: "{{ matrix_mautrix_googlechat_sqlite_database_path_local }}" - register: matrix_mautrix_googlechat_sqlite_database_path_local_stat_result + path: "{{ matrix_bridge_mautrix_googlechat_sqlite_database_path_local }}" + register: matrix_bridge_mautrix_googlechat_sqlite_database_path_local_stat_result - - when: "matrix_mautrix_googlechat_sqlite_database_path_local_stat_result.stat.exists | bool" + - when: "matrix_bridge_mautrix_googlechat_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_googlechat_sqlite_database_path_local }}" - dst: "{{ matrix_mautrix_googlechat_database_connection_string }}" + src: "{{ matrix_bridge_mautrix_googlechat_sqlite_database_path_local }}" + dst: "{{ matrix_bridge_mautrix_googlechat_database_connection_string }}" caller: "{{ role_path | basename }}" - engine_variable_name: 'matrix_mautrix_googlechat_database_engine' + engine_variable_name: 'matrix_bridge_mautrix_googlechat_database_engine' engine_old: 'sqlite' systemd_services_to_stop: ['matrix-mautrix-googlechat.service'] - ansible.builtin.set_fact: - matrix_mautrix_googlechat_migration_requires_restart: true + matrix_bridge_mautrix_googlechat_migration_requires_restart: true - name: Ensure Mautrix googlechat image is pulled community.docker.docker_image_pull: - name: "{{ matrix_mautrix_googlechat_container_image }}" + name: "{{ matrix_bridge_mautrix_googlechat_container_image }}" pull: always - when: not matrix_mautrix_googlechat_container_image_self_build - register: matrix_mautrix_googlechat_container_image_pull_result + when: not matrix_bridge_mautrix_googlechat_container_image_self_build + register: matrix_bridge_mautrix_googlechat_container_image_pull_result retries: "{{ devture_playbook_help_container_retries_count }}" delay: "{{ devture_playbook_help_container_retries_delay }}" - until: matrix_mautrix_googlechat_container_image_pull_result is not failed + until: matrix_bridge_mautrix_googlechat_container_image_pull_result is not failed - name: Ensure Mautrix googlechat paths exist ansible.builtin.file: @@ -55,37 +55,37 @@ owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" with_items: - - {path: "{{ matrix_mautrix_googlechat_base_path }}", when: true} - - {path: "{{ matrix_mautrix_googlechat_config_path }}", when: true} - - {path: "{{ matrix_mautrix_googlechat_data_path }}", when: true} - - {path: "{{ matrix_mautrix_googlechat_container_src_files_path }}", when: "{{ matrix_mautrix_googlechat_container_image_self_build }}"} + - {path: "{{ matrix_bridge_mautrix_googlechat_base_path }}", when: true} + - {path: "{{ matrix_bridge_mautrix_googlechat_config_path }}", when: true} + - {path: "{{ matrix_bridge_mautrix_googlechat_data_path }}", when: true} + - {path: "{{ matrix_bridge_mautrix_googlechat_container_src_files_path }}", when: "{{ matrix_bridge_mautrix_googlechat_container_image_self_build }}"} when: "item.when | bool" - name: Ensure Mautrix Hangots repository is present on self build ansible.builtin.git: - repo: "{{ matrix_mautrix_googlechat_container_image_self_build_repo }}" - version: "{{ matrix_mautrix_googlechat_container_image_self_build_repo_version }}" - dest: "{{ matrix_mautrix_googlechat_container_src_files_path }}" + repo: "{{ matrix_bridge_mautrix_googlechat_container_image_self_build_repo }}" + version: "{{ matrix_bridge_mautrix_googlechat_container_image_self_build_repo_version }}" + dest: "{{ matrix_bridge_mautrix_googlechat_container_src_files_path }}" force: "yes" become: true become_user: "{{ matrix_user_name }}" - register: matrix_mautrix_googlechat_git_pull_results - when: "matrix_mautrix_googlechat_container_image_self_build | bool" + register: matrix_bridge_mautrix_googlechat_git_pull_results + when: "matrix_bridge_mautrix_googlechat_container_image_self_build | bool" - name: Ensure Mautrix googlechat Docker image is built community.docker.docker_image_build: - name: "{{ matrix_mautrix_googlechat_container_image }}" + name: "{{ matrix_bridge_mautrix_googlechat_container_image }}" dockerfile: Dockerfile - path: "{{ matrix_mautrix_googlechat_container_src_files_path }}" + path: "{{ matrix_bridge_mautrix_googlechat_container_src_files_path }}" pull: true - rebuild: "{{ 'always' if matrix_mautrix_googlechat_git_pull_results.changed | bool else 'never' }}" - when: "matrix_mautrix_googlechat_container_image_self_build | bool" - register: matrix_mautrix_googlechat_container_image_build_result + rebuild: "{{ 'always' if matrix_bridge_mautrix_googlechat_git_pull_results.changed | bool else 'never' }}" + when: "matrix_bridge_mautrix_googlechat_container_image_self_build | bool" + register: matrix_bridge_mautrix_googlechat_container_image_build_result - name: Check if an old database file already exists ansible.builtin.stat: - path: "{{ matrix_mautrix_googlechat_base_path }}/mautrix-googlechat.db" - register: matrix_mautrix_googlechat_stat_database + path: "{{ matrix_bridge_mautrix_googlechat_base_path }}/mautrix-googlechat.db" + register: matrix_bridge_mautrix_googlechat_stat_database - name: (Data relocation) Ensure matrix-mautrix-googlechat.service is stopped ansible.builtin.service: @@ -94,49 +94,49 @@ enabled: false daemon_reload: true failed_when: false - when: "matrix_mautrix_googlechat_stat_database.stat.exists" + when: "matrix_bridge_mautrix_googlechat_stat_database.stat.exists" - name: (Data relocation) Move mautrix-googlechat database file to ./data directory ansible.builtin.command: - cmd: "mv {{ matrix_mautrix_googlechat_base_path }}/mautrix-googlechat.db {{ matrix_mautrix_googlechat_data_path }}/mautrix-googlechat.db" - creates: "{{ matrix_mautrix_googlechat_data_path }}/mautrix-googlechat.db" - removes: "{{ matrix_mautrix_googlechat_base_path }}/mautrix-googlechat.db" - when: "matrix_mautrix_googlechat_stat_database.stat.exists" + cmd: "mv {{ matrix_bridge_mautrix_googlechat_base_path }}/mautrix-googlechat.db {{ matrix_bridge_mautrix_googlechat_data_path }}/mautrix-googlechat.db" + creates: "{{ matrix_bridge_mautrix_googlechat_data_path }}/mautrix-googlechat.db" + removes: "{{ matrix_bridge_mautrix_googlechat_base_path }}/mautrix-googlechat.db" + when: "matrix_bridge_mautrix_googlechat_stat_database.stat.exists" - name: Ensure mautrix-googlechat config.yaml installed ansible.builtin.copy: - content: "{{ matrix_mautrix_googlechat_configuration | to_nice_yaml(indent=2, width=999999) }}" - dest: "{{ matrix_mautrix_googlechat_config_path }}/config.yaml" + content: "{{ matrix_bridge_mautrix_googlechat_configuration | to_nice_yaml(indent=2, width=999999) }}" + dest: "{{ matrix_bridge_mautrix_googlechat_config_path }}/config.yaml" mode: '0644' owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" - register: matrix_mautrix_googlechat_config_result + register: matrix_bridge_mautrix_googlechat_config_result - name: Ensure mautrix-googlechat registration.yaml installed ansible.builtin.copy: - content: "{{ matrix_mautrix_googlechat_registration | to_nice_yaml(indent=2, width=999999) }}" - dest: "{{ matrix_mautrix_googlechat_config_path }}/registration.yaml" + content: "{{ matrix_bridge_mautrix_googlechat_registration | to_nice_yaml(indent=2, width=999999) }}" + dest: "{{ matrix_bridge_mautrix_googlechat_config_path }}/registration.yaml" mode: '0644' owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" - register: matrix_mautrix_googlechat_registration_result + register: matrix_bridge_mautrix_googlechat_registration_result - name: Ensure mautrix-googlechat support files installed ansible.builtin.template: src: "{{ role_path }}/templates/{{ item }}.j2" - dest: "{{ matrix_mautrix_googlechat_base_path }}/{{ item }}" + dest: "{{ matrix_bridge_mautrix_googlechat_base_path }}/{{ item }}" mode: '0640' owner: "{{ matrix_user_name }}" group: "{{ matrix_group_name }}" with_items: - labels - register: matrix_mautrix_googlechat_support_files_result + register: matrix_bridge_mautrix_googlechat_support_files_result - name: Ensure matrix-mautrix-googlechat container network is created - when: matrix_mautrix_googlechat_container_network != 'host' + when: matrix_bridge_mautrix_googlechat_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" - name: "{{ matrix_mautrix_googlechat_container_network }}" + name: "{{ matrix_bridge_mautrix_googlechat_container_network }}" driver: bridge driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" @@ -145,19 +145,19 @@ src: "{{ role_path }}/templates/systemd/matrix-mautrix-googlechat.service.j2" dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-googlechat.service" mode: '0644' - register: matrix_mautrix_googlechat_systemd_service_result + register: matrix_bridge_mautrix_googlechat_systemd_service_result - name: Determine whether matrix-mautrix-googlechat needs a restart ansible.builtin.set_fact: - matrix_mautrix_googlechat_restart_necessary: >- + matrix_bridge_mautrix_googlechat_restart_necessary: >- {{ - matrix_mautrix_googlechat_migration_requires_restart | default(false) - or matrix_mautrix_googlechat_config_result.changed | default(false) - or matrix_mautrix_googlechat_registration_result.changed | default(false) - or matrix_mautrix_googlechat_support_files_result.changed | default(false) - or matrix_mautrix_googlechat_systemd_service_result.changed | default(false) - or matrix_mautrix_googlechat_container_image_pull_result.changed | default(false) - or matrix_mautrix_googlechat_container_image_build_result.changed | default(false) + matrix_bridge_mautrix_googlechat_migration_requires_restart | default(false) + or matrix_bridge_mautrix_googlechat_config_result.changed | default(false) + or matrix_bridge_mautrix_googlechat_registration_result.changed | default(false) + or matrix_bridge_mautrix_googlechat_support_files_result.changed | default(false) + or matrix_bridge_mautrix_googlechat_systemd_service_result.changed | default(false) + or matrix_bridge_mautrix_googlechat_container_image_pull_result.changed | default(false) + or matrix_bridge_mautrix_googlechat_container_image_build_result.changed | default(false) }} - name: Ensure matrix-mautrix-googlechat.service restarted, if necessary @@ -165,4 +165,4 @@ name: "matrix-mautrix-googlechat.service" state: restarted daemon_reload: true - when: "matrix_mautrix_googlechat_migration_requires_restart | bool" + when: "matrix_bridge_mautrix_googlechat_migration_requires_restart | bool" diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml index 412a08847..a32247ba9 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_uninstall.yml @@ -9,9 +9,9 @@ - name: Check existence of matrix-mautrix-googlechat service ansible.builtin.stat: path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-googlechat.service" - register: matrix_mautrix_googlechat_service_stat + register: matrix_bridge_mautrix_googlechat_service_stat -- when: matrix_mautrix_googlechat_service_stat.stat.exists | bool +- when: matrix_bridge_mautrix_googlechat_service_stat.stat.exists | bool block: - name: Ensure matrix-mautrix-googlechat is stopped ansible.builtin.service: diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml index 7f8919f55..c6b185667 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/validate_config.yml @@ -14,14 +14,14 @@ 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_googlechat_docker_image_name_prefix', 'new': 'matrix_mautrix_googlechat_container_image_registry_prefix'} - - {'old': 'matrix_mautrix_googlechat_docker_image', 'new': 'matrix_mautrix_googlechat_container_image'} - - {'old': 'matrix_mautrix_googlechat_docker_image_force_pull', 'new': 'matrix_mautrix_googlechat_container_image_force_pull'} - - {'old': 'matrix_mautrix_googlechat_docker_image_registry_prefix', 'new': 'matrix_mautrix_googlechat_container_image_registry_prefix'} - - {'old': 'matrix_mautrix_googlechat_docker_image_registry_prefix_upstream', 'new': 'matrix_mautrix_googlechat_container_image_registry_prefix_upstream'} - - {'old': 'matrix_mautrix_googlechat_docker_image_registry_prefix_upstream_default', 'new': 'matrix_mautrix_googlechat_container_image_registry_prefix_upstream_default'} - - {'old': 'matrix_mautrix_googlechat_docker_src_files_path', 'new': 'matrix_mautrix_googlechat_container_src_files_path'} - - {'old': 'matrix_mautrix_googlechat_container_image_force_pull', 'new': ' (the new community.docker.docker_image_pull module handles this natively)'} + - {'old': 'matrix_bridge_mautrix_googlechat_docker_image_name_prefix', 'new': 'matrix_bridge_mautrix_googlechat_container_image_registry_prefix'} + - {'old': 'matrix_bridge_mautrix_googlechat_docker_image', 'new': 'matrix_bridge_mautrix_googlechat_container_image'} + - {'old': 'matrix_bridge_mautrix_googlechat_docker_image_force_pull', 'new': 'matrix_bridge_mautrix_googlechat_container_image_force_pull'} + - {'old': 'matrix_bridge_mautrix_googlechat_docker_image_registry_prefix', 'new': 'matrix_bridge_mautrix_googlechat_container_image_registry_prefix'} + - {'old': 'matrix_bridge_mautrix_googlechat_docker_image_registry_prefix_upstream', 'new': 'matrix_bridge_mautrix_googlechat_container_image_registry_prefix_upstream'} + - {'old': 'matrix_bridge_mautrix_googlechat_docker_image_registry_prefix_upstream_default', 'new': 'matrix_bridge_mautrix_googlechat_container_image_registry_prefix_upstream_default'} + - {'old': 'matrix_bridge_mautrix_googlechat_docker_src_files_path', 'new': 'matrix_bridge_mautrix_googlechat_container_src_files_path'} + - {'old': 'matrix_bridge_mautrix_googlechat_container_image_force_pull', 'new': ' (the new community.docker.docker_image_pull module handles this natively)'} - name: Fail if required mautrix-googlechat settings not defined ansible.builtin.fail: @@ -29,13 +29,13 @@ 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_googlechat_public_endpoint', when: true} - - {'name': 'matrix_mautrix_googlechat_appservice_token', when: true} - - {'name': 'matrix_mautrix_googlechat_homeserver_token', when: true} - - {'name': 'matrix_mautrix_googlechat_database_hostname', when: "{{ matrix_mautrix_googlechat_database_engine == 'postgres' }}"} - - {'name': 'matrix_mautrix_googlechat_container_network', when: true} - - {'name': 'matrix_mautrix_googlechat_homeserver_address', when: true} - - {'name': 'matrix_mautrix_googlechat_metrics_proxying_hostname', when: "{{ matrix_mautrix_googlechat_metrics_proxying_enabled }}"} - - {'name': 'matrix_mautrix_googlechat_metrics_proxying_path_prefix', when: "{{ matrix_mautrix_googlechat_metrics_proxying_enabled }}"} - - {'name': 'matrix_mautrix_googlechat_container_labels_public_endpoint_hostname', when: "{{ matrix_mautrix_googlechat_container_labels_public_endpoint_enabled }}"} - - {'name': 'matrix_mautrix_googlechat_container_labels_public_endpoint_path_prefix', when: "{{ matrix_mautrix_googlechat_container_labels_public_endpoint_enabled }}"} + - {'name': 'matrix_bridge_mautrix_googlechat_public_endpoint', when: true} + - {'name': 'matrix_bridge_mautrix_googlechat_appservice_token', when: true} + - {'name': 'matrix_bridge_mautrix_googlechat_homeserver_token', when: true} + - {'name': 'matrix_bridge_mautrix_googlechat_database_hostname', when: "{{ matrix_bridge_mautrix_googlechat_database_engine == 'postgres' }}"} + - {'name': 'matrix_bridge_mautrix_googlechat_container_network', when: true} + - {'name': 'matrix_bridge_mautrix_googlechat_homeserver_address', when: true} + - {'name': 'matrix_bridge_mautrix_googlechat_metrics_proxying_hostname', when: "{{ matrix_bridge_mautrix_googlechat_metrics_proxying_enabled }}"} + - {'name': 'matrix_bridge_mautrix_googlechat_metrics_proxying_path_prefix', when: "{{ matrix_bridge_mautrix_googlechat_metrics_proxying_enabled }}"} + - {'name': 'matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_hostname', when: "{{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_enabled }}"} + - {'name': 'matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_path_prefix', when: "{{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_enabled }}"} diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-googlechat/templates/config.yaml.j2 index 83b13f6cf..f3e74521b 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-googlechat/templates/config.yaml.j2 @@ -2,9 +2,9 @@ # Homeserver details homeserver: # The address that this appservice can use to connect to the homeserver. - address: {{ matrix_mautrix_googlechat_homeserver_address }} + address: {{ matrix_bridge_mautrix_googlechat_homeserver_address }} # The domain of the homeserver (for MXIDs, etc). - domain: {{ matrix_mautrix_googlechat_homeserver_domain }} + domain: {{ matrix_bridge_mautrix_googlechat_homeserver_domain }} # Whether or not to verify the SSL certificate of the homeserver. # Only applies if address starts with https:// verify_ssl: true @@ -13,7 +13,7 @@ homeserver: # Changing these values requires regeneration of the registration. appservice: # The address that the homeserver can use to connect to this appservice. - address: {{ matrix_mautrix_googlechat_appservice_address }} + address: {{ matrix_bridge_mautrix_googlechat_appservice_address }} # The hostname and port where this appservice should listen. hostname: 0.0.0.0 @@ -27,24 +27,24 @@ appservice: # Format examples: # SQLite: sqlite:///filename.db # Postgres: postgres://username:password@hostname/dbname - database: {{ matrix_mautrix_googlechat_appservice_database|to_json }} + database: {{ matrix_bridge_mautrix_googlechat_appservice_database|to_json }} # The unique ID of this appservice. id: googlechat # Username of the appservice bot. - bot_username: {{ matrix_mautrix_googlechat_appservice_bot_username|to_json }} + bot_username: {{ matrix_bridge_mautrix_googlechat_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: googlechat bridge bot bot_avatar: mxc://maunium.net/FBXZnpfORkBEruORbikmleAy # Authentication tokens for AS <-> HS communication. - as_token: "{{ matrix_mautrix_googlechat_appservice_token }}" - hs_token: "{{ matrix_mautrix_googlechat_homeserver_token }}" + as_token: "{{ matrix_bridge_mautrix_googlechat_appservice_token }}" + hs_token: "{{ matrix_bridge_mautrix_googlechat_homeserver_token }}" # Prometheus telemetry config. Requires prometheus-client to be installed. metrics: - enabled: {{ matrix_mautrix_googlechat_metrics_enabled | to_json }} + enabled: {{ matrix_bridge_mautrix_googlechat_metrics_enabled | to_json }} listen_port: 8000 # Bridge config @@ -67,7 +67,7 @@ bridge: - name # The prefix for commands. Only required in non-management rooms. - command_prefix: "{{ matrix_mautrix_googlechat_command_prefix }}" + command_prefix: "{{ matrix_bridge_mautrix_googlechat_command_prefix }}" # Number of chats to sync (and create portals for) on startup/login. # Maximum 20, set 0 to disable automatic syncing. @@ -83,7 +83,7 @@ bridge: # 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. - login_shared_secret: {{ matrix_mautrix_googlechat_login_shared_secret|to_json }} + login_shared_secret: {{ matrix_bridge_mautrix_googlechat_login_shared_secret|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 @@ -93,14 +93,14 @@ bridge: # application service. encryption: # Allow encryption, work in group chat rooms with e2ee enabled - allow: {{ matrix_mautrix_googlechat_bridge_encryption_allow|to_json }} + allow: {{ matrix_bridge_mautrix_googlechat_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_googlechat_bridge_encryption_default|to_json }} + default: {{ matrix_bridge_mautrix_googlechat_bridge_encryption_default|to_json }} # Whether or not created rooms should have federation enabled. # If false, created portal rooms will never be federated. - federate_rooms: {{ matrix_mautrix_googlechat_federate_rooms|to_json }} + federate_rooms: {{ matrix_bridge_mautrix_googlechat_federate_rooms|to_json }} # Public website and API configs web: # Auth server config @@ -110,8 +110,8 @@ bridge: # or otherwise pointed to the appservice's webserver to the path specified below (prefix). # This path should usually include a trailing slash. # Internal prefix in the appservice web server for the login endpoints. - public: "{{ matrix_homeserver_url }}{{ matrix_mautrix_googlechat_public_endpoint }}/login" - prefix: "{{ matrix_mautrix_googlechat_public_endpoint }}/login" + public: "{{ matrix_homeserver_url }}{{ matrix_bridge_mautrix_googlechat_public_endpoint }}/login" + prefix: "{{ matrix_bridge_mautrix_googlechat_public_endpoint }}/login" # Permissions for using the bridge. @@ -122,7 +122,7 @@ bridge: # * - All Matrix users # domain - All users on that homeserver # mxid - Specific user - permissions: {{ matrix_mautrix_googlechat_bridge_permissions|to_json }} + permissions: {{ matrix_bridge_mautrix_googlechat_bridge_permissions|to_json }} # Python logging configuration. # @@ -142,11 +142,11 @@ logging: formatter: colored loggers: mau: - level: {{ matrix_mautrix_googlechat_logging_level|to_json }} + level: {{ matrix_bridge_mautrix_googlechat_logging_level|to_json }} hangups: - level: {{ matrix_mautrix_googlechat_logging_level|to_json }} + level: {{ matrix_bridge_mautrix_googlechat_logging_level|to_json }} aiohttp: - level: {{ matrix_mautrix_googlechat_logging_level|to_json }} + level: {{ matrix_bridge_mautrix_googlechat_logging_level|to_json }} root: - level: {{ matrix_mautrix_googlechat_logging_level|to_json }} + level: {{ matrix_bridge_mautrix_googlechat_logging_level|to_json }} handlers: [console] diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/templates/labels.j2 b/roles/custom/matrix-bridge-mautrix-googlechat/templates/labels.j2 index 567dc2958..bc4ea211f 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/templates/labels.j2 +++ b/roles/custom/matrix-bridge-mautrix-googlechat/templates/labels.j2 @@ -4,35 +4,35 @@ SPDX-FileCopyrightText: 2024 Slavi Pantaleev SPDX-License-Identifier: AGPL-3.0-or-later #} -{% if matrix_mautrix_googlechat_container_labels_traefik_enabled %} +{% if matrix_bridge_mautrix_googlechat_container_labels_traefik_enabled %} traefik.enable=true -{% if matrix_mautrix_googlechat_container_labels_traefik_docker_network %} -traefik.docker.network={{ matrix_mautrix_googlechat_container_labels_traefik_docker_network }} +{% if matrix_bridge_mautrix_googlechat_container_labels_traefik_docker_network %} +traefik.docker.network={{ matrix_bridge_mautrix_googlechat_container_labels_traefik_docker_network }} {% endif %} traefik.http.services.matrix-mautrix-googlechat-public.loadbalancer.server.port=8080 traefik.http.services.matrix-mautrix-googlechat-metrics.loadbalancer.server.port=8000 -{% if matrix_mautrix_googlechat_container_labels_public_endpoint_enabled %} +{% if matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_enabled %} ############################################################ # # # Public # # # ############################################################ -traefik.http.routers.matrix-mautrix-googlechat-public.rule={{ matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_rule }} +traefik.http.routers.matrix-mautrix-googlechat-public.rule={{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_rule }} -{% if matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_priority | int > 0 %} -traefik.http.routers.matrix-mautrix-googlechat-public.priority={{ matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_priority }} +{% if matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_priority | int > 0 %} +traefik.http.routers.matrix-mautrix-googlechat-public.priority={{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_priority }} {% endif %} traefik.http.routers.matrix-mautrix-googlechat-public.service=matrix-mautrix-googlechat-public -traefik.http.routers.matrix-mautrix-googlechat-public.entrypoints={{ matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_entrypoints }} +traefik.http.routers.matrix-mautrix-googlechat-public.entrypoints={{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_entrypoints }} -traefik.http.routers.matrix-mautrix-googlechat-public.tls={{ matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_tls | to_json }} -{% if matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_tls %} -traefik.http.routers.matrix-mautrix-googlechat-public.tls.certResolver={{ matrix_mautrix_googlechat_container_labels_public_endpoint_traefik_tls_certResolver }} +traefik.http.routers.matrix-mautrix-googlechat-public.tls={{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_tls | to_json }} +{% if matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_tls %} +traefik.http.routers.matrix-mautrix-googlechat-public.tls.certResolver={{ matrix_bridge_mautrix_googlechat_container_labels_public_endpoint_traefik_tls_certResolver }} {% endif %} ############################################################ @@ -43,30 +43,30 @@ traefik.http.routers.matrix-mautrix-googlechat-public.tls.certResolver={{ matrix {% endif %} -{% if matrix_mautrix_googlechat_container_labels_metrics_enabled %} +{% if matrix_bridge_mautrix_googlechat_container_labels_metrics_enabled %} ############################################################ # # # Metrics # # # ############################################################ -{% if matrix_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_enabled %} -traefik.http.middlewares.matrix-mautrix-googlechat-metrics-basic-auth.basicauth.users={{ matrix_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_users }} +{% if matrix_bridge_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_enabled %} +traefik.http.middlewares.matrix-mautrix-googlechat-metrics-basic-auth.basicauth.users={{ matrix_bridge_mautrix_googlechat_container_labels_metrics_middleware_basic_auth_users }} traefik.http.routers.matrix-mautrix-googlechat-metrics.middlewares=matrix-mautrix-googlechat-metrics-basic-auth {% endif %} -traefik.http.routers.matrix-mautrix-googlechat-metrics.rule={{ matrix_mautrix_googlechat_container_labels_metrics_traefik_rule }} +traefik.http.routers.matrix-mautrix-googlechat-metrics.rule={{ matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_rule }} -{% if matrix_mautrix_googlechat_container_labels_metrics_traefik_priority | int > 0 %} -traefik.http.routers.matrix-mautrix-googlechat-metrics.priority={{ matrix_mautrix_googlechat_container_labels_metrics_traefik_priority }} +{% if matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_priority | int > 0 %} +traefik.http.routers.matrix-mautrix-googlechat-metrics.priority={{ matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_priority }} {% endif %} traefik.http.routers.matrix-mautrix-googlechat-metrics.service=matrix-mautrix-googlechat-metrics -traefik.http.routers.matrix-mautrix-googlechat-metrics.entrypoints={{ matrix_mautrix_googlechat_container_labels_metrics_traefik_entrypoints }} +traefik.http.routers.matrix-mautrix-googlechat-metrics.entrypoints={{ matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_entrypoints }} -traefik.http.routers.matrix-mautrix-googlechat-metrics.tls={{ matrix_mautrix_googlechat_container_labels_metrics_traefik_tls | to_json }} -{% if matrix_mautrix_googlechat_container_labels_metrics_traefik_tls %} -traefik.http.routers.matrix-mautrix-googlechat-metrics.tls.certResolver={{ matrix_mautrix_googlechat_container_labels_metrics_traefik_tls_certResolver }} +traefik.http.routers.matrix-mautrix-googlechat-metrics.tls={{ matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_tls | to_json }} +{% if matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_tls %} +traefik.http.routers.matrix-mautrix-googlechat-metrics.tls.certResolver={{ matrix_bridge_mautrix_googlechat_container_labels_metrics_traefik_tls_certResolver }} {% endif %} ############################################################ @@ -79,4 +79,4 @@ traefik.http.routers.matrix-mautrix-googlechat-metrics.tls.certResolver={{ matri {% endif %} -{{ matrix_mautrix_googlechat_container_labels_additional_labels }} +{{ matrix_bridge_mautrix_googlechat_container_labels_additional_labels }} diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/templates/systemd/matrix-mautrix-googlechat.service.j2 b/roles/custom/matrix-bridge-mautrix-googlechat/templates/systemd/matrix-mautrix-googlechat.service.j2 index d616433bb..c651ef94a 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/templates/systemd/matrix-mautrix-googlechat.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-googlechat/templates/systemd/matrix-mautrix-googlechat.service.j2 @@ -1,11 +1,11 @@ #jinja2: lstrip_blocks: True [Unit] Description=Matrix Mautrix googlechat bridge -{% for service in matrix_mautrix_googlechat_systemd_required_services_list %} +{% for service in matrix_bridge_mautrix_googlechat_systemd_required_services_list %} Requires={{ service }} After={{ service }} {% endfor %} -{% for service in matrix_mautrix_googlechat_systemd_wanted_services_list %} +{% for service in matrix_bridge_mautrix_googlechat_systemd_wanted_services_list %} Wants={{ service }} {% endfor %} DefaultDependencies=no @@ -22,21 +22,21 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --log-driver=none \ --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ --cap-drop=ALL \ - --network={{ matrix_mautrix_googlechat_container_network }} \ - {% if matrix_mautrix_googlechat_container_http_host_bind_port %} - -p {{ matrix_mautrix_googlechat_container_http_host_bind_port }}:8080 \ + --network={{ matrix_bridge_mautrix_googlechat_container_network }} \ + {% if matrix_bridge_mautrix_googlechat_container_http_host_bind_port %} + -p {{ matrix_bridge_mautrix_googlechat_container_http_host_bind_port }}:8080 \ {% endif %} - --mount type=bind,src={{ matrix_mautrix_googlechat_config_path }},dst=/config \ - --mount type=bind,src={{ matrix_mautrix_googlechat_data_path }},dst=/data \ - --label-file={{ matrix_mautrix_googlechat_base_path }}/labels \ - {% for arg in matrix_mautrix_googlechat_container_extra_arguments %} + --mount type=bind,src={{ matrix_bridge_mautrix_googlechat_config_path }},dst=/config \ + --mount type=bind,src={{ matrix_bridge_mautrix_googlechat_data_path }},dst=/data \ + --label-file={{ matrix_bridge_mautrix_googlechat_base_path }}/labels \ + {% for arg in matrix_bridge_mautrix_googlechat_container_extra_arguments %} {{ arg }} \ {% endfor %} - {{ matrix_mautrix_googlechat_container_image }} \ + {{ matrix_bridge_mautrix_googlechat_container_image }} \ python3 -m mautrix_googlechat -c /config/config.yaml --no-update -{% if matrix_mautrix_googlechat_container_network != 'host' %} -{% for network in matrix_mautrix_googlechat_container_additional_networks %} +{% if matrix_bridge_mautrix_googlechat_container_network != 'host' %} +{% for network in matrix_bridge_mautrix_googlechat_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-googlechat {% endfor %} {% endif %}