FakeRelay is a tool for Mastodon admins to load statuses into their instances.
## Why is it needed?
If you're on a small or solo instance, following a hashtag doesn't provide a lot of value. This is because you'll only see stuff that's on the instance's federated timeline... but if you're the only user, the federated timeline is the same as your timeline.
Discovering what to index isn't hard (I'm hitting big instances' `/tags/{interestingTag}.json` routes to fetch the content I want), but telling my instance that I want to bring over a toot isn't straightforward.
One thing any user can do is hit the `/api/v2/search` endpoint using `resolve=true`. That does accomplish the goal of fetching the status, but it's a synchronous call so it can take some seconds.
This project uses the ActivityPub `/inbox` endpoint as if it were a relay. And then, the request is queued and eventually processed.
## How can I use it?
### You need to get an api key
Ask the operator for an api key. If you want an api key for fakerelay.gervas.io, I'm `@g3rv4@mastodonte.tech`. Send me a toot with your instance domain and I'll get you one. The API key will be associated with your domain.
### Add the relay to your instance
Your instance will receive traffic from this site as if it were a relay. But don't worry, it won't send anything except from the statuses you tell it to index.
Sure thing! The easiest way is doing so via `docker-compose`. One important thing to notice is that all the instances that use your FakeRelay will treat it as a real relay. That means they will send traffic your way.
FakeRelay ignores this traffic, but that will still count against your badwidth. What I did is I set up Cloudflare so that it only forwards `POST`s to `/inbox` if the `type` is `Follow`.
If you want requests to the homepage to redirect visitors somewhere, you can add a `"HomeRedirect"` entry on the generated `config.json`. The file would look like this:
```
{
"PublicKey": "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----",