1
1
mirror of https://github.com/openziti/zrok.git synced 2025-07-14 05:05:10 +02:00

Merge branch 'main' into docs-styling

This commit is contained in:
Michael Quigley
2025-05-06 20:46:05 -04:00
2 changed files with 13 additions and 7 deletions

@ -1,5 +1,9 @@
# CHANGELOG # CHANGELOG
## v1.0.5
FIX: `zrok enable` now handles the case where the user ID does not resolve to a username when generating the default environment description (https://github.com/openziti/zrok/issues/959)
## v1.0.4 ## v1.0.4
FIX: `zrok admin bootstrap` and `zrok enable` functionality were broken in `v1.0.3`. A bad combination of dependencies caused issues with marshalling data from the associated controller endpoints FIX: `zrok admin bootstrap` and `zrok enable` functionality were broken in `v1.0.3`. A bad combination of dependencies caused issues with marshalling data from the associated controller endpoints

@ -56,14 +56,16 @@ func (cmd *enableCommand) run(_ *cobra.Command, args []string) {
panic(err) panic(err)
} }
var username string var username string
user, err := user2.Current() userObj, err := user2.Current()
if err != nil { if err == nil && userObj.Username != "" {
username := os.Getenv("USER") username = userObj.Username
if username == "" {
logrus.Panicf("unable to determine the current user: %v", err)
}
} else { } else {
username = user.Username username = os.Getenv("USER")
if username == "" {
euid := os.Geteuid()
username = fmt.Sprintf("user-%d", euid)
logrus.Warnf("unable to determine the current user, using effective UID: %v", euid)
}
} }
hostDetail = fmt.Sprintf("%v; %v", username, hostDetail) hostDetail = fmt.Sprintf("%v; %v", username, hostDetail)
if cmd.description == "<user>@<hostname>" { if cmd.description == "<user>@<hostname>" {