aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2025-06-30 17:44:55 +0600
committerGitHub <noreply@github.com>2025-06-30 17:44:55 +0600
commit1bc61e5959fcf1d1cf4b57cf6496630e32a9ec95 (patch)
treee9dc22f383d730bfcce04c3f6e8e167cb378b7ba /rules
parent09756fbbc2d5901958b7099420dd648d627b40ee (diff)
parentce2dba2f58b8dacbf0569d31d40e2c001c1cc0ab (diff)
downloadrspamd-master.tar.gz
rspamd-master.zip
Merge pull request #5524 from moisseev/fuzzy-configHEADmaster
[WebUI] Add fuzzy flag selectors to Scan/Learn tab
Diffstat (limited to 'rules')
-rw-r--r--rules/controller/fuzzy.lua22
1 files changed, 21 insertions, 1 deletions
diff --git a/rules/controller/fuzzy.lua b/rules/controller/fuzzy.lua
index 193e6fd4c..06f5d43d9 100644
--- a/rules/controller/fuzzy.lua
+++ b/rules/controller/fuzzy.lua
@@ -37,10 +37,30 @@ local function handle_gen_fuzzy(task, conn, req_params)
end
end
+local function handle_fuzzy_storages(_task, conn)
+ if type(rspamd_plugins.fuzzy_check) == 'table'
+ and type(rspamd_plugins.fuzzy_check.list_storages) == 'function' then
+ local ok, result = pcall(rspamd_plugins.fuzzy_check.list_storages, rspamd_config)
+
+ if ok then
+ conn:send_ucl({ success = true, storages = result })
+ else
+ conn:send_error(500, 'cannot list fuzzy storages')
+ end
+ else
+ conn:send_error(404, 'fuzzy_check is not enabled')
+ end
+end
+
return {
hashes = {
handler = handle_gen_fuzzy,
need_task = true,
enable = false
},
-} \ No newline at end of file
+ storages = {
+ handler = handle_fuzzy_storages,
+ need_task = false,
+ enable = false
+ },
+}