Merge pull request #894 from gravitl/feature_v0.12.0_versioning

Feature v0.12.0 versioning
This commit is contained in:
dcarns 2022-03-14 19:28:04 -04:00 committed by GitHub
commit cc8f31a851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 50 additions and 37 deletions

View file

@ -31,6 +31,7 @@ body:
label: Version
description: What version are you running?
options:
- v0.12.0
- v0.11.1
- v0.11.0
- v0.10.0

View file

@ -3,12 +3,12 @@
<img src="netmaker.png" width="75%"><break/>
</p>
<p align="center">
<i>Create and control automated virtual networks.</i>
a platform for blazing fast and dynamic virtual networks
</p>
<p align="center">
<a href="https://github.com/gravitl/netmaker/releases">
<img src="https://img.shields.io/badge/Version-0.11.1-informational?style=flat-square" />
<img src="https://img.shields.io/badge/Version-0.12.0-informational?style=flat-square" />
</a>
<a href="https://hub.docker.com/r/gravitl/netmaker/tags">
<img src="https://img.shields.io/docker/pulls/gravitl/netmaker" />

View file

@ -3,7 +3,7 @@ version: "3.4"
services:
netmaker:
container_name: netmaker
image: gravitl/netmaker:v0.11.1
image: gravitl/netmaker:v0.12.0
volumes:
- dnsconfig:/root/config/dnsconfig
- sqldata:/root/data
@ -45,7 +45,7 @@ services:
container_name: netmaker-ui
depends_on:
- netmaker
image: gravitl/netmaker-ui:v0.11.1
image: gravitl/netmaker-ui:v0.12.0
links:
- "netmaker:api"
ports:

View file

@ -3,7 +3,7 @@ version: "3.4"
services:
netmaker:
container_name: netmaker
image: gravitl/netmaker:v0.11.1
image: gravitl/netmaker:v0.12.0
volumes:
- dnsconfig:/root/config/dnsconfig
- /usr/bin/wg:/usr/bin/wg
@ -41,7 +41,7 @@ services:
container_name: netmaker-ui
depends_on:
- netmaker
image: gravitl/netmaker-ui:0.11.1
image: gravitl/netmaker-ui:0.12.0
links:
- "netmaker:api"
ports:

View file

@ -3,7 +3,7 @@ version: "3.4"
services:
netmaker:
container_name: netmaker
image: gravitl/netmaker:v0.11.1
image: gravitl/netmaker:v0.12.0
volumes:
- dnsconfig:/root/config/dnsconfig
- sqldata:/root/data
@ -45,7 +45,7 @@ services:
container_name: netmaker-ui
depends_on:
- netmaker
image: gravitl/netmaker-ui:v0.11.1
image: gravitl/netmaker-ui:v0.12.0
links:
- "netmaker:api"
ports:

View file

@ -3,7 +3,7 @@ version: "3.4"
services:
netmaker:
container_name: netmaker
image: gravitl/netmaker:v0.11.1
image: gravitl/netmaker:v0.12.0
volumes:
- dnsconfig:/root/config/dnsconfig
- sqldata:/root/data
@ -45,7 +45,7 @@ services:
container_name: netmaker-ui
depends_on:
- netmaker
image: gravitl/netmaker-ui:v0.11.1
image: gravitl/netmaker-ui:v0.12.0
links:
- "netmaker:api"
ports:

View file

@ -2,7 +2,7 @@ services:
netmaker: # The Primary Server for running Netmaker
privileged: true # Necessary to run sudo/root level commands on host system. Likely using this if running with host networking on.
container_name: netmaker
image: gravitl/netmaker:v0.11.1
image: gravitl/netmaker:v0.12.0
volumes: # Volume mounts necessary for CLIENT_MODE to control wireguard networking on host (except dnsconfig, which is where dns config files are stored for use by CoreDNS)
- dnsconfig:/root/config/dnsconfig # Netmaker writes Corefile to this location, which gets mounted by CoreDNS for DNS configuration.
- sqldata:/root/data
@ -44,7 +44,7 @@ services:
container_name: netmaker-ui
depends_on:
- netmaker
image: gravitl/netmaker-ui:v0.11.1
image: gravitl/netmaker-ui:v0.12.0
links:
- "netmaker:api"
ports:

View file

@ -3,7 +3,7 @@ version: "3.4"
services:
netmaker:
container_name: netmaker
image: gravitl/netmaker:v0.11.1
image: gravitl/netmaker:v0.12.0
volumes:
- dnsconfig:/root/config/dnsconfig
- sqldata:/root/data
@ -45,7 +45,7 @@ services:
container_name: netmaker-ui
depends_on:
- netmaker
image: gravitl/netmaker-ui:v0.11.1
image: gravitl/netmaker-ui:v0.12.0
links:
- "netmaker:api"
ports:

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="0.11.1.0"
version="0.12.0.0"
processorArchitecture="*"
name="netclient.exe"
type="win32"

View file

@ -29,7 +29,7 @@
"OriginalFilename": "",
"PrivateBuild": "",
"ProductName": "Netclient",
"ProductVersion": "v0.11.1.0",
"ProductVersion": "v0.12.0.0",
"SpecialBuild": ""
},
"VarFileInfo": {

View file

@ -166,21 +166,7 @@ func InitWireguard(node *models.Node, privkey string, peers []wgtypes.PeerConfig
}
}
// ensure you clear any existing interface first
d, _ := wgclient.Device(deviceiface)
startTime := time.Now()
for d != nil && d.Name == deviceiface {
if err = RemoveConf(deviceiface, false); err != nil { // remove interface first
if strings.Contains(err.Error(), "does not exist") {
err = nil
break
}
}
time.Sleep(time.Second >> 2)
d, _ = wgclient.Device(deviceiface)
if time.Now().After(startTime.Add(time.Second << 4)) {
break
}
}
RemoveConfGraceful(deviceiface)
ApplyConf(node, ifacename, confPath) // Apply initially
ncutils.PrintLog("waiting for interface...", 1) // ensure interface is created
output, _ := ncutils.RunCmd("wg", false)
@ -301,6 +287,7 @@ func ApplyConf(node *models.Node, ifacename string, confPath string) error {
var err error
switch os {
case "windows":
RemoveConfGraceful(ifacename)
ApplyWindowsConf(confPath)
case "darwin":
ApplyMacOSConf(node, ifacename, confPath)
@ -478,3 +465,29 @@ func UpdatePrivateKey(file, privateKey string) error {
}
return nil
}
// RemoveConfGraceful - Run remove conf and wait for it to actually be gone before proceeding
func RemoveConfGraceful(ifacename string) {
// ensure you clear any existing interface first
wgclient, err := wgctrl.New()
if err != nil {
ncutils.PrintLog("could not create wgclient", 0)
return
}
defer wgclient.Close()
d, _ := wgclient.Device(ifacename)
startTime := time.Now()
for d != nil && d.Name == ifacename {
if err = RemoveConf(ifacename, false); err != nil { // remove interface first
if strings.Contains(err.Error(), "does not exist") {
err = nil
break
}
}
time.Sleep(time.Second >> 2)
d, _ = wgclient.Device(ifacename)
if time.Now().After(startTime.Add(time.Second << 4)) {
break
}
}
}

View file

@ -7,7 +7,6 @@ import (
"strconv"
"strings"
"github.com/gravitl/netmaker/logger"
"github.com/gravitl/netmaker/models"
"github.com/gravitl/netmaker/netclient/config"
"github.com/gravitl/netmaker/netclient/ncutils"
@ -72,7 +71,7 @@ func ApplyWithoutWGQuick(node *models.Node, ifacename string, confPath string) e
}
}
if _, err := ncutils.RunCmd(ipExec+" link set down dev "+ifacename, false); err != nil {
logger.Log(2, "attempted to remove interface before editing")
ncutils.PrintLog("attempted to remove interface before editing", 1)
return err
}
if node.PostDown != "" {
@ -81,7 +80,7 @@ func ApplyWithoutWGQuick(node *models.Node, ifacename string, confPath string) e
}
// set MTU of node interface
if _, err := ncutils.RunCmd(ipExec+" link set mtu "+strconv.Itoa(int(node.MTU))+" up dev "+ifacename, true); err != nil {
logger.Log(2, "failed to create interface with mtu", strconv.Itoa(int(node.MTU)), "-", ifacename)
ncutils.PrintLog("failed to create interface with mtu "+strconv.Itoa(int(node.MTU))+"-"+ifacename, 1)
return err
}
if node.PostUp != "" {
@ -89,7 +88,7 @@ func ApplyWithoutWGQuick(node *models.Node, ifacename string, confPath string) e
_ = ncutils.RunCmds(runcmds, true)
}
if node.Address6 != "" && node.IsDualStack == "yes" {
logger.Log(1, "adding address:", node.Address6)
ncutils.PrintLog("adding address: "+node.Address6, 1)
_, _ = ncutils.RunCmd(ipExec+" address add dev "+ifacename+" "+node.Address6+"/64", true)
}
return nil
@ -104,8 +103,8 @@ func RemoveWithoutWGQuick(ifacename string) error {
out, err := ncutils.RunCmd(ipExec+" link del "+ifacename, false)
dontprint := strings.Contains(out, "does not exist") || strings.Contains(out, "Cannot find device")
if err != nil && !dontprint {
logger.Log(1, "error running command:", ipExec, "link del", ifacename)
logger.Log(1, out)
ncutils.PrintLog("error running command: "+ipExec+" link del "+ifacename, 1)
ncutils.PrintLog(out, 1)
}
network := strings.ReplaceAll(ifacename, "nm-", "")
nodeconf, err := config.ReadConfig(network)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 16 KiB