Remove Komodo backend in favor of native hosts
This commit is contained in:
@@ -24,7 +24,6 @@ const SERVERS_COLUMNS: Array<{ name: string; ddl: string }> = [
|
||||
{ name: 'desired_state', ddl: "ALTER TABLE servers ADD COLUMN desired_state TEXT NOT NULL DEFAULT 'running' CHECK (desired_state IN ('running','stopped'))" },
|
||||
// Base columns that shipped in the very first schema stay here for parity
|
||||
// with fresh installs — no ALTER is issued if they're already present.
|
||||
{ name: 'komodo_server', ddl: 'ALTER TABLE servers ADD COLUMN komodo_server TEXT' },
|
||||
{ name: 'game_port', ddl: 'ALTER TABLE servers ADD COLUMN game_port INTEGER' },
|
||||
{ name: 'rcon_host', ddl: 'ALTER TABLE servers ADD COLUMN rcon_host TEXT' },
|
||||
{ name: 'last_players', ddl: 'ALTER TABLE servers ADD COLUMN last_players INTEGER' },
|
||||
@@ -65,6 +64,14 @@ function migrateServers(handle: Database.Database): void {
|
||||
handle.exec(col.ddl);
|
||||
}
|
||||
}
|
||||
// Retire external-backend registry fields, including required fields that
|
||||
// would otherwise prevent native inserts into an upgraded database.
|
||||
const retired = new Set(['komodo_type', 'komodo_name', 'komodo_server']);
|
||||
handle.transaction(() => {
|
||||
for (const column of rows) {
|
||||
if (retired.has(column.name)) handle.exec(`ALTER TABLE servers DROP COLUMN "${column.name.replaceAll('"', '""')}"`);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
// Additive columns on tables the script model owns. Same pattern as
|
||||
@@ -286,7 +293,7 @@ function migrateWatchdogConstraints(handle: Database.Database): void {
|
||||
function backfillDesiredState(handle: Database.Database): void {
|
||||
if (handle.prepare("SELECT 1 FROM settings WHERE key = 'watchdog_desired_state_v1'").get()) return;
|
||||
handle.transaction(() => {
|
||||
// A failed stop may have reached Komodo. Preserve that explicit intent.
|
||||
// A failed stop may have reached the host agent. Preserve that explicit intent.
|
||||
handle.exec(`UPDATE servers SET desired_state = 'stopped' WHERE 'stop' = (
|
||||
SELECT action FROM server_deployments d WHERE d.server = servers.name AND d.state != 'cancelled'
|
||||
AND d.action IN ('create','start','restart','rebuild','stop')
|
||||
|
||||
@@ -63,13 +63,10 @@ CREATE INDEX IF NOT EXISTS idx_leaderboard_player_matches ON leaderboard_match_p
|
||||
|
||||
CREATE TABLE IF NOT EXISTS servers (
|
||||
name TEXT PRIMARY KEY,
|
||||
komodo_type TEXT NOT NULL DEFAULT 'deployment', -- deployment|stack|container
|
||||
komodo_name TEXT NOT NULL,
|
||||
komodo_server TEXT,
|
||||
container_checked_at TEXT,
|
||||
container_state TEXT, -- last observed Komodo runtime state
|
||||
container_state TEXT, -- last observed host-agent runtime state
|
||||
desired_state TEXT NOT NULL DEFAULT 'running' CHECK (desired_state IN ('running','stopped')),
|
||||
game_port INTEGER, -- UDP RCON port; lazy-filled from Komodo
|
||||
game_port INTEGER, -- UDP game port assigned on the host
|
||||
rcon_host TEXT, -- optional per-server override of RCON_HOST
|
||||
game TEXT, -- 't5' etc.; static per-server (no map rotation)
|
||||
map TEXT, -- 'zombie_theater' etc.; static per-server
|
||||
|
||||
Reference in New Issue
Block a user