feat: 接入 AnyTLS 节点托管和用户流量同步
This commit is contained in:
+10
-2
@@ -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]),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user