aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-02-21 22:54:08 +0600
committerGitHub <noreply@github.com>2024-02-21 22:54:08 +0600
commit23b730c272eaa94bd90d2f44c50b7025ff1c14c0 (patch)
tree50d1fca00eeddbb38a5902c075c609bd75fc7506
parenta8c0e34fc81c407990d2179bad10abfd2b38c97f (diff)
parent923a70bbce21b9087f2aab9e9289872bf5065de5 (diff)
downloadrspamd-23b730c272eaa94bd90d2f44c50b7025ff1c14c0.tar.gz
rspamd-23b730c272eaa94bd90d2f44c50b7025ff1c14c0.zip
Merge pull request #4829 from rspamd/revert-4826-vstakhov-fix-history-key
Revert "[Fix] Fix history key, as we use `{=` and not `{{` in templates"
-rw-r--r--conf/modules.d/history_redis.conf2
-rw-r--r--lualib/lua_util.lua4
-rw-r--r--src/plugins/lua/history_redis.lua2
3 files changed, 4 insertions, 4 deletions
diff --git a/conf/modules.d/history_redis.conf b/conf/modules.d/history_redis.conf
index 141f9df32..b55d2fbba 100644
--- a/conf/modules.d/history_redis.conf
+++ b/conf/modules.d/history_redis.conf
@@ -14,7 +14,7 @@
history_redis {
#servers = 127.0.0.1:6379; # Redis server to store history
- key_prefix = "rs_history{=HOSTNAME=}{=COMPRESS=}"; # Default key name template
+ key_prefix = "rs_history{{HOSTNAME}}{{COMPRESS}}"; # Default key name template
nrows = 200; # Default rows limit
compress = true; # Use zstd compression when storing data in redis
subject_privacy = false; # subject privacy is off
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua
index 07ab13c9c..6964b0f00 100644
--- a/lualib/lua_util.lua
+++ b/lualib/lua_util.lua
@@ -171,7 +171,7 @@ end
-- @param {boolean} skip_global_env don't export Rspamd superglobals
-- @return {string} string containing replaced values
-- @example
--- lua_util.jinja_template("HELLO {=FOO=} {=BAR=}!", {['FOO'] = 'LUA', ['BAR'] = 'WORLD'})
+-- lua_util.jinja_template("HELLO {{FOO}} {{BAR}}!", {['FOO'] = 'LUA', ['BAR'] = 'WORLD'})
-- "HELLO LUA WORLD!"
--]]
exports.jinja_template = function(text, env, skip_global_env)
@@ -190,7 +190,7 @@ end
-- @param {boolean} skip_global_env don't export Rspamd superglobals
-- @return {string} string containing replaced values
-- @example
--- lua_util.jinja_template("HELLO {=FOO=} {=BAR=}!", {['FOO'] = 'LUA', ['BAR'] = 'WORLD'})
+-- lua_util.jinja_template("HELLO {{FOO}} {{BAR}}!", {['FOO'] = 'LUA', ['BAR'] = 'WORLD'})
-- "HELLO LUA WORLD!"
--]]
exports.jinja_template_file = function(filename, env, skip_global_env)
diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua
index 1a6d10705..f2554ef93 100644
--- a/src/plugins/lua/history_redis.lua
+++ b/src/plugins/lua/history_redis.lua
@@ -57,7 +57,7 @@ local template_env = {
local redis_params
local settings = {
- key_prefix = 'rs_history{=HOSTNAME=}{=COMPRESS=}', -- default key name template
+ key_prefix = 'rs_history{{HOSTNAME}}{{COMPRESS}}', -- default key name template
expire = nil, -- default no expire
nrows = 200, -- default rows limit
compress = true, -- use zstd compression when storing data in redis