aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_rcl.cxx
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-08-15 14:58:35 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-08-15 14:58:35 +0100
commit28aa53b19d0c5ce2e1101680f1f3179b46457396 (patch)
tree9bb16121d48a67d84f8e595ec1bcf27ef3b2c542 /src/libserver/cfg_rcl.cxx
parent56343d2576e88573d1a26431cfa54ee1a22c9715 (diff)
downloadrspamd-28aa53b19d0c5ce2e1101680f1f3179b46457396.tar.gz
rspamd-28aa53b19d0c5ce2e1101680f1f3179b46457396.zip
[Rework] Breaking: Rewrite cfg transform and remove legacy
What is removed: * SURBL/Email -> rbl conversion * IP reputation -> reputation conversion Reasoning: * Too hard to support forever * Outdated * Want to use transparent UCL instead of modifying the config from Lua
Diffstat (limited to 'src/libserver/cfg_rcl.cxx')
-rw-r--r--src/libserver/cfg_rcl.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libserver/cfg_rcl.cxx b/src/libserver/cfg_rcl.cxx
index 7856af814..270678491 100644
--- a/src/libserver/cfg_rcl.cxx
+++ b/src/libserver/cfg_rcl.cxx
@@ -3489,7 +3489,7 @@ void rspamd_rcl_maybe_apply_lua_transform(struct rspamd_config *cfg)
lua_pushvalue(L, -2);
/* Push the existing config */
- ucl_object_push_lua(L, cfg->cfg_ucl_obj, true);
+ ucl_object_push_lua_unwrapped(L, cfg->cfg_ucl_obj);
if (auto ret = lua_pcall(L, 1, 2, err_idx); ret != 0) {
msg_err("call to rspamadm lua script failed (%d): %s", ret,
@@ -3499,12 +3499,8 @@ void rspamd_rcl_maybe_apply_lua_transform(struct rspamd_config *cfg)
return;
}
- if (lua_toboolean(L, -2) && lua_type(L, -1) == LUA_TTABLE) {
- ucl_object_t *old_cfg = cfg->cfg_ucl_obj;
-
+ if (lua_toboolean(L, -2) && lua_type(L, -1) == LUA_TUSERDATA) {
msg_info_config("configuration has been transformed in Lua");
- cfg->cfg_ucl_obj = ucl_object_lua_import(L, -1);
- ucl_object_unref(old_cfg);
}
/* error function */