Skip to main content

PyPI release Supported Python versions Code style: black BSD License

Tools for Mastodon Instance Blocklist Management

If you are running a small Mastodon instance then you do not have the benefit of moderation teams that larger instances have. This means that you may see toots from instances that you are not interested in.

Particularly when you use relays to discover interesting content there is a high probability that you will quickly discover eg. openly racist instances that nobody in their right mind needs or wants. With a personal mastodon instance it will be your job to either block individual users from those instances, or manually defederate (that is: block) the server for everyone on your instance.

So if you trust some larger instance to do a good job at maintaining their instance block list then this tool allows you to piggyback on their work and use their blocklists on your instance.

Installation

You will need Python 3.6+ with pip. Then run pip install defederate.

Parse a public 3rd-party blocklist

$ defederate show social.example.com
Current blocklist on social.example.com:
 SILENCE: badhost1.example.com
 SILENCE: badhost2.example.com
 (...)
 SUSPEND: badhost1.example.net
 SUSPEND: badhost2.example.net
 (...)

The server you are requesting the blocklist from must allow public access.

This can also parse blocklists in Markdown format, for example the blocklist used by chaos.social:

$ defederate show https://github.com/chaossocial/about/raw/master/blocked_instances.md

Notes

Metadata

Release files for defederate 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for defederate 0.2.1
File Size Uploaded Provenance Actions
defederate-0.2.1.tar.gz 11.3 kB Without provenance Details for defederate-0.2.1.tar.gz

Release files / defederate-0.2.1.tar.gz

Download URL defederate-0.2.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2b077d906a4dbf078c2d71ead892f822536d1982ef0888679bdaaeac194637d0
BLAKE2b-256 checksum
How to use checksums
ef0e2daf800d5441db4867b4f79e18f948097e27de6fc84e9943caca3c3e3cf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for defederate 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page