mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-18 22:55:15 +08:00
use dns entry in wireguard config file; checkin temporarily disabled til figure issue with dns on checkin
This commit is contained in:
@@ -99,6 +99,8 @@ func RunUserspaceDaemon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CheckIn(cfg config.ClientConfig) error {
|
func CheckIn(cfg config.ClientConfig) error {
|
||||||
|
log.Println("checkin --- diabled for now")
|
||||||
|
return nil
|
||||||
var err error
|
var err error
|
||||||
var errN error
|
var errN error
|
||||||
if cfg.Network == "" {
|
if cfg.Network == "" {
|
||||||
|
@@ -83,9 +83,9 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ncutils.IsLinux() {
|
if ncutils.IsLinux() {
|
||||||
_, err := exec.LookPath("resolvectl")
|
_, err := exec.LookPath("resolveconf")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ncutils.PrintLog("resolvectl not present", 2)
|
ncutils.PrintLog("resolveconf not present", 2)
|
||||||
ncutils.PrintLog("unable to configure DNS automatically, disabling automated DNS management", 2)
|
ncutils.PrintLog("unable to configure DNS automatically, disabling automated DNS management", 2)
|
||||||
cfg.Node.DNSOn = "no"
|
cfg.Node.DNSOn = "no"
|
||||||
}
|
}
|
||||||
|
@@ -35,6 +35,7 @@ func GetEmbedded() error {
|
|||||||
|
|
||||||
// CreateUserSpaceConf - creates a user space WireGuard conf
|
// CreateUserSpaceConf - creates a user space WireGuard conf
|
||||||
func CreateUserSpaceConf(address string, privatekey string, listenPort string, mtu int32, dns string, perskeepalive int32, peers []wgtypes.PeerConfig) (string, error) {
|
func CreateUserSpaceConf(address string, privatekey string, listenPort string, mtu int32, dns string, perskeepalive int32, peers []wgtypes.PeerConfig) (string, error) {
|
||||||
|
log.Println("---------- dns passed to create conf ", dns)
|
||||||
peersString, err := parsePeers(perskeepalive, peers)
|
peersString, err := parsePeers(perskeepalive, peers)
|
||||||
var listenPortString string
|
var listenPortString string
|
||||||
if mtu <= 0 {
|
if mtu <= 0 {
|
||||||
|
@@ -136,7 +136,10 @@ func InitWireguard(node *models.Node, privkey string, peers []wgtypes.PeerConfig
|
|||||||
log.Fatal("no address to configure")
|
log.Fatal("no address to configure")
|
||||||
}
|
}
|
||||||
|
|
||||||
nameserver := servercfg.CoreDNSAddr
|
var nameserver string
|
||||||
|
if node.DNSOn == "yes" {
|
||||||
|
nameserver = servercfg.CoreDNSAddr
|
||||||
|
}
|
||||||
var newConf string
|
var newConf string
|
||||||
if node.UDPHolePunch != "yes" {
|
if node.UDPHolePunch != "yes" {
|
||||||
newConf, _ = ncutils.CreateUserSpaceConf(node.Address, key.String(), strconv.FormatInt(int64(node.ListenPort), 10), node.MTU, nameserver, node.PersistentKeepalive, peers)
|
newConf, _ = ncutils.CreateUserSpaceConf(node.Address, key.String(), strconv.FormatInt(int64(node.ListenPort), 10), node.MTU, nameserver, node.PersistentKeepalive, peers)
|
||||||
|
Reference in New Issue
Block a user