install.sh: honor PLANNOTATOR_RELEASE_DOWNLOAD_URL for the binary download

オープン 初心者向け
#3,298 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
66/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
shell
領域
devops

調査の方向性

ハードコードされた GitHub の URL は 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分
マージ済み PR(30日)
830

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

backnotprop/plannotator のほかの issue

backnotprop/plannotator の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。