From 1cded9ae765a9e8d9d10534762fe32614026dbf8 Mon Sep 17 00:00:00 2001 From: Viyurz <128215328+Viyurz@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:51:46 +0000 Subject: [PATCH] Synapse: Add script to generate registration token --- synapse/generate_registration_token.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 synapse/generate_registration_token.sh diff --git a/synapse/generate_registration_token.sh b/synapse/generate_registration_token.sh new file mode 100755 index 0000000..607784f --- /dev/null +++ b/synapse/generate_registration_token.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +rel_path="$(dirname "$0")" +access_token="$(cat $rel_path/../matrix_access_token.txt)" + +curl --header "Authorization: Bearer $access_token" \ + -H "Content-Type: application/json" -w "\n" \ + -X POST http://localhost:8008/_synapse/admin/v1/registration_tokens/new \ + -d '{ "uses_allowed": 1, "expiry_time": '"$(date +%s000 -d tomorrow)"' }'