mirror of
https://github.com/hanzozt/zt.git
synced 2026-11-02 11:38:22 +00:00
Every variable the code reads or sets is now ZT_* with the same suffix, with no aliases for the old names. User-facing text, default CSR fields and error messages follow, as do the identifiers on the lines that changed. Three names keep their spelling because another program owns them: the C tunneler reads ZITI_LOG and ZITI_TIME_FORMAT, and the Go SDK reads ZITI_TRACE_ENABLED. Co-authored-by: Hanzo Dev <[email protected]>
28 lines
766 B
Go
28 lines
766 B
Go
package getzt
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/blang/semver"
|
|
c "github.com/hanzozt/zt/v2/zt/constants"
|
|
)
|
|
|
|
func InstallZitiEdgeTunnel(targetVersion, targetOS, targetArch, binDir string, verbose bool) error {
|
|
var newVersion semver.Version
|
|
|
|
if targetVersion != "" {
|
|
newVersion = semver.MustParse(strings.TrimPrefix(targetVersion, "v"))
|
|
} else {
|
|
v, err := GetLatestGitHubReleaseVersion(c.HanzoZTOrg, c.ZT_EDGE_TUNNEL_GITHUB, verbose)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
newVersion = v
|
|
}
|
|
|
|
fmt.Println("Attempting to install '" + c.ZT_EDGE_TUNNEL + "' version: " + newVersion.String())
|
|
return FindVersionAndInstallGitHubRelease(
|
|
c.HanzoZTOrg, c.ZT_EDGE_TUNNEL, c.ZT_EDGE_TUNNEL_GITHUB, targetOS, targetArch, binDir, newVersion.String(), verbose)
|
|
}
|