Lines 1104-1144javascript
1106 return realpathSync(resolve(scriptPath));
1109 return resolve(scriptPath);
1112async function runDashboard(context) {
1113 const portStr = stringFlag(context.parsed, "port");
1114 const port = portStr ? Number.parseInt(portStr, 10) : 8758;
1115 if (Number.isNaN(port) || port <= 0) {
1116 throw new Error("--port must be a positive integer");
1118 const connection = resolveConnection(context);
1119 context.stderr.write(`\n${pc.bold(pc.blue("thingd Inspector Dashboard"))}\n` +
1120 `Starting local REST server on ${pc.cyan(`http://localhost:${port}`)}...\n` +
1121 `Database path: ${pc.green(connection.path)}\n` +
1122 `Storage engine: ${pc.cyan(connection.driver || "memory")}\n\n`);
1123 const { startDashboardServer } = await import("./dashboard/server.js");
1124 const { server: _server, close } = await startDashboardServer(connection, port);
1125 context.stderr.write(`${pc.green("✔ Dashboard successfully loaded.")}\n` +
1126 `Opening browser... (Press ${pc.yellow("Ctrl+C")} to stop the server)\n\n`);
1127 await openBrowser(`http://localhost:${port}`);
1128 return new Promise((_resolve) => {
1129 process.on("SIGINT", async () => {
1133 process.on("SIGTERM", async () => {
1139async function openBrowser(url) {
1140 const { exec } = await import("node:child_process");
1141 const startCommand = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/index.jsView on unpkg · L1124 1142 exec(`${startCommand} ${url}`, () => {
1143 // Ignore browser spawn errors silently