mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
Merge origin/main into moderator-tools
Hardware bans, panel search and logs, two worlds and the verified badge, with the branch's staff roles kept: full rooms let in active staff, and address search stays with the roles that may ban addresses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
commit
da7eb9af58
33 files changed
+2771
-166
No files matched your search
+10
-1
@@ -4,6 +4,7 @@ const accounts = require("./accounts.js");
|
||||
const bans = require("./bans.js");
|
||||
const captcha = require("./captcha.js");
|
||||
const defpacks = require("./defpacks.js");
|
||||
const devices = require("./devices.js");
|
||||
const config = require("../config.js");
|
||||
const dens = require("./dens.js");
|
||||
const limits = require("./limits.js");
|
||||
@@ -208,13 +209,21 @@ const handle = async (route, params, body, from) => {
|
||||
}
|
||||
const ban = world.moderation.banOf(account);
|
||||
const addressBan = ban ? null : bans.addressBan(from.address);
|
||||
const deviceBan = ban || addressBan ? null : devices.banOfAccount(account);
|
||||
return {status: 200, body: ban ? {banned: "account", banned_seconds: ban.seconds, ban_reason: ban.reason}
|
||||
: addressBan ? {banned: "address", banned_seconds: world.moderation.PERMANENT, ban_reason: addressBan.reason} : {banned: null}};
|
||||
: addressBan ? {banned: "address", banned_seconds: world.moderation.PERMANENT, ban_reason: addressBan.reason}
|
||||
: deviceBan ? {banned: "device", banned_seconds: world.moderation.PERMANENT, ban_reason: deviceBan.reason} : {banned: null}};
|
||||
}
|
||||
case "POST /api/register": {
|
||||
if (bans.addressBan(from.address)) {
|
||||
return {status: 403, body: {error: "address_banned"}};
|
||||
}
|
||||
// the client says which computer it is on (lib/devices.js); the sign-up
|
||||
// page cannot, and an account made there still signs in through the client.
|
||||
const device = devices.read((body || {}).device);
|
||||
if (device && devices.banOf(device)) {
|
||||
return {status: 403, body: {error: "device_banned"}};
|
||||
}
|
||||
const {username, password, avatarType} = body || {};
|
||||
// the terms and the privacy policy, and old enough to agree to them:
|
||||
// said by the one signing up, on the page or in the client.
|
||||
|
||||
Reference in new issue
Block a user