diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index c38014b0b..a6acac69a 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -31,6 +31,7 @@ body: label: Version description: What version are you running? options: + - v0.20.4 - v0.20.3 - v0.20.2 - v0.20.1 diff --git a/.github/workflows/branchtest.yml b/.github/workflows/branchtest.yml index 222e9be59..ed545dee2 100644 --- a/.github/workflows/branchtest.yml +++ b/.github/workflows/branchtest.yml @@ -39,71 +39,12 @@ jobs: echo branch does not exist echo "netclientbranch=develop" >> $GITHUB_OUTPUT fi - - getserver: - runs-on: ubuntu-latest - needs: skip-check - if: ${{ needs.skip-check.outputs.skip != 'true' }} - outputs: - netmakerserver: ${{ steps.getserver.outputs.server }} - steps: - - name: setup ssh - run: | - mkdir -p ~/.ssh/ - echo "$SSH_KEY" > ~/.ssh/id_devops - chmod 600 ~/.ssh/id_devops - cat >>~/.ssh/config <> /tmp/server - break - fi - done - echo server is $server - if [ "$server" == "" ] - then - echo server not set - exit 1 - fi - echo "netmakerserver=${ server }" >> $GITHUB_OUTPUT - - name: save server name - uses: actions/upload-artifact@v3 - with: - name: server - path: /tmp/ping - retention-days: 3 - - terraform: - needs: [getbranch, getserver] - uses: gravitl/devops/.github/workflows/terraform.yml@master - with: - netmakerbranch: ${{ github.head_ref }} - netclientbranch: ${{ needs.getbranch.outputs.netclientbranch }} - server: ${{ needs.getserver.outputs.netmakerserver }} - secrets: inherit - - testbranch: - needs: [getbranch, terraform] - uses: gravitl/devops/.github/workflows/branchtest.yml@master + branchtest: + uses: gravitl/devops/.github/workflows/testdeploybranch.yml@master + needs: [getbranch, skip-check] with: + netclientbranch: ${{ needs.getbranch.outputs.netclientbranch }} + netmakerbranch: ${{ github.head_ref }} tag: ${{ github.run_id }}-${{ github.run_attempt }} - network: netmaker - secrets: inherit - + secrets: inherit diff --git a/.github/workflows/deletedroplets.yml b/.github/workflows/deletedroplets.yml index 7ec939dd0..359bd7b0d 100644 --- a/.github/workflows/deletedroplets.yml +++ b/.github/workflows/deletedroplets.yml @@ -26,7 +26,7 @@ jobs: webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} color: "#42f545" username: "GitHub Bot" - message: "${{ github.repository }}: ${{ github.event.workflow_run.name }} on dashboard.${{ env.SERVER }}.clustercat.com was successful: droplets from this workflow (tag ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}) will be deleted in 15 min" + message: " ${{ github.repository }}:${{ github.event.workflow_run.name }}:PR ${{ env.pull_request }} was successful: droplets from this workflow (tag ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt}}) will be deleted in 15 min" file: ./results/results.log - name: delete droplets if: success() || failure() @@ -67,7 +67,7 @@ jobs: webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} color: "#990000" username: "GitHub Bot" - message: "${{ github.repository }}: ${{ github.event.workflow_run.name }} failed: droplets from this workflow (tag ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt}}) will be deleted in 3 hours" + message: " ${{ github.repository}}:${{ github.event.workflow_run.name }}:PR ${{ env.pull_request}} failed: droplets from this workflow (tag ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}) will be deleted in 3 hours" file: ./results/results.log - name: discord error message uses: appleboy/discord-action@master diff --git a/README.md b/README.md index c69a561da..1ee6d840b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@

- + @@ -47,18 +47,22 @@ | :heavy_check_mark: Mesh VPNs | :heavy_check_mark: Private DNS | :heavy_check_mark: Mac | | :heavy_check_mark: Site-to-Site | :heavy_check_mark: Access Control Lists | :heavy_check_mark: Windows | -# Get Started in 5 Minutes +# Try Online -(For production-grade installations, visit the [Install Docs](https://netmaker.readthedocs.io/en/master/install.html).) +If you're just looking to use Netmaker, you can create an account for free at [netmaker.io](https://account.netmaker.io). + +# Self-Hosted Quick Start + +These are the instructions for deploying a Netmaker server on your own cloud VM as quickly as possible. For more detailed instructions, visit the [Install Docs](https://netmaker.readthedocs.io/en/master/install.html). 1. Get a cloud VM with Ubuntu 22.04 and a public IP. -2. Open ports 443, 80, and 51821-51830/udp on the VM firewall and in cloud security settings. -3. (optional) Prepare DNS - Set a wildcard subdomain in your DNS for Netmaker, e.g. *.netmaker.example.com +2. Open ports 443, 80, 3479, 8089 and 51821-51830/udp on the VM firewall and in cloud security settings. +3. (recommended) Prepare DNS - Set a wildcard subdomain in your DNS settings for Netmaker, e.g. *.netmaker.example.com, which points to your VM's pubic IP. 4. Run the script: `sudo wget -qO /root/nm-quick.sh https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/nm-quick.sh && sudo chmod +x /root/nm-quick.sh && sudo /root/nm-quick.sh` -This script gives you the option to deploy the Community or Enterprise version of Netmaker. If deploying Enterprise, you get a free account with a 50 node limit by default. It also gives you the option to use your own domain (recommended) or an auto-generated domain. +This script gives you the option to deploy the Community or Enterprise version of Netmaker. It also gives you the option to use your own domain (recommended) or an auto-generated domain.

