Repository navigation
Security / 安全修复
本版本修复了以下影响 v0.6.6.6 及更早版本的安全问题,建议尽快升级。This release fixes the following issues affecting v0.6.6.6 and earlier; upgrading is recommended.
- 写令牌可读取配置目录(高):
storage:write、webservice:write等令牌可把配置目录挂为存储或静态站点后读取account.json并伪造管理员会话。现在存储挂载、静态站点与 WebDAV/FTP/SMB 拒绝配置目录及其子目录;包含配置目录的目录照常共享,但配置目录被隐藏。EasyTier/Tailscale/NetBird 程序路径与备份口令改为仅登录会话可改,令牌编辑器标出可读写服务器文件的模块(GHSA-mppw-4rpr-jj6r)。 / Write tokens could read the config directory (high): tokens such asstorage:writeorwebservice:writecould expose the config directory as a mount or static site, readaccount.jsonand forge an admin session. Mounts, static sites and WebDAV/FTP/SMB now refuse the config directory and anything inside it; directories containing it still work with the config directory hidden. Managed program paths and the backup passphrase are session-only, and the token editor marks modules whose write access reaches server files (GHSA-mppw-4rpr-jj6r). - 站点第三方登录回跳地址可被 Host 操纵(高):通配或默认站点的第三方登录可把登录票据送到攻击者域名。现在只从指向本实例的地址发起(GHSA-xww7-c723-p3wf)。 / Site third-party sign-in redirect controlled by Host (high): on wildcard or default sites the sign-in ticket could be sent to an attacker's host; sign-in now only starts from addresses that point to this instance (GHSA-xww7-c723-p3wf).
- SMB 认证前解析在 32 位构建上可单包崩溃(高):偏移与长度改为 64 位判断,单连接 panic 只断开该连接;未登录连接增加超时、请求大小与连接数上限(GHSA-gw77-6jx4-jpx7)。 / SMB pre-auth crash on 32-bit builds (high): offsets and lengths are checked in 64-bit arithmetic, a panic only drops its connection, and unauthenticated connections get timeouts, a request size limit and connection caps (GHSA-gw77-6jx4-jpx7).
- 其他(中/低):飞牛网关模式下同主机其他端口页面可借管理员 Cookie 发请求;管理端 Cookie 会转发给同主机名站点;只读账号可见部分凭据;WebDAV/FTP 跟随指向共享外的符号链接;诱饵端口/扫描检测按可伪造的单个 SYN 封禁;Webhook/PushPlus 拼入未转义访客文本;站点用户密码明文保存(改为 bcrypt);管理界面增加 CSP,HTTPS 下 Cookie 带 Secure;跨域只接受站点自身域名;Passkey 登录挑战按来源限制;诊断包脱敏补全。 / Also (medium/low): fnOS gateway same-host cross-port requests; admin cookies forwarded to same-host sites; partial credentials visible to read-only identities; WebDAV/FTP following symlinks outside the share; decoy/scan bans on a single forgeable SYN; unescaped visitor text in Webhook/PushPlus payloads; site user passwords stored in plain text (now bcrypt); CSP for the admin UI and Secure cookies over HTTPS; cross-origin access limited to the site's own domains; per-source Passkey challenge limits; more redaction in diagnostics bundles.
- 发布签名:
checksums.txt起用 minisign 签名(checksums.txt.minisig),在线升级先验签再核对 SHA-256;v0.6.8 及之后缺少签名文件的版本拒绝在线升级。 / Release signing:checksums.txtis signed with minisign (checksums.txt.minisig); online upgrades verify the signature before SHA-256, and releases of v0.6.8 or later without a signature are refused.
中文
管理界面
- 导航收敛:相关页面合并为带标签页的页面,侧边栏从 39 项减到 27 项,旧地址自动跳转;手机抽屉分组可折叠。
- 全局搜索:Ctrl/⌘+K 搜索页面、标签页、站点域名、端口转发规则、DDNS 记录与证书。
- 首次使用:全新安装改密后选择使用场景(发布网站、端口转发/打洞、动态域名、组网、文件共享、VPS 入口或全部),按场景开启模块;总览顶部的「开始使用」清单按实际配置打勾。
- 快速建站向导:三步发布一个站点:域名、后端地址(带连通性测试与 Home Assistant、Jellyfin、Emby、Vaultwarden、Nextcloud、Immich、Proxmox VE、群晖、飞牛等模板)、HTTP 或 HTTPS(就地申请证书)。
- 空列表模板:端口转发与 DDNS 的空列表提供常见场景模板。
- 其他:HTTPS 站点行显示所匹配证书的剩余天数;表单保存前检查必填项;列表加载失败显示原因与重试;手机端按钮与顶栏改进,顶栏显示当前页面名;页面标题链接到官网文档;状态色对比度与无障碍改进。
导入
- Nginx Proxy Manager:nginx 导入直接支持 NPM 配置,
set变量代入proxy_pass与跳转目标,Force SSL、Cache Assets 等映射为 Gately 设置。 - Sun-Panel:导航面板可导入 Sun-Panel 1.x(.sun-panel.json)与 2.x(.zip)导出,新建面板或合并到已有面板。
导航面板
- 布局:每个面板可选卡片或桌面应用图标两种链接样式,可调图标大小、每行数量(宽屏与手机分别设置)、间距与内容宽度,访客可切换样式。
- 地址选择器:带其他访问方式的链接点击后弹出地址选择(桌面为浮层、手机为底部弹层,支持键盘),不可用地址划线显示。
- 开关:分组数量与多地址角标(默认关闭);「登录以查看更多链接」只在页面原本为空时显示。
入侵防护与访问控制
- 诱饵端口与扫描检测只对完成 TCP 握手的来源计数封禁,不再因伪造源地址的 SYN 误封。
- 管理员登录成功后的免封只覆盖诱饵端口与端口扫描;日志规则、路径探测、TLS、敲门与文件服务封禁照常生效。
- WebDAV/FTP/SMB 登录失败发布
fileauth.failed事件,附规则模板。 - 封禁表上限 32768 条,满时先淘汰过期与最早的临时自动封禁,永久与手动封禁不淘汰。
端口转发与协议分流
- 每个 TCP 端口限制单一来源(IPv4 或 IPv6 /64)的并发连接,默认为端口上限的一半,可按规则与全局设置调整;回环与内网来源不受限。
- 双方在首包超时(默认 60 秒)内都不发数据的 TCP 连接会被关闭。
- 目标地址写成 host:port 时界面即时提示。
frp、DNS 与 WAF
- frps 可监听 KCP 与 QUIC(UDP 端口),frpc/frps 可调 QUIC 参数,frps 可自动放行防火墙。
- 自定义 DNS:首选服务器 1 秒无结果或失败时并行查询下一台,取最先返回的结果。
- 动态域名:主机记录统一小写,Porkbun 找不到记录时回退为列出全域(#99);A/AAAA 按地址比较,展开写法的 IPv6 不再被当成变化。
- WAF:正则预过滤默认开启(可关)。
日志与性能
- 新增日志级别设置(默认 info,可用
GATELY_LOG_LEVEL),端口转发与协议分流的逐连接记录默认不再写入。 - 日志与翻译、反向代理、封禁表、DNS 查询、端口转发等热路径减少分配与锁竞争;管理界面按需加载组件与语言包,首屏更小。
其他
- 演示模式:
-demo/GATELY_DEMO=1启动只读公开实例,一键只读登录,数据每小时重置(deploy/demo)。 - 使用问题请先到 GitHub Discussions 的 Q&A,Telegram 群用于即时交流。
升级提示
- 站点用户密码改为 bcrypt 哈希保存,接口只返回掩码;旧版本保存的明文照常可用,在所在监听下次保存时转换。
- 日志级别默认为 info:需要端口转发逐连接记录时,在设置中改为 debug。
- 指向配置目录本身或其子目录的存储挂载、静态站点与文件服务目录升级后不再提供服务,日志中会列出。
更新说明:https://gately.cn/news/v0.6.8
English
Admin UI
- Leaner navigation: related pages are merged into tabbed pages and the sidebar goes from 39 to 27 entries; old addresses redirect. Sidebar groups fold in the phone drawer.
- Global search: Ctrl/⌘+K searches pages, tabs, site domains, port forwarding rules, DDNS records and certificates.
- First run: after the password change a fresh install asks what Gately will be used for (publishing sites, port forwarding / hole punching, dynamic DNS, mesh networking, file sharing, VPS entry point, or everything) and turns on the matching modules; a Getting started checklist on the overview ticks steps off from the actual configuration.
- Quick site wizard: publish a site in three steps: domain, backend address (with a reachability test and templates for Home Assistant, Jellyfin, Emby, Vaultwarden, Nextcloud, Immich, Proxmox VE, Synology DSM and fnOS), then HTTP or HTTPS with a certificate requested on the spot.
- Empty-list templates: port forwarding and DDNS offer common scenario templates when empty.
- Also: HTTPS site rows show the remaining days of the matched certificate; forms check required fields before saving; lists show the failure reason with a Retry button; better phone buttons and a top bar with the current page name; page headers link to the docs; contrast and accessibility fixes.
Import
- Nginx Proxy Manager: the nginx import reads NPM configs directly, substitutes
setvariables intoproxy_passand redirect targets, and maps Force SSL, Cache Assets and other NPM options to Gately settings. - Sun-Panel: navigation panels import Sun-Panel 1.x (.sun-panel.json) and 2.x (.zip) exports into a new panel or an existing one.
Navigation panels
- Layout: per panel, links as cards or desktop-app icons, icon size, links per row (wide screens and phones separately), spacing and content width; visitors can switch the style.
- Address chooser: links with other ways to open show an address chooser on click (a popover on desktop, a bottom sheet on phones, keyboard friendly), with unavailable addresses struck through.
- Switches: group counts and an address-count badge (both off by default); the "sign in to see more" hint only shows on an otherwise empty page.
Intrusion prevention and access control
- Decoy ports and scan detection count only sources that complete the TCP handshake, so forged SYNs no longer cause bans.
- A successful admin sign-in now exempts the address only from decoy-port and port-scan bans; log rules, web probing, TLS, knock and file-service bans still apply.
- WebDAV/FTP/SMB sign-in failures publish a
fileauth.failedevent with a rule template. - The ban table is capped at 32768 entries; when full, expired and the oldest temporary automatic bans are evicted first, never permanent or manual ones.
Port forwarding and protocol routing
- Each TCP port limits concurrent connections from a single source (IPv4 address or IPv6 /64), by default half of the port's limit, adjustable per rule and globally; loopback and private sources are exempt.
- TCP connections where neither side sends data within the first data timeout (60 seconds by default) are closed.
- The form warns right away when a target address is written as host:port.
frp, DNS and WAF
- frps can listen for KCP and QUIC on UDP ports, frpc/frps get QUIC tuning, and frps can open the firewall automatically.
- Custom DNS: when the preferred server fails or gives no answer within 1 second, the next one is queried in parallel and the first answer wins.
- Dynamic DNS: host records are lower-cased and Porkbun falls back to listing the whole domain when a record is not found (#99); A/AAAA values are compared as addresses, so an expanded IPv6 no longer counts as a change.
- WAF: the regex pre-filter is on by default (can be turned off).
Logs and performance
- New log level setting (default info, also
GATELY_LOG_LEVEL); per-connection records of port forwarding and protocol routing are no longer written by default. - Fewer allocations and less lock contention on the logging, translation, reverse proxy, ban table, DNS and port forwarding hot paths; the admin UI loads components and language packs on demand for a smaller first load.
Also
- Demo mode:
-demo/GATELY_DEMO=1starts a read-only public instance with one-click read-only sign-in and hourly data reset (deploy/demo). - Usage questions go to GitHub Discussions Q&A first; the Telegram group is for chat.
Upgrade notes
- Site user passwords are stored as bcrypt hashes and the API only returns masks; plaintext passwords saved by earlier versions keep working and are converted the next time their listener is saved.
- The log level defaults to info; set it to debug in Settings to get per-connection port forwarding records.
- Storage mounts, static sites and file service directories pointing at the config directory itself or inside it stop being served after the upgrade and are listed in the logs.
Release notes: https://gately.cn/en/news/v0.6.8