Harden nomos-circuits download/extract

This commit is contained in:
andrussal 2025-12-03 04:11:43 +01:00
parent f9fce36c5c
commit 8c6690f7d5

View File

@ -110,7 +110,7 @@ download_release() {
print_info "URL: $url"
# Build curl command with optional authentication
local curl_cmd="curl -L"
local curl_cmd="curl -fL --retry 5 --retry-delay 2 --retry-all-errors"
if [ -n "$GITHUB_TOKEN" ]; then
curl_cmd="$curl_cmd --header 'authorization: Bearer ${GITHUB_TOKEN}'"
fi
@ -126,6 +126,13 @@ download_release() {
print_success "Download complete"
# Validate archive before extracting
if ! tar -tzf "${temp_dir}/${artifact}" >/dev/null 2>&1; then
print_error "Downloaded archive is not a valid tar.gz: ${temp_dir}/${artifact}"
rm -rf "$temp_dir"
return 1
fi
print_info "Extracting to ${INSTALL_DIR}..."
mkdir -p "$INSTALL_DIR"