fix(install): fail fast when GitHub fetch stalls (#46)

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>
This commit is contained in:
Tomáš DvořákandDevin authored and GitHub committed 2026-09-28 21:14:15 +02:00
1 parent 61f0974c61
commit bc8b165ad9
1 file changed
+6 -2
+6 -2
View File
@@ -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