-
Notifications
You must be signed in to change notification settings - Fork 5
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 a little tutorial for how to configure protections. #43
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Configuring protections | ||
|
||
This is a tutorial that aims to guide a moderator through configuring | ||
a protection. We use the `JoinWaveShortCircuitProtection` in the | ||
examples, but the steps are the same for every protection. | ||
|
||
## Displaying the protection settings | ||
|
||
Each protection can provide different configuration options, which are | ||
sometimes also referred to as _protection settings_. The command that | ||
is used to view these settings | ||
|
||
To display an overview for a protection's protection settings, you can | ||
use the `!draupnir protections show <protection name>` command. If you | ||
don't know the name of the protection that you are trying to find, you | ||
can copy the name from the list provided when using the `!draupnir | ||
protections` command. | ||
|
||
So for the `JoinWaveShortCircuitProtection`, the command would look | ||
like this: | ||
|
||
`!draupnir protections show JoinWaveShortCircuitProtection`: | ||
|
||
**Protection Settings** | ||
|
||
- `maxPer`: The maximum number of users that can join a room in the | ||
timescaleMinutes timescale before the room is set to invite-only. | ||
default value: 50 (number) | ||
|
||
- `timescaleMinutes`: The timescale in minutes over which the maxPer | ||
users can join before the room is set to invite-only. | ||
|
||
As you can see, we are provided with a short description of each | ||
setting, and the setting's name that we can copy into a command. | ||
|
||
## Changing protection settings | ||
|
||
Let's consider adjusting the protection settings for the | ||
`JoinWaveShortCircuitProtection`. If we have a particularly inactive | ||
room, we might want to reduce the timesacale and the maximum number of | ||
joins within it a little. | ||
|
||
To do this, we can use the `!draupnir protections config set | ||
<protection name> <property name>` command. | ||
|
||
`!draupnir protections config set JoinWaveShortCircuitProtection | ||
maxPer 5` would set the `maxPer` setting to just 5 joins. And | ||
`!draupnir protections config set JoinWaveShortCircuitProtection | ||
timescaleMinutes 10` would make sure that a maximum of 5 joins is | ||
allowed over a period of 10 minutes before triggering the short | ||
circuit. | ||
|
||
### Managing sets | ||
|
||
Some protections have settings that are a set of values. The | ||
`TrustedReporters` protection has a setting like this. | ||
|
||
- `mxids`: The users who are marked as trusted reporters. default | ||
value: [] (empty array) | ||
|
||
To manage the list, we can use the `!draupnir protections config <add/remove> <protection name> <property name>` command. | ||
|
||
So to add a user to the list of trusted reporters, we would use | ||
`!draupnir protections config add TrustedReporters mxids | ||
@alice:example.com`, and to remove a user `!draupnir protections | ||
config remove TrustedReporters mxids @alice:example.com`. |
Oops, something went wrong.
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.
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.
Kitty has reviewed and cant find too many flaws. But kitty is tired. Still looks acceptable to this tired kitty.
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.
Thank you Cat, and yeah, we'll see once it's in.