From 07d173d2cf390fdad6c0b833a817ae3fd8408fc3 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 24 Oct 2022 19:11:48 +0800 Subject: [PATCH] up --- plugins/op_waf/index.py | 9 +++++++++ plugins/op_waf/waf/lua/init.lua | 1 + plugins/webstats/index.py | 2 +- plugins/webstats/lua/webstats_common.lua | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/op_waf/index.py b/plugins/op_waf/index.py index 9ce12b941..0ba1fba1e 100755 --- a/plugins/op_waf/index.py +++ b/plugins/op_waf/index.py @@ -424,6 +424,15 @@ def restart(): def reload(): stop() + path = getServerDir() + path_tpl = getPluginDir() + + config = path + "/waf/lua/init.lua" + config_tpl = path_tpl + "/waf/lua/init.lua" + content = mw.readFile(config_tpl) + content = contentReplace(content) + mw.writeFile(config, content) + errlog = mw.getServerDir() + "/openresty/nginx/logs/error.log" mw.execShell('rm -rf ' + errlog) diff --git a/plugins/op_waf/waf/lua/init.lua b/plugins/op_waf/waf/lua/init.lua index d23596e9d..a164838a9 100644 --- a/plugins/op_waf/waf/lua/init.lua +++ b/plugins/op_waf/waf/lua/init.lua @@ -295,6 +295,7 @@ local function is_open_waf_cc_increase() return true end + -- C:D("waf config:"..json.encode(config)) if cpu_percent >= config['safe_verify']['cpu'] then return true end diff --git a/plugins/webstats/index.py b/plugins/webstats/index.py index 9ba0926f7..9c7ee5412 100755 --- a/plugins/webstats/index.py +++ b/plugins/webstats/index.py @@ -132,7 +132,7 @@ def loadLuaSiteFile(): tmp = { "name": "unset", - "domain": [], + "domains": [], } content.append(tmp) listToLuaFile(lua_site, content) diff --git a/plugins/webstats/lua/webstats_common.lua b/plugins/webstats/lua/webstats_common.lua index e9917a3ca..a596dbf9f 100644 --- a/plugins/webstats/lua/webstats_common.lua +++ b/plugins/webstats/lua/webstats_common.lua @@ -149,7 +149,7 @@ function _M.get_sn(self, input_sn) cache:set(input_sn, v['name'], 86400) return v["name"] end - + -- self:D("get_sn:"..json.encode(v)) for _,dst_domain in ipairs(v['domains']) do if input_sn == dst_domain then