自动将同集群节点IP加入白名单/尝试使用本地防火墙提升黑名单连接封锁效率

This commit is contained in:
GoEdgeLab
2022-05-21 21:32:10 +08:00
parent b13fccc093
commit 0677923f98
4 changed files with 18 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
package iplibrary
import (
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
"github.com/TeaOSLab/EdgeNode/internal/utils"
)
@@ -14,6 +15,12 @@ func AllowIP(ip string, serverId int64) (canGoNext bool, inAllowList bool) {
return false, false
}
// check node
nodeConfig, err := nodeconfigs.SharedNodeConfig()
if err == nil && nodeConfig.IPIsAutoAllowed(ip) {
return true, true
}
// check white lists
if GlobalWhiteIPList.Contains(ipLong) {
return true, true