buzzrelay
buzzrelay copied to clipboard
Add /ingest relay endpoint
This adds a new /ingest
endpoint to allow instances to opt-in to relaying their users' posts to a buzzrelay instance without necessarily subscribing to receive posts from the relay (or to subscribe to only selected hashtags or instances as they do now).
This allows instances that have upgraded to 4.2 but still want their posts on the relay to participate without requiring that they provide an API token for their streaming API (#6).
It'll probably help with #10 (update and delete posts not being forwarded), too, for posts that originate on a cooperating instance.
Note: I have not tested the code in the PR.
Not sure I get the idea here but I actually prefer buzzrelay following back eventually...
The idea is that this would allow buzzrelay to find posts in a way that's closer to a "real" relay (which is clearly the direction that the Mastodon devs want to move people towards).
You (or whoever else is also running this) won't have to manage accounts or deal with API keys on a bunch of different instances in order to collect posts from their streaming APIs - the admins of those instances can just add this endpoint to their relay config instead.
I think this goes in the right direction, but a quick look at the code makes me think the relay currently only understand Follow
and Undo Follow
activities (https://github.com/astro/buzzrelay/blob/276b78e8e0eafb2f6695e9c3e07e7ed14ad44a99/src/main.rs#L173), so adding a post-only endpoint would not actually be enough for content to be ingested. The relay code should support Create
, Update
and Delete
as well for this to work.
By the way, what you probably want to do on those activities:
-
Create
:Announce
the created object, routing based on its hashtags -
Update
: if it has a validsignature
, forward the activity as-is, routing based on its hashtags; otherwise, drop it -
Delete
: if does not have a validsignature
, drop it, otherwise forward the activity as-is, to everyone ifobject
==actor
, or routing based on hashtags otherwise (that part, however, may be a lot more work as you need to remember what hashtags the post was using)