File tree Expand file tree Collapse file tree 4 files changed +418
-12
lines changed
Expand file tree Collapse file tree 4 files changed +418
-12
lines changed Original file line number Diff line number Diff line change @@ -36,5 +36,5 @@ cert-deploy
3636certs
3737ssl
3838install.sh
39- Makefile
40- config.yaml
39+ config.yaml
40+ cert-deploy.log
Original file line number Diff line number Diff line change 1+ .PHONY : build build-mac build-linux build-windows compress build-compress proto clean install
2+
3+ # 默认目标
4+ all : proto build
5+
6+ # 构建二进制文件
7+ build : build-mac build-linux build-windows
8+ @echo " 所有平台构建完成"
9+
10+ # 构建 Mac 版本
11+ build-mac :
12+ @echo " 构建 Mac 版本..."
13+ @mkdir -p bin
14+ @GOOS=darwin GOARCH=amd64 go build -ldflags=" -s -w" -trimpath -o bin/cert-deploy-mac main.go
15+ @GOOS=darwin GOARCH=arm64 go build -ldflags=" -s -w" -trimpath -o bin/cert-deploy-mac-arm64 main.go
16+ @echo " Mac 版本构建完成"
17+
18+ # 构建 Linux 版本
19+ build-linux :
20+ @echo " 构建 Linux 版本..."
21+ @mkdir -p bin
22+ @GOOS=linux GOARCH=amd64 go build -ldflags=" -s -w" -trimpath -o bin/cert-deploy-linux main.go
23+ @GOOS=linux GOARCH=arm64 go build -ldflags=" -s -w" -trimpath -o bin/cert-deploy-linux-arm64 main.go
24+ @echo " Linux 版本构建完成"
25+
26+ # 构建 Windows 版本
27+ build-windows :
28+ @echo " 构建 Windows 版本..."
29+ @mkdir -p bin
30+ @GOOS=windows GOARCH=amd64 go build -ldflags=" -s -w" -trimpath -o bin/cert-deploy-windows.exe main.go
31+ @GOOS=windows GOARCH=arm64 go build -ldflags=" -s -w" -trimpath -o bin/cert-deploy-windows-arm64.exe main.go
32+ @echo " Windows 版本构建完成"
33+
34+ # 压缩二进制文件(需要安装 UPX)
35+ compress :
36+ @echo " 压缩二进制文件..."
37+ @if command -v upx > /dev/null 2>&1 ; then \
38+ upx --best bin/cert-deploy-linux* ; \
39+ echo " 压缩完成" ; \
40+ else \
41+ echo " UPX 未安装,跳过压缩步骤" ; \
42+ echo " 安装 UPX: brew install upx (macOS) 或 apt install upx (Ubuntu)" ; \
43+ fi
44+
45+ # 构建并压缩所有版本
46+ build-compress : build compress
47+ @echo " 构建和压缩完成"
Original file line number Diff line number Diff line change 77创建配置文件 ` config.yaml ` :
88
99``` yaml
10- # 证书部署配置
1110server :
11+ # 在 设置-->个人资料 中找到
1212 accessKey : " "
1313
14- # 证书存储配置
1514ssl :
16- # 证书存储根目录
15+ # 证书存储根目录,不配置默认放在【与程序同级目录/certs】
1716 path : " /etc/nginx/ssl"
1817` ` `
1918
2221### 基本命令
2322
2423` ` ` bash
25- # 显示帮助信息
26- cert-deploy --help
27-
28- # 启动守护进程模式
29- cert-deploy daemon
24+ ./cert-deploy --help # 显示帮助信息
25+
26+ ./cert-deploy daemon # 启动守护进程(后台运行)
27+ ./cert-deploy log # 查看守护进程日志,-f 实时跟踪日志输出
28+ ./cert-deploy restart # 重启守护进程
29+ ./cert-deploy start # 启动守护进程(前台运行)
30+ ./cert-deploy status # 查看守护进程状态
31+ ./cert-deploy stop # 停止守护进程
3032```
3133
3234## 许可证
You can’t perform that action at this time.
0 commit comments