Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
此PR为wxwClub添加了基本的blocklist管理功能:
动机
昨天 board 公共留言板遭遇恶意用户发送多条骚扰信息。另外我在日常浏览中曾多次看到有用户抱怨board被滥用。所以实现并提出了此PR。如果通过测试并实装,希望能够减少对board的滥用。
新增功能
实例屏蔽包括实例域名和该域名下所有子域,屏蔽检查发生在
Club_Announce_Process
时,对actor进行blocklist匹配。数据库变更
创建新表
users_blocks
和instances_blocks
。由于wxwClub目前只有单个SQL文件,不提供迁移支持,在创建新表的指令前添加了对应注释和日期以供区分。cli.php
中添加了新的命令行选项,用于管理屏蔽列表src/function.php
中实现了屏蔽相关的核心功能users_blocks
和instances_blocks
表CLI 变更
添加以下 CLI 命令来管理 blocklist:
php cli.php block user <user> [<club>]
php cli.php block instance <instance> [<club>]
php cli.php unblock user <user> [<club>]
php cli.php unblock instance <instance> [<club>]
php cli.php list-blocks [<club>]
php cli.php export-blocks [<club>]
php cli.php import-blocks <user|instance> <file_path> [<club>]
TODO
Reject
回应或在特定endpoint公开blocklist。