Compatibility between Nextcloud Social app and Pleroma
I am trying to make the Nextcloud Social app working with Pleroma, but I am facing an issue when doing any request on any instance of Pleroma.
on my side
Let's say I want to follow a remote account (cult@bruno.artificial-owl.com), this is the generated ActivityPub object
Now, the generated signature:
"content-length: 259\ndate: Tue, 09 Jul 2019 13:06:58 GMT\ndigest: SHA-256=WGKUoFQkXhr5Sreg0JFgzwsVI\/JGpNEcGSZDUtAfhF0=\nhost: bruno.artificial-owl.com"
And the signed header:
keyId="https://test.artificial-owl.com/index.php/apps/social/@cult#main-key",algorithm="rsa-sha256",headers="content-length date digest host",signature="HQ6ig9SkckBYn2aP6ZKva0RBLTgOLEfX3vXfV7NszSavM4hsNovg4e7BDrHbut6GhOO3UzrlQvj8gCqvj0OD7YupEldFvrLP5n3HfEvYsdFTugc+XTiM0jl9tcywQdxXCHkD+SIOfFuUudGjjYg/M9ijUiPsgcrSyh6sV6eUhgKifZVrCERGFTRDi/tnc2SZJRhvhR7aP12bznVuHVm3fJmDMqZNOfWymwNCp26as9yOnIWmUWd5BriyXoWagngbl1IECVBca2Wu4hEwfJCYkbhPrLVXxJEioa6zz+jPSvfbqA5s48zmdr1CB1GFZNKV46+qFTM/OhtYi8C48c0zgQ=="
Please find some more info about the request:
{
"protocol": "https",
"host": "bruno.artificial-owl.com",
"headers": [
"Content-length: 259",
"Host: bruno.artificial-owl.com",
"Date: Tue, 09 Jul 2019 13:06:58 GMT",
"Digest: SHA-256=WGKUoFQkXhr5Sreg0JFgzwsVI/JGpNEcGSZDUtAfhF0=",
"Signature: keyId=\"https://test.artificial-owl.com/index.php/apps/social/@cult#main-key\",algorithm=\"rsa-sha256\",headers=\"content-length date digest host\",signature=\"HQ6ig9SkckBYn2aP6ZKva0RBLTgOLEfX3vXfV7NszSavM4hsNovg4e7BDrHbut6GhOO3UzrlQvj8gCqvj0OD7YupEldFvrLP5n3HfEvYsdFTugc+XTiM0jl9tcywQdxXCHkD+SIOfFuUudGjjYg/M9ijUiPsgcrSyh6sV6eUhgKifZVrCERGFTRDi/tnc2SZJRhvhR7aP12bznVuHVm3fJmDMqZNOfWymwNCp26as9yOnIWmUWd5BriyXoWagngbl1IECVBca2Wu4hEwfJCYkbhPrLVXxJEioa6zz+jPSvfbqA5s48zmdr1CB1GFZNKV46+qFTM/OhtYi8C48c0zgQ==\""
],
"url": "/users/cult/inbox",
"timeout": 3,
"type": 1,
"data": {
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://test.artificial-owl.com/d8beee93-aa2a-4e8d-be73-31fee3087873",
"type": "Follow",
"actor": "https://test.artificial-owl.com/apps/social/@cult",
"object": "https://bruno.artificial-owl.com/users/cult"
}
}
(type=1 means POST)
on Pleroma
And now the result I have on my instance of pleroma:
[info] POST /users/cult/inbox
[debug] Processing with Pleroma.Web.ActivityPub.ActivityPubController.inbox/2
Parameters: %{"nickname" => "cult", "{\"@context\":\"https://www.w3.org/ns/activitystreams\",\"id\":\"https://test.artificial-owl.com/166911a2-27e4-431d-a939-e8636244fae6\",\"type\
":\"Follow\",\"actor\":\"https://test.artificial-owl.com/apps/social/@cult\",\"object\":\"https://bruno.artificial-owl.com/users/cult\"}" => nil}
Pipelines: [:activitypub]
[debug] Checking sig for
[error] Internal server error: %ArgumentError{message: "argument error"}
[info] Sent 500 in 712µs
[info] Converted error :badarg to 500 response
[error] #PID<0.20573.1> running Pleroma.Web.Endpoint (connection #PID<0.20572.1>, stream id 1) terminated
Server: bruno.artificial-owl.com:80 (http)
Request: POST /users/cult/inbox
** (exit) an exception was raised:
** (ArgumentError) argument error
(stdlib) :binary.match("keyId=\"https://test.artificial-owl.com/index.php/apps/social/@cult#main-key\",algorithm=\"rsa-sha256\",headers=\"content-length date digest host\",si
gnature=\"oD0WWAbDB7wIA/8QPLQ7KCADdpHhllvwbDVQWVfan9qxyENB6EUtiWq0/ESZZZg4TiA2rBpEX308Jv9+QQ6vDmPtZwCxbLacTzENMZiU8VOueXOzWhk20ww4wfMp5xoL/unDaYY3WBmt3YZEhsoC7mzYMUJVRNH7KwSlatDmlAEG
VHGMyt+Wzej+5j2v1Hem0vipzTpvkBHwiJqoqik6S26QvtukJXoHkQsqa30xLqvpUm5f9o08NDmJrnW1IwkecZwPELwhRfV5AOSUGAGDK83WiSwgJhHUJSYXXrKpRsvnwhksPzYFEQhhPVj15hVKXNe3A2VFnWg8c0muZf2hWg==\"", nil)
(elixir) lib/string.ex:2089: String.contains?/2
(pleroma) lib/pleroma/plugs/http_signature.ex:24: Pleroma.Web.Plugs.HTTPSignaturePlug.call/2
(pleroma) lib/pleroma/web/router.ex:613: Pleroma.Web.Router.activitypub/2
(pleroma) lib/pleroma/web/router.ex:5: Pleroma.Web.Router.__pipe_through19__/1
(phoenix) lib/phoenix/router.ex:275: Phoenix.Router.__call__/2
(pleroma) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.plug_builder_call/2
(pleroma) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.call/2
Spent already a lot of time on this one, please help !