Misskey: Can't follow Peertube & Pixelfed Users

Created on 14 Jan 2020  ·  6Comments  ·  Source: syuilo/misskey

💡 Summary

I recently installed a Misskey instance, it's really great :) but I can't follow Peertube and Pixelfed users.

🙂 Expected Behavior

Following success

☹️ Actual Behavior

This has already been discussed here : https://github.com/syuilo/misskey/issues/3996#issue-403448950 and https://github.com/syuilo/misskey/issues/3781#issue-394556635 for pixelfed but obviously the problem persists

Instances return 403 errors for Peertube and 500 errors for Pixelfed.

Example : [queue.deliver] failed (500 Internal Server Error) id=4751 attempts=1/8 age=169ms to=https://pixelfed.social/users/KazukyAkayashi/inbox

📝 Steps to Reproduce

  1. Searh user (pixelfed or peertube)
  2. Follow user
⚠️bug? 🌌Federation

All 6 comments

どうせGoogle翻訳通すだけなので日本語で書いちゃう。

Test with PeerTube (v2.0.0)
PeerTube (v2.0.0) と通信してみたところほぼあっち側に原因があるかなと

1. PeerTube's publicKey validation

MisskeyがActivityを送る => PeerTubeがActivityのActorを検証する際に
MisskeyのKey形式をrejectしてしまう
https://github.com/Chocobozzz/PeerTube/blob/f8b65c22a9cbf60a1d359c6aa2744baede1ee05f/server/helpers/custom-validators/activitypub/actor.ts#L30-L31

PeerTube expects...

-----BEGIN PUBLIC KEY-----
-----END PUBLIC KEY-----

but, Misskey send

-----BEGIN RSA PUBLIC KEY-----
-----END RSA PUBLIC KEY-----

2. PeerTube's request header

PeerTubeからAccept Follow Activityを送り返す際に、Signatureのヘッダ形式が間違っている

x signature: Signature keyId=
o signature: keyId=

ただこれはPeerTubeのdevelop branchでなおっている可能性がある
https://github.com/Chocobozzz/PeerTube/commit/e92269053e3fd0e9b9c155ded86a1668444f3d70

3.PeerTube's Activity id

PeerTubeからAccept Follow Activityを送り返す際に、Activity idが間違っている
actorと同じホストを指さないといけない
Mastodonで動いているのは下のLD-Signatureを検証してくれてるからかも
image

あともう1個 (4つめ)
MastodonとMisskeyはActor/ActorKeyのURIの形式が違ってて

Misskey
actor: /users/:userId
keyId:   /users/:userId/publickey

Mastodon
actor: /users/:userId
keyId:   /users/:userId#main-key

MisskeyはActivityのkeyIdとして別のURLを参照するけど
おそらくPeerTubeはactorと同じ形式でkeyIdを返すことを期待しているのでうまくいかないみたい。
ActivityPubでkey周りをどうするかの標準仕様が見当たらないのでどれが正しいのかわからない。

上の4つ目のkeyIdについて補足すると
Activityを送ったときにhttp-signatureのkeyIdのURIを指定できるのですが
そのkeyIdの実態を何にするかがおそらく仕様上あいまいで

Misskeyはtype=KeyなるObjectを返しますが

  id: 'https://mk10.~/users/5dcd660b9c3d987828856fcb/publickey',
  type: 'Key',
  owner: 'https://mk10.~/users/5dcd660b9c3d987828856fcb',
  publicKeyPem: '-----BEGIN RSA PUBLIC KEY-----

MastodonはActorそのものを返します
(/users/:userId#main-key なのでHTTPリクエスト的には同じものを指しているため)

Mastodonはどちらの種類が返されてもいいようになってるみたいですが
https://github.com/tootsuite/mastodon/pull/4630

おそらくPeerTubeはMastodonのようにActorそのものを返すことを想定しているみたいなので、うまくいかないみたいです。

ちなにみに、MisskeyはkeyIdのURIにリクエストすることはなく
DB上にActorとkeyIdの組み合わせを持っているためそれと突き合わせています。

この部分に関しては、PeerTubeで両方を想定する or MisskeyでkeyIdの先でActorそのものを返すようにする などをする必要があると思います。

  1. PeerTube's publicKey validation

について
BEGIN RSA PUBLIC KEY => PKCS#1
BEGIN PUBLIC KEY => PKCS#8

Mastodon/PeerTube は PKCS#8 を使っていて
Misskey は PKCS#1 を使っているみたいです

3つどの実装も両方の形式を解釈できるみたいですが
PeerTubeは上のあるように文字列として検証して弾くみたいです
PeerTubeで上の検証部分をスキップするとKeyの検証は通るみたい

PixelFedは

  • publicKeyPemの形式を PKCS#1 => PKCS#8
  • keyIdを#main-key形式

にすることでフォローできるみたい

↪️ With Misskey v12

Peertube Update
Peertube instances (v2.1.x) no longer return 403 but it is still impossible to follow a user, the following button loops and stays on "processing in progress" 🤔

Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[remote resolve-user]#011WebFinger for [email protected]
Apr  4 17:00:38 nodejs-2 misskey[464]: DONE 1#011[remote resolve-user]#011return new remote user: [email protected]
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[remote ap]#011Creating the Person: https://videos.pair2jeux.tube/accounts/lecygnenoir
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[remote ap]#011Creating the Image: https://videos.pair2jeux.tube/lazy-static/avatars/06668f16-658a-477f-817f-e664f334e91d.png
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[download]#011Downloading https://videos.pair2jeux.tube/lazy-static/avatars/06668f16-658a-477f-817f-e664f334e91d.png ...
Apr  4 17:00:38 nodejs-2 misskey[464]: DONE 1#011[download]#011Downloaded to: /tmp/tmp-1227WbR7q9gJ5551
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[nodeinfo]#011Fetching nodeinfo of videos.pair2jeux.tube ...
Apr  4 17:00:38 nodejs-2 misskey[464]: DONE 1#011[download]#011Download finished: https://videos.pair2jeux.tube/lazy-static/avatars/06668f16-658a-477f-817f-e664f334e91d.png
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[chart]#011users (hour): New commit created
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[drive register]#011{"size":10159,"md5":"980a47ae537a845a8ce3233e3e38b7eb","type":{"mime":"image/png","ext":"png"},"width":120,"height":120,"avgColor":[150,148,148],"warnings":[]}
Apr  4 17:00:38 nodejs-2 misskey[464]: DONE 1#011[nodeinfo]#011Successfuly fetched nodeinfo of videos.pair2jeux.tube
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[drive register]#011web image not created (from remote)
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[drive register]#011thumbnail stored: thumbnail-8beef953-b208-49ae-98ca-be4bab198a94
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[chart]#011instance:videos.pair2jeux.tube (day): New commit created
Apr  4 17:00:38 nodejs-2 misskey[464]: INFO 1#011[chart]#011instance:videos.pair2jeux.tube (hour): New commit created

Pixelfed
Pixelfed instances always return an error 500 ☹️

[queue.deliver] failed(500 Internal Server Error) id=117112 attempts=3/12 age=4m to=https://pxlmo.com/users/peter/inbox
Was this page helpful?
0 / 5 - 0 ratings