fleet(tower): 0.18 — Tasks-View (Spool/Dead-Letter/Alarm) + Task-Detail-Modal + /healthz + /api/status; Fleet-Views 0.13-0.18 erstmals versioniert

This commit is contained in:
Hermes CEO
2026-10-30 04:55:35 +00:00
parent fa3d5d0a8f
commit 9e94512214
33 changed files with 3498 additions and 3 deletions
+40
View File
@@ -0,0 +1,40 @@
import { NextResponse } from "next/server"
import { uptimeSeconds, TOWER_VERSION } from "@/app/lib/fleet/health"
import { FLEET_SPOOL_DIR, FLEET_ORG_PATH, loadOrg } from "@/app/lib/fleet/fleetSource"
import { existsSync } from "node:fs"
export const dynamic = "force-dynamic"
/**
* GET /healthz — Readiness/Liveness des Tower-Service (Karte it1-tower-03).
* 200 = Kernquellen (Spool-PVC, org.yaml) verfuegbar; 503 = eine Kernquelle tot.
* JSON statt HTML, damit Uptime-Monitoring den Grund maschinell lesen kann.
*/
export async function GET() {
const problems: string[] = []
const spoolOk = existsSync(FLEET_SPOOL_DIR)
if (!spoolOk) problems.push(`spool fehlt: ${FLEET_SPOOL_DIR}`)
if (!existsSync(FLEET_ORG_PATH)) {
problems.push(`org.yaml fehlt: ${FLEET_ORG_PATH}`)
} else {
try {
if (loadOrg().members.length === 0) problems.push("org.yaml ohne members")
} catch (e) {
problems.push(`org.yaml unlesbar: ${e instanceof Error ? e.message : String(e)}`)
}
}
const ok = problems.length === 0
return NextResponse.json(
{
status: ok ? "ok" : "unhealthy",
version: TOWER_VERSION,
uptime_seconds: uptimeSeconds(),
generated_at: new Date().toISOString(),
problems,
},
{ status: ok ? 200 : 503, headers: { "Cache-Control": "no-store" } }
)
}