commit 6c3d5c7: Apply suggestions from code review

GitHub noreply at github.com
Mon Aug 21 15:21:08 UTC 2023


Author: LaoDC
Date: 2023-08-21 22:02:20 +0700
URL: https://github.com/rspamd/rspamd/commit/6c3d5c7db86c2fe28d10915c2d6578efe5a4661c (refs/pull/4578/head)

Apply suggestions from code review
Co-authored-by: Vsevolod Stakhov <vsevolod at rspamd.com>
---
 lualib/lua_redis.lua             |  2 +-
 lualib/rspamadm/configwizard.lua | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index 8ae40da5b..ead938a0a 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -37,7 +37,7 @@ local common_schema = {
   sentinel_watch_time = (ts.number + ts.string / lutil.parse_time_interval):is_optional():describe("Sentinel watch time"),
   sentinel_masters_pattern = ts.string:is_optional():describe("Sentinel masters pattern"),
   sentinel_master_maxerrors = (ts.number + ts.string / tonumber):is_optional():describe("Sentinel master max errors"),
-  sentinel_username = ts.string:is_optional():describe("sentinel username"),
+  sentinel_username = ts.string:is_optional():describe("Sentinel username"),
   sentinel_password = ts.string:is_optional():describe("Sentinel password"),
 }
 
diff --git a/lualib/rspamadm/configwizard.lua b/lualib/rspamadm/configwizard.lua
index 7bcda5a01..fb8bd0d35 100644
--- a/lualib/rspamadm/configwizard.lua
+++ b/lualib/rspamadm/configwizard.lua
@@ -249,12 +249,12 @@ local function setup_redis(cfg, changes)
       redis_params['write_servers'] = ws
     end
 
-    if ask_yes_no('Do you have any username set for your Redis?') then
-      local usernm = readline_default("Enter Redis username:", nil)
+    if ask_yes_no('Do you have any username set for your Redis (ACL SETUSER and Redis 6.0+)') then
+      local username = readline_default("Enter Redis username:", nil)
 
-      if usernm then
-        changes.l['redis.conf']['username'] = usernm
-        redis_params['username'] = usernm
+      if username then
+        changes.l['redis.conf'].username = username
+        redis_params.username = username
       end
 
       local passwd = readline_default("Enter Redis password:", nil)


More information about the Commits mailing list