[HLCC-ICE-000001][ZY-CONTRIB-20260723-001] feat: 以来光者贡献链启用冰朔第五域个人子频道
This commit is contained in:
commit
5615453e4e
660 changed files with 122355 additions and 0 deletions
41
server-tools/jd-forgejo/native.test.js
Normal file
41
server-tools/jd-forgejo/native.test.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
"use strict";
|
||||
const test = require("node:test");
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const { parseProductIdentity } = require("./product-identity");
|
||||
const ini = fs.readFileSync(path.join(__dirname, "app.ini.template"), "utf8");
|
||||
const unit = fs.readFileSync(path.join(__dirname, "guanghu-forgejo.service"), "utf8");
|
||||
test("native Forgejo binds only to JD loopback", () => {
|
||||
assert.match(ini, /HTTP_ADDR = 127\.0\.0\.1/);
|
||||
assert.match(ini, /HTTP_PORT = 3001/);
|
||||
});
|
||||
test("registration and push-create are disabled", () => {
|
||||
assert.match(ini, /DISABLE_REGISTRATION = true/);
|
||||
assert.match(ini, /ENABLE_PUSH_CREATE_USER = false/);
|
||||
});
|
||||
test("secrets remain server-side placeholders", () => {
|
||||
assert.equal((ini.match(/PRIVATE_SERVER_VALUE/g) || []).length, 2);
|
||||
assert.doesNotMatch(ini, /[a-f0-9]{40,}/);
|
||||
assert.match(unit, /User=git/);
|
||||
});
|
||||
test("product identity probe rejects Gitea being labeled as Forgejo", () => {
|
||||
const identity = parseProductIdentity(
|
||||
{ version: "1.23.7" },
|
||||
'<meta name="author" content="Gitea - Git with a cup of tea">',
|
||||
);
|
||||
assert.deepEqual(identity, {
|
||||
product: "GITEA",
|
||||
version: "1.23.7",
|
||||
author: "Gitea - Git with a cup of tea",
|
||||
});
|
||||
assert.notEqual(identity.product, "FORGEJO");
|
||||
});
|
||||
test("product identity probe recognizes Forgejo independently", () => {
|
||||
const identity = parseProductIdentity(
|
||||
{ version: "15.0.5" },
|
||||
'<meta name="author" content="Forgejo – Beyond coding. We forge.">',
|
||||
);
|
||||
assert.equal(identity.product, "FORGEJO");
|
||||
assert.equal(identity.version, "15.0.5");
|
||||
});
|
||||
Loading…
Reference in a new issue