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.
- Copy
settings.ini.example
tosettings.ini
- Create a new Mastodon application in the settings under Development -> New Application
- Grant the application
admin:write
permission, and copy the access token tosettings.ini
- Enter the URL for your Mastodon instance (excluding the
https://
) insettings.ini
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)
- Install required dependencies (literally just
requests
) python fediblock_importer.py