mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-07 13:44:17 +08:00
change stun port to int type
This commit is contained in:
parent
3bf78fe638
commit
79aa9893dc
3 changed files with 9 additions and 6 deletions
|
@ -77,7 +77,7 @@ type ServerConfig struct {
|
|||
LicenseValue string `yaml:"license_value"`
|
||||
NetmakerAccountID string `yaml:"netmaker_account_id"`
|
||||
IsEE string `yaml:"is_ee"`
|
||||
StunPort string `yaml:"stun_port"`
|
||||
StunPort int `yaml:"stun_port"`
|
||||
StunHost string `yaml:"stun_host"`
|
||||
Proxy string `yaml:"proxy"`
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ type ServerConfig struct {
|
|||
Server string `yaml:"server"`
|
||||
Broker string `yaml:"broker"`
|
||||
Is_EE bool `yaml:"isee"`
|
||||
StunPort string `yaml:"stun_port"`
|
||||
StunPort int `yaml:"stun_port"`
|
||||
StunHost string `yaml:"stun_host"`
|
||||
}
|
||||
|
||||
|
|
|
@ -692,11 +692,14 @@ func GetNetmakerAccountID() string {
|
|||
return netmakerAccountID
|
||||
}
|
||||
|
||||
func GetStunPort() string {
|
||||
port := "3478" //default
|
||||
func GetStunPort() int {
|
||||
port := 3478 //default
|
||||
if os.Getenv("STUN_PORT") != "" {
|
||||
port = os.Getenv("STUN_PORT")
|
||||
} else if config.Config.Server.StunPort != "" {
|
||||
portInt, err := strconv.Atoi(os.Getenv("STUN_PORT"))
|
||||
if err == nil {
|
||||
port = portInt
|
||||
}
|
||||
} else if config.Config.Server.StunPort != 0 {
|
||||
port = config.Config.Server.StunPort
|
||||
}
|
||||
return port
|
||||
|
|
Loading…
Add table
Reference in a new issue