From 093c1aa3d4f9fbf7209b7a1dbf6fd6ba571381fb Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Tue, 7 Jul 2026 09:12:28 -0600 Subject: [PATCH] fix: validate detected release tag in install script version detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the GitHub request fails (unreachable network, rate limiting — common on Proxmox homelab VMs with broken IPv6/DNS), curl -f fails but -w still prints the attempted URL, so detect_version() returned "https://github.com/dokploy/dokploy/releases/latest" instead of a tag. The resulting invalid image (dokploy/dokploy:https://...) meant the dokploy service was never created, traefik.yml was never written, and the bind mount created it as a directory. Accept only values that look like a release tag (v0.x.y), falling back to "latest" otherwise, and add --connect-timeout 10 so blackholed networks fail over in seconds instead of hanging the install. Verified on debian:13 containers: normal network detects v0.29.10, the DOKPLOY_VERSION override is intact, and connection-refused or blackholed github.com now falls back to "latest" within 10s. Fixes #126 Co-Authored-By: Claude Fable 5 --- apps/website/public/install.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/website/public/install.sh b/apps/website/public/install.sh index 5046a2a..19c1231 100644 --- a/apps/website/public/install.sh +++ b/apps/website/public/install.sh @@ -19,10 +19,19 @@ detect_version() { echo "Detecting latest stable version from GitHub..." >&2 # Try to get latest release from GitHub by following redirects - version=$(curl -fsSL -o /dev/null -w '%{url_effective}\n' \ + version=$(curl -fsSL --connect-timeout 10 -o /dev/null -w '%{url_effective}\n' \ https://github.com/dokploy/dokploy/releases/latest 2>/dev/null | \ sed 's#.*/tag/##') - + + # When the request fails (unreachable network, rate limit), curl still + # prints the attempted URL, which would produce an invalid image tag + # like dokploy/dokploy:https://... Accept only values that look like a + # release tag (e.g. v0.29.10). + case "$version" in + v[0-9]*) ;; + *) version="" ;; + esac + # Fallback to latest tag if detection fails if [ -z "$version" ]; then echo "Warning: Could not detect latest version from GitHub, using fallback version latest" >&2