Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this plugin support the "replies" collection? #138

Open
johnspurlock opened this issue Feb 23, 2022 · 25 comments
Open

Does this plugin support the "replies" collection? #138

johnspurlock opened this issue Feb 23, 2022 · 25 comments

Comments

@johnspurlock
Copy link

Sending an ActivityPub request to
https://www.draky.net/wordpress/2019/11/15/bonjour-tout-le-monde/

which has this plugin installed, returns good looking AP, but without the "replies" collection
https://www.w3.org/TR/activitystreams-vocabulary/#dfn-replies

This makes it impossible to enumerate the comment thread.

I'm wondering if it's implemented?

Thanks
- John

@pfefferle
Copy link
Member

It is not yet implemented.

Do you know a platform that is already consuming the replies-collection?

@johnspurlock
Copy link
Author

Ah, ok - thanks for getting back.

There is a new open standard for podcast episode comments that relies on the existing basic Fediverse protocol (ActivityPub, Webfinger, http signatures for auth) for sending and displaying replies to a root comment post associated with that episode.

Info site here: https://podcastsocial.org/
Underlying rss feed tag spec, and open source components to make it easier for existing podcast apps to send and display them.

For displaying comments, it relies on being able to enumerate comments by parsing the standard replies collections
recursively. Mastodon supports paged collections in its replies implementation, but replies can also be modeled inline if that's easier.

For sending comments, it relies on standard s2s federation inReplyTo the target object. Is this supported? I'm getting a 406 error (see below for the gory details) when POSTing to the inbox url using my custom software. Replying from a Mastodon instance does not seem to work either.

I was really excited when I saw your plugin, the idea of a podcaster being able to use a WordPress site as the venue for their comments instead of, say, Mastodon, is that WP is already very popular in the podcasting community, and it would presumably provide additional moderation options for these incoming comments.

POST https://example.com/wp-json/activitypub/1.0/users/1/inbox
date: Thu, 24 Feb 2022 14:36:26 GMT
signature: keyId="https://sender.com/path/to#main-key",algorithm="rsa-sha256",headers="(request-target) host date digest",signature="<base64>"
digest: SHA-256=<base64>
content-type: application/activity+json

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "https://sender.com/path/to/activity",
  "type": "Create",
  "actor": "https://sender.com/path/to/actor",
  "object": {
    "id": "https://sender.com/path/to/object",
    "type": "Note",
    "published": "2022-02-24T14:35:34.151Z",
    "attributedTo": "https://sender.com/path/to/actor",
    "inReplyTo": "https://example.com/myfirstarticle/",
    "contentMap": {
      "und": "Hello!"
    },
    "to": [
      "https://www.w3.org/ns/activitystreams#Public"
    ],
    "cc": [
      "https://example.com/author/admin/"
    ]
  },
  "published": "2022-02-24T14:35:34.151Z"
}

results in

406
content-type: text/html; charset=iso-8859-1

<head><title>Not Acceptable!</title></head><body><h1>Not Acceptable!</h1><p>An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.</p></body></html>

@pfefferle
Copy link
Member

The plugin should accept replies from all big plattforms. The inReplyTo has to be the permalink of the blogpost.

See: https://github.com/pfefferle/wordpress-activitypub/blob/44c652eba8174368c9fdc2ca33e02fd2afbe436d/includes/rest/class-inbox.php#L410

@pfefferle
Copy link
Member

Is your endpoint accessible? The error is coming from Mod_Security, not from the plugin, so it might be a server configuration issue?!?

@johnspurlock
Copy link
Author

Yep, we're using the article permalink for inReplyTo.
Test article: https://lehman-family.com/jstest/
(also is the AP "id" returned when requesting with accept: application/json)

But replying doesn't seem to work, even from Mastodon, paging @Lehmancreations for question about security setup on that site

@Lehmancreations
Copy link

@johnspurlock There are a few plugins that could maybe be the issue. One being Akismet Anti-Spam and the other is Limit Login Attempts. Let me know when you want to test again and I will disable them

@mediaformat
Copy link
Collaborator

This is not yet implemented, but it is planned!

@johnspurlock
Copy link
Author

