Bläddra i källkod

adding test logs

afeiszli 3 år sedan
förälder
incheckning
57a3c5f4aa

+ 2 - 0
netclient/functions/checkin.go

@@ -202,6 +202,8 @@ func Pull(network string, manual bool) (*models.Node, error) {
 	// ensure that the OS never changes
 	resNode.OS = runtime.GOOS
 	if resNode.PullChanges == "yes" || manual {
+
+		ncutils.PrintLog("DELETEME: Check #1 for PullChanges/Manual", 0)
 		// check for interface change
 		if cfg.Node.Interface != resNode.Interface {
 			if err = DeleteInterface(cfg.Node.Interface, cfg.Node.PostDown); err != nil {

+ 1 - 1
netclient/ncutils/netclientutils_windows.go

@@ -49,7 +49,7 @@ func RunCmdFormatted(command string, printerr bool) (string, error) {
 }
 
 // CreateWireGuardConf - creates a WireGuard conf string
-func CreateWireGuardConf(node *models.Node, privatekey string, listenPort string, dns string, peers []wgtypes.PeerConfig) (string, error) {
+func CreateWireGuardConf(node *models.Node, privatekey string, listenPort string, peers []wgtypes.PeerConfig) (string, error) {
 	peersString, err := parsePeers(node.PersistentKeepalive, peers)
 	var listenPortString string
 	if node.MTU <= 0 {

+ 5 - 1
netclient/wireguard/common.go

@@ -21,6 +21,7 @@ import (
 // SetPeers - sets peers on a given WireGuard interface
 func SetPeers(iface string, keepalive int32, peers []wgtypes.PeerConfig) error {
 
+	ncutils.PrintLog("DELETEME: Check for SetPeers", 0)
 	var devicePeers []wgtypes.Peer
 	var err error
 	if ncutils.IsFreeBSD() {
@@ -103,6 +104,8 @@ func SetPeers(iface string, keepalive int32, peers []wgtypes.PeerConfig) error {
 // Initializes a WireGuard interface
 func InitWireguard(node *models.Node, privkey string, peers []wgtypes.PeerConfig, hasGateway bool, gateways []string, syncconf bool) error {
 
+	ncutils.PrintLog("DELETEME: In InitWireGuard", 0)
+
 	key, err := wgtypes.ParseKey(privkey)
 	if err != nil {
 		return err
@@ -232,7 +235,8 @@ func SetWGConfig(network string, peerupdate bool) error {
 	if err != nil {
 		return err
 	}
-	if peerupdate && !ncutils.IsFreeBSD() && !(ncutils.IsLinux() && !ncutils.IsKernel()) {
+	var notKernelLinux = !(ncutils.IsLinux() && !ncutils.IsKernel())
+	if peerupdate && !ncutils.IsFreeBSD() && notKernelLinux {
 		var iface string
 		iface = nodecfg.Interface
 		if ncutils.IsMac() {