adding necessary changes for client and server key to work

This commit is contained in:
afeiszli 2021-04-13 01:10:57 -04:00
parent 2ea497c6ff
commit 587442dfe3
3 changed files with 9 additions and 5 deletions

View file

@ -526,7 +526,7 @@ func createAccessKey(w http.ResponseWriter, r *http.Request) {
netID := params["networkname"]
address := gconf.ServerGRPC + gconf.PortGRPC
accessstringdec := address + "." + netID + "." + accesskey.Value + "." + privAddr
accessstringdec := address + "|" + netID + "|" + accesskey.Value + "|" + privAddr
accesskey.AccessString = base64.StdEncoding.EncodeToString([]byte(accessstringdec))
network.AccessKeys = append(network.AccessKeys, accesskey)

View file

@ -93,7 +93,7 @@ func Install(accesskey string, password string, server string, network string, n
log.Fatalf("Something went wrong decoding your token: %v", err)
}
token := string(btoken)
tokenvals := strings.Split(token, ".")
tokenvals := strings.Split(token, "|")
tserver = tokenvals[0]
tnetwork = tokenvals[1]
tkey = tokenvals[2]
@ -108,11 +108,15 @@ func Install(accesskey string, password string, server string, network string, n
if accesskey == "badkey" {
accesskey = tkey
}
fmt.Println(trange)
if trange != "" {
islocal = true
_, localrange, err = net.ParseCIDR(trange)
printrange = localrange.String()
if err == nil {
printrange = localrange.String()
} else {
//localrange = ""
}
} else {
printrange = "Not a local network. Will use public address for endpoint."
}

View file

@ -13,7 +13,7 @@ import (
func DownloadNetclient() error {
// Get the data
resp, err := http.Get("https://github.com/gravitl/netmaker/releases/download/develop/netclient")
resp, err := http.Get("https://github.com/gravitl/netmaker/releases/download/latest/netclient")
if err != nil {
return err
}