mirror of
https://github.com/openziti/zrok.git
synced 2025-06-18 15:56:42 +02:00
Merge branch 'main' into docs-styling
This commit is contained in:
commit
cb618ce877
@ -1,5 +1,9 @@
|
||||
# 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
|
||||
|
||||
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)
|
||||
}
|
||||
var username string
|
||||
user, err := user2.Current()
|
||||
if err != nil {
|
||||
username := os.Getenv("USER")
|
||||
if username == "" {
|
||||
logrus.Panicf("unable to determine the current user: %v", err)
|
||||
}
|
||||
userObj, err := user2.Current()
|
||||
if err == nil && userObj.Username != "" {
|
||||
username = userObj.Username
|
||||
} 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)
|
||||
if cmd.description == "<user>@<hostname>" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user