From: Vsevolod Stakhov Date: Wed, 19 Nov 2025 10:44:27 +0000 (+0000) Subject: [Fix] Fix external_relay mixins and confighelp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f93f1591926fa0f2354a14084185b7a67da619ad;p=thirdparty%2Frspamd.git [Fix] Fix external_relay mixins and confighelp - Register external_relay_common mixin for documentation - Fix confighelp to handle table data (doc objects) --- diff --git a/lualib/rspamadm/confighelp.lua b/lualib/rspamadm/confighelp.lua index 36161c10f2..dedc844ca9 100644 --- a/lualib/rspamadm/confighelp.lua +++ b/lualib/rspamadm/confighelp.lua @@ -76,8 +76,13 @@ local function print_help(key, value, tabs) if not opts['short'] then if value['data'] then - local nv = string.match(value['data'], '^#%s*(.*)%s*$') or value.data - print(string.format('%s\tDescription: %s', tabs, nv)) + local data = value['data'] + if type(data) == 'string' then + local nv = string.match(data, '^#%s*(.*)%s*$') or data + print(string.format('%s\tDescription: %s', tabs, nv)) + elseif type(data) == 'table' and data.summary then + print(string.format('%s\tDescription: %s', tabs, data.summary)) + end end if type(value['type']) == 'string' then print(string.format('%s\tType: %s', tabs, value['type'])) diff --git a/src/plugins/lua/external_relay.lua b/src/plugins/lua/external_relay.lua index 6dd1e3e462..b40dd076b2 100644 --- a/src/plugins/lua/external_relay.lua +++ b/src/plugins/lua/external_relay.lua @@ -36,6 +36,9 @@ local rule_common = T.table({ symbol = T.string():optional():doc({ summary = "Symbol name" }), }):doc({ summary = "Common rule fields" }) +-- Register rule_common as a mixin for documentation +PluginSchema.register("mixins.external_relay_common", rule_common) + local config_schema = T.table({ enabled = T.boolean():optional():doc({ summary = "Enable the plugin" }), rules = T.table({}, {