This is a CLI utility that imports lists of instances to block into Mastodon. This is sometimes also called "defederation" or "domain blocking".
By default, this imports the instances from the @PaulaToThePeople list from https://joinfediverse.wiki/FediBlock but you can import any list that's in the right format (see Advanced usage below).
Note that this only works with instances running Mastodon v4.0 or higher because the admin domain blocks API is new.
This tool is what one might call a "blunt instrument" because it just defederates instances en masse. It is essentially a large banhammer.
Sometimes this is what you want - the PaulaToThePeople list is the worst of the worst so I think it's fine to just suspend those all at once.
But in general, please consider who you choose to defederate. This does ultimately affect people after all.
First, make sure you have a Python 3 environment set up. If you don't have one, I recommend pyenv.
- Install dependencies:
pip install -r requirements.txt
- In your instance, go to Preferences -> Development.
- Click New application. Name it anything you want and select the
admin:writescope. Leave all other defaults. - Click into your new application and note the client ID and secret.
- Fill in the
INSTANCE_URL,CLIENT_ID, andCLIENT_SECRETvariables inimporter.py.INSTANCE_URLshould start withhttps://and should not contain a trailing slash. - Run the script:
python importer.py
- Feel free to delete the application you created if you want.
This script can import any list that conforms to this YAML format:
- hostname: the instance domain
public_comment: the public reason you this is blocked
severity: one of "silence", "suspend", or "noop"You can see a full example in lists/paulatothepeople.yaml.
To import a custom list, run the script with the --list parameter:
python importer.py --list /path/to/list.yamlI included the script I used to generate the lists/paulatothepeople.yaml file. It can be used to regenerate the yaml if that list changes:
python tools/paulatothepeople_list.py > lists/paulatothepeople.yamlI vendored the list here just in case the Join the Fediverse wiki were to go down or something else happened to the list.
I will consider PRs, including those adding new lists. But keep in mind I will only accept new lists based on my own values, which are in line with point 1 of the Mastodon Server Covenant:
- Active moderation against racism, sexism, homophobia and transphobia
Thanks to @PaulaToThePeople for compiling this list, and the broader Mastodon #FediBlock community for spreading it around.