install.sh: honor PLANNOTATOR_RELEASE_DOWNLOAD_URL for the binary download

Abierto Apto para principiantes
#3,298 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
66/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
shell
Área
devops

Línea de trabajo

La URL de GitHub codificada en duro es binary_url en install.sh, cerca de la línea 848; el override PLANNOTATOR_RELEASE_DOWNLOAD_URL ya se usa para descargar .sha256 en update-prepare, así que replica ese patrón. Empieza leyendo cómo install.sh construye binary_url y cómo verifica PLANNOTATOR_EXPECTED_SHA256. Está listo cuando tanto el binario como su checksum provienen del override si está definido, recurren a GitHub en caso contrario, y el checksum sigue validando la instalación.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
8.7k
Forks
649
Merge medio
10 h 45 min
PR fusionados (30 d)
830

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de backnotprop/plannotator

Todos los issues de backnotprop/plannotator

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.