feat(server): implement workspace and SSH run pipeline (#3)
Add strict host-key confirmation, FIFO execution, streamed events, audit records, captures and SFTP artifacts/uploads. Use ssh2 for SSH/SFTP, yaml for inventory parsing, and compile-time ssh2/ws declarations.
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import Fastify, { type FastifyInstance } from "fastify";
|
||||
import websocket from "@fastify/websocket";
|
||||
import { loadConfig, type ServerConfig } from "./config";
|
||||
import { workspacePlugin } from "./workspace";
|
||||
import { runsPlugin, EventsHub } from "./runs";
|
||||
|
||||
export interface AppOptions {
|
||||
logger?: boolean;
|
||||
config?: Partial<ServerConfig>;
|
||||
events?: EventsHub;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -15,6 +20,8 @@ export interface AppOptions {
|
||||
export async function buildApp(options: AppOptions = {}): Promise<FastifyInstance> {
|
||||
const app = Fastify({ logger: options.logger ?? false });
|
||||
await app.register(websocket);
|
||||
await app.register(workspacePlugin, { config: loadConfig(options.config) });
|
||||
await app.register(runsPlugin, { config: loadConfig(options.config), hub: options.events ?? new EventsHub() });
|
||||
|
||||
app.get("/api/health", async () => ({ ok: true }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user