From de5b241c4b3f6f4782515d8dedf4132a55dabf7b Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sun, 19 Jan 2025 14:33:37 +0900 Subject: [PATCH] Update docs for Draupnir and Mjolnir: the instructions for running the curl command Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-bot-draupnir.md | 11 +++++++++-- docs/configuring-playbook-bot-mjolnir.md | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/configuring-playbook-bot-draupnir.md b/docs/configuring-playbook-bot-draupnir.md index 31e2965f3..a20a97e7e 100644 --- a/docs/configuring-playbook-bot-draupnir.md +++ b/docs/configuring-playbook-bot-draupnir.md @@ -98,12 +98,19 @@ Manual access to Synapse's Admin APIs requires an access token for a homeserver #### Run the `curl` command -To discharge rate limiting, run the following command on systems that ship curl (note that it does not work on outdated Windows 10). Even if the APIs are not exposed to the internet, you should still be able to run the command on the homeserver locally. Before running it, make sure to replace `@bot.draupnir:example.com` with the MXID of your Draupnir: +To discharge rate limiting, run the following command on systems that ship curl (note that it does not work on outdated Windows 10). + +Before running it, make sure to replace: +- `ADMIN_ACCESS_TOKEN_HERE` with the access token of the admin account +- `example.com` with your base domain +- `@bot.draupnir:example.com` with the MXID of your Draupnir ```sh -curl --header "Authorization: Bearer " -X POST https://matrix.example.com/_synapse/admin/v1/users/@bot.draupnir:example.com/override_ratelimit +curl --header "Authorization: Bearer ADMIN_ACCESS_TOKEN_HERE" -X POST https://matrix.example.com/_synapse/admin/v1/users/@bot.draupnir:example.com/override_ratelimit ``` +**Note**: even if the APIs are not exposed to the internet, you should still be able to run the command on the homeserver locally. + ### Abuse Reports Draupnir can receive reports in the management room. diff --git a/docs/configuring-playbook-bot-mjolnir.md b/docs/configuring-playbook-bot-mjolnir.md index 14fe847ca..66cab6a67 100644 --- a/docs/configuring-playbook-bot-mjolnir.md +++ b/docs/configuring-playbook-bot-mjolnir.md @@ -50,12 +50,19 @@ Manual access to Synapse's Admin APIs requires an access token for a homeserver #### Run the `curl` command -To discharge rate limiting, run the following command on systems that ship curl (note that it does not work on outdated Windows 10). Even if the APIs are not exposed to the internet, you should still be able to run the command on the homeserver locally. Before running it, make sure to replace `@bot.mjolnir:example.com` with the MXID of your Mjolnir: +To discharge rate limiting, run the following command on systems that ship curl (note that it does not work on outdated Windows 10). + +Before running it, make sure to replace: +- `ADMIN_ACCESS_TOKEN_HERE` with the access token of the admin account +- `example.com` with your base domain +- `@bot.mjolnir:example.com` with the MXID of your Mjolnir ```sh -curl --header "Authorization: Bearer " -X POST https://matrix.example.com/_synapse/admin/v1/users/@bot.mjolnir:example.com/override_ratelimit +curl --header "Authorization: Bearer ADMIN_ACCESS_TOKEN_HERE" -X POST https://matrix.example.com/_synapse/admin/v1/users/@bot.mjolnir:example.com/override_ratelimit ``` +**Note**: even if the APIs are not exposed to the internet, you should still be able to run the command on the homeserver locally. + ### Create a management room Using your own account, create a new invite only room that you will use to manage the bot. This is the room where you will see the status of the bot and where you will send commands to the bot, such as the command to ban a user from another room.