Add native host management and role-based operator authentication

Introduce an outbound Python host agent, Debian installer, durable remote
operations, immutable game-file libraries, host-aware deployments and ports,
and occupancy-safe campaigns and draining. Native hosts do not require Komodo.

Add administrator, operator and viewer accounts, protected management routes,
secure sessions, password recovery, audit history and separate telemetry tokens.
Document first-admin setup, reporter migration and live-host acceptance checks.

Validation: 1,343 TypeScript tests and 39 agent tests passed, along with type
checking, the production build, compiled SSR/API smoke tests and administrator
recovery. Real Debian/Docker T5/T6 acceptance remains unrun.
This commit is contained in:
2026-10-03 11:42:36 -04:00
parent a2e2311aa9
commit e5c0fda1ed
127 changed files with 8485 additions and 657 deletions
+20
View File
@@ -0,0 +1,20 @@
import type Database from 'better-sqlite3';
export function migrateNativeInstances(handle: Database.Database): void {
handle.exec(`
CREATE TABLE IF NOT EXISTS native_instances (
id TEXT PRIMARY KEY, server TEXT NOT NULL, host_id TEXT NOT NULL,
generation INTEGER NOT NULL DEFAULT 1, library_id TEXT NOT NULL,
image TEXT NOT NULL, bind_address TEXT NOT NULL DEFAULT '0.0.0.0',
port INTEGER NOT NULL, public_address TEXT, public_port INTEGER,
created_at TEXT NOT NULL, retired_at TEXT
);
CREATE UNIQUE INDEX IF NOT EXISTS native_instance_live_name ON native_instances(server) WHERE retired_at IS NULL;
CREATE TABLE IF NOT EXISTS native_provisioning (
deployment_id TEXT PRIMARY KEY REFERENCES server_deployments(id),
instance_id TEXT NOT NULL REFERENCES native_instances(id), generation INTEGER NOT NULL,
stage_operation_id TEXT, operation_id TEXT, files_json TEXT,
applied_at TEXT, verified_at TEXT
);
`);
}