I have a small question about using ACL and the Redis CLI in combination for a healtcheck in my Docker Compose file.
healthcheck:
test: ["CMD", "redis-cli", "-a", "password", "--no-auth-warning", "ping"]
timeout: 30s
retries: 5
start_period: 10s
Currently, I have the following section in my Docker Compose file for the healtcheck. This also works great when times has a default user enabled, as I only need to provide the password. Unfortunately I can't find a way to do this ping call directly if you have a user and password.
Generally I would just register a ping user in my users.acl, which is only allowed to execute the ping command.
Since I currently can't create an extra user, because then I can't use the workaround anymore, I have now given the default user only rights for the ping command.
user default on #sha265 nocommands +ping
Is this the best workaround, or is there a better one so I can create a separate user and just disable the demonuser.
Thanks a lot Jonas
Comment From: itamarhaber
Hello @gowizzard
I can't find a way
Have you tried?
test: ["CMD", "redis-cli", "-a", "password", "--user", "myuser", "--no-auth-warning", "ping"]
Comment From: gowizzard
Hallo @itamarhaber,
thank you for your answer. Sorry I have overlooked the argument. I have now adjusted the whole thing, and I can now disable the default user.
test: [ "CMD", "redis-cli", "--user", "ping", "--pass", "test", "--no-auth-warning", "ping" ]
Have a nice weekend!