ActivityPub Plugin

It looks like there will be issues with non-Latin usernames in Article mode. Looks like the username needs to be encoded?

2 Likes

Seems like in a fluctuating network environment, a post may be received multiple times.

3 Likes

@angus @infodesk@oxygen.offdem.net should have posted a few ones since the initial post, but they do not seem to appear at all in my timeline, without any error on the Discourse.

A couple of days ago I used a shared draft before posting, but the message did not appear in Mastodon. So I thought it would be related to a bug with shared drafts, and today I posted directly to a new topic, but although the post was supposed to be sent to the Fediverse at 13:18 CET, nothing appears – so not boostable. :thinking:

Plugin version

eee34494

Error log

Finally appeared: https://oxygen.offdem.net/logs/show/c6449d732e8e9b866bf07935e8132744

(Note that a fix that would resend the latest posts would be awesome)

Latest announcements

Category settings

The ActivityPub plugin has a robust logging system that will pick up most issues. First, make sure you’ve got verbose logging turned on for the plugin.

What’s the publication status of this post? (i.e. share a screenshot of the modal that appears when you click the AP icon on the post)

I assume the publication status is “published” (i.e. the icon is green)? If you had verbose logging on could you share what was logged when this was published? (something would have been logged).

1 Like

Thank you @angus, the error log is in my previous post:

Here is the post’s status:
image

You can see the topic here: O₄FFDEM programme is out! - Announcements - OFFDEM

1 Like

Thanks for the further detail.

Only admins can view logs on an instance :slight_smile:

Could you copy the relevant logs in a PM to me? Thanks.

3 Likes

Hi folks, thanks so much for the excellent work you’ve done to get this concept to this point!! I began following the discussions to implement federation in Discourse many years ago now, and I’m happy to see this moving so far along.

I’ve successfully managed to federate my Discourse category by following it with my account on Mastodon. New topics in my category are available to view from my Mastodon account.

I don’t seem to be receiving Mastodon replies to my federated Discourse topics in Discourse, but top-level Toots from my followed Mastodon account seem to appear as new topics just fine. Is this presently the expected behavior?

I read through this thread and I don’t think that I explicitly saw anything about federating replies to topics.

Here is a screenshot of my category ActivityPub settings.

Is this at all related to the security settings for the category? Right now I have it that everyone can see topics, but only admins can create and reply to them.

Thank you!

2 Likes

Hey @rsmithlal, thanks for trying out the plugin, and for your detailed feedback!

Yes, this is the reason why replies to the toots are not being imported. Just so I understand, you’re expecting that:

  1. Users cannot reply to a Discourse topic in Discourse.
  2. Users can reply to a Discourse topic in Mastodon.

Is that right? If so, that’s not currently supported. But I take the point that it’s not yet entirely clear how the category security settings are meant to interact with ActivityPub. We hope to address that more explicitly in the next phase of work.

2 Likes

Hi @angus, does that mean that toot replies to Discourse topics that have been federated should show up in the federated topic as Discourse replies under the correct configuration?

For example:

  1. Let’s say that I create a new topic “My First Federated Topic” on my Discourse instance Discourse1.server in a federated category “My Federated Category”.
  2. This new topic gets federated and appears as a toot from fed-cat@discourse1.server in the feed of my Mastodon account rob@mastodon1.server which follows “My Federated Category, fed-cat@discourse1.server”.
  3. I create a reply toot on Mastodon1.server to the federated note containing the contents of “My First Federated Topic” originally federated by Discourse1.server.

In this case, I would expect that my Mastodon toot reply to this federated Discourse topic should appear as a reply on the original “My First Federated Topic” topic at Discourse1.server.

This would be the ideal case for me, but I haven’t been able to achieve it yet. Is it presently possible?

If this is possible, what are the configuration settings that would permit it to function as expected?

Thank you kindly. I hope my explanation was clear!

1 Like

Main category has ActivePub enabled and I created sub-category with ActivePub too. But when I try to follow someone thru sub-category clicking button follows I get boring not found/nor allowed error page. Main categories work just fine, though.

There is no fancy or strange things done on settings.

Expecting behaviour or bug’ish?

@rsmithlal Yes, what you’ve described is how the “Full Topic” publication type is intended to work. The only change you need to make is to allow normal users to reply in the category (in the category access settings). The reason it’s not working for you is because you’ve restricted replies to admins. Replies imported by ActivityPub cannot override that restriction.

Generally speaking sub-categories do not inherit the configuration of parent categories, and ActivityPub is no different in this respect. ActivityPub settings are category-specific and there is no inheritance (yet). That said, what you’ve described is a UX issue which I’ll address soon, i.e. the ActivityPub controls should not appear when you’re looking specifically at a sub-category.

3 Likes

Thank you, @angus, I will give that a try. Very exciting!!

I had mostly restricted replies because it was just a test category and topic. I initially had it private to admins, but I couldn’t get ActivityPub to activate at all until I opened it up to being visible to everyone. This has been a very insightful exchange.

2 Likes

@Jagster The issue you’ve described will be fixed once this is merged. Thanks for reporting it.

5 Likes

Problem

Hello, we are testing this plugin at agora.eXO.cat and we can’t get it to work (status on discourse’s web says “Note was not published via ActivityPub”, other fediverse apps do not find the actor)

Is there anything particular we should be aware of? Checking the documentation didn’t point to anything particular troubleshooting we can follow and the logs (see below) do not help us further :-(.

Setup

Plugin version: 79da1c2

We are using a public subcategory, which we want to publish to the fediverse.

The settings are straightforward, nothing changed except for:

  • schedule time down to 1 minute for testing
  • picking actor name and display name for the category

Some things we have tried:

  • Enable “activity pub object logging” and check logs
  • Patching out the line that produced the error, since it gave us “chicken and egg” vives (“maybe can’t schedule post because no recipients, will not create actor until post is created”)
tested patch
> ./launcher enter app
> sed -i.orig -E 's!^(.*no recip.*)$!#\1!' /var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/delivery_handler.rb
> ./launcher restart app
  • When that patch didn’t work, we got rid of it
  • Deleting and re-creating the category so there are no “special” characters anywhere (the word is actually exofĂ sia, which we want to spell: eXOfĂ sia)
  • When recreating the category, use Note (default) instead of Article (what we want)

logs

Here is what we see on the logs
Message

[Discourse Activity Pub] https://agora.exo.cat/ap/actor/31cb67a1093eca932caaf1e764814bde failed to schedule https://agora.exo.cat/ap/activity/803be329c95f67b5ab62d43c7c61f6f3 for delivery: no recipients

Backtrace

/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/delivery_handler.rb:93:in `log_failure'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/delivery_handler.rb:35:in `can_deliver?'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/delivery_handler.rb:13:in `perform'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/delivery_handler.rb:27:in `perform'
/var/www/discourse/plugins/discourse-activity-pub/app/models/concerns/discourse_activity_pub/ap/model_callbacks.rb:140:in `activity_pub_deliver_activity'
/var/www/discourse/plugins/discourse-activity-pub/app/models/concerns/discourse_activity_pub/ap/model_callbacks.rb:38:in `perform_activity_pub_activity'
/var/www/discourse/plugins/discourse-activity-pub/plugin.rb:473:in `block (2 levels) in activate!'
/var/www/discourse/lib/plugin/instance.rb:341:in `public_send'
/var/www/discourse/lib/plugin/instance.rb:341:in `block (2 levels) in add_to_class'
/var/www/discourse/plugins/discourse-activity-pub/plugin.rb:654:in `block (2 levels) in activate!'

Env

HTTP HOSTS: agora.exo.cat
The error is consistent when republishing from the interface
Message

[Discourse Activity Pub] https://agora.exo.cat/ap/actor/31cb67a1093eca932caaf1e764814bde failed to schedule https://agora.exo.cat/ap/activity/30d34f8b38be0d2d5bc997fd4147c5b2 for delivery: no recipients

Backtrace

/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/delivery_handler.rb:93:in `log_failure'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/delivery_handler.rb:35:in `can_deliver?'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/delivery_handler.rb:13:in `perform'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/delivery_handler.rb:27:in `perform'
/var/www/discourse/plugins/discourse-activity-pub/app/models/concerns/discourse_activity_pub/ap/model_callbacks.rb:140:in `activity_pub_deliver_activity'
/var/www/discourse/plugins/discourse-activity-pub/app/models/concerns/discourse_activity_pub/ap/model_callbacks.rb:38:in `perform_activity_pub_activity'
/var/www/discourse/plugins/discourse-activity-pub/plugin.rb:473:in `block (2 levels) in activate!'
/var/www/discourse/lib/plugin/instance.rb:341:in `public_send'
/var/www/discourse/lib/plugin/instance.rb:341:in `block (2 levels) in add_to_class'
/var/www/discourse/plugins/discourse-activity-pub/plugin.rb:481:in `block (2 levels) in activate!'

Env

HTTP HOSTS: agora.exo.cat

Webfinger

And what a webfinger returns:

> curl -L 'https://agora.eXO.cat/.well-known/webfinger?resource=acct:exofasia@agora.exo.cat'
{"subject":"acct:exofasia@agora.exo.cat","aliases":["https://agora.exo.cat/c/exo/exofasia/33"],"links":[{"rel":"self","type":"application/activity+json","href":"https://agora.exo.cat/ap/actor/31cb67a1093eca932caaf1e764814bde"}]}
2 Likes

Hey there @evilham, the message you’re seeing is logged when the Actor has no followers (no activities will be published). Is anyone following the actor?

Note that the only actor that can be followed currently is the Category actor (i.e. the Group actor). That Actor is created as soon as you enable ActivityPub in a category (and hence does not cause a chicken and egg issue). You can’t follow user actors (i.e. Persons) at the moment.

1 Like

Hey, the issue is precisely that the actor can’t be found (try yourself: exofasia@agora.exo.cat):

By checking last night here in more detail, I saw that we are not the first instance to bump against this:

So, maybe the log entry is entirely unrelated, but it is the only one we have >,<, so the only clue we had to follow.

The post itself stays with a disconnected from fediverse icon and this text:
image

Any attempts to schedule publishing the post result in the log we mentioned, and nothing else.

The category claims to be properly configured (as mentioned, nothing was changed):

And the category is fully public.

I just successfully followed that actor from my local instance.

I found it successfully.

Then successfully sent a Follow and received an Accept.

If you refresh the “Followers” list on your instance you’ll now see a follow from general@angus.ngrok.io.

I suspect the issue you’re having is that you have HTTP signatures set as required

and the client you’re using to follow doesn’t support and / or send an appropriate HTTP signature. That is perhaps the issue @Lhc_fl was having as well.

2 Likes

Oh, that’s quite interesting, can confirm that the follow appears!

Indeed, as this was the default and we changed as little as needed.

We tried several clients, chiefly Mastodon and Pleroma.

Following the HTTP signatures required hint, we disabled that (aka: changed the default), then tried re-scheduling the post, this time with a positive result (possibly the difference is because there is 1 follower?):

image

OTOH, at least Mastodon keeps showing a 404 when searching for the profile, so the main goal (following the category from other fediverse apps) is still not being fulfilled.

Is there anything else we can look into? to facilitate that?

I just also successfully followed that category from mastodon.

Oh wow, I don’t get it, before last post I tried from two different Mastodon servers, one of which I had never used before, and the result was a 404 on the profile on both of them.

Will check again in the afternoon, but any pointers as to why the view could be inconsistent or what we can try would be great.