# HG changeset patch # User Peter Gervai # Date 1643016068 -3600 # Node ID 85afc1496738472af8dddf99d0b9396df7ae75bf # Parent 2128a557be765262b61a88c8dbb405ef5bd5df96 madmin shows v2 delete room example diff -r 2128a557be76 -r 85afc1496738 synapse/madmin.sh --- a/synapse/madmin.sh Mon Jan 24 10:20:52 2022 +0100 +++ b/synapse/madmin.sh Mon Jan 24 10:21:08 2022 +0100 @@ -1,5 +1,5 @@ #!/bin/bash -# $Id$ +# $Id: madmin.sh,v fc290d860b42 2022/01/24 09:19:54 grin $ #(c)Peter Gervai, 2019-21 # # A simple tool to query the admin API @@ -8,10 +8,8 @@ # export T="MDAxNWxvY2F0aW..." # +. ./_config.sh -. ./token.sh - -U="https://matrix.example.mars:8448" MODE="$1" CMD="$2" JSON="$3" || '{}' @@ -20,14 +18,17 @@ if [ "x" = "x$CMD" ]; then echo "Usage: $0 []" echo "Example: $0 GET /_matrix/client/r0/admin/whois/@grin:grin.hu" - echo "Example: $0 GET /_synapse/admin/v1/reset_password/@example:grin.hu '{ \"new_password\": \"12345\" }'" - echo "Example: $0 POST /_synapse/admin/v1/send_server_notice '{\"user_id\": \"@grin:matrix.org\", \"content\":{\"msgtype\":\"m.text\",\"body\": \"Hello from server!\"}}'" + echo " $0 GET /_synapse/admin/v1/reset_password/@example:grin.hu '{ \"new_password\": \"12345\" }'" + echo " $0 POST /_synapse/admin/v1/send_server_notice '{\"user_id\": \"@grin:matrix.org\", \"content\":{\"msgtype\":\"m.text\",\"body\": \"Hello from server!\"}}'" echo " $0 POST /_synapse/admin/v1/deactivate/@spammer:grin.hu" + echo " $0 DELETE '/_synapse/admin/v2/rooms/!YDqJPFEKtBIEGBHqZE:matrix.org' '{ \"block\": true, \"purge\": true }'" + echo " $0 GET '/_synapse/admin/v2/rooms/!YDqJPFEKtBIEGBHqZE:matrix.org/delete_status' | jq" + exit fi #set -x -curl -d "$JSON" -X${MODE} "${U}${CMD}?access_token=$T" +curl -d "$JSON" -X${MODE} "${SRV}${CMD}?access_token=$T" #set +x echo ' '