feat:change folder name

This commit is contained in:
samwaf
2024-10-16 14:49:06 +08:00
parent 82fe7c0566
commit 231f286fa7
6 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -8,7 +8,6 @@ import (
"SamWaf/innerbean"
"SamWaf/model"
"SamWaf/model/wafenginmodel"
"SamWaf/plugin"
"SamWaf/utils"
"SamWaf/utils/zlog"
"SamWaf/wafconfig"
@@ -19,6 +18,7 @@ import (
"SamWaf/wafsafeclear"
"SamWaf/wafsnowflake"
"SamWaf/waftask"
"SamWaf/webplugin"
"crypto/tls"
_ "embed"
"fmt"
@@ -394,7 +394,7 @@ func (m *wafSystenService) run() {
break
case enums.ChanTypeAnticc:
globalobj.GWAF_RUNTIME_OBJ_WAF_ENGINE.HostTarget[globalobj.GWAF_RUNTIME_OBJ_WAF_ENGINE.HostCode[msg.HostCode]].Mux.Lock()
globalobj.GWAF_RUNTIME_OBJ_WAF_ENGINE.HostTarget[globalobj.GWAF_RUNTIME_OBJ_WAF_ENGINE.HostCode[msg.HostCode]].PluginIpRateLimiter = plugin.NewIPRateLimiter(rate.Limit(msg.Content.(model.AntiCC).Rate), msg.Content.(model.AntiCC).Limit)
globalobj.GWAF_RUNTIME_OBJ_WAF_ENGINE.HostTarget[globalobj.GWAF_RUNTIME_OBJ_WAF_ENGINE.HostCode[msg.HostCode]].PluginIpRateLimiter = webplugin.NewIPRateLimiter(rate.Limit(msg.Content.(model.AntiCC).Rate), msg.Content.(model.AntiCC).Limit)
zlog.Debug("远程配置", zap.Any("Anticc", msg.Content.(model.AntiCC)))
globalobj.GWAF_RUNTIME_OBJ_WAF_ENGINE.HostTarget[globalobj.GWAF_RUNTIME_OBJ_WAF_ENGINE.HostCode[msg.HostCode]].Mux.Unlock()
break
+5 -5
View File
@@ -2,10 +2,10 @@ package wafenginmodel
import (
"SamWaf/model"
"SamWaf/plugin"
"SamWaf/utils"
"SamWaf/wafenginecore/loadbalance"
"SamWaf/wafproxy"
"SamWaf/webplugin"
"sync"
)
@@ -17,10 +17,10 @@ type HostSafe struct {
RuleData []model.Rules
RuleVersionSum int //规则版本的汇总 通过这个来进行版本动态加载
Host model.Hosts
PluginIpRateLimiter *plugin.IPRateLimiter //ip限流
IPWhiteLists []model.IPAllowList //ip 白名单
UrlWhiteLists []model.URLAllowList //url 白名单
LdpUrlLists []model.LDPUrl //url 隐私保护
PluginIpRateLimiter *webplugin.IPRateLimiter //ip限流
IPWhiteLists []model.IPAllowList //ip 白名单
UrlWhiteLists []model.URLAllowList //url 白名单
LdpUrlLists []model.LDPUrl //url 隐私保护
IPBlockLists []model.IPBlockList //ip 黑名单
UrlBlockLists []model.URLBlockList //url 黑名单
+2 -2
View File
@@ -19,8 +19,8 @@ import (
"path/filepath"
"time"
//"github.com/kangarooxin/gorm-plugin-crypto"
//"github.com/kangarooxin/gorm-plugin-crypto/strategy"
//"github.com/kangarooxin/gorm-webplugin-crypto"
//"github.com/kangarooxin/gorm-webplugin-crypto/strategy"
gowxsqlite3 "github.com/pengge/go-wxsqlite3"
"github.com/pengge/sqlitedriver"
"gorm.io/gorm"
+3 -3
View File
@@ -9,12 +9,12 @@ import (
"SamWaf/model/baseorm"
"SamWaf/model/detection"
"SamWaf/model/wafenginmodel"
"SamWaf/plugin"
"SamWaf/service/waf_service"
"SamWaf/utils"
"SamWaf/utils/zlog"
"SamWaf/wafenginecore/loadbalance"
"SamWaf/wafproxy"
"SamWaf/webplugin"
"bufio"
"bytes"
"compress/flate"
@@ -770,9 +770,9 @@ func (waf *WafEngine) LoadHost(inHost model.Hosts) innerbean.ServerRunTime {
global.GWAF_LOCAL_DB.Where("host_code=? ", inHost.Code).Limit(1).Find(&anticcBean)
//初始化插件-ip计数器
var pluginIpRateLimiter *plugin.IPRateLimiter
var pluginIpRateLimiter *webplugin.IPRateLimiter
if anticcBean.Id != "" {
pluginIpRateLimiter = plugin.NewIPRateLimiter(rate.Limit(anticcBean.Rate), anticcBean.Limit)
pluginIpRateLimiter = webplugin.NewIPRateLimiter(rate.Limit(anticcBean.Rate), anticcBean.Limit)
}
//查询ip白名单
@@ -1,4 +1,4 @@
package plugin
package webplugin
import (
"sync"
@@ -1,4 +1,4 @@
package plugin
package webplugin
import (
"gorm.io/gorm"