Skip to content

fix: get latest version#139

Closed
fir4tozden wants to merge 1 commit intoDokploy:mainfrom
fir4tozden:fix/get-latest-version
Closed

fix: get latest version#139
fir4tozden wants to merge 1 commit intoDokploy:mainfrom
fir4tozden:fix/get-latest-version

Conversation

@fir4tozden
Copy link
Contributor

@fir4tozden fir4tozden commented Feb 21, 2026

The previous GitHub release request wasn't stable, and I had issues with that. I've made it more stable.

image

Greptile Summary

Changed GitHub release version detection from redirect-following to API endpoint parsing. While the API approach may seem more direct, it introduces critical issues:

  • Rate limiting: GitHub API has strict limits (60 requests/hour unauthenticated) that will cause failures for popular installation scripts
  • Missing error handling: Removed -f flag means HTTP errors won't trigger the fallback mechanism properly
  • Fragile JSON parsing: Using grep | cut instead of a proper JSON parser risks breaking with formatting changes

The previous redirect-following method was more robust as it didn't count against API limits and was the recommended approach for public installation scripts.

Confidence Score: 1/5

  • This PR introduces critical reliability issues that will cause installation failures under normal usage conditions
  • The GitHub API rate limiting issue alone makes this change problematic for a public installation script that could be run frequently. Combined with missing error handling and fragile JSON parsing, this change reduces stability rather than improving it.
  • apps/website/public/install.sh requires immediate attention - the version detection logic needs to be reverted or significantly improved

Last reviewed commit: 59c90c8

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

version=$(curl -fsSL -o /dev/null -w '%{url_effective}\n' \
https://github.com/dokploy/dokploy/releases/latest 2>/dev/null | \
sed 's#.*/tag/##')
version=$(curl -s https://api.github.com/repos/dokploy/dokploy/releases/latest | grep "\"tag_name\":" | cut -d "\"" -f 4)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub API rate limit (60 req/hour unauthenticated) will cause failures for users. The previous redirect-following approach didn't count against API limits.

Suggested change
version=$(curl -s https://api.github.com/repos/dokploy/dokploy/releases/latest | grep "\"tag_name\":" | cut -d "\"" -f 4)
version=$(curl -fsSL -o /dev/null -w '%{url_effective}\n' \
https://github.com/dokploy/dokploy/releases/latest 2>/dev/null | \
sed 's#.*/tag/##')

version=$(curl -fsSL -o /dev/null -w '%{url_effective}\n' \
https://github.com/dokploy/dokploy/releases/latest 2>/dev/null | \
sed 's#.*/tag/##')
version=$(curl -s https://api.github.com/repos/dokploy/dokploy/releases/latest | grep "\"tag_name\":" | cut -d "\"" -f 4)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing -f flag means curl won't fail on HTTP errors (403, 404, etc). HTTP errors will pass through to grep and fail silently.

Suggested change
version=$(curl -s https://api.github.com/repos/dokploy/dokploy/releases/latest | grep "\"tag_name\":" | cut -d "\"" -f 4)
version=$(curl -fsSL https://api.github.com/repos/dokploy/dokploy/releases/latest 2>/dev/null | grep "\"tag_name\":" | cut -d "\"" -f 4)

version=$(curl -fsSL -o /dev/null -w '%{url_effective}\n' \
https://github.com/dokploy/dokploy/releases/latest 2>/dev/null | \
sed 's#.*/tag/##')
version=$(curl -s https://api.github.com/repos/dokploy/dokploy/releases/latest | grep "\"tag_name\":" | cut -d "\"" -f 4)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing JSON with grep | cut is fragile. Consider using jq with fallback:

version=$(curl -fsSL https://api.github.com/repos/dokploy/dokploy/releases/latest 2>/dev/null | jq -r '.tag_name // empty' 2>/dev/null || \
    curl -fsSL -o /dev/null -w '%{url_effective}\n' https://github.com/dokploy/dokploy/releases/latest 2>/dev/null | sed 's#.*/tag/##')

@fir4tozden fir4tozden marked this pull request as draft February 21, 2026 22:49
@fir4tozden fir4tozden closed this Feb 21, 2026
@fir4tozden fir4tozden deleted the fix/get-latest-version branch February 21, 2026 22:58
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