From 8751e34ede04cc1911d0ab1ad3a0cbab92ff2641 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 21 May 2026 12:22:15 +0300 Subject: [PATCH] matrix-bot-maubot: avoid double slash in base paths when path_prefix is / The derived `*_base_path` defaults concatenated `matrix_bot_maubot_path_prefix` directly, producing `//v1` and `//plugin/` when users set the documented `matrix_bot_maubot_path_prefix: /` (for serving on a dedicated subdomain), which Traefik rejects. Apply the standard `'/' == path_prefix` guard already used by other roles (honoroit, mautrix-discord, MAS, heisenbridge, etc.). Reported by The Dark Wizard. Co-Authored-By: Claude Opus 4.7 (1M context) --- roles/custom/matrix-bot-maubot/defaults/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-bot-maubot/defaults/main.yml b/roles/custom/matrix-bot-maubot/defaults/main.yml index c0cd9201f..5d4c24e46 100644 --- a/roles/custom/matrix-bot-maubot/defaults/main.yml +++ b/roles/custom/matrix-bot-maubot/defaults/main.yml @@ -23,6 +23,9 @@ matrix_bot_maubot_initial_password: '' matrix_bot_maubot_scheme: https matrix_bot_maubot_hostname: '' + +# The path at which maubot is exposed. +# This value must either be `/` or not end with a slash (e.g. `/_matrix/maubot`). matrix_bot_maubot_path_prefix: /_matrix/maubot matrix_bot_maubot_container_image_self_build: false @@ -58,9 +61,9 @@ matrix_bot_maubot_container_src_files_path: "{{ matrix_bot_maubot_base_path }}/d matrix_bot_maubot_customized_container_src_files_path: "{{ matrix_bot_maubot_base_path }}/customized-docker-src" matrix_bot_maubot_bot_server_public_url: "{{ matrix_bot_maubot_scheme }}://{{ matrix_bot_maubot_hostname }}" -matrix_bot_maubot_bot_server_base_path: "{{ matrix_bot_maubot_path_prefix }}/v1" +matrix_bot_maubot_bot_server_base_path: "{{ '' if matrix_bot_maubot_path_prefix == '/' else matrix_bot_maubot_path_prefix }}/v1" matrix_bot_maubot_bot_server_ui_base_path: "{{ matrix_bot_maubot_path_prefix }}" -matrix_bot_maubot_bot_server_plugin_base_path: "{{ matrix_bot_maubot_path_prefix }}/plugin/" +matrix_bot_maubot_bot_server_plugin_base_path: "{{ '' if matrix_bot_maubot_path_prefix == '/' else matrix_bot_maubot_path_prefix }}/plugin/" matrix_bot_maubot_bot_server_appservice_base_path: "{{ matrix_bot_maubot_bot_server_base_path }}" matrix_bot_maubot_proxy_management_interface: true