Filter incoming relay traffic to a self-hosted Mastodon instance by remote server name.
Reduce storage usage on a Mastodon server by rejecting unwanted federated content.
Sit in front of an existing reverse proxy to control what relays can send to your instance.
| ahmed-debbech/mastgate | 3imed-jaberi/cryptography-si-isamm | 3imed-jaberi/koa-isomorphic-router | |
|---|---|---|---|
| Stars | 2 | 2 | 2 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | — | 2021-09-25 | 2021-02-06 |
| Maintenance | — | Dormant | Dormant |
| Setup difficulty | moderate | easy | easy |
| Complexity | 3/5 | 1/5 | 2/5 |
| Audience | ops devops | researcher | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires an existing reverse proxy in front of your Mastodon instance and Docker Compose to run.
Mastgate is a small proxy tool built for people who run their own Mastodon server, the kind of thing that powers Mastodon and other apps in what is called the Fediverse. Mastodon servers can subscribe to relays, which are services that forward a firehose of posts from many other servers so a small instance can see more activity. The problem is that most of that traffic is often irrelevant to the person running the server, and it fills up storage with content nobody wants to keep. Mastgate sits between the relay traffic and your Mastodon instance and decides what gets through. It looks at the incoming federated content and checks the remote server name it came from. If that server is on your allowed list, the content is forwarded to your instance as normal. If it is not, the content is rejected before it ever reaches your instance, saving you the storage space and clutter. Setting it up involves copying a sample environment file, filling in your Mastodon instance's URL, and pointing your existing reverse proxy so relay traffic flows through Mastgate first. From there you run it with Docker Compose. Once it is running, you visit a configuration page on the Mastgate server itself to tell it which relays you expect traffic from and which remote instances should be allowed through. Under the hood, Mastgate watches the inbox endpoint that receives federated messages, checks whether the request's signature matches one of your configured relays, then inspects the message body to find which server actually sent it. Only messages from allowed servers make it to your instance, everything else is silently rejected. The README describes this as a work in progress by a single developer, so it is a focused, personal tool rather than a polished product, and anyone using it should expect it to keep evolving.
A small proxy that filters Fediverse relay traffic before it reaches your Mastodon server, so you only receive posts from servers you actually allow.
Mainly JavaScript. The stack also includes JavaScript, Docker, Docker Compose.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly ops devops.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.