install.sh: honor PLANNOTATOR_RELEASE_DOWNLOAD_URL for the binary download

Aperta Adatta ai principianti
#3,298 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
66/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
shell
Ambito
devops

Direzione di ricerca

L'URL di GitHub hardcoded è binary_url in install.sh, intorno alla riga 848; l'override PLANNOTATOR_RELEASE_DOWNLOAD_URL è già usato per scaricare .sha256 in update-prepare, quindi replica quel pattern. Inizia leggendo come install.sh costruisce binary_url e controlla PLANNOTATOR_EXPECTED_SHA256. È fatto quando sia il binario sia il checksum provengono dall'override se impostato, ricadono su GitHub altrimenti, e il checksum continua a validare l'installazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
8.7k
Fork
649
Merge medio
10h 45m
PR unite (30g)
830

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di backnotprop/plannotator

Tutte le issue di backnotprop/plannotator

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.