Skip to content

fix: resilient GitHub downloads and version lookups#5480

Open
smower476 wants to merge 1 commit into
hiddify:devfrom
smower476:fix/github-download-retry-fallback
Open

fix: resilient GitHub downloads and version lookups#5480
smower476 wants to merge 1 commit into
hiddify:devfrom
smower476:fix/github-download-retry-fallback

Conversation

@smower476

Copy link
Copy Markdown

Due to recent instability in GitHub's operation, brief download interruptions may occur, particularly in Russia, where DPI systems often reset or stall the TLS connection to GitHub. A request fails or hangs, but retrying the same request usually succeeds. Previously, installation and update processes would terminate immediately upon encountering even a transient download error (or hang indefinitely on a stalled handshake, since several downloads had no timeout).

This adds download_with_fallback() in common/utils.sh: retries each source up to 3x and falls back through GitHub mirror proxies (ghproxy.net, gh-proxy.com), failing only when all sources are exhausted. All GitHub file downloads are routed through it (hiddify_installer.sh, downgrade.sh, GeoLite DBs in hiddify-panel/install.sh, and the package_manager.sh binary downloader for xray/singbox/warp/wgcf/dnstm). The download.sh and docker-installer.sh bootstraps keep a minimal inline copy since they run before utils.sh exists on disk. The version/API lookups (get_release_version, etc.) now use --connect-timeout + --retry --retry-all-errors so a stalled handshake can't hang them.

Tested on a fresh IONOS VPS (ionos.de, 1 vCPU / 1 GB RAM / 10 GB SSD) and on local Ubuntu 24.04 VMs, including a network where raw.githubusercontent.com was actually blocked: full install completes end-to-end, the helper is exercised in the install path, and the success / retry / full mirror-fallback paths were verified.

Downloads: add download_with_fallback() in common/utils.sh — retries each
source up to 3x and falls back through GitHub mirror proxies (ghproxy.net,
gh-proxy.com), failing only when all sources are exhausted. All GitHub file
downloads are routed through it: hiddify_installer.sh, downgrade.sh, the
GeoLite DBs in hiddify-panel/install.sh, and the package_manager.sh binary
downloader (xray/singbox/warp/wgcf/dnstm). The download.sh and
docker-installer.sh bootstraps keep a minimal inline copy since they run
before utils.sh is on disk.

Version/API lookups (get_release_version, get_pre_release_version,
get_commit_version) previously used curl with no timeout, so a stalled TLS
handshake could hang forever. They now use --connect-timeout + --retry
--retry-all-errors to bound the handshake and retry both timeouts and
connection resets. No mirror fallback here: the proxies don't serve
api.github.com.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant