编译工具优化

This commit is contained in:
2026-07-26 12:17:09 +08:00
parent 18e8098aa4
commit 469a3687ca
4 changed files with 28 additions and 11 deletions
BIN
View File
Binary file not shown.
+1 -3
View File
@@ -46,14 +46,12 @@ func getFrpcPath() (string, error) {
switch { switch {
case runtime.GOOS == "windows" && runtime.GOARCH == "amd64": case runtime.GOOS == "windows" && runtime.GOARCH == "amd64":
fileName = "frpc_windows_amd64.exe" fileName = "frpc_windows_amd64.exe"
case runtime.GOOS == "windows" && runtime.GOARCH == "386":
fileName = "frpc_windows_386.exe"
case runtime.GOOS == "linux" && runtime.GOARCH == "amd64": case runtime.GOOS == "linux" && runtime.GOARCH == "amd64":
fileName = "frpc_linux_amd64" fileName = "frpc_linux_amd64"
case runtime.GOOS == "linux" && runtime.GOARCH == "arm64": case runtime.GOOS == "linux" && runtime.GOARCH == "arm64":
fileName = "frpc_linux_arm64" fileName = "frpc_linux_arm64"
case runtime.GOOS == "linux" && runtime.GOARCH == "arm": case runtime.GOOS == "linux" && runtime.GOARCH == "arm":
fileName = "frpc_linux_armv7" fileName = "frpc_linux_arm_hf"
default: default:
path, err := exec.LookPath("frpc") path, err := exec.LookPath("frpc")
if err == nil { if err == nil {
+11 -1
View File
@@ -211,7 +211,17 @@ frpc-console 遵循 **“够用就好”** 的原则:
· ✨ 多平台 frpc 自动适配</br> · ✨ 多平台 frpc 自动适配</br>
· 🐳 Docker 镜像支持 · 🐳 Docker 镜像支持
### 2.0-Release (正在修整,后续开发) ### 1.5-Release (2026-07-25)
· ✨ 全局配置页面卡片式重构(服务器连接 / 传输配置 / 日志配置)</br>
· ✨ 新增运行日志面板(实时查看 frpc 日志,8 秒自动刷新)</br>
· ✨ frp v2 隧道支持 UI 占位(灰标禁用,为 2.0 预留)</br>
· ✨ 数据库 Schema 自动迁移(新增字段自动补全,升级无忧)</br>
· ✨ 默认配置改为通用占位符</br>
· 🎨 样式拆分与优化</br>
· 🐛 修复配置页面结构错乱、日志行泛光异常等问题</br>
### 2.0-Release (猫猫正在修整,等待后续开发)
--- ---
+16 -7
View File
@@ -20,15 +20,14 @@ type Platform struct {
var platforms = []Platform{ var platforms = []Platform{
{"windows", "amd64", "Windows x86-64", ".exe"}, {"windows", "amd64", "Windows x86-64", ".exe"},
{"windows", "386", "Windows x86", ".exe"},
{"linux", "amd64", "Linux x86-64", ""}, {"linux", "amd64", "Linux x86-64", ""},
{"linux", "arm64", "Linux ARM64", ""}, {"linux", "arm64", "Linux ARM64", ""},
{"linux", "armv7", "Linux ARMv7l", ""}, {"linux", "arm", "Linux ARMv7l", ""}, // GOARCH=arm, GOARM=7
} }
const ( const (
Version = "1.0.0" Version = "1.5.0"
BuildTime = "2026-07-24" BuildTime = "2026-07-25"
Binary = "frpc-console" Binary = "frpc-console"
) )
@@ -53,7 +52,7 @@ func main() {
} }
} }
fmt.Println("❌ 不支持的平台:", target) fmt.Println("❌ 不支持的平台:", target)
fmt.Println(" 可用: windows/amd64, windows/386, linux/amd64, linux/arm64, linux/armv7") fmt.Println(" 可用: windows/amd64, linux/amd64, linux/arm64, linux/armv7")
fmt.Println(" 或: all, list, clean") fmt.Println(" 或: all, list, clean")
return return
} }
@@ -126,10 +125,14 @@ func build(p Platform, silent bool) {
return return
} }
outName := Binary + "-" + p.OS + "-" + p.Arch + p.Ext // 构建输出文件名
outName := Binary + "-" + p.OS + "-" + p.Arch
if p.Arch == "arm" {
outName += "v7" // 标注 ARMv7 版本
}
outName += p.Ext
outPath := filepath.Join(outDir, outName) outPath := filepath.Join(outDir, outName)
// 用 "go" 而不是硬编码路径,让系统去 PATH 里找
cmd := exec.Command("go", "build", cmd := exec.Command("go", "build",
"-ldflags=-s -w -X main.version="+Version, "-ldflags=-s -w -X main.version="+Version,
"-o", outPath, "-o", outPath,
@@ -140,6 +143,12 @@ func build(p Platform, silent bool) {
"GOARCH="+p.Arch, "GOARCH="+p.Arch,
"CGO_ENABLED=0", "CGO_ENABLED=0",
) )
// ARM 架构指定 GOARM=7
if p.Arch == "arm" {
cmd.Env = append(cmd.Env, "GOARM=7")
}
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr