mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-18 14:54:23 +08:00
added ipv6 responses
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
nodepb "github.com/gravitl/netmaker/grpc"
|
nodepb "github.com/gravitl/netmaker/grpc"
|
||||||
"github.com/gravitl/netmaker/models"
|
"github.com/gravitl/netmaker/models"
|
||||||
"github.com/gravitl/netmaker/functions"
|
"github.com/gravitl/netmaker/functions"
|
||||||
|
"github.com/gravitl/netmaker/servercfg"
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
@@ -40,6 +41,7 @@ func (s *NodeServiceServer) ReadNode(ctx context.Context, req *nodepb.ReadNodeRe
|
|||||||
Macaddress: node.MacAddress,
|
Macaddress: node.MacAddress,
|
||||||
Name: node.Name,
|
Name: node.Name,
|
||||||
Address: node.Address,
|
Address: node.Address,
|
||||||
|
Address6: node.Address6,
|
||||||
Endpoint: node.Endpoint,
|
Endpoint: node.Endpoint,
|
||||||
Password: node.Password,
|
Password: node.Password,
|
||||||
Nodenetwork: node.Network,
|
Nodenetwork: node.Network,
|
||||||
@@ -48,6 +50,7 @@ func (s *NodeServiceServer) ReadNode(ctx context.Context, req *nodepb.ReadNodeRe
|
|||||||
Postdown: node.PostDown,
|
Postdown: node.PostDown,
|
||||||
Postup: node.PostUp,
|
Postup: node.PostUp,
|
||||||
Checkininterval: node.CheckInInterval,
|
Checkininterval: node.CheckInInterval,
|
||||||
|
Dnsoff: servercfg.IsDNSMode(),
|
||||||
Ispending: node.IsPending,
|
Ispending: node.IsPending,
|
||||||
Publickey: node.PublicKey,
|
Publickey: node.PublicKey,
|
||||||
Listenport: node.ListenPort,
|
Listenport: node.ListenPort,
|
||||||
@@ -71,6 +74,7 @@ func (s *NodeServiceServer) CreateNode(ctx context.Context, req *nodepb.CreateNo
|
|||||||
LocalAddress: data.GetLocaladdress(),
|
LocalAddress: data.GetLocaladdress(),
|
||||||
Name: data.GetName(),
|
Name: data.GetName(),
|
||||||
Address: data.GetAddress(),
|
Address: data.GetAddress(),
|
||||||
|
Address6: data.GetAddress6(),
|
||||||
AccessKey: data.GetAccesskey(),
|
AccessKey: data.GetAccesskey(),
|
||||||
Endpoint: data.GetEndpoint(),
|
Endpoint: data.GetEndpoint(),
|
||||||
PersistentKeepalive: data.GetKeepalive(),
|
PersistentKeepalive: data.GetKeepalive(),
|
||||||
@@ -132,10 +136,12 @@ func (s *NodeServiceServer) CreateNode(ctx context.Context, req *nodepb.CreateNo
|
|||||||
Localaddress: node.LocalAddress,
|
Localaddress: node.LocalAddress,
|
||||||
Name: node.Name,
|
Name: node.Name,
|
||||||
Address: node.Address,
|
Address: node.Address,
|
||||||
|
Address6: node.Address6,
|
||||||
Endpoint: node.Endpoint,
|
Endpoint: node.Endpoint,
|
||||||
Password: node.Password,
|
Password: node.Password,
|
||||||
Interface: node.Interface,
|
Interface: node.Interface,
|
||||||
Nodenetwork: node.Network,
|
Nodenetwork: node.Network,
|
||||||
|
Dnsoff: servercfg.IsDNSMode(),
|
||||||
Ispending: node.IsPending,
|
Ispending: node.IsPending,
|
||||||
Publickey: node.PublicKey,
|
Publickey: node.PublicKey,
|
||||||
Listenport: node.ListenPort,
|
Listenport: node.ListenPort,
|
||||||
@@ -162,6 +168,7 @@ func (s *NodeServiceServer) CheckIn(ctx context.Context, req *nodepb.CheckInReq)
|
|||||||
// ID: primitive.NilObjectID,
|
// ID: primitive.NilObjectID,
|
||||||
MacAddress: data.GetMacaddress(),
|
MacAddress: data.GetMacaddress(),
|
||||||
Address: data.GetAddress(),
|
Address: data.GetAddress(),
|
||||||
|
Address6: data.GetAddress6(),
|
||||||
Endpoint: data.GetEndpoint(),
|
Endpoint: data.GetEndpoint(),
|
||||||
Network: data.GetNodenetwork(),
|
Network: data.GetNodenetwork(),
|
||||||
Password: data.GetPassword(),
|
Password: data.GetPassword(),
|
||||||
@@ -207,6 +214,7 @@ func (s *NodeServiceServer) UpdateNode(ctx context.Context, req *nodepb.UpdateNo
|
|||||||
MacAddress: data.GetMacaddress(),
|
MacAddress: data.GetMacaddress(),
|
||||||
Name: data.GetName(),
|
Name: data.GetName(),
|
||||||
Address: data.GetAddress(),
|
Address: data.GetAddress(),
|
||||||
|
Address6: data.GetAddress6(),
|
||||||
LocalAddress: data.GetLocaladdress(),
|
LocalAddress: data.GetLocaladdress(),
|
||||||
Endpoint: data.GetEndpoint(),
|
Endpoint: data.GetEndpoint(),
|
||||||
Password: data.GetPassword(),
|
Password: data.GetPassword(),
|
||||||
@@ -255,6 +263,7 @@ func (s *NodeServiceServer) UpdateNode(ctx context.Context, req *nodepb.UpdateNo
|
|||||||
Localaddress: newnode.LocalAddress,
|
Localaddress: newnode.LocalAddress,
|
||||||
Name: newnode.Name,
|
Name: newnode.Name,
|
||||||
Address: newnode.Address,
|
Address: newnode.Address,
|
||||||
|
Address6: newnode.Address6,
|
||||||
Endpoint: newnode.Endpoint,
|
Endpoint: newnode.Endpoint,
|
||||||
Password: newnode.Password,
|
Password: newnode.Password,
|
||||||
Interface: newnode.Interface,
|
Interface: newnode.Interface,
|
||||||
@@ -263,6 +272,7 @@ func (s *NodeServiceServer) UpdateNode(ctx context.Context, req *nodepb.UpdateNo
|
|||||||
Nodenetwork: newnode.Network,
|
Nodenetwork: newnode.Network,
|
||||||
Ispending: newnode.IsPending,
|
Ispending: newnode.IsPending,
|
||||||
Publickey: newnode.PublicKey,
|
Publickey: newnode.PublicKey,
|
||||||
|
Dnsoff: servercfg.IsDNSMode(),
|
||||||
Listenport: newnode.ListenPort,
|
Listenport: newnode.ListenPort,
|
||||||
Keepalive: newnode.PersistentKeepalive,
|
Keepalive: newnode.PersistentKeepalive,
|
||||||
Islocal: *network.IsLocal,
|
Islocal: *network.IsLocal,
|
||||||
@@ -316,6 +326,7 @@ func (s *NodeServiceServer) GetPeers(req *nodepb.GetPeersReq, stream nodepb.Node
|
|||||||
stream.Send(&nodepb.GetPeersRes{
|
stream.Send(&nodepb.GetPeersRes{
|
||||||
Peers: &nodepb.PeersResponse{
|
Peers: &nodepb.PeersResponse{
|
||||||
Address: peers[i].Address,
|
Address: peers[i].Address,
|
||||||
|
Address6: peers[i].Address6,
|
||||||
Endpoint: peers[i].Endpoint,
|
Endpoint: peers[i].Endpoint,
|
||||||
Gatewayrange: peers[i].GatewayRange,
|
Gatewayrange: peers[i].GatewayRange,
|
||||||
Isgateway: peers[i].IsGateway,
|
Isgateway: peers[i].IsGateway,
|
||||||
|
66
docker-compose.nodns.yml
Normal file
66
docker-compose.nodns.yml
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
version: "3.4"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
dnsconfig:
|
||||||
|
driver: local
|
||||||
|
services:
|
||||||
|
mongodb:
|
||||||
|
image: mongo:4.2
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
|
container_name: mongodb
|
||||||
|
volumes:
|
||||||
|
- mongovol:/data/db
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
MONGO_INITDB_ROOT_USERNAME: mongoadmin
|
||||||
|
MONGO_INITDB_ROOT_PASSWORD: mongopass
|
||||||
|
netmaker:
|
||||||
|
privileged: true
|
||||||
|
container_name: netmaker
|
||||||
|
build: netmaker
|
||||||
|
depends_on:
|
||||||
|
- mongodb
|
||||||
|
image: gravitl/netmaker:v0.3
|
||||||
|
ports:
|
||||||
|
- "8081:8081"
|
||||||
|
- "50051:50051"
|
||||||
|
volumes:
|
||||||
|
- ./:/local
|
||||||
|
- /etc/netclient:/etc/netclient
|
||||||
|
- dnsconfig:/root/config/dnsconfig
|
||||||
|
- /usr/bin/wg:/usr/bin/wg:ro
|
||||||
|
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
|
||||||
|
- /run/systemd/system:/run/systemd/system
|
||||||
|
- /etc/systemd/system:/etc/systemd/system
|
||||||
|
- /sys/fs/cgroup:/sys/fs/cgroup
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- SYS_MODULE
|
||||||
|
restart: always
|
||||||
|
network_mode: host
|
||||||
|
netmaker-ui:
|
||||||
|
container_name: netmaker-ui
|
||||||
|
depends_on:
|
||||||
|
- netmaker
|
||||||
|
image: gravitl/netmaker-ui:v0.3
|
||||||
|
links:
|
||||||
|
- "netmaker:api"
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
environment:
|
||||||
|
BACKEND_URL: "http://3.236.149.180:8081"
|
||||||
|
coredns:
|
||||||
|
depends_on:
|
||||||
|
- netmaker
|
||||||
|
image: coredns/coredns
|
||||||
|
command: -conf /root/dnsconfig/Corefile
|
||||||
|
container_name: coredns
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "53:53/udp"
|
||||||
|
volumes:
|
||||||
|
- dnsconfig:/root/dnsconfig
|
||||||
|
volumes:
|
||||||
|
mongovol: {}
|
||||||
|
dnsconfig: {}
|
@@ -34,8 +34,6 @@ services:
|
|||||||
- /run/systemd/system:/run/systemd/system
|
- /run/systemd/system:/run/systemd/system
|
||||||
- /etc/systemd/system:/etc/systemd/system
|
- /etc/systemd/system:/etc/systemd/system
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup
|
- /sys/fs/cgroup:/sys/fs/cgroup
|
||||||
environment:
|
|
||||||
MONGO_HOST: "127.0.0.1"
|
|
||||||
cap_add:
|
cap_add:
|
||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
- SYS_MODULE
|
- SYS_MODULE
|
||||||
|
1
go.mod
1
go.mod
@@ -22,6 +22,7 @@ require (
|
|||||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200609130330-bd2cb7843e1b
|
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200609130330-bd2cb7843e1b
|
||||||
google.golang.org/genproto v0.0.0-20210201151548-94839c025ad4 // indirect
|
google.golang.org/genproto v0.0.0-20210201151548-94839c025ad4 // indirect
|
||||||
google.golang.org/grpc v1.35.0
|
google.golang.org/grpc v1.35.0
|
||||||
|
google.golang.org/protobuf v1.25.0 // indirect
|
||||||
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
||||||
gopkg.in/go-playground/validator.v9 v9.31.0
|
gopkg.in/go-playground/validator.v9 v9.31.0
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
|
||||||
|
1903
grpc/node.pb.go
1903
grpc/node.pb.go
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,7 @@ message Node {
|
|||||||
string id = 1;
|
string id = 1;
|
||||||
string name = 2;
|
string name = 2;
|
||||||
string address = 3;
|
string address = 3;
|
||||||
|
string address6 = 26;
|
||||||
int32 listenport = 4;
|
int32 listenport = 4;
|
||||||
string publickey = 5;
|
string publickey = 5;
|
||||||
string endpoint = 6;
|
string endpoint = 6;
|
||||||
@@ -44,6 +45,7 @@ message Node {
|
|||||||
string postchanges = 21;
|
string postchanges = 21;
|
||||||
string allowedips = 22;
|
string allowedips = 22;
|
||||||
bool islocal = 23;
|
bool islocal = 23;
|
||||||
|
bool isdualstack = 27;
|
||||||
bool dnsoff = 24;
|
bool dnsoff = 24;
|
||||||
string localrange = 25;
|
string localrange = 25;
|
||||||
}
|
}
|
||||||
@@ -64,6 +66,7 @@ message PeersResponse {
|
|||||||
string publickey = 5;
|
string publickey = 5;
|
||||||
string endpoint = 6;
|
string endpoint = 6;
|
||||||
string address = 3;
|
string address = 3;
|
||||||
|
string address6 = 8;
|
||||||
int32 listenport = 4;
|
int32 listenport = 4;
|
||||||
string localaddress = 7;
|
string localaddress = 7;
|
||||||
int32 keepalive = 13;
|
int32 keepalive = 13;
|
||||||
|
@@ -94,6 +94,7 @@ type PeersResponse struct {
|
|||||||
PublicKey string `json:"publickey" bson:"publickey"`
|
PublicKey string `json:"publickey" bson:"publickey"`
|
||||||
Endpoint string `json:"endpoint" bson:"endpoint"`
|
Endpoint string `json:"endpoint" bson:"endpoint"`
|
||||||
Address string `json:"address" bson:"address"`
|
Address string `json:"address" bson:"address"`
|
||||||
|
Address6 string `json:"address6" bson:"address6"`
|
||||||
LocalAddress string `json:"localaddress" bson:"localaddress"`
|
LocalAddress string `json:"localaddress" bson:"localaddress"`
|
||||||
IsGateway bool `json:"isgateway" bson:"isgateway"`
|
IsGateway bool `json:"isgateway" bson:"isgateway"`
|
||||||
GatewayRange string `json:"gatewayrange" bson:"gatewayrange"`
|
GatewayRange string `json:"gatewayrange" bson:"gatewayrange"`
|
||||||
|
Reference in New Issue
Block a user