install.sh: honor PLANNOTATOR_RELEASE_DOWNLOAD_URL for the binary download

Đang mở Phù hợp với người mới
#3,298 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
66/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
shell
Lĩnh vực
devops

Hướng nghiên cứu

URL GitHub được mã cứng là binary_url trong install.sh, khoảng dòng 848; biến ghi đè PLANNOTATOR_RELEASE_DOWNLOAD_URL đã được dùng để tải .sha256 trong update-prepare, vì vậy hãy làm theo mẫu đó. Bắt đầu bằng việc đọc cách install.sh xây dựng binary_url và kiểm tra PLANNOTATOR_EXPECTED_SHA256. Hoàn thành khi cả binary lẫn checksum đều lấy từ biến ghi đè nếu được đặt, và lấy từ GitHub nếu không, đồng thời checksum vẫn kiểm soát việc cài đặt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
649
Merge trung bình
10 giờ 45 phút
Pull request đã merge (30 ngày)
830

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của backnotprop/plannotator

Tất cả issue của backnotprop/plannotator

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.