julian

joined 11 years ago
 

tl;dr — you can now send me DMs. I blatently and unforgivingly abused the NodeBB chat system to make this work.


Ever since I started this project at the start of 2024, I knew that posts with limited visibility were going to be a sore spot. ActivityPub has the concept of "addressing", with the following valid entries:

  • An actor (as:Person or similar) uri
  • A followers collection (?!?!?!)
  • The public collection

However, posts and topics in NodeBB have their privileges and access scoped to the category, which meant that while it is able to restrict visibility/posting/etc. to specific users, the system was not flexible enough to handle individual posts with different user visibilities.

Given that limitation, up until this week, if your object did not contain the public collection https://www.w3.org/ns/activitystreams#Public, it was automatically and unceremoniously dropped because there was no way NodeBB could display it to the targeted user without leaking it to other users.

I had gone through a couple iterations to try to figure out a way to make this work, but none stuck (see the follow-up technical post for more details), and I had just about relegated it to the "think on this for awhile" pile until a recent post by @[email protected] got me thinking outside of the box:

and your forums, direct messages, and inbox can have different feature sets.

Emphasis mine.

Unlike topics and posts, NodeBB's chat system is not constrained by the privilege system, and each chat room has its own collection of members, which in many ways made it a better fit!

I put together a proof-of-concept in a couple days, and we're test driving it now. So my apologies if in the past year you tried to DM me, and I didn't respond. I wasn't ignoring you, NodeBB just didn't know how to handle it, promise!

[–] [email protected] 0 points 2 weeks ago* (last edited 2 weeks ago) (4 children)

This also reminds me of a discussion I had way back when I first joined fedi, with @[email protected] . When mocking up a forum-like frontend for ActivityPub data*, he actually rendered the content of the inReplyTo as a blockquote before the reply, which is actually quite an interesting use-case for inReplyTo!

* Also, is there anything more indie hacker than that? lol

0
Quoted posts (community.nodebb.org)
 

Note that I said "quoted posts", not "quote posts", don't @ me!

After the last WG meeting @[email protected] @[email protected] and I chatted a bit about how NodeBB handles quoted posts, but also in relation to quote posts. I thought that it was an interesting chat that merited further discussion; also because some of it was over my head.

When asked how NodeBB handles blockquotes specifically, I replied that blockquotes themselves are rather simple. We set a copy of the text wrapped in <blockquote>.

The rationale is simple: forums typically represent content in a linear fashion, and quoted posts are a handy way to reinforce subcontext within a topic. A typical topic/thread could have many separate discussions all happening together (aka thread drift), so quotes help others know what you're responding to. We don't have special handling or references to our blockquotes because there is a history in forums of edited blockquotes.

Perhaps you want to have a block quote and add some emphasis?

It's also better netiquette (god, that term is old) to trim down the quote to only the relevant parts.

Another upside is that a copy-paste of a post preserves that post to history. That can be useful if the quoted user tries to edit their post later, etc.

vis-a-vis the concept of "quote posts", which I take to mean an embedded post within a post, allowing for replies, likes, etc. How that is represented via ActivityPub is probably detailed in some FEP, but NodeBB doesn't implement that yet. It's a more complicated mechanism that requires a lot more thinking through, and to be honest, we haven't had the need for that in the 10+ years we've been building NodeBB.

[–] [email protected] 3 points 3 weeks ago

@[email protected] Interesting article by @[email protected] about the future of forums and federation.

A little disappointed that only Discourse was mentioned, but I guess I need to make a bigger impact hehe

 

tl;dr — category actors in NodeBB now have better avatars/pictures! They're generated from the icon, color, and bgColor settings for each category.

Did you know that categories in NodeBB can also be followed on the social web/fediverse? Categories, as they are known here, are also actors on the fediverse, so you can find them just like any other account.

e.g. @general-discussion @support @nodebb-development @activitypub

@[email protected] opened an issue back in April (!!) pointing out that the avatar/picture served by NodeBB for category actors was not as good as it could be.

