misskey-dev / misskey

🌎 A completely free and open interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
9.93k stars 1.34k forks source link

HTTP接続を明示的にサポート対象外にする提案 #14528

Open KisaragiEffective opened 3 weeks ago

KisaragiEffective commented 3 weeks ago

動機

最近のブラウザーは"Secure Context"-onlyなAPIを提供することがある。これはソースコードの字句的に明らかではなく、またそうでないように見えても実際にはそうであることがあり、一見すると不可解なランタイムエラーが生じることがある。 これを回避するためにはwindow.isSecureContexttrueのときのみ呼び出せばよいが、おそらく大規模な改修が必要となる上、継続的な開発で意識するのは難しい。

幸い、Secure Contextではないとしてみなされるほとんどのケースは宛先がローカルホストではないHTTP接続だけである。 現代ではCloudflareやLet's EncryptなどでSSL証明書を無料で取得し、かつSaaSやPaaSがそれを自動で適用する設定を備えていることを踏まえると、黙示的にせよHTTP接続をサポートすることは合理的ではないと考える。

related: #14527 #14366

提案

そこで、バグレポート、issue、Discussionの運用方針としてホストするサーバーとの接続がHTTPである場合、それらはnot plannedとして閉じても良い運用方針を追加することを提案する。 ただし、内容によっては非Secure Contextに起因しないことがある。その場合は従前通りの運用とすることを提案する。

kakkokari-gtyih commented 2 weeks ago

もしくは window.isSecureContext がない場合は「一部の機能が正常に動作しない可能性があります」みたいな表示を出すとか(表示が出てるのにバグ報告が来る可能性はあるけど)

temtemy commented 1 week ago

I disagree with dropping support for http in code. As I pointed out in #14606 this will exclude operators who also serve Misskey via hidden networks like Tor and Yggdrasil, where HTTPS is unnecessary (and in the case of Tor is even tricky to get a TLS certificate for). I run one in Yggdrasil, with the hostname both in the IPv6 form and meshname DNS (both of which would be impossible to get working TLS on).

Maybe it should be done like allowedPrivateNetworks in .config/default.yml, where operators can set IP ranges it would allow Misskey to run in plain HTTP. Loopback should always be allowed (which is enough for Tor), and those serving via Yggdrasil can allow 200::/7.

temtemy commented 1 week ago

However I can agree with closing issues in this bug tracker if it's related to "Secure Context" and it only happens in HTTP mode. Though I wonder if that's really necessary as I don't think there are anyone out there who would want to serve Misskey completely unencrypted (so no encryption at all either in the application or network level). Okay maybe I do but I'd be insane to allow completely unencrypted HTTP when there's a logged in session...

syuilo commented 1 week ago