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

pub-relay #6341

Merged
merged 7 commits into from May 10, 2020
Merged

pub-relay #6341

merged 7 commits into from May 10, 2020

Conversation

mei23
Copy link
Contributor

@mei23 mei23 commented May 10, 2020

Summary

Resolve #2443

@mei23
Copy link
Contributor Author

mei23 commented May 10, 2020

メモ
リレー配送時のHTTP-Signatureの署名者がMastodonと違うぽい

リレーに配送するときは、HTTP-Signature と LD-Signature の2つの署名が付く
HTTP-Signatureはいわゆるピア間の署名で、発信元とリレーの間でのみ通用する署名。
LD-Signatureはいわゆるメッセージ署名で、この署名を付けて転送すれば第3インスタンスでも照合できる署名。

で、それぞれ誰の鍵で署名するかと言うと、LD-Signatureはもちろん投稿者本人の鍵で署名する。
HTTP-Signatureを誰の鍵で署名するかは、投稿者の鍵 or リレーする特殊ユーザーの鍵 が考えられる。

今Misskeyは、リレーする特殊ユーザーの鍵で署名する。
Mastodonは、投稿者の鍵で署名する。(ただこれは初期実装時にリレーする特殊ユーザーがいなかったからこれしか選択肢がなかったのかもしれない)

ほとんどの実装でどちらでも大丈夫だが、稀にHTTP-Signatureの署名者がLD-Signatureと違うと不具合が出ることがある。

@u1-liquid

This comment has been minimized.

@mei23
Copy link
Contributor Author

mei23 commented May 10, 2020

nodeinfoは全然Relayと関係ないですね

@@ -349,6 +350,10 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
dm.addFollowersRecipe();
}

if (['public', 'home'].includes(note.visibility)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Homeは送らなくて良さそう

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mastodon の未収載と違ってタグタイムラインに載るし流した方がよさそう?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

うーん悩む

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なんかHome以下転送しないリレー実装もありそうだったから無効にしてしまった

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あーAnnounceをHome扱いにすることがあるからやっぱりHome送ったほうがいいかも

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

どうせ今の状態だとHome投稿をPublicでRenoteした時に飛んでくし…

@mei23
Copy link
Contributor Author

mei23 commented May 10, 2020

リレーのActorはApplicationに

@mei23
Copy link
Contributor Author

mei23 commented May 10, 2020

なんかkoa-compressがAccept-Encoding指定なしで、Content-Encoding: gzip でボディの中身がgzipじゃなさそうな謎バイナリ返してきてあやしいので無効に

@mei23
Copy link
Contributor Author

mei23 commented May 10, 2020

Homeはリレーに送らないように

@mei23 mei23 marked this pull request as ready for review May 10, 2020 09:03
@syuilo
Copy link
Member

syuilo commented May 10, 2020

アカウント作成処理、src\server\api\common\signup.ts と共通化できるかな

@syuilo
Copy link
Member

syuilo commented May 10, 2020

↑あとで私がやる

@mei23
Copy link
Contributor Author

mei23 commented May 10, 2020

共通化すると分岐だらけになりそうなのでやめた

@syuilo
Copy link
Member

syuilo commented May 10, 2020

なるほど👀
じゃあいいか

@mei23
Copy link
Contributor Author

mei23 commented May 10, 2020

src\server\api\common\signup.ts のkeyPair作るところはまとめられるけどやってない

src/services/relay.ts Outdated Show resolved Hide resolved
@syuilo syuilo merged commit 1453897 into misskey-dev:develop May 10, 2020
@syuilo
Copy link
Member

syuilo commented May 10, 2020

👍👍👍

@mei23 mei23 deleted the mei-a0510-pub-relay-v12 branch May 15, 2020 17:14
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

Successfully merging this pull request may close these issues.

pub-relayサーバーを利用できるように
4 participants