4
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2026-06-30 15:31:18 +00:00

mautrix-telegram: expose bridge HTTP API (for mautrix-manager and similar)

Route the whole mautrix-telegram HTTP port via Traefik under
`<matrix-fqn>/bridges/telegram` and populate appservice.public_address,
reusing the matrix_bridges_exposure_* mechanism. The provisioning shared
secret is already auto-generated in group_vars, so the provisioning API
is enabled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Slavi Pantaleev
2026-06-28 19:56:24 +03:00
parent a4ddba3989
commit d2252db4fe
4 changed files with 60 additions and 1 deletions
@@ -281,7 +281,7 @@ appservice:
# A public address that external services can use to reach this appservice.
# This is only needed for things like public media. A reverse proxy is generally necessary when using this field.
# This value doesn't affect the registration file.
public_address: ""
public_address: {{ matrix_mautrix_telegram_bridge_public_address | to_json }}
# The hostname and port where this appservice should listen.
# For Docker, you generally have to change the hostname to 0.0.0.0.
@@ -46,6 +46,39 @@ traefik.http.routers.matrix-mautrix-telegram-metrics.tls.certResolver={{ matrix_
############################################################
{% endif %}
{% if matrix_mautrix_telegram_container_labels_exposure_enabled %}
############################################################
# #
# Bridge API exposure #
# #
############################################################
traefik.http.services.matrix-mautrix-telegram-exposure.loadbalancer.server.port=8080
traefik.http.middlewares.matrix-mautrix-telegram-exposure-strip-prefix.stripprefix.prefixes={{ matrix_mautrix_telegram_exposure_path_prefix }}
traefik.http.routers.matrix-mautrix-telegram-exposure.middlewares=matrix-mautrix-telegram-exposure-strip-prefix
traefik.http.routers.matrix-mautrix-telegram-exposure.rule={{ matrix_mautrix_telegram_container_labels_exposure_traefik_rule }}
{% if matrix_mautrix_telegram_container_labels_exposure_traefik_priority | int > 0 %}
traefik.http.routers.matrix-mautrix-telegram-exposure.priority={{ matrix_mautrix_telegram_container_labels_exposure_traefik_priority }}
{% endif %}
traefik.http.routers.matrix-mautrix-telegram-exposure.service=matrix-mautrix-telegram-exposure
traefik.http.routers.matrix-mautrix-telegram-exposure.entrypoints={{ matrix_mautrix_telegram_container_labels_exposure_traefik_entrypoints }}
traefik.http.routers.matrix-mautrix-telegram-exposure.tls={{ matrix_mautrix_telegram_container_labels_exposure_traefik_tls | to_json }}
{% if matrix_mautrix_telegram_container_labels_exposure_traefik_tls %}
traefik.http.routers.matrix-mautrix-telegram-exposure.tls.certResolver={{ matrix_mautrix_telegram_container_labels_exposure_traefik_tls_certResolver }}
{% endif %}
############################################################
# #
# /Bridge API exposure #
# #
############################################################
{% endif %}
{% endif %}