-
-
Notifications
You must be signed in to change notification settings - Fork 90
fix: get latest version #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,9 +16,7 @@ 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' \ | ||||||
| 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) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parsing JSON with 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/##') |
||||||
|
|
||||||
| # Fallback to latest tag if detection fails | ||||||
| if [ -z "$version" ]; then | ||||||
|
|
@@ -361,4 +359,4 @@ if [ "$1" = "update" ]; then | |||||
| update_dokploy | ||||||
| else | ||||||
| install_dokploy | ||||||
| fi | ||||||
| fi | ||||||
There was a problem hiding this comment.
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.