I'm trying to get an extremely basic AP setup going where people can follow a single account on a server and get automatically-generated updates when actions are performed. Specifically, I want to process followers and send a post to followers when someone adds a book to or removes one from Little Library. It's pretty much 100% server to server with very little client input beyond prompting the server to post.
So far, I have an outbox and a way to view posts. I'm trying to get that set up so I can start researching what I receive from a Mastodon follow request in order to learn what data to save and send Create activities to. But when I search for a specific post from Mastodon, it errors out with a 503 error from the Masto server...
Here is the folder of the repo with my implementation so far:
And here is my (temporary) live AP actor endpoint with a piece of live data:
Thanks in advance!
@Alamantus I’m not an expert, but a few of my thoughts:
I believe that in ActivityPub sending Create activities to followers doesn’t refer back to the original Follow request at all. The Create/Note is just sent to an actor whether it’s a follower or not. So a list of actor (webfinger) ids is all you would need to store to handle followers. However, ActivityPub servers will expect the server they send a Follow/Actor activity to, to send them an Accept/Follow (or Reject/Follow) eventually in a separate connection; this includes the original Follow. Some systems will do this by just storing the whole received thing (and all sent things), others by faking the original, presumably by at least remembering the activity id. But I’m totally not an expert!
I think you can leave out the Create activity if it just wraps an object like a Note; maybe I misunderstood from the spec.
Having the activity id and the object id the same doesn’t seem right. Take into account that the object of an activity can itself be an activity (e.g. the Accept/Follow).
@dansup So I updated the actor to be structured the same way as the fedidb actor you share in your last message, and Mastodon is still not finding it... The only thing I excluded was "following".
Any other guesses? The branch of the repo that I linked before has been updated with the current setup.
@Alamantus Hmm, strange. I noticed your webfinger doesn't have an aliases attribute, maybe that could be it?
I tested your actor with Pixelfed and its working as expected.
@dansup Hmm, that's worth a shot, I suppose. Lol I'll just try to get it to look as much like your fedidb account as possible!
That's very encouraging to see it working on Pixelfed, though! Except it should have 1 post in the outbox... hmm, one step at a time, I guess.
Thanks so much for helping!
@Alamantus I tried importing the post but its missing a context, thats likely why you can't search for the post.
@dansup Oh geez, you're right! I'll try adding that next. Thanks again for helping and being so patient with me!
@Alamantus I noticed you have both Create + Note objects, usually Create is only used for delivery to inboxes and it references the Note or whatever verb.
Here is an example object https://fedidb.org/actor/mgc4EcwQvSbXhxZBbW9W/content/post.json if it helps. And no problem, if you have any more questions let me know!
@dansup Ahh, ok, cool! That was one thing I wasn't sure about and couldn't really find a clear answer for when I looked. That gives me a lot to work with now
I'm sure I'll have more questions soon! Lol
@dansup So I'm pretty sure that I've got everything looking like the output for Mastodon, FediDB, and PixelFed, but searches still don't reveal my post(s). Mastodon's outboxes do contain the Create action with the Note object, so I kept that how I had it. The only thing I'm not doing is paginating my outbox because I really don't want to paginate it and according to the spec it should be fine...
PixelFed does find the actor, but not the new images I attached to it or the posts in the outbox... The HTTP headers don't seem to matter when comparing Mastodon to FediDB, so at this point I'm just a little lost about why it's not working...
Any other ideas?
@mike Ah, I didn't realize that was a Mastodon-specific thing. I'm still working on getting HTTP signatures working. I thought I had it set up correctly to send Accept activities to follow requests, but Mastodon said verification failed when I tried following. Probably needs both kinds of signature is my guess?
Little Library won't be getting any posts, only sending them to followers, so I'm not too worried about that at the moment. Still have plenty to figure out, though...
@mike FYI, it can't be tested at the moment because the power in my neighborhood went out and the server is in my home office...