Skip to content

Commit 0f608cb

Browse files
authored
Merge pull request #363 from gravitl/develop
Develop
2 parents c24a872 + 394ec05 commit 0f608cb

File tree

104 files changed

+3495
-764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+3495
-764
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Basic dependabot.yml file with minimum configuration for gomod.
2+
3+
version: 2
4+
updates:
5+
# Enable version updates for go
6+
- package-ecosystem: "gomod"
7+
directory: "/"
8+
# Check for updates every day (weekdays)
9+
schedule:
10+
interval: "daily"

.github/workflows/publish-docker.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131
uses: docker/setup-qemu-action@v1
3232
- name: Set up Docker Buildx
3333
uses: docker/setup-buildx-action@v1
34-
- name: Login to DockerHub
34+
- if: github.event_name != 'pull_request'
35+
name: Login to DockerHub
3536
uses: docker/login-action@v1
3637
with:
3738
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -41,5 +42,5 @@ jobs:
4142
with:
4243
context: .
4344
platforms: linux/amd64, linux/arm64
44-
push: true
45+
push: ${{ github.event_name != 'pull_request' }}
4546
tags: gravitl/netmaker:${{ env.TAG }}

.github/workflows/test.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@ on:
66
jobs:
77
tests:
88
env:
9-
DATABASE: rqlite
10-
runs-on: ubuntu-latest
11-
services:
12-
rqlite:
13-
image: rqlite/rqlite
14-
ports:
15-
- 4001:4001
16-
- 4002:4002
9+
DATABASE: sqlite
10+
runs-on: ubuntu-20.04
1711
steps:
1812
- name: Checkout
1913
uses: actions/checkout@v2
2014
- name: run tests
2115
run: |
2216
go test -p 1 ./... -v
2317
env:
24-
DATABASE: rqlite
25-
CLIENT_MODE: "off"
18+
DATABASE: sqlite
19+
CLIENT_MODE: "off"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
<p align="center">
1010
<a href="https://github.com/gravitl/netmaker/releases">
11-
<img src="https://img.shields.io/docker/v/gravitl/netmaker?color=blue" />
11+
<img src="https://img.shields.io/badge/Version-0.8.4-informational?style=flat-square" />
1212
</a>
1313
<a href="https://discord.gg/zRb9Vfhk8A">
14-
<img src="https://img.shields.io/badge/community-discord-purple" />
14+
<img src="https://img.shields.io/badge/community-discord-informational" />
1515
</a>
1616
<a href="https://github.com/gravitl/netmaker/graphs/contributors">
17-
<img src="https://img.shields.io/github/commit-activity/w/gravitl/netmaker?color=brightgreen" />
17+
<img src="https://img.shields.io/github/commit-activity/w/gravitl/netmaker?color=blue" />
1818
</a>
1919
<a href="https://gravitl.com/resources">
2020
<img src="https://img.shields.io/badge/learning-resources-9cf" />
@@ -27,7 +27,6 @@
2727
</a>
2828
</p>
2929

30-
3130
# WireGuard® Automation from Homelab to Enterprise
3231
- [x] Peer-to-Peer Mesh Networks
3332
- [x] Site-to-Site Gateways
@@ -37,7 +36,8 @@
3736

3837
# Get Started in 5 Minutes
3938

40-
**For production-grade installations, visit the [Install Docs](https://netmaker.readthedocs.io/en/develop/install.html).**
39+
**For production-grade installations, visit the [Install Docs](https://netmaker.readthedocs.io/en/develop/install.html).**
40+
**For an HA install using helm on k8s, visit the [Helm Repo](https://github.com/gravitl/netmaker-helm/).**
4141
1. Get a cloud VM with Ubuntu 20.04 and a public IP.
4242
2. Open ports 443, 53, and 51821-51830/udp on the VM firewall and in cloud security settings.
4343
3. Run the script:

compose/docker-compose.caddy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: "3.4"
33
services:
44
netmaker:
55
container_name: netmaker
6-
image: gravitl/netmaker:v0.8.3
6+
image: gravitl/netmaker:v0.8.4
77
volumes:
88
- /etc/netclient/config:/etc/netclient/config
99
- dnsconfig:/root/config/dnsconfig

compose/docker-compose.nodns.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
version: "3.4"
2+
3+
services:
4+
netmaker:
5+
container_name: netmaker
6+
image: gravitl/netmaker:v0.8.4
7+
volumes:
8+
- /etc/netclient/config:/etc/netclient/config
9+
- /usr/bin/wg:/usr/bin/wg
10+
- sqldata:/root/data
11+
cap_add:
12+
- NET_ADMIN
13+
restart: always
14+
network_mode: host
15+
environment:
16+
SERVER_HOST: "SERVER_PUBLIC_IP"
17+
SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
18+
SERVER_GRPC_CONN_STRING: "grpc.NETMAKER_BASE_DOMAIN:443"
19+
COREDNS_ADDR: "SERVER_PUBLIC_IP"
20+
GRPC_SSL: "on"
21+
DNS_MODE: "off"
22+
SERVER_HTTP_HOST: "api.NETMAKER_BASE_DOMAIN"
23+
SERVER_GRPC_HOST: "grpc.NETMAKER_BASE_DOMAIN"
24+
API_PORT: "8081"
25+
GRPC_PORT: "50051"
26+
CLIENT_MODE: "on"
27+
MASTER_KEY: "REPLACE_MASTER_KEY"
28+
SERVER_GRPC_WIREGUARD: "off"
29+
CORS_ALLOWED_ORIGIN: "*"
30+
DATABASE: "sqlite"
31+
netmaker-ui:
32+
container_name: netmaker-ui
33+
depends_on:
34+
- netmaker
35+
image: gravitl/netmaker-ui:v0.8
36+
links:
37+
- "netmaker:api"
38+
ports:
39+
- "8082:80"
40+
environment:
41+
BACKEND_URL: "https://api.NETMAKER_BASE_DOMAIN"
42+
restart: always
43+
caddy:
44+
image: caddy:latest
45+
container_name: caddy
46+
restart: unless-stopped
47+
network_mode: host # Wants ports 80 and 443!
48+
volumes:
49+
- /root/Caddyfile:/etc/caddy/Caddyfile
50+
# - $PWD/site:/srv # you could also serve a static site in site folder
51+
- caddy_data:/data
52+
- caddy_conf:/config
53+
volumes:
54+
caddy_data: {}
55+
caddy_conf: {}
56+
sqldata: {}

compose/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: "3.4"
33
services:
44
netmaker:
55
container_name: netmaker
6-
image: gravitl/netmaker:v0.8.3
6+
image: gravitl/netmaker:v0.8.4
77
volumes:
88
- /etc/netclient/config:/etc/netclient/config
99
- dnsconfig:/root/config/dnsconfig

config/config.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var Config *EnvironmentConfig
3030
// EnvironmentConfig :
3131
type EnvironmentConfig struct {
3232
Server ServerConfig `yaml:"server"`
33+
SQL SQLConfig `yaml:"sql"`
3334
}
3435

3536
// ServerConfig :
@@ -44,21 +45,34 @@ type ServerConfig struct {
4445
GRPCSecure string `yaml:"grpcsecure"`
4546
MasterKey string `yaml:"masterkey"`
4647
AllowedOrigin string `yaml:"allowedorigin"`
48+
NodeID string `yaml:"nodeid"`
4749
RestBackend string `yaml:"restbackend"`
4850
AgentBackend string `yaml:"agentbackend"`
4951
ClientMode string `yaml:"clientmode"`
5052
DNSMode string `yaml:"dnsmode"`
51-
SplitDNS string `yaml:"splitdns"`
53+
SplitDNS string `yaml:"splitdns"`
5254
DisableRemoteIPCheck string `yaml:"disableremoteipcheck"`
5355
DisableDefaultNet string `yaml:"disabledefaultnet"`
5456
GRPCSSL string `yaml:"grpcssl"`
5557
Version string `yaml:"version"`
5658
SQLConn string `yaml:"sqlconn"`
57-
Platform string `yaml:"platform"`
59+
Platform string `yaml:"platform"`
5860
Database string `yaml:database`
5961
CheckinInterval string `yaml:checkininterval`
6062
DefaultNodeLimit int32 `yaml:"defaultnodelimit"`
6163
Verbosity int32 `yaml:"verbosity"`
64+
ServerCheckinInterval int64 `yaml:"servercheckininterval"`
65+
}
66+
67+
68+
// Generic SQL Config
69+
type SQLConfig struct {
70+
Host string `yaml:"host"`
71+
Port int32 `yaml:"port"`
72+
Username string `yaml:"username"`
73+
Password string `yaml:"password"`
74+
DB string `yaml:"db"`
75+
SSLMode string `yaml:"sslmode"`
6276
}
6377

6478
//reading in the env file

controllers/authGrpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (s *NodeServiceServer) Login(ctx context.Context, req *nodepb.Object) (*nod
124124
err = errors.New("Missing Password.")
125125
return nil, err
126126
} else {
127-
//Search DB for node with Mac Address. Ignore pending nodes (they should not be able to authenticate with API untill approved).
127+
//Search DB for node with Mac Address. Ignore pending nodes (they should not be able to authenticate with API until approved).
128128
collection, err := database.FetchRecords(database.NODES_TABLE_NAME)
129129
if err != nil {
130130
return nil, err

controllers/common_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func TestSetNetworkNodesLastModified(t *testing.T) {
124124
}
125125

126126
func createTestNode() models.Node {
127-
createnode := models.Node{PublicKey: "DM5qhLAE20PG9BbfBCger+Ac9D2NDOwCtY1rbYDLf34=", Endpoint: "10.0.0.1", MacAddress: "01:02:03:04:05:06", Password: "password", Network: "skynet"}
127+
createnode := models.Node{PublicKey: "DM5qhLAE20PG9BbfBCger+Ac9D2NDOwCtY1rbYDLf34=", Name: "testnode", Endpoint: "10.0.0.1", MacAddress: "01:02:03:04:05:06", Password: "password", Network: "skynet"}
128128
node, _ := logic.CreateNode(createnode, "skynet")
129129
return node
130130
}

0 commit comments

Comments
 (0)