Skip to content

Add /ingest relay endpoint#11

Open
M2Ys4U wants to merge 2 commits into
astro:mainfrom
M2Ys4U:ingest_relay
Open

Add /ingest relay endpoint#11
M2Ys4U wants to merge 2 commits into
astro:mainfrom
M2Ys4U:ingest_relay

Conversation

@M2Ys4U
Copy link
Copy Markdown

@M2Ys4U M2Ys4U commented Aug 10, 2023

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.

M2Ys4U added 2 commits August 10, 2023 03:50
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
@astro
Copy link
Copy Markdown
Owner

astro commented Aug 11, 2023

Not sure I get the idea here but I actually prefer buzzrelay following back eventually...

@M2Ys4U
Copy link
Copy Markdown
Author

M2Ys4U commented Aug 11, 2023

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.

@ClearlyClaire
Copy link
Copy Markdown

ClearlyClaire commented Aug 16, 2023

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 (

if action.action_type == "Follow" {
), 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 valid signature, forward the activity as-is, routing based on its hashtags; otherwise, drop it
  • Delete: if does not have a valid signature, drop it, otherwise forward the activity as-is, to everyone if object == 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)

@astro astro force-pushed the main branch 3 times, most recently from ea3a4c9 to 667602f Compare March 27, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants