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

support Pleroma #12

Open
1 of 2 tasks
snarfed opened this issue Oct 16, 2017 · 66 comments
Open
1 of 2 tasks

support Pleroma #12

snarfed opened this issue Oct 16, 2017 · 66 comments

Comments

@snarfed
Copy link
Owner

snarfed commented Oct 16, 2017

https://gitgud.io/lambadalambda/pleroma . haven't found a website apart from that. doesn't seem to be used very widely. claims to be OStatus compatible.

Known interop problems so far:

TODO: file issues on https://git.pleroma.social/pleroma/pleroma/-/issues for these ^

@snarfed snarfed changed the title support pleroma support Pleroma Oct 16, 2017
@leenaars
Copy link

leenaars commented Jan 1, 2018

The project meanwhile seems to have matured to its own domain and git repo:

https://git.pleroma.social/pleroma/pleroma

@normikoto
Copy link

Should note that it's also ActivityPub-compatible as well now.

@vikanezrimaya
Copy link

Pleroma seems to gain popularity. It even caused some drama on the fediverse, causing in defederation with several mastodon instances. It is said to be light on resources and I'm moving to it (if you need some assistance with testing, I'd be happy to help!)

@aqeeliz
Copy link

aqeeliz commented Apr 1, 2019

Pleroma is compatible with Mastodon clients, so if Mastodon is working, Pleroma should (at least theoretically) work too.

@swentel
Copy link
Contributor

swentel commented Oct 6, 2020

While working on the Drupal plugin, I finally got successful requests with Pleroma.
You can see a notice at https://kiwifarms.cc/notice/9zpG1WBnWG67cro7bk

@snarfed thinks to look out for:

  • Accept request: you need to pass on the 'id' from the received Follow object into the 'object'. Otherwise it won't work
  • Posting notes/reply: the id of the activity and object must be different. The object also needs the attributedTo property.

That should do it.

@snarfed
Copy link
Owner Author

snarfed commented Oct 6, 2020

thank you @swentel! great sleuthing, really useful info.

and funny coincidence, i've been troubleshooting Pleroma compatibility in Bridgy itself recently too, eg snarfed/bridgy#977 .

@jk-na
Copy link

jk-na commented Mar 10, 2021

I'm sure this doesn't add much of any substance that you didn't already know, however, I've just configured my site to use bridgy-fed and was successfully able to reply to a mastodon post (yours @snarfed ) but not a pleroma post on my site.

The following is the feedback from webmention.app:

source= https://fed.brid.gy/
target= 502 https://fed.brid.gy/webmention
400 Client Error: Bad Request for url: https://social.nipponalba.scot/users/jk/inbox ; "error" 

Apologies in advance if once again this is down to my particular instance not playing ball.

@jk-na
Copy link

jk-na commented Mar 10, 2021

The following are the (debug enabled) logs of an attempt to reply to pleroma:

