Rainbeam Staff Guide
Welcome, Rainbeam moderator/administrator! This guide will assist you on your journey of keeping Rainbeam (and adjacent sites) safe from troublemakers and creeps.
License
This entire guide is licensed under the MIT license. You can view the license here.
Permissions
Rainbeam expresses permissions using bitflags which join together into a single, serializable integer.
You can view the names of every permission here, with their values visible in the source here.
These permissions are demoed in the moderation.sql
example. In this example, we create a default "helpers" group:
INSERT INTO
"xgroups"
VALUES
('Helpers', '1', 33603612);
This group is given a permission integer of 33603612
, which is built using something similar to the following:
(1 << 2) | (1 << 3) | (1 << 4) | (1 << 14) | (1 << 15) | (1 << 25)
That represents the following permissions:
MANAGE_RESPONSES
MANAGE_COMMENTS
MANAGE_QUESTIONS
VIEW_AUDIT_LOG
VIEW_REPORTS
MANAGE_WARNINGS
This also matches the minimum permissions to be marked as a "helper".
Adding user groups
In Rainbeam, each Profile
contains a group
field which determines the group that they are part of. Groups point to a row in the xgroups
table.
As a starting point, we provide the moderation.sql
file to give you a simple setup.
This chapter will walk through what each line of that file does, and how you can customize it to create your own groups.
In the start of the file, we create three groups:
-- the minimum value for helpers is:
-- (1 << 2) | (1 << 3) | (1 << 4) | (1 << 14) | (1 << 15) | (1 << 25)
INSERT INTO
"xgroups"
VALUES
('Helpers', '1', 33603612);
-- the minimum value for managers is:
-- (1 << 2) | (1 << 3) | (1 << 4) | (1 << 10) | (1 << 11) | (1 << 13) | (1 << 14) | (1 << 15) | (1 << 23) | (1 << 25)
INSERT INTO
"xgroups"
VALUES
('Managers', '2', 42003484);
-- admins are granted administrator permissions:
-- (1 << 0) | (1 << 1)
INSERT INTO
"xgroups"
VALUES
('Admins', '3', 3);
These groups are created using bitflag permissions.
The name and ID of a group must be unique to the group, but the roles can be shared with any group.
Finally, we add a user to the group:
UPDATE "xprofiles" SET "group" = '1' WHERE "username" = 'USERNAME_HERE';
Adding a user to a group can also be done through the moderator UI, but it has to be done through plain SQL to set up your first administrator user.
The number that we change group
to must correspond with a group from the xgroups
table.
Mod panel
Every moderator (Helper
and higher) can access the "Manage (Mod)" tab on every profile. This tab shows various pieces of information which may help you moderate slightly more efficiently.
The panel has a few sub-tabs:
Info tab
The "Info" (information) tab contains basic information about the user:
- Join date
- Group number
- The user's group number can be changed by clicking on the number. This number can be set to
-1
to mark the user as banned. Attempting to change it to a number which isn't bound to a group will result in an error.
- The user's group number can be changed by clicking on the number. This number can be set to
- Tier number
- The user's tier number can be changed by clicking on the number.
- Coin amount
- Coins can be added (use a negative to subtract) from the user's balance by clicking on the number.
- Verify URL + verify code
- The user's verify URL can be changed by clicking on the URL.
The tab also includes various links to view the user's private pages:
- View mail
- View items
- View settings
- View notifications
Each of those links will open their respective pages as the user in question. For example, changing the settings after you click on "View settings" will change the settings of the user, not of yourself.
You can also view every setting the user has set (with its true identifier) on this page.
Badges tab
The badges tab allows you to edit the user's badge JSON.
Badges follow this schema:
["icon", "background", "foreground"]
Password tab
The password tab allows you to edit the current password of the user. It does not allow you to view the user's current password as we do not actually have access to that.
Sessions tab
The sessions tab is one of the most powerful moderator tabs available to staff. Through this tab, you can view the same sessions table available in user settings. On top of this, you can click "New" to create a custom session with a custom identifier and permissions.
You can delete the user's sessions at will, as well as see the IP address, app, creation date, and permissions of each session.
The session token is returned after creating a new session, allowing you to directly sign in by updating your __Secure-Token
cookie to this unique token.
Chats tab
The chats tab allows you to view and open all the chats that the user is a part of. The only real use for this tab is to see if the user is in known problematic chats.
Labels tab
The labels tab has two parts:
- The "This user" section
- The global label manager section
In the first section, you're able to add user labels (by ID) to the user. You're also able to remove their labels and view information about the labels attached via the label's respective buttons.
In the second section, you're able to create and delete user labels globally. Note that deleting a label does not remove it from profiles. That would be hard to implement.
Reserved labels
The labels below are reserved and will be used for various purposes (even if they don't actually exist in the xlabels
table).
-1
: quarantined user (effectively a shadow-ban, fully removed from timelines)
Warnings tab
Finally, we have the warnings tab. This tab allows you to create a manage the warnings left by other moderators on the user's profile. When a warning is created, the user will receive a notification telling them about it. The notification doesn't include the username of the moderator who created the warning.
What makes a good warning?
A good warning is actually quite simple. While warnings are a punishment, they're also a way of taking mercy on users who have broken the rules.
A good warning is easy: don't be mean, get quick and concise, and always cite the TOS! Citing the TOS is the most important step, because otherwise questions could be raised about why the warning was ever created in the first place.
Inboxes
As a moderator, you have access to a few additional inboxes.
Audit log
The audit log provides a list of moderator events that have taken place. Each listed event follows this format:
- The ID of the moderator as the title (linking to their profile)
- The body of the event (containing what the event was and a link to the asset if applicable)
- A button to open the event moderator's profile
IP bans
The IP bans tab allows you to view every IP that has been banned, the moderator who banned it, and the note they left.
You're able to click on the IP to unban it if necessary. Both banning and unbanning IPs creates an audit log event.
Reports
The reports inbox allows you to view reports created by users. This inbox essentially acts the same as the regular user notification tab.
Each report contains a title which will specify the type of the report and the target asset. The title will likely contain a link to view the asset.
The body of each report will contain the exact text given by the user, as well as the IP of the user who created the report. As with every IP (besides the IPs in the audit log and moderator panel), clicking the IP will prompt you to either ban the IP or view the first profile associated with the IP.
You can press the "Open" button on a report to open the target asset, or the "Delete" button to remove the report. The "Delete" button also acts as a "Mark as resolved" button.