]> source.dussan.org Git - rspamd.git/commitdiff
Apply suggestions from code review 4578/head
authorLaoDC <github@laodc.com>
Mon, 21 Aug 2023 15:02:20 +0000 (22:02 +0700)
committerGitHub <noreply@github.com>
Mon, 21 Aug 2023 15:02:20 +0000 (22:02 +0700)
Co-authored-by: Vsevolod Stakhov <vsevolod@rspamd.com>
lualib/lua_redis.lua
lualib/rspamadm/configwizard.lua

index 8ae40da5bc39eecbdd245aabd642b3431161113a..ead938a0a4b8cfc9855136a7339f3383284967ee 100644 (file)
@@ -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"),
 }
 
index 7bcda5a018bc78f68a622e0f203d464bc1510374..fb8bd0d35838f5d1cdf6d82a10d9e7d11d0a4f91 100644 (file)
@@ -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)