5
0
DEPRECATED. The scripts have been moved to ansible. Synapse (matrix server) scripts for Anarchy Planet
This repository has been archived on 2024-08-15. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2022-12-26 11:25:05 -08:00
Makefile refactor synapse purge and compress to run non-interactively 2021-10-09 11:04:48 -07:00
README.md refactor synapse purge and compress to run non-interactively 2021-10-09 11:04:48 -07:00
synapse-purge-compress.sh Update default path of database config file 2022-12-26 11:25:05 -08:00

Synapse (matrix server) scripts for Anarchy Planet.

Dependencies

curl for GET and POST to the synapse API.

jq for JSON parsing.

psql utility, which is normally automatically installed with the postgresql server.

synapse-compress-state for compressing the synapse state tables.

Installing

With this repository as your working directory, run make as root.

Using the scripts

synapse-purge-compress

The postgres database for the matrix synapse server grows big fast. This script brings its size back down by purging old data and compressing the state tables.

Run as the matrix-synapse user, for example:

sudo -u matrix-synapse synapse-purge-compress

Run from cron:

sudo -u matrix-synapse crontab -e

Add a line like so:

0 2 1 * * /usr/local/bin/synapse-purge-compress

NOTE: the script is still very verbose, so you may want to run it with chronic from moreutils.