add Google Voice bridge, fixes #3574 (#5426)

This commit is contained in:
Aine
2026-07-15 19:15:58 +01:00
committed by GitHub
parent b2788f690a
commit 5da2d0e4a5
18 changed files with 1250 additions and 0 deletions
+104
View File
@@ -132,6 +132,8 @@ matrix_homeserver_container_extra_arguments_auto: |
+
(['--mount type=bind,src=' + matrix_mautrix_gmessages_config_path + '/registration.yaml,dst=/matrix-mautrix-gmessages-registration.yaml,ro'] if matrix_mautrix_gmessages_enabled else [])
+
(['--mount type=bind,src=' + matrix_mautrix_gvoice_config_path + '/registration.yaml,dst=/matrix-mautrix-gvoice-registration.yaml,ro'] if matrix_mautrix_gvoice_enabled else [])
+
(['--mount type=bind,src=' + matrix_mautrix_whatsapp_config_path + '/registration.yaml,dst=/matrix-mautrix-whatsapp-registration.yaml,ro'] if matrix_mautrix_whatsapp_enabled else [])
+
(['--mount type=bind,src=' + matrix_mautrix_wsproxy_config_path + '/androidsms-registration.yaml,dst=/matrix-mautrix-androidsms-registration.yaml,ro'] if matrix_mautrix_wsproxy_enabled else [])
@@ -189,6 +191,8 @@ matrix_homeserver_app_service_config_files_auto: |
+
(['/matrix-mautrix-gmessages-registration.yaml'] if matrix_mautrix_gmessages_enabled else [])
+
(['/matrix-mautrix-gvoice-registration.yaml'] if matrix_mautrix_gvoice_enabled else [])
+
(['/matrix-mautrix-whatsapp-registration.yaml'] if matrix_mautrix_whatsapp_enabled else [])
+
(['/matrix-mautrix-androidsms-registration.yaml'] if matrix_mautrix_wsproxy_enabled else [])
@@ -485,6 +489,13 @@ devture_systemd_service_manager_services_list_auto: |
'groups': ['matrix', 'bridges', 'mautrix-gmessages'],
}] if matrix_mautrix_gmessages_enabled else [])
+
([{
'name': 'matrix-mautrix-gvoice.service',
'priority': 2000,
'restart_necessary': (matrix_mautrix_gvoice_restart_necessary | bool),
'groups': ['matrix', 'bridges', 'mautrix-gvoice'],
}] if matrix_mautrix_gvoice_enabled else [])
+
([{
'name': 'matrix-mautrix-whatsapp.service',
'priority': 2000,
@@ -2199,6 +2210,87 @@ matrix_mautrix_gmessages_database_password: "{{ (matrix_homeserver_generic_secre
#
######################################################################
######################################################################
#
# matrix-bridge-mautrix-gvoice
#
######################################################################
# We don't enable bridges by default.
matrix_mautrix_gvoice_enabled: false
matrix_mautrix_gvoice_systemd_required_services_list_auto: |
{{
matrix_addons_homeserver_systemd_services_list
+
([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_mautrix_gvoice_database_hostname == postgres_connection_hostname) else [])
}}
matrix_mautrix_gvoice_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_mautrix_gvoice_container_image_registry_prefix_upstream_default }}"
matrix_mautrix_gvoice_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}"
matrix_mautrix_gvoice_container_network: "{{ matrix_addons_container_network }}"
matrix_mautrix_gvoice_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_gvoice_database_hostname == postgres_connection_hostname and matrix_mautrix_gvoice_container_network != postgres_container_network) else [])
+
([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_playbook_reverse_proxyable_services_additional_network and matrix_mautrix_gvoice_container_labels_traefik_enabled) else [])
) | unique
}}
matrix_mautrix_gvoice_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
matrix_mautrix_gvoice_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
matrix_mautrix_gvoice_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
matrix_mautrix_gvoice_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"
matrix_mautrix_gvoice_container_labels_metrics_middleware_basic_auth_enabled: "{{ matrix_metrics_exposure_http_basic_auth_enabled }}"
matrix_mautrix_gvoice_container_labels_metrics_middleware_basic_auth_users: "{{ matrix_metrics_exposure_http_basic_auth_users }}"
matrix_mautrix_gvoice_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':gvoice.as.token') | hash('sha512') | to_uuid }}"
matrix_mautrix_gvoice_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}"
matrix_mautrix_gvoice_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':gvoice.hs.token') | hash('sha512') | to_uuid }}"
matrix_mautrix_gvoice_provisioning_shared_secret: "{{ (matrix_homeserver_generic_secret_key + ':gvoice.prov') | hash('sha512') | to_uuid }}"
matrix_mautrix_gvoice_homeserver_async_media: "{{ matrix_homeserver_implementation in ['synapse'] }}"
matrix_mautrix_gvoice_double_puppet_secrets_auto: |-
{{
{
matrix_mautrix_gvoice_homeserver_domain: ("as_token:" + matrix_appservice_double_puppet_registration_as_token)
}
if matrix_appservice_double_puppet_enabled
else {}
}}
matrix_mautrix_gvoice_metrics_enabled: "{{ prometheus_enabled or matrix_metrics_exposure_enabled }}"
matrix_mautrix_gvoice_metrics_proxying_enabled: "{{ matrix_mautrix_gvoice_metrics_enabled and matrix_metrics_exposure_enabled }}"
matrix_mautrix_gvoice_metrics_proxying_hostname: "{{ matrix_metrics_exposure_hostname }}"
matrix_mautrix_gvoice_metrics_proxying_path_prefix: "{{ matrix_metrics_exposure_path_prefix }}/mautrix-gvoice"
matrix_mautrix_gvoice_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}"
matrix_mautrix_gvoice_exposure_enabled: "{{ matrix_bridges_exposure_enabled }}"
matrix_mautrix_gvoice_exposure_hostname: "{{ matrix_bridges_exposure_hostname }}"
matrix_mautrix_gvoice_exposure_path_prefix: "{{ matrix_bridges_exposure_path_prefix }}/gvoice"
# Postgres is the default, except if not using internal Postgres server
matrix_mautrix_gvoice_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}"
matrix_mautrix_gvoice_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
matrix_mautrix_gvoice_database_password: "{{ (matrix_homeserver_generic_secret_key + ':maugvoice.db') | hash('sha512') | to_uuid }}"
######################################################################
#
# /matrix-bridge-mautrix-gvoice
#
######################################################################
######################################################################
#
# matrix-bridge-mautrix-wsproxy
@@ -4132,6 +4224,12 @@ postgres_managed_databases_auto: |
'password': matrix_mautrix_gmessages_database_password,
}] if (matrix_mautrix_gmessages_enabled and matrix_mautrix_gmessages_database_engine == 'postgres' and matrix_mautrix_gmessages_database_hostname == postgres_connection_hostname) else [])
+
([{
'name': matrix_mautrix_gvoice_database_name,
'username': matrix_mautrix_gvoice_database_username,
'password': matrix_mautrix_gvoice_database_password,
}] if (matrix_mautrix_gvoice_enabled and matrix_mautrix_gvoice_database_engine == 'postgres' and matrix_mautrix_gvoice_database_hostname == postgres_connection_hostname) else [])
+
([{
'name': matrix_mautrix_whatsapp_database_name,
'username': matrix_mautrix_whatsapp_database_username,
@@ -5036,6 +5134,11 @@ matrix_ketesa_config_asManagedUsers_auto: |
'^@gmessages_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
] if matrix_mautrix_gmessages_enabled else [])
+
([
'^@'+(matrix_mautrix_gvoice_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$',
'^@gvoice_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
] if matrix_mautrix_gvoice_enabled else [])
+
([
'^@'+(matrix_mautrix_googlechat_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$',
'^@googlechat_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
@@ -5905,6 +6008,7 @@ matrix_static_files_file_matrix_mautrix_property_fi_mau_bridges_auto: |-
[
matrix_mautrix_bluesky_appservice_public_address if (matrix_mautrix_bluesky_enabled and matrix_mautrix_bluesky_container_labels_traefik_enabled and matrix_mautrix_bluesky_container_labels_exposure_enabled) else '',
matrix_mautrix_gmessages_bridge_public_address if (matrix_mautrix_gmessages_enabled and matrix_mautrix_gmessages_container_labels_traefik_enabled and matrix_mautrix_gmessages_container_labels_exposure_enabled) else '',
matrix_mautrix_gvoice_bridge_public_address if (matrix_mautrix_gvoice_enabled and matrix_mautrix_gvoice_container_labels_traefik_enabled and matrix_mautrix_gvoice_container_labels_exposure_enabled) else '',
matrix_mautrix_meta_instagram_bridge_public_address if (matrix_mautrix_meta_instagram_enabled and matrix_mautrix_meta_instagram_container_labels_traefik_enabled and matrix_mautrix_meta_instagram_container_labels_exposure_enabled) else '',
matrix_mautrix_meta_messenger_bridge_public_address if (matrix_mautrix_meta_messenger_enabled and matrix_mautrix_meta_messenger_container_labels_traefik_enabled and matrix_mautrix_meta_messenger_container_labels_exposure_enabled) else '',
matrix_mautrix_signal_bridge_public_address if (matrix_mautrix_signal_enabled and matrix_mautrix_signal_container_labels_traefik_enabled and matrix_mautrix_signal_container_labels_exposure_enabled) else '',