diff --git a/compose/docker-compose.netclient.yml b/compose/docker-compose.netclient.yml index f6c05c3c1..96c6ead66 100644 --- a/compose/docker-compose.netclient.yml +++ b/compose/docker-compose.netclient.yml @@ -3,7 +3,7 @@ version: "3.4" services: netclient: container_name: netclient - image: 'gravitl/netclient:v0.20.3' + image: 'gravitl/netclient:v0.20.4' hostname: netmaker-1 network_mode: host restart: on-failure diff --git a/config/config.go b/config/config.go index 0dbafc853..1d0c7d1f7 100644 --- a/config/config.go +++ b/config/config.go @@ -71,7 +71,7 @@ type ServerConfig struct { MetricsExporter string `yaml:"metrics_exporter"` BasicAuth string `yaml:"basic_auth"` LicenseValue string `yaml:"license_value"` - NetmakerAccountID string `yaml:"netmaker_account_id"` + NetmakerTenantID string `yaml:"netmaker_tenant_id"` IsEE string `yaml:"is_ee"` StunPort int `yaml:"stun_port"` StunList string `yaml:"stun_list"` diff --git a/controllers/docs.go b/controllers/docs.go index 5408c50c7..52cb55f69 100644 --- a/controllers/docs.go +++ b/controllers/docs.go @@ -10,7 +10,7 @@ // // Schemes: https // BasePath: / -// Version: 0.20.3 +// Version: 0.20.4 // Host: netmaker.io // // Consumes: diff --git a/controllers/hosts.go b/controllers/hosts.go index 92f0fd897..764fe5c21 100644 --- a/controllers/hosts.go +++ b/controllers/hosts.go @@ -9,7 +9,6 @@ import ( "github.com/gorilla/mux" "github.com/gravitl/netmaker/logger" "github.com/gravitl/netmaker/logic" - "github.com/gravitl/netmaker/logic/hostactions" "github.com/gravitl/netmaker/models" "github.com/gravitl/netmaker/mq" "github.com/gravitl/netmaker/servercfg" @@ -199,6 +198,8 @@ func updateHost(w http.ResponseWriter, r *http.Request) { func deleteHost(w http.ResponseWriter, r *http.Request) { var params = mux.Vars(r) hostid := params["hostid"] + forceDelete := r.URL.Query().Get("force") == "true" + // confirm host exists currHost, err := logic.GetHost(hostid) if err != nil { @@ -206,7 +207,7 @@ func deleteHost(w http.ResponseWriter, r *http.Request) { logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal")) return } - if err = logic.RemoveHost(currHost); err != nil { + if err = logic.RemoveHost(currHost, forceDelete); err != nil { logger.Log(0, r.Header.Get("user"), "failed to delete a host:", err.Error()) logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal")) return @@ -259,18 +260,14 @@ func addHostToNetwork(w http.ResponseWriter, r *http.Request) { return } logger.Log(1, "added new node", newNode.ID.String(), "to host", currHost.Name) - hostactions.AddAction(models.HostUpdate{ - Action: models.JoinHostToNetwork, - Host: *currHost, - Node: *newNode, - }) - if servercfg.IsMessageQueueBackend() { + go func() { mq.HostUpdate(&models.HostUpdate{ - Action: models.RequestAck, + Action: models.JoinHostToNetwork, Host: *currHost, + Node: *newNode, }) - } - + mq.PublishPeerUpdate() + }() logger.Log(2, r.Header.Get("user"), fmt.Sprintf("added host %s to network %s", currHost.Name, network)) w.WriteHeader(http.StatusOK) } @@ -291,6 +288,7 @@ func deleteHostFromNetwork(w http.ResponseWriter, r *http.Request) { var params = mux.Vars(r) hostid := params["hostid"] network := params["network"] + forceDelete := r.URL.Query().Get("force") == "true" if hostid == "" || network == "" { logic.ReturnErrorResponse(w, r, logic.FormatError(errors.New("hostid or network cannot be empty"), "badrequest")) return @@ -309,18 +307,37 @@ func deleteHostFromNetwork(w http.ResponseWriter, r *http.Request) { logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal")) return } + if node.IsRelayed { + // cleanup node from relayednodes on relay node + relayNode, err := logic.GetNodeByID(node.RelayedBy) + if err == nil { + relayedNodes := []string{} + for _, relayedNodeID := range relayNode.RelayedNodes { + if relayedNodeID == node.ID.String() { + continue + } + relayedNodes = append(relayedNodes, relayedNodeID) + } + relayNode.RelayedNodes = relayedNodes + logic.UpsertNode(&relayNode) + } + } + if node.IsRelay { + // unset all the relayed nodes + logic.SetRelayedNodes(false, node.ID.String(), node.RelayedNodes) + } node.Action = models.NODE_DELETE node.PendingDelete = true logger.Log(1, "deleting node", node.ID.String(), "from host", currHost.Name) - if err := logic.DeleteNode(node, false); err != nil { + if err := logic.DeleteNode(node, forceDelete); err != nil { logic.ReturnErrorResponse(w, r, logic.FormatError(fmt.Errorf("failed to delete node"), "internal")) return } // notify node change - runUpdates(node, false) go func() { // notify of peer change - if err := mq.PublishPeerUpdate(); err != nil { + err = mq.PublishDeletedNodePeerUpdate(node) + if err != nil { logger.Log(1, "error publishing peer update ", err.Error()) } if err := mq.PublishDNSDelete(node, currHost); err != nil { diff --git a/controllers/node.go b/controllers/node.go index 667fbb519..1d92acd58 100644 --- a/controllers/node.go +++ b/controllers/node.go @@ -721,6 +721,7 @@ func deleteNode(w http.ResponseWriter, r *http.Request) { // get params var params = mux.Vars(r) var nodeid = params["nodeid"] + forceDelete := r.URL.Query().Get("force") == "true" fromNode := r.Header.Get("requestfrom") == "node" node, err := logic.GetNodeByID(nodeid) if err != nil { @@ -754,13 +755,13 @@ func deleteNode(w http.ResponseWriter, r *http.Request) { relayNode.RelayedNodes = relayedNodes logic.UpsertNode(&relayNode) } - } if node.IsRelay { // unset all the relayed nodes logic.SetRelayedNodes(false, node.ID.String(), node.RelayedNodes) } - if err := logic.DeleteNode(&node, fromNode); err != nil { + purge := forceDelete || fromNode + if err := logic.DeleteNode(&node, purge); err != nil { logic.ReturnErrorResponse(w, r, logic.FormatError(fmt.Errorf("failed to delete node"), "internal")) return } @@ -770,17 +771,12 @@ func deleteNode(w http.ResponseWriter, r *http.Request) { if !fromNode { // notify node change runUpdates(&node, false) } - go func(deletedNode *models.Node, fromNode bool) { // notify of peer change + go func() { // notify of peer change var err error - if fromNode { - err = mq.PublishDeletedNodePeerUpdate(deletedNode) - } else { - err = mq.PublishPeerUpdate() - } + err = mq.PublishDeletedNodePeerUpdate(&node) if err != nil { logger.Log(1, "error publishing peer update ", err.Error()) } - host, err := logic.GetHost(node.HostID.String()) if err != nil { logger.Log(1, "failed to retrieve host for node", node.ID.String(), err.Error()) @@ -788,7 +784,7 @@ func deleteNode(w http.ResponseWriter, r *http.Request) { if err := mq.PublishDNSDelete(&node, host); err != nil { logger.Log(1, "error publishing dns update", err.Error()) } - }(&node, fromNode) + }() } func runUpdates(node *models.Node, ifaceDelta bool) { diff --git a/ee/license.go b/ee/license.go index d9b197ab7..b49f90270 100644 --- a/ee/license.go +++ b/ee/license.go @@ -48,9 +48,9 @@ func AddLicenseHooks() { // if license is not valid, server should terminate func ValidateLicense() error { licenseKeyValue := servercfg.GetLicenseKey() - netmakerAccountID := servercfg.GetNetmakerAccountID() + netmakerTenantID := servercfg.GetNetmakerTenantID() logger.Log(0, "proceeding with Netmaker license validation...") - if len(licenseKeyValue) == 0 || len(netmakerAccountID) == 0 { + if len(licenseKeyValue) == 0 || len(netmakerTenantID) == 0 { logger.FatalLog0(errValidation.Error()) } @@ -65,7 +65,7 @@ func ValidateLicense() error { } licenseSecret := LicenseSecret{ - AssociatedID: netmakerAccountID, + AssociatedID: netmakerTenantID, Limits: getCurrentServerLimit(), } diff --git a/go.mod b/go.mod index e005aa51f..6a95af3ae 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/gravitl/netmaker go 1.19 require ( - github.com/eclipse/paho.mqtt.golang v1.4.2 + github.com/eclipse/paho.mqtt.golang v1.4.3 github.com/go-playground/validator/v10 v10.14.1 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/google/uuid v1.3.0 @@ -15,14 +15,14 @@ require ( github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/stretchr/testify v1.8.4 github.com/txn2/txeh v1.4.0 - golang.org/x/crypto v0.10.0 - golang.org/x/net v0.11.0 // indirect - golang.org/x/oauth2 v0.9.0 - golang.org/x/sys v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/crypto v0.11.0 + golang.org/x/net v0.12.0 // indirect + golang.org/x/oauth2 v0.10.0 + golang.org/x/sys v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.zx2c4.com/wireguard v0.0.0-20220920152132-bb719d3a6e2c // indirect golang.zx2c4.com/wireguard/wgctrl v0.0.0-20220324164955-056925b7df31 - google.golang.org/protobuf v1.28.1 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 ) @@ -35,13 +35,12 @@ require ( require ( github.com/coreos/go-oidc/v3 v3.6.0 github.com/gorilla/websocket v1.5.0 - github.com/pkg/errors v0.9.1 golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 - gortc.io/stun v1.23.0 ) require ( github.com/devilcove/httpclient v0.6.0 + github.com/go-jose/go-jose/v3 v3.0.0 github.com/guumaster/tablewriter v0.0.10 github.com/matryer/is v1.4.1 github.com/olekukonko/tablewriter v0.0.5 @@ -49,21 +48,20 @@ require ( ) require ( - cloud.google.com/go/compute/metadata v0.2.1 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect - github.com/go-jose/go-jose/v3 v3.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/spf13/pflag v1.0.5 // indirect ) require ( - cloud.google.com/go/compute v1.12.1 // indirect + cloud.google.com/go/compute v1.20.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.3 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/hashicorp/go-version v1.6.0 github.com/josharian/native v1.0.0 // indirect diff --git a/go.sum b/go.sum index e50910551..f6bc93af4 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ -cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -16,8 +16,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/devilcove/httpclient v0.6.0 h1:M5YAfHeNbu+0QxCiOCo/fKN+Hf0BtF/6aovu3NNgcKk= github.com/devilcove/httpclient v0.6.0/go.mod h1:ctrAO2gRgTT+GxtRdWBp2SMQ+vacuxXlbhmlM4oWhs8= -github.com/eclipse/paho.mqtt.golang v1.4.2 h1:66wOzfUHSSI1zamx7jR6yMEI5EuHnT1G6rNA5PM12m4= -github.com/eclipse/paho.mqtt.golang v1.4.2/go.mod h1:JGt0RsEwEX+Xa/agj90YJ9d9DH2b7upDZMK9HRbFvCA= +github.com/eclipse/paho.mqtt.golang v1.4.3 h1:2kwcUGn8seMUfWndX0hGbvH8r7crgcJguQNCyp70xik= +github.com/eclipse/paho.mqtt.golang v1.4.3/go.mod h1:CSYvoAlsMkhYOXh/oKyxa8EcBci6dVkLCbo5tTC1RIE= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -36,8 +36,8 @@ github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOW github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -50,7 +50,6 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/guumaster/tablewriter v0.0.10 h1:A0HD94yMdt4usgxBjoEceNeE0XMJ027euoHAzsPqBQs= @@ -83,8 +82,6 @@ github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721 h1:RlZweED6sbSArvlE9 github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posthog/posthog-go v0.0.0-20211028072449-93c17c49e2b0 h1:Y2hUrkfuM0on62KZOci/VLijlkdF/yeWU262BQgvcjE= @@ -121,28 +118,26 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220208050332-20e1d8d225ab/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211111083644-e5c967477495/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= -golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -152,8 +147,8 @@ golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220207234003-57398862261d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -161,8 +156,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -177,13 +172,11 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gortc.io/stun v1.23.0 h1:CpRQFjakCZMwVKTwInKbcCzlBklj62LGzD3NPdFyGrE= -gortc.io/stun v1.23.0/go.mod h1:XD5lpONVyjvV3BgOyJFNo0iv6R2oZB4L+weMqxts+zg= diff --git a/k8s/client/netclient-daemonset.yaml b/k8s/client/netclient-daemonset.yaml index 09d3a8bdd..5c310628d 100644 --- a/k8s/client/netclient-daemonset.yaml +++ b/k8s/client/netclient-daemonset.yaml @@ -16,7 +16,7 @@ spec: hostNetwork: true containers: - name: netclient - image: gravitl/netclient:v0.20.3 + image: gravitl/netclient:v0.20.4 env: - name: TOKEN value: "TOKEN_VALUE" diff --git a/k8s/client/netclient.yaml b/k8s/client/netclient.yaml index 8a7aecba0..dd54033b2 100644 --- a/k8s/client/netclient.yaml +++ b/k8s/client/netclient.yaml @@ -28,7 +28,7 @@ spec: # - "" containers: - name: netclient - image: gravitl/netclient:v0.20.3 + image: gravitl/netclient:v0.20.4 env: - name: TOKEN value: "TOKEN_VALUE" diff --git a/k8s/server/netmaker-ui.yaml b/k8s/server/netmaker-ui.yaml index a39e63e2d..8719225eb 100644 --- a/k8s/server/netmaker-ui.yaml +++ b/k8s/server/netmaker-ui.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: netmaker-ui - image: gravitl/netmaker-ui:v0.20.3 + image: gravitl/netmaker-ui:v0.20.4 ports: - containerPort: 443 env: diff --git a/logic/host_test.go b/logic/host_test.go index 49bd24269..333c99bd0 100644 --- a/logic/host_test.go +++ b/logic/host_test.go @@ -44,7 +44,7 @@ func TestCheckPorts(t *testing.T) { //not sure why this initialization is required but without it // RemoveHost returns database is closed database.InitializeDatabase() - RemoveHost(&h) + RemoveHost(&h, true) CreateHost(&h) t.Run("no change", func(t *testing.T) { is := is.New(t) diff --git a/logic/hosts.go b/logic/hosts.go index 06b46fd30..1972f8189 100644 --- a/logic/hosts.go +++ b/logic/hosts.go @@ -296,17 +296,26 @@ func UpsertHost(h *models.Host) error { } // RemoveHost - removes a given host from server -func RemoveHost(h *models.Host) error { - if len(h.Nodes) > 0 { +func RemoveHost(h *models.Host, forceDelete bool) error { + if !forceDelete && len(h.Nodes) > 0 { return fmt.Errorf("host still has associated nodes") } + if servercfg.IsUsingTurn() { DeRegisterHostWithTurn(h.ID.String()) } + + if len(h.Nodes) > 0 { + if err := DisassociateAllNodesFromHost(h.ID.String()); err != nil { + return err + } + } + err := database.DeleteRecord(database.HOSTS_TABLE_NAME, h.ID.String()) if err != nil { return err } + deleteHostFromCache(h.ID.String()) return nil } diff --git a/logic/peers.go b/logic/peers.go index 909a2e32d..1d8a54014 100644 --- a/logic/peers.go +++ b/logic/peers.go @@ -191,6 +191,12 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N PersistentKeepaliveInterval: &peer.PersistentKeepalive, ReplaceAllowedIPs: true, } + if peer.IsEgressGateway { + hostPeerUpdate.EgressRoutes = append(hostPeerUpdate.EgressRoutes, models.EgressNetworkRoutes{ + NodeAddr: node.PrimaryAddressIPNet(), + EgressRanges: peer.EgressGatewayRanges, + }) + } if node.IsIngressGateway || node.IsEgressGateway { if peer.IsIngressGateway { _, extPeerIDAndAddrs, err := getExtPeers(&peer) @@ -312,7 +318,6 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N } hostPeerUpdate.NodePeers = append(hostPeerUpdate.NodePeers, nodePeer) } - //} } var extPeers []wgtypes.PeerConfig var extPeerIDAndAddrs []models.IDandAddr @@ -387,6 +392,18 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N } hostPeerUpdate.Peers[i] = peer } + if deletedNode != nil && host.OS != models.OS_Types.IoT { + peerHost, err := GetHost(deletedNode.HostID.String()) + if err == nil && host.ID != peerHost.ID { + if _, ok := peerIndexMap[peerHost.PublicKey.String()]; !ok { + hostPeerUpdate.Peers = append(hostPeerUpdate.Peers, wgtypes.PeerConfig{ + PublicKey: peerHost.PublicKey, + Remove: true, + }) + } + } + + } for i := range hostPeerUpdate.NodePeers { peer := hostPeerUpdate.NodePeers[i] diff --git a/logic/zombie.go b/logic/zombie.go index 199a8b4d9..e51365fc0 100644 --- a/logic/zombie.go +++ b/logic/zombie.go @@ -120,7 +120,7 @@ func ManageZombies(ctx context.Context, peerUpdate chan *models.Node) { continue } if len(host.Nodes) == 0 { - if err := RemoveHost(host); err != nil { + if err := RemoveHost(host, true); err != nil { logger.Log(0, "error deleting zombie host", host.ID.String(), err.Error()) } } diff --git a/main.go b/main.go index 66041f556..d4dea722c 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ import ( "golang.org/x/exp/slog" ) -var version = "v0.20.3" +var version = "v0.20.4" // Start DB Connection and start API Request Handler func main() { diff --git a/models/mqtt.go b/models/mqtt.go index 8ac6b63a3..a68b7bba3 100644 --- a/models/mqtt.go +++ b/models/mqtt.go @@ -22,6 +22,7 @@ type HostPeerUpdate struct { PeerIDs PeerMap `json:"peerids" bson:"peerids" yaml:"peerids"` EndpointDetection bool `json:"endpointdetection" yaml:"endpointdetection"` HostNetworkInfo HostInfoMap `json:"host_network_info,omitempty" bson:"host_network_info,omitempty" yaml:"host_network_info,omitempty"` + EgressRoutes []EgressNetworkRoutes `json:"egress_network_routes"` } // IngressInfo - struct for ingress info @@ -39,6 +40,12 @@ type EgressInfo struct { EgressGWCfg EgressGatewayRequest `json:"egress_gateway_cfg" yaml:"egress_gateway_cfg"` } +// EgressNetworkRoutes - struct for egress network routes for adding routes to peer's interface +type EgressNetworkRoutes struct { + NodeAddr net.IPNet `json:"node_addr"` + EgressRanges []string `json:"egress_ranges"` +} + // PeerRouteInfo - struct for peer info for an ext. client type PeerRouteInfo struct { PeerAddr net.IPNet `json:"peer_addr" yaml:"peer_addr"` diff --git a/release.md b/release.md index 0981cbf9f..431528a51 100644 --- a/release.md +++ b/release.md @@ -1,24 +1,22 @@ -# Netmaker v0.20.3 +# Netmaker v0.20.4 ## Whats New -- Moved to new licensing server for self-hosted -- STUN removed from netmaker server to improve memory performance -- Added DB caching to drastically reduce read/writes from disk +- FreeBSD 13/14 specific binaries +- Whitelabelling capabilities ## What's Fixed -- Major memory leak resolved due to STUN -- Issues with netclient ports on daemon restart -- Windows GUI unable to find netclient backend -- Major scalability fixes - Can now scale to hundreds of hosts with low resources -- Resolved ACL panic -- Reverted blocking creation of Ingress with NAT +- Fixes for FreeBSD +- Mac installer installs WireGuard +- ACL rendering on UI +- Updating Endpoint IP from UI ## known issues +- Windows installer does not install WireGuard - netclient-gui (windows) will display an erroneous error dialog when joining a network (can be ignored) - netclient-gui will continously display error dialog if netmaker server is offline - Incorrect metrics against ext clients -- Host ListenPorts set to 0 after migration from 0.17.1 -> 0.20.3 +- Host ListenPorts set to 0 after migration from 0.17.1 -> 0.20.4 - Mac IPv6 addresses/route issues - Docker client can not re-join after complete deletion - netclient-gui network tab blank after disconnect diff --git a/scripts/netmaker.default.env b/scripts/netmaker.default.env index b99f4818d..226895e49 100644 --- a/scripts/netmaker.default.env +++ b/scripts/netmaker.default.env @@ -15,7 +15,7 @@ MQ_USERNAME= # The password to set for MQ access MQ_PASSWORD= INSTALL_TYPE= -NETMAKER_ACCOUNT_ID= +NETMAKER_TENANT_ID= LICENSE_KEY= SERVER_IMAGE_TAG= UI_IMAGE_TAG= diff --git a/scripts/nm-quick.sh b/scripts/nm-quick.sh index 3e761b105..67b30668f 100755 --- a/scripts/nm-quick.sh +++ b/scripts/nm-quick.sh @@ -43,6 +43,7 @@ while getopts evab:d:t: flag; do case "${flag}" in e) INSTALL_TYPE="ee" + UPGRADE_FLAG="yes" ;; v) usage @@ -120,7 +121,7 @@ set_buildinfo() { elif [ -z "$INSTALL_TYPE" ]; then echo "-----------------------------------------------------" echo "Would you like to install Netmaker Community Edition (CE), or Netmaker Enterprise Edition (EE)?" - echo "EE will require you to create an account at https://dashboard.license.netmaker.io" + echo "EE will require you to create an account at https://app.netmaker.io" echo "-----------------------------------------------------" select install_option in "Community Edition" "Enterprise Edition"; do case $REPLY in @@ -291,7 +292,7 @@ save_config() { ( fi # version-specific entries if [ "$INSTALL_TYPE" = "ee" ]; then - save_config_item NETMAKER_ACCOUNT_ID "$ACCOUNT_ID" + save_config_item NETMAKER_TENANT_ID "$TENANT_ID" save_config_item LICENSE_KEY "$LICENSE_KEY" save_config_item METRICS_EXPORTER "on" save_config_item PROMETHEUS "on" @@ -307,7 +308,7 @@ save_config() { ( fi # copy entries from the previous config local toCopy=("SERVER_HOST" "MASTER_KEY" "TURN_USERNAME" "TURN_PASSWORD" "MQ_USERNAME" "MQ_PASSWORD" - "INSTALL_TYPE" "NODE_ID" "METRICS_EXPORTER" "PROMETHEUS" "DNS_MODE" "NETCLIENT_AUTO_UPDATE" "API_PORT" + "INSTALL_TYPE" "NODE_ID" "DNS_MODE" "NETCLIENT_AUTO_UPDATE" "API_PORT" "CORS_ALLOWED_ORIGIN" "DISPLAY_KEYS" "DATABASE" "SERVER_BROKER_ENDPOINT" "STUN_PORT" "VERBOSITY" "DEFAULT_PROXY_MODE" "TURN_PORT" "USE_TURN" "DEBUG_MODE" "TURN_API_PORT" "REST_BACKEND" "DISABLE_REMOTE_IP_CHECK" "NETCLIENT_ENDPOINT_DETECTION" "TELEMETRY" "AUTH_PROVIDER" "CLIENT_ID" "CLIENT_SECRET" @@ -565,18 +566,18 @@ set_install_vars() { echo "-----------------------------------------------------" echo "Provide Details for EE installation:" - echo " 1. Log into https://dashboard.license.netmaker.io" - echo " 2. Copy License Key Value: https://dashboard.license.netmaker.io/license-keys" - echo " 3. Retrieve Account ID: https://dashboard.license.netmaker.io/user" + echo " 1. Log into https://app.netmaker.io" + echo " 2. follow instructions to get a license at: https://docs.netmaker.io/ee/ee-setup.html" + echo " 3. Retrieve License and Tenant ID" echo " 4. note email address" echo "-----------------------------------------------------" unset LICENSE_KEY while [ -z "$LICENSE_KEY" ]; do read -p "License Key: " LICENSE_KEY done - unset ACCOUNT_ID - while [ -z ${ACCOUNT_ID} ]; do - read -p "Account ID: " ACCOUNT_ID + unset TENANT_ID + while [ -z ${TENANT_ID} ]; do + read -p "Tenant ID: " TENANT_ID done fi @@ -709,7 +710,7 @@ set_install_vars() { echo " public ip: $SERVER_HOST" if [ "$INSTALL_TYPE" = "ee" ]; then echo " license: $LICENSE_KEY" - echo " account id: $ACCOUNT_ID" + echo " account id: $TENANT_ID" fi echo "-----------------------------------------------------------------" echo "Confirm Settings for Installation" @@ -880,6 +881,9 @@ print_logo if [ -f "$CONFIG_PATH" ]; then echo "Using config: $CONFIG_PATH" source "$CONFIG_PATH" + if [ "$UPGRADE_FLAG" = "yes" ]; then + INSTALL_TYPE="ee" + fi fi # 2. setup the build instructions diff --git a/scripts/nm-upgrade-0-17-1-to-0-19-0.sh b/scripts/nm-upgrade-0-17-1-to-0-19-0.sh index 7804bb5a4..da80590a1 100644 --- a/scripts/nm-upgrade-0-17-1-to-0-19-0.sh +++ b/scripts/nm-upgrade-0-17-1-to-0-19-0.sh @@ -1,6 +1,6 @@ #!/bin/bash -LATEST="v0.20.3" +LATEST="v0.20.4" INSTALL_PATH="/root" trap restore_old_netmaker_instructions diff --git a/servercfg/serverconf.go b/servercfg/serverconf.go index 185fd8708..910bd997d 100644 --- a/servercfg/serverconf.go +++ b/servercfg/serverconf.go @@ -670,13 +670,13 @@ func GetLicenseKey() string { return licenseKeyValue } -// GetNetmakerAccountID - get's the associated, Netmaker, account ID to verify ownership -func GetNetmakerAccountID() string { - netmakerAccountID := os.Getenv("NETMAKER_ACCOUNT_ID") - if netmakerAccountID == "" { - netmakerAccountID = config.Config.Server.NetmakerAccountID +// GetNetmakerTenantID - get's the associated, Netmaker, tenant ID to verify ownership +func GetNetmakerTenantID() string { + netmakerTenantID := os.Getenv("NETMAKER_TENANT_ID") + if netmakerTenantID == "" { + netmakerTenantID = config.Config.Server.NetmakerTenantID } - return netmakerAccountID + return netmakerTenantID } // GetStunPort - Get the port to run the stun server on diff --git a/swagger.yaml b/swagger.yaml index 88ac6c2a0..079ae858d 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -704,7 +704,7 @@ info: API calls must be authenticated via a header of the format -H “Authorization: Bearer ” There are two methods to obtain YOUR_SECRET_KEY: 1. Using the masterkey. By default, this value is “secret key,” but you should change this on your instance and keep it secure. This value can be set via env var at startup or in a config file (config/environments/< env >.yaml). See the [Netmaker](https://docs.netmaker.org/index.html) documentation for more details. 2. Using a JWT received for a node. This can be retrieved by calling the /api/nodes//authenticate endpoint, as documented below. title: Netmaker - version: 0.20.3 + version: 0.20.4 paths: /api/dns: get: