tootpaste/README.md

58 lines
2.0 KiB
Markdown
Raw Permalink Normal View History

2021-08-29 00:00:05 +00:00
# tootpaste
2021-08-29 01:15:41 +00:00
![tootpaste logo](./logo.png)
2021-08-29 01:17:54 +00:00
2021-08-29 00:55:48 +00:00
Toot(h)paste is a simple bash script to clean your Mastodon instance.
2021-08-29 01:25:08 +00:00
It is basically a wrapper around `tootctl` but add some more logic, especially
around `accounts cull` to detect instances in errors and purge them (expired
certificate, cannot connect, etc.)
2021-08-29 00:55:48 +00:00
# How to install
```bash
$ wget https://git.benpro.fr/benoit/tootpaste/raw/branch/main/tootpaste.sh \
-O /tmp/tootpaste.sh
$ sudo install -m 755 -o root -g root /tmp/tootpaste.sh /usr/local/bin/tootpaste
```
# How to use
By default it runs in dry-run mode.
To run without dry-run:
```bash
$ DRY_RUN=false tootpaste
```
## Parameters
There are no arguments, everything is managed by environment variables, here is
the list of what you can use:
- `DO_ACCOUNTS_CULL`, boolean, run or not accounts cull step, default: `true`
- `DO_MEDIA_REMOVE`, boolean, run or not media remove step, default: `true`
- `DO_STATUSES_REMOVE`, boolean, run or not statuses remove step, default:
`true`
- `DO_CACHE_RECOUNT`, boolean, run or not cache recount step, default: `true`
- `TOOTCTL`, string, path to tootctl binary, default:
`/home/mastodon/live/bin/tootctl`
- `DB_POOL`, integer, concurrency to use (connections to PostgreSQL), default:
2021-08-29 01:20:58 +00:00
`5`
2021-08-29 00:55:48 +00:00
- `DRY_RUN`, boolean, run or not in dry-run mode, default: `true`
- `TLS_EXPIRED_MAX_SEC`, integer, number of seconds, age difference between now
and date of expired certificate, default: `1210000`, 2w
- `INSTANCE_LAST_CHANCE_TIMEOUT`, integer, timeout in seconds to connect to an
instance that was previously not accessible, default: `30`
- `MEDIA_REMOVE_DAYS`, integer, how old in days media attachments have to be
2021-08-29 02:04:02 +00:00
before getting removed, default: `7`
2021-08-29 00:55:48 +00:00
- `CARDS_REMOVE_DAYS`, integer, how old in days cards previews have to be
2021-08-29 02:04:02 +00:00
before getting removed, default: `15`
2021-08-29 00:55:48 +00:00
- `STATUSES_REMOVE_DAYS`, integer, how old in days unreferenced statuses have
2021-08-29 02:04:02 +00:00
to be before getting removed, default: `30`
2021-08-29 00:55:48 +00:00
Example:
```bash
$ DRY_RUN=false DO_CACHE_RECOUNT=false DB_POOL=50 tootpaste
```