-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add Join Wave Short-Circuit Protection #280
Conversation
d3cb15f
to
4634ac2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is nice, just a couple of questions though
Will we have to manually activate this protection in all rooms? Or will it be added automatically once the bot is updated? |
If this PR gets merged, and a new release includes this, you will have to enable it using However, you can deploy this early by checking out the PR branch, and building the docker image (if you are using that) yourself. I recommend asking about this in the mjolnir room, though. |
given this makes no existing tests fail and a protection like this is time-critical, i think i'm going to merge this shortly |
This partially addresses #267
This adds
JoinWaveShortCircuit
, a protection which will set the room to invite-only as soon as X amount of users (default 50) join the room in the last X minutes (default 60).The protection works with a Bucket, starting the bucket at first join, and only counting users if its been X minutes since the last bucket start.
(The reasoning for this particular approach is likely sensitive (in relation to other protections), so please reach out if you'd like to hear it.)
It has two settings;
maxPer
, which determines how many users will have to join in the last X minutes before it will trigger the protection.timescaleMinutes
, the timescale in X minutes, this determines on what time scale the bot will look at joins.This adds a status command to the protection, with optional subcommands
withExpired
andwithStart
, to debug buckets and/or give more information.Rationale
This is auto-moderation for a particular problem; Join-spam waves often come when a moderation can be inactive, busy, or otherwise unable to immediately respond. It often fills a room with hundreds of users within a few minutes. This protection is meant to "short-circuit" the wave, and keep it relatively contained for moderators to assess and clean up afterwards.
Usage
Use
!mjolnir enable JoinWaveShortCircuit
to enable this protection for all your protected rooms.Then, run
!mjolnir verify
to make sure the bot has join_rules permissions in all relevant rooms. (Note: due to technical reasons, the bot will currently not check this on startup, #290 tracks this problem)Tweak with
!mjolnir config set JoinWaveShortCircuit.maxPer 50
andJoinWaveShortCircuit.timescaleMinutes 60
to your preference.