diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 3f3dbefe3..ca00258fe 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -2145,7 +2145,9 @@ matrix_bot_maubot_systemd_required_services_list_auto: | ([devture_postgres_identifier ~ '.service'] if (devture_postgres_enabled and matrix_bot_maubot_database_hostname == devture_postgres_connection_hostname) else []) }} -matrix_bot_maubot_registration_shared_secret: |- +matrix_bot_maubot_homeserver_url: "{{ matrix_addons_homeserver_client_api_url }}" + +matrix_bot_maubot_homeserver_secret: |- {{ { 'synapse': matrix_synapse_registration_shared_secret, diff --git a/roles/custom/matrix-bot-maubot/defaults/main.yml b/roles/custom/matrix-bot-maubot/defaults/main.yml index 23249ab41..d12dd20a0 100644 --- a/roles/custom/matrix-bot-maubot/defaults/main.yml +++ b/roles/custom/matrix-bot-maubot/defaults/main.yml @@ -58,6 +58,10 @@ matrix_bot_maubot_server_port: 29316 matrix_bot_maubot_unshared_secret: 'generate' +matrix_bot_maubot_homeserver_name: "{{ matrix_domain }}" +matrix_bot_maubot_homeserver_url: "" +matrix_bot_maubot_homeserver_secret: "" + matrix_bot_maubot_admins: [] # Specifies the default log level for all bot loggers. diff --git a/roles/custom/matrix-bot-maubot/tasks/validate_config.yml b/roles/custom/matrix-bot-maubot/tasks/validate_config.yml index dfe6a1033..4247c8b58 100644 --- a/roles/custom/matrix-bot-maubot/tasks/validate_config.yml +++ b/roles/custom/matrix-bot-maubot/tasks/validate_config.yml @@ -9,6 +9,7 @@ with_items: - {'old': 'matrix_bot_maubot_management_interface_port', 'new': 'matrix_bot_maubot_server_port'} - {'old': 'matrix_bot_maubot_management_interface_http_bind_port', 'new': 'matrix_bot_maubot_container_management_interface_http_bind_port'} + - {'old': 'matrix_bot_maubot_registration_shared_secret', 'new': 'matrix_bot_maubot_homeserver_secret'} - name: Fail if required maubot settings not defined ansible.builtin.fail: @@ -22,3 +23,5 @@ - {'name': 'matrix_bot_maubot_admins', when: true} - {'name': 'matrix_bot_maubot_database_hostname', when: "{{ matrix_bot_maubot_database_engine == 'postgres' }}"} - {'name': 'matrix_bot_maubot_container_network', when: true} + - {'name': 'matrix_bot_maubot_homeserver_name', when: true} + - {'name': 'matrix_bot_maubot_homeserver_url', when: true} diff --git a/roles/custom/matrix-bot-maubot/templates/config/config.yaml.j2 b/roles/custom/matrix-bot-maubot/templates/config/config.yaml.j2 index f321db78a..8da34c9ed 100644 --- a/roles/custom/matrix-bot-maubot/templates/config/config.yaml.j2 +++ b/roles/custom/matrix-bot-maubot/templates/config/config.yaml.j2 @@ -58,13 +58,13 @@ server: # clients in the management UI, since you can also just type the homeserver URL # into the box there. homeservers: - {{ matrix_domain }}: + {{ matrix_bot_maubot_homeserver_name }}: # Client-server API URL - url: {{ matrix_homeserver_container_url | to_json }} + url: {{ matrix_bot_maubot_homeserver_url | to_json }} # registration_shared_secret from synapse config # You can leave this empty if you don't have access to the homeserver. # When this is empty, `mbc auth --register` won't work, but `mbc auth` (login) will. - secret: {{ matrix_bot_maubot_registration_shared_secret|to_json }} + secret: {{ matrix_bot_maubot_homeserver_secret | to_json }} # List of administrator users. Plaintext passwords will be bcrypted on startup. Set empty password # to prevent normal login. Root is a special user that can't have a password and will always exist.