Repository navigation
中文
端口敲门:每人一份密钥
- 身份:规则可添加身份,每个身份(人或设备)有自己的加密密钥与 HMAC 密钥,可单独停用、重新生成,每条规则最多 64 个;日志、通知与放行记录写明敲门的身份,停用或换掉某人的密钥只撤销这个人的放行。
- 停用共享密钥、一次只放行一个地址(同一身份从新地址敲门时撤销旧地址的放行)。
- 伪造报文校验复用 HMAC 对象,64 个身份时开销约减半;来源表满时淘汰最久未用的网段。
端口转发 / 协议分流
- 不受单来源上限的来源:全局设置新增 IP / CIDR 列表,公网中转或前置代理让所有访客显示为同一来源时不再被单来源最大连接数卡住;超限日志写明被计数的来源与上限。
- 修复:填写目标地址后失去焦点仍提示
targetAddresses为必填。
Web 服务
- 反代到另一台 Gately:v0.6.8 起会剥掉所有
gately_token/gately_entry/gately_login_nonce,后端 Gately 登录后立即 401、安全入口一直 404、经外层第三方登录提示浏览器不一致。现在只剥本实例签发且仍有效的 Cookie。 - 开启「转发 Gately 登录 Cookie」时转发本实例校验不过的
gately_admin,双层部署时内层的「后台登录免认证」可生效。 - 修复 421:v0.6.8.1 起,前置反向代理以 HTTP/2、后端主机名作 SNI 连接时,落到默认站点的请求返回 421。现在只有 SNI 是本监听某站点的域名时才返回 421。
- 同一 IP 并发的正确登录不再被当成失败过多;错误密码上限仍为 10 次,排队超过 5 秒或队列满时返回 429。
- 「后台登录免认证」去掉 v0.6.8.1 的跨父域握手(后台入口地址),重新只在单点登录域内生效。
导航面板(#104)
- 链接拖动排序(鼠标与触摸、自动滚动、Esc 取消、选择模式多选移动);面板列表分组、搜索、紧凑视图与排序批量。
性能
- 同一监听下相同后端与连接设置的站点共用后端连接池,反代不再复制每个请求;站点分钟统计按小时块分配,1000 站点峰值内存 463 MiB → 225 MiB。
- GC 百分比为 0 时,内存不少于 1 GiB 默认 200,否则 100;设置了
GOGC环境变量时沿用它。 - 入侵防护跟随日志改为写入即读(Linux inotify),封禁写防火墙 250 ms 合批。
其他
- 手写配置缺字段时,Web 服务、DDNS、STUN、SSL、WAF、入侵防护、网络唤醒、通知、File Browser、Web 终端、性能监控加载时补上默认值。
- Webhook 变量列表补上
{server};官网新增教程与性能对比页。
升级提示
- 用过 v0.6.8.1「后台入口地址」的,单点登录域以外的站点恢复为正常站点认证。
- 反代到另一台 Gately 的 Cookie 问题只需升级外层。
更新说明:https://gately.cn/news/v0.6.8.2
English
Port knocking: keys per person
- Identities: a rule can have identities, each person or device with its own encryption and HMAC keys that can be disabled or regenerated on their own, up to 64 per rule. Logs, notifications and grants name the identity that knocked, and disabling or replacing someone's keys revokes only their grants.
- Disable shared keys and one address at a time (a knock from a new address revokes the identity's grant on the old one).
- Forged packets are checked with reused HMAC objects, about half the cost with 64 identities; a full source table evicts the idlest network.
Port forwarding / Protocol routing
- Sources without per-source limit: an IP / CIDR list in the global settings, for a public relay or front proxy that makes every visitor appear as one source; the per-source limit warning names the counted source and the limit.
- Fix: the target address field kept saying
targetAddressesis required after it was filled in.
Web services
- Proxying to another Gately: since v0.6.8 every
gately_token,gately_entryandgately_login_noncewas stripped, so the backend Gately answered 401 right after sign-in, its safe entry kept answering 404 and third-party sign-in through the outer site failed with a browser mismatch. Only cookies this instance issued and still accepts are stripped now. - With "Forward Gately sign-in cookies", a
gately_adminthis instance cannot verify is forwarded, so the inner Gately's admin sign-in bypass works in a two-layer setup. - 421 fix: since v0.6.8.1 a front reverse proxy connecting over HTTP/2 with the backend host as SNI got 421 for requests served by the default site. 421 is now only returned when the SNI is a domain this listener has a site for.
- Concurrent correct sign-ins from one IP are no longer rejected as too many failures; the limit of 10 wrong passwords stays, and a check that waits over 5 seconds or finds the queue full gets 429.
- The admin sign-in bypass drops the cross-parent-domain handshake of v0.6.8.1 (admin entry URL) and works only under the single sign-on domain again.
Navigation panels (#104)
- Drag links to reorder (mouse and touch, auto-scroll, Esc to cancel, move several in Select mode); the panel list has groups, search, a compact view and Sort & batch.
Performance
- Sites on one listener with the same backend and connection settings share a backend connection pool, and the proxy no longer copies each request; per-site minute statistics use hourly blocks, 1000-site peak memory 463 MiB → 225 MiB.
- With the GC percent setting at 0, the default is 200 with at least 1 GiB of memory and 100 otherwise; a
GOGCenvironment variable is kept. - Intrusion prevention reads followed logs as they are written (inotify on Linux), and ban list writes to the firewall are batched every 250 ms.
Other
- Hand-edited configs with missing fields get the same defaults as saving in Web services, DDNS, STUN, SSL, WAF, intrusion prevention, Wake-on-LAN, notifications, File Browser, Web Terminal and performance monitoring.
{server}in the webhook variable list; the website adds tutorials and a benchmarks page.
Upgrade notes
- If you used the v0.6.8.1 admin entry URL, sites outside the single sign-on domain go back to normal site authentication.
- The cookie fix for proxying to another Gately only needs the outer instance upgraded.
Release notes: https://gately.cn/en/news/v0.6.8.2