From 2d6e815b3db3e72cbd956c4381076ec40fc8de40 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Fri, 29 Dec 2023 18:45:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A6=82=20Redis=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=8C=85=E5=90=AB=E7=89=B9=E6=AE=8A=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E6=97=B6=EF=BC=8C=E6=9C=8D=E5=8A=A1=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/conf.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index 80790eb2e..66aba779e 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -17,7 +17,7 @@ import re import sys import types from importlib import import_module -from urllib.parse import urljoin, urlparse +from urllib.parse import urljoin, urlparse, quote import yaml from django.urls import reverse_lazy @@ -693,6 +693,13 @@ class Config(dict): if openid_config: self.set_openid_config(openid_config) + def compatible_redis(self): + redis_config = { + 'REDIS_PASSWORD': quote(str(self.REDIS_PASSWORD)), + } + for key, value in redis_config.items(): + self[key] = value + def compatible(self): """ 对配置做兼容处理 @@ -704,6 +711,8 @@ class Config(dict): """ # 兼容 OpenID 配置 self.compatible_auth_openid() + # 兼容 Redis 配置 + self.compatible_redis() def convert_type(self, k, v): default_value = self.defaults.get(k)