mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-01-29 21:51:31 +00:00
Merge pull request #8457 from jumpserver/pr@dev@perf_redis
perf: redis AND login page
This commit is contained in:
@@ -32,12 +32,29 @@
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hr-line-dashed {
|
||||
border-top: 1px dashed #e7eaec;
|
||||
color: #ffffff;
|
||||
background-color: #ffffff;
|
||||
height: 1px;
|
||||
margin: 20px 0;
|
||||
.form-group {
|
||||
margin-bottom: 40px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.addition .form-group, .has-error .form-group {
|
||||
margin-bottom: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.auth-methods.has-error .form-group, .auth-methods.addition .form-group {
|
||||
margin-bottom: 15px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.has-error.addition .form-group {
|
||||
margin-bottom: 20px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.auth-methods.addition.has-error .form-group {
|
||||
margin-bottom: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.login-content {
|
||||
@@ -78,34 +95,25 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.captch-field .has-error .help-block {
|
||||
.captcha-field .has-error .help-block {
|
||||
margin-top: -8px !important;
|
||||
}
|
||||
|
||||
.no-captcha-challenge .form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.jms-title {
|
||||
padding: 40px 10px 10px;
|
||||
}
|
||||
|
||||
.no-captcha-challenge .jms-title {
|
||||
padding: 60px 10px 10px;
|
||||
}
|
||||
|
||||
.no-captcha-challenge .welcome-message {
|
||||
padding-top: 10px;
|
||||
.more-login-items {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.more-login-item {
|
||||
border-right: 1px dashed #dedede;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
.more-login-item:last-child {
|
||||
border: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.select-con {
|
||||
@@ -117,6 +125,7 @@
|
||||
}
|
||||
|
||||
.login-page-language {
|
||||
font-size: 12px!important;
|
||||
margin-right: -11px !important;
|
||||
padding-top: 12px !important;
|
||||
padding-left: 0 !important;
|
||||
@@ -125,15 +134,65 @@
|
||||
font-weight: 350 !important;
|
||||
min-height: auto !important;
|
||||
}
|
||||
|
||||
.right-image {
|
||||
height: 100%;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.jms-title {
|
||||
font-size: 21px;
|
||||
font-weight:400;
|
||||
color: #151515;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
.more-methods-title {
|
||||
position: relative;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.more-methods-title:before, .more-methods-title:after {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
content: '';
|
||||
border: 1px dashed #e7eaec;
|
||||
width: 35%;
|
||||
}
|
||||
.more-methods-title:before {
|
||||
left: 0;
|
||||
}
|
||||
.more-methods-title:after {
|
||||
right: 0;
|
||||
}
|
||||
.more-methods-title.ja:before, .more-methods-title.ja:after{
|
||||
width: 26%;
|
||||
}
|
||||
.captcha-field .form-group {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.auto-login.form-group .checkbox {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.more-login {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.has-error .more-login {
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="login-content">
|
||||
<div class="login-content
|
||||
{% if form.errors or form.non_field_error %} has-error {% endif %}
|
||||
{% if auth_methods %} auth-methods {% endif %}
|
||||
{% if form.captcha or form.mfa_type or form.challenge %} addition {% endif %}
|
||||
">
|
||||
<div class="right-image-box">
|
||||
<a href="{% if not XPACK_ENABLED %}https://github.com/jumpserver/jumpserver{% endif %}">
|
||||
<img src="{{ LOGIN_IMAGE_URL }}" style="height: 100%; width: 100%"/>
|
||||
<a href="{% if not XPACK_ENABLED %}https://github.com/jumpserver/jumpserver.git{% endif %}">
|
||||
<img src="{{ LOGIN_IMAGE_URL }}" class="right-image" alt="screen-image"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="left-form-box {% if not form.challenge and not form.captcha %} no-captcha-challenge {% endif %}">
|
||||
@@ -142,26 +201,23 @@
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle login-page-language" data-toggle="dropdown" href="#" target="_blank">
|
||||
<i class="fa fa-globe fa-lg" style="margin-right: 2px"></i>
|
||||
{% if request.COOKIES.django_language == 'en' %}
|
||||
<span>English<b class="caret"></b></span>
|
||||
{% elif request.COOKIES.django_language == 'ja' %}
|
||||
<span>日本語<b class="caret"></b></span>
|
||||
{% else %}
|
||||
<span>中文(简体)<b class="caret"></b></span>
|
||||
{% endif %}
|
||||
<span>{{ current_lang.title }}<b class="caret"></b></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu profile-dropdown dropdown-menu-right">
|
||||
<li> <a id="switch_cn" href="{% url 'i18n-switch' lang='zh-hans' %}"> <span>中文(简体)</span> </a> </li>
|
||||
<li> <a id="switch_en" href="{% url 'i18n-switch' lang='en' %}"> <span>English</span> </a> </li>
|
||||
<li> <a id="switch_ja" href="{% url 'i18n-switch' lang='ja' %}"> <span>日本語</span> </a> </li>
|
||||
{% for lang in langs %}
|
||||
<li>
|
||||
<a href="{% url 'i18n-switch' lang=lang.code %}">
|
||||
<span>{{ lang.title }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="jms-title">
|
||||
<span style="font-size: 21px;font-weight:400;color: #151515;letter-spacing: 0;">{{ JMS_TITLE }}</span>
|
||||
<span style="">{{ JMS_TITLE }}</span>
|
||||
</div>
|
||||
<div class="contact-form col-md-10 col-md-offset-1">
|
||||
|
||||
<form id="login-form" action="" method="post" role="form" novalidate="novalidate">
|
||||
{% csrf_token %}
|
||||
<div style="line-height: 17px;margin-bottom: 20px;color: #999999;">
|
||||
@@ -177,7 +233,6 @@
|
||||
</div>
|
||||
|
||||
{% bootstrap_field form.username show_label=False %}
|
||||
|
||||
<div class="form-group {% if form.password.errors %} has-error {% endif %}">
|
||||
<input type="password" class="form-control" id="password" placeholder="{% trans 'Password' %}" required>
|
||||
<input id="password-hidden" type="text" style="display:none" name="{{ form.password.html_name }}">
|
||||
@@ -194,18 +249,18 @@
|
||||
{% include '_mfa_login_field.html' %}
|
||||
</div>
|
||||
{% elif form.captcha %}
|
||||
<div class="captch-field">
|
||||
<div class="captcha-field">
|
||||
{% bootstrap_field form.captcha show_label=False %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-group" style="padding-top: 5px; margin-bottom: 10px">
|
||||
<div class="form-group auto-login" style="margin-bottom: 10px">
|
||||
<div class="row">
|
||||
<div class="col-md-6" style="text-align: left">
|
||||
{% if form.auto_login %}
|
||||
{% bootstrap_field form.auto_login form_group_class='' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-6" style="line-height: 25px">
|
||||
<a id="forgot_password" href="{{ forgot_password_url }}" style="float: right">
|
||||
<small>{% trans 'Forgot password' %}?</small>
|
||||
</a>
|
||||
@@ -213,18 +268,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="">
|
||||
<button type="submit" class="btn btn-transparent" onclick="doLogin();return false;">{% trans 'Login' %}</button>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-transparent" onclick="doLogin();return false;">
|
||||
{% trans 'Login' %}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="more-login">
|
||||
{% if auth_methods %}
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div style="display: inline-block; float: left">
|
||||
<b class="text-muted text-left" >{% trans "More login options" %}</b>
|
||||
<div class="more-methods-title {{ current_lang.code }}">
|
||||
{% trans "More login options" %}
|
||||
</div>
|
||||
<div class="more-login-items">
|
||||
{% for method in auth_methods %}
|
||||
<a href="{{ method.url }}" class="more-login-item">
|
||||
<i class="fa"><img src="{{ method.logo }}" height="13" width="13"></i> {{ method.name }}
|
||||
<i class="fa"><img src="{{ method.logo }}" height="15" width="15"></i> {{ method.name }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@@ -10,8 +10,7 @@ from django.contrib.auth import login as auth_login, logout as auth_logout
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import reverse, redirect
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.db import transaction
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import ugettext as _, get_language
|
||||
from django.views.decorators.cache import never_cache
|
||||
from django.views.decorators.csrf import csrf_protect
|
||||
from django.views.decorators.debug import sensitive_post_parameters
|
||||
@@ -181,6 +180,29 @@ class UserLoginView(mixins.AuthMixin, FormView):
|
||||
]
|
||||
return [method for method in auth_methods if method['enabled']]
|
||||
|
||||
@staticmethod
|
||||
def get_support_langs():
|
||||
langs = [
|
||||
{
|
||||
'title': '中文(简体)',
|
||||
'code': 'zh-hans'
|
||||
},
|
||||
{
|
||||
'title': 'English',
|
||||
'code': 'en'
|
||||
},
|
||||
{
|
||||
'title': '日本語',
|
||||
'code': 'ja'
|
||||
}
|
||||
]
|
||||
return langs
|
||||
|
||||
def get_current_lang(self):
|
||||
langs = self.get_support_langs()
|
||||
matched_lang = filter(lambda x: x['code'] == get_language(), langs)
|
||||
return next(matched_lang, langs[0])
|
||||
|
||||
@staticmethod
|
||||
def get_forgot_password_url():
|
||||
forgot_password_url = reverse('authentication:forgot-password')
|
||||
@@ -188,14 +210,16 @@ class UserLoginView(mixins.AuthMixin, FormView):
|
||||
return forgot_password_url
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = {
|
||||
context = super().get_context_data(**kwargs)
|
||||
context.update({
|
||||
'demo_mode': os.environ.get("DEMO_MODE"),
|
||||
'auth_methods': self.get_support_auth_methods(),
|
||||
'langs': self.get_support_langs(),
|
||||
'current_lang': self.get_current_lang(),
|
||||
'forgot_password_url': self.get_forgot_password_url(),
|
||||
**self.get_user_mfa_context(self.request.user)
|
||||
}
|
||||
kwargs.update(context)
|
||||
return super().get_context_data(**kwargs)
|
||||
})
|
||||
return context
|
||||
|
||||
|
||||
class UserLoginGuardView(mixins.AuthMixin, RedirectView):
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from channels.auth import AuthMiddlewareStack
|
||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
from ops.urls.ws_urls import urlpatterns as ops_urlpatterns
|
||||
from notifications.urls.ws_urls import urlpatterns as notifications_urlpatterns
|
||||
@@ -12,4 +13,5 @@ application = ProtocolTypeRouter({
|
||||
'websocket': AuthMiddlewareStack(
|
||||
URLRouter(urlpatterns)
|
||||
),
|
||||
"http": get_asgi_application(),
|
||||
})
|
||||
|
||||
@@ -11,10 +11,19 @@ from django.urls import reverse_lazy
|
||||
from .. import const
|
||||
from ..const import CONFIG
|
||||
|
||||
|
||||
def exist_or_default(path, default):
|
||||
if not os.path.exists(path):
|
||||
path = default
|
||||
return path
|
||||
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
VERSION = const.VERSION
|
||||
BASE_DIR = const.BASE_DIR
|
||||
PROJECT_DIR = const.PROJECT_DIR
|
||||
DATA_DIR = os.path.join(PROJECT_DIR, 'data')
|
||||
CERTS_DIR = os.path.join(DATA_DIR, 'certs')
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
|
||||
@@ -148,19 +157,7 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
||||
# 自定义的配置,SESSION_EXPIRE_AT_BROWSER_CLOSE 始终为 True, 下面这个来控制是否强制关闭后过期 cookie
|
||||
SESSION_EXPIRE_AT_BROWSER_CLOSE_FORCE = CONFIG.SESSION_EXPIRE_AT_BROWSER_CLOSE_FORCE
|
||||
SESSION_SAVE_EVERY_REQUEST = CONFIG.SESSION_SAVE_EVERY_REQUEST
|
||||
SESSION_ENGINE = 'jumpserver.rewriting.session'
|
||||
SESSION_REDIS = {
|
||||
'url': '%(protocol)s://:%(password)s@%(host)s:%(port)s/%(db)s' % {
|
||||
'protocol': 'rediss' if CONFIG.REDIS_USE_SSL else 'redis',
|
||||
'password': CONFIG.REDIS_PASSWORD,
|
||||
'host': CONFIG.REDIS_HOST,
|
||||
'port': CONFIG.REDIS_PORT,
|
||||
'db': CONFIG.REDIS_DB_CACHE,
|
||||
},
|
||||
'prefix': 'auth_session',
|
||||
'socket_timeout': 1,
|
||||
'retry_on_timeout': False
|
||||
}
|
||||
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
|
||||
|
||||
MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'
|
||||
# Database
|
||||
@@ -180,7 +177,6 @@ DATABASES = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DB_CA_PATH = os.path.join(PROJECT_DIR, 'data', 'certs', 'db_ca.pem')
|
||||
if CONFIG.DB_ENGINE.lower() == 'mysql':
|
||||
DB_OPTIONS['init_command'] = "SET sql_mode='STRICT_TRANS_TABLES'"
|
||||
@@ -264,45 +260,40 @@ FILE_UPLOAD_PERMISSIONS = 0o644
|
||||
FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o755
|
||||
|
||||
# Cache use redis
|
||||
REDIS_SSL_KEYFILE = os.path.join(PROJECT_DIR, 'data', 'certs', 'redis_client.key')
|
||||
if not os.path.exists(REDIS_SSL_KEYFILE):
|
||||
REDIS_SSL_KEYFILE = None
|
||||
|
||||
REDIS_SSL_CERTFILE = os.path.join(PROJECT_DIR, 'data', 'certs', 'redis_client.crt')
|
||||
if not os.path.exists(REDIS_SSL_CERTFILE):
|
||||
REDIS_SSL_CERTFILE = None
|
||||
|
||||
REDIS_SSL_CA_CERTS = os.path.join(PROJECT_DIR, 'data', 'certs', 'redis_ca.crt')
|
||||
if not os.path.exists(REDIS_SSL_CA_CERTS):
|
||||
REDIS_SSL_CA_CERTS = os.path.join(PROJECT_DIR, 'data', 'certs', 'redis_ca.pem')
|
||||
|
||||
if not os.path.exists(REDIS_SSL_CA_CERTS):
|
||||
REDIS_SSL_CA_CERTS = None
|
||||
|
||||
REDIS_SSL_KEYFILE = exist_or_default(os.path.join(CERTS_DIR, 'redis_client.key'), None)
|
||||
REDIS_SSL_CERTFILE = exist_or_default(os.path.join(CERTS_DIR, 'redis_client.crt'), None)
|
||||
REDIS_SSL_CA_CERTS = exist_or_default(os.path.join(CERTS_DIR, 'redis_ca.pem'), None)
|
||||
REDIS_SSL_CA_CERTS = exist_or_default(os.path.join(CERTS_DIR, 'redis_ca.crt'), REDIS_SSL_CA_CERTS)
|
||||
REDIS_SSL_REQUIRED = CONFIG.REDIS_SSL_REQUIRED or 'none'
|
||||
REDIS_LOCATION_NO_DB = '%(protocol)s://:%(password)s@%(host)s:%(port)s/{}' % {
|
||||
'protocol': 'rediss' if CONFIG.REDIS_USE_SSL else 'redis',
|
||||
'password': CONFIG.REDIS_PASSWORD,
|
||||
'host': CONFIG.REDIS_HOST,
|
||||
'port': CONFIG.REDIS_PORT,
|
||||
}
|
||||
|
||||
CACHES = {
|
||||
'default': {
|
||||
# 'BACKEND': 'redis_cache.RedisCache',
|
||||
'BACKEND': 'redis_lock.django_cache.RedisCache',
|
||||
'LOCATION': '%(protocol)s://:%(password)s@%(host)s:%(port)s/%(db)s' % {
|
||||
'protocol': 'rediss' if CONFIG.REDIS_USE_SSL else 'redis',
|
||||
'password': CONFIG.REDIS_PASSWORD,
|
||||
'host': CONFIG.REDIS_HOST,
|
||||
'port': CONFIG.REDIS_PORT,
|
||||
'db': CONFIG.REDIS_DB_CACHE,
|
||||
},
|
||||
'OPTIONS': {
|
||||
"REDIS_CLIENT_KWARGS": {"health_check_interval": 30},
|
||||
"CONNECTION_POOL_KWARGS": {
|
||||
'ssl_cert_reqs': REDIS_SSL_REQUIRED,
|
||||
"ssl_keyfile": REDIS_SSL_KEYFILE,
|
||||
"ssl_certfile": REDIS_SSL_CERTFILE,
|
||||
"ssl_ca_certs": REDIS_SSL_CA_CERTS
|
||||
} if CONFIG.REDIS_USE_SSL else {}
|
||||
}
|
||||
REDIS_CACHE_DEFAULT = {
|
||||
'BACKEND': 'redis_lock.django_cache.RedisCache',
|
||||
'LOCATION': REDIS_LOCATION_NO_DB.format(CONFIG.REDIS_DB_CACHE),
|
||||
'OPTIONS': {
|
||||
"REDIS_CLIENT_KWARGS": {"health_check_interval": 30},
|
||||
"CONNECTION_POOL_KWARGS": {
|
||||
'ssl_cert_reqs': REDIS_SSL_REQUIRED,
|
||||
"ssl_keyfile": REDIS_SSL_KEYFILE,
|
||||
"ssl_certfile": REDIS_SSL_CERTFILE,
|
||||
"ssl_ca_certs": REDIS_SSL_CA_CERTS
|
||||
} if CONFIG.REDIS_USE_SSL else {}
|
||||
}
|
||||
}
|
||||
REDIS_CACHE_SESSION = dict(REDIS_CACHE_DEFAULT)
|
||||
REDIS_CACHE_SESSION['LOCATION'] = REDIS_LOCATION_NO_DB.format(CONFIG.REDIS_DB_SESSION)
|
||||
|
||||
CACHES = {
|
||||
'default': REDIS_CACHE_DEFAULT,
|
||||
'session': REDIS_CACHE_SESSION
|
||||
}
|
||||
|
||||
SESSION_CACHE_ALIAS = "session"
|
||||
|
||||
FORCE_SCRIPT_NAME = CONFIG.FORCE_SCRIPT_NAME
|
||||
SESSION_COOKIE_SECURE = CONFIG.SESSION_COOKIE_SECURE
|
||||
|
||||
@@ -6,6 +6,7 @@ import ssl
|
||||
from .base import REDIS_SSL_CA_CERTS, REDIS_SSL_CERTFILE, REDIS_SSL_KEYFILE, REDIS_SSL_REQUIRED
|
||||
from ..const import CONFIG, PROJECT_DIR
|
||||
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
# Use Django's standard `django.contrib.auth` permissions,
|
||||
# or allow read-only access for unauthenticated users.
|
||||
@@ -14,7 +15,6 @@ REST_FRAMEWORK = {
|
||||
),
|
||||
'DEFAULT_RENDERER_CLASSES': (
|
||||
'rest_framework.renderers.JSONRenderer',
|
||||
# 'rest_framework.renderers.BrowsableAPIRenderer',
|
||||
'common.drf.renders.CSVFileRenderer',
|
||||
'common.drf.renders.ExcelFileRenderer',
|
||||
|
||||
@@ -47,9 +47,6 @@ REST_FRAMEWORK = {
|
||||
'DATETIME_INPUT_FORMATS': ['%Y/%m/%d %H:%M:%S %z', 'iso-8601', '%Y-%m-%d %H:%M:%S %z'],
|
||||
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
|
||||
'EXCEPTION_HANDLER': 'common.drf.exc_handlers.common_exception_handler',
|
||||
# 'PAGE_SIZE': 100,
|
||||
# 'MAX_PAGE_SIZE': 5000
|
||||
|
||||
}
|
||||
|
||||
SWAGGER_SETTINGS = {
|
||||
@@ -67,7 +64,7 @@ SWAGGER_SETTINGS = {
|
||||
|
||||
|
||||
# Captcha settings, more see https://django-simple-captcha.readthedocs.io/en/latest/advanced.html
|
||||
CAPTCHA_IMAGE_SIZE = (140, 34)
|
||||
CAPTCHA_IMAGE_SIZE = (180, 38)
|
||||
CAPTCHA_FOREGROUND_COLOR = '#001100'
|
||||
CAPTCHA_NOISE_FUNCTIONS = ('captcha.helpers.noise_dots',)
|
||||
CAPTCHA_CHALLENGE_FUNCT = 'captcha.helpers.math_challenge'
|
||||
@@ -127,18 +124,13 @@ CELERY_RESULT_SERIALIZER = 'pickle'
|
||||
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
|
||||
CELERY_ACCEPT_CONTENT = ['json', 'pickle']
|
||||
CELERY_RESULT_EXPIRES = 600
|
||||
# CELERY_WORKER_LOG_FORMAT = '%(asctime)s [%(module)s %(levelname)s] %(message)s'
|
||||
# CELERY_WORKER_LOG_FORMAT = '%(message)s'
|
||||
# CELERY_WORKER_TASK_LOG_FORMAT = '%(task_id)s %(task_name)s %(message)s'
|
||||
CELERY_WORKER_TASK_LOG_FORMAT = '%(message)s'
|
||||
# CELERY_WORKER_LOG_FORMAT = '%(asctime)s [%(module)s %(levelname)s] %(message)s'
|
||||
CELERY_WORKER_LOG_FORMAT = '%(message)s'
|
||||
CELERY_TASK_EAGER_PROPAGATES = True
|
||||
CELERY_WORKER_REDIRECT_STDOUTS = True
|
||||
CELERY_WORKER_REDIRECT_STDOUTS_LEVEL = "INFO"
|
||||
# CELERY_WORKER_HIJACK_ROOT_LOGGER = True
|
||||
# CELERY_WORKER_MAX_TASKS_PER_CHILD = 40
|
||||
CELERY_TASK_SOFT_TIME_LIMIT = 3600
|
||||
|
||||
if CONFIG.REDIS_USE_SSL:
|
||||
CELERY_BROKER_USE_SSL = CELERY_REDIS_BACKEND_USE_SSL = {
|
||||
'ssl_cert_reqs': REDIS_SSL_REQUIRED,
|
||||
|
||||
@@ -2298,7 +2298,7 @@ msgstr "登录"
|
||||
|
||||
#: authentication/templates/authentication/login.html:224
|
||||
msgid "More login options"
|
||||
msgstr "更多登录方式"
|
||||
msgstr "其他方式登录"
|
||||
|
||||
#: authentication/templates/authentication/login_mfa.html:6
|
||||
msgid "MFA Auth"
|
||||
|
||||
@@ -5,5 +5,5 @@ from .. import ws
|
||||
app_name = 'notifications'
|
||||
|
||||
urlpatterns = [
|
||||
path('ws/notifications/site-msg/', ws.SiteMsgWebsocket, name='site-msg-ws'),
|
||||
]
|
||||
path('ws/notifications/site-msg/', ws.SiteMsgWebsocket.as_asgi(), name='site-msg-ws'),
|
||||
]
|
||||
|
||||
@@ -5,5 +5,5 @@ from .. import ws
|
||||
app_name = 'ops'
|
||||
|
||||
urlpatterns = [
|
||||
path('ws/ops/tasks/log/', ws.TaskLogWebsocket, name='task-log-ws'),
|
||||
path('ws/ops/tasks/log/', ws.TaskLogWebsocket.as_asgi(), name='task-log-ws'),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user