Enabling the ActivityPub plugin

So, I couldn’t find a discussion about it, but apparently Discourse’s ActivityPub plugin is working?

It looks like it’s a read-only feature of a Topic, but it’s probably better than nothing. Is it enabled here yet? Should it be?

2 Likes

Yes, AP is enabled on this forum, and SocialHub has offered to be early bird tester of new functionality. See the topic by @angus in the Discourse category: Adding federation support to Discourse

3 Likes

@evan, the discussion is here: Welcome Discourse to the Fediverse!, and I must say that since today, new topics in the Fediverse Futures are now public!

The SocialHub follows the discourse-activity-pub plugin development closely and we try to use and test the latest features as soon as they appear.

4 Likes

I gave this entire thing a spin, and I’m not impressed. Here’s what happens:

  1. Discourse uses an unnamed HTTP client! From my HTTP access logs
116.203.222.33 - - [20/Aug/2023:09:17:56 +0000] "GET /endpoints/SYn3cl_N4HAPfPHgo2x37XunLEmhV9LnxCggcYwyec0 HTTP/1.1" 401 0.006 186 "-" "-" "-"
  1. Discourse does not sign their GET requests
Aug 20 09:17:56 [2023-08-20 09:17:56,550] DEBUG  
bovine.crypto.signature_checker Signature not present on
request for /endpoints/SYn3cl_N4HAPfPHgo2x37XunLEmhV9LnxCggcYwyec0
Aug 20 09:17:56 [2023-08-20 09:17:56,551] DEBUG  
bovine.crypto.signature_checker {"Remote-Addr": "<local>", 
"Host": "mymath.rocks", "X-Forwarded-For": "116.203.222.33", 
"X-Forwarded-Proto": "https", "Connection": "close", "Date":
 "Sun, 20 Aug 2023 09:17:56 GMT", "Accept": 
"application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""}
  1. Discourse expects signed GET requests
bovine_store.actor.bovine_store_actor aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://socialhub.activitypub.rocks/ap/actor/bcde488169a4ac803695493219aece2a')

2 & 3 are incompatible.

1 is bad practice, and makes problems such as 2 + 3 harder to debug.

cc @angus

Perhaps if you could explain what you’re trying to test? Is there a use case you’re trying to achieve?

Sorry, I kind of lost sight of this. Fortunately, I can give a better description of the problem now.

Basically, the case for the persona Claire, I describe here and here doesn’t work with Discourse yet. This means if an application requires signed requests for a GET, they fail to federate with Discourse. This corresponds to Mastodon with AUTHORIZED_FETCH = true.

In particular, I think Discourse will fail to federate with itself. :thinking:

Anyway, in my Verifying your Actor tool, the result looks like:

4 Likes

Thanks for explaining. We’re not trying to support that yet. We’ll be looking at Discourse <> Discourse federation in the next phase of work starting this week (and winding up toward the end of the year). I’ll have a look at what you’re referring to as part of that phase.

4 Likes

Thank you @helge for the tool and explanation, this is super useful.

And thank you @angus for keeping up with this. I’m so grateful to you for this effort.

2 Likes

@helge I’m at the point where I’m looking at the issues you’ve raised more closely. Trying out your tool (which looks useful!) it doesn’t seem to be working though. Perhaps it needs an update?

Which python version are you using?

You can see it by running python --version.

Ah, I had assumed you dockerized everything. I’m running 3.11.6. Note that I’m running your docker compose file here

docker compose --file pasture.yml up pasture_verify_actor

Ok. This means we have left the area, where I have simple advice.

docker system prune -af
docker compose --file pasture.yml up pasture_verify_actor

worked for me.

I’ve uploaded the resulting image:

docker run -p 2909:80  helgekr/funfedidev-pasture python -m fediverse_pasture.verify_actor --port 80 --domain pasture_verify_actor

should result in something working.

If this works, you should be able to get the docker file working, by editing it to

  pasture_verify_actor:
    image: helgekr/funfedidev-pasture
      # build: ./dockerfiles/pasture
    volumes: ["./volumes/pasture:/opt"]
    command: python -m fediverse_pasture.verify_actor --port 80 --domain pasture_verify_actor
    ports:
      - 2909:80

Not sure what the underlying docker problems are. So this is just sympton fighting.

1 Like