mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-04-27 17:15:33 +08:00
NS节点也增加DDoS配置
This commit is contained in:
@@ -5,15 +5,18 @@ package dnsconfigs
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ddosconfigs"
|
||||
)
|
||||
|
||||
type NSNodeConfig struct {
|
||||
Id int64 `yaml:"id" json:"id"`
|
||||
NodeId string `yaml:"nodeId" json:"nodeId"`
|
||||
Secret string `yaml:"secret" json:"secret"`
|
||||
ClusterId int64 `yaml:"clusterId" json:"clusterId"`
|
||||
AccessLogRef *NSAccessLogRef `yaml:"accessLogRef" json:"accessLogRef"`
|
||||
RecursionConfig *RecursionConfig `yaml:"recursionConfig" json:"recursionConfig"`
|
||||
Id int64 `yaml:"id" json:"id"`
|
||||
NodeId string `yaml:"nodeId" json:"nodeId"`
|
||||
Secret string `yaml:"secret" json:"secret"`
|
||||
ClusterId int64 `yaml:"clusterId" json:"clusterId"`
|
||||
AccessLogRef *NSAccessLogRef `yaml:"accessLogRef" json:"accessLogRef"`
|
||||
RecursionConfig *RecursionConfig `yaml:"recursionConfig" json:"recursionConfig"`
|
||||
DDoSProtection *ddosconfigs.ProtectionConfig `yaml:"ddosProtection" json:"ddosProtection"`
|
||||
AllowedIPs []string `yaml:"allowedIPs" json:"allowedIPs"`
|
||||
|
||||
TCP *serverconfigs.TCPProtocolConfig `yaml:"tcp" json:"tcp"` // TCP配置
|
||||
TLS *serverconfigs.TLSProtocolConfig `yaml:"tls" json:"tls"` // TLS配置
|
||||
@@ -33,6 +36,22 @@ func (this *NSNodeConfig) Init() error {
|
||||
}
|
||||
}
|
||||
|
||||
// 递归DNS
|
||||
if this.RecursionConfig != nil {
|
||||
err := this.RecursionConfig.Init()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// DDoS
|
||||
if this.DDoSProtection != nil {
|
||||
err := this.DDoSProtection.Init()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// tcp
|
||||
if this.TCP != nil {
|
||||
err := this.TCP.Init()
|
||||
|
||||
Reference in New Issue
Block a user