From b20cfc5015317afc4f8d9a7e0f8ba5d80153591e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Wed, 20 Jul 2022 11:23:32 +0200 Subject: [PATCH] Clear up maubot role (#1960) * Make interface hidden behind proxy by default * Remove expose option and replace with http_bind_port Reasoning: This is a similar binary trigger but allows to bin not on all interfaces * Clarify maubot admin purpose * Remove unnecessary edif * Extend docs to prevent common misconceptions * Make http_bind_port singular, do not allow multiple values * Make optional again --- docs/configuring-playbook-bot-maubot.md | 10 +++++++++- roles/matrix-bot-maubot/defaults/main.yml | 3 +-- .../templates/systemd/matrix-bot-maubot.service.j2 | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/configuring-playbook-bot-maubot.md b/docs/configuring-playbook-bot-maubot.md index 1fbe8d173..d74cfb2fc 100644 --- a/docs/configuring-playbook-bot-maubot.md +++ b/docs/configuring-playbook-bot-maubot.md @@ -18,7 +18,8 @@ matrix_bot_maubot_admins: - yourusername: securepassword ``` -You can add multiple admins. +You can add multiple admins. The admin accounts are not connected to any matrix ID and are only used to access the +maubot administration interface. ## Installing @@ -32,6 +33,13 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start ## Usage You can visit `matrix./_matrix/maubot/` to manage your available plugins, clients and instances. + +You should start in the following order +1. **Create one or more clients:** A client is a matrix account which the bot will use to message. +2. **Upload some Plugins:** Plugins can be obtained from [here](https://github.com/maubot/maubot#plugins) or any other source. +3. **Create an instance:** An instance is the actual bot. You have to specify a client which the bot instance will use +and the plugin (how the bot will behave) + To add a client you first need to create an account and obtain a valid access token. ## Registering the bot user diff --git a/roles/matrix-bot-maubot/defaults/main.yml b/roles/matrix-bot-maubot/defaults/main.yml index f210ba517..c6d92215c 100644 --- a/roles/matrix-bot-maubot/defaults/main.yml +++ b/roles/matrix-bot-maubot/defaults/main.yml @@ -19,8 +19,7 @@ matrix_bot_maubot_data_path: "{{ matrix_bot_maubot_base_path }}/data" matrix_bot_maubot_config_path: "{{ matrix_bot_maubot_base_path }}/config" matrix_bot_maubot_bot_server_public_url: "https://{{ matrix_server_fqn_matrix }}" -matrix_bot_maubot_proxy_management_interface: false -matrix_bot_maubot_expose_management_interface: true +matrix_bot_maubot_proxy_management_interface: true matrix_bot_maubot_database_engine: sqlite matrix_bot_maubot_sqlite_database_path_local: "{{ matrix_bot_maubot_data_path }}/maubot.db" diff --git a/roles/matrix-bot-maubot/templates/systemd/matrix-bot-maubot.service.j2 b/roles/matrix-bot-maubot/templates/systemd/matrix-bot-maubot.service.j2 index 594356676..6f8ec6f6b 100644 --- a/roles/matrix-bot-maubot/templates/systemd/matrix-bot-maubot.service.j2 +++ b/roles/matrix-bot-maubot/templates/systemd/matrix-bot-maubot.service.j2 @@ -26,9 +26,9 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-bot-maubot \ {{ arg }} \ {% endfor %} --network={{ matrix_docker_network }} \ - {% if matrix_bot_maubot_expose_management_interface|bool %} - -p {{ matrix_bot_maubot_management_interface_port }}:29316 \ - {% endif %} + {% if matrix_bot_maubot_management_interface_http_bind_port | bool %} + -p {{ matrix_bot_maubot_management_interface_http_bind_port }}:29316 + {% endif %} {{ matrix_bot_maubot_docker_image }} \ python3 -m maubot -c /data/config.yaml