Repository navigation
中文
rclone 挂载(#158)
- 「文件服务」分组新增「rclone 挂载」:托管 rclone,把 WebDAV 网盘挂载为本机目录或磁盘(Linux/OpenWrt/FreeBSD/Docker 经 FUSE;macOS 无 macFUSE/FUSE-T 时自动用 NFS,免驱动;Windows 经 WinFsp)。
- 在线安装、更新与回滚;标准/影音/低内存预设;启用即挂载,停用、删除或退出时卸载,重启时只清理 rclone 自己的失联挂载;只改名称、备注、分组不重新挂载;进程反复退出时卡片显示次数与原因。
- 密码经环境变量传递;额外参数拒绝开放网络服务、读写任意文件或执行命令的选项(
--rc*、--addr、--config*、--password-*、--log-file、--dump*等);挂载点与缓存目录不能位于系统目录、.ssh或配置目录。挂载点失联时模块不再卡住。 - Docker 镜像内置 fuse3(需
/dev/fuse、SYS_ADMIN,建议stop_grace_period: 40s);从 Lucky 导入时「挂载到系统」的 WebDAV 存储同时导入为挂载点(默认停用)。
Web 服务
- 加密 SNI(ECH,#160):HTTPS 监听开启 ECH 并填写公开域名,生成 X25519 密钥与 ECHConfigList,界面给出 HTTPS 记录(含非 443 端口的
port=与 HTTP/3 的h3);POST /api/webservice/listeners/{key}/ech/rotate轮换密钥热更新,上一把继续可解密;私钥不经接口输出、不随复制带走。关闭 HTTPS 会同时关闭 ECH。 - 单页应用回退(#159,
spaFallback):缺失文件以 200 返回根目录index.html(含/u/john.doe这类带点路由),常见静态资源扩展名仍为 404,站点自设的Cache-Control保留;nginx 导入把try_files ... /index.html转为该开关。
协议分流与端口转发
- HTTP 路由按请求头分流(#163):最多 4 个条件、
*通配、不区分大小写;按连接判断第一个请求,不能用作拦截或安全防护。请求头增量解析,32 KB 慢速请求头的处理开销从约 3.3 秒降到约 28 毫秒。 - 交给本机 Web 监听(#161,
targetWeb):进程内交接,无回环端口与 PROXY 协议,站点看到访客真实地址,访问控制、WAF、日志照常;改配置断连防护能识别这条访问路径;引用的监听停用或不存在时界面标注、日志限频。 - 经代理连接目标(#164,
upstreamProxy):http/https/socks5 或更新代理,密码掩码,仅 TCP。
证书
- 从 URL 拉取(#162,
source: url):每 30 分钟从上游下载证书与私钥,匹配且未过期才替换,随后执行映射与部署;上游离线时保留旧证书并提示,到期提醒照常。从另一台 Gately 拉取需要证书模块写权限的 API 令牌。 - 请求头、地址签名与密码掩码;改了下载地址的主机或协议须重新填写凭据;带凭据时公网地址必须 https,拒绝 https→http 重定向;单次下载上限 1 MB。
通知与登录
- Bark 推送加密(#157):
cipherModeGCM/CBC/ECB,cipherKey16/24/32 字节对应 AES-128/192/256,每条随机 IV;选 ECB 时界面提示风险。 - OIDC/Google 身份字段(#152,
identityClaim:auto/email/preferred_username/sub):sub 与已验证邮箱作为别名匹配允许名单。选用户名时,形如邮箱或纯数字的用户名须与本人已验证邮箱或 sub 一致,否则拒绝登录;Google 不可选用户名。
修复
- 在线升级弹窗停在「正在校验 SHA-256」(#155):状态丢失时按
/api/status版本号确认结果。 - 证书 PEM 只保留证书块,夹带的私钥不再出现在视图、下载链接与映射文件中(旧配置加载时清理)。
- 各列表的新增接口忽略请求体中的
key,不再沿用已有条目的密钥(如 ECH 私钥、站点用户密码)。 - 进程托管:Before 钩子执行期间被停止时不再启动进程。
Gately 由作者一人业余开发维护,所有功能免费。如果它帮到了你,欢迎赞助支持后续开发;在留言里写下昵称会列入致谢名单。
English
rclone mounts (#158)
- New rclone Mounts page under File services: Gately hosts rclone and mounts WebDAV drives as local directories or disks (FUSE on Linux/OpenWrt/FreeBSD/Docker; NFS on macOS when macFUSE/FUSE-T is not installed, no driver needed; WinFsp on Windows).
- Online install, update and rollback; standard, media and low-memory presets; enabling mounts and disabling, deleting or quitting unmounts; on restart only rclone's own stale mounts are cleaned; editing only the name, remark or group does not remount; a mount whose rclone keeps exiting shows the count and last reason.
- Passwords travel in environment variables; extra arguments reject options that open network services, read or write arbitrary files or run commands (
--rc*,--addr,--config*,--password-*,--log-file,--dump*and more); mount points and the cache root cannot be in system directories,.sshor the config directory. A hung mount no longer blocks the module. - The Docker image ships fuse3 (needs
/dev/fuseandSYS_ADMIN;stop_grace_period: 40srecommended). Lucky import turns WebDAV storages with "Mount to system" into mount points (disabled by default).
Web service
- Encrypted Client Hello (ECH, #160): turn on ECH for an HTTPS listener with a public name; Gately generates an X25519 key and the ECHConfigList and shows an HTTPS record (with
port=off 443 andh3when HTTP/3 is on).POST /api/webservice/listeners/{key}/ech/rotaterotates without a restart and the previous key keeps decrypting; private keys never leave the server or a copy. Turning HTTPS off also turns ECH off. - Single-page app fallback (#159,
spaFallback): missing files return the rootindex.htmlwith 200 (dotted routes such as/u/john.doeincluded), common static asset extensions still 404, and a siteCache-Controlheader is kept; nginx import convertstry_files ... /index.html.
Protocol routing and port forwarding
- HTTP routes match request headers (#163): up to 4 conditions,
*wildcards, case-insensitive; decided per connection on the first request, not a security control. Headers are parsed incrementally: a slow 32 KB header went from about 3.3 s to about 28 ms of work. - Hand routes to a local web listener (#161,
targetWeb): handed over in process with no loopback port or PROXY protocol, sites see the real visitor address, access control, WAF and logs apply; the access path check sees this path; disabled or missing listeners are marked in the UI and logged at most once a minute. - Connect to targets through a proxy (#164,
upstreamProxy): http/https/socks5 or the update proxy, password masked, TCP only.
Certificates
- Fetch from URL (#162,
source: url): downloads the certificate and key every 30 minutes and replaces the local one only when they match and have not expired, then runs mapping and deployments; the old certificate stays while the upstream is offline, with expiry warnings as usual. Pulling from another Gately needs an API token with certificate write access. - Headers, URL signatures and passwords are masked; changing the host or scheme of a download URL requires entering the credentials again; with credentials, public hosts need https and https-to-http redirects are refused; 1 MB per download.
Notifications and sign-in
- Bark push encryption (#157):
cipherModeGCM/CBC/ECB,cipherKeyof 16/24/32 bytes for AES-128/192/256, random IV per message; the UI warns when ECB is chosen. - OIDC/Google identity field (#152,
identityClaim: auto/email/preferred_username/sub): sub and the verified email are matched as aliases in allow lists. With username, a username that looks like an email or is all digits must equal the user's own verified email or sub, otherwise sign-in is refused; Google cannot use username.
Fixes
- Online upgrade dialog stuck at "Verifying SHA-256" (#155): an empty state is resolved through the version in
/api/status. - Certificate PEM keeps only certificate blocks, so a private key bundled in the file no longer shows in the view, the download link or mapping files (old configs are cleaned on load).
- Create endpoints ignore
keyin the request body, so a new entry never inherits another entry's secrets (such as ECH keys or site user passwords). - Process supervisor: a process stopped while its Before hook runs is no longer started.
Gately is built and maintained by one developer in spare time and every feature is free. If it helps you, consider sponsoring future development; leave your name in the message to be added to the thanks list.