From 6035d1f130efaa3ba845c6620876c64343bba615 Mon Sep 17 00:00:00 2001 From: chnliyong Date: Sat, 10 Mar 2018 10:46:28 +0800 Subject: [PATCH 1/3] python-gssapi libkrb5-dev for gssapi/gssapi.h --- requirements/deb_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/deb_requirements.txt b/requirements/deb_requirements.txt index a0ddb7642..f4131a3ea 100644 --- a/requirements/deb_requirements.txt +++ b/requirements/deb_requirements.txt @@ -1 +1 @@ -libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk python-dev openssl libssl-dev libldap2-dev libsasl2-dev sqlite gcc automake +libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk python-dev openssl libssl-dev libldap2-dev libsasl2-dev sqlite gcc automake libkrb5-dev From 4fd83bd5be712dbe4b152137f052d50245062323 Mon Sep 17 00:00:00 2001 From: Nidhoggur1993 Date: Tue, 3 Apr 2018 16:02:51 +0800 Subject: [PATCH 2/3] Update make_migrations.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加自动合并而不是在弹出warning结束 --- utils/make_migrations.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/make_migrations.sh b/utils/make_migrations.sh index fdf1f6efb..b6068a1ca 100755 --- a/utils/make_migrations.sh +++ b/utils/make_migrations.sh @@ -4,3 +4,5 @@ python3 ../apps/manage.py makemigrations python3 ../apps/manage.py migrate + +python3 ../apps/manage.py makemigrations –merge From a2f23e96819a755d5e2d31a3f43c5299b9681e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E5=BF=97=E8=89=B3?= Date: Fri, 8 Jun 2018 11:01:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=96=B0=E5=A2=9ERedis=20DB=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/settings.py | 6 ++++-- config_example.py | 24 +++++++++++++----------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index 6fd9f0fdd..c8ed1505e 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -343,10 +343,11 @@ if AUTH_LDAP: AUTHENTICATION_BACKENDS.insert(0, AUTH_LDAP_BACKEND) # Celery using redis as broker -CELERY_BROKER_URL = 'redis://:%(password)s@%(host)s:%(port)s/3' % { +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, } CELERY_TASK_SERIALIZER = 'pickle' CELERY_RESULT_SERIALIZER = 'pickle' @@ -367,10 +368,11 @@ CELERY_WORKER_HIJACK_ROOT_LOGGER = False CACHES = { 'default': { 'BACKEND': 'redis_cache.RedisCache', - 'LOCATION': 'redis://:%(password)s@%(host)s:%(port)s/4' % { + 'LOCATION': '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_CACHE or 4, } } } diff --git a/config_example.py b/config_example.py index 0c8d87094..a96f0d7c9 100644 --- a/config_example.py +++ b/config_example.py @@ -21,10 +21,10 @@ class Config: ALLOWED_HOSTS = ['*'] # Development env open this, when error occur display the full process track, Production disable it - DEBUG = True + DEBUG = os.environ.get("DEBUG") or True # DEBUG, INFO, WARNING, ERROR, CRITICAL can set. See https://docs.djangoproject.com/en/1.10/topics/logging/ - LOG_LEVEL = 'DEBUG' + LOG_LEVEL = os.environ.get("LOG_LEVEL") or 'DEBUG' LOG_DIR = os.path.join(BASE_DIR, 'logs') # Database setting, Support sqlite3, mysql, postgres .... @@ -35,12 +35,12 @@ class Config: DB_NAME = os.path.join(BASE_DIR, 'data', 'db.sqlite3') # MySQL or postgres setting like: - # DB_ENGINE = 'mysql' - # DB_HOST = '127.0.0.1' - # DB_PORT = 3306 - # DB_USER = 'root' - # DB_PASSWORD = '' - # DB_NAME = 'jumpserver' + # DB_ENGINE = os.environ.get("DB_ENGINE") or 'mysql' + # DB_HOST = os.environ.get("DB_HOST") or '127.0.0.1' + # DB_PORT = os.environ.get("DB_PORT") or 3306 + # DB_USER = os.environ.get("DB_USER") or 'jumpserver' + # DB_PASSWORD = os.environ.get("DB_PASSWORD") or 'weakPassword' + # DB_NAME = os.environ.get("DB_NAME") or 'jumpserver' # When Django start it will bind this host and port # ./manage.py runserver 127.0.0.1:8080 @@ -48,9 +48,11 @@ class Config: HTTP_LISTEN_PORT = 8080 # Use Redis as broker for celery and web socket - REDIS_HOST = '127.0.0.1' - REDIS_PORT = 6379 - REDIS_PASSWORD = '' + REDIS_HOST = os.environ.get("REDIS_HOST") or '127.0.0.1' + REDIS_PORT = os.environ.get("REDIS_PORT") or 6379 + REDIS_PASSWORD = os.environ.get("REDIS_PASSWORD") or '' + REDIS_DB_CELERY = os.environ.get('REDIS_DB') or 3 + REDIS_DB_CACHE = os.environ.get('REDIS_DB') or 4 def __init__(self): pass