From 3e3ab556d3e386b2d01611949b33481ec93eb102 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 23 Nov 2018 18:28:02 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/settings.py | 20 ++++++++++---------- config_example.py | 4 +++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index 6801be6c5..1d7a2a8de 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -14,7 +14,7 @@ import os import sys import ldap -from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion +# from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion from django.urls import reverse_lazy from .conf import load_user_config @@ -362,11 +362,11 @@ AUTH_LDAP_SEARCH_OU = 'ou=tech,dc=jumpserver,dc=org' AUTH_LDAP_SEARCH_FILTER = '(cn=%(user)s)' AUTH_LDAP_START_TLS = False AUTH_LDAP_USER_ATTR_MAP = {"username": "cn", "name": "sn", "email": "mail"} -AUTH_LDAP_GROUP_SEARCH_OU = CONFIG.AUTH_LDAP_GROUP_SEARCH_OU -AUTH_LDAP_GROUP_SEARCH_FILTER = CONFIG.AUTH_LDAP_GROUP_SEARCH_FILTER -AUTH_LDAP_GROUP_SEARCH = LDAPSearch( - AUTH_LDAP_GROUP_SEARCH_OU, ldap.SCOPE_SUBTREE, AUTH_LDAP_GROUP_SEARCH_FILTER -) +# AUTH_LDAP_GROUP_SEARCH_OU = CONFIG.AUTH_LDAP_GROUP_SEARCH_OU +# AUTH_LDAP_GROUP_SEARCH_FILTER = CONFIG.AUTH_LDAP_GROUP_SEARCH_FILTER +# AUTH_LDAP_GROUP_SEARCH = LDAPSearch( +# AUTH_LDAP_GROUP_SEARCH_OU, ldap.SCOPE_SUBTREE, AUTH_LDAP_GROUP_SEARCH_FILTER +# ) AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_TIMEOUT: 5 } @@ -397,10 +397,10 @@ if AUTH_OPENID: # Celery using redis as broker CELERY_BROKER_URL = 'redis://:%(password)s@%(host)s:%(port)s/%(db)s' % { - 'password': CONFIG.REDIS_PASSWORD if CONFIG.REDIS_PASSWORD else '', - 'host': CONFIG.REDIS_HOST or '127.0.0.1', - 'port': CONFIG.REDIS_PORT or 6379, - 'db': CONFIG.REDIS_DB_CELERY_BROKER or 3, + 'password': CONFIG.REDIS_PASSWORD, + 'host': CONFIG.REDIS_HOST, + 'port': CONFIG.REDIS_PORT, + 'db': CONFIG.REDIS_DB_CELERY_BROKER, } CELERY_TASK_SERIALIZER = 'pickle' CELERY_RESULT_SERIALIZER = 'pickle' diff --git a/config_example.py b/config_example.py index d907b17f7..d2255a0d9 100644 --- a/config_example.py +++ b/config_example.py @@ -72,7 +72,9 @@ class Config: # Redis配置 REDIS_HOST = '127.0.0.1' REDIS_PORT = 6379 - REDIS_PASSWORD = '' + # REDIS_PASSWORD = '' + # REDIS_DB_CELERY_BROKER = 3 + # REDIS_DB_CACHE = 4 # Use OpenID authorization # 使用OpenID 来进行认证设置