Alright, verified that the 406 response received was due to the shared WP host's custom security filter. They tweaked their secret algorithm and the AP payloads are now allowed through. Phew!

One small nitpick remains on incoming comments: your implementation should use the appropriate contentMap lang string (usually only one) as the content text. It currently appears to only recognize the content string property. They are actually the same conceptual field in the AP model.

My implementation can include a redundant string property on outgoing requests (Mastodon does this too as a workaround for outgoing), but it's not required, Mastodon/Pleroma use contentMap just fine if no content is provided for incoming.

Anyway this is exciting! A fediverse option with fine-grained, pre-emptive moderation is a big deal.

While sending works, we won't be able to promote this plugin as a solution, though, until the replies collection is implemented, in order to support the read scenario.

I understand this might not be a trivial thing to implement, especially if you do it with paged collections for scalability (to support a post with thousands of comments), but this would be much appreciated by several folks interested in pointing people to existing fediverse endpoints on platforms that people are already using.

Let me know if I can help in any way, I haven't done PHP in 20 years, but happy to help test on the AP client side.

@Lehmancreations
Copy link

I second @johnspurlock's comment Would love to be able to use this plugin in a podcasting setting but would need the replies collection. This would be totally awesome to have cross app comments in podcasting and have the root comment be on our own website were the episode is based. I hope you consider adding the replies collection.

@stale
Copy link

stale bot commented Jun 25, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the [Status] wontfix This will not be worked on label Jun 25, 2022
@johnspurlock
Copy link
Author

@mediaformat still eagerly awaiting this - any news on this front?

@stale stale bot removed the [Status] wontfix This will not be worked on label Jun 25, 2022
@mediaformat
Copy link
Collaborator

@johnspurlock yes, it is planned as part of #142

@johnspurlock
Copy link
Author

@johnspurlock yes, it is planned as part of #142

Excellent! Thank you

@stale
Copy link

stale bot commented Oct 24, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the [Status] wontfix This will not be worked on label Oct 24, 2022
@johnspurlock
Copy link
Author

👀

@stale stale bot removed the [Status] wontfix This will not be worked on label Oct 24, 2022
@stale
Copy link

stale bot commented Feb 22, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the [Status] wontfix This will not be worked on label Feb 22, 2023
@mediaformat mediaformat removed the [Status] wontfix This will not be worked on label Feb 22, 2023
@github-actions
Copy link

github-actions bot commented Oct 7, 2023

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Oct 7, 2023
@mediaformat mediaformat removed the Stale label Oct 7, 2023
@pfefferle
Copy link
Member

keep

@Menrath
Copy link
Contributor

Menrath commented Jan 4, 2024

As I learned today the replies Collection is also used by by client application like some iOS and android apps.
@pfefferle which url should the replies Collection have for a WordPress post?

I got interested in implementing this, but got stuck fast, as I stumbled upon the issue whether it is a good practice to leak internal user-ids to an API.

@pfefferle
Copy link
Member

I would use an API endpoint for this. Something like /activitypub/1.0/posts/1/replies or similar?!?

@Menrath
Copy link
Contributor

Menrath commented Jan 4, 2024

I assume the 1 is the WordPress Post-ID? Seems it should be totally possible to not include the user in the replies Collection of a post like Mastodon does. And in leaking the internal Post-ID I don't see any problem.

@Menrath
Copy link
Contributor

Menrath commented Jan 4, 2024

Related: Mobilizon announces every reply with the application actor. Any reasons not to do that (with at least if comments are manually accepted)? ... users should be able to understand the consequences of having followers of the application actor.

@pfefferle
Copy link
Member

I assume the 1 is the WordPress Post-ID? Seems it should be totally possible to not include the user in the replies Collection of a post like Mastodon does.

Exactly!

And in leaking the internal Post-ID I don't see any problem.

The Short URL is using the post ID, so I wouldn't see an issue here. (Even the User-ID is propagated by the default WordPress API btw.)

Copy link

github-actions bot commented May 4, 2024

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label May 4, 2024
@johnspurlock
Copy link
Author

👀

@github-actions github-actions bot removed the Stale label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants