diff --git a/CHANGELOG.md b/CHANGELOG.md index b84478f..f705852 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ The format is based on [Semantic Versioning](https://semver.org/). ### Added - GitHub Actions workflow (`.github/workflows/deploy.yml`): pull requests into `main` are checked (all Python files must compile), and merging into `main` updates and restarts the bot on the server over SSH through `tools/deploy.sh`, using a key that can only run that script. Setup: `docs/deploy.md`. +### Fixed +- Anyone logged in with a shared account (e.g. `murid`) could delete that account for everyone with `/du murid` + `y`, because the bot treated it as deleting their own account. Accounts listed in the new `SHARED_ACCOUNTS` setting (default `tamu`, `murid`, `hadirin`, `osis`, `guest`) cannot be deleted via the bot, not even by admins. +- Join/login spam detection counted everyone on a shared account behind one IP (all students on `murid` from the school network) as one person. For shared accounts it now tells people apart by nickname + IP. +- Channels created by a shared account (owned by e.g. `murid`) could be deleted or given away by anyone on that account. Non-admin shared accounts can no longer create, delete or transfer channels via the bot; admin accounts (`pemateri`, `F.OSIS`) keep their admin rights. `pemateri` and `f.osis` are in the default `SHARED_ACCOUNTS`. + ### Changed - The shipped badword list is now `badwords/default_words.txt`; `badwords/words.txt` (with the admins' `/bwa`/`/bwd` edits) is git-ignored and created from the default list on first run, so updates no longer conflict with or overwrite those edits. - `TeamTalkBot.service` is a template for a non-root account and logs to the journal. diff --git a/README.md b/README.md index 97c108a..be91f25 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ All settings live in `config.json`. Highlights: | **Lifecycle** | `CHANNEL_INACTIVITY_TIMEOUT` (`{"value": X, "unit": "days"}`), `CHANNEL_DELETION_WARNING_SECONDS` | | **Channel Rules** | `CHANNEL_CREATION_MAX_PER_USER`, limit/block messages, `CHANNEL_CREATION_BLOCKED_USERNAMES` | | **Registration** | `REGISTRATION_ALLOWED_USERNAMES`, per-IP limits/messages | +| **Shared accounts** | `SHARED_ACCOUNTS` – accounts many people log in with (default `tamu`, `murid`, `hadirin`, `osis`, `pemateri`, `f.osis`, `guest`): not deletable via the bot, moderation tells their users apart by nickname + IP, and unless they are admin accounts they cannot create, delete or transfer channels via the bot | | **Abuse Throttling** | `ABUSE_LOGIN_ENABLED`, `ABUSE_JOIN_ENABLED`, `ABUSE_LOGIN_COUNT`, `ABUSE_JOIN_COUNT`, `BADWORD_ABUSE_COUNT`, `ABUSE_WINDOW_SEC`, `ABUSE_TEMP_BAN_MINUTES`, `BAN_TARGET`, `ABUSE_WHITELIST_FILE`, warning message arrays | | **Message Anti-Spam** | `ANTISPAM_MESSAGE_ENABLED`, `ANTISPAM_MESSAGE_COUNT`, `ANTISPAM_MESSAGE_WINDOW_SEC`, `ANTISPAM_INTERCEPT_TYPES`, `ANTISPAM_IGNORE_ADMINS`, warning message arrays | | **Badwords** | `BADWORDS_ENABLED`, `BADWORDS_INTERCEPT_TYPES` (`"PRIVATE"`, `"CHANNEL"`, `"BROADCAST"`), `BADWORDS_FILE`, `BADWORDS_IGNORE_ADMINS`, `BADWORDS_PROFILE_CHECK_ENABLED` | diff --git a/config.py b/config.py index 74d2743..2168cf9 100644 --- a/config.py +++ b/config.py @@ -89,6 +89,12 @@ CHANNEL_CREATION_BLOCKED_MESSAGE: str = "You are not permitted to create channels." REGISTRATION_ALLOWED_USERNAMES: List[str] = ["guest"] REGISTRATION_NOT_ALLOWED_MESSAGE: str = "You already have a registered account and do not need to register again." +# Accounts that many people log in with. They cannot be deleted via the bot, +# moderation tells their users apart by nickname + IP instead of username, and +# (unless they are admin accounts) they cannot create or manage channels. +SHARED_ACCOUNTS: List[str] = [ + "tamu", "murid", "hadirin", "osis", "pemateri", "f.osis", "guest", +] REGISTRATION_IP_LIMIT: int = 1 REGISTRATION_IP_WINDOW_MINUTES: int = 2880 REGISTRATION_IP_LIMIT_MESSAGE: str = "Account creation failed: your IP has reached the registration limit. Please try again later." @@ -173,6 +179,7 @@ "CHANNEL_CREATION_BLOCKED_MESSAGE": CHANNEL_CREATION_BLOCKED_MESSAGE, "REGISTRATION_ALLOWED_USERNAMES": REGISTRATION_ALLOWED_USERNAMES, "REGISTRATION_NOT_ALLOWED_MESSAGE": REGISTRATION_NOT_ALLOWED_MESSAGE, + "SHARED_ACCOUNTS": SHARED_ACCOUNTS, "REGISTRATION_IP_LIMIT": REGISTRATION_IP_LIMIT, "REGISTRATION_IP_WINDOW_MINUTES": REGISTRATION_IP_WINDOW_MINUTES, "REGISTRATION_IP_LIMIT_MESSAGE": REGISTRATION_IP_LIMIT_MESSAGE, diff --git a/docs/index.html b/docs/index.html index f992a81..cfa517c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -81,6 +81,7 @@

Channel Creation Rules

Registration Policy