Simple database-based block bot for Mastodon
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Kay Faraday 40fad78407 implement opt-out 2023-02-06 08:20:34 +00:00
.gitignore implement opt-out 2023-02-06 08:20:34 +00:00
LICENSE.md initial commit 2023-02-04 03:22:37 +00:00
README.md implement opt-out 2023-02-06 08:20:34 +00:00
blockbot.sql implement opt-out 2023-02-06 08:20:34 +00:00
opter_outer.example.toml implement opt-out 2023-02-06 08:20:34 +00:00
opter_outer.py implement opt-out 2023-02-06 08:20:34 +00:00
requirements.txt implement opt-out 2023-02-06 08:20:34 +00:00

README.md

Mastodon Block Bot

This is a simple database-based block bot for Mastodon.

Installation

  1. Install plpython3. On Debian this is apt install postgresql-plpython3-13.
  2. Run the script as the database administrator account (postgres) in your Mastodon database. Database admin is required to create the Python extension and function. For example: sudo -u postgres psql mastodon < blockbot.sql.
  3. Insert a row into blockbot_config with your Mastodon hostname and a token for the account you want the blockbot to use. INSERT INTO blockbot_config (hostname, token) VALUES ('freak.university', '...');

Opter outer

This is a python fedi bot that processes opt out/opt in requests. By default, people are opted in, and they can run @blockbot opt out to opt out.

  1. Copy opter_outer.example.toml to opter_outer.toml
  2. Edit the db section as needed.
  3. python -m venv .venv
  4. . .venv/bin/activate
  5. pip install -r requirements.txt

Then set your service manager (such as systemd) to run .venv/bin/python opter_outer.py.

License

AGPLv3, see LICENSE.md.