[HLCC-ICE-000001][ZY-CONTRIB-20260723-001] feat: 以来光者贡献链启用冰朔第五域个人子频道

This commit is contained in:
光湖代码频道 · 铸渊 2026-07-24 10:39:10 +08:00
commit 5615453e4e
660 changed files with 122355 additions and 0 deletions

View file

@ -0,0 +1,26 @@
"use strict";
const test = require("node:test");
const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const script = fs.readFileSync(path.join(__dirname, "..", "enroll-bs-sg-001-from-console.sh"), "utf8");
test("BS-SG-001 enrollment is fixed to one node, source and public key", () => {
assert.match(script, /NODE_ID=BS-SG-001/);
assert.match(script, /EXPECTED_HOSTNAME=guanghu-lang-sg-001/);
assert.match(script, /JD_SOURCE_CIDR=111\.228\.0\.139\/32/);
assert.match(script, /jd_ops_to_bs_sg_001/);
assert.match(script, /no-port-forwarding/);
assert.match(script, /no-agent-forwarding/);
assert.doesNotMatch(script, /eval|bash\s+-c|\$\{cmd\}/);
});
test("enrollment validates Gatekeeper identity and provides a narrow rollback", () => {
assert.match(script, /127\.0\.0\.1:3911\/status/);
assert.match(script, /Gatekeeper identity mismatch/);
assert.match(script, /--rollback/);
assert.match(script, /grep -vF/);
assert.match(script, /other authorized keys were preserved/);
});

View file

@ -0,0 +1,24 @@
"use strict";
const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const test = require("node:test");
const root = path.join(__dirname, "..");
const probe = fs.readFileSync(path.join(root, "probe.sh"), "utf8");
const timer = fs.readFileSync(path.join(root, "guanghu-personal-node-probe.timer"), "utf8");
test("probe uses a private SSH alias and fixed read-only command", () => {
assert.match(probe, /NODE_ALIAS/);
assert.match(probe, /systemctl is-active nginx/);
assert.match(probe, /df --output=pcent/);
assert.doesNotMatch(probe, /(?:\d{1,3}\.){3}\d{1,3}/);
assert.doesNotMatch(probe, /token|password|private[_ -]?key/i);
});
test("probe writes a latest receipt and runs periodically", () => {
assert.match(probe, /RECEIPT_FILE/);
assert.match(timer, /OnUnitActiveSec=5min/);
assert.match(timer, /Persistent=true/);
});