improvements and bug fixes

This commit is contained in:
legop3
2026-06-29 20:19:24 -04:00
parent 02df826eb4
commit 79be3e1583
28 changed files with 164 additions and 233 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ const io = require('../../globals/io');
const { getRole, roleEvents } = require('../roleService');
const { getSocketIp } = require('../../helpers/ipResolver');
const ADMIN_ROLES = new Set(['admin', 'lockdown', 'lockdown-admin']);
const ADMIN_ROLES = new Set(['admin', 'lockdown']);
const MAX_HISTORY = 200;
const history = [];
@@ -19,7 +19,7 @@ function formatWebhookUsername(payload) {
const name = payload.nickname || payload.socketId?.slice(0, 6) || 'unknown';
const botTag = payload.bot ? ' [BOT]' : '';
const spectatorTag = payload.role === 'spectator' && !payload.bot ? ' [SPECTATOR]' : '';
const adminTag = payload.role === 'admin' || payload.role === 'lockdown' || payload.role === 'lockdown-admin' ? ' [Rover Admin]' : '';
const adminTag = payload.role === 'admin' || payload.role === 'lockdown' ? ' [Rover Admin]' : '';
if (payload.fromDiscord) {
const origin = payload.discordGuildName ? ` (From: ${payload.discordGuildName})` : '';
return `${name}${origin}${botTag}${spectatorTag}${adminTag}`;
@@ -1,5 +1,5 @@
// Identity Admin Service
// Purpose: Exposes lockdown-admin socket operations for inspecting and editing the central identity database.
// Purpose: Exposes lockdown admin socket operations for inspecting and editing the central identity database.
// Scope: Owns transport-level authorization and delegates every database mutation to identityService.
const io = require('../../globals/io');
const logger = require('../../globals/logger').child('identityAdminService');
@@ -19,7 +19,7 @@ const MAX_FEATURE_STATE_JSON_BYTES = 64 * 1024;
function isLockdownAdminSocket(socket) {
const role = getRole(socket);
return role === 'lockdown' || role === 'lockdown-admin';
return role === 'lockdown';
}
function requireLockdownAdmin(socket) {
@@ -2,7 +2,7 @@
// Purpose: Provides pure helpers for admin state projection, role checks, and structured error normalization.
// Scope: Keeps runtime behavior unchanged by extracting deterministic helper logic from index orchestration.
function isAdminRole(role) {
return role === 'admin' || role === 'lockdown' || role === 'lockdown-admin';
return role === 'admin' || role === 'lockdown';
}
function buildAdminState(status, runHistory) {
@@ -1,5 +1,5 @@
function isAdminRole(role) {
return role === 'admin' || role === 'lockdown' || role === 'lockdown-admin';
return role === 'admin' || role === 'lockdown';
}
function buildAdminState(status, runHistory) {
@@ -39,7 +39,6 @@ function createSidebarRenderer({ execFileAsync, ensureDir }) {
switch (String(role)) {
case 'admin':
case 'lockdown':
case 'lockdown-admin':
return '#FCD34D';
case 'spectator':
return '#94A3B8';
@@ -8,7 +8,7 @@ const { isAdmin, isLockdownAdmin, getRole } = require('../roleService');
const SUBSCRIBE_LIMIT = 50;
const SUBSCRIBE_WINDOW_MS = 10000;
const STREAM_INTERVAL_MS = 1000;
const STREAM_INTERVAL_MS = 2000;
function passesMode(socket) {
const mode = getMode();
@@ -43,7 +43,7 @@ function normalizeKnownIps(raw = []) {
}
function isAdminRole(role) {
return role === 'admin' || role === 'lockdown' || role === 'lockdown-admin';
return role === 'admin' || role === 'lockdown';
}
function parseDeterrenceSelector(selector) {
@@ -42,7 +42,7 @@ function emitChange(reason, payload = {}) {
}
function isAdminRole(role) {
return role === 'admin' || role === 'lockdown' || role === 'lockdown-admin';
return role === 'admin' || role === 'lockdown';
}
function refreshSocketIdentityFlags(socket) {