mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-02 10:12:06 +08:00
option of turn off stun
This commit is contained in:
parent
bab772f562
commit
64b6a11e52
4 changed files with 14 additions and 1 deletions
|
|
@ -102,6 +102,7 @@ type ServerConfig struct {
|
|||
MetricInterval string `yaml:"metric_interval"`
|
||||
ManageDNS bool `yaml:"manage_dns"`
|
||||
DefaultDomain string `yaml:"default_domain"`
|
||||
StunStatus bool `yaml:"stun_status"`
|
||||
}
|
||||
|
||||
// SQLConfig - Generic SQL Config
|
||||
|
|
|
|||
|
|
@ -268,6 +268,7 @@ type ServerConfig struct {
|
|||
MetricInterval string `yaml:"metric_interval"`
|
||||
ManageDNS bool `yaml:"manage_dns"`
|
||||
DefaultDomain string `yaml:"default_domain"`
|
||||
StunStatus bool `yaml:"stun_status"`
|
||||
}
|
||||
|
||||
// User.NameInCharset - returns if name is in charset below or not
|
||||
|
|
|
|||
|
|
@ -92,4 +92,5 @@ PEER_UPDATE_BATCH=true
|
|||
PEER_UPDATE_BATCH_SIZE=50
|
||||
# default domain for internal DNS lookup
|
||||
DEFAULT_DOMAIN=netmaker.hosted
|
||||
|
||||
# config to turn off Stun
|
||||
STUN_STATUS=true
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ func GetServerConfig() config.ServerConfig {
|
|||
cfg.MetricInterval = GetMetricInterval()
|
||||
cfg.ManageDNS = GetManageDNS()
|
||||
cfg.DefaultDomain = GetDefaultDomain()
|
||||
cfg.StunStatus = GetSTUNStatus()
|
||||
return cfg
|
||||
}
|
||||
|
||||
|
|
@ -141,6 +142,7 @@ func GetServerInfo() models.ServerConfig {
|
|||
cfg.MetricInterval = GetMetricInterval()
|
||||
cfg.ManageDNS = GetManageDNS()
|
||||
cfg.DefaultDomain = GetDefaultDomain()
|
||||
cfg.StunStatus = GetSTUNStatus()
|
||||
return cfg
|
||||
}
|
||||
|
||||
|
|
@ -846,6 +848,14 @@ func GetAllowedEmailDomains() string {
|
|||
return allowedDomains
|
||||
}
|
||||
|
||||
func GetSTUNStatus() bool {
|
||||
s := true
|
||||
if os.Getenv("STUN_STATUS") != "" {
|
||||
s = os.Getenv("STUN_STATUS") == "true"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// GetNmBaseDomain - fetches nm base domain
|
||||
func GetNmBaseDomain() string {
|
||||
return os.Getenv("NM_DOMAIN")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue