Browse Source

Revert "[Fix] Fix history key, as we use `{=` and not `{{` in templates"

tags/3.8.4
Vsevolod Stakhov 2 months ago
parent
commit
923a70bbce
No account linked to committer's email address
3 changed files with 4 additions and 2 deletions
  1. 1
    1
      conf/modules.d/history_redis.conf
  2. 2
    0
      lualib/lua_util.lua
  3. 1
    1
      src/plugins/lua/history_redis.lua

+ 1
- 1
conf/modules.d/history_redis.conf View File



history_redis { history_redis {
#servers = 127.0.0.1:6379; # Redis server to store history #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 nrows = 200; # Default rows limit
compress = true; # Use zstd compression when storing data in redis compress = true; # Use zstd compression when storing data in redis
subject_privacy = false; # subject privacy is off subject_privacy = false; # subject privacy is off

+ 2
- 0
lualib/lua_util.lua View File

-- @param {boolean} skip_global_env don't export Rspamd superglobals -- @param {boolean} skip_global_env don't export Rspamd superglobals
-- @return {string} string containing replaced values -- @return {string} string containing replaced values
-- @example -- @example
-- lua_util.jinja_template("HELLO {{FOO}} {{BAR}}!", {['FOO'] = 'LUA', ['BAR'] = 'WORLD'})
-- "HELLO LUA WORLD!" -- "HELLO LUA WORLD!"
--]] --]]
exports.jinja_template = function(text, env, skip_global_env) exports.jinja_template = function(text, env, skip_global_env)
-- @param {boolean} skip_global_env don't export Rspamd superglobals -- @param {boolean} skip_global_env don't export Rspamd superglobals
-- @return {string} string containing replaced values -- @return {string} string containing replaced values
-- @example -- @example
-- lua_util.jinja_template("HELLO {{FOO}} {{BAR}}!", {['FOO'] = 'LUA', ['BAR'] = 'WORLD'})
-- "HELLO LUA WORLD!" -- "HELLO LUA WORLD!"
--]] --]]
exports.jinja_template_file = function(filename, env, skip_global_env) exports.jinja_template_file = function(filename, env, skip_global_env)

+ 1
- 1
src/plugins/lua/history_redis.lua View File

local redis_params local redis_params


local settings = { 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 expire = nil, -- default no expire
nrows = 200, -- default rows limit nrows = 200, -- default rows limit
compress = true, -- use zstd compression when storing data in redis compress = true, -- use zstd compression when storing data in redis

Loading…
Cancel
Save