Browse Source

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 <[email protected]>
Co-authored-by: 0xdcarns <[email protected]>
Co-authored-by: afeiszli <[email protected]>
Matthew R Kasun 3 years ago
parent
commit
b85ab18404
4 changed files with 3 additions and 11 deletions
  1. 0 2
      .gitignore
  2. 0 3
      config/config.go
  3. 0 5
      netclient/command/commands.go
  4. 3 1
      netclient/ncutils/netclientutils_linux.go

+ 0 - 2
.gitignore

@@ -16,5 +16,3 @@ netclient/netclient.exe
 config/dnsconfig/
 data/
 .vscode/
-.idea/
-.vscode/

+ 0 - 3
config/config.go

@@ -43,14 +43,12 @@ type ServerConfig struct {
 	GRPCHost              string `yaml:"grpchost"`
 	GRPCPort              string `yaml:"grpcport"`
 	GRPCSecure            string `yaml:"grpcsecure"`
-	MQHOST                string `yaml:"mqhost"`
 	MasterKey             string `yaml:"masterkey"`
 	DNSKey                string `yaml:"dnskey"`
 	AllowedOrigin         string `yaml:"allowedorigin"`
 	NodeID                string `yaml:"nodeid"`
 	RestBackend           string `yaml:"restbackend"`
 	AgentBackend          string `yaml:"agentbackend"`
-	MessageQueueBackend   string `yaml:"messagequeuebackend"`
 	ClientMode            string `yaml:"clientmode"`
 	DNSMode               string `yaml:"dnsmode"`
 	SplitDNS              string `yaml:"splitdns"`
@@ -71,7 +69,6 @@ type ServerConfig struct {
 	FrontendURL           string `yaml:"frontendurl"`
 	DisplayKeys           string `yaml:"displaykeys"`
 	AzureTenant           string `yaml:"azuretenant"`
-	RCE                   string `yaml:"rce"`
 }
 
 // SQLConfig - Generic SQL Config

+ 0 - 5
netclient/command/commands.go

@@ -215,8 +215,3 @@ func Daemon() error {
 	err := functions.Daemon()
 	return err
 }
-
-func Daemon() error {
-	err := functions.Daemon()
-	return err
-}

+ 3 - 1
netclient/ncutils/netclientutils_linux.go

@@ -34,7 +34,7 @@ func GetEmbedded() error {
 }
 
 // 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)
 	var listenPortString, postDownString, postUpString string
 	if node.MTU <= 0 {
@@ -56,6 +56,7 @@ func CreateWireGuardConf(node *models.Node, privatekey string, listenPort string
 	}
 	config := fmt.Sprintf(`[Interface]
 Address = %s
+DNS = %s
 PrivateKey = %s
 MTU = %s
 %s
@@ -66,6 +67,7 @@ MTU = %s
 
 `,
 		node.Address+"/32",
+		dns,
 		privatekey,
 		strconv.Itoa(int(node.MTU)),
 		postDownString,