Browse Source

Merge pull request #1854 from gravitl/release_v0.17.1

Release v0.17.1
dcarns 2 years ago
parent
commit
248672e545

+ 1 - 0
.github/ISSUE_TEMPLATE/bug-report.yml

@@ -31,6 +31,7 @@ body:
       label: Version
       label: Version
       description: What version are you running?
       description: What version are you running?
       options:
       options:
+        - v0.17.1      
         - v0.17.0
         - v0.17.0
         - v0.16.3
         - v0.16.3
         - v0.16.2
         - v0.16.2

+ 18 - 14
.github/workflows/publish-docker.yml

@@ -13,7 +13,7 @@ jobs:
   docker:
   docker:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     steps:
     steps:
-      - 
+      -
         name: Set tag
         name: Set tag
         run: |
         run: |
             if [[ -n "${{ github.event.inputs.tag }}" ]]; then
             if [[ -n "${{ github.event.inputs.tag }}" ]]; then
@@ -24,16 +24,16 @@ jobs:
               TAG="${{ github.ref_name }}"
               TAG="${{ github.ref_name }}"
             fi
             fi
             echo "TAG=${TAG}" >> $GITHUB_ENV
             echo "TAG=${TAG}" >> $GITHUB_ENV
-      - 
+      -
         name: Checkout
         name: Checkout
         uses: actions/checkout@v3
         uses: actions/checkout@v3
-      - 
+      -
         name: Set up QEMU
         name: Set up QEMU
         uses: docker/setup-qemu-action@v2
         uses: docker/setup-qemu-action@v2
-      - 
+      -
         name: Set up Docker Buildx
         name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v2
         uses: docker/setup-buildx-action@v2
-      - 
+      -
         name: Login to DockerHub
         name: Login to DockerHub
         uses: docker/login-action@v2
         uses: docker/login-action@v2
         with:
         with:
@@ -47,31 +47,33 @@ jobs:
           platforms: linux/amd64, linux/arm64, linux/arm/v7
           platforms: linux/amd64, linux/arm64, linux/arm/v7
           push: true
           push: true
           tags: ${{ github.repository }}:${{ env.TAG }}, ${{ github.repository }}:latest
           tags: ${{ github.repository }}:${{ env.TAG }}, ${{ github.repository }}:latest
-          build-args: version=${{ env.TAG }}
+          build-args: | 
+            version=${{ env.TAG }}
+            tags=ce
 
 
   docker-ee:
   docker-ee:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     steps:
     steps:
-      - 
+      -
         name: Set tag
         name: Set tag
         run: |
         run: |
             if [[ -n "${{ github.event.inputs.tag }}" ]]; then
             if [[ -n "${{ github.event.inputs.tag }}" ]]; then
-              docker/build-push-action@v3.tag }}
+              TAG=${{ github.event.inputs.tag }}
             elif [[ "${{ github.ref_name }}" == 'master' ]]; then
             elif [[ "${{ github.ref_name }}" == 'master' ]]; then
               TAG="latest"
               TAG="latest"
             else
             else
               TAG="${{ github.ref_name }}"
               TAG="${{ github.ref_name }}"
             fi
             fi
             echo "TAG=${TAG}" >> $GITHUB_ENV
             echo "TAG=${TAG}" >> $GITHUB_ENV
-      - 
+      -
         name: Checkout
         name: Checkout
         uses: actions/checkout@v3
         uses: actions/checkout@v3
-      - 
+      -
         name: Set up QEMU
         name: Set up QEMU
         uses: docker/setup-qemu-action@v2
         uses: docker/setup-qemu-action@v2
-      - 
+      -
         name: Set up Docker Buildx
         name: Set up Docker Buildx
-        uses: docker/build-push-action@v3
+        uses: docker/setup-buildx-action@v2
       - 
       - 
         name: Login to DockerHub
         name: Login to DockerHub
         uses: docker/login-action@v2
         uses: docker/login-action@v2
@@ -83,7 +85,9 @@ jobs:
         uses: docker/build-push-action@v3
         uses: docker/build-push-action@v3
         with:
         with:
           context: .
           context: .
-          platforms: linux/amd64, linux/arm64, linux/arm/v7
+          platforms: linux/amd64, linux/arm64
           push: true
           push: true
           tags: ${{ github.repository }}:${{ env.TAG }}-ee
           tags: ${{ github.repository }}:${{ env.TAG }}-ee
