Add turn relay start and end port configuration (#733)
This commit is contained in:
+21
-7
@@ -151,13 +151,15 @@ type LoggingConfig struct {
|
||||
}
|
||||
|
||||
type TURNConfig struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
Domain string `yaml:"domain"`
|
||||
CertFile string `yaml:"cert_file"`
|
||||
KeyFile string `yaml:"key_file"`
|
||||
TLSPort int `yaml:"tls_port"`
|
||||
UDPPort int `yaml:"udp_port"`
|
||||
ExternalTLS bool `yaml:"external_tls"`
|
||||
Enabled bool `yaml:"enabled"`
|
||||
Domain string `yaml:"domain"`
|
||||
CertFile string `yaml:"cert_file"`
|
||||
KeyFile string `yaml:"key_file"`
|
||||
TLSPort int `yaml:"tls_port"`
|
||||
UDPPort int `yaml:"udp_port"`
|
||||
RelayPortRangeStart uint16 `yaml:"relay_range_start,omitempty"`
|
||||
RelayPortRangeEnd uint16 `yaml:"relay_range_end,omitempty"`
|
||||
ExternalTLS bool `yaml:"external_tls"`
|
||||
}
|
||||
|
||||
type WebHookConfig struct {
|
||||
@@ -276,6 +278,18 @@ func NewConfig(confString string, c *cli.Context) (*Config, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// set defaults for Turn relay if none are set
|
||||
if conf.TURN.RelayPortRangeStart == 0 || conf.TURN.RelayPortRangeEnd == 0 {
|
||||
// to make it easier to run in dev mode/docker, default to two ports
|
||||
if conf.Development {
|
||||
conf.TURN.RelayPortRangeStart = 30000
|
||||
conf.TURN.RelayPortRangeEnd = 30002
|
||||
} else {
|
||||
conf.TURN.RelayPortRangeStart = 30000
|
||||
conf.TURN.RelayPortRangeEnd = 40000
|
||||
}
|
||||
}
|
||||
|
||||
if conf.RTC.NodeIP == "" {
|
||||
conf.RTC.NodeIP, err = conf.determineIP()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user