Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
需求
托盘程序跑不进容器/服务器。要部署到 Docker、NAS 或任何无图形会话的机器,需要三样东西:不启托盘、有健康检查端点、有可复用的镜像。
修复
ZEN_GATE_HEADLESS=1等价于--no-tray,在flag.Parse()之后生效,显式传参的优先级不受影响。/healthz:与/health同义(Kubernetes 探针与 DockerHEALTHCHECK的默认约定名),响应体保持不变。Dockerfile(多阶段构建,alpine 运行层,ZEN_GATE_HOME=/data挂卷,内建HEALTHCHECK)+docker-compose.yml(8787 端口、命名卷、restart: unless-stopped)。配置目录走
ZEN_GATE_HOME,容器重建不丢配置。实测
在本机以空配置目录起了一个无头实例(
ZEN_GATE_HEADLESS=1 ZEN_GATE_HOME=… --port 18787):日志确认无窗口、正常出服务:
dashboard ready at http://127.0.0.1:18787。两点说明
ZEN_GATE_ALLOW_MULTI=1,否则第二次启动会去聚焦已有窗口 —— 这个行为我保留原样,没有改动。测试
go build ./.../go vet ./...通过;internal/gateway测试通过(22.2s)。Closes #79