Repository navigation
Releases
Releases · DejavuMoe/warpsocks
v0.1.1
Security
- hev-socks5-server no longer inherits the environment. It runs as uid 65532 and talks to SOCKS clients; it could read
ZT_CLIENT_SECRET,ZT_JWTandWARP_LICENSEfrom/proc/self/environ. compose.yamldrops all capabilities exceptNET_ADMIN,CHOWN,SETUID,SETGID,KILLandDAC_OVERRIDE, and setsno-new-privileges.- Stricter input validation:
ZT_TEAMmust be a bare team name (the service token is sent to<team>.cloudflareaccess.com);SOCKS_USER/SOCKS_PASSare limited to 255 bytes without control characters;WARP_DNSandSOCKS_UDP_ADDRreject IPv6 zones. - Access JWTs and oversized API error bodies no longer reach the logs; endpoint ports from the API are range-checked and bounded.
identity.jsonis written through a fresh 0600 temporary file and fsynced before the rename; the hev config is recreated rather than truncated.
Changes
- Docker health check every 60 s (was 30 s) with a 5 s start interval, so the container reports healthy sooner after start. The watchdog keeps probing every 30 s.
- Smaller binary: dropped
regexpand an unused API call. - README: Mermaid diagrams for the architecture, the self-healing loop and Zero Trust enrollment; benchmark results with charts.
Benchmarks
Same 1 vCPU VPS (Geekbench 5 single-core ≈ 400, 2 GB), consumer WARP, means of 5 rounds, compared with cmj2002/warp-docker:
| warpsocks | warp-docker | |
|---|---|---|
| Image download (amd64) | 5.1 MB | 386.4 MB |
| Memory: idle / 1,000 connections | 5.1 / 23.3 MiB | 78.2 / 145.0 MiB |
| CPU at idle | 0.24 % | 2.0 % |
| Download / upload, one stream | 43.7 / 41.1 MB/s | 22.6 / 26.3 MB/s |
| TLS handshake via proxy (direct 25 ms) | 33.9 ms | 40.1 ms |
| UDP DNS round trip (direct 1.7 ms) | 2.8 ms | no reply |
Upgrading
docker compose pull && docker compose up -d. Fetch the new compose.yaml to get the capability changes. Configurations with a zone in WARP_DNS/SOCKS_UDP_ADDR or URL characters in ZT_TEAM now fail with exit code 2.
安全
- hev-socks5-server 不再继承环境变量。它以 uid 65532 运行并直接面对 SOCKS 客户端,此前能从
/proc/self/environ读到ZT_CLIENT_SECRET、ZT_JWT和WARP_LICENSE。 compose.yaml去掉全部能力,只保留NET_ADMIN、CHOWN、SETUID、SETGID、KILL、DAC_OVERRIDE,并启用no-new-privileges。- 输入校验更严格:
ZT_TEAM只能是团队名(service token 会发往<team>.cloudflareaccess.com);SOCKS_USER/SOCKS_PASS不超过 255 字节且不含控制字符;WARP_DNS和SOCKS_UDP_ADDR不接受带 zone 的 IPv6 地址。 - Access JWT 和过长的 API 错误内容不再写入日志;API 返回的端点端口会校验范围并限制数量。
identity.json通过新建的 0600 临时文件写入,fsync 后再改名;hev 配置文件改为重建而不是截断。
改动
- Docker 健康检查改为每 60 秒一次(原 30 秒),启动阶段每 5 秒检查,容器启动后更快显示 healthy。看门狗仍每 30 秒探测。
- 二进制更小:去掉
regexp和一个未使用的 API 调用。 - README:用 Mermaid 图展示架构、自愈流程和 Zero Trust 注册;新增基准测试结果和图表。
基准测试
同一台 1 vCPU VPS(Geekbench 5 单核约 400,2 GB),普通 WARP,5 轮平均,对比 cmj2002/warp-docker:
| warpsocks | warp-docker | |
|---|---|---|
| 镜像下载(amd64) | 5.1 MB | 386.4 MB |
| 内存:空闲 / 1000 个连接 | 5.1 / 23.3 MiB | 78.2 / 145.0 MiB |
| 空闲 CPU | 0.24% | 2.0% |
| 单流下载 / 上传 | 43.7 / 41.1 MB/s | 22.6 / 26.3 MB/s |
| 经代理 TLS 握手(直连 25 ms) | 33.9 ms | 40.1 ms |
| UDP DNS 往返(直连 1.7 ms) | 2.8 ms | 无响应 |
升级
docker compose pull && docker compose up -d。如需新的能力限制,请同时更新 compose.yaml。WARP_DNS/SOCKS_UDP_ADDR 带 zone 或 ZT_TEAM 含 URL 字符的配置现在会以退出码 2 失败。
Full Changelog: v0.1.0...v0.1.1
v0.1.0
Full Changelog: https://github.com/DejavuMoe/warpsocks/commits/v0.1.0