Repository navigation
Moderation: queue, actions, appeals, audit log, retention - #23
Merged
Merged
Conversation
AlxcBTW
force-pushed
the
feat/moderation
branch
from
October 24, 2026 13:56
385fc68 to
3ce5f90
Compare
…etention Moderators are accounts with a role (the admin token stays for bootstrap). Warnings, mutes and bans carry a rule and a reason the player reads, as a statement of reasons on the connection, at GET /v1/me/actions and in the banned error. One appeal per action, decided by a different moderator when there is one. Every step goes to an append-only audit log. Reports keep a snapshot and survive account deletion. Bans, actions, reports and the log are swept after configurable periods (default 6 months). Ban e-mail hashes are keyed. Accounts younger than 24 h cannot send friend requests.
…sts on day one new_account_hours now covers messages (replacing stranger_min_age_hours) and a cap on friend requests (new_account_friend_requests_per_day). A muted account sends no messages either. A report can name a message and keep its text.
AlxcBTW
force-pushed
the
feat/moderation
branch
from
October 24, 2026 14:42
3ce5f90 to
9cfd717
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Moderation for a public cloud: report queue, actions with a stated reason, an audit log, appeals, protection for new accounts and retention. Needs network PR anyplaynet/network#14 first (the cloud builds against network main). Migration
0005_moderation.sqlfor SQLite and PostgreSQL; 0004 is left to the other change.anyplay-cloud admin grant-moderator). They use the/v1/moderation/...routes with their access token. The admin token stays for bootstrap and acts asoperator; the old/admin/v1/...routes still work and now go through the same code.actionevent,bannedwithstatement), atGET /v1/me/actionsand in thebannederror, which also carries an appeal token so a banned person can appeal.ban_secretordata_dir/ban.key. Older plain hashes are replaced at start when the account exists, or when the address shows up; they match until then.docs/configuration.md.new_account_hours, 0 = off) cannot send friend requests:restrictedwithrestriction: new_accountanduntil. The rule ismoderation::may_write_to_strangers, ready for messages.docs/moderation.md;docs/compliance/updated.DSA tasks closed: T3, T4 (app and API; the mail is open), T5, T6 (moderation; the log of authority orders is open), T10 (reports, bans, actions, appeals, log; devices and inactive accounts, G3, are open). Gaps G1, G2, G8 closed. T1, T2, T7, T8, T9 stay open.
Tests:
crates/cloud/tests/moderation.rs(28 tests, SQLite and PostgreSQL, plus a two-node ban test and a migration test with existing data). Existing tests changed where behaviour changed on purpose: a ban needs a reason, a second open report about one account is refused, and test clouds turn the new-account rule off.The 24 h rule is on by default, so the launcher must show the
restrictederror to a new player who tries to add a friend.