fix(settings): use qdm12/gosettings env.Get

This commit is contained in:
Quentin McGaw
2023-05-29 20:43:06 +00:00
parent b961284845
commit 47593928f9
20 changed files with 51 additions and 58 deletions

View File

@@ -3,10 +3,10 @@ package env
import (
"fmt"
"net/netip"
"os"
"strings"
"github.com/qdm12/gluetun/internal/configuration/settings"
"github.com/qdm12/gosettings/sources/env"
)
func (s *Source) readWireguard() (wireguard settings.Wireguard, err error) {
@@ -16,7 +16,7 @@ func (s *Source) readWireguard() (wireguard settings.Wireguard, err error) {
wireguard.PrivateKey = envToStringPtr("WIREGUARD_PRIVATE_KEY")
wireguard.PreSharedKey = envToStringPtr("WIREGUARD_PRESHARED_KEY")
_, wireguard.Interface = s.getEnvWithRetro("VPN_INTERFACE", "WIREGUARD_INTERFACE")
wireguard.Implementation = os.Getenv("WIREGUARD_IMPLEMENTATION")
wireguard.Implementation = env.Get("WIREGUARD_IMPLEMENTATION")
wireguard.Addresses, err = s.readWireguardAddresses()
if err != nil {
return wireguard, err // already wrapped