From 8912370328e7b4dd502dc35dd04a8c85192940d4 Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Mon, 24 Feb 2025 06:14:13 +0000 Subject: [PATCH 1/3] chore: show server install.sh on cli version mismatch --- cli/root.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cli/root.go b/cli/root.go index 778cf2c24215f..61b3cfb3f97c6 100644 --- a/cli/root.go +++ b/cli/root.go @@ -1213,9 +1213,13 @@ func wrapTransportWithVersionMismatchCheck(rt http.RoundTripper, inv *serpent.In return } upgradeMessage := defaultUpgradeMessage(semver.Canonical(serverVersion)) - serverInfo, err := getBuildInfo(inv.Context()) - if err == nil && serverInfo.UpgradeMessage != "" { - upgradeMessage = serverInfo.UpgradeMessage + if serverInfo, err := getBuildInfo(inv.Context()); err == nil { + switch { + case serverInfo.UpgradeMessage != "": + upgradeMessage = serverInfo.UpgradeMessage + case serverInfo.DashboardURL != "": + upgradeMessage = fmt.Sprintf("download the server version with: 'curl -fsSL %s/install.sh | sh'", serverInfo.DashboardURL) + } } fmtWarningText := "version mismatch: client %s, server %s\n%s" fmtWarn := pretty.Sprint(cliui.DefaultStyles.Warn, fmtWarningText) From 6793771a8f2ee73a0c8a881db48504097fad8518 Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Mon, 24 Feb 2025 06:32:11 +0000 Subject: [PATCH 2/3] version check --- cli/root.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/root.go b/cli/root.go index 61b3cfb3f97c6..b47c6d340567d 100644 --- a/cli/root.go +++ b/cli/root.go @@ -1217,7 +1217,8 @@ func wrapTransportWithVersionMismatchCheck(rt http.RoundTripper, inv *serpent.In switch { case serverInfo.UpgradeMessage != "": upgradeMessage = serverInfo.UpgradeMessage - case serverInfo.DashboardURL != "": + // The site-local `install.sh` was introduced in v2.19.0 + case serverInfo.DashboardURL != "" && semver.Compare(semver.MajorMinor(serverVersion), "v2.19") >= 0: upgradeMessage = fmt.Sprintf("download the server version with: 'curl -fsSL %s/install.sh | sh'", serverInfo.DashboardURL) } } From 5b499d23c397ff2cbb2e62948a985bf51706c5cd Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Tue, 25 Feb 2025 02:21:31 +0000 Subject: [PATCH 3/3] use version number --- cli/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/root.go b/cli/root.go index b47c6d340567d..09044ad3e28ca 100644 --- a/cli/root.go +++ b/cli/root.go @@ -1219,7 +1219,7 @@ func wrapTransportWithVersionMismatchCheck(rt http.RoundTripper, inv *serpent.In upgradeMessage = serverInfo.UpgradeMessage // The site-local `install.sh` was introduced in v2.19.0 case serverInfo.DashboardURL != "" && semver.Compare(semver.MajorMinor(serverVersion), "v2.19") >= 0: - upgradeMessage = fmt.Sprintf("download the server version with: 'curl -fsSL %s/install.sh | sh'", serverInfo.DashboardURL) + upgradeMessage = fmt.Sprintf("download %s with: 'curl -fsSL %s/install.sh | sh'", serverVersion, serverInfo.DashboardURL) } } fmtWarningText := "version mismatch: client %s, server %s\n%s" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy