mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-21 16:09:59 +08:00
Rebase to develop (#4)
* add nameserver in call to CreateUserSpaceConf * fixed user deletion * changed log * go mod tidy and conver azure tenant to env/conf var * added egress relayed addrs to relayed nodes * added post commands for wg quick * refactored ncutils x-platform * log fix * adding egress to relay * fixing egress on relay Co-authored-by: dcarns <75687250+0xdcarns@users.noreply.github.com> Co-authored-by: 0xdcarns <dillon.carns@gmail.com> Co-authored-by: afeiszli <alex.feiszli@gmail.com>
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -16,5 +16,3 @@ netclient/netclient.exe
|
|||||||
config/dnsconfig/
|
config/dnsconfig/
|
||||||
data/
|
data/
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
|
||||||
.vscode/
|
|
||||||
|
@@ -43,14 +43,12 @@ type ServerConfig struct {
|
|||||||
GRPCHost string `yaml:"grpchost"`
|
GRPCHost string `yaml:"grpchost"`
|
||||||
GRPCPort string `yaml:"grpcport"`
|
GRPCPort string `yaml:"grpcport"`
|
||||||
GRPCSecure string `yaml:"grpcsecure"`
|
GRPCSecure string `yaml:"grpcsecure"`
|
||||||
MQHOST string `yaml:"mqhost"`
|
|
||||||
MasterKey string `yaml:"masterkey"`
|
MasterKey string `yaml:"masterkey"`
|
||||||
DNSKey string `yaml:"dnskey"`
|
DNSKey string `yaml:"dnskey"`
|
||||||
AllowedOrigin string `yaml:"allowedorigin"`
|
AllowedOrigin string `yaml:"allowedorigin"`
|
||||||
NodeID string `yaml:"nodeid"`
|
NodeID string `yaml:"nodeid"`
|
||||||
RestBackend string `yaml:"restbackend"`
|
RestBackend string `yaml:"restbackend"`
|
||||||
AgentBackend string `yaml:"agentbackend"`
|
AgentBackend string `yaml:"agentbackend"`
|
||||||
MessageQueueBackend string `yaml:"messagequeuebackend"`
|
|
||||||
ClientMode string `yaml:"clientmode"`
|
ClientMode string `yaml:"clientmode"`
|
||||||
DNSMode string `yaml:"dnsmode"`
|
DNSMode string `yaml:"dnsmode"`
|
||||||
SplitDNS string `yaml:"splitdns"`
|
SplitDNS string `yaml:"splitdns"`
|
||||||
@@ -71,7 +69,6 @@ type ServerConfig struct {
|
|||||||
FrontendURL string `yaml:"frontendurl"`
|
FrontendURL string `yaml:"frontendurl"`
|
||||||
DisplayKeys string `yaml:"displaykeys"`
|
DisplayKeys string `yaml:"displaykeys"`
|
||||||
AzureTenant string `yaml:"azuretenant"`
|
AzureTenant string `yaml:"azuretenant"`
|
||||||
RCE string `yaml:"rce"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SQLConfig - Generic SQL Config
|
// SQLConfig - Generic SQL Config
|
||||||
|
@@ -215,8 +215,3 @@ func Daemon() error {
|
|||||||
err := functions.Daemon()
|
err := functions.Daemon()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func Daemon() error {
|
|
||||||
err := functions.Daemon()
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
@@ -34,7 +34,7 @@ func GetEmbedded() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CreateWireGuardConf - creates a user space WireGuard conf
|
// CreateWireGuardConf - creates a user space WireGuard conf
|
||||||
func CreateWireGuardConf(node *models.Node, privatekey string, listenPort string, peers []wgtypes.PeerConfig) (string, error) {
|
func CreateWireGuardConf(node *models.Node, privatekey string, listenPort string, dns string, peers []wgtypes.PeerConfig) (string, error) {
|
||||||
peersString, err := parsePeers(node.PersistentKeepalive, peers)
|
peersString, err := parsePeers(node.PersistentKeepalive, peers)
|
||||||
var listenPortString, postDownString, postUpString string
|
var listenPortString, postDownString, postUpString string
|
||||||
if node.MTU <= 0 {
|
if node.MTU <= 0 {
|
||||||
@@ -56,6 +56,7 @@ func CreateWireGuardConf(node *models.Node, privatekey string, listenPort string
|
|||||||
}
|
}
|
||||||
config := fmt.Sprintf(`[Interface]
|
config := fmt.Sprintf(`[Interface]
|
||||||
Address = %s
|
Address = %s
|
||||||
|
DNS = %s
|
||||||
PrivateKey = %s
|
PrivateKey = %s
|
||||||
MTU = %s
|
MTU = %s
|
||||||
%s
|
%s
|
||||||
@@ -66,6 +67,7 @@ MTU = %s
|
|||||||
|
|
||||||
`,
|
`,
|
||||||
node.Address+"/32",
|
node.Address+"/32",
|
||||||
|
dns,
|
||||||
privatekey,
|
privatekey,
|
||||||
strconv.Itoa(int(node.MTU)),
|
strconv.Itoa(int(node.MTU)),
|
||||||
postDownString,
|
postDownString,
|
||||||
|
Reference in New Issue
Block a user