Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement ActivityPub to enable federated Inventaire instances #187

Open
1 of 3 tasks
maxlath opened this issue May 24, 2018 · 13 comments
Open
1 of 3 tasks

implement ActivityPub to enable federated Inventaire instances #187

maxlath opened this issue May 24, 2018 · 13 comments

Comments

@maxlath
Copy link
Member

maxlath commented May 24, 2018

This issue isn't a todo, rather a way to investigate and document a possible future:

Steps

  1. Move Inventaire entities to a Wikibase instance (move Inventaire entities to a Wikibase instance #186), that would be the main non-decentralized service among federated Inventaire instances, the idea being that decentralizing this knowledge base would be pure waste of contributors efforts, which would have to re-do the work on every instances.

  2. Turn Inventaire into an ActivityPub-powered social network

Other services that could benefit from not being decentralized, or at least to offer the option to use a common instance between several instances:

  • The entities search engine: the entities remaining centralized, all running a search engine could just be a waste of resources(?)
  • A registry of compatible inventory providers (like libraries, bookshops, etc) and Inventaire instances(?)

Pros

  • centralizing everything has never been the goal of this project: the vision is still to aggregate information on resources from different providers, be them peers, libraries, or bookshops
  • that would probably bring more code contributors, just interested in improving/customizing their instance, giving the opportunity to explore adding new kinds of resources beyond books in a full bazar way
  • decentralization is cool ;)

Cons

  • Federation is still difficult to understand for many people used to centralized services
  • And then even for tech-saavy people, federation is hard: which instance should I choose, etc
  • Quality of service is hard to keep consistent over many instances, run by a diversely qualified crowd of sys admins and/or amateurs. Several issues on Mastodon seem to be related to this: mismatch between following/followers count and the actual list, cross instance lags, etc
  • Yeaah let's do all the work, and let a startup deploy it's customized version with ads and affiliation to Amazon on every pages, hurraay...

Questions

  • Is that even possible? Inventaire isn't "just" a microblogging platform, there are some heavy optimization to do to be able to display inventory content in a meaningful way, etc, how would that work over the fediverse? Discussing this possibility with @Chocobozzz, ActivityPub seems fit to activity streams, not to browsing large inventories over a myriad of instances(?)
  • Wouldn't that just create a lot of duplicated content? All the pages on entities (authors, works, series, etc) would be basically the same over each instances, with the only difference being the related inventory items being shown: to which page should you link when you want to link to this entity for the information on entity it provides, not for the inventory feature?

Requirements

  • full import/export features to be able to move an account to another instance: it is currently possible to export an inventory, but not to re-import it in a clean/complete way
@jum-s
Copy link
Contributor

jum-s commented Mar 5, 2020

Data transformation of users to create a discoverable ActivityPub actor could be a very first step toward being activity pub compliant, without having to think to much about entities and inventories yet.
Changing how relations and users are implemented today, so a user/actor could become something like this.
This would need to implement :

@vk0xOrg
Copy link

vk0xOrg commented Jul 22, 2020

any progress so far?

@maxlath
Copy link
Member Author

maxlath commented Jul 23, 2020

@vk0xOrg the informal discussions are accelerating and getting more urging but no code has been written in this direction yet

@maxlath
Copy link
Member Author

maxlath commented Jul 23, 2020

cross-posting a discussion from the chat:

Q: could one follow inventaire's user, say from mastodon?

A: no it's not possible at the moment. we are considering using ActivityPub to implement federation features #187 but it's not trivial. In the use case you describe for example, it wouldn't be as easy as just publishing one action per added items, as it's a perfectly acceptable behaviour in inventaire to create a 1000 items at once (either by importing data from another platform or by scanning a large library): just broadcasting that activity on something like mastodon would but zuper spammy. Maybe we could instead generate some sort of summary, like publishing one action saying "user X added 1000 new items to their inventory" with a link to the inventory. Somewhere where we could have a "1 inventaire action = 1 activity pub action" could be with book reviews: it's not expected that people would post a 1000 reviews at once (out of the case where they import reviews from another platform).

