mirror of
https://github.com/openziti/zrok.git
synced 2024-12-22 23:02:52 +01:00
Merge pull request #583 from openziti/get-user-fallback
fall back to env var USER when /etc/passwd and stdlib faculties fail …
This commit is contained in:
commit
2bef0f8624
@ -4,6 +4,8 @@
|
||||
|
||||
FIX: Also update the Python SDK to include the permission mode and access grants fields on the `ShareRequest` (https://github.com/openziti/zrok/issues/432)
|
||||
|
||||
FIX: Add a way to find the username on Linux when /etc/passwd and stdlib can't resolve the UID (https://github.com/openziti/zrok/issues/454)
|
||||
|
||||
## v0.4.26
|
||||
|
||||
FEATURE: New _permission modes_ available for shares. _Open permission mode_ retains the behavior of previous zrok releases and is the default setting. _Closed permission mode_ (`--closed`) only allows a share to be accessed (`zrok access`) by users who have been granted access with the `--access-grant` flag. See the documentation at (https://docs.zrok.io/docs/guides/permission-modes/) (https://github.com/openziti/zrok/issues/432)
|
||||
|
@ -56,13 +56,19 @@ func (cmd *enableCommand) run(_ *cobra.Command, args []string) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
var username string
|
||||
user, err := user2.Current()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
username := os.Getenv("USER")
|
||||
if username == "" {
|
||||
logrus.Panicf("unable to determine the current user: %v", err)
|
||||
}
|
||||
} else {
|
||||
username = user.Username
|
||||
}
|
||||
hostDetail = fmt.Sprintf("%v; %v", user.Username, hostDetail)
|
||||
hostDetail = fmt.Sprintf("%v; %v", username, hostDetail)
|
||||
if cmd.description == "<user>@<hostname>" {
|
||||
cmd.description = fmt.Sprintf("%v@%v", user.Username, hostName)
|
||||
cmd.description = fmt.Sprintf("%v@%v", username, hostName)
|
||||
}
|
||||
zrok, err := env.Client()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user