Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Fix history key, as we use {= and not {{ in templates #4826

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/modules.d/history_redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lualib/lua_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/lua/history_redis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down