mirror of
				https://github.com/gravitl/netmaker.git
				synced 2025-11-04 11:39:22 +08:00 
			
		
		
		
	removed client mode and references
This commit is contained in:
		
							parent
							
								
									f4851937c1
								
							
						
					
					
						commit
						6a5057f57b
					
				
					 9 changed files with 0 additions and 40 deletions
				
			
		| 
						 | 
				
			
			@ -17,7 +17,6 @@ services:
 | 
			
		|||
      DNS_MODE: "on"
 | 
			
		||||
      SERVER_HTTP_HOST: "api.NETMAKER_BASE_DOMAIN"
 | 
			
		||||
      API_PORT: "8081"
 | 
			
		||||
      CLIENT_MODE: "on"
 | 
			
		||||
      MASTER_KEY: "REPLACE_MASTER_KEY"
 | 
			
		||||
      CORS_ALLOWED_ORIGIN: "*"
 | 
			
		||||
      DISPLAY_KEYS: "on"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,7 +44,6 @@ type ServerConfig struct {
 | 
			
		|||
	RestBackend           string `yaml:"restbackend"`
 | 
			
		||||
	AgentBackend          string `yaml:"agentbackend"`
 | 
			
		||||
	MessageQueueBackend   string `yaml:"messagequeuebackend"`
 | 
			
		||||
	ClientMode            string `yaml:"clientmode"`
 | 
			
		||||
	DNSMode               string `yaml:"dnsmode"`
 | 
			
		||||
	DisableRemoteIPCheck  string `yaml:"disableremoteipcheck"`
 | 
			
		||||
	Version               string `yaml:"version"`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,6 @@ server:
 | 
			
		|||
  allowedorigin: "" # defaults to '*' or CORS_ALLOWED_ORIGIN (if set)
 | 
			
		||||
  restbackend: "" # defaults to "on" or REST_BACKEND (if set)
 | 
			
		||||
  agentbackend: "" # defaults to "on" or AGENT_BACKEND (if set)
 | 
			
		||||
  clientmode: "" # defaults to "on" or CLIENT_MODE (if set)
 | 
			
		||||
  dnsmode: "" # defaults to "on" or DNS_MODE (if set)
 | 
			
		||||
  sqlconn: "" # defaults to "http://" or SQL_CONN (if set)
 | 
			
		||||
  disableremoteipcheck: "" # defaults to "false" or DISABLE_REMOTE_IP_CHECK (if set)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								dev.yaml
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								dev.yaml
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -15,7 +15,6 @@ server:
 | 
			
		|||
  restbackend: "on"
 | 
			
		||||
  agentbackend: "on"
 | 
			
		||||
  messagequeuebackend: "on"
 | 
			
		||||
  clientmode: "on"
 | 
			
		||||
  dnsmode: "on"
 | 
			
		||||
  disableremoteipcheck: ""
 | 
			
		||||
  grpcssl: "on"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,8 +53,6 @@ spec:
 | 
			
		|||
          value: wireguard-go
 | 
			
		||||
        - name: DNS_MODE
 | 
			
		||||
          value: "off"
 | 
			
		||||
        - name: CLIENT_MODE
 | 
			
		||||
          value: "on"
 | 
			
		||||
        - name: DISPLAY_KEYS
 | 
			
		||||
          value: "on"
 | 
			
		||||
        - name: DATABASE
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										15
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								main.go
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -8,7 +8,6 @@ import (
 | 
			
		|||
	"os"
 | 
			
		||||
	"os/signal"
 | 
			
		||||
	"runtime/debug"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"sync"
 | 
			
		||||
	"syscall"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -97,20 +96,6 @@ func initialize() { // Client Mode Prereq Check
 | 
			
		|||
		logger.FatalLog("error setting defaults: ", err.Error())
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if servercfg.IsClientMode() != "off" {
 | 
			
		||||
		output, err := ncutils.RunCmd("id -u", true)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			logger.FatalLog("Error running 'id -u' for prereq check. Please investigate or disable client mode.", output, err.Error())
 | 
			
		||||
		}
 | 
			
		||||
		uid, err := strconv.Atoi(string(output[:len(output)-1]))
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			logger.FatalLog("Error retrieving uid from 'id -u' for prereq check. Please investigate or disable client mode.", err.Error())
 | 
			
		||||
		}
 | 
			
		||||
		if uid != 0 {
 | 
			
		||||
			logger.FatalLog("To run in client mode requires root privileges. Either disable client mode or run with sudo.")
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if servercfg.IsDNSMode() {
 | 
			
		||||
		err := functions.SetDNSDir()
 | 
			
		||||
		if err != nil {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -227,7 +227,6 @@ type ServerConfig struct {
 | 
			
		|||
	CoreDNSAddr string `yaml:"corednsaddr"`
 | 
			
		||||
	API         string `yaml:"api"`
 | 
			
		||||
	APIPort     string `yaml:"apiport"`
 | 
			
		||||
	ClientMode  string `yaml:"clientmode"`
 | 
			
		||||
	DNSMode     string `yaml:"dnsmode"`
 | 
			
		||||
	Version     string `yaml:"version"`
 | 
			
		||||
	MQPort      string `yaml:"mqport"`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,10 +50,6 @@ func GetServerConfig() config.ServerConfig {
 | 
			
		|||
	if IsAgentBackend() {
 | 
			
		||||
		cfg.AgentBackend = "on"
 | 
			
		||||
	}
 | 
			
		||||
	cfg.ClientMode = "off"
 | 
			
		||||
	if IsClientMode() != "off" {
 | 
			
		||||
		cfg.ClientMode = IsClientMode()
 | 
			
		||||
	}
 | 
			
		||||
	cfg.DNSMode = "off"
 | 
			
		||||
	if IsDNSMode() {
 | 
			
		||||
		cfg.DNSMode = "on"
 | 
			
		||||
| 
						 | 
				
			
			@ -345,18 +341,6 @@ func IsMessageQueueBackend() bool {
 | 
			
		|||
	return ismessagequeue
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsClientMode - checks if it should run in client mode
 | 
			
		||||
func IsClientMode() string {
 | 
			
		||||
	isclient := "on"
 | 
			
		||||
	if os.Getenv("CLIENT_MODE") == "off" {
 | 
			
		||||
		isclient = "off"
 | 
			
		||||
	}
 | 
			
		||||
	if config.Config.Server.ClientMode == "off" {
 | 
			
		||||
		isclient = "off"
 | 
			
		||||
	}
 | 
			
		||||
	return isclient
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Telemetry - checks if telemetry data should be sent
 | 
			
		||||
func Telemetry() string {
 | 
			
		||||
	telemetry := "on"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -575,8 +575,6 @@ definitions:
 | 
			
		|||
                type: string
 | 
			
		||||
            ClientID:
 | 
			
		||||
                type: string
 | 
			
		||||
            ClientMode:
 | 
			
		||||
                type: string
 | 
			
		||||
            ClientSecret:
 | 
			
		||||
                type: string
 | 
			
		||||
            CoreDNSAddr:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue