News:

Wondering if this will always be free?  See why free is better.

Main Menu

ActivityPub / Fediverse bridge

Started by shawnb61, August 07, 2024, 09:24:38 AM

Previous topic - Next topic

shawnb61

Sure seems feasible.  Maybe as a mod.

Any Mastodon users out there?

Some background:
https://en.m.wikipedia.org/wiki/ActivityPub
https://www.w3.org/TR/activitypub/

A first pass poc needn't be too complicated.  As a simple example, I believe you can share your music with the fediverse via a channel on Funkwhale.  Folks can subscribe to that channel, e.g., on Mastodon.  And my understanding is that Funkwhale just publishes that via a simple RSS feed.
https://www.funkwhale.audio/

Just some food for thought...
A question worth asking is born in experience & driven by necessity. - Fripp

Sesquipedalian

More information is needed about the scope and goals of this feature request. What would it be intended to do? How should it work?
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Arantor

There are definite holes in the ActivityPub spec that would need to be solved; there's no super solid way of migrating accounts between services in the purest sense, meaning that migration is a build-in that has to happen per instance, which is annoying.

Representing a post as an article with its replies being comments is otherwise not particularly tragic to do, and even pushing notifications out and back isn't the worst.

Treating topics in a board as if it's a federated instance that can be viewed from Mastodon as a 'server' to push/pull from is probably the least massive change you'd need to do to keep it cohesive.

The real question is whether you truly gain anything from it; Mastodon in particular operates off a Twitter like model (user posts + comments, rather than topics in the traditional sense) and, really, you lose the categorisation angle. And one of the big downsides to it is the even-more-inconsistent moderation of peer servers, it's even more scattershot than forum to forum.
Holder of controversial views, all of which my own.


shawnb61

At the moment, I think this is directional &  aspirational - planting a seed of thought.  Further brainstorming is needed.  In the long run, I think SMF would benefit from joining in the fediverse.  So SMF forums aren't isolated little islands - they can opt to be federated & with whom they wish to be federated. 

The good news is that ActivityPub has a finite, clearly defined approach, scope & spec.  (https://www.w3.org/TR/activitypub/)

In the short term, a baby step may be as simple as one-way subscriptions (e.g., to be able to display recent music releases from FunkWhale).  I would suggest a new class of topics/boards that participate. 

In the long term topics should be published via ActivityPub.  Comments from non-local members, if allowed, can be represented as guest posts.  Would need to be able to whitelist/blacklist servers &/or individuals.

ActivityPub looks like it has a hard OAuth requirement.  Maybe step 1 towards federation is to implement OAuth. 

Mastodon looks tempting because it is so widely adopted, and a full implementation already exists.  It looks easy to setup a Mastodon server, but it has IMO odd server requirements, e.g., postgresql, ruby.  Maybe some potential Frankenstein action there...

Ownership of sites like reddit/fb/bandcamp/etc is a problem, it's like they all grow & turn evil or something...  I think SMF sites are pretty much immune from that rot.  I think federation would bring almost immediate relevance & interest, and lure folks back from those massive, manipulative platforms.
A question worth asking is born in experience & driven by necessity. - Fripp

Sesquipedalian

#4
Okay, so what I understand is that this is a request:

  • To implement the ability to import posts and comments via the ActivityPub API as new forum topics in a specified board. This in turn would require, for SMF's needs:
    • The ability to associate imported ActivityPub posts created by the forum's members with the their forum accounts.
    • The ability to create guest posts for imported ActivityPub posts created by people who are not members of the forum.
    • The ability to automatically moderate imported content based on ActivityPub user.
    • The ability to automatically moderate imported content based on source ActivityPub server.
  • To implement the ability to publish topics via the ActivityPub API, with the topic's original post as a new ActivityPub post and the reply posts as ActivityPub comments.
  • To implement OAuth.

Arantor makes a very good point about categorization of incoming content—namely, that dumping everything imported from ActivityPub into a board will create an undifferentiated mess of content. That is fundamentally a content management issue rather than a show-stopping technical issue, but it would nevertheless require careful consideration in order to avoid producing a bad user experience in the end.

A more pressing technical issue is the fact that SMF uses a flat topic structure rather than a branching one. Microblogging-style social media uses branched structures. Squashing a branched structure down into a flat structure is difficult to do, and nearly impossible to do well.

If I have misunderstood something, please explain further. :)
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Arantor

IF the goal is about de-islanding, I think you'd immediately benefit from adding in OAuth2 support both for account creation and account authentication (i.e. to be both an service provider and an identity provider), ahead of implementing APub.

The thing about federated moderation is that, honestly, as someone who does spend time in Mastodon... it's actually a different kind of disaster where you don't just have individuals having trouble with other individuals but server to server beef too, to the point that servers can cut off their inhabitants from other servers. That and the fact that identity is tied to home instance which means if the home instance collapses, goodbye your entire existence, not just an account on an island.


The structure needn't be a problem outbound; you treat it as you treat any other single strand: it's a post with a single linear thread of replies to each other because you don't have any metadata to infer otherwise. And realistically even if you did try to capture it, that's still all you're going to end up with because users don't tend to actually use that style of branching conversation unless it's made absolutely front and centre a la Reddit, or it's made the *only* style of conversation a la Twitter/Mastodon.

Inbound is a different proposition. Realistically what you could try to do is ingest all of them (on first import) and internally store the relationships from post to post as a directed acyclic graph. At that point you can walk the tree until you read the tip of the tree, and there's your opening topic, with all replies to it implicitly in chronological order. For bonus points you must know the reply context from that, and you could display that above the post with a link back to it if you have it. (Structurally this is no more than adding a parent ID to each message).

Though this raises the bigger question: do you want to consider properly supporting the threaded conversation model? It's certainly been done historically to support it as a true hybrid, where each existing thread is really one long linear chain of replies back to the top but future topics didn't have to be.

https://xenforo.com/community/threads/will-xenforo-ever-adopt-threaded-comment-structures-like-reddit.205394/ is an interesting time capsule of thoughts on the subject. Disclaimer: I am a participant in this conversation and I am not a clear proponent of it, however there is merit to having the same discussion with different points of view joining it.
Holder of controversial views, all of which my own.


shawnb61

Yep.  Perfect for starters!

I'm sure we'll learn quite a bit as we go...

SMF might even adopt a bit of a role as a fediverse aggregator.  I could easily see setting up a board that shows activity from 3 other actors on 3 completely different servers.  The board follows 3 remote users.

The part that will be fun to learn is how deep & wide the "following" goes, user/board/topic, in the long term...  As an example, User A follows remote users b, c, d; user E follows remote f, g, h.  What should be visible to user A is local smf content as appropriate, plus remote b, c, d.  User E should see local smf content, plus f, g, h.  E doesn't see b, c, d, as it's not followed.  Like a subscription model almost.  Topics may need a finer permission set than "in board x".

But...  One step at a time.  Baby steps.
A question worth asking is born in experience & driven by necessity. - Fripp

Sesquipedalian

Quote from: Arantor on August 08, 2024, 05:31:52 PMThough this raises the bigger question: do you want to consider properly supporting the threaded conversation model?

I have no such plans, no.

I do like the suggestion you gave in another discussion a while ago to allow a post to be marked as a reply to another post, i.e. with a small "Replying to #17" metadata line in the header or something along those lines. But that would be a tweak to the existing flat structure, not a change from flat to threaded.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sesquipedalian

Quote from: shawnb61 on August 08, 2024, 05:37:15 PMSMF might even adopt a bit of a role as a fediverse aggregator.

Probably not.

Quote from: shawnb61 on August 08, 2024, 05:37:15 PMI could easily see setting up a board that shows activity from 3 other actors on 3 completely different servers.  The board follows 3 remote users.

But what happens when those actors post content that doesn't belong with the expected content for the board?

But questions about content curation aside, I think you could accomplish this easily already using an RSS import mod, since Every Mastodon User Has an RSS Feed.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

shawnb61

The aim here was to have SMF join the fediverse.  Just viewing simple feeds was a suggestion as a baby step down that path.  (Using RSS was even suggested as a temp hack in the first post.)

I am seeing more fediverse usage over time, as folks finally get sick of reddit, fb, etc.  Slow, but steady.  SMF was here before them, & I have a fairly strong suspicion a move in that direction will help us outlast 'em. 

As I said, food for thought.
A question worth asking is born in experience & driven by necessity. - Fripp

Sesquipedalian

I see the attraction, sure. But before it could be done, a lot more thought would need to go into figuring out how to map concepts and structures from one to the other. 

From what I can tell, there are several vital concepts in a forum that have no obvious equivalent in ActivityPub, and vice versa. Figuring out how to translate from one to the other would therefore be challenging.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

shawnb61

Yep. Understood. 

Just planting that seed of thought.
A question worth asking is born in experience & driven by necessity. - Fripp

Sesquipedalian

Fair enough. But if you want that seed to grow, you can water it by providing a detailed explanation of how to map the concepts and structures from one to the other and back.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

shawnb61

The requirements, I think, are pretty well spelled out above.  Thankfully the ActivityPub spec is mercifully short & clear.

I think there are only two gotchas on the design, which definitely need more work.  The main one being introduction of an access model that isn't 100% board based like it is today.  Not impossible at all, though almost certainly will require db changes to existing structures.  The flat vs threaded question, I think, has a proposal above that could work w/o db changes.  Threaded has always bugged me anyway.

I'll put some thought into a proposed ERD over the next few weeks.  (Or more...)  Maybe dummy up some test data for performance testing.
A question worth asking is born in experience & driven by necessity. - Fripp

shawnb61

...and it's the kinda thing that needs to steep in everyone's brain for a while...

If you haven't already, just setup a Mastodon acct & use it instead of twitter or fb for a week or two.

It's got some pretty steep & interesting limitations, and those are baked into the spec...  At first glance, they are odd.  But the reality is the spec sets realistic expectations on communications across servers. 

An example: I created a list of folks to follow, who happened to be on other servers.  I pulled up the list, expecting to see a bunch of their recent posts...  But...  It was empty...  Until someone posted.  Slowly, over time, it filled up.  It's all a kinda "going forward" model.  There's no backfilling, as that is really expensive.  (If you really want to see history on another server, then go to that other server...)  It doesn't expect everything to be cloned everywhere; it's very targeted in its publish/subscribe model.
A question worth asking is born in experience & driven by necessity. - Fripp

NFG

I came here to see if ActivityPub had been mentioned yet, as well as federation in general.  I think, as has been mentioned, this is going to be critical to the future success of all the forums and many websites all over the world, 'cause big social media is intent on tearing itself apart, and we don't all want to join tiny isolated communities all around the world anymore.

That said, my thinking for SMF's position in the federated future, is that it should at the very least make it easy to follow from other places.  Users, threads, categories, for sure, the whole forum as well, if someone wants that.  Basically, it's RSS for the new era.

Also, Bsky is huge, and growing very quickly, with a very different audience than you'll typically find on Mastodon.  So, IMO ATproto should be considered as well. 

A Wordpress plugin made it very easy for me to create a followable actor on the AP fediverse, so for sure there's going to be code there that can be used as a springboard.  ATproto, still a lot newer, has a wild ecosystem coming up around it.  So there's going to be plenty of code there too.

Making a follow-only system, at least with AP, shouldn't require too much work, but I confess I'm a PHP hack without the strongest awareness of how much I don't know (a lot).  I don't know if I have anything to offer WRT to these integrations but I'd love to help. 

If nothing else, consider this a vote for 'yes plz'.

Sesquipedalian

Quote from: NFG on January 09, 2025, 11:01:58 PMMaking a follow-only system, at least with AP, shouldn't require too much work, but I confess I'm a PHP hack without the strongest awareness of how much I don't know (a lot).  I don't know if I have anything to offer WRT to these integrations but I'd love to help. 

Writing code isn't the issue. As you have rightly noted, there are APIs available and we have people who know how to use such things.

Rather, the hard part is this:

Quote from: Sesquipedalian on August 08, 2024, 11:34:49 PMFrom what I can tell, there are several vital concepts in a forum that have no obvious equivalent in ActivityPub, and vice versa. Figuring out how to translate from one to the other would therefore be challenging.

That would be just as true for BlueSky's API as for ActivityPub.

Since you said you'd like to help, @NFG, the best thing you could do would be to work on this:

Quote from: Sesquipedalian on August 09, 2024, 12:21:56 AMproviding a detailed explanation of how to map the concepts and structures from one to the other and back.

That's a matter of abstract conceptualization, with no knowledge of PHP code required. Perhaps if you and @shawnb61 were to work together on thinking through that, you might be able come up with a solid proposal for this.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Advertisement: