Discourse <> WordPress Integration

@angus @how Can you maybe also activate it for @wordpress and maybe add me as admin? So that I can run some tests?

Done! If you head over to WordPress you’ll now see this

Hey @angus,

thanks for your support, but for now I only see “Followers” there.

Matthias

1 Like

Hey @angus @how

thanks to work by @pfefferle Wordpress should now federate properly with Discourse

@how would you be willing to try and follow my WordPress account (@laurenshof@fediversereport.com) from the Fediverse Report Category on the Social Hub? This way only my weekly article should pop up in the category, which I think fits well, and would be a nice benefit!

Thanks all!

3 Likes

Just a note that I’ve been testing wordpress-activitypub 2.3.1 with discourse-activity-pub locally and it works!

The Wordpress plugin is not yet ingesting Notes/Articles inReplyTo as comments yet though. @pfefferle This is what an object inReplyTo might look like

Object inReplyTo
id: https://angus.ngrok.io/ap/activity/4fdb8bd5714f54c9dd48ca03f6e71dd6
type: Announce
audience: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80
to: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80
cc:
- https://www.w3.org/ns/activitystreams#Public
updated: '2024-04-30T12:59:52Z'
actor:
  id: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80
  type: Group
  updated: '2024-04-22T06:44:09Z'
  url: https://angus.ngrok.io/c/general/4
  name: General test
  inbox: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80/inbox
  outbox: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80/outbox
  followers: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80/followers
  preferredUsername: general
  publicKey:
    id: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80#main-key
    owner: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80
    publicKeyPem: |
      -----BEGIN PUBLIC KEY-----
      MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmfJyF4Cj4XgAR7UP+Ip2
      aeAj0qa2CNU+orya1fHBCan3dgyY9zv+PzBu4JQZf0xN0z6OHgcsD3Fj6mMnk0uc
      2wdXMPJB8xo0+PlulMmoZQJm2HaI6/gdKBfFdgzTAnbKPbzuXim7wme+Esnikrlt
      uk/UH3Tz0VRYDxpgsqFDhIPJZbFWgVi0UrvoazwaXhVaoBrnBurtRA1EzLhWJVSn
      F+FdFvATe/YUcW1JaqFn4e3a5oaO2/7zUk5wGqXK4QRacF9qEoikKIQHdi+YQp7T
      /aTGvFhGyKToNtVQcnpKiLs567qInUeRQvlNJcc5LgEZ6oe8nJiRkiPEiz9n2rCm
      1QIDAQAB
      -----END PUBLIC KEY-----
  icon: !ruby/hash:ActiveSupport::HashWithIndifferentAccess
    type: Image
    mediaType: image/png
    url: http://localhost:3000/images/discourse-logo-sketch-small.png
  "@context": https://www.w3.org/ns/activitystreams
"@context": https://www.w3.org/ns/activitystreams
object:
  id: https://angus.ngrok.io/ap/activity/3733861745fa89dd7f7039b99d6895c5
  type: Create
  audience: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80
  to: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80
  cc:
  - https://www.w3.org/ns/activitystreams#Public
  published: '2024-04-30T12:59:52Z'
  updated: '2024-04-30T12:59:52Z'
  actor: !ruby/hash:ActiveSupport::HashWithIndifferentAccess
    id: https://angus.ngrok.io/ap/actor/d36c5f94845b2d9c8d99fcaeaf0a9e08
    type: Person
    updated: '2024-04-17T15:25:43Z'
    url: http://localhost:3000/u/angus
    inbox: https://angus.ngrok.io/ap/actor/d36c5f94845b2d9c8d99fcaeaf0a9e08/inbox
    outbox: https://angus.ngrok.io/ap/actor/d36c5f94845b2d9c8d99fcaeaf0a9e08/outbox
    sharedInbox: https://angus.ngrok.io/ap/users/inbox
    followers: https://angus.ngrok.io/ap/actor/d36c5f94845b2d9c8d99fcaeaf0a9e08/followers
    preferredUsername: angus
    publicKey:
      id: https://angus.ngrok.io/ap/actor/d36c5f94845b2d9c8d99fcaeaf0a9e08#main-key
      owner: https://angus.ngrok.io/ap/actor/d36c5f94845b2d9c8d99fcaeaf0a9e08
      publicKeyPem: |
        -----BEGIN PUBLIC KEY-----
        MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs4gIikB9kVAEnKsdyLi6
        jPloo8cPyYxHWAYvWgAxEPDeMt0NGPmFmJe3OpAR1fgp+1kRZ16yDYC8JbZ/YEhp
        Zk6d7Y8u8geQIyf7FER6XfqXp+yC2tgttOmabETRJMH9tofMPZjNTzmYq8bdKkL7
        Wc/WfPYvqSqzgXW6mr/2I8/m2YpXcfihRcAE8p9ZzM5qYBFFYUxYrv0ItyM11nDq
        BGVYfhxjey9flTmXayHd7C0B1d1ezP81GVNJ2Xp4SvWl+cfIM6WnMY7p84dxXInn
        bUeykNXdNUz5OMWe/zpC8Xt1+ztftC7JWBOJUktVA4n6FDmOS9nE2plcDje7lmuV
        SQIDAQAB
        -----END PUBLIC KEY-----
    icon:
      type: Image
      mediaType: image/png
      url: "//localhost:3000/letter_avatar_proxy/v4/letter/a/b3f665/96.png"
    "@context": https://www.w3.org/ns/activitystreams
  "@context": https://www.w3.org/ns/activitystreams
  object:
    id: https://angus.ngrok.io/ap/object/d706092348d2945c548e66fec0e68f4d
    type: Note
    audience: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80
    to: https://angus.ngrok.io/ap/actor/edf3ef1e40c7899e215d5cf2e0166e80
    cc:
    - https://www.w3.org/ns/activitystreams#Public
    published: '2024-04-30T12:59:52Z'
    updated: '2024-04-30T12:59:52Z'
    url: https://angus.ngrok.io/t/this-is-a-title/34/2
    attributedTo: https://angus.ngrok.io/ap/actor/d36c5f94845b2d9c8d99fcaeaf0a9e08
    context: https://angus.ngrok.io/ap/collection/8634b4532902c50b15f318899cd31bf0
    content: This is a reply to the content from Discourse
    inReplyTo: https://wordpress.pavilion.tech/this-is-a-title/
    "@context": https://www.w3.org/ns/activitystreams

Perhaps the issue is that you don’t support the ingestion of Announcements of an Actor (e.g. a Category Group actor) of an Activity (e.g. a Create Note of a Person inReplyTo the Wordpress Note)?

2 Likes

Thanks for debugging! This is a wild implementation! They do not send the reply directly, but instead an Announce of it!

Have to see how I can implement that properly!

Thanks! Lmk if I can help in any way.

Yeah, it’s an implementation of FEP-1b12

In short this lets people follow a taxonomy (e.g. a category or tag). The announcements come from the category (or tag) actor which is a Group.

We may add Person (user) following down the track in the Discourse plugin, however in a forum environment, following a taxonomy tends to make more sense than following a user. e.g. you probably want to know what’s happening in Threadiverse Working Group as a category rather than just which topics I post there :slight_smile:

1 Like

Thanks @angus !

You are directly working on that plugin?

I understand the point and advantage of Announcing Activities (we do that also for WordPress. The blog-user Announces the posts of every blog user, and we also want to add support for Tags/Categories), but I haven’t seen it for replies until now.

1 Like

Yes, I built (am still building) the Discourse ActivityPub Plugin on contract for CDCK, the company that makes Discourse. I also maintain the WP Discourse plugin for CDCK, so I have some experience with Wordpress if that becomes relevant at any point.

Actually, testing your plugin this morning I was trying to remember why we Announce replies as well as the OP. I think it might have been a “strict” implementation of FEP-1b12, however I’m wondering whether it’s necessary.

1 Like

@angus see

and

:slight_smile:

1 Like

I will run some more tests and release a new version with comment support then!

1 Like

Very exciting! Thanks for adding announce support.

1 Like

@pfefferle I also had a look at federation between Lemmy and Wordpress. There is a minor fix I have to get in to make comparison of response content-type headers case insensitive (because you send charset=UTF-8 while eg Mastodon has charset=utf-8.

With that change I can already fetch Wordpress groups and users. But there is one more problem, Lemmy expects to find the Group that a post belongs to in cc or audience field. Is there any chance you could add that?

3 Likes

@nutomic I am more than happy to add anything that helps with interoperability!

The main issue with that is time! It’s hard to have a local version of every platform, to be able to debug things.

So long story short: If you tell me what to do, I will do :slight_smile:

Is there a preferred way to add the group? cc or audience?

1 Like

Thanks for your help btw!!!

1 Like

audience is preferable as its also where nodebb and discourse send it. Plus its easier to parse a single value than extracting from an array.

4 Likes

Does discourse support Announces with an URI as object? Improve lemmy compatibility by pfefferle · Pull Request #752 · Automattic/wordpress-activitypub · GitHub

1 Like

Yes, the Discourse plugin will resolve object URIs :+1:

3 Likes

Interesting look at how #activertypub uses social means to build interop rather than ridged specifications, kinda inspiring. Be human on the openweb :slight_smile:

2 Likes