Mar 10 13:54:17 MatrixRock pleroma[7585]: 13:54:17.446 [info] POST /users/jk/inbox
Mar 10 13:54:17 MatrixRock pleroma[7585]: 13:54:17.448 request_id=Fmr_mvne5kH7O3MADlJi [debug] POST /users/jk/inbox
Mar 10 13:54:17 MatrixRock pleroma[7585]: 13:54:17.462 request_id=Fmr_mvne5kH7O3MADlJi [debug] Processing with Pleroma.Web.ActivityPub.ActivityPubController.inbox/2
Mar 10 13:54:17 MatrixRock pleroma[7585]:   Parameters: %{"@context" => "https://www.w3.org/ns/activitystreams", "nickname" => "jk", "object" => %{"@context" => "https://www.w3.org/ns/activitystreams", "attachment" => [%{"name" => "J K 🇯🇵🏴󠁧󠁢󠁳󠁣󠁴󠁿's avatar Wed, 10 Mar 2021 10:50:00 GMT\nRight then, if I've fixed my atom feed and added the link to bridgy fed for posts.. nginx rule added.. so long as my beehive -&gt; webmention.app process works then maybe my site is now activitypubbed.. maybe.. (https://jk.nipponalba.scot/note/6048a457/)", "type" => "Note"}], "attributedTo" => [%{"icon" => [%{"type" => "Image", "url" => "https://jk.nipponalba.scot/images/profile.jpg"}], "id" => "https://fed.brid.gy/jk.nipponalba.scot", "image" => [%{"type" => "Image", "url" => "https://jk.nipponalba.scot/images/profile.jpg"}], "name" => "J K 🇯🇵🏴󠁧󠁢󠁳󠁣󠁴󠁿 | personal site", "preferredUsername" => "jk.nipponalba.scot", "type" => "Person", "url" => "https://fed.brid.gy/r/https://jk.nipponalba.scot"}], "cc" => ["https://www.w3.org/ns/activitystreams#Public", "https://social.nipponalba.scot/users/jk", "https://social.nipponalba.scot/users/jk/followers"], "content" => "<br/><p>If you can see this, it worked!</p>", "id" => "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6048bcde/", "inReplyTo" => "https://social.nipponalba.scot/objects/1bf56236-fe1f-4f3c-9978-7b3eabcf73b5", "name" => "If you can see this, it worked!", "published" => "10 Mar 2021 12:34 GMT", "tag" => [%{"href" => "https://social.nipponalba.scot/users/jk", "type" => "Mention"}, %{"href" => "https://social.nipponalba.scot/users/jk", "type" => "Mention"}], "type" => "Note", "url" => "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6048bcde/", "urls" => [%{"value" => "https://jk.nipponalba.scot/response/6048bcde/"}, %{"value" => "https://fed.brid.gy/"}]}, "type" => "Create"}
Mar 10 13:54:17 MatrixRock pleroma[7585]:   Pipelines: [:activitypub]
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.128 request_id=Fmr_mvne5kH7O3MADlJi [debug] Couldn't parse XML: "{\n  \"subject\": \"acct:[email protected]\",\n  \"aliases\": [\n    \"https://jk.nipponalba.scot/\",\n    \"https://social.nipponalba.scot/jk\",\n    \"https://px.nipponalba.scot/jk\"\n  ],\n  \"magic_keys\": [\n    {\n      \"value\": \"data:application/magic-public-key,RSA.3Wq8cM8ZzWydoZ3ljmB5GCaMJKcooELcZVHdFY4EkB8MVPZFqn26xwVQA8k7XKov-HQM0Hd1JwiNUzzZ5-Cz2WPT1qIlnd2ZdfxHyxcTuy1PRku33Ei0JMo-STYUpTdyPED7nWW8m64EQ1WWKKA3tQ_uduSixqgtmo6yFTog0U0=.AQAB\"\n    }\n  ],\n  \"links\": [\n    {\n      \"rel\": \"http://webfinger.net/rel/profile-page\",\n      \"type\": \"text/html\",\n      \"href\": \"https://jk.nipponalba.scot/\"\n    },\n    {\n      \"rel\": \"http://webfinger.net/rel/profile-page\",\n      \"type\": \"text/html\",\n      \"href\": \"https://social.nipponalba.scot/jk\"\n    },\n    {\n      \"rel\": \"http://webfinger.net/rel/profile-page\",\n      \"type\": \"text/html\",\n      \"href\": \"https://px.nipponalba.scot/jk\"\n    },\n    {\n      \"rel\": \"http://webfinger.net/rel/avatar\",\n      \"href\": {\n        \"value\": \"https://jk.nipponalba.scot/images/profile.jpg\",\n        \"alt\": \"profile picture\"\n      }\n    },\n    {\n      \"rel\": \"canonical_uri\",\n      \"type\": \"text/html\",\n      \"href\": \"https://jk.nipponalba.scot/\"\n    },\n    {\n      \"rel\": \"self\",\n      \"type\": \"application/activity+json\",\n      \"href\": \"https://fed.brid.gy/jk.nipponalba.scot\"\n    },\n    {\n      \"rel\": \"inbox\",\n      \"type\": \"application/activity+json\",\n      \"href\": \"https://fed.brid.gy/jk.nipponalba.scot/inbox\"\n    },\n    {\n      \"rel\": \"http://schemas.google.com/g/2010#updates-from\",\n      \"type\": \"application/atom+xml\",\n      \"href\": \"http://jk.nipponalba.scot/atom.xml\"\n    },\n    {\n      \"rel\": \"hub\",\n      \"href\": \"https://bridgy-fed.superfeedr.com/\"\n    },\n    {\n      \"rel\": \"magic-public-key\",\n      \"href\": \"data:application/magic-public-key,RSA.3Wq8cM8ZzWydoZ3ljmB5GCaMJKcooELcZVHdFY4EkB8MVPZFqn26xwVQA8k7XKov-HQM0Hd1JwiNUzzZ5-Cz2WPT1qIlnd2ZdfxHyxcTuy1PRku33Ei0JMo-STYUpTdyPED7nWW8m64EQ1WWKKA3tQ_uduSixqgtmo6yFTog0U0=.AQAB\"\n    },\n    {\n      \"rel\": \"salmon\",\n      \"href\": \"https://fed.brid.gy/jk.nipponalba.scot/salmon\"\n    }\n  ]\n}"
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.130 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: "text/html"
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.131 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: "text/html"
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.131 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: "text/html"
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.132 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: nil
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.133 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: "text/html"
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.134 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: "application/activity+json"
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.136 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: "application/atom+xml"
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.137 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: nil
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.138 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: nil
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.139 request_id=Fmr_mvne5kH7O3MADlJi [debug] Unhandled type: nil
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.140 request_id=Fmr_mvne5kH7O3MADlJi [debug] Could not validate against known public keys: {:error, {:error, "acct:[email protected]"}}
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.141 request_id=Fmr_mvne5kH7O3MADlJi [debug] Signature missing or not from author, relayed Create message, fetching object from source
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.150 request_id=Fmr_mvne5kH7O3MADlJi [debug] QUERY OK source="objects" db=6.3ms queue=0.4ms idle=261.1ms
Mar 10 13:54:21 MatrixRock pleroma[7585]: SELECT o0."id", o0."data", o0."inserted_at", o0."updated_at" FROM "objects" AS o0 WHERE ((o0."data")->>'id' = $1) ["https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6048bcde/"]
Mar 10 13:54:21 MatrixRock pleroma[7585]: 13:54:21.150 request_id=Fmr_mvne5kH7O3MADlJi [debug] Fetching object https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6048bcde/ via AP
Mar 10 13:54:22 MatrixRock pleroma[7585]: 13:54:22.200 request_id=Fmr_mvne5kH7O3MADlJi [debug] Sent 200 in 4751ms
Mar 10 13:54:22 MatrixRock pleroma[7585]: 13:54:22.200 request_id=Fmr_mvne5kH7O3MADlJi [info] Sent 200 in 4754ms

@snarfed
Copy link
Owner Author

snarfed commented Mar 10, 2021

Thanks for the details!

Here's also the complete AS2 activity that Bridgy Fed sent to https://social.nipponalba.scot/users/jk/inbox , and got a 200 back for, from Bridgy Fed's log.

One thing I notice is that the object has an id, but the activity doesn't, and @swentel said above:

Posting notes/reply: the id of the activity and object must be different. The object also needs the attributedTo property.

I can look into adding an activity id.

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "object": {
    "published": "10 Mar 2021 12:34 GMT",
    "content": "<br/><p>If you can see this, it worked!</p>",
    "url": "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6048bcde/",
    "urls": [
      {"value": "https://jk.nipponalba.scot/response/6048bcde/"},
      {"value": "https://fed.brid.gy/"}
    ],
    "inReplyTo": "https://social.nipponalba.scot/objects/1bf56236-fe1f-4f3c-9978-7b3eabcf73b5",
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Note",
    "name": "If you can see this, it worked!",
    "attachment": [
      {
        "type": "Note",
        "name": "J K \ud83c\uddef\ud83c\uddf5\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f's avatar Wed, 10 Mar 2021 10:50:00 GMT\nRight then, if I've fixed my atom feed and added the link to bridgy fed for posts.. nginx rule added.. so long as my beehive -&gt; webmention.app process works then maybe my site is now activitypubbed.. maybe.. (https://jk.nipponalba.scot/note/6048a457/)"
      }
    ],
    "attributedTo": [
      {
        "url": "https://fed.brid.gy/r/https://jk.nipponalba.scot",
        "type": "Person",
        "name": "J K \ud83c\uddef\ud83c\uddf5\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f | personal site",
        "image": [
          {
            "url": "https://jk.nipponalba.scot/images/profile.jpg",
            "type": "Image"
          }
        ],
        "icon": [
          {
            "url": "https://jk.nipponalba.scot/images/profile.jpg",
            "type": "Image"
          }
        ],
        "preferredUsername": "jk.nipponalba.scot",
        "id": "https://fed.brid.gy/jk.nipponalba.scot"
      }
    ],
    "tag": [
      {
        "type": "Mention",
        "href": "https://social.nipponalba.scot/users/jk"
      },
      {
        "type": "Mention",
        "href": "https://social.nipponalba.scot/users/jk"
      }
    ],
    "id": "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6048bcde/",
    "cc": [
      "https://www.w3.org/ns/activitystreams#Public",
      "https://social.nipponalba.scot/users/jk",
      "https://social.nipponalba.scot/users/jk/followers"
    ]
  }
}

