mirror of
https://github.com/qdm12/gluetun.git
synced 2026-06-23 12:27:44 +02:00
chore!(amneziawg): refactor to be separate from wireguard
- amneziawg is now a VPN protocol and no longer a Wireguard implementation - Use it with VPN_TYPE=amneziawg - document AMNEZIAWG_* options in Dockerfile - document amneziawg support in readme - separate amneziawg settings and code from wireguard - re-use code from wireguard whenever possible
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package secrets
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/configuration/sources/files"
|
||||
)
|
||||
|
||||
func (s *Source) lazyLoadAmneziawgConf() files.AmneziawgConfig {
|
||||
if s.cached.amneziawgLoaded {
|
||||
return s.cached.amneziawgConf
|
||||
}
|
||||
|
||||
path := os.Getenv("AMNEZIAWG_CONF_SECRETFILE")
|
||||
if path == "" {
|
||||
path = filepath.Join(s.rootDirectory, "amneziawg", "awg0.conf")
|
||||
}
|
||||
|
||||
s.cached.amneziawgLoaded = true
|
||||
var err error
|
||||
s.cached.amneziawgConf, err = files.ParseAmneziawgConf(path)
|
||||
if err != nil {
|
||||
s.warner.Warnf("skipping Amneziawg config: %s", err)
|
||||
}
|
||||
return s.cached.amneziawgConf
|
||||
}
|
||||
Reference in New Issue
Block a user