ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/ai-music-system / webhook.js

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/ai-music-system / webhook.js
DateNot specified in source
RepositoryJanady13/ai-music-system
Revision9a816470ef81edba7a5d8f3aae62c05eead638a7
Branchmain
Path or archive memberwebhook.js
Original SHA-256acb395b8c266b2bdde3ad21d946fb2df1e71a8df6adddda49c82b773c064f1f2
Git blob SHAcc55b06b8a393b9367bb2aed3ec75e0e7300a8bb
Reading-copy SHA-256acb395b8c266b2bdde3ad21d946fb2df1e71a8df6adddda49c82b773c064f1f2

Original source ↗

Every recorded occurrence

These 3 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/ai-music-system / webhook.jsmain9a816470ef81edba7a5d8f3aae62c05eead638a7Open original
Janady13/ai-music-system / webhook.jscodex/create-ai-for-music-generation-ifwcfccd5207850253ee238f8a267c043b1e3c070ed81aOpen original
Janady13/ai-music-system / webhook.jscodex/create-ai-for-music-generation017052c0e72c6175378aebb7a7f9dd96e82c3ce2Open original

Recovered source transcript

const http = require("http"); const crypto = require("crypto"); const { exec } = require("child_process"); const SECRET = process.env.WEBHOOK_SECRET || ""; const PORT = Number(process.env.PORT || process.env.WEBHOOK_PORT || 8787); function sign(body) { const h = crypto.createHmac("sha256", SECRET).update(body).digest("hex"); return "sha256=" + h; } function safeTimingEqual(a, b) { const ba = Buffer.from(a || ""); const bb = Buffer.from(b || ""); if (ba.length !== bb.length) return false; return crypto.timingSafeEqual(ba, bb); } function SAFE(a, b) { try { return safeTimingEqual(a, b); } catch { return false; } } const server = http.createServer((req, res) => { if (req.method !== "POST" || req.url !== "/github") { res.writeHead(404); return res.end("not found"); } let raw = ""; req.on("data", c => raw += c); req.on("end", () => { try { const sig = req.headers["x-hub-signature-256"] || ""; const calc = sign(raw); if (!SAFE(sig, calc)) { res.writeHead(401); return res.end("bad sig"); } const event = req.headers["x-github-event"] || ""; if (event !== "push") { res.writeHead(200); return res.end("ignored"); } exec(`${process.env.HOME}/skynet-deploy.sh`, { timeout: 10 * 60 * 1000 }, (err) => { if (err) { console.error("deploy error", err); res.writeHead(500); return res.end("deploy failed"); } res.writeHead(200); res.end("ok"); }); } catch (e) { console.error(e); res.writeHead(500); res.end("error"); } }); }); server.listen(PORT, "0.0.0.0", () => { console.log("webhook up on", PORT); });

Search equations, builds, manuscript text, and recovered sources.