From bc8b165ad938681c4c2581397ca3f3ddb3883799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Dvo=C5=99=C3=A1k?= <150935816+Dvorinka@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:14:15 +0200 Subject: [PATCH] fix(install): fail fast when GitHub fetch stalls (#46) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit curl without timeouts hangs silently on a stalled connection — the install looked dead between 'Fetching compose files' and the image pulls. --connect-timeout/--max-time/--retry-all-errors turn it into a clear error naming the file. Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 35a6658..6a96da0 100755 --- a/install.sh +++ b/install.sh @@ -38,9 +38,12 @@ mkdir -p "$DIR/infra/nginx" cd "$DIR" # The compose stack needs exactly these three files from the repo. +# Timeouts + retries: a stalled connection must fail loudly, not hang. info "Fetching compose files ($REF)" for f in docker-compose.yml .env.example infra/nginx/default.conf; do - curl -fsSL "https://raw.githubusercontent.com/$REPO/$REF/$f" -o "$f" + curl -fsSL --connect-timeout 10 --max-time 60 --retry 3 --retry-delay 1 --retry-all-errors \ + "https://raw.githubusercontent.com/$REPO/$REF/$f" -o "$f" \ + || die "could not fetch $f — check connectivity to raw.githubusercontent.com" done if [ -f .env ]; then @@ -129,7 +132,8 @@ if docker pull "ghcr.io/$GHCR_OWNER/primora-backend:latest" \ else # GHCR packages are private until first published release — build from source. info "Prebuilt images unavailable; building from source" - curl -fsSL "https://codeload.github.com/$REPO/tar.gz/refs/heads/$REF" | tar xz --strip-components=1 + curl -fsSL --connect-timeout 10 --max-time 120 --retry 3 --retry-delay 1 --retry-all-errors \ + "https://codeload.github.com/$REPO/tar.gz/refs/heads/$REF" | tar xz --strip-components=1 docker compose up -d --build fi