@vk0xOrg
Copy link

vk0xOrg commented Jul 23, 2020

the above sounds cool for me. at the moment I do not know ActivityPub protocol. Following days would try to check it and to see what I can do for this

@maxlath
Copy link
Member Author

maxlath commented Oct 6, 2020

Guide for new ActivityPub implementers

@jum-s
Copy link
Contributor

jum-s commented Dec 19, 2020

Some take away of AP exploration so far : mainly those articles, darius express example repo and the w3c specs: vocabulary and the basics:

  • "An activity is delivered to its targets (which are actors) by first looking up the targets' inboxes and then posting the activity to those inboxes." "The inbox is determined by first retrieving the target actor's JSON-LD representation and then looking up the inbox property."
  • "For federated servers performing delivery to a third party server, delivery SHOULD be performed asynchronously, and SHOULD additionally retry delivery to recipients if it fails due to network error. "
  • inboxes are stored as actorUrl+'/inbox'
  • "Servers SHOULD validate the content they receive to avoid content spoofing attacks." source
  • "The request contains a Date header. Compare it with current date and time within a reasonable time window to prevent replay attacks." source
  • "You need to include an inbox even if you don’t plan on receiving messages in response, because for legacy purposes Mastodon doesn’t acknowledge inbox-less actors as compatible." Meaning there is no need to setup inboxes if inventaire does not talk to masto source

To me the next step toward implementing users inventories activity streams would be to define what activity types to use (Accept, Create, Delete, Follow, Remove, Update)

@jum-s
Copy link
Contributor

jum-s commented Dec 28, 2020

an example of activityPub implemented in a book sharing context

@jum-s
Copy link
Contributor

jum-s commented Feb 5, 2021

new feedback from AP exploration, with a bunch of decision-related questions to figure out, before even considering to follow people from two inventaire instances

  • Webfinger: do we use webfingers ? Which is technically not AP but most implementers use it (peertube, funkwhale, pleroma)

  • Auth: server to server. 2 options through HTTP or through Linked Data. HTTP seems lighter. If we agree on HTTP signature, 2 features to implement: signature verification from remote instances and signature verification on incoming activities. RSA key pair got to be generated for each actor/user (at user creation, or at their first "federation opt-in" in user settings)

Those bring a larger question : is inventaire AP designed to be fully interoperating with Mastodon ? (implying extra work like implementing inboxes and webfingers for example). As this detailed report puts it :

Applications interoperating with Mastodon over ActivityPub must support Webfinger resolution, with a unique preferredUsername per host, so that they can be interacted with by other users. Posts to the inbox must be signed using the HTTP Signatures draft spec with a public key that can be fetched from the actor, using the publicKey object format from the WebPayments JSON-LD Security Vocabulary.

@aschrijver
Copy link

Wonderful to see this issue. I was pointed in this direction by @mariha in this SocialHub topic. A whole ranch of new application types are considering a move to the Fediverse, and an opportunity exists to latch on to this to collaboratively focus on standardisation of vocabularies and interop mechanisms. For instance we have a growing group of people interested in Semantic Knowledge Bases.

You are all most welcome at SocialHub community, where the real Fediverse technology foundation action takes place. I encourage anyone to join as member and discuss topics of interest :)

PS. I have added your project on the ActivityPub Application Watchlist in the Open Data category.

@jum-s
Copy link
Contributor

jum-s commented Jul 8, 2021

some detailed documentation on the federating process of gitea with AP and AS go-gitea/gitea#14186

@jum-s
Copy link
Contributor

jum-s commented Jul 16, 2021

a rather extensive ActivityStream implementation from a CouchDB point of view (found here https://socialhub.activitypub.rocks/t/how-do-i-store-activities-and-objects-in-an-sql-database/1880). Looks like CouchDB is convenient to store full JSON activities and retrieve specific objects when asked by someone else.

@almereyda
Copy link

Especially the explanation of the OP of the comment you are referring to further down in the conversation is very compelling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants