feat(map): add cache-first Cesium gateway and AMD egress

This commit is contained in:
Codex
2026-07-16 02:23:56 +03:00
parent 59e9c92415
commit 7b55d887bc
31 changed files with 4956 additions and 167 deletions
@@ -0,0 +1,17 @@
import { spawn } from "node:child_process";
import { mkdir, chown } from "node:fs/promises";
const cacheDir = String(process.env.MAP_CACHE_DIR || "").trim();
if (cacheDir) {
await mkdir(cacheDir, { recursive: true });
await chown(cacheDir, 1000, 1000);
}
if (process.getuid?.() === 0) {
process.setgid(1000);
process.setuid(1000);
}
const [command, ...args] = process.argv.slice(2);
if (!command) throw new Error("map_gateway_runtime_command_required");
const child = spawn(command, args, { stdio: "inherit" });
child.on("exit", (code, signal) => process.exitCode = code ?? (signal ? 1 : 0));
child.on("error", (error) => { throw error; });