- drop qdm12/govalid dependency - upgrade qdm12/ss-server to v0.6.0 - do not unset sensitive config settings (makes no sense to me)
28 lines
589 B
Go
28 lines
589 B
Go
package secrets
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"github.com/qdm12/gluetun/internal/configuration/sources/files"
|
|
)
|
|
|
|
func (s *Source) lazyLoadWireguardConf() files.WireguardConfig {
|
|
if s.cached.wireguardLoaded {
|
|
return s.cached.wireguardConf
|
|
}
|
|
|
|
path := os.Getenv("WIREGUARD_CONF_SECRETFILE")
|
|
if path == "" {
|
|
path = filepath.Join(s.rootDirectory, "wg0.conf")
|
|
}
|
|
|
|
s.cached.wireguardLoaded = true
|
|
var err error
|
|
s.cached.wireguardConf, err = files.ParseWireguardConf(path)
|
|
if err != nil {
|
|
s.warner.Warnf("skipping Wireguard config: %s", err)
|
|
}
|
|
return s.cached.wireguardConf
|
|
}
|