Published source
Download source ZIP
CH-J Server Manager
Browse directories and files for a specific application release.
Source is provided under the CH-J Proprietary Software License 1.14. Its availability does not change the license terms or grant additional rights.
1
"use strict";3
const crypto = require("node:crypto");4
const fs = require("node:fs");5
const path = require("node:path");7
const builtAt = new Date().toISOString();8
const compactTime = builtAt.replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z");9
const generatedId = `core-${compactTime}-${crypto.randomBytes(6).toString("hex")}`;10
const buildId = String(process.env.CHJ_BUILD_ID || generatedId).trim();11
if (!/^[A-Za-z0-9][A-Za-z0-9._-]{7,127}$/.test(buildId)) {12
throw new Error("CHJ_BUILD_ID must contain 8-128 safe identifier characters.");13
}15
const target = path.join(__dirname, "..", "src", "shared", "buildInfo.json");16
fs.writeFileSync(target, `${JSON.stringify({ buildId, builtAt }, null, 2)}\n`, { mode: 0o600 });17
process.stdout.write(`Stamped build ${buildId} (${builtAt})\n`);SHA-256: 6862c726e55b34c37d0470fecd831bdb81b6a59663b5efad9acc88284499783a
Archive SHA-256: 5ac91caf4fa32a6fdb114f2430deed486fbe7489d5eea343d1f034169fafb5e0