diff options
author | Erik Johnston <erik@matrix.org> | 2023-12-13 16:15:22 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2023-12-13 16:15:22 +0000 |
commit | 0455c40085db7356f73b12e2592e35f02321c6ef (patch) | |
tree | 2dcd3ec1054371287ccc69dddd69aa31ad33703e /contrib/purge_api | |
parent | More renaming (diff) | |
download | synapse-0455c40085db7356f73b12e2592e35f02321c6ef.tar.xz |
Update book location
Diffstat (limited to 'contrib/purge_api')
-rw-r--r-- | contrib/purge_api/README.md | 6 | ||||
-rw-r--r-- | contrib/purge_api/purge_history.sh | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/contrib/purge_api/README.md b/contrib/purge_api/README.md index 2f2e5c58cd..5c5b1bcb53 100644 --- a/contrib/purge_api/README.md +++ b/contrib/purge_api/README.md @@ -4,8 +4,8 @@ Purge history API examples # `purge_history.sh` A bash file, that uses the -[purge history API](https://matrix-org.github.io/synapse/latest/admin_api/purge_history_api.html) -to purge all messages in a list of rooms up to a certain event. You can select a +[purge history API](https://element-hq.github.io/synapse/latest/admin_api/purge_history_api.html) +to purge all messages in a list of rooms up to a certain event. You can select a timeframe or a number of messages that you want to keep in the room. Just configure the variables DOMAIN, ADMIN, ROOMS_ARRAY and TIME at the top of @@ -14,5 +14,5 @@ the script. # `purge_remote_media.sh` A bash file, that uses the -[purge history API](https://matrix-org.github.io/synapse/latest/admin_api/purge_history_api.html) +[purge history API](https://element-hq.github.io/synapse/latest/admin_api/purge_history_api.html) to purge all old cached remote media. diff --git a/contrib/purge_api/purge_history.sh b/contrib/purge_api/purge_history.sh index de58dcdbb7..9092f2e670 100644 --- a/contrib/purge_api/purge_history.sh +++ b/contrib/purge_api/purge_history.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash # this script will use the api: -# https://matrix-org.github.io/synapse/latest/admin_api/purge_history_api.html -# +# https://element-hq.github.io/synapse/latest/admin_api/purge_history_api.html +# # It will purge all messages in a list of rooms up to a cetrain event ################################################################################################### @@ -77,9 +77,9 @@ TOKEN=$(sql "SELECT token FROM access_tokens WHERE user_id='$ADMIN' ORDER BY id AUTH="Authorization: Bearer $TOKEN" ################################################################################################### -# check, if your TOKEN works. For example this works: +# check, if your TOKEN works. For example this works: ################################################################################################### -# $ curl --header "$AUTH" "$API_URL/rooms/$ROOM/state/m.room.power_levels" +# $ curl --header "$AUTH" "$API_URL/rooms/$ROOM/state/m.room.power_levels" ################################################################################################### # finally start pruning the room: @@ -117,13 +117,13 @@ for ROOM in "${ROOMS_ARRAY[@]}"; do sleep $SLEEP STATUS=$(curl --header "$AUTH" -s GET "$API_URL/admin/purge_history_status/$PURGE_ID" |grep status|cut -d'"' -f4) : "$ROOM --> Status: $STATUS" - [[ "$STATUS" == "active" ]] || break + [[ "$STATUS" == "active" ]] || break SLEEP=$((SLEEP + 1)) - done + done fi set +x sleep 1 - fi + fi done |