A tool for blocking federation with Mastodon instances in bulk
This repository has been archived on 2024-03-03. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2024-02-18 18:32:56 -05:00
.gitignore First release 2022-11-21 20:21:55 -05:00
blocklist.csv First release 2022-11-21 20:21:55 -05:00
fediblock_importer.py First release 2022-11-21 20:21:55 -05:00
LICENSE Initial commit 2022-11-21 20:18:39 -05:00
README.md Update README.md 2024-02-18 18:32:56 -05:00
requirements.txt First release 2022-11-21 20:21:55 -05:00
settings.ini.example First release 2022-11-21 20:21:55 -05:00

UPDATE 2024-02-18: This tool is no longer necessary, you can import blocklists directly into Mastodon in newer versions. From your settings page, go to Moderation -> Federation -> Import. Export your existing blocklist first to get a sample of the format your blocklist should be imported in.

This is a tool for bulk blocking federation with Mastodon instances.

Setup

  1. Copy settings.ini.example to settings.ini
  2. Create a new Mastodon application in the settings under Development -> New Application
  3. Grant the application admin:write permission, and copy the access token to settings.ini
  4. Enter the URL for your Mastodon instance (excluding the https://) in settings.ini

Blocklist formatting

Add rows to blocklist.csv for each domain you want to block in the following format:

domain,block_type,reject_media,reject_reports,private_comment,public_comment,obfuscate

block_type should be either silence or suspend

reject_media, reject_reports, and obfuscate should be True or False (case-insensitive)

Usage

  1. Install required dependencies (literally just requests)
  2. python fediblock_importer.py