-          build-args: version=${{ env.TAG }}, tags="-tags=ee"
+          build-args: |
+            version=${{ env.TAG }}
+            tags=ee

+ 1 - 0
.gitignore

@@ -3,6 +3,7 @@ netmaker-arm
 netmaker-arm64
 netmaker-arm64
 netmaker-32
 netmaker-32
 netmaker-amd64
 netmaker-amd64
+cli/nmctl
 netclient/netclient
 netclient/netclient
 netclient/netclient.syso
 netclient/netclient.syso
 netclient/build
 netclient/build

+ 1 - 1
Dockerfile

@@ -7,7 +7,7 @@ COPY . .
 ENV GO111MODULE=auto
 ENV GO111MODULE=auto
 
 
 RUN apk add git
 RUN apk add git
-RUN GOOS=linux CGO_ENABLED=1 go build ${tags} -ldflags="-s -X 'main.version=${version}'" .
+RUN GOOS=linux CGO_ENABLED=1 go build -ldflags="-s -X 'main.version=${version}'" -tags ${tags} .
 # RUN go build -tags=ee . -o netmaker main.go
 # RUN go build -tags=ee . -o netmaker main.go
 FROM alpine:3.16.2
 FROM alpine:3.16.2
 
 

+ 2 - 2
README.md

@@ -17,7 +17,7 @@
 
 
 <p align="center">
 <p align="center">
   <a href="https://github.com/gravitl/netmaker/releases">
   <a href="https://github.com/gravitl/netmaker/releases">
-    <img src="https://img.shields.io/badge/Version-0.17.0-informational?style=flat-square" />
+    <img src="https://img.shields.io/badge/Version-0.17.1-informational?style=flat-square" />
   </a>
   </a>
   <a href="https://hub.docker.com/r/gravitl/netmaker/tags">
   <a href="https://hub.docker.com/r/gravitl/netmaker/tags">
     <img src="https://img.shields.io/docker/pulls/gravitl/netmaker?label=downloads" />
     <img src="https://img.shields.io/docker/pulls/gravitl/netmaker?label=downloads" />
@@ -57,7 +57,7 @@
 3. (optional) Prepare DNS - Set a wildcard subdomain in your DNS for Netmaker, e.g. *.netmaker.example.com
 3. (optional) Prepare DNS - Set a wildcard subdomain in your DNS for Netmaker, e.g. *.netmaker.example.com
 4. Run the script: 
 4. Run the script: 
 
 
