2 Commits

Author SHA1 Message Date
0c66722989 feat: "支持arm架构"
All checks were successful
release / release (push) Successful in 17s
2026-05-27 16:19:36 +08:00
d21dcaa303 fix
All checks were successful
release / release (push) Successful in 31s
2026-05-24 15:07:00 +08:00
2 changed files with 23 additions and 4 deletions

View File

@@ -1,10 +1,26 @@
"use strict"; "use strict";
const os = require("node:os");
const path = require("node:path"); const path = require("node:path");
const { randomBytes } = require("node:crypto"); const { randomBytes } = require("node:crypto");
const DEFAULT_FRP_VERSION = "0.58.1"; const DEFAULT_FRP_VERSION = "0.58.1";
const DEFAULT_FRP_ARCH = "amd64";
// Map Node's os.arch() to the arch token frp uses in its release asset names
// (e.g. frp_0.58.1_linux_arm64.tar.gz). Falls back to amd64 for the common case.
function detectFrpArch() {
switch (os.arch()) {
case "x64": return "amd64";
case "arm64": return "arm64";
case "arm": return "arm";
case "ia32": return "386";
case "mips": return "mips";
case "mipsel": return "mipsle";
default: return "amd64";
}
}
const DEFAULT_FRP_ARCH = detectFrpArch();
const DEFAULT_FRP_SERVER_ADDR = "81.70.134.9"; const DEFAULT_FRP_SERVER_ADDR = "81.70.134.9";
const DEFAULT_FRP_SERVER_PORT = 15443; const DEFAULT_FRP_SERVER_PORT = 15443;
const DEFAULT_SERVICE_NAME = "frpc"; const DEFAULT_SERVICE_NAME = "frpc";
@@ -212,6 +228,7 @@ function buildGlobals({ serverAddr, serverPort, token, tlsEnable, tcpMux, logFil
module.exports = { module.exports = {
DEFAULT_FRP_VERSION, DEFAULT_FRP_VERSION,
DEFAULT_FRP_ARCH, DEFAULT_FRP_ARCH,
detectFrpArch,
DEFAULT_FRP_SERVER_ADDR, DEFAULT_FRP_SERVER_ADDR,
DEFAULT_FRP_SERVER_PORT, DEFAULT_FRP_SERVER_PORT,
DEFAULT_SERVICE_NAME, DEFAULT_SERVICE_NAME,

View File

@@ -48,7 +48,6 @@ function zshInstallPlan() {
const steps = [ const steps = [
run("apt update", "sudo", aptArgs("update")), run("apt update", "sudo", aptArgs("update")),
run("apt upgrade", "sudo", aptArgs("upgrade", "-y")),
run("install zsh & friends", "sudo", aptArgs("install", "zsh", "git", "curl", "wget", "-y")), run("install zsh & friends", "sudo", aptArgs("install", "zsh", "git", "curl", "wget", "-y")),
run("git credential helper = store", "git", ["config", "--global", "credential.helper", "store"]), run("git credential helper = store", "git", ["config", "--global", "credential.helper", "store"]),
run("change shell to zsh", "sudo", ["chsh", "-s", "/bin/zsh", os.userInfo().username]), run("change shell to zsh", "sudo", ["chsh", "-s", "/bin/zsh", os.userInfo().username]),
@@ -80,8 +79,11 @@ function gitPluginStep(name, repo, destination) {
function condaInstallPlan(options = {}) { function condaInstallPlan(options = {}) {
const installDir = options.installDir || path.join(os.homedir(), "miniconda3"); const installDir = options.installDir || path.join(os.homedir(), "miniconda3");
const installer = "/tmp/Miniconda3-latest-Linux-x86_64.sh"; // Miniconda asset naming uses uname-style arch tokens (x86_64 / aarch64).
const url = "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"; const condaArch = os.arch() === "arm64" ? "aarch64" : "x86_64";
const installerName = `Miniconda3-latest-Linux-${condaArch}.sh`;
const installer = `/tmp/${installerName}`;
const url = `https://repo.anaconda.com/miniconda/${installerName}`;
const condaBin = path.join(installDir, "bin", "conda"); const condaBin = path.join(installDir, "bin", "conda");
return { return {