mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-30 18:16:39 +08:00
删除IP名单中某个IP时,也会删除WAF保存在内存中的名单中的IP
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/rpc"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf"
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -125,6 +126,16 @@ func (this *IPListManager) fetch() (hasNext bool, err error) {
|
||||
if item.IsDeleted {
|
||||
list.Delete(item.Id)
|
||||
|
||||
// 从临时名单中删除
|
||||
if len(item.IpFrom) > 0 && len(item.IpTo) == 0 {
|
||||
switch item.ListType {
|
||||
case "black":
|
||||
waf.SharedIPBlackList.RemoveIP(item.IpFrom)
|
||||
case "white":
|
||||
waf.SharedIPWhiteList.RemoveIP(item.IpFrom)
|
||||
}
|
||||
}
|
||||
|
||||
// 操作事件
|
||||
SharedActionManager.DeleteItem(item.ListType, item)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user