snarfed added a commit that referenced this issue Mar 11, 2021
@snarfed
Copy link
Owner Author

snarfed commented Mar 11, 2021

I've added an id to outbound AS2 activities. Feel free to try again!

@jk-na
Copy link

jk-na commented Mar 11, 2021

I've tried again and am seeing a similar pattern to above - there are 200 responses but there are also errors relating to signatures and failures to parse xml.

Mar 11 09:42:22 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] POST /users/jk/inbox
Mar 11 09:42:22 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Processing with Pleroma.Web.ActivityPub.ActivityPubController.inbox/2#012  Parameters: %{"@context" => "https://www.w3.org/ns/activitystreams", "id" => "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6049d413/#bridgy-fed-create", "nickname" => "jk", "object" => %{"@context" => "https://www.w3.org/ns/activitystreams", "attributedTo" => [%{"icon" => [%{"type" => "Image", "url" => "https://jk.nipponalba.scot/images/profile.jpg"}], "id" => "https://fed.brid.gy/jk.nipponalba.scot", "image" => [%{"type" => "Image", "url" => "https://jk.nipponalba.scot/images/profile.jpg"}], "name" => "J K 🇯🇵🏴󠁧󠁢󠁳󠁣󠁴󠁿 | personal site", "preferredUsername" => "jk.nipponalba.scot", "type" => "Person", "url" => "https://fed.brid.gy/r/https://jk.nipponalba.scot"}], "cc" => ["https://www.w3.org/ns/activitystreams#Public", "https://social.nipponalba.scot/users/jk", "https://social.nipponalba.scot/users/jk/followers"], "content" => "<br/><p>Testing</p>", "id" => "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6049d413/", "inReplyTo" => "https://social.nipponalba.scot/objects/c341db0a-ad7e-406a-9b9f-07b575ce9f61", "name" => "Testing", "published" => "11 Mar 2021 08:25 GMT", "tag" => [%{"href" => "https://social.nipponalba.scot/users/jk", "type" => "Mention"}, %{"href" => "https://social.nipponalba.scot/users/jk", "type" => "Mention"}], "type" => "Note", "url" => "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6049d413/", "urls" => [%{"value" => "https://jk.nipponalba.scot/response/6049d413/"}, %{"value" => "https://fed.brid.gy/"}]}, "type" => "Create"}#012  Pipelines: [:activitypub]
Mar 11 09:42:25 MatrixRock pleroma: [debug] QUERY OK source="users" db=1077.5ms decode=0.7ms queue=0.1ms idle=110.3ms#012SELECT distinct split_part(u0."nickname", '@', 2) FROM "users" AS u0 WHERE (u0."local" != $1) [true]
Mar 11 09:42:25 MatrixRock pleroma: [debug] QUERY OK source="users" db=4.6ms queue=0.2ms idle=194.6ms#012SELECT sum(u0."note_count") FROM "users" AS u0 WHERE (NOT (u0."nickname" IS NULL)) AND (NOT (u0."nickname" LIKE 'internal.%')) AND (u0."local" = $1) [true]
Mar 11 09:42:25 MatrixRock pleroma: [debug] QUERY OK source="users" db=4.9ms queue=1.1ms idle=197.8ms#012SELECT count(u0."id") FROM "users" AS u0 WHERE (u0."is_active" = TRUE) AND (u0."local" = TRUE) AND (NOT (u0."nickname" IS NULL)) AND (NOT (u0."invisible")) []
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Couldn't parse XML: "{\n  \"subject\": \"acct:[email protected]\",\n  \"aliases\": [\n    \"https://jk.nipponalba.scot/\",\n    \"https://social.nipponalba.scot/jk\",\n    \"https://px.nipponalba.scot/jk\"\n  ],\n  \"magic_keys\": [\n    {\n      \"value\": \"data:application/magic-public-key,RSA.3Wq8cM8ZzWydoZ3ljmB5GCaMJKcooELcZVHdFY4EkB8MVPZFqn26xwVQA8k7XKov-HQM0Hd1JwiNUzzZ5-Cz2WPT1qIlnd2ZdfxHyxcTuy1PRku33Ei0JMo-STYUpTdyPED7nWW8m64EQ1WWKKA3tQ_uduSixqgtmo6yFTog0U0=.AQAB\"\n    }\n  ],\n  \"links\": [\n    {\n      \"rel\": \"http://webfinger.net/rel/profile-page\",\n      \"type\": \"text/html\",\n      \"href\": \"https://jk.nipponalba.scot/\"\n    },\n    {\n      \"rel\": \"http://webfinger.net/rel/profile-page\",\n      \"type\": \"text/html\",\n      \"href\": \"https://social.nipponalba.scot/jk\"\n    },\n    {\n      \"rel\": \"http://webfinger.net/rel/profile-page\",\n      \"type\": \"text/html\",\n      \"href\": \"https://px.nipponalba.scot/jk\"\n    },\n    {\n      \"rel\": \"http://webfinger.net/rel/avatar\",\n      \"href\": {\n        \"value\": \"https://jk.nipponalba.scot/images/profile.jpg\",\n        \"alt\": \"profile picture\"\n      }\n    },\n    {\n      \"rel\": \"canonical_uri\",\n      \"type\": \"text/html\",\n      \"href\": \"https://jk.nipponalba.scot/\"\n    },\n    {\n      \"rel\": \"self\",\n      \"type\": \"application/activity+json\",\n      \"href\": \"https://fed.brid.gy/jk.nipponalba.scot\"\n    },\n    {\n      \"rel\": \"inbox\",\n      \"type\": \"application/activity+json\",\n      \"href\": \"https://fed.brid.gy/jk.nipponalba.scot/inbox\"\n    },\n    {\n      \"rel\": \"http://schemas.google.com/g/2010#updates-from\",\n      \"type\": \"application/atom+xml\",\n      \"href\": \"http://jk.nipponalba.scot/atom.xml\"\n    },\n    {\n      \"rel\": \"hub\",\n      \"href\": \"https://bridgy-fed.superfeedr.com/\"\n    },\n    {\n      \"rel\": \"magic-public-key\",\n      \"href\": \"data:application/magic-public-key,RSA.3Wq8cM8ZzWydoZ3ljmB5GCaMJKcooELcZVHdFY4EkB8MVPZFqn26xwVQA8k7XKov-HQM0Hd1JwiNUzzZ5-Cz2WPT1qIlnd2ZdfxHyxcTuy1PRku33Ei0JMo-STYUpTdyPED7nWW8m64EQ1WWKKA3tQ_uduSixqgtmo6yFTog0U0=.AQAB\"\n    },\n    {\n      \"rel\": \"salmon\",\n      \"href\": \"https://fed.brid.gy/jk.nipponalba.scot/salmon\"\n    }\n  ]\n}"
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: "text/html"
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: "text/html"
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: "text/html"
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: nil
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: "text/html"
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: "application/activity+json"
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: "application/atom+xml"
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: nil
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: nil
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Unhandled type: nil
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Could not validate against known public keys: {:error, {:error, "acct:[email protected]"}}
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Signature missing or not from author, relayed Create message, fetching object from source
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] QUERY OK source="objects" db=5.6ms queue=0.4ms idle=258.2ms#012SELECT o0."id", o0."data", o0."inserted_at", o0."updated_at" FROM "objects" AS o0 WHERE ((o0."data")->>'id' = $1) ["https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6049d413/"]
Mar 11 09:42:25 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Fetching object https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6049d413/ via AP
Mar 11 09:42:26 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] QUERY OK source="objects" db=6.4ms queue=0.2ms idle=348.7ms#012SELECT o0."id", o0."data", o0."inserted_at", o0."updated_at" FROM "objects" AS o0 WHERE ((o0."data")->>'id' = $1) ["https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6049d413/#bridgy-fed-create"]
Mar 11 09:42:26 MatrixRock pleroma: request_id=FmtAcEQM0DZ8z1UAFDvB [debug] Sent 200 in 3997ms

Not sure if perhaps:
Could not validate against known public keys: {:error, {:error, "acct:[email protected]"}}
or
Couldn't parse XML
are at all relevant?

The first of those seems similar in nature to the pixelfed error, could it be that the AP spec has it that the key needs to be formatted in a certain way (which pixelfed and pleroma perhaps require) but mastodon have a workaround in place that converts one format to the other?

@jk-na
Copy link

jk-na commented Mar 11, 2021

The mastodon activitypub page has the key id in the format of "https://mastodon.social/users/Gargron#main-key" rather than the webfinger format above. I may however be reading way too much into this, and it could well be a red herring.

@snarfed
Copy link
Owner Author

snarfed commented Mar 11, 2021

@jk-na those are all good clues!

I did notice one other quirk: it looks like your site's redirects to Bridgy Fed are duplicating the query parameters. eg https://jk.nipponalba.scot/.well-known/webfinger?resource=acct:[email protected] currently redirects to https://fed.brid.gy/.well-known/webfinger?resource=acct:[email protected]?resource=acct:[email protected]. Bridgy Fed still serves that request fine though, for just [email protected], so I doubt it's the cause here.

@jk-na
Copy link

jk-na commented Mar 11, 2021

How bizarre, I just copied and pasted the nginx redirect from the set up instructions to my proxy server, I'll double-check it though.

@snarfed
Copy link
Owner Author

snarfed commented Mar 11, 2021

Also, Couldn't parse XML is odd. ActivityPub is all JSON afaik, the term XML literally doesn't appear anywhere on https://w3c.github.io/activitypub/ , so I'm not sure where Pleroma is expecting XML.

@snarfed
Copy link
Owner Author

snarfed commented Mar 11, 2021

Based on the logs, it looks like Pleroma is trying to parse the JSON WebFinger response as XML, which explains that error and why it can't find or validate your public key. I'll try to figure out why.

@jk-na
Copy link

jk-na commented Mar 11, 2021

I fixed the duplication by adding a ? to the end of the rewrite target..

rewrite ^/.well-known/(host-meta|webfinger).* https://fed.brid.gy$request_uri? redirect;

Interestingly, I don't now get the webmention.app error, instead receiving a 200 response. Received the error on the second attempt.. same errors at the pleroma end.

@jk-na
Copy link

jk-na commented Mar 11, 2021

The following is an excerpt from a successful POST to my inbox and might provide a clue or more confusion, it is from a mastodon account, I think:

