Files
zt/common/getzt/install_zt_edge_tunnel.go
zeekayandHanzo Dev cd4e9a11bb Rename the environment contract to ZT_
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]>
2026-09-23 00:57:09 -07:00

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)
}