Skip to content

Commit

Permalink
Merge pull request #4036 from luixxiul/fix
Browse files Browse the repository at this point in the history
Update files for rageshake, matrix-registration-bot, baibot
  • Loading branch information
spantaleev authored Feb 6, 2025
2 parents 410b563 + 589aa94 commit f3f36a8
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/configuring-playbook-bot-baibot.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 22 additions & 0 deletions docs/configuring-playbook-bot-matrix-registration-bot.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -63,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
```
41 changes: 29 additions & 12 deletions docs/configuring-playbook-rageshake.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand All @@ -67,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`.
2 changes: 1 addition & 1 deletion roles/custom/matrix-bot-baibot/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion roles/custom/matrix-bot-baibot/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion roles/custom/matrix-rageshake/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion roles/custom/matrix-rageshake/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f3f36a8

Please sign in to comment.