From 9e3c337080ecb113157c964badc80e5d4c2b0102 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Wed, 11 Dec 2024 11:40:09 +0900 Subject: [PATCH] Update draupnir and mjolnir docs: create "Extending the configuration" sections Signed-off-by: Suguru Hirahara --- ...ng-playbook-appservice-draupnir-for-all.md | 6 +++- docs/configuring-playbook-bot-draupnir.md | 36 +++++++++---------- docs/configuring-playbook-bot-mjolnir.md | 34 +++++++++--------- 3 files changed, 41 insertions(+), 35 deletions(-) diff --git a/docs/configuring-playbook-appservice-draupnir-for-all.md b/docs/configuring-playbook-appservice-draupnir-for-all.md index 29a0129ab..a2c023431 100644 --- a/docs/configuring-playbook-appservice-draupnir-for-all.md +++ b/docs/configuring-playbook-appservice-draupnir-for-all.md @@ -50,7 +50,11 @@ matrix_appservice_draupnir_for_all_enabled: true matrix_appservice_draupnir_for_all_master_control_room_alias: "ALIAS_FROM_STEP_2_GOES_HERE" ``` -You can configure additional options by adding the `matrix_appservice_draupnir_for_all_extension_yaml` variable. For example, to change Draupnir's `protectAllJoinedRooms` option to `true`, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: +### Extending the configuration + +You can configure additional options by adding the `matrix_appservice_draupnir_for_all_extension_yaml` variable. + +For example, to change Draupnir's `protectAllJoinedRooms` option to `true`, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: ```yaml matrix_appservice_draupnir_for_all_extension_yaml: | diff --git a/docs/configuring-playbook-bot-draupnir.md b/docs/configuring-playbook-bot-draupnir.md index 0ec2273b3..07bf6e07d 100644 --- a/docs/configuring-playbook-bot-draupnir.md +++ b/docs/configuring-playbook-bot-draupnir.md @@ -103,6 +103,24 @@ You must replace `ACCESS_TOKEN_FROM_STEP_2_GOES_HERE` with your own value. matrix_bot_draupnir_access_token: "ACCESS_TOKEN_FROM_STEP_2_GOES_HERE" ``` +### Extending the configuration + +You can configure additional options by adding the `matrix_bot_draupnir_configuration_extension_yaml` variable. + +For example, to change Draupnir's `recordIgnoredInvites` option to `true`, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: + +```yaml +matrix_bot_draupnir_configuration_extension_yaml: | + # Your custom YAML configuration goes here. + # This configuration extends the default starting configuration (`matrix_bot_draupnir_configuration_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_bot_draupnir_configuration_yaml`. + recordIgnoredInvites: true +``` + ### Migrating from Mjolnir (Only required if migrating) Replace your `matrix_bot_mjolnir` config with `matrix_bot_draupnir` config. Also disable Mjolnir if you're doing migration. @@ -196,24 +214,6 @@ To **enable a given protection**, send a command like this: `!draupnir enable PR To **disable a given protection**, send a command like this: `!draupnir disable PROTECTION_NAME` (e.g. `!draupnir disable JoinWaveShortCircuit`). -## Extending the configuration - -You can configure additional options by adding the `matrix_bot_draupnir_configuration_extension_yaml` variable to your `inventory/host_vars/matrix.example.com/vars.yml` file. - -For example to change Draupnir's `recordIgnoredInvites` option to `true` you would add the following to your `vars.yml` file. - -```yaml -matrix_bot_draupnir_configuration_extension_yaml: | - # Your custom YAML configuration goes here. - # This configuration extends the default starting configuration (`matrix_bot_draupnir_configuration_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_bot_draupnir_configuration_yaml`. - recordIgnoredInvites: true -``` - ## Abuse Reports Draupnir supports two methods to receive reports in the management room. diff --git a/docs/configuring-playbook-bot-mjolnir.md b/docs/configuring-playbook-bot-mjolnir.md index 735a77596..f2f252277 100644 --- a/docs/configuring-playbook-bot-mjolnir.md +++ b/docs/configuring-playbook-bot-mjolnir.md @@ -99,6 +99,24 @@ You must replace `ACCESS_TOKEN_FROM_STEP_2_GOES_HERE` with your own value. matrix_bot_mjolnir_access_token: "ACCESS_TOKEN_FROM_STEP_2_GOES_HERE" ``` +### Extending the configuration + +You can configure additional options by adding the `matrix_bot_mjolnir_configuration_extension_yaml` variable to your `inventory/host_vars/matrix.example.com/vars.yml` file. + +For example, to change Mjolnir's `recordIgnoredInvites` option to `true`, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: + +```yaml +matrix_bot_mjolnir_configuration_extension_yaml: | + # Your custom YAML configuration goes here. + # This configuration extends the default starting configuration (`matrix_bot_mjolnir_configuration_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_bot_mjolnir_configuration_yaml`. + recordIgnoredInvites: true +``` + ## Adding Mjolnir synapse antispam module (optional) Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file (adapt to your needs): @@ -133,19 +151,3 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use ## Usage You can refer to the upstream [documentation](https://github.com/matrix-org/mjolnir) for additional ways to use and configure Mjolnir. Check out their [quickstart guide](https://github.com/matrix-org/mjolnir#quickstart-guide) for some basic commands you can give to the bot. - -You can configure additional options by adding the `matrix_bot_mjolnir_configuration_extension_yaml` variable to your `inventory/host_vars/matrix.example.com/vars.yml` file. - -For example to change Mjolnir's `recordIgnoredInvites` option to `true` you would add the following to your `vars.yml` file. - -```yaml -matrix_bot_mjolnir_configuration_extension_yaml: | - # Your custom YAML configuration goes here. - # This configuration extends the default starting configuration (`matrix_bot_mjolnir_configuration_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_bot_mjolnir_configuration_yaml`. - recordIgnoredInvites: true -```