drawpile-monitor - automod for Drawpile servers
Set up an environment and install the dependencies into it:
python -m venv env
. env/bin/activate
pip install -r requirements.txt
Copy the config file template:
cp config.template.ini config.ini
Open the config file and fill in the required information. There's comments inside the file to guide you.
Now you can run this thing:
. env/bin/activate
export DRAWPILE_MONITOR_USER='<WEB ADMIN USERNAME GOES HERE>'
export DRAWPILE_MONITOR_PASS='<WEB ADMIN PASSWORD GOES HERE>'
# To do a dry-run (makes checks and reports to Discord, but does not act):
./drawpile-monitor.py --dryrun
# To run it once:
./drawpile-monitor.py
# To check every 10 seconds:
./drawpile-monitor.py --interval=10
# To check randomly between 20 and 60 seconds (to avoid counter-scripting)
./drawpile-monitor.py --interval=20 --jitter=40
This will hit drawpile-srv's web admin API and check for profanity and other banned words in session titles, session aliases and usernames.
Sessions with bad titles will get two warnings and their tile will be changed to a generic "Session #". On the third infraction, they will be terminated.
Sessions with bad aliases will get terminated immediately, since those can't be changed after the fact.
Users with bad names will get kicked and the session they're in will be notified about it.
It optionally reports the stuff it did to a Discord webhook.
You can check what drawpile-monitor would consider offensive by running
./test-offensive.py
and typing in the stuff you want to check. It will give
you a breakdown of the profanity check along with the final verdict based on
those.
If something is getting falsely flagged, you can use this to figure out where it's going wrong so that you can adjust the right knobs.
Licensed under the MIT license, see the LICENSE file for details.
Drawpile: https://drawpile.net/