Understanding ActivityPub and Federation

I have tried to understand how Federation works but I’m getting a feeling that there’s some rather large gaps here. My first attempt was to find an API implementation in python, 3 wasted hours of my life later and I’m making requests.request() calls like it’s 2007. And I still can’t access the content as presented on the webinterfaces. There doesn’t seem to be a way to access eg the communities tab via activitypub? Any Help?

@programming

  • alexland@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    I’m not an expert, but based on my understanding the Communities tab (as well as things like your user profile) are special to Lemmy, and stored on a given Lemmy instance. ActivityPub basically provides a shared language for how various services/clients can ask for and send each other data (posts, comments etc) in a totally agnostic format. Lemmy renders this data as posts and comments, but Mastodon renders them as toots and so forth. And that’s an oversimplification, because there’s no guarantee that two pieces of software (Lemmy and Mastodon in this example) will operate with the same ActivityPub types, so the way content is displayed is inconsistent or possibly entirely incompatible. If you want to create a generic Fediverse reader, you would need to keep an up-to-date representation of every type that every common ActivityPub software uses for its content, which could work but I imagine would be quite tedious and prone to breaking. That being said, I was imagining something like this existing myself, and I suspect over time as different types become common “building blocks” for different types of social networks this will be more solidified and straightforward.

    To your mention of content not being accessible from everywhere, it sounds like maybe you’re expecting a centralized directory of information, but that’s the big difference with true decentralization/federation. No single Lemmy instance know of every other Lemmy instance, they only know the ones they’ve talked to. All of the data is accessible if I know the hostname of a Lemmy instance, I just need to know the hostname first, and unless we build a centralized repository of every instance, we will never know of every single one. In the meantime, larger Lemmy instances have a large enough list of federated servers to get you most of the way there in terms of a directory, so maybe that’s a reasonable stopgap.

    • JustusWingert@feddit.de
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      You actually described my expectation in that last paragraph. I fully expected to have to invent a curated list of endpoints. What I instead found was that even given an endpoint (like beehaw.org) there is no way to discover what is on that instance. Which is a big issue. I’ve discussed this a bit (albeit extremely slowly) with the folks in the activitypub irc, and pretty much got it confirmed. If you want to develop a service that is intent on delivering any form of public content at all, supporting activitypub, then you have no protocol based way of communicating this content to anyone. So going by that the lemmy implementation is actually “correct”, in as much as the protocol simply fails to provide guidance for this critical step.