It's definitely possible to do something like this, although it is usually rather resource intensive. For example, when you paste a GitHub URL somewhere (e.g. Slack), it may try to unfurl the URL and display an image. GitHub blogged about how they did this using Puppeteer to generate the images.

I knew right away I didn't want to bundle what was basically an entire browser runtime into NodeBB's dependencies, so I needed a more lightweight solution.

I attempted to build my own SVG string and send that through as a data-uri, but not surprisingly, it was not handled by the implementations I tested.

Some more research this week led me to Vercel's OG Image Generation, which allows you to create images on the fly using Vercel Edge Functions. Since NodeBB is neither a Vercel app, nor do any people running NodeBB use Vercel, that ruled out this product.

However, more research into Vercel's implementation led me to Satori and resvg, a pair of programs that can generate an SVG from HTML, and a PNG from SVG.

From there, it was a fairly standard technical exercise to combine these with our font-awesome libraries in order to output our own implementation of this to generate colourful category avatars for its category actors.

For now, they are only generated on-demand when a category actor is requested, but if there are applications for the icons to be used elsewhere, then we could look into having them generated on direct file request.

Enjoy!

0ff837a6-8f76-4c81-a81f-d4ad6d24660e-image.png

0
Update(Note) quirk (community.nodebb.org)
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/[email protected]
 

Today I tagged the v4.0.0-beta.2 release purely to fix a single issue — Update(Note) federation.

It turns out that just sending the Update(Note) activity was not enough, the underlying object needed to also have the updated field set in order to Mastodon to process the update. My guess is Mastodon checks that field and only processes the note if the value is greater than the last known value.

I'd write it off as a Mastodon-ism, but it's actually better to have that property present, so now it is.

Edit — does anyone know if Mastodon handles Update(Tombstone)? I sent one and Mastodon didn't do anything, which is technically ok. NodeBB handles it like a soft delete and removes it from public view.

0
NodeBB v4.0.0 Beta (community.nodebb.org)
 

Last friday I quietly tagged a commit on the activitypub branch with v4.0.0-beta.1, which signals that the ActivityPub integration is now ready for beta testing.

For the most complete (yet readable) list of new functionality from the alpha, check out the "Road to Beta" project page.

tl;dr — some new features and a lot of fixes

  • Editing a category now issues an Update(Actor)
  • replies is now populated and responds with an OrderedCollection of direct replies (see the post about that)
  • Proper sharedInbox support
  • Better indicators for content that comes from non-local (aka "remote") users
  • Conversational context synchronization mechanic (corresponding post for that)
  • Moving a topic out of the "uncategorized" category will now federate out an Announce

By and large most incompatibilties have been resolved, although if you do find some issues, please do let me know in the corresponding bug report thread.

I'm looking to wrap up the year with some of the more difficult projects I've put off

  • Object Integrity Proofs, which will also enable Inbox Forwarding
  • Better handling of "Open in App" signals from third-party instances
  • Post visibility support (or at least better handling so non-public messages aren'y unceremoniously dropped!)
  • Ongoing integration with FEPs 400e and 7888
 

Now that the alpha version of NodeBB v4 has been released, it means that people are starting to look into using NodeBB for testing (or if they're really looking to have fun, production.)

The first step in enabling those intrepid individuals is providing documentation!

While a little bare-bones at the moment, I've written up a brief summary of what NodeBB brings to the ActivityPub landscape, as well as a run-down of various settings/toggles/switches, and how to switch over to the code branch that enables ActivityPub integration.

What I don't know is what's missing. There's a lot about NodeBB's integration that's very obvious to me, since I built it, but what don't you see that you'd like me to write about? Let me know.

Thanks!

 

Does anyone know what the most broadly implemented standard is for signalling that a web page has an alternative ActivityPub endpoint?

What I found online (and with @[email protected] and @[email protected]'s input) was to deliver a Link header and set a <link> tag, but it doesn't seem to work (at least with Megalodon)...