misskey-dev / misskey

🌎 An interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
9.74k stars 1.31k forks source link

Make instances block more lenient #9258

Closed tamaina closed 1 year ago

tamaina commented 1 year ago

Summary

インスタンスブロック(blockedHosts)の検査をもう少し広範にする
現状、インスタンスブロック設定はblockedHosts.includes(targetHost)のように検査されており、ワイルドカード等には非対応で等しいものしかブロックできない。

blockedHosts.someでendsWithとかincludesなどで検査するようにしたい。

tamaina commented 1 year ago

https://github.com/mastodon/mastodon/issues/11558

MastodonはendsWithっぽい

tamaina commented 1 year ago

SQLのWhereでNOT blockedHosts.some(x => x.endsWith(targetHost))ってどうやって表現するんだろう

tamaina commented 1 year ago

FoundKeyだとRegExpでゴニョゴニョやってるわね

https://akkoma.dev/FoundKeyGang/FoundKey/src/commit/18cf228f893806e690be37729c75d66b32080784/packages/backend/src/misc/skipped-instances.ts

tamaina commented 1 year ago

https://akkoma.dev/FoundKeyGang/FoundKey/pulls/269/files

FoundKey、RegExp(ワイルドカード)やめるらしいぜ