Mar 11 21:48:56 MatrixRock pleroma: [info] POST /inbox
Mar 11 21:48:56 MatrixRock pleroma: request_id=FmtoFl8HNVPrWxgAEQ-j [debug] POST /inbox
Mar 11 21:48:56 MatrixRock pleroma: request_id=FmtoFl8HNVPrWxgAEQ-j [debug] Processing with Pleroma.Web.ActivityPub.ActivityPubController.inbox/2#012  Parameters: %{"@context" => ["https://www.w3.org/ns/activitystreams", %{"atomUri" => "ostatus:atomUri", "conversation" => "ostatus:conversation", "inReplyToAtomUri" => "ostatus:inReplyToAtomUri", "ostatus" => "http://ostatus.org#", "sensitive" => "as:sensitive", "toot" => "http://joinmastodon.org/ns#", "votersCount" => "toot:votersCount"}], "actor" => "https://rage.love/users/pfx", "cc" => [], "id" => "https://rage.love/users/pfx/statuses/105873364426273091/activity", "object" => %{"atomUri" => "https://rage.love/users/pfx/statuses/105873364426273091", "attachment" => [], "attributedTo" => "https://rage.love/users/pfx", "cc" => [], "content" => "<p>mmm nectarines with the texture of a old apple</p>", "contentMap" => %{"en" => "<p>mmm nectarines with the texture of a old apple</p>"}, "conversation" => "tag:rage.love,2021-03-11:objectId=5836645:objectType=Conversation", "id" => "https://rage.love/users/pfx/statuses/105873364426273091", "inReplyTo" => nil, "inReplyToAtomUri" => nil, "published" => "2021-03-11T21:48:55Z", "replies" => %{"first" => %{"items" => [], "next" => "https://rage.love/users/pfx/statuses/105873364426273091/replies?only_other_accounts=true&page=true", "partOf" => "https://rage.love/users/pfx/statuses/105873364426273091/replies", "type" => "CollectionPage"}, "id" => "https://rage.love/users/pfx/statuses/105873364426273091/replies", "type" => "Collection"}, "sensitive" => true, "summary" => "food", "tag" => [], "to" => ["https://rage.love/users/pfx/followers"], "type" => "Note", "url" => "https://rage.love/@pfx/105873364426273091"}, "published" => "2021-03-11T21:48:55Z", "to" => ["https://rage.love/users/pfx/followers"], "type" => "Create"}#012  Pipelines: [:activitypub]
Mar 11 21:48:56 MatrixRock pleroma: request_id=FmtoFl8HNVPrWxgAEQ-j [debug] Signature: IUDKbTJA9AnMERaKNHEN8ayG9G+jrsHsy8gFGoUjA3fqcgioDGkg+Cz4S+MZnvnB5LwZRDsMNb/AoquHESVbY6GPvEVusUk0JVz8WcIKFEwDdCqoVkhW7rnXMYLBs8bJ4+qpUBKV2lfljJCE4xVLVT8L9ZHXrYaksKk3qOkAq0P1/QQqaXrkvOniVw0T33RnY5MggQyXPidc1rtxPTqlCHogvsRpWMKplr3qo4xIIM36TT2zpsvzThJBTs5q0zrd9HfCreHx8NOYyDaO95L0y5Jdnnb1wfKi9yLY45mv8oBw7yCT4oy7UWpi/zvFq1/QLvKHXqrEcz4FaJNMCxWUQw==
Mar 11 21:48:56 MatrixRock pleroma: request_id=FmtoFl8HNVPrWxgAEQ-j [debug] Sigstring: (request-target): post /inbox#012host: social.nipponalba.scot#012date: Thu, 11 Mar 2021 21:48:56 GMT#012digest: SHA-256=ZaO6N06SYi9mA9R095sODVeuVud3eiPukDra3aYwCvc=#012content-type: application/activity+json
Mar 11 21:48:56 MatrixRock pleroma: request_id=FmtoFl8HNVPrWxgAEQ-j [debug] QUERY OK source="instances" db=4.7ms queue=0.2ms idle=440.6ms#012SELECT i0."id", i0."host", i0."unreachable_since", i0."favicon", i0."favicon_updated_at", i0."inserted_at", i0."updated_at" FROM "instances" AS i0 WHERE (i0."host" = $1) ["rage.love"]
Mar 11 21:48:56 MatrixRock pleroma: request_id=FmtoFl8HNVPrWxgAEQ-j [debug] Sent 200 in 30ms

@snarfed
Copy link
Owner Author

snarfed commented Mar 11, 2021

The WebFinger spec says:

The WebFinger resource returns a JSON Resource Descriptor (JRD) as the resource representation to convey information about an entity on the Internet.

I did notice that the official mime type for JRD is application/jrd+json, but Bridgy Fed currently returns application/json. I've fixed that, feel free to try again.

@jk-na
Copy link

jk-na commented Mar 11, 2021

After much backslash removal, this is the bit that pleroma seems to be having with:

Couldn't parse XML: "{
			"subject": "acct:[email protected]",
			"aliases": ["https://jk.nipponalba.scot/", "https://social.nipponalba.scot/jk", "https://px.nipponalba.scot/jk"],
			"magic_keys": [{"value": "data:application/magic-public-key,RSA.3Wq8cM8ZzWydoZ3ljmB5GCaMJKcooELcZVHdFY4EkB8MVPZFqn26xwVQA8k7XKov-HQM0Hd1JwiNUzzZ5-Cz2WPT1qIlnd2ZdfxHyxcTuy1PRku33Ei0JMo-STYUpTdyPED7nWW8m64EQ1WWKKA3tQ_uduSixqgtmo6yFTog0U0=.AQAB"}],
			"links": [{"rel": "http://webfinger.net/rel/profile-page",
			         "type": "text/html",
				 "href": "https://jk.nipponalba.scot/"},
		         {"rel": "http://webfinger.net/rel/profile-page",
			 	 "type": "text/html",
			 	 "href": "https://social.nipponalba.scot/jk"},
			 {"rel": "http://webfinger.net/rel/profile-page",
			 	 "type": "text/html", 
				 "href": "https://px.nipponalba.scot/jk"},
			 {"rel": "http://webfinger.net/rel/avatar",
	                         "href": {"value": "https://jk.nipponalba.scot/images/profile.jpg",
			           	    "alt": "profile picture"}},
			 {"rel": "canonical_uri",
				 "type": "text/html",
				 "href": "https://jk.nipponalba.scot/"},
			 {"rel": "self",
				 "type": "application/activity+json",
				 "href": "https://fed.brid.gy/jk.nipponalba.scot"},
			 {"rel": "inbox",
				 "type": "application/activity+json",
				 "href": "https://fed.brid.gy/jk.nipponalba.scot/inbox"},
			 {"rel": "http://schemas.google.com/g/2010#updates-from",
				 "type": "application/atom+xml"
				 "href": "http://jk.nipponalba.scot/atom.xml"},
			 {"rel": "hub",
			   	 "href": "https://bridgy-fed.superfeedr.com/"},
			 {"rel": "magic-public-key",
				 "href": "data:application/magic-public-key,RSA.3Wq8cM8ZzWydoZ3ljmB5GCaMJKcooELcZVHdFY4EkB8MVPZFqn26xwVQA8k7XKov-HQM0Hd1JwiNUzzZ5-Cz2WPT1qIlnd2ZdfxHyxcTuy1PRku33Ei0JMo-STYUpTdyPED7nWW8m64EQ1WWKKA3tQ_uduSixqgtmo6yFTog0U0=.AQAB"},
			 {"rel": "salmon",
				 "href": "https://fed.brid.gy/jk.nipponalba.scot/salmon"}]}"

I'll try again.

@jk-na
Copy link

jk-na commented Mar 11, 2021

The WebFinger spec says:

The WebFinger resource returns a JSON Resource Descriptor (JRD) as the resource representation to convey information about an entity on the Internet.

I did notice that the official mime type for JRD is application/jrd+json, but Bridgy Fed currently returns application/json. I've fixed that, feel free to try again.

Still the same error.

For ease of reading, I've tried to format the payload being processed by the inbox controller, I can see some differences but I don't know what is and isn't mandatory unfortunately.

First one is the mastodon transaction from above, second is one of my attempts via bridgy fed

