chore(sources/env): bump gosettings to v0.3.0-rc9
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
"github.com/qdm12/gosettings/sources/env"
|
||||
"github.com/qdm12/govalid/port"
|
||||
)
|
||||
|
||||
func (s *Source) readWireguardSelection() (
|
||||
@@ -21,18 +20,18 @@ func (s *Source) readWireguardSelection() (
|
||||
return selection, err
|
||||
}
|
||||
|
||||
selection.PublicKey = env.Get("WIREGUARD_PUBLIC_KEY", env.ForceLowercase(false))
|
||||
selection.PublicKey = env.String("WIREGUARD_PUBLIC_KEY", env.ForceLowercase(false))
|
||||
|
||||
return selection, nil
|
||||
}
|
||||
|
||||
func (s *Source) readWireguardEndpointIP() (endpointIP netip.Addr, err error) {
|
||||
key, value := s.getEnvWithRetro("VPN_ENDPOINT_IP", []string{"WIREGUARD_ENDPOINT_IP"})
|
||||
if value == "" {
|
||||
if value == nil {
|
||||
return endpointIP, nil
|
||||
}
|
||||
|
||||
endpointIP, err = netip.ParseAddr(value)
|
||||
endpointIP, err = netip.ParseAddr(*value)
|
||||
if err != nil {
|
||||
return endpointIP, fmt.Errorf("environment variable %s: %w", key, err)
|
||||
}
|
||||
@@ -41,16 +40,6 @@ func (s *Source) readWireguardEndpointIP() (endpointIP netip.Addr, err error) {
|
||||
}
|
||||
|
||||
func (s *Source) readWireguardCustomPort() (customPort *uint16, err error) {
|
||||
key, value := s.getEnvWithRetro("VPN_ENDPOINT_PORT", []string{"WIREGUARD_ENDPOINT_PORT"})
|
||||
if value == "" {
|
||||
return nil, nil //nolint:nilnil
|
||||
}
|
||||
|
||||
customPort = new(uint16)
|
||||
*customPort, err = port.Validate(value)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("environment variable %s: %w", key, err)
|
||||
}
|
||||
|
||||
return customPort, nil
|
||||
envKey, _ := s.getEnvWithRetro("VPN_ENDPOINT_PORT", []string{"WIREGUARD_ENDPOINT_PORT"})
|
||||
return env.Uint16Ptr(envKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user