feat: 接入 AnyTLS 节点托管和用户流量同步

This commit is contained in:
2026-09-29 13:35:44 +08:00
parent 586c2399d1
commit ac5fed695c
24 changed files with 1413 additions and 185 deletions
+10 -2
View File
@@ -1,3 +1,4 @@
import { SING_BOX_VERSION } from "@/lib/anytls";
import { readFileSync } from "node:fs";
import path from "node:path";
import { decryptText } from "@/lib/crypto";
@@ -11,11 +12,18 @@ export function buildInstallScript(job: Installation) {
TOKEN: token,
INSTALL_ID: job.id,
SLUG: job.slug,
SING_BOX_VERSION,
};
return readFileSync(
path.join(process.cwd(), "lib/templates/install-node.sh"),
path.join(
process.cwd(),
"lib", "templates",
job.protocol === "anytls"
? "install-anytls.sh"
: "install-node.sh",
),
"utf8",
).replace(/__(PANEL|TOKEN|INSTALL_ID|SLUG)__/g, (_, key) =>
).replace(/__(PANEL|TOKEN|INSTALL_ID|SLUG|SING_BOX_VERSION)__/g, (_, key) =>
quote(values[key]),
);
}