Browse Source

updating readme and versions

afeiszli 3 years ago
parent
commit
11a0ecdbb8

+ 10 - 5
README.md

@@ -8,7 +8,7 @@
 
 <p align="center">
   <a href="https://github.com/gravitl/netmaker/releases">
-    <img src="https://img.shields.io/badge/Version-0.9.0-informational?style=flat-square" />
+    <img src="https://img.shields.io/badge/Version-0.9.1-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" />
@@ -29,9 +29,10 @@
 
 # WireGuard® Automation from Homelab to Enterprise
 - [x] Peer-to-Peer Mesh Networks
-- [x] Kubernetes, Multi-Cloud
-- [x] OAuth and Private DNS
-- [x] Linux, Mac, Windows, FreeBSD, iPhone, and Android
+- [x] Kubernetes and Multi-Cloud Enablement
+- [x] Remote Site Access via Gateway
+- [x] OAuth and Private DNS Features
+- [x] Support for Linux, Mac, Windows, FreeBSD, iPhone, and Android
 
 # Get Started in 5 Minutes  
 
@@ -96,7 +97,11 @@ After installing Netmaker, check out the [Walkthrough](https://itnext.io/getting
 
 - [Golang GUI](https://github.com/mattkasun/netmaker-gui)
 
-- [CoreDNS Plugin](https://github.com/SekoiaLab/netmaker-coredns)
+- [CoreDNS Plugin](https://github.com/gravitl/netmaker-coredns-plugin)
+
+- [Multi-Cluster K8S Plugin](https://github.com/gravitl/netmak8s)
+
+- [Terraform Provider](https://github.com/madacluster/netmaker-terraform-provider)
 
 
 ## Disclaimer

+ 1 - 1
compose/docker-compose.caddy.yml

@@ -3,7 +3,7 @@ version: "3.4"
 services:
   netmaker:
     container_name: netmaker
-    image: gravitl/netmaker:v0.9.0
+    image: gravitl/netmaker:v0.9.1
     volumes:
       - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
       - /run/systemd/system:/run/systemd/system

+ 1 - 1
compose/docker-compose.contained.yml

@@ -3,7 +3,7 @@ version: "3.4"
 services:
   netmaker:
     container_name: netmaker
-    image: gravitl/netmaker:v0.9.0
+    image: gravitl/netmaker:v0.9.1
     volumes:
       - dnsconfig:/root/config/dnsconfig
       - /usr/bin/wg:/usr/bin/wg

+ 1 - 1
compose/docker-compose.nodns.yml

@@ -3,7 +3,7 @@ version: "3.4"
 services:
   netmaker:
     container_name: netmaker
-    image: gravitl/netmaker:v0.9.0
+    image: gravitl/netmaker:v0.9.1
     volumes:
       - /usr/bin/wg:/usr/bin/wg
       - sqldata:/root/data

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

@@ -11,7 +11,7 @@ services:
     container_name: netmaker
     depends_on:
       - rqlite
-    image: gravitl/netmaker:v0.9.0
+    image: gravitl/netmaker:v0.9.1
     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.
       - /usr/bin/wg:/usr/bin/wg

+ 1 - 1
docs/conf.py

@@ -22,7 +22,7 @@ copyright = '2021, Alex Feiszli'
 author = 'Alex Feiszli'
 
 # The full version, including alpha/beta/rc tags
-release = '0.9.0'
+release = '0.9.1'
 
 
 # -- General configuration ---------------------------------------------------

+ 5 - 1
netclient/command/commands.go

@@ -95,7 +95,7 @@ func RunUserspaceDaemon() {
 
 func CheckIn(cfg config.ClientConfig) error {
 	var err error
-
+	var errN error
 	if cfg.Network == "" {
 		ncutils.PrintLog("required, '-n', exiting", 0)
 		os.Exit(1)
@@ -123,10 +123,14 @@ func CheckIn(cfg config.ClientConfig) error {
 				daemon.StopWindowsDaemon()
 			}
 		}
+		errN = err
 		err = nil
 	} else {
 		err = functions.CheckConfig(cfg)
 	}
+	if err == nil && errN != nil {
+		err = errN
+	}
 	return err
 }
 

+ 1 - 1
netclient/main.go

@@ -24,7 +24,7 @@ func main() {
 	app := cli.NewApp()
 	app.Name = "Netclient CLI"
 	app.Usage = "Netmaker's netclient agent and CLI. Used to perform interactions with Netmaker server and set local WireGuard config."
-	app.Version = "v0.9.0"
+	app.Version = "v0.9.1"
 
 	hostname, err := os.Hostname()
 	if err != nil {

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

@@ -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.8.5.0"
+            version="0.9.1.0"
             processorArchitecture="*"
             name="netclient.exe"
             type="win32"

+ 1 - 1
netclient/versioninfo.json

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

+ 290 - 0
scripts/install-netmaker.sh

@@ -0,0 +1,290 @@
+#!/bin/bash
+
+set -e
+
+cat << "EOF"
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    ______     ______     ______     __   __   __     ______   __                        
+   /\  ___\   /\  == \   /\  __ \   /\ \ / /  /\ \   /\__  _\ /\ \                       
+   \ \ \__ \  \ \  __<   \ \  __ \  \ \ \'/   \ \ \  \/_/\ \/ \ \ \____                  
+    \ \_____\  \ \_\ \_\  \ \_\ \_\  \ \__|    \ \_\    \ \_\  \ \_____\                 
+     \/_____/   \/_/ /_/   \/_/\/_/   \/_/      \/_/     \/_/   \/_____/                 
+                                                                                         
+ __   __     ______     ______   __    __     ______     __  __     ______     ______    
+/\ "-.\ \   /\  ___\   /\__  _\ /\ "-./  \   /\  __ \   /\ \/ /    /\  ___\   /\  == \   
+\ \ \-.  \  \ \  __\   \/_/\ \/ \ \ \-./\ \  \ \  __ \  \ \  _"-.  \ \  __\   \ \  __<   
+ \ \_\\"\_\  \ \_____\    \ \_\  \ \_\ \ \_\  \ \_\ \_\  \ \_\ \_\  \ \_____\  \ \_\ \_\ 
+  \/_/ \/_/   \/_____/     \/_/   \/_/  \/_/   \/_/\/_/   \/_/\/_/   \/_____/   \/_/ /_/ 
+                                                                                                                                                                                                 
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+EOF
+
+NETMAKER_BASE_DOMAIN=nm.$(curl -s ifconfig.me | tr . -).nip.io
+COREDNS_IP=$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')
+SERVER_PUBLIC_IP=$(curl -s ifconfig.me)
+MASTER_KEY=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 30 ; echo '')
+EMAIL="[email protected]"
+
+echo "Default Base Domain: $NETMAKER_BASE_DOMAIN"
+echo "To Override, add a Wildcard (*.netmaker.example.com) DNS record pointing to $SERVER_PUBLIC_IP"
+echo "Or, add three DNS records pointing to $SERVER_PUBLIC_IP for the following (Replacing 'netmaker.example.com' with the domain of your choice):"
+echo "   dashboard.netmaker.example.com"
+echo "         api.netmaker.example.com"
+echo "        grpc.netmaker.example.com"
+echo "-----------------------------------------------------"
+read -p "Domain (Hit 'enter' to use $NETMAKER_BASE_DOMAIN): " domain
+read -p "Contact Email: " email
+
+if [ -n "$domain" ]; then
+  NETMAKER_BASE_DOMAIN=$domain
+fi
+if [ -n "$email" ]; then
+  EMAIL=$email
+fi
+
+while true; do
+    read -p "Configure a default network automatically? " yn
+    case $yn in
+        [Yy]* ) MESH_SETUP="true"; break;;
+        [Nn]* ) MESH_SETUP="false"; break;;
+        * ) echo "Please answer yes or no.";;
+    esac
+done
+
+while true; do
+    read -p "Configure a VPN gateway automatically? " yn
+    case $yn in
+        [Yy]* ) VPN_SETUP="true"; break;;
+        [Nn]* ) VPN_SETUP="false"; break;;
+        * ) echo "Please answer yes or no.";;
+    esac
+done
+
+if [ "${VPN_SETUP}" == "true" ]; then
+while :; do
+    read -ep '# of VPN clients to configure by default: ' num_clients
+    [[ $num_clients =~ ^[[:digit:]]+$ ]] || continue
+    (( ( (num_clients=(10#$num_clients)) <= 200 ) && num_clients >= 0 )) || continue
+    break
+done
+fi
+
+if [ -n "$num_clients" ]; then
+  NUM_CLIENTS=$num_clients
+fi
+
+while true; do
+    read -p "Override master key ($MASTER_KEY)? " yn
+    case $yn in
+        [Yy]* ) override="true"; break;;
+        [Nn]* ) override="false"; break;;
+        * ) echo "Please answer yes or no.";;
+    esac
+done
+
+if [ "${override}" == "true" ]; then
+while :; do
+    read -ep 'New Master Key: ' key
+    result="$(cracklib-check <<<"$key")"
+    okay="$(awk -F': ' '{ print $2}' <<<"$result")"
+    if [[ "$okay" == "OK" ]]
+    then
+	MASTER_KEY=$key
+	break
+    else
+	echo "Your password was rejected - $result"
+        echo "Try again."
+    fi
+done
+fi
+
+echo "-----------------------------------------------------------------"
+echo "                SETUP ARGUMENTS"
+echo "-----------------------------------------------------------------"
+echo "        domain: $NETMAKER_BASE_DOMAIN"
+echo "         email: $EMAIL"
+echo "    coredns ip: $COREDNS_IP"
+echo "     public ip: $SERVER_PUBLIC_IP"
+echo "    master key: $MASTER_KEY"
+echo "   setup mesh?: $MESH_SETUP"
+echo "    setup vpn?: $VPN_SETUP"
+if [ "${VPN_SETUP}" == "true" ]; then
+echo "     # clients: $NUM_CLIENTS"
+fi
+
+while true; do
+    read -p "Does everything look right? " yn
+    case $yn in
+        [Yy]* ) override="true"; break;;
+        [Nn]* ) echo "exiting..."; exit;;
+        * ) echo "Please answer yes or no.";;
+    esac
+done
+
+
+echo "Beginning installation in 5 seconds..."
+
+sleep 5
+
+
+echo "Setting Caddyfile..."
+
+sed -i "s/NETMAKER_BASE_DOMAIN/$NETMAKER_BASE_DOMAIN/g" /root/Caddyfile
+sed -i "s/YOUR_EMAIL/$EMAIL/g" /root/Caddyfile
+
+echo "Setting docker-compose..."
+
+sed -i "s/NETMAKER_BASE_DOMAIN/$NETMAKER_BASE_DOMAIN/g" /root/docker-compose.yml
+sed -i "s/SERVER_PUBLIC_IP/$SERVER_PUBLIC_IP/g" /root/docker-compose.yml
+sed -i "s/COREDNS_IP/$COREDNS_IP/g" /root/docker-compose.yml
+sed -i "s/REPLACE_MASTER_KEY/$MASTER_KEY/g" /root/docker-compose.yml
+
+echo "Starting containers..."
+
+docker-compose -f /root/docker-compose.yml up -d
+
+sleep 2
+
+setup_mesh() {
+echo "Creating default network (10.101.0.0/16)..."
+
+curl -s -o /dev/null -d '{"addressrange":"10.101.0.0/16","netid":"default"}' -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/networks
+
+sleep 2
+
+echo "Creating default key..."
+
+curlresponse=$(curl -s -d '{"uses":99999,"name":"defaultkey"}' -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/networks/default/keys)
+ACCESS_TOKEN=$(jq -r '.accessstring' <<< ${curlresponse})
+
+sleep 2
+
+echo "Configuring Netmaker server as ingress gateway..."
+
+curlresponse=$(curl -s -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/nodes/default)
+SERVER_ID=$(jq -r '.[0].macaddress' <<< ${curlresponse})
+
+curl -o /dev/null -s -X POST -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/nodes/default/$SERVER_ID/createingress
+
+VPN_ACCESS_TOKEN=$ACCESS_TOKEN
+
+}
+
+mesh_connect_logs() {
+sleep 5
+echo "-----------------------------------------------------------------"
+echo "-----------------------------------------------------------------"
+echo "DEFAULT NETWORK CLIENT INSTALL INSTRUCTIONS:"
+echo "-----------------------------------------------------------------"
+echo "-----------------------------------------------------------------"
+sleep 5
+echo "For Linux and Mac clients, install with the following command:"
+echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
+echo "curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/develop/scripts/netclient-install.sh | sudo KEY=$VPN_ACCESS_TOKEN sh -"
+sleep 5
+echo "-----------------------------------------------------------------"
+echo "-----------------------------------------------------------------"
+echo "For Windows clients, perform the following from powershell, as administrator:"
+echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
+echo "1. Make sure WireGuardNT is installed - https://download.wireguard.com/windows-client/wireguard-installer.exe"
+echo "2. Download netclient.exe - wget https://github.com/gravitl/netmaker/releases/download/latest/netclient.exe"
+echo "3. Install Netclient - powershell.exe .\\netclient.exe join -t $VPN_ACCESS_TOKEN"
+echo "4. Whitelist C:\ProgramData\Netclient in Windows Defender"
+sleep 5
+echo "-----------------------------------------------------------------"
+echo "-----------------------------------------------------------------"
+echo "For Android and iOS clients, perform the following steps:"
+echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
+echo "1. Log into UI at dashboard.$NETMAKER_BASE_DOMAIN"
+echo "2. Navigate to \"EXTERNAL CLIENTS\" tab"
+echo "3. Select the gateway and create clients"
+echo "4. Scan the QR Code from WireGuard app in iOS or Android"
+echo "-----------------------------------------------------------------"
+echo "-----------------------------------------------------------------"
+sleep 5
+}
+
+setup_vpn() {
+echo "Creating vpn network (10.201.0.0/16)..."
+
+curl -s -o /dev/null -d '{"addressrange":"10.201.0.0/16","netid":"vpn","defaultextclientdns":"8.8.8.8"}' -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/networks
+
+sleep 2
+
+echo "Configuring Netmaker server as vpn inlet..."
+
+curlresponse=$(curl -s -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/nodes/vpn)
+SERVER_ID=$(jq -r '.[0].macaddress' <<< ${curlresponse})
+
+curl -s -o /dev/null -X POST -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/nodes/vpn/$SERVER_ID/createingress
+
+echo "Waiting 10 seconds for server to apply configuration..."
+
+sleep 10
+
+echo "Configuring Netmaker server VPN gateway..."
+
+[ -z "$GATEWAY_IFACE" ] && GATEWAY_IFACE=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | grep -v default)
+
+curlresponse=$(curl -s -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/nodes/vpn)
+SERVER_ID=$(jq -r '.[0].macaddress' <<< ${curlresponse})
+
+EGRESS_JSON=$( jq -n \
+                  --arg gw "$GATEWAY_IFACE" \
+                  '{ranges: ["0.0.0.0/0"], interface: $gw}' )
+
+curl -s -o /dev/null -X POST -d "$EGRESS_JSON" -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/nodes/vpn/$SERVER_ID/creategateway
+
+echo "Creating client configs..."
+
+for ((a=1; a <= $NUM_CLIENTS; a++))
+do
+        CLIENT_JSON=$( jq -n \
+                  --arg clientid "vpnclient-$a" \
+                  '{clientid: $clientid}' )
+
+        curl -s -o /dev/null -d "$CLIENT_JSON" -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' localhost:8081/api/extclients/vpn/$SERVER_ID
+done
+
+}
+
+vpn_connect_logs() {
+sleep 5
+echo "-----------------------------------------------------------------"
+echo "-----------------------------------------------------------------"
+echo "VPN GATEWAY CLIENT INSTALL INSTRUCTIONS:"
+echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
+echo "1. log into dashboard.$NETMAKER_BASE_DOMAIN"
+echo "2. Navigate to \"EXTERNAL CLIENTS\" tab"
+echo "3. Download or scan a client config (vpnclient-x) to the appropriate device"
+echo "4. Follow the steps for your system to configure WireGuard on the appropriate device"
+echo "5. Create and delete clients as necessary. Changes to netmaker server settings require regenerating ext clients."
+echo "-----------------------------------------------------------------"
+echo "-----------------------------------------------------------------"
+sleep 5
+}
+
+if [ "${MESH_SETUP}" != "false" ]; then
+        setup_mesh
+fi
+
+if [ "${VPN_SETUP}" == "true" ]; then
+        setup_vpn
+fi
+
+if [ "${MESH_SETUP}" != "false" ]; then
+        mesh_connect_logs
+fi
+
+if [ "${VPN_SETUP}" == "true" ]; then
+        vpn_connect_logs
+fi
+
+echo "Netmaker setup is now complete. You are ready to begin using Netmaker."
+echo "Visit dashboard.$NETMAKER_BASE_DOMAIN to log in"
+
+cp -f /etc/skel/.bashrc /root/.bashrc

+ 1 - 1
servercfg/serverconf.go

@@ -109,7 +109,7 @@ func GetAPIConnString() string {
 
 // GetVersion - version of netmaker
 func GetVersion() string {
-	version := "0.9.0"
+	version := "0.9.1"
 	if config.Config.Server.Version != "" {
 		version = config.Config.Server.Version
 	}