fix(install): add network timeouts to install script downloads

The GitHub API and binary download calls in `install_binary()` (`scripts/install.sh`) and `Install-Binary` (`scripts/install.ps1`) could hang indefinitely on stalled connections. Added curl `--connect-timeout`/`--max-time` to the release metadata calls and `--connect-timeout`/`--speed-limit`/`--speed-time` to the binary download, plus `-TimeoutSec` to the PowerShell `Invoke-RestMethod`/`Invoke-WebRequest` calls. Verified `bash -n scripts/install.sh` passes; no TypeScript typecheck is affected.

Closes #4253
This commit is contained in:
metaphorics
2026-07-02 17:25:50 +09:00
parent 8a8e9aebe5
commit 165a33eece
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -239,13 +239,13 @@ function Install-Binary {
if ($Ref) {
Write-Host "Fetching release $Ref..."
try {
$Release = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases/tags/$Ref"
$Release = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases/tags/$Ref" -TimeoutSec 60
} catch {
throw "Release tag not found: $Ref`nFor branch/commit installs, use -Source with -Ref."
}
} else {
Write-Host "Fetching latest release..."
$Release = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases/latest"
$Release = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases/latest" -TimeoutSec 60
}
$Latest = $Release.tag_name
@@ -260,7 +260,7 @@ function Install-Binary {
$BinaryUrl = "https://github.com/$Repo/releases/download/$Latest/$BinaryName"
Write-Host "Downloading $BinaryName..."
$OutPath = Join-Path $InstallDir "omp.exe"
Invoke-WebRequest -Uri $BinaryUrl -OutFile $OutPath
Invoke-WebRequest -Uri $BinaryUrl -OutFile $OutPath -TimeoutSec 900
Write-Host ""
Write-Host "✓ Installed omp to $OutPath" -ForegroundColor Green