-`sudo wget -qO /root/nm-quick-interactive.sh https://raw.githubusercontent.com/gravitl/netmaker/test_v0.17.0_compose/scripts/nm-quick-interactive.sh && sudo chmod +x /root/nm-quick-interactive.sh && sudo /root/nm-quick-interactive.sh`  
+`sudo wget -qO /root/nm-quick-interactive.sh https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/nm-quick-interactive.sh && sudo chmod +x /root/nm-quick-interactive.sh && sudo /root/nm-quick-interactive.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. 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. 
 
 

+ 2 - 2
compose/docker-compose.ee.yml

@@ -3,7 +3,7 @@ version: "3.4"
 services:
 services:
   netmaker:
   netmaker:
     container_name: netmaker
     container_name: netmaker
-    image: gravitl/netmaker:v0.17.0-ee
+    image: gravitl/netmaker:v0.17.1-ee
     cap_add: 
     cap_add: 
       - NET_ADMIN
       - NET_ADMIN
       - NET_RAW
       - NET_RAW
@@ -47,7 +47,7 @@ services:
       - "51821-51830:51821-51830/udp"
       - "51821-51830:51821-51830/udp"
   netmaker-ui:
   netmaker-ui:
     container_name: netmaker-ui
     container_name: netmaker-ui
-    image: gravitl/netmaker-ui:v0.17.0
+    image: gravitl/netmaker-ui:v0.17.1
     depends_on:
     depends_on:
       - netmaker
       - netmaker
     links:
     links:

+ 2 - 2
compose/docker-compose.reference.yml

@@ -3,7 +3,7 @@ version: "3.4"
 services:
 services:
   netmaker: # The Primary Server for running Netmaker
   netmaker: # The Primary Server for running Netmaker
     container_name: netmaker
     container_name: netmaker
-    image: gravitl/netmaker:v0.17.0
+    image: gravitl/netmaker:v0.17.1
     cap_add: 
     cap_add: 
       - NET_ADMIN
       - NET_ADMIN
       - NET_RAW
       - NET_RAW
@@ -54,7 +54,7 @@ services:
       - "51821-51830:51821-51830/udp" # wireguard ports
       - "51821-51830:51821-51830/udp" # wireguard ports
   netmaker-ui:  # The Netmaker UI Component
   netmaker-ui:  # The Netmaker UI Component
     container_name: netmaker-ui
     container_name: netmaker-ui
-    image: gravitl/netmaker-ui:v0.17.0
+    image: gravitl/netmaker-ui:v0.17.1
     depends_on:
     depends_on:
       - netmaker
       - netmaker
     links:
     links:

+ 3 - 6
compose/docker-compose.yml

@@ -3,7 +3,7 @@ version: "3.4"
 services:
 services:
   netmaker:
   netmaker:
     container_name: netmaker
     container_name: netmaker
-    image: gravitl/netmaker:v0.17.0
+    image: gravitl/netmaker:v0.17.1
     cap_add: 
     cap_add: 
       - NET_ADMIN
       - NET_ADMIN
       - NET_RAW
       - NET_RAW
@@ -44,7 +44,7 @@ services:
       - "51821-51830:51821-51830/udp"
       - "51821-51830:51821-51830/udp"
   netmaker-ui:
   netmaker-ui:
     container_name: netmaker-ui
     container_name: netmaker-ui
-    image: gravitl/netmaker-ui:v0.17.0
+    image: gravitl/netmaker-ui:v0.17.1
     depends_on:
     depends_on:
       - netmaker
       - netmaker
     links:
     links:
@@ -86,13 +86,10 @@ services:
       - /root/wait.sh:/mosquitto/config/wait.sh
       - /root/wait.sh:/mosquitto/config/wait.sh
       - mosquitto_data:/mosquitto/data
       - mosquitto_data:/mosquitto/data
       - mosquitto_logs:/mosquitto/log
       - mosquitto_logs:/mosquitto/log
-    ports:
-      - "1883:1883"
-      - "8883:8883"
 volumes:
 volumes:
   caddy_data: {}
   caddy_data: {}
   caddy_conf: {}
   caddy_conf: {}
   sqldata: {}
   sqldata: {}
   dnsconfig: {}
   dnsconfig: {}
   mosquitto_data: {}
   mosquitto_data: {}
-  mosquitto_logs: {}
+  mosquitto_logs: {}

+ 1 - 1
controllers/docs.go

@@ -10,7 +10,7 @@
 //
 //
 //	Schemes: https
 //	Schemes: https
 //	BasePath: /
 //	BasePath: /
-//	Version: 0.17.0
+//	Version: 0.17.1
 //	Host: netmaker.io
 //	Host: netmaker.io
 //
 //
 //	Consumes:
 //	Consumes:

+ 1 - 1
docker/Dockerfile-netclient-multiarch-userspace

@@ -6,7 +6,7 @@ COPY . .
 
 
 ENV GO111MODULE=auto
 ENV GO111MODULE=auto
 
 
-RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 /usr/local/go/bin/go build -ldflags="-w -s" -o netclient-app netclient/main.go
+RUN GOOS=linux CGO_ENABLED=0 /usr/local/go/bin/go build -ldflags="-w -s" -o netclient-app netclient/main.go
 
 
 WORKDIR /root/
 WORKDIR /root/
 
 

+ 1 - 1
k8s/client/netclient-daemonset.yaml

@@ -16,7 +16,7 @@ spec:
       hostNetwork: true
       hostNetwork: true
       containers:
       containers:
       - name: netclient
       - name: netclient
-        image: gravitl/netclient:v0.17.0
+        image: gravitl/netclient:v0.17.1
         env:
         env:
         - name: TOKEN
         - name: TOKEN
           value: "TOKEN_VALUE"
           value: "TOKEN_VALUE"

+ 1 - 1
k8s/client/netclient.yaml

@@ -28,7 +28,7 @@ spec:
       #           - "<node label value>"
       #           - "<node label value>"
       containers:
       containers:
       - name: netclient
       - name: netclient
-        image: gravitl/netclient:v0.17.0
+        image: gravitl/netclient:v0.17.1
         env:
         env:
         - name: TOKEN
         - name: TOKEN
           value: "TOKEN_VALUE"
           value: "TOKEN_VALUE"

+ 1 - 1
k8s/server/netmaker-server.yaml

@@ -83,7 +83,7 @@ spec:
           value: "Kubernetes"
           value: "Kubernetes"
         - name: VERBOSITY
         - name: VERBOSITY
           value: "3"
           value: "3"
-        image: gravitl/netmaker:v0.17.0
+        image: gravitl/netmaker:v0.17.1
         imagePullPolicy: Always
         imagePullPolicy: Always
         name: netmaker
         name: netmaker
         ports:
         ports:

+ 1 - 1
k8s/server/netmaker-ui.yaml

@@ -15,7 +15,7 @@ spec:
     spec:
     spec:
       containers:
       containers:
       - name: netmaker-ui
       - name: netmaker-ui
-        image: gravitl/netmaker-ui:v0.17.0
+        image: gravitl/netmaker-ui:v0.17.1
         ports:
         ports:
         - containerPort: 443
         - containerPort: 443
         env:
         env:

+ 1 - 1
netclient/netclient.exe.manifest.xml

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

+ 3 - 3
netclient/versioninfo.json

@@ -3,13 +3,13 @@
         "FileVersion": {
         "FileVersion": {
             "Major": 0,
             "Major": 0,
             "Minor": 17,
             "Minor": 17,
-            "Patch": 0,
+            "Patch": 1,
             "Build": 0
             "Build": 0
         },
         },
         "ProductVersion": {
         "ProductVersion": {
             "Major": 0,
             "Major": 0,
             "Minor": 17,
             "Minor": 17,
-            "Patch": 0,
+            "Patch": 1,
             "Build": 0
             "Build": 0
         },
         },
         "FileFlagsMask": "3f",
         "FileFlagsMask": "3f",
@@ -29,7 +29,7 @@
         "OriginalFilename": "",
         "OriginalFilename": "",
         "PrivateBuild": "",
         "PrivateBuild": "",
         "ProductName": "Netclient",
         "ProductName": "Netclient",
-        "ProductVersion": "v0.17.0.0",
+        "ProductVersion": "v0.17.1.0",
         "SpecialBuild": ""
         "SpecialBuild": ""
     },
     },
     "VarFileInfo": {
     "VarFileInfo": {

+ 14 - 9
scripts/nm-quick-interactive.sh

@@ -314,8 +314,7 @@ sed -i "s/REPLACE_MASTER_KEY/$MASTER_KEY/g" /root/docker-compose.yml
 sed -i "s/YOUR_EMAIL/$EMAIL/g" /root/Caddyfile
 sed -i "s/YOUR_EMAIL/$EMAIL/g" /root/Caddyfile
 sed -i "s/REPLACE_MQ_ADMIN_PASSWORD/$MQ_PASSWORD/g" /root/docker-compose.yml 
 sed -i "s/REPLACE_MQ_ADMIN_PASSWORD/$MQ_PASSWORD/g" /root/docker-compose.yml 
 if [ "$INSTALL_TYPE" = "ee" ]; then
 if [ "$INSTALL_TYPE" = "ee" ]; then
-	sed -i "s~YOUR_LICENSE_KEY~$LICENSE_KEY~g" /root/docker-compose.yml 
-	sed -i "s/YOUR_ACCOUNT_ID/$ACCOUNT_ID/g" /root/docker-compose.yml 
+ 
 fi
 fi
 echo "Starting containers..."
 echo "Starting containers..."
 
 
@@ -326,11 +325,11 @@ sleep 2
 test_connection() {
 test_connection() {
 
 
 echo "Testing Caddy setup (please be patient, this may take 1-2 minutes)"
 echo "Testing Caddy setup (please be patient, this may take 1-2 minutes)"
-for i in 1 2 3 4 5 6
+for i in 1 2 3 4 5 6 7 8
 do
 do
 curlresponse=$(curl -vIs https://api.${NETMAKER_BASE_DOMAIN} 2>&1)
 curlresponse=$(curl -vIs https://api.${NETMAKER_BASE_DOMAIN} 2>&1)
 
 
-if [[ "$i" == 6 ]]; then
+if [[ "$i" == 8 ]]; then
   echo "    Caddy is having an issue setting up certificates, please investigate (docker logs caddy)"
   echo "    Caddy is having an issue setting up certificates, please investigate (docker logs caddy)"
   echo "    Exiting..."
   echo "    Exiting..."
   exit 1
   exit 1
@@ -351,7 +350,7 @@ done
 
 
 setup_mesh() {( set -e
 setup_mesh() {( set -e
 
 
-wait_seconds 5
+wait_seconds 15
 
 
 echo "Creating netmaker network (10.101.0.0/16)"
 echo "Creating netmaker network (10.101.0.0/16)"
 
 
@@ -371,23 +370,29 @@ echo "Configuring netmaker server as ingress gateway"
 for i in 1 2 3 4 5 6
 for i in 1 2 3 4 5 6
 do
 do
 	echo "    waiting for server node to become available"
 	echo "    waiting for server node to become available"
-	wait_seconds 5
+	wait_seconds 10
 	curlresponse=$(curl -s -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/netmaker)
 	curlresponse=$(curl -s -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/netmaker)
 	SERVER_ID=$(jq -r '.[0].id' <<< ${curlresponse})
 	SERVER_ID=$(jq -r '.[0].id' <<< ${curlresponse})
-	if [[ "$i" == 6 && -z "$SERVER_ID" ]]; then
+	echo "    Server ID: $SERVER_ID"
+	if [ $SERVER_ID == "null" ]; then
+		SERVER_ID=""
+	fi
+	if [[ "$i" -ge "6" && -z "$SERVER_ID" ]]; then
 		echo "    Netmaker is having issues configuring itself, please investigate (docker logs netmaker)"
 		echo "    Netmaker is having issues configuring itself, please investigate (docker logs netmaker)"
 		echo "    Exiting..."
 		echo "    Exiting..."
 		exit 1
 		exit 1
 	elif [ -z "$SERVER_ID" ]; then
 	elif [ -z "$SERVER_ID" ]; then
 		echo "    server node not yet configured, retrying..."
 		echo "    server node not yet configured, retrying..."
-	else
+	elif [[ ! -z "$SERVER_ID" ]]; then
 		echo "    server node is now availble, continuing"
 		echo "    server node is now availble, continuing"
 		break
 		break
 	fi
 	fi
 done
 done
 
 
-curl -o /dev/null -s -X POST -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/netmaker/$SERVER_ID/createingress
 
 
+if [[ ! -z "$SERVER_ID"  ]]; then
+	curl -o /dev/null -s -X POST -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/netmaker/$SERVER_ID/createingress
+fi 
 )}
 )}
 
 
 set +e
 set +e

+ 4 - 4
scripts/nm-quick.sh

@@ -149,13 +149,13 @@ docker-compose -f /root/docker-compose.yml up -d
 
 
 test_connection() {
 test_connection() {
 
 
-echo "testing Traefik setup (please be patient, this may take 1-2 minutes)"
-for i in 1 2 3 4 5 6
+echo "testing Caddy setup (please be patient, this may take 1-2 minutes)"
+for i in 1 2 3 4 5 6 7 8
 do
 do
 curlresponse=$(curl -vIs https://api.${NETMAKER_BASE_DOMAIN} 2>&1)
 curlresponse=$(curl -vIs https://api.${NETMAKER_BASE_DOMAIN} 2>&1)
 
 
-if [[ "$i" == 6 ]]; then
-  echo "    Traefik is having an issue setting up certificates, please investigate (docker logs traefik)"
+if [[ "$i" == 8 ]]; then
+  echo "    Caddy is having an issue setting up certificates, please investigate (docker logs caddy)"
   echo "    exiting..."
   echo "    exiting..."
   exit 1
   exit 1
 elif [[ "$curlresponse" == *"failed to verify the legitimacy of the server"* ]]; then
 elif [[ "$curlresponse" == *"failed to verify the legitimacy of the server"* ]]; then

+ 1 - 1
swagger.yaml

@@ -746,7 +746,7 @@ info:
 
 
         API calls must be authenticated via a header of the format -H “Authorization: Bearer <YOUR_SECRET_KEY>” 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/<network>/authenticate endpoint, as documented below.
         API calls must be authenticated via a header of the format -H “Authorization: Bearer <YOUR_SECRET_KEY>” 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/<network>/authenticate endpoint, as documented below.
     title: Netmaker
     title: Netmaker
-    version: 0.17.0
+    version: 0.17.1
 paths:
 paths:
     /api/dns:
     /api/dns:
         get:
         get: