hotfix(env): read some settings with case sensitivity

This commit is contained in:
Quentin McGaw
2023-05-30 12:46:10 +00:00
parent 47593928f9
commit 2c30984a10
18 changed files with 78 additions and 58 deletions

View File

@@ -21,13 +21,13 @@ func (s *Source) readWireguardSelection() (
return selection, err
}
selection.PublicKey = env.Get("WIREGUARD_PUBLIC_KEY")
selection.PublicKey = env.Get("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", "WIREGUARD_ENDPOINT_IP")
key, value := s.getEnvWithRetro("VPN_ENDPOINT_IP", []string{"WIREGUARD_ENDPOINT_IP"})
if value == "" {
return endpointIP, nil
}
@@ -41,7 +41,7 @@ func (s *Source) readWireguardEndpointIP() (endpointIP netip.Addr, err error) {
}
func (s *Source) readWireguardCustomPort() (customPort *uint16, err error) {
key, value := s.getEnvWithRetro("VPN_ENDPOINT_PORT", "WIREGUARD_ENDPOINT_PORT")
key, value := s.getEnvWithRetro("VPN_ENDPOINT_PORT", []string{"WIREGUARD_ENDPOINT_PORT"})
if value == "" {
return nil, nil //nolint:nilnil
}