Initial commit — SvelteKit fleet manager for T5 Plutonium servers
Ports push_scripts.sh (1497 lines of bash) to a SvelteKit + SQLite web app that manages a fleet of T5 Plutonium servers running on Komodo. Same push and beta workflow as the shell script, with a live SSE pipeline view, a !rt-token-gated auth modal that hard-pauses deployments on stale tokens, per-file audit diffs, and a Komodo-container deployment target. - Push/beta engines port the exact filter, held-by-beta, conflict, and stale-backup rules from the shell script - SQLite (better-sqlite3) replaces script_metadata.json; a one-shot importer moves legacy state over on first boot - 16 vitest tests cover push add/update/skip, beta open→rollback, open→promote, conflict guards, sweep frozen/manual branches, and IW4M login/status parsing - docker/ + komodo/stack.toml deploy as a managed container on the same host as the game servers, /root/zombies bind-mounted at the same path the shell script used
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { EventEmitter } from 'node:events';
|
||||
|
||||
// One in-process event bus, multiplexed by all three SSE endpoints. Kept
|
||||
// separate from any specific subscriber so push/beta/sweep can emit without
|
||||
// pulling the whole worker module in.
|
||||
|
||||
export type PipelineEvent =
|
||||
| { type: 'deployment-opened'; deploymentId: string; action: string; servers: string[] }
|
||||
| { type: 'server-changed'; deploymentId: string; server: string; files: number }
|
||||
| {
|
||||
type: 'server-state';
|
||||
deploymentId: string;
|
||||
server: string;
|
||||
state: 'pending' | 'done' | 'failed' | 'held' | 'manual';
|
||||
players: number | null;
|
||||
error: string | null;
|
||||
}
|
||||
| { type: 'sweep-tick'; frozen: boolean; reason?: string }
|
||||
| { type: 'auth-state'; state: import('../integrations/auth-state.js').AuthState; msRemaining?: number }
|
||||
| { type: 'server-status'; entries: Array<{ server: string; players: number | null; name?: string }> };
|
||||
|
||||
class Bus extends EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
// Deployments and sweep can produce a lot of events during a big push.
|
||||
this.setMaxListeners(64);
|
||||
}
|
||||
}
|
||||
|
||||
const bus = new Bus();
|
||||
|
||||
export function emit(event: PipelineEvent): void {
|
||||
bus.emit('event', event);
|
||||
}
|
||||
|
||||
export function subscribe(listener: (event: PipelineEvent) => void): () => void {
|
||||
bus.on('event', listener);
|
||||
return () => bus.off('event', listener);
|
||||
}
|
||||
Reference in New Issue
Block a user