Processing with Pleroma.Web.ActivityPub.ActivityPubController.inbox/2#012  
Parameters: 
	%{"@context" => 
		["https://www.w3.org/ns/activitystreams", 
		 %{
			"atomUri" => "ostatus:atomUri", 
			"conversation" => "ostatus:conversation", 
			"inReplyToAtomUri" => "ostatus:inReplyToAtomUri", 
			"ostatus" => "http://ostatus.org#", "
			sensitive" => "as:sensitive", 
			"toot" => "http://joinmastodon.org/ns#", 
			"votersCount" => "toot:votersCount"
		 }
		], 
		"actor" => "https://rage.love/users/pfx", 
		"cc" => [], 
		"id" => "https://rage.love/users/pfx/statuses/105873364426273091/activity", 
		"object" => %{
				"atomUri" => "https://rage.love/users/pfx/statuses/105873364426273091", 
				"attachment" => [], 
				"attributedTo" => "https://rage.love/users/pfx", 
				"cc" => [], 
				"content" => "<p>mmm nectarines with the texture of a old apple</p>", 
				"contentMap" => %{"en" => "<p>mmm nectarines with the texture of a old apple</p>"}, 
				"conversation" => "tag:rage.love,2021-03-11:objectId=5836645:objectType=Conversation", 
				"id" => "https://rage.love/users/pfx/statuses/105873364426273091", 
				"inReplyTo" => nil, 
				"inReplyToAtomUri" => nil, 
				"published" => "2021-03-11T21:48:55Z", 
				"replies" => %{
						"first" => %{
								"items" => [], 
								"next" => "https://rage.love/users/pfx/statuses/105873364426273091/replies?only_other_accounts=true&page=true", 
								"partOf" => "https://rage.love/users/pfx/statuses/105873364426273091/replies", 
								"type" => "CollectionPage"}, 
						"id" => "https://rage.love/users/pfx/statuses/105873364426273091/replies", 
						"type" => "Collection"}, 
				"sensitive" => true, 
				"summary" => "food", 
				"tag" => [], 
				"to" => ["https://rage.love/users/pfx/followers"], 
				"type" => "Note", 
				"url" => "https://rage.love/@pfx/105873364426273091"}, 
		"published" => "2021-03-11T21:48:55Z", 
		"to" => ["https://rage.love/users/pfx/followers"], 
		"type" => "Create"}
#012  Pipelines: [:activitypub]


Processing with Pleroma.Web.ActivityPub.ActivityPubController.inbox/2#012  
Parameters: 
	%{"@context" => "https://www.w3.org/ns/activitystreams", 
	"id" => "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6049d880/#bridgy-fed-create", 
	"nickname" => "jk", 
	"object" => %{
		"@context" => "https://www.w3.org/ns/activitystreams", 
		"attributedTo" => [%{"icon" => [%{"type" => "Image", "url" => "https://jk.nipponalba.scot/images/profile.jpg"}], 
			"id" => "https://fed.brid.gy/jk.nipponalba.scot", 
			"image" => [%{"type" => "Image", "url" => "https://jk.nipponalba.scot/images/profile.jpg"}], 
			"name" => "J K 🇯🇵🏴󠁧󠁢󠁳󠁣󠁴󠁿 | personal site", 
			"preferredUsername" => "jk.nipponalba.scot", 
			"type" => "Person", 
			"url" => "https://fed.brid.gy/r/https://jk.nipponalba.scot"}], 
		"cc" => ["https://www.w3.org/ns/activitystreams#Public", "https://social.nipponalba.scot/users/jk", "https://social.nipponalba.scot/users/jk/followers"], 
		"content" => "<br/><p>Test #2</p>", 
		"id" => "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6049d880/", 
		"inReplyTo" => "https://social.nipponalba.scot/objects/c341db0a-ad7e-406a-9b9f-07b575ce9f61", 
		"name" => "Test #2", 
		"published" => "11 Mar 2021 08:44 GMT", 
		"tag" => [%{"href" => "https://social.nipponalba.scot/users/jk", "type" => "Mention"}, %{"href" => "https://social.nipponalba.scot/users/jk", "type" => "Mention"}], 
		"type" => "Note", 
		"url" => "https://fed.brid.gy/r/https://jk.nipponalba.scot/response/6049d880/", 
		"urls" => [%{"value" => "https://jk.nipponalba.scot/response/6049d880/"}, %{"value" => "https://fed.brid.gy/"}]
         }, 
	"type" => "Update"}

#012  Pipelines: [:activitypub]

@jk-na
Copy link

jk-na commented Mar 11, 2021

I had a look at my webfinger response for my pleroma account and the following is the output (I found the xml)

<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
   <Subject>acct:[email protected]</Subject>
   <Alias>https://social.nipponalba.scot/users/jk</Alias>
   <Link href="https://social.nipponalba.scot/users/jk" rel="http://webfinger.net/rel/profile-page" type="text/html" />
   <Link href="https://social.nipponalba.scot/users/jk" rel="self" type="application/activity+json" />
   <Link href="https://social.nipponalba.scot/users/jk" rel="self" type="application/ld+json; profile=&quot;https://www.w3.org/ns/activitystreams&quot;" />
   <Link rel="http://ostatus.org/schema/1.0/subscribe" template="https://social.nipponalba.scot/ostatus_subscribe?acct={uri}" />
</XRD>

@snarfed
Copy link
Owner Author

snarfed commented Mar 11, 2021

Thanks! Yup, that's XML-based XRD. I can try supporting that and see if it works then.

@jk-na
Copy link

jk-na commented Mar 11, 2021

This one is from my test mastodon account:

{
"subject":"acct:[email protected]",
"aliases":["https://mastodon.scot/@jk_na","https://mastodon.scot/users/jk_na"],
"links":[
	{"rel":"http://webfinger.net/rel/profile-page",
	 "type":"text/html","href":"https://mastodon.scot/@jk_na"},
	{"rel":"self",
	 "type":"application/activity+json",
	 "href":"https://mastodon.scot/users/jk_na"},
	{"rel":"http://ostatus.org/schema/1.0/subscribe",
	 "template":"https://mastodon.scot/authorize_interaction?uri={uri}"}
	]
}

@snarfed
Copy link
Owner Author

snarfed commented Mar 12, 2021

OK, Bridgy Fed's WebFinger now supports XRD. If you fetch it with `Accept: application/xrd' or 'application/xml', it now returns similar XRD to Pleroma's. Feel free to retry. Thanks again for all the testing!

@jk-na
Copy link

jk-na commented Mar 12, 2021

I think we're almost there.. the error message is smaller!

Couldn't parse XML: "{\"links\": [\n  {\n    \"rel\": \"lrdd\",\n    \"type\": \"application/json\",\n    \"template\": \"https://fed.brid.gy/.well-known/webfinger?resource={uri}\"\n   }\n  ]\n}"
Could not validate against known public keys: {:error, {:error, "acct:[email protected]"}}

When I look at the webfinger, I don't see any rel for lrdd so I'm not sure but also the subject element is empty.

<?xml version='1.0' encoding='UTF-8'?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>

    <Subject></Subject>
    <Alias>https://jk.nipponalba.scot/</Alias>

    
    <Link rel='http://webfinger.net/rel/profile-page' type='text/html' href='https://jk.nipponalba.scot/' />
    
    <Link rel='http://webfinger.net/rel/profile-page' type='text/html' href='https://social.nipponalba.scot/jk' />
    
    <Link rel='http://webfinger.net/rel/profile-page' type='text/html' href='https://px.nipponalba.scot/jk' />
    
    <Link rel='http://webfinger.net/rel/avatar' type='' href='https://jk.nipponalba.scot/images/profile.jpg' />
    
    <Link rel='canonical_uri' type='text/html' href='https://jk.nipponalba.scot/' />
    
    <Link rel='self' type='application/activity+json' href='https://fed.brid.gy/jk.nipponalba.scot' />
    
    <Link rel='inbox' type='application/activity+json' href='https://fed.brid.gy/jk.nipponalba.scot/inbox' />
    
    <Link rel='http://schemas.google.com/g/2010#updates-from' type='application/atom+xml' href='http://jk.nipponalba.scot/atom.xml' />
    
    <Link rel='hub' type='' href='https://bridgy-fed.superfeedr.com/' />
    
    <Link rel='magic-public-key' type='' href='data:application/magic-public-key,RSA.3Wq8cM8ZzWydoZ3ljmB5GCaMJKcooELcZVHdFY4EkB8MVPZFqn26xwVQA8k7XKov-HQM0Hd1JwiNUzzZ5-Cz2WPT1qIlnd2ZdfxHyxcTuy1PRku33Ei0JMo-STYUpTdyPED7nWW8m64EQ1WWKKA3tQ_uduSixqgtmo6yFTog0U0=.AQAB' />
    
    <Link rel='salmon' type='' href='https://fed.brid.gy/jk.nipponalba.scot/salmon' />
    

    
    <Property xmlns:mk="http://salmon-protocol.org/ns/magic-key"
              type="http://salmon-protocol.org/ns/magic-key">
      data:application/magic-public-key,RSA.3Wq8cM8ZzWydoZ3ljmB5GCaMJKcooELcZVHdFY4EkB8MVPZFqn26xwVQA8k7XKov-HQM0Hd1JwiNUzzZ5-Cz2WPT1qIlnd2ZdfxHyxcTuy1PRku33Ei0JMo-STYUpTdyPED7nWW8m64EQ1WWKKA3tQ_uduSixqgtmo6yFTog0U0=.AQAB
    </Property>
    
</XRD>

snarfed added a commit that referenced this issue Mar 12, 2021
@snarfed
Copy link
Owner Author

snarfed commented Mar 12, 2021

Thanks! I should really set up my own local Pleroma instance to do this testing. 😆

That new JSON is .well-known/host-meta, it needs to be XRD too. I'll do that.

@snarfed
Copy link
Owner Author

snarfed commented Oct 12, 2023

Progress after #442! Got a Like to work. A reply still 500ed though.

@snarfed
Copy link
Owner Author

snarfed commented Oct 30, 2023

Also, wow, Pleroma prefixes our handles with an ugly hash id, eg https://pleroma.envs.net/users/ARH2JS1YMQXugE3HZw says I'm @[email protected]:

image

@snarfed
Copy link
Owner Author

snarfed commented Oct 31, 2023

@srijan says this doesn't happen on his Akkoma instance, eg https://fedi.srijan.dev/users/ARH2J8WrU9En9ZzmSG, so it may be a misconfiguration or other problem on pleroma.envs.net specifically?

@snarfed
Copy link
Owner Author

snarfed commented Nov 8, 2023

Filed https://git.pleroma.social/pleroma/pleroma/-/issues/3206 for the reply inbox delivery 500.

@snarfed
Copy link
Owner Author

snarfed commented Feb 7, 2024

Same Pleroma 500 is still happening: https://git.pleroma.social/pleroma/pleroma/-/issues/3206#note_104956 . Got a bit of a response and discussion from a maintainer in that thread, but no conclusion and nothing more recently.

@hellquist
Copy link

When I try to follow my website from my Akkoma account it says "request sent", but I'm not clear on how/where I can see, or respond to, that request.

image

@snarfed
Copy link
Owner Author

snarfed commented Mar 7, 2024

@hellquist following up in #374

@snan
Copy link

snan commented May 9, 2024

(Moved here)

@snarfed
Copy link
Owner Author

snarfed commented May 9, 2024

@snan feel free to add that to #374!

@snarfed snarfed added the now label Jun 19, 2024
@snarfed snarfed removed the now label Jul 17, 2024
@snarfed
Copy link
Owner Author

snarfed commented Aug 17, 2024

Got a new lead here. @[email protected] reports:

Pleroma wants to see the ap_id at the top level in either to, cc, bto or bcc. It won't parse into the object to find the ap_id under that.

If I use the json from the Pleroma issue on https://git.pleroma.social/pleroma/pleroma/-/issues/3206 and take the recipient out of the cc and place it into the to at the top level then it works OK.

@snarfed snarfed added the now label Aug 17, 2024
@snarfed
Copy link
Owner Author

snarfed commented Aug 21, 2024

Big milestone here! Diego's lead above panned out: for Creates and Updates, it's evidently not enough for to and cc to be in the object, Pleroma evidently also expects the outer activity to have the exact same to and cc values. 🤷 I added that in e2b6b59, and now Pleroma is accepting Bridgy Fed's replies. Example here. Woot!

@snarfed
Copy link
Owner Author

snarfed commented Sep 10, 2024

Looks like we still have some to values to fix. We currently send Accepts like this below out sometimes, and Pleroma returns HTTP 400 "Invalid request."

I'm guessing the problem is the non-standard to field value in the inner object. Definitely something I can and should fix on BF's end. The other fields are right, notably id, so Pleroma is arguably being too brittle if it's choking on the to field, but I can try to fix them!

{
  "id": "https://fed.brid.gy/r/snarfed.org/followers#accept-https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee",
  "actor": "https://fed.brid.gy/snarfed.org",
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Accept",
  "object": {
    "actor": "https://sironi.tk/users/luca",
    "id": "https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee",
    "state": "pending",
    "url": "https://sironi.tk/users/luca#followed-snarfed.org",
    "type": "Follow",
    "object": "https://fed.brid.gy/snarfed.org",
    "to": ["snarfed.org"]
  },
  "to": ["https://www.w3.org/ns/activitystreams#Public"]
}

@snarfed snarfed added the now label Sep 10, 2024
@snarfed
Copy link
Owner Author

snarfed commented Sep 13, 2024

I'm struggling to find recent examples of this. The Accepts I see that we're sending on behalf of both Bluesky and web users have "to": ["https://www.w3.org/ns/activitystreams#Public"] in both the outer activity and the inner object.

@snarfed
Copy link
Owner Author

snarfed commented Sep 13, 2024

Here's the full send task log for the bad Accept above:

2024-09-09 22:55:41.449 PDT
POST http://atproto-hub.bridgy-federated.uc.r.appspot.com/queue/send

Task 1421521966353677224
Params: [('obj', 'ahBicmlkZ3ktZmVkZXJhdGVkcmoLEgZPYmplY3QiXnNuYXJmZWQub3JnL2ZvbGxvd2VycyNhY2NlcHQtaHR0cHM6Ly9zaXJvbmkudGsvYWN0aXZpdGllcy9mMDM4ZmI1ZC1kODBhLTQ1NDAtOWEzZi0xYzdkNzIxODcyZWUM'), ('protocol', 'activitypub'), ('url', 'https://sironi.tk/users/luca/inbox'), ('user', 'ahBicmlkZ3ktZmVkZXJhdGVkchkLEghNYWdpY0tleSILc25hcmZlZC5vcmcM')]
Sending None accept snarfed.org/followers#accept-https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee to activitypub https://sironi.tk/users/luca/inbox
No matching protocol found for snarfed.org/followers#accept-https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee !
Signing with snarfed.org 's key
requests.post https://sironi.tk/users/luca/inbox {'data': {"id":"https://fed.brid.gy/r/snarfed.org/followers#accept-https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee","actor":"https://fed.brid.gy/snarfed.org","@context":"https://www.w3.org/ns/activitystreams","type":"Accept","object":{"actor":"https://sironi.tk/users/luca","id":"https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee","state":"pending","url":"https://sironi.tk/users/luca#followed-snarfed.org","type":"Follow","object":"https://fed.brid.gy/snarfed.org","to":["snarfed.org"]},"to":["https://www.w3.org/ns/activitystreams#Public"]}'}
Received 400: "Invalid request."
400 Client Error: Bad Request for url: https://sironi.tk/users/luca/inbox ; "Invalid request."
  File "/layers/google.python.pip/pip/lib/python3.11/site-packages/oauth_dropins/webutil/util.py", line 1698, in call
     resp.raise_for_status()
  File "/layers/google.python.pip/pip/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
     raise HTTPError(http_error_msg, response=self)
Error 502, response body: '<p>400 Client Error: Bad Request for url: https://sironi.tk/users/luca/inbox ; &#34;Invalid request.&#34;</p>'

@snarfed
Copy link
Owner Author

snarfed commented Sep 13, 2024

Here's an Accept we sent just now for the same affected user (me) as above in #12 (comment). This one also didn't reproduce, both tos are ok.

{
  "id": "https://fed.brid.gy/r/snarfed.org/followers#accept-https://s3th.me/0df470b2-b240-42f8-8efa-dffa9d13834c",
  "actor": "https://fed.brid.gy/snarfed.org",
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Accept",
  "object": {
    "id": "https://s3th.me/0df470b2-b240-42f8-8efa-dffa9d13834c",
    "actor": "https://s3th.me/users/pch",
    "url": "https://s3th.me/users/pch#followed-snarfed.org",
    "type": "Follow",
    "object": "https://fed.brid.gy/snarfed.org",
    "to": ["https://www.w3.org/ns/activitystreams#Public"]
  },
  "to": ["https://www.w3.org/ns/activitystreams#Public"]
}

@snarfed
Copy link
Owner Author

snarfed commented Sep 13, 2024

Finally reproduced it. Not sure what I should put in the outer activity's to though. Matching the object's to doesn't make sense since that's the followee. Maybe the follower? Or maybe public will work once the inner to is valid?

@qazmlp
Copy link

qazmlp commented Sep 13, 2024

Finally reproduced it. Not sure what I should put in the outer activity's to though. Matching the object's to doesn't make sense since that's the followee. Maybe the follower? Or maybe public will work once the inner to is valid?

I'd put the follower in "to" (since the Accept is a sort of response to their action) and …#Public in "cc" (also visible to, but never loudly notified about it), intuitively speaking.

@snarfed
Copy link
Owner Author

snarfed commented Sep 13, 2024

Yes! ...sadly that didn't work though, either with or without cc. I've tried a number of different other shapes for this Accept now too, but sironi.tk has 400ed on every one so far. I may have to give up for now.

Here are a few, first with full object, matching to, and cc public:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Accept",
  "id": "https://fed.brid.gy/r/snarfed.org/followers#accept-2-https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee",
  "actor": "https://fed.brid.gy/snarfed.org",
  "object": {
    "type": "Follow",
    "id": "https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee",
    "object": "https://fed.brid.gy/snarfed.org",
    "actor": "https://sironi.tk/users/luca",
    "state": "pending",
    "url": "https://sironi.tk/users/luca#followed-snarfed.org",
    "to": ["https://fed.brid.gy/snarfed.org"]
  },
  "to": ["https://sironi.tk/users/luca/inbox"],
  "cc": ["https://www.w3.org/ns/activitystreams#Public"]
}

...and also ^ without cc...

...and also with just the follow id in object:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Accept",
  "id": "https://fed.brid.gy/r/snarfed.org/followers#accept-2-https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee",
  "actor": "https://fed.brid.gy/snarfed.org",
  "object": "https://sironi.tk/activities/f038fb5d-d80a-4540-9a3f-1c7d721872ee",
  "to": ["https://fed.brid.gy/snarfed.org"]
}

🤷 🤷 🤷

@snarfed snarfed removed the now label Sep 13, 2024
@syobocat
Copy link

@snarfed
Copy link
Owner Author

snarfed commented Oct 17, 2024

Ugh, that's a new problem causd by #1331. Thank you for filing the Pleroma bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests