Exhaustive list of Fediverse app compatibilities?

Hello,

Is there somewhere an exhaustive list of compatibilities between Fediverse apps ?

e.g. : Mastodon ↔ Pleroma ↔ Pixelfed, Lemmy ↔ Kbin, etc.

Thanks

2 Likes

UP please, thanks !!

I don’t know of any exhaustive list . There are some fragments of information on a few sites, but nothing that seems to be actively maintained.

Could anyone with current and extensive knowledge of the fediverse make a list here ?

As I’m creating a tool for browsers to redirect between fediverse instances (e.g. a user clicks on mas.to/@alice/xxxx gets redirected to mstdn.social/@alice@mas.to/xxxx because that’s where they have an account), I need to know all possible redirections (i.e. not only between instances of the same software but also between compatible software), so that all use cases would be covered.

Thanks

This question of the incompatibilities is relevant. I am afraid we will end having multiple applications where some functionalities are incompatible among them. We should also identify which aspects are incompatible. For example, can I migrate between two applications (e.g., Mastodon and Pleroma) such that followers and followed people are preserved?

No this isn’t about redirecting as in migrating an account to another, but as in literally redirecting a link to another in the browser.

e.g. I click on the following post link from an instance I am not a member of : Daniel Hernandez: "#introduction: I am a Chilean computer scientist …" - Mastodon ; and I am redirected to this link pointing to the same post viewed from an instance I am a member of : Daniel Hernandez: "#introduction: I am a Chilean computer scientist …" - Mastodon

Demo :

Recording 2023-07-08 at 23.04.16

For now I have an script that can do the following redirections :

  • Mastodon to Mastodon ;
  • Lemmy to Lemmy ;
  • Pixelfed to Pixelfed.

But it was brought to my attention that I should also add the following :

  • Mastodon to Pixelfed ;
  • Pixelfed to Mastodon ;
  • Lemmy to Kbin ;
  • Kbin to Lemmy.

I’m also taking into consideration that everything that is compatible with Mastodon is compatible with Elk as well.

So, if I want to release something as versatile as possible, I’ll need a complete list of compatibilities.

Thanks

Sorry, but the video is so fast that I cannot understand what is happening in it. I am trying to understand what you mean by compatible. I can use other instances to display my Fediverse profile @danielhz@mastodon.social. For example, in the Mastodon instance https://mamot.fr/ and in the Kbin instance https://kbin.social, my profile is then displayed on the following URLs.

A: https://mamot.fr/@danielhz@mastodon.social.
B: https://kbin.social/u/@danielhz@mastodon.social

These URLs are displaying what can be seen on the original URL:

C: https://mastodon.social/@danielhz.

Moreover, I can do the same with a post. The URLs D and E (below) are displaying what can be seen on URL F.

D: https://mamot.fr/@danielhz@mastodon.social/110680082727181778
E: https://kbin.social/m/fediverse/p/748374/I-created-a-profile-on-Kbin-at-danielhz-at-kbin-social-and-a-profile
F: https://mastodon.social/@danielhz/110680082409708996

If I use wget to access URLs A, B, C and D, I got the following results:

For A, I got a redirection to C, and then download C.
For B, I download C.
For D, I got a redirection to F, and then download F.
For E, I download F.

Then Mastodon and Kabin have a different behavior when trying to access “copies” of a post. Is this the difference you mean by compatibility?

the video is so fast that I cannot understand what is happening in it

It’s actually not as fast as I’d like but I optimized it as best I could.

Perhaps the only way for you to understand would be to experience it yourself : userscripts/README.md at master - userscripts - KaKi's git

Then Mastodon and Kabin have a different behavior when trying to access “copies” of a post. Is this the difference you mean by compatibility?

I’m not sure. What are those differences ?

Now it is clear to me what you want. You want to extend the browser, so when you open a URL that corresponds to a Fediverse post or profile (e.g., D), you want to display it on the instance you are using (e.g., C). So, you want that the browser automatically do a redirection.

To achieve this, we need a map D ↦ C where D and C are the URLs:

C: https://mamot.fr/@danielhz@mastodon.social
D: https://mastodon.social/@danielhz

But I don’t think you should use URL patterns because different Fediverse applications may use different patterns for profile URLs. For example, we must also need to discover the map H ↦ G where H and G are the URLs:

G: https://mamot.fr/@danielhz@kbin.social
H: https://kbin.social/u/danielhz

How do you identify that an arbitrary URL is describing an ActivityPub agent or object? For example, if I give you the URL H, how can you determine that H is describing the ActivityPub agent @danielhz@kbin.social?

But I don’t think you should use URL patterns because different Fediverse applications may use different patterns for profile URLs.

Which I already managed to handle :

        apps = [
            {
                id: 'mastodon',
                isDetected: () => !!document.querySelector('.app-holder#mastodon'),
                urlPattern: ':clientHostname/@:profileUsername(@:profileHostname)(/:postId)'
            },
            {
                parentId: 'mastodon',
                id: 'elk',
                isDetected: () => !!document.querySelector('meta[property="og:site_name"][content="Elk"]'),
                urlPattern: '/:clientHostname/@:profileUsername(@:profileHostname)(/:postId)'
            },
            {
                id: 'lemmy',
                isDetected: () => !!unsafeWindow['lemmyConfig'],
                urlPattern: ':clientHostname/(c/:communityName(@:communityHostname))(u/:profileUsername(@:profileHostname))(post/:postId)(comment/:commentId)'
            },
            {
                id: 'pixelfed',
                isDetected: () => !!unsafeWindow['pixelfed'],
                urlPattern: ':clientHostname/(:profileUsername)(i/web/profile/:profileId)(p/:profileUsername/:postId)(i/web/post/:postId)',
                redirectUrlPath: '/i/web'
            }
        ]

But if you have a better idea then feel free to share it.

we must also need to discover the map H ↦ G where H and G are the URLs

Precisely, that’s why I want an exhaustive compatibility list. For example, I didn’t know that Mastodon and Kbin were compatible, now that I know it, I will allow the user to make that redirection.
So I need to know all the possibilities.

How do you identify that an arbitrary URL is describing an ActivityPub agent or object?

Cf. the abovementioned code : I identify Fediverse software by detecting unique aspects (an element, a variable, etc.) of each one and then match the URL with its specific pattern.

That is not the best way to solve the problem because you depend on the particular decisions of the existing popular Fediverse applications, instead of using standards. Doing so, you will not be compatible with new or less popular applications. To be interoperable you need to relay not on URLs but on metadata.

Instead of loading the HTML page representing the URL, you should retrieve the metadata using content negotiation. According to the ActivityPub specification, servers must allow you to request the application/ld+json and application/activity+json representation of objects. You can compare the following two requests:

# Requesting the HTML representation
curl 'https://mastodon.social/@danielhz' \
  -H 'Accept: application/ld+json; profile="text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8'

# Requesting the JSON-LD representation
curl 'https://mastodon.social/@danielhz' \
  -H 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams'

I recommend you to use the JSON-LD representation. If you still prefer using HTML representations, you can still use metadata. For example, in my Mastodon profile, the following metadata in the HTML representation indicates that the URL corresponds to a profile.

<meta content="profile" property="og:type">
<meta content="danielhz@mastodon.social" property="profile:username">

So, you first need to inspect the URL, and then perform the redirection. This requires an additional lookup, but I think is the best way because you do not need to consider the particular decisions of application implementers.

Did you take into consideration that the script must be executed on every single page that the user visits to determine whether it’s a Fediverse app ?

This method sounds ideal as a one-time task, but it’s the worst when it has to be ran on any website that may or may not be Fediverse software.

Meanwhile, checking if an element or a variable exists on a page uses a negligible amount of resources considering how many times each day that task runs.

So yes, I rely on front-end maintainer decisions, but it’s not that bad : FLOSS developers rarely change things compared to companies.

For example, the selector I use for Mastodon exists since 2017.

Maybe, you can cache instance rules for servers you already visited, in addition to the patterns you already defined. Anyway, what did you mean by compatibility? Did you mean if all object types in one system can be displayed in the other?

Maybe, you can cache instance rules for servers you already visited, in addition to the patterns you already defined.

I’ll benchmark this.

Anyway, what did you mean by compatibility? Did you mean if all object types in one system can be displayed in the other?

I guess so, yes.

Do you know all the classes of object that are currently used in Fediverse applications? For example, in Mastodon, objects typically belong to class as:Note, which is a subclass of as:Object. I think that is it worth listing the class hierarchy and the application using each class. Doing so, you will know which objects can be displayed in each application.

I’m not familiar with this. Where can I find that list ? Thanks

I doubt that such a list exists. You can use content negotiation to get the JSON-LD representation of each object published. For example, if you run the code:

curl 'https://mastodon.social/@danielhz/109343217573470742' \
  -H 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams'

you will obtain a JSON-LD document as the following with attributes as

{
  ...,
  "id": "https://mastodon.social/users/danielhz/statuses/109343217573470742",
  "type": "Note",
  ...
}

This means that the object identified by the URL https://mastodon.social/users/danielhz/statuses/109343217573470742 is a Note. The class of the note is indeed identified by another URL, namely https://www.w3.org/ns/activitystreams#Note (which using a namespace is abbreviated as:Note). You can load the aforementioned JSON-LD document in an RDF visualizer, to navigate over the graphical representation of the data.

In Lemmy, I have seen objects of types as:Page, as:Tombstone, and as:Note.

So, I have to get the JSON-LD data of all types of pages from all apps to determine that those who have common types are compatible between them ?