Skip to content

Commit

Permalink
hotfix(config): do not log retro-compat warning when using OPENVPN_US…
Browse files Browse the repository at this point in the history
…ER or OPENVPN_PASSWORD
  • Loading branch information
qdm12 committed Jul 26, 2024
1 parent e7381b3 commit a03041c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions internal/configuration/settings/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,21 @@ func (p *PortForwarding) read(r *reader.Reader) (err error) {
return err
}

p.Username = r.String("VPN_PORT_FORWARDING_USERNAME",
reader.RetroKeys("USER", "OPENVPN_USER"), reader.ForceLowercase(false))
p.Password = r.String("VPN_PORT_FORWARDING_PASSWORD",
reader.RetroKeys("PASSWORD", "OPENVPN_PASSWORD"), reader.ForceLowercase(false))
usernameKeys := []string{"VPN_PORT_FORWARDING_USERNAME", "OPENVPN_USER", "USER"}
for _, key := range usernameKeys {
p.Username = r.String(key, reader.ForceLowercase(false))
if p.Username != "" {
break
}
}

passwordKeys := []string{"VPN_PORT_FORWARDING_PASSWORD", "OPENVPN_PASSWORD", "PASSWORD"}
for _, key := range passwordKeys {
p.Password = r.String(key, reader.ForceLowercase(false))
if p.Password != "" {
break
}
}

return nil
}

0 comments on commit a03041c

Please sign in to comment.