8 ms·
Go-Fed: ActivityPub in Go
- donio 4y agohttps://github.com/superseriousbusiness/gotosocial https://github.com/superseriousbusiness/gotosocial is another ActivityPub implementation in Go. It implements a full server and aims to provide Mastodon-compatible client APIs. Lots of cool work going on in this space.
- remram 4y agohttps://github.com/superseriousbusiness/activity https://github.com/superseriousbusiness/activity [1] is actually forked from go-fed/activity, so they are not really different implementations. I don't know why go-fed is on here honestly, it's just a library, and one that isn't used directly for anything at the moment. [1]: https://github.com/superseriousbusiness/activity https://github.com/superseriousbusiness/activity
- doublepg23 4y agoIt’s been an enjoyable experience getting this to run on fly.io . Still working out a few bugs but the team has been very responsive on my bug reports.
- serverholic 4y agoI’ve heard ActivityPub has mixed reviews. Perhaps someone here with a little more expertise can answer this question. Does ActivityPub have a batching mechanism? Imagine you are on server A and you have 3000 followers on server B. If you create a post do 3000 messages get sent to server B? Or just one?
- jakewins 4y ago> 7.1.3 Shared Inbox Delivery > For servers hosting many actors, delivery to all followers can result in an overwhelming number of messages sent. Some servers would also like to display a list of all messages posted publicly to the "known network". Thus ActivityPub provides an optional mechanism for serving these two use cases. From https://www.w3.org/TR/activitypub/#outbox-delivery https://www.w3.org/TR/activitypub/#outbox-delivery
- zimpenfish 4y agoYou don't necessarily have a sharedInbox though, I think?
- nightpool 4y agoServers are not required to provide a shared inbox, but if they want to enable batching behavior they can. Not sure if that's what your asking?
- zimpenfish 4y agoAFAIUI yes, you will probably get 3000 messages sent because each follower has their own inbox. There is a potential for batching though - "a server MAY reduce the number of receiving actors delivered to by identifying all followers which share the same sharedInbox who would otherwise be individual recipients and instead deliver objects to said sharedInbox" - if a bunch of the 3000 followers have the same sharedInbox (which presumably the receiving server has somehow magicked up?[1]), then your server can do a bulk delivery to that for those followers. [1] I guess you might make them for specific celebrities if your server has a high density of followers? grepping the Pleroma source doesn't seem to throw up any obvious "automatically make them" logic.
- nightpool 4y agoGenerally, all followers on a single server share the same sharedInbox. To a first approximation, that's what "server" means on ActivityPub—sharing a "batch" inbox you can deliver to.
- zimpenfish 4y ago> Generally, all followers on a single server share the same sharedInbox. You mean that all followers of Celebrity X on instance Y will have a sharedInbox because they're a follower of Celebrity X? Apologies, I've only lightly read the spec and haven't really seen anything like this in there.
- nightpool 4y agoNo, sorry, what I mean is that all users on mastodon.social have a unique private inbox and then a "sharedInbox" value of "https://mastodon.social/inbox https://mastodon.social/inbox". Almost all deliveries (with appropriate "to" and "cc" targeting values that the receiving server can appropriately deliver to, i.e. individual actors or the special "followers" group for an actors) can be sent to the sharedInbox in bulk, but for private groups and some other special cases you may want to use direct delivery.
- orblivion 4y agoI just tried using the app tutorial the other week as a newcomer to ActivityPub. I found it rather difficult to follow because it's so abstracted and it has you dive in head first doing a lot at once. And there are parts left as an exercise to the reader, which leaves gaps that makes it harder. And there are a few bugs in the tutorial code to boot. I feel like the author was very thoughtful about the whole thing, and very thorough, which I appreciate, but was too deep into it to put himself in the headspace of someone who is new to ActivityPub per se. Just my guess, of course. I'm trying go-ap now and it's better in that I can jump in and use small parts of it, but it still could use more documentation.
- mariusor 4y agoHi, I'm the developer of go-ap, thank you for your interest. Which parts of it are giving you trouble? I'm always open to answer questions to the project's mailing list: https://lists.sr.ht/~mariusor/activitypub-go https://lists.sr.ht/~mariusor/activitypub-go There is a rather hidden wiki that has some more information than strictly the comments in the code: https://man.sr.ht/~mariusor/go-activitypub/ https://man.sr.ht/~mariusor/go-activitypub/ If you are looking for examples, there is a reference server at https://github.com/go-ap/fedbox https://github.com/go-ap/fedbox Outside of that, any submission for documentation from your part would be greatly appreciated, like you already said, if you work with the specification for a long time it's sometimes difficult to put yourself in the shoes of someone new. I would greatly appreciate such a perspective.
- orblivion 4y agoThanks, I appreciate that you're interested in this feedback. I didn't know how much I should be bombarding the github issues. I posted the github issue in fedbox about making cs2.md easier to find. (to that end - if there's a hidden wiki, make it not hidden!) Nothing in particular is giving me trouble. It's just that reading through fedbox (which I think is billed as a "simple" example) there's a lot going on and I don't know what exactly I'm looking at or where to start looking (though over time, especially after finding cs2.md, I'm starting to). The first hook for me was the definition of the "Service" actor, and I said "ah hah. so if I do this, but make it a Person, and fill in these attributes, it'll help me generate a json response of a Person actor" Then after spending time looking at errors with json.Marshal I realized that I need to be using jsonld.Marshal instead. That detail was never put in front of me. Then I had to dig through various repos to find how to add the "@context" fields. Right now I'm figuring out what exactly the Inbox and Outbox things do for me (maybe just generate a path?) And so on. I don't imagine this is how you want us to figure out how to use go-ap. Similar to the go-fed developer, it seems like you may not realize how much understanding you're taking for granted. I think someone like me could benefit from a real stripped down example, no currying (pretty cool, never seen it before in Go, but a bit confusing), no layers of indirection, normal Go http handlers, the simplest database option. Let me do fancy abstractions in my own app once I learn how the libraries work. And/or a README that gives the lay of the land.
- olah_1 4y agoCan this run on a mobile device similar to Matrix’s Dendrite server running on mobile?
- Arathorn 4y agoprobably, but the hard bit of doing that is needing the p2p overlay network to provide connectivity - eg Pinecone is what we use for P2P Matrix (see https://arewep2pyet.com https://arewep2pyet.com)