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.

716 B
Raw Blame
import os from "node:os";
import type { InstanceEnvironment, RuntimeIdentity } from "@/lib/contracts/runtime-identity";

export function getRuntimeIdentity(): RuntimeIdentity {
  let serviceUser: string | null = null;
  try { serviceUser = os.userInfo().username || null; } catch { /* The service may have no passwd entry. */ }
  const declaredEnvironment = process.env.OS_INSTANCE_ENVIRONMENT?.trim() ?? "";
  const environment = ["development", "test", "staging", "production"].includes(declaredEnvironment)
    ? declaredEnvironment as InstanceEnvironment : null;
  return {
    hostname: os.hostname(),
    serviceUser,
    runtimeInstanceId: process.env.MSO_RUNTIME_INSTANCE_ID || null,
    environment,
  };
}