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

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

Unlike the other mautrix bridges, the mautrix-slack role had no Traefik
label infrastructure at all, so this builds the scaffold first (a new
labels.j2, the container_labels_traefik_* vars, the label-file wiring in
the systemd service and setup_install.yml, and the group_vars wiring),
then exposes the bridge's appservice HTTP API under
https://matrix.<domain>/bridges/slack like the other bridges.

The provisioning shared secret was already auto-generated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Slavi Pantaleev
2026-06-29 09:08:57 +03:00
parent 42c173c0b3
commit 2879a01105
6 changed files with 115 additions and 1 deletions
@@ -213,7 +213,7 @@ appservice:
address: {{ matrix_mautrix_slack_appservice_address | to_json }}
# A public address that external services can use to reach this appservice.
# This value doesn't affect the registration file.
public_address: https://bridge.example.com
public_address: {{ matrix_mautrix_slack_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.
@@ -0,0 +1,50 @@
{#
SPDX-FileCopyrightText: 2026 Slavi Pantaleev
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% if matrix_mautrix_slack_container_labels_traefik_enabled %}
traefik.enable=true
{% if matrix_mautrix_slack_container_labels_traefik_docker_network %}
traefik.docker.network={{ matrix_mautrix_slack_container_labels_traefik_docker_network }}
{% endif %}
{% if matrix_mautrix_slack_container_labels_exposure_enabled %}
############################################################
# #
# Bridge API exposure #
# #
############################################################
traefik.http.services.matrix-mautrix-slack-exposure.loadbalancer.server.port=8080
traefik.http.middlewares.matrix-mautrix-slack-exposure-strip-prefix.stripprefix.prefixes={{ matrix_mautrix_slack_exposure_path_prefix }}
traefik.http.routers.matrix-mautrix-slack-exposure.middlewares=matrix-mautrix-slack-exposure-strip-prefix
traefik.http.routers.matrix-mautrix-slack-exposure.rule={{ matrix_mautrix_slack_container_labels_exposure_traefik_rule }}
{% if matrix_mautrix_slack_container_labels_exposure_traefik_priority | int > 0 %}
traefik.http.routers.matrix-mautrix-slack-exposure.priority={{ matrix_mautrix_slack_container_labels_exposure_traefik_priority }}
{% endif %}
traefik.http.routers.matrix-mautrix-slack-exposure.service=matrix-mautrix-slack-exposure
traefik.http.routers.matrix-mautrix-slack-exposure.entrypoints={{ matrix_mautrix_slack_container_labels_exposure_traefik_entrypoints }}
traefik.http.routers.matrix-mautrix-slack-exposure.tls={{ matrix_mautrix_slack_container_labels_exposure_traefik_tls | to_json }}
{% if matrix_mautrix_slack_container_labels_exposure_traefik_tls %}
traefik.http.routers.matrix-mautrix-slack-exposure.tls.certResolver={{ matrix_mautrix_slack_container_labels_exposure_traefik_tls_certResolver }}
{% endif %}
############################################################
# #
# /Bridge API exposure #
# #
############################################################
{% endif %}
{% endif %}
{{ matrix_mautrix_slack_container_labels_additional_labels }}
@@ -25,6 +25,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--network={{ matrix_mautrix_slack_container_network }} \
--mount type=bind,src={{ matrix_mautrix_slack_config_path }},dst=/config,ro \
--mount type=bind,src={{ matrix_mautrix_slack_data_path }},dst=/data \
--label-file={{ matrix_mautrix_slack_base_path }}/labels \
--workdir=/data \
{% for arg in matrix_mautrix_slack_container_extra_arguments %}
{{ arg }} \