Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

1.2 KB
Raw Blame
import { NextResponse } from "next/server";
import pkg from "../../../package.json";
import { IS_DEMO } from "@/lib/demo";


// Public liveness probe — no auth. Used by systemd WatchdogSec / Dokploy /
// uptime monitors. Cheap, never cached. Demo builds avoid exposing host uptime.

export async function handleGetHealth(): Promise<Response> {
  if (IS_DEMO) {
    return NextResponse.json(
      {
        status: "ok",
        service: "mso",
        buildId: process.env.NEXT_PUBLIC_BUILD_ID || "dev",
        buildSha: process.env.NEXT_PUBLIC_COMMIT_SHA || null,
        runtimeInstanceId: process.env.MSO_RUNTIME_INSTANCE_ID || null,
        version: pkg.version ?? "0.0.0",
        demo: true,
      },
      { headers: { "Cache-Control": "no-store" } },
    );
  }

  return NextResponse.json(
    {
      status: "ok",
      service: "mso",
      buildId: process.env.NEXT_PUBLIC_BUILD_ID || "dev",
      buildSha: process.env.NEXT_PUBLIC_COMMIT_SHA || null,
      runtimeInstanceId: process.env.MSO_RUNTIME_INSTANCE_ID || null,
      uptime: Math.round(process.uptime()),
      version: pkg.version ?? "0.0.0",
    },
    { headers: { "Cache-Control": "no-store" } },
  );
}