New files: - 139_server_config.sql — DB migration for short_name system - 139_seed_server_config.js — auto-populates 17 servers from Pterodactyl - src/services/uptimeKuma.js — Socket.IO direct (no npm wrapper) - src/services/pterodactyl.js — power actions + console commands Modified files: - servers.js — 6 new POST routes (short-name, lock, createserver, delserver, power, console) + short_name-based channel detection - _server_card.ejs — full rebuild with command center UI - _matrix_body.ejs — refactored from 144 lines to 20 (uses partial) - package.json — added socket.io-client Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
867 B
SQL
25 lines
867 B
SQL
-- Migration 139: Server Command Center — server_config table
|
|
-- Creates the foundation for short_name-based Discord channel detection
|
|
-- and server management from Trinity Console.
|
|
|
|
CREATE TABLE IF NOT EXISTS server_config (
|
|
server_identifier VARCHAR(36) PRIMARY KEY,
|
|
short_name VARCHAR(64) UNIQUE,
|
|
short_name_locked BOOLEAN DEFAULT false,
|
|
display_name VARCHAR(128),
|
|
restart_enabled BOOLEAN DEFAULT true,
|
|
restart_offset_minutes INTEGER DEFAULT 0,
|
|
node VARCHAR(8),
|
|
pterodactyl_name VARCHAR(128),
|
|
created_at TIMESTAMP DEFAULT NOW(),
|
|
updated_at TIMESTAMP DEFAULT NOW()
|
|
);
|
|
|
|
-- Index for fast short_name lookups (channel detection)
|
|
CREATE INDEX IF NOT EXISTS idx_server_config_short_name
|
|
ON server_config (short_name);
|
|
|
|
-- Index for node-based queries (matrix grouping)
|
|
CREATE INDEX IF NOT EXISTS idx_server_config_node
|
|
ON server_config (node);
|