From 1d02937aa7996aca39af00698d631c7b5bad82b8 Mon Sep 17 00:00:00 2001 From: Sven Marnach Date: Mon, 15 Jul 2024 11:01:07 +0200 Subject: [PATCH] bug-1907816: Allow using a Redis password. --- tecken/settings.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tecken/settings.py b/tecken/settings.py index cd11ee81d..fbf3eafec 100644 --- a/tecken/settings.py +++ b/tecken/settings.py @@ -394,6 +394,12 @@ def filter(self, record): ) REDIS_URL = _config("REDIS_URL", doc="URL for Redis.") +REDIS_PASSWORD = ( + _config( + "REDIS_PASSWORD", doc="Password for the Redis AUTH command.", raise_error=False + ) + or None +) REDIS_SOCKET_CONNECT_TIMEOUT = 2 REDIS_SOCKET_TIMEOUT = 2 @@ -417,6 +423,7 @@ def filter(self, record): "BACKEND": "django_redis.cache.RedisCache", "LOCATION": REDIS_URL, "OPTIONS": { + "PASSWORD": REDIS_PASSWORD, "COMPRESSOR": "django_redis.compressors.zlib.ZlibCompressor", "SERIALIZER": "django_redis.serializers.msgpack.MSGPackSerializer", "SOCKET_CONNECT_TIMEOUT": REDIS_SOCKET_CONNECT_TIMEOUT,