feat(update): OTA 兜底发现与系统代理支持

- check_latest 加免 API 配额的兜底路径:api.github.com 被限流(60 次/
  小时/IP,共享出口 IP 实测已打满)时,跟踪 github.com/releases/latest
  的 302 从最终 URL 提取 tag,下载与 .sha256 按命名约定构造;notes 置空、
  大小置 0(进度未知、对账跳过),sha256 校验仍强制执行
- ureq 启用 win-system-proxy:Windows 系统代理注册表设置自动生效;
  HTTP(S)_PROXY 环境变量代理 ureq 默认就读取,无需配置
- 实测:github.com 直连与代理均可达(302 正常),api.github.com 直连
  与代理出口 IP 的未认证配额均耗尽 —— 兜底路径为必需品而非锦上添花
This commit is contained in:
2026-09-30 12:54:57 +08:00
parent 68273e8e63
commit 7b41e7f13d
4 changed files with 105 additions and 3 deletions
+3 -2
View File
@@ -41,8 +41,9 @@ rustls-native-certs = "0.8"
# 原生文件对话框(连接导入/导出);Windows 走内建 COM 后端,Linux 用默认 xdg-portal
rfd = "0.17"
# OTA 自更新:Gitea Release 检查/下载(ureq 用 rustls,与 rumqttc 依赖同源)
ureq = { version = "3", features = ["json"] }
# OTA 自更新:GitHub Release 检查/下载(ureq 用 rustls,与 rumqttc 依赖同源;
# win-system-proxy 使 Windows 系统代理注册表设置自动生效,环境变量代理本就默认支持)
ureq = { version = "3", features = ["json", "win-system-proxy"] }
sha2 = "0.11"
# Release 附件为 7z 压缩包,纯 Rust 解压(客户端免装 7-Zip)
sevenz-rust = "0.6"