pull/216/head
midoks 3 years ago
parent 8e1d95bf82
commit 63e6a95553
  1. 1
      plugins/op_waf/conf/luawaf.conf
  2. 8
      plugins/op_waf/t/index.py
  3. 4
      plugins/op_waf/waf/lua/common.lua
  4. 4
      plugins/op_waf/waf/lua/init.lua

@ -2,6 +2,7 @@ lua_shared_dict waf_limit 30m;
lua_shared_dict waf_drop_ip 10m;
lua_shared_dict waf_drop_sum 10m;
lua_package_path "{$WAF_PATH}/html/?.lua;{$WAF_PATH}/conf/?.lua;{$WAF_PATH}/lua/?.lua;{$ROOT_PATH}/openresty/lualib/?.lua;;";
lua_package_cpath "{$WAF_PATH}/conf/?.so;{$ROOT_PATH}/openresty/lualib/?.so;;";
init_worker_by_lua_file {$WAF_PATH}/lua/init_worker.lua;
access_by_lua_file {$WAF_PATH}/lua/init.lua;

@ -211,16 +211,16 @@ def test_OK():
def test_start():
# test_OK()
# test_Dir()
test_UA()
# test_UA()
# test_UA_for(1000)
# test_POST()
# test_scan()
# test_CC()
test_CC()
# test_url_ext()
# test_cdn()
if __name__ == "__main__":
os.system('cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/op_waf && sh install.sh uninstall 0.2.2 && sh install.sh install 0.2.2')
os.system('cd /Users/midoks/Desktop/mwdev/server/mdserver-web/ && python3 plugins/openresty/index.py stop && python3 plugins/openresty/index.py start')
# os.system('cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/op_waf && sh install.sh uninstall 0.2.2 && sh install.sh install 0.2.2')
# os.system('cd /Users/midoks/Desktop/mwdev/server/mdserver-web/ && python3 plugins/openresty/index.py stop && python3 plugins/openresty/index.py start')
test_start()

@ -60,7 +60,7 @@ function _M.initDB(self)
db:exec([[PRAGMA journal_size_limit = 1073741824]])
self.db = db
return db
return self.db
end
function _M.log(self, args, rule_name, reason)
@ -95,6 +95,7 @@ function _M.log(self, args, rule_name, reason)
if local_db and local_db:isopen() then
local_db:close()
end
return true
end
function _M.setDebug(self, mode)
debug_mode = mode
@ -103,7 +104,6 @@ end
-- 调试方式
function _M.D(self, msg)
if not debug_mode then return true end
local _msg = ''

@ -2,10 +2,10 @@
local json = require "cjson"
local ngx_match = ngx.re.find
local __C = require "common"
local __WAF = require "common"
-- print(json.encode(__C))
local C = __C:getInstance()
local C = __WAF:getInstance()
local config = require "waf_config"
local site_config = require "waf_site"

Loading…
Cancel
Save