Files
yuez f04ce9dcbb feat: 多架构镜像(linux/amd64 + linux/arm64,均用厂商原生包)
- 厂商按架构发包:amd64 海光麒麟 1.1.3.1010701,arm64 鲲鹏麒麟 1.1.5.1010901
  (飞腾麒麟同一文件),均为 AArch64/x86-64 原生二进制
- Dockerfile 用 buildx 的 TARGETARCH 选 deb,一次构建出双架构 manifest
- fetch-client-deb.sh 支持按架构取包 / fetch-all;CI 缓存两个 deb 并逐一校验 md5
- CI: setup-qemu 模拟 arm64 RUN;PR 用 --load 的 amd64 镜像跑冒烟,
  另加原生 arm64 runner(ubuntu-24.04-arm)跑同一套冒烟
- 新增 scripts/smoke-image.sh:起临时容器验证 Xvfb/noVNC/SOCKS5/GUI 进程
  存活 + ELF 机器码与镜像架构一致(make smoke)
- 镜像 tag 不再含客户端版本号(两架构版本不同),版本写入
  /opt/sslvpnclient/.client-version 并由 entrypoint 打印
- verify.sh 同时校验两个 deb;README/vendor 文档更新
2026-11-13 17:05:04 +08:00

76 lines
2.7 KiB
Makefile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
SERVICE := secgate-gui
IMAGE := $(or $(SECGATE_IMAGE),ghcr.io/zgs225/secgate-vpn-docker:latest)
GUI := /opt/sslvpnclient/files/bin/sslvpn
URL := http://127.0.0.1:6080/vnc.html
.PHONY: help build pull up down restart ps logs url shot verify smoke shell window ruleset nas-deploy fetch fetch-all rebuild multiarch clean
help: ## 显示所有可用命令
@grep -hE '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
build: ## 本地构建镜像(按本机架构选 vendor/ 里的 deb,打 ghcr 同名 tag)
docker compose build
pull: ## 拉取 GitHub Actions 发布到 GHCR 的镜像(不想本地构建时用它)
docker compose pull $(SERVICE)
rebuild: ## 无缓存重建图形端镜像
docker compose build --no-cache secgate-gui
up: ## 启动图形端容器
docker compose up -d secgate-gui
@sleep 2; docker compose ps; echo; echo "浏览器打开: $(URL)"
down: ## 停止并删除图形端容器
docker compose down
restart: ## 重启图形端容器
docker compose restart secgate-gui
ps: ## 查看容器状态
docker compose ps
logs: ## 跟随容器内各服务日志(entrypoint/Xvfb/websockify)
docker compose logs -f --tail=80 $(SERVICE)
url: ## 打印 noVNC 地址
@echo $(URL)
shot: ## 截图当前桌面 → ./screenshots/(自检 GUI 是否正常渲染)
@mkdir -p screenshots
@docker exec $(SERVICE) scrot -o /tmp/screen.png
@docker cp $(SERVICE):/tmp/screen.png screenshots/gui-$$(date +%H%M%S).png >/dev/null
@ls -t screenshots/*.png | head -1
window: ## 列出 X 里的窗口(确认客户端窗口存在)
@docker exec $(SERVICE) xwininfo -root -tree | head -30
verify: ## 自检:X / noVNC / SOCKS5 / 客户端进程 / 窗口 / 隧道
@./scripts/verify.sh
smoke: ## 运行时冒烟:临时起容器确认 X/noVNC/SOCKS/GUI 都活着(不登录)
@./scripts/smoke-image.sh $(IMAGE)
ruleset: ## 导出 tun0 路由为 clash ipcidr ruleset(需已登录)
@./scripts/export-clash-ruleset.sh
fetch: ## 取本机架构的厂商 deb 到 vendor/(不入库)
@./scripts/fetch-client-deb.sh
fetch-all: ## 取 amd64 + arm64 两个 deb(多架构构建用)
@./scripts/fetch-client-deb.sh all
multiarch: ## 本地构建 amd64+arm64 并推送(需先 docker login;平时交给 CI)
docker buildx build --platform linux/amd64,linux/arm64 -t $(IMAGE) \
--build-arg IMAGE_VERSION=$$(git rev-parse --short HEAD) --push .
nas-deploy: ## 部署/更新到 NAS(NAS_HOST=...,端口可用 SOCKS_PORT/VNC_PORT 覆盖)
@./scripts/deploy-nas.sh
shell: ## 进入容器
docker exec -it $(SERVICE) bash
clean: ## 停容器并删除本地镜像
docker compose down
docker rmi $(IMAGE) 2>/dev/null || true