-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Gervasio Marchand | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,22 +2,34 @@ | |
|
||
FakeRelay is a tool for Mastodon admins to load statuses into their instances. | ||
|
||
More importantly, FakeRelay is NOT: | ||
|
||
* A relay. Even if from Mastodon's point of view it is a relay, if multiple instances are connected to it *it won't* share their posts. | ||
* A scraper. FakeRelay receives a post's url and sends that to the registered instance. | ||
|
||
## 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. | ||
If you're an admin of an instance, it's not really that easy to tell it "hey, index this post!". One thing any user can do is hit the `/api/v2/search` endpoint using `resolve=true`. That does accomplish the goal of fetching the post, but it's a synchronous call so it can take some seconds. | ||
|
||
FakeRelay exposes an API to use the ActivityPub `/inbox` endpoint as if it were a relay. And then, the request is queued and eventually processed. | ||
|
||
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. | ||
## What can I use it for? | ||
|
||
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. | ||
I use it to load content with #hashtags I care about. How? well, that's a separate project: [GetMoarFediverse](https://github.com/g3rv4/GetMoarFediverse). | ||
|
||
This project uses the ActivityPub `/inbox` endpoint as if it were a relay. And then, the request is queued and eventually processed. | ||
Other people have built other things on top of FakeRelay: | ||
|
||
* Abhinav Sarkar wrote [an article](https://notes.abhinavsarkar.net/2022/fake-relay) showing how you can achieve something similar to GetMoarFediverse in Python | ||
* Raynor built [Fake Firehose](https://github.com/raynormast/fake-firehose), a tool that streams content from other instances and pushes that to FakeRelay. | ||
|
||
## 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 `@[email protected]`. Send me a toot with your instance domain and I'll get you one. The API key will be associated with your domain. | ||
|
||
I'm hosting this behind Cloudflare Workers. So if you have a lot of traffic, I'll ask you to run it on your infrastructure :) | ||
|
||
### 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. | ||
|