@debugkit/dashboard 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +30 -0
- package/dist/client/assets/_authed-BDx4Txp7.js +7 -0
- package/dist/client/assets/_authed-D6P9RBN1.js +1 -0
- package/dist/client/assets/charts-Covhtva2.js +55 -0
- package/dist/client/assets/index-BKQXehfa.js +12 -0
- package/dist/client/assets/issues._fingerprint-DtAqk0rC.js +1 -0
- package/dist/client/assets/login-Da8b3hjR.js +1 -0
- package/dist/client/assets/styles-CZZRuG1z.css +2 -0
- package/dist/client/assets/ui-DnKidKVi.js +1 -0
- package/dist/server/assets/_authed-BjmBAX3l.js +482 -0
- package/dist/server/assets/_authed-x9Ku8dyL.js +40 -0
- package/dist/server/assets/_tanstack-start-manifest_v-CY7PP5UB.js +40 -0
- package/dist/server/assets/charts-CNlV7Pga.js +221 -0
- package/dist/server/assets/demo-DTdlXNgj.js +333 -0
- package/dist/server/assets/dynamodb-DejcakaF.js +187 -0
- package/dist/server/assets/empty-plugin-adapters-BsRz-CQL.js +4 -0
- package/dist/server/assets/firestore-BH-gx9no.js +112 -0
- package/dist/server/assets/fns-CgB12FUN.js +31 -0
- package/dist/server/assets/fns-Yg8sT1Cb.js +87 -0
- package/dist/server/assets/issues._fingerprint-C2EdByPH.js +255 -0
- package/dist/server/assets/login-BMGNYcxB.js +107 -0
- package/dist/server/assets/memory-4DwW5cTO.js +59 -0
- package/dist/server/assets/queries-DIVV-5j6.js +4274 -0
- package/dist/server/assets/rollups-JXbazRNh.js +22 -0
- package/dist/server/assets/router-D2L7-BwF.js +222 -0
- package/dist/server/assets/src-D5jyi_C4.js +235 -0
- package/dist/server/assets/start-t09PGpZL.js +3 -0
- package/dist/server/assets/ui-Lv-KcOoP.js +131 -0
- package/dist/server/server.js +7825 -0
- package/package.json +52 -3
- package/scripts/hash-password.mjs +17 -0
- package/server.mjs +50 -0
- package/README.md +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debugkit/dashboard",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "The self-hosted deBug dashboard. Run it with npx debugkit dashboard, or npx @debugkit/dashboard with your own settings.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"debugkit-dashboard": "./server.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"server.mjs",
|
|
12
|
+
"scripts",
|
|
13
|
+
".env.example"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@aws-sdk/client-dynamodb": "^3.700.0",
|
|
17
|
+
"@aws-sdk/lib-dynamodb": "^3.700.0",
|
|
18
|
+
"@tanstack/react-router": "^1.170.46",
|
|
19
|
+
"firebase-admin": "^13.0.1",
|
|
20
|
+
"react": "^19.3.1",
|
|
21
|
+
"react-dom": "^19.3.1",
|
|
22
|
+
"recharts": "^3.10.1"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@tailwindcss/vite": "^4.3.5",
|
|
26
|
+
"@types/react": "^19.2.0",
|
|
27
|
+
"@types/react-dom": "^19.2.0",
|
|
28
|
+
"@vitejs/plugin-react": "^6.3.0",
|
|
29
|
+
"tailwindcss": "^4.3.5",
|
|
30
|
+
"vite": "^8.3.7",
|
|
31
|
+
"@tanstack/react-start": "^1.169.5",
|
|
32
|
+
"@debugkit/ingest": "0.3.0",
|
|
33
|
+
"@debugkit/schema": "0.3.0",
|
|
34
|
+
"@debugkit/adapters": "0.3.0"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=20.12"
|
|
38
|
+
},
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/Abantu-Digital/deBug.git",
|
|
43
|
+
"directory": "apps/dashboard"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"dev": "vite dev --port 4400",
|
|
50
|
+
"build": "vite build",
|
|
51
|
+
"start": "node server.mjs",
|
|
52
|
+
"typecheck": "tsc -p .",
|
|
53
|
+
"hash-password": "node scripts/hash-password.mjs"
|
|
54
|
+
}
|
|
6
55
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Usage: pnpm --filter @debugkit/dashboard hash-password [email]
|
|
3
|
+
import { randomBytes, scryptSync } from "node:crypto";
|
|
4
|
+
import { createInterface } from "node:readline";
|
|
5
|
+
|
|
6
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
7
|
+
const ask = (q) => new Promise((r) => rl.question(q, r));
|
|
8
|
+
const email = process.argv[2] ?? (await ask("Email: "));
|
|
9
|
+
const password = await ask("Password (min 10 chars): ");
|
|
10
|
+
rl.close();
|
|
11
|
+
if (password.length < 10) {
|
|
12
|
+
console.error("Password must be at least 10 characters.");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
const salt = randomBytes(16);
|
|
16
|
+
const hash = scryptSync(password, salt, 64);
|
|
17
|
+
console.log(`\nAdd to DEBUG_DASHBOARD_USERS (comma-separate multiple users):\n\n${email.trim().toLowerCase()}=scrypt.${salt.toString("hex")}.${hash.toString("hex")}\n`);
|
package/server.mjs
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Production server for a self-hosted deBug dashboard: `pnpm build && pnpm start`.
|
|
3
|
+
// Serves built assets from dist/client and hands every other request to the TanStack Start handler.
|
|
4
|
+
import { createReadStream, existsSync, statSync } from "node:fs";
|
|
5
|
+
import { createServer } from "node:http";
|
|
6
|
+
import { extname, join, normalize } from "node:path";
|
|
7
|
+
import { Readable } from "node:stream";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
process.loadEnvFile(process.env.DEBUG_ENV_FILE ?? ".env");
|
|
12
|
+
} catch {}
|
|
13
|
+
process.env.NODE_ENV ??= "production";
|
|
14
|
+
|
|
15
|
+
const root = fileURLToPath(new URL("./dist/client", import.meta.url));
|
|
16
|
+
const { default: app } = await import("./dist/server/server.js");
|
|
17
|
+
const port = Number(process.env.PORT ?? 4400);
|
|
18
|
+
const host = process.env.HOST ?? "127.0.0.1"; // bind to localhost by default; set HOST=0.0.0.0 behind a proxy
|
|
19
|
+
|
|
20
|
+
const TYPES = { ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png", ".ico": "image/x-icon", ".woff2": "font/woff2", ".json": "application/json", ".txt": "text/plain" };
|
|
21
|
+
|
|
22
|
+
createServer(async (req, res) => {
|
|
23
|
+
try {
|
|
24
|
+
const url = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
|
|
25
|
+
const file = normalize(join(root, decodeURIComponent(url.pathname)));
|
|
26
|
+
if (file.startsWith(root) && url.pathname !== "/" && existsSync(file) && statSync(file).isFile()) {
|
|
27
|
+
res.writeHead(200, {
|
|
28
|
+
"content-type": TYPES[extname(file)] ?? "application/octet-stream",
|
|
29
|
+
"cache-control": url.pathname.startsWith("/assets/") ? "public, max-age=31536000, immutable" : "no-cache",
|
|
30
|
+
});
|
|
31
|
+
return createReadStream(file).pipe(res);
|
|
32
|
+
}
|
|
33
|
+
const body = req.method === "GET" || req.method === "HEAD" ? undefined : Readable.toWeb(req);
|
|
34
|
+
const request = new Request(url, { method: req.method, headers: req.headers, body, duplex: "half" });
|
|
35
|
+
const response = await app.fetch(request);
|
|
36
|
+
const headers = {};
|
|
37
|
+
response.headers.forEach((v, k) => {
|
|
38
|
+
if (k !== "set-cookie") headers[k] = v;
|
|
39
|
+
});
|
|
40
|
+
const cookies = response.headers.getSetCookie?.() ?? [];
|
|
41
|
+
if (cookies.length) headers["set-cookie"] = cookies;
|
|
42
|
+
res.writeHead(response.status, headers);
|
|
43
|
+
if (response.body && req.method !== "HEAD") Readable.fromWeb(response.body).pipe(res);
|
|
44
|
+
else res.end();
|
|
45
|
+
} catch (err) {
|
|
46
|
+
console.error(err);
|
|
47
|
+
if (!res.headersSent) res.writeHead(500);
|
|
48
|
+
res.end("Internal error");
|
|
49
|
+
}
|
|
50
|
+
}).listen(port, host, () => console.log(`deBug dashboard on http://${host}:${port}`));
|
package/README.md
DELETED