From d5bebcf1ed778f6fad850828d5cfacddcc735ef7 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 26 Dec 2019 18:00:18 -0600 Subject: [PATCH 1/3] expand README --- README.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15c1192..5a9923d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,68 @@ -remote_media_killer +Remote Media Killer =============== -A shell script to make purging remote media files from a Matrix Synapse server easier. \ No newline at end of file +A shell script to make purging remote media files from a Matrix *Synapse* server +easier. + +## Dependencies + +These (or compatible versions) are likely included by default with your chosen +GNU/Linux system. + +- Tested with *GNU bash* 5.0.11 +- Requires *GNU date* for date/time conversion +- Requires *Perl* for domain validation + +## Installation + +### Downloading directly + +Go to the [Releases](https://gitbucket.thisisjoes.site/joe/remote_media_killer/releases) +page and click the link for `rmk.sh` to download the script. + +### Downloading using *git* + +Navigate to a reasonable directory and download the repo with `git clone +https://gitbucket.thisisjoes.site/joe/remote_media_killer.git`. This will create +a directory named `remote_media_killer` automatically. + +To ensure you run the latest version of the script, first navigate to the +directory with `cd remote_media_killer`, then switch to the latest version with +`git checkout 1.0.0`, replacing "1.0.0" with a more recent version if necessary. + +## Usage + +### Executing the script + +You may execute the script directly using *bash* with `bash rmk.sh`. + +You may also **mark the script as executable** with `chmod +x rmk.sh` and +execute using this shorthand `./ rmk.sh`. + +#### Making executable from anywhere +If you don't want to have to navigate to the directory containing the script +before executing it, you can make it executable from anywhere by first marking +it as executable (see above), then copying it to an appropriate directory +`cp -p rmk.sh /usr/bin/local/rmk`. Finally execute the script with `rmk`. + +### Inputting Information + +*Remote Media Killer* only takes three variables: + + 1. The FQDN (Domain) of your Matrix Synapse server. + 2. The time/date (Time) of the oldest media you want to keep. + 3. The account token (Token) of a Matrix account with administrative privileges + on your server. + +Type each of these variables when prompted and press ***Enter*** to continue. +The script will return relevant errors if there are any, as well as any output +from the *Synapse* server. + +For example, a successful media purge would result in output similar to the +following: + +```json +{ + "deleted": 1337 +} +``` From 20450a8e46090555eec1ae37892be635f194eeb7 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 26 Dec 2019 18:47:23 -0600 Subject: [PATCH 2/3] add Common Errors section and corresponding wiki link --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5a9923d..b42a0ef 100644 --- a/README.md +++ b/README.md @@ -66,3 +66,7 @@ following: "deleted": 1337 } ``` + +### Common Errors + +If you encounter an error while using the script you may find a solution on the [Common Errors](https://gitbucket.thisisjoes.site/joe/remote_media_killer/wiki/Common Errors) page. From 4f04a999a48927d6d9651615415ee54bae941cc4 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 26 Dec 2019 18:49:28 -0600 Subject: [PATCH 3/3] include endpoint used in dependencies section --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b42a0ef..9ec9053 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ GNU/Linux system. - Tested with *GNU bash* 5.0.11 - Requires *GNU date* for date/time conversion - Requires *Perl* for domain validation +- Uses the `_synapse/admin/v1/purge_media_cache` API endpoint ## Installation