Files
secgate-vpn-docker/Makefile
T
yuez cf2bbbb3d9 feat(ci): main 分支构建镜像并发布到 GHCR
- .github/workflows/docker.yml:push main / tag v* 构建 linux/amd64 镜像推
  ghcr.io/zgs225/secgate-vpn-docker(latest、客户端版本、sha-、semver tag),
  PR 只构建 + 冒烟检查;厂商 deb 由 fetch-client-deb.sh 在 CI 取包并校验,按
  版本缓存
- compose/Makefile/deploy-nas.sh 默认镜像改为 ghcr.io,新增 make pull,
  NAS 部署优先 docker pull,失败再回退 save/load
- README/SECURITY/vendor 文档补充 GHCR 用法与包可见性说明
- Dockerfile 补 OCI source/url/licenses 标签
2026-11-13 16:12:38 +08:00

66 lines
2.2 KiB
Makefile
Raw 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 shell window ruleset nas-deploy fetch rebuild 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
ruleset: ## 导出 tun0 路由为 clash ipcidr ruleset(需已登录)
@./scripts/export-clash-ruleset.sh
fetch: ## 从官方下载站取图形端安装包到 vendor/(不入库)
@./scripts/fetch-client-deb.sh
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