ip and mtu updates (linux only)

This commit is contained in:
Christoph Haas
2020-12-18 21:54:57 +01:00
parent a95fe42efe
commit 10defaa2ba
7 changed files with 163 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import (
"errors"
"os"
"reflect"
"runtime"
"github.com/h44z/wg-portal/internal/wireguard"
@@ -91,6 +92,7 @@ func NewConfig() *Config {
cfg.LDAP.BindPass = "SuperSecret"
cfg.WG.DeviceName = "wg0"
cfg.WG.WireGuardConfig = "/etc/wireguard/wg0.conf"
cfg.WG.ManageIPAddresses = true
cfg.AdminLdapGroup = "CN=WireGuardAdmins,OU=_O_IT,DC=COMPANY,DC=LOCAL"
cfg.Email.Host = "127.0.0.1"
cfg.Email.Port = 25
@@ -109,5 +111,10 @@ func NewConfig() *Config {
log.Warnf("unable to load environment config: %v", err)
}
if cfg.WG.ManageIPAddresses && runtime.GOOS != "linux" {
log.Warnf("Managing IP addresses only works on linux! Feature disabled.")
cfg.WG.ManageIPAddresses = false
}
return cfg
}