Compare commits

...

7 Commits

Author SHA1 Message Date
Joe f54344f113 correct clone link 2019-12-26 19:10:12 -06:00
Joe 0211689025 remove extra space 2019-12-26 19:01:09 -06:00
Joe d3aa1a6971 Merge pull request #1 from joe/dev
dev=>master
2019-12-26 18:50:12 -06:00
Joe 48ce539c41 Merge branch 'master' into dev 2019-12-26 18:50:06 -06:00
Joe 4f04a999a4 include endpoint used in dependencies section 2019-12-26 18:49:28 -06:00
Joe 20450a8e46 add Common Errors section and corresponding wiki link 2019-12-26 18:47:23 -06:00
Joe d5bebcf1ed expand README 2019-12-26 18:00:18 -06:00

View File

@ -1,4 +1,73 @@
remote_media_killer Remote Media Killer
=============== ===============
A shell script to make purging remote media files from a Matrix Synapse server easier. 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
- Uses the `_synapse/admin/v1/purge_media_cache` API endpoint
## 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/git/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
}
```
### 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.