From f01d95f2dd5a3d281603d810557438a686fb1ade Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 28 Dec 2024 11:49:05 -0500 Subject: [PATCH 1/8] Update docs/configuring-playbook-rageshake: add the common section "Extending the configuration" Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-rageshake.md | 37 +++++++++++++++++--------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/docs/configuring-playbook-rageshake.md b/docs/configuring-playbook-rageshake.md index 6db32e43a..aa61314f0 100644 --- a/docs/configuring-playbook-rageshake.md +++ b/docs/configuring-playbook-rageshake.md @@ -20,18 +20,6 @@ To enable rageshake, add the following configuration to your `inventory/host_var matrix_rageshake_enabled: true ``` -rageshake has various options which don't have dedicated Ansible variables. You can see the full list of options in the [`rageshake.sample.yaml` file](https://github.com/matrix-org/rageshake/blob/master/rageshake.sample.yaml). - -To set these, you can make use of the `matrix_rageshake_configuration_extension_yaml` variable like this: - -```yaml -matrix_rageshake_configuration_extension_yaml: | - github_token: secrettoken - - github_project_mappings: - my-app: octocat/HelloWorld -``` - ### Adjusting the rageshake URL (optional) By tweaking the `matrix_rageshake_hostname` and `matrix_rageshake_path_prefix` variables, you can easily make the service available at a **different hostname and/or path** than the default one. @@ -51,6 +39,31 @@ After changing the domain, **you may need to adjust your DNS** records to point If you've decided to reuse the `matrix.` domain, you won't need to do any extra DNS configuration. +### Extending the configuration + +There are some additional things you may wish to configure about the server. + +Take a look at: + +- `roles/custom/matrix-rageshake/defaults/main.yml` for some variables that you can customize via your `vars.yml` file +- `roles/custom/matrix-rageshake/templates/config.yaml.j2` for the server's default configuration. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_rageshake_configuration_extension_yaml` variable + +```yaml +matrix_rageshake_configuration_extension_yaml: | + # Your custom YAML configuration goes here. + # This configuration extends the default starting configuration (`matrix_rageshake_configuration_extension_yaml`). + # + # You can override individual variables from the default configuration, or introduce new ones. + # + # If you need something more special, you can take full control by + # completely redefining `matrix_rageshake_configuration_extension_yaml`. + + github_token: secrettoken + + github_project_mappings: + my-app: octocat/HelloWorld +``` + ## Installing After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the playbook with [playbook tags](playbook-tags.md) as below: From 51f0a315ac5f93bdc0fb116971e799c59e539024 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 1 Feb 2025 00:42:45 +0900 Subject: [PATCH 2/8] =?UTF-8?q?Update=20files=20for=20rageshake:=20change?= =?UTF-8?q?=20config.yml.j2=20=E2=86=92=20config.yaml.j2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Suguru Hirahara --- roles/custom/matrix-rageshake/defaults/main.yml | 2 +- roles/custom/matrix-rageshake/tasks/install.yml | 2 +- .../templates/{config.yml.j2 => config.yaml.j2} | 0 .../templates/systemd/matrix-rageshake.service.j2 | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename roles/custom/matrix-rageshake/templates/{config.yml.j2 => config.yaml.j2} (100%) diff --git a/roles/custom/matrix-rageshake/defaults/main.yml b/roles/custom/matrix-rageshake/defaults/main.yml index 77caeab1b..f104cbebd 100644 --- a/roles/custom/matrix-rageshake/defaults/main.yml +++ b/roles/custom/matrix-rageshake/defaults/main.yml @@ -93,7 +93,7 @@ matrix_rageshake_config_api_prefix: "{{ matrix_rageshake_scheme }}://{{ matrix_r # # For a more advanced customization, you can extend the default (see `matrix_rageshake_configuration_extension_yaml`) # or completely replace this variable with your own template. -matrix_rageshake_configuration_yaml: "{{ lookup('template', 'templates/config.yml.j2') }}" +matrix_rageshake_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" matrix_rageshake_configuration_extension_yaml: | # Your custom YAML configuration for Synapse goes here. diff --git a/roles/custom/matrix-rageshake/tasks/install.yml b/roles/custom/matrix-rageshake/tasks/install.yml index 572f03f1f..33953de5e 100644 --- a/roles/custom/matrix-rageshake/tasks/install.yml +++ b/roles/custom/matrix-rageshake/tasks/install.yml @@ -19,7 +19,7 @@ - name: Ensure rageshake config file created ansible.builtin.copy: content: "{{ matrix_rageshake_configuration | to_nice_yaml(indent=2, width=999999) }}" - dest: "{{ matrix_rageshake_config_path }}/config.yml" + dest: "{{ matrix_rageshake_config_path }}/config.yaml" owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" mode: 0640 diff --git a/roles/custom/matrix-rageshake/templates/config.yml.j2 b/roles/custom/matrix-rageshake/templates/config.yaml.j2 similarity index 100% rename from roles/custom/matrix-rageshake/templates/config.yml.j2 rename to roles/custom/matrix-rageshake/templates/config.yaml.j2 diff --git a/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 b/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 index 9abaf3db5..ba98d0e3a 100644 --- a/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 +++ b/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 @@ -32,7 +32,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ arg }} \ {% endfor %} {{ matrix_rageshake_container_image }} \ - --config /config/config.yml + --config /config/config.yaml {% for network in matrix_rageshake_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-rageshake From fd2428972ded775a5c6dcfe227c9b937fdf22932 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Thu, 30 Jan 2025 15:33:26 +0900 Subject: [PATCH 3/8] Update docs/configuring-playbook-rageshake.md: add the common section "Troubleshooting" Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-rageshake.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/configuring-playbook-rageshake.md b/docs/configuring-playbook-rageshake.md index aa61314f0..e52c8cdef 100644 --- a/docs/configuring-playbook-rageshake.md +++ b/docs/configuring-playbook-rageshake.md @@ -80,3 +80,7 @@ The shortcut commands with the [`just` program](just.md) are also available: `ju ## Usage Refer to the project's [documentation](https://github.com/matrix-org/rageshake/blob/main/README.md) for available APIs, etc. + +## Troubleshooting + +As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-rageshake`. From 0980339e70f4380ba3482ae7f51ae1b6a42e5045 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 28 Dec 2024 11:49:36 -0500 Subject: [PATCH 4/8] Update docs/configuring-playbook-bot-matrix-registration-bot.md: add the common section "Extending the configuration" Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-bot-matrix-registration-bot.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/configuring-playbook-bot-matrix-registration-bot.md b/docs/configuring-playbook-bot-matrix-registration-bot.md index 95b86163f..a425b5969 100644 --- a/docs/configuring-playbook-bot-matrix-registration-bot.md +++ b/docs/configuring-playbook-bot-matrix-registration-bot.md @@ -29,6 +29,15 @@ matrix_synapse_registration_requires_token: true The bot account will be created automatically. +### Extending the configuration + +There are some additional things you may wish to configure about the bot. + +Take a look at: + +- `roles/custom/matrix-bot-matrix-registration-bot/defaults/main.yml` for some variables that you can customize via your `vars.yml` file +- `roles/custom/matrix-bot-matrix-registration-bot/templates/config.yaml.j2` for the bridge's default configuration + ## Installing After configuring the playbook, run it with [playbook tags](playbook-tags.md) as below: From 66df132e666186f1782a441bf9135339102a3992 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 1 Feb 2025 00:41:38 +0900 Subject: [PATCH 5/8] =?UTF-8?q?Update=20files=20for=20matrix-registration-?= =?UTF-8?q?bot:=20change=20config.yml.j2=20=E2=86=92=20config.yaml.j2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Suguru Hirahara --- .../tasks/setup_install.yml | 4 ++-- .../templates/{config.yml.j2 => config.yaml.j2} | 0 .../systemd/matrix-bot-matrix-registration-bot.service.j2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename roles/custom/matrix-bot-matrix-registration-bot/templates/{config.yml.j2 => config.yaml.j2} (100%) diff --git a/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml b/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml index 0ac4e6a1f..a05c04109 100644 --- a/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml @@ -15,8 +15,8 @@ - name: Ensure matrix-registration-bot configuration file created ansible.builtin.template: - src: "{{ role_path }}/templates/config.yml.j2" - dest: "{{ matrix_bot_matrix_registration_bot_config_path }}/config.yml" + src: "{{ role_path }}/templates/config.yaml.j2" + dest: "{{ matrix_bot_matrix_registration_bot_config_path }}/config.yaml" owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" mode: 0640 diff --git a/roles/custom/matrix-bot-matrix-registration-bot/templates/config.yml.j2 b/roles/custom/matrix-bot-matrix-registration-bot/templates/config.yaml.j2 similarity index 100% rename from roles/custom/matrix-bot-matrix-registration-bot/templates/config.yml.j2 rename to roles/custom/matrix-bot-matrix-registration-bot/templates/config.yaml.j2 diff --git a/roles/custom/matrix-bot-matrix-registration-bot/templates/systemd/matrix-bot-matrix-registration-bot.service.j2 b/roles/custom/matrix-bot-matrix-registration-bot/templates/systemd/matrix-bot-matrix-registration-bot.service.j2 index a48c4f045..d12d2f588 100644 --- a/roles/custom/matrix-bot-matrix-registration-bot/templates/systemd/matrix-bot-matrix-registration-bot.service.j2 +++ b/roles/custom/matrix-bot-matrix-registration-bot/templates/systemd/matrix-bot-matrix-registration-bot.service.j2 @@ -21,7 +21,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --name=matrix-bot-matrix-registration-bot \ --log-driver=none \ --cap-drop=ALL \ - -e "CONFIG_PATH=/config/config.yml" \ + -e "CONFIG_PATH=/config/config.yaml" \ --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ --read-only \ --mount type=bind,src={{ matrix_bot_matrix_registration_bot_config_path }},dst=/config,ro \ From f732007b376fff9b8797617644dd85182d8cb330 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Fri, 31 Jan 2025 00:08:22 +0900 Subject: [PATCH 6/8] Update files for matrix-registration-bot: add the common section for "Troubleshooting" See: https://github.com/moan0s/matrix-registration-bot/blob/main/README.md Signed-off-by: Suguru Hirahara --- ...figuring-playbook-bot-matrix-registration-bot.md | 13 +++++++++++++ .../defaults/main.yml | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/configuring-playbook-bot-matrix-registration-bot.md b/docs/configuring-playbook-bot-matrix-registration-bot.md index a425b5969..fffd239f2 100644 --- a/docs/configuring-playbook-bot-matrix-registration-bot.md +++ b/docs/configuring-playbook-bot-matrix-registration-bot.md @@ -72,3 +72,16 @@ To clean the cache (session & encryption data) after you changed the bot's usern ```sh just run-tags bot-matrix-registration-bot-clean-cache ``` + +## Troubleshooting + +As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-registration-bot`. + +### Increase logging verbosity + +The default logging level for this component is `INFO`. If you want to increase the verbosity, add the following configuration to your `vars.yml` file and re-run the playbook: + +```yaml +# Valid values: ERROR, INFO, DEBUG +matrix_bot_matrix_registration_bot_logging_level: DEBUG +``` diff --git a/roles/custom/matrix-bot-matrix-registration-bot/defaults/main.yml b/roles/custom/matrix-bot-matrix-registration-bot/defaults/main.yml index ba1fc7273..9423e8fad 100644 --- a/roles/custom/matrix-bot-matrix-registration-bot/defaults/main.yml +++ b/roles/custom/matrix-bot-matrix-registration-bot/defaults/main.yml @@ -39,7 +39,8 @@ matrix_bot_matrix_registration_bot_api_token: '' matrix_bot_matrix_registration_bot_device_id: "matrix-docker-ansible-deploy" -matrix_bot_matrix_registration_bot_logging_level: info +# Valid values: ERROR, INFO, DEBUG +matrix_bot_matrix_registration_bot_logging_level: INFO matrix_bot_matrix_registration_bot_container_network: "" From 30dad8ba277bc32494125b70794e2d0df5ac08ae Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 1 Feb 2025 00:40:58 +0900 Subject: [PATCH 7/8] =?UTF-8?q?Updat=20files=20for=20baibot:=20change=20co?= =?UTF-8?q?nfig.yml.j2=20=E2=86=92=20config.yaml.j2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Suguru Hirahara --- roles/custom/matrix-bot-baibot/defaults/main.yml | 2 +- roles/custom/matrix-bot-baibot/tasks/install.yml | 2 +- .../templates/{config.yml.j2 => config.yaml.j2} | 0 .../templates/systemd/matrix-bot-baibot.service.j2 | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename roles/custom/matrix-bot-baibot/templates/{config.yml.j2 => config.yaml.j2} (100%) diff --git a/roles/custom/matrix-bot-baibot/defaults/main.yml b/roles/custom/matrix-bot-baibot/defaults/main.yml index fba1cd908..d3737b2a8 100644 --- a/roles/custom/matrix-bot-baibot/defaults/main.yml +++ b/roles/custom/matrix-bot-baibot/defaults/main.yml @@ -461,7 +461,7 @@ matrix_bot_baibot_configuration: "{{ matrix_bot_baibot_configuration_yaml | from # # For a more advanced customization, you can extend the default (see `matrix_bot_baibot_configuration_extension_yaml`) # or completely replace this variable with your own template. -matrix_bot_baibot_configuration_yaml: "{{ lookup('template', 'templates/config.yml.j2') }}" +matrix_bot_baibot_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" matrix_bot_baibot_configuration_extension_yaml: | # Your custom YAML configuration for baibot goes here. diff --git a/roles/custom/matrix-bot-baibot/tasks/install.yml b/roles/custom/matrix-bot-baibot/tasks/install.yml index f74ab3442..d2dcfdb6d 100644 --- a/roles/custom/matrix-bot-baibot/tasks/install.yml +++ b/roles/custom/matrix-bot-baibot/tasks/install.yml @@ -17,7 +17,7 @@ - name: Ensure baibot configuration installed ansible.builtin.copy: content: "{{ matrix_bot_baibot_configuration | to_nice_yaml(indent=2, width=999999) }}" - dest: "{{ matrix_bot_baibot_config_path }}/config.yml" + dest: "{{ matrix_bot_baibot_config_path }}/config.yaml" mode: 0644 owner: "{{ matrix_user_username }}" group: "{{ matrix_user_groupname }}" diff --git a/roles/custom/matrix-bot-baibot/templates/config.yml.j2 b/roles/custom/matrix-bot-baibot/templates/config.yaml.j2 similarity index 100% rename from roles/custom/matrix-bot-baibot/templates/config.yml.j2 rename to roles/custom/matrix-bot-baibot/templates/config.yaml.j2 diff --git a/roles/custom/matrix-bot-baibot/templates/systemd/matrix-bot-baibot.service.j2 b/roles/custom/matrix-bot-baibot/templates/systemd/matrix-bot-baibot.service.j2 index 346925c4a..e34f62357 100644 --- a/roles/custom/matrix-bot-baibot/templates/systemd/matrix-bot-baibot.service.j2 +++ b/roles/custom/matrix-bot-baibot/templates/systemd/matrix-bot-baibot.service.j2 @@ -29,7 +29,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --read-only \ --network={{ matrix_bot_baibot_container_network }} \ --env-file={{ matrix_bot_baibot_config_path }}/env \ - --mount type=bind,src={{ matrix_bot_baibot_config_path }}/config.yml,dst=/app/config.yml,ro \ + --mount type=bind,src={{ matrix_bot_baibot_config_path }}/config.yaml,dst=/app/config.yaml,ro \ --mount type=bind,src={{ matrix_bot_baibot_data_path }},dst=/data \ --tmpfs=/tmp:rw,noexec,nosuid,size=1024m \ {% for arg in matrix_bot_baibot_container_extra_arguments %} From 589aa949f4dc9edcec80683d701d6f2abb0bdcf8 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Thu, 30 Jan 2025 19:38:21 +0900 Subject: [PATCH 8/8] Update docs/configuring-playbook-bot-baibot.md: adopt the common description for the section "Troubleshooting" Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-bot-baibot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuring-playbook-bot-baibot.md b/docs/configuring-playbook-bot-baibot.md index ac270d3a3..a9c3d2c66 100644 --- a/docs/configuring-playbook-bot-baibot.md +++ b/docs/configuring-playbook-bot-baibot.md @@ -398,7 +398,7 @@ You can also refer to the upstream [baibot](https://github.com/etkecc/baibot) pr ## Troubleshooting -As with all other services, you can find service logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by running something like `journalctl -fu matrix-bot-baibot` +As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-bot-baibot`. ### Increase logging verbosity