install.sh: honor PLANNOTATOR_RELEASE_DOWNLOAD_URL for the binary download

未关闭 适合新手
#3,298 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
66/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
shell
领域
devops

调研方向

硬编码的 GitHub 地址是 install.sh 第 848 行附近的 binary_url。PLANNOTATOR_RELEASE_DOWNLOAD_URL 覆盖项已用于 update-prepare 中获取 .sha256,因此请沿用相同的模式。先阅读 install.sh 如何构建 binary_url,以及如何检查 PLANNOTATOR_EXPECTED_SHA256。完成的标准是:设置了覆盖项时,二进制文件和校验和都来自该覆盖项;未设置时回退到 GitHub;并且校验和仍然对安装进行校验把关。

由索引模型根据 Issue 内容生成。

描述

Problem

On some networks, downloading release assets from github.com is very slow. Here it ran at about 110 KB/s, so the ~195 MB plannotator-darwin-arm64 took about 25 minutes, and the update lock was held the whole time. A nearby machine downloads the same file in seconds and could serve it as a mirror. Plannotator already has a setting for this, but the installer ignores it for the binary.

Current behavior (0.28.63)

  • The app accepts PLANNOTATOR_RELEASE_DOWNLOAD_URL, which passes isAllowedOverrideUrl. update-prepare uses it to fetch the .sha256.
  • install.sh hardcodes GitHub for the binary (line 848):
    binary_url="https://github.com/${REPO}/releases/download/${latest_tag}/${binary_name}"
    
    So the override changes where the checksum comes from, but the 195 MB download still goes to github.com.

Request

Make install.sh use PLANNOTATOR_RELEASE_DOWNLOAD_URL for the binary and its .sha256 when set, and fall back to GitHub when it isn't:

release_base="${PLANNOTATOR_RELEASE_DOWNLOAD_URL:-https://github.com/${REPO}/releases/download}"
binary_url="${release_base}/${latest_tag}/${binary_name}"

The pinned SHA-256 check (PLANNOTATOR_EXPECTED_SHA256) still guards the file, so a mirror can't swap in a different binary.

Why

With this change, a slow link can point updates at a mirror and keep the normal path: auto-update, Update now, checksum and attestation checks. Without it, the only workaround is to copy the binary by hand into the installer's temp download file mid-update, which depends on internal details.

主要语言
TypeScript
星标
8.7k
派生
649
平均合并
10 小时 45 分钟
30 天内合并 PR
830

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

backnotprop/plannotator 的其他 Issue

查看 backnotprop/plannotator 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。