feat: 支持修改忘记密码重置密码的连接 (#5700)

perf: 优化代码暗示

Co-authored-by: ibuler <ibuler@qq.com>
pull/5717/head
fit2bot 2021-03-10 11:21:12 +08:00 committed by GitHub
parent 81170b4b7b
commit 7b2f813e7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 122 additions and 104 deletions

View File

@ -163,7 +163,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<a id="forgot_password" href="{% url 'authentication:forgot-password' %}" style="float: right"> <a id="forgot_password" href="{{ forgot_password_url }}" style="float: right">
<small>{% trans 'Forgot password' %}?</small> <small>{% trans 'Forgot password' %}?</small>
</a> </a>
</div> </div>

View File

@ -100,11 +100,17 @@ class UserLoginView(mixins.AuthMixin, FormView):
self.request.session[RSA_PRIVATE_KEY] = rsa_private_key self.request.session[RSA_PRIVATE_KEY] = rsa_private_key
self.request.session[RSA_PUBLIC_KEY] = rsa_public_key self.request.session[RSA_PUBLIC_KEY] = rsa_public_key
forgot_password_url = reverse('authentication:forgot-password')
has_other_auth_backend = settings.AUTHENTICATION_BACKENDS[0] != settings.AUTH_BACKEND_MODEL
if has_other_auth_backend and settings.FORGOT_PASSWORD_URL:
forgot_password_url = settings.FORGOT_PASSWORD_URL
context = { context = {
'demo_mode': os.environ.get("DEMO_MODE"), 'demo_mode': os.environ.get("DEMO_MODE"),
'AUTH_OPENID': settings.AUTH_OPENID, 'AUTH_OPENID': settings.AUTH_OPENID,
'AUTH_CAS': settings.AUTH_CAS, 'AUTH_CAS': settings.AUTH_CAS,
'rsa_public_key': rsa_public_key, 'rsa_public_key': rsa_public_key,
'forgot_password_url': forgot_password_url
} }
kwargs.update(context) kwargs.update(context)
return super().get_context_data(**kwargs) return super().get_context_data(**kwargs)

View File

@ -287,6 +287,7 @@ class Config(dict):
'DISK_CHECK_ENABLED': True, 'DISK_CHECK_ENABLED': True,
'SESSION_SAVE_EVERY_REQUEST': True, 'SESSION_SAVE_EVERY_REQUEST': True,
'SESSION_EXPIRE_AT_BROWSER_CLOSE_FORCE': False, 'SESSION_EXPIRE_AT_BROWSER_CLOSE_FORCE': False,
'FORGOT_PASSWORD_URL': '',
} }
def compatible_auth_openid_of_key(self): def compatible_auth_openid_of_key(self):

View File

@ -14,7 +14,7 @@ def jumpserver_processor(request):
'LOGIN_IMAGE_URL': static('img/login_image.png'), 'LOGIN_IMAGE_URL': static('img/login_image.png'),
'FAVICON_URL': static('img/facio.ico'), 'FAVICON_URL': static('img/facio.ico'),
'LOGIN_CAS_LOGO_URL': static('img/login_cas_logo.png'), 'LOGIN_CAS_LOGO_URL': static('img/login_cas_logo.png'),
'JMS_TITLE': _('JumpServer Open Source PAM'), 'JMS_TITLE': _('JumpServer Open Source Bastion Host'),
'VERSION': settings.VERSION, 'VERSION': settings.VERSION,
'COPYRIGHT': 'FIT2CLOUD 飞致云' + ' © 2014-2021', 'COPYRIGHT': 'FIT2CLOUD 飞致云' + ' © 2014-2021',
'SECURITY_COMMAND_EXECUTION': settings.SECURITY_COMMAND_EXECUTION, 'SECURITY_COMMAND_EXECUTION': settings.SECURITY_COMMAND_EXECUTION,

View File

@ -127,7 +127,7 @@ if AUTH_OPENID:
if AUTH_RADIUS: if AUTH_RADIUS:
AUTHENTICATION_BACKENDS.insert(0, AUTH_BACKEND_RADIUS) AUTHENTICATION_BACKENDS.insert(0, AUTH_BACKEND_RADIUS)
if AUTH_SSO: if AUTH_SSO:
AUTHENTICATION_BACKENDS.insert(0, AUTH_BACKEND_SSO) AUTHENTICATION_BACKENDS.append(AUTH_BACKEND_SSO)
ONLY_ALLOW_EXIST_USER_AUTH = CONFIG.ONLY_ALLOW_EXIST_USER_AUTH ONLY_ALLOW_EXIST_USER_AUTH = CONFIG.ONLY_ALLOW_EXIST_USER_AUTH

View File

@ -118,4 +118,5 @@ REFERER_CHECK_ENABLED = CONFIG.REFERER_CHECK_ENABLED
CONNECTION_TOKEN_ENABLED = CONFIG.CONNECTION_TOKEN_ENABLED CONNECTION_TOKEN_ENABLED = CONFIG.CONNECTION_TOKEN_ENABLED
DISK_CHECK_ENABLED = CONFIG.DISK_CHECK_ENABLED DISK_CHECK_ENABLED = CONFIG.DISK_CHECK_ENABLED
FORGOT_PASSWORD_URL = CONFIG.FORGOT_PASSWORD_URL

Binary file not shown.

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: JumpServer 0.3.3\n" "Project-Id-Version: JumpServer 0.3.3\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-09 10:09+0800\n" "POT-Creation-Date: 2021-03-10 11:16+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n" "Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\n" "Language-Team: JumpServer team<ibuler@qq.com>\n"
@ -182,8 +182,8 @@ msgstr "用户名"
#: applications/serializers/attrs/application_type/vmware_client.py:30 #: applications/serializers/attrs/application_type/vmware_client.py:30
#: assets/models/base.py:252 assets/serializers/asset_user.py:71 #: assets/models/base.py:252 assets/serializers/asset_user.py:71
#: audits/signals_handler.py:46 authentication/forms.py:22 #: audits/signals_handler.py:46 authentication/forms.py:22
#: authentication/templates/authentication/login.html:149 #: authentication/templates/authentication/login.html:148
#: settings/serializers/settings.py:84 users/forms/profile.py:21 #: settings/serializers/settings.py:89 users/forms/profile.py:21
#: users/templates/users/user_otp_check_password.html:13 #: users/templates/users/user_otp_check_password.html:13
#: users/templates/users/user_password_update.html:43 #: users/templates/users/user_password_update.html:43
#: users/templates/users/user_password_verify.html:18 #: users/templates/users/user_password_verify.html:18
@ -207,7 +207,7 @@ msgstr "目标URL"
#: applications/serializers/attrs/application_type/mysql_workbench.py:18 #: applications/serializers/attrs/application_type/mysql_workbench.py:18
#: assets/models/asset.py:183 assets/models/domain.py:52 #: assets/models/asset.py:183 assets/models/domain.py:52
#: assets/serializers/asset_user.py:46 settings/serializers/settings.py:103 #: assets/serializers/asset_user.py:46 settings/serializers/settings.py:108
#: users/templates/users/_granted_assets.html:26 #: users/templates/users/_granted_assets.html:26
#: users/templates/users/user_asset_permission.html:156 #: users/templates/users/user_asset_permission.html:156
msgid "IP" msgid "IP"
@ -263,7 +263,7 @@ msgid "Platform"
msgstr "系统平台" msgstr "系统平台"
#: assets/models/asset.py:184 assets/serializers/asset_user.py:45 #: assets/models/asset.py:184 assets/serializers/asset_user.py:45
#: assets/serializers/gathered_user.py:20 settings/serializers/settings.py:102 #: assets/serializers/gathered_user.py:20 settings/serializers/settings.py:107
#: users/templates/users/_granted_assets.html:25 #: users/templates/users/_granted_assets.html:25
#: users/templates/users/user_asset_permission.html:157 #: users/templates/users/user_asset_permission.html:157
msgid "Hostname" msgid "Hostname"
@ -1286,11 +1286,11 @@ msgstr "登录复核 {}"
msgid "SSO auth closed" msgid "SSO auth closed"
msgstr "SSO 认证关闭了" msgstr "SSO 认证关闭了"
#: authentication/errors.py:220 authentication/views/login.py:219 #: authentication/errors.py:220 authentication/views/login.py:232
msgid "Your password is too simple, please change it for security" msgid "Your password is too simple, please change it for security"
msgstr "你的密码过于简单,为了安全,请修改" msgstr "你的密码过于简单,为了安全,请修改"
#: authentication/errors.py:229 authentication/views/login.py:234 #: authentication/errors.py:229 authentication/views/login.py:247
msgid "Your password has expired, please reset before logging in" msgid "Your password has expired, please reset before logging in"
msgstr "您的密码已过期,先修改再登录" msgstr "您的密码已过期,先修改再登录"
@ -1412,34 +1412,30 @@ msgstr "确认"
msgid "Code error" msgid "Code error"
msgstr "代码错误" msgstr "代码错误"
#: authentication/templates/authentication/login.html:137 #: authentication/templates/authentication/login.html:141
msgid "Captcha invalid"
msgstr "验证码错误"
#: authentication/templates/authentication/login.html:142
msgid "Welcome back, please enter username and password to login" msgid "Welcome back, please enter username and password to login"
msgstr "欢迎回来,请输入用户名和密码登录" msgstr "欢迎回来,请输入用户名和密码登录"
#: authentication/templates/authentication/login.html:168 #: authentication/templates/authentication/login.html:167
#: users/templates/users/forgot_password.html:7 #: users/templates/users/forgot_password.html:15
#: users/templates/users/forgot_password.html:8 #: users/templates/users/forgot_password.html:16
msgid "Forgot password" msgid "Forgot password"
msgstr "忘记密码" msgstr "忘记密码"
#: authentication/templates/authentication/login.html:175 #: authentication/templates/authentication/login.html:174
#: templates/_header_bar.html:83 #: templates/_header_bar.html:83
msgid "Login" msgid "Login"
msgstr "登录" msgstr "登录"
#: authentication/templates/authentication/login.html:182 #: authentication/templates/authentication/login.html:181
msgid "More login options" msgid "More login options"
msgstr "更多登录方式" msgstr "更多登录方式"
#: authentication/templates/authentication/login.html:185 #: authentication/templates/authentication/login.html:184
msgid "OpenID" msgid "OpenID"
msgstr "OpenID" msgstr "OpenID"
#: authentication/templates/authentication/login.html:190 #: authentication/templates/authentication/login.html:189
msgid "CAS" msgid "CAS"
msgstr "" msgstr ""
@ -1485,7 +1481,7 @@ msgstr "复制成功"
msgid "Please enable cookies and try again." msgid "Please enable cookies and try again."
msgstr "设置你的浏览器支持cookie" msgstr "设置你的浏览器支持cookie"
#: authentication/views/login.py:165 #: authentication/views/login.py:178
msgid "" msgid ""
"Wait for <b>{}</b> confirm, You also can copy link to her/him <br/>\n" "Wait for <b>{}</b> confirm, You also can copy link to her/him <br/>\n"
" Don't close this page" " Don't close this page"
@ -1493,19 +1489,19 @@ msgstr ""
"等待 <b>{}</b> 确认, 你也可以复制链接发给他/她 <br/>\n" "等待 <b>{}</b> 确认, 你也可以复制链接发给他/她 <br/>\n"
" 不要关闭本页面" " 不要关闭本页面"
#: authentication/views/login.py:170 #: authentication/views/login.py:183
msgid "No ticket found" msgid "No ticket found"
msgstr "没有发现工单" msgstr "没有发现工单"
#: authentication/views/login.py:202 #: authentication/views/login.py:215
msgid "Logout success" msgid "Logout success"
msgstr "退出登录成功" msgstr "退出登录成功"
#: authentication/views/login.py:203 #: authentication/views/login.py:216
msgid "Logout success, return login page" msgid "Logout success, return login page"
msgstr "退出登录成功,返回到登录页面" msgstr "退出登录成功,返回到登录页面"
#: authentication/views/login.py:218 authentication/views/login.py:233 #: authentication/views/login.py:231 authentication/views/login.py:246
msgid "Please change your password" msgid "Please change your password"
msgstr "请修改密码" msgstr "请修改密码"
@ -1524,10 +1520,8 @@ msgid "Updated by"
msgstr "更新人" msgstr "更新人"
#: common/drf/exc_handlers.py:25 #: common/drf/exc_handlers.py:25
#, fuzzy
#| msgid "Reject"
msgid "Object" msgid "Object"
msgstr "拒绝" msgstr "对象"
#: common/drf/parsers/base.py:17 #: common/drf/parsers/base.py:17
msgid "The file content overflowed (The maximum length `{}` bytes)" msgid "The file content overflowed (The maximum length `{}` bytes)"
@ -1607,7 +1601,7 @@ msgid "Should not contains special characters"
msgstr "不能包含特殊字符" msgstr "不能包含特殊字符"
#: jumpserver/context_processor.py:17 #: jumpserver/context_processor.py:17
msgid "JumpServer Open Source PAM" msgid "JumpServer Open Source Bastion Host"
msgstr "JumpServer 开源堡垒机" msgstr "JumpServer 开源堡垒机"
#: jumpserver/views/celery_flower.py:23 #: jumpserver/views/celery_flower.py:23
@ -1854,7 +1848,7 @@ msgstr "应用程序"
msgid "Application permission" msgid "Application permission"
msgstr "应用管理" msgstr "应用管理"
#: perms/models/asset_permission.py:37 settings/serializers/settings.py:107 #: perms/models/asset_permission.py:37 settings/serializers/settings.py:112
msgid "All" msgid "All"
msgstr "全部" msgstr "全部"
@ -1955,7 +1949,7 @@ msgstr "邮件已经发送{}, 请检查"
#: settings/api/common.py:110 xpack/plugins/interface/api.py:18 #: settings/api/common.py:110 xpack/plugins/interface/api.py:18
#: xpack/plugins/interface/models.py:36 #: xpack/plugins/interface/models.py:36
msgid "Welcome to the JumpServer open source fortress" msgid "Welcome to the JumpServer open source Bastion Host"
msgstr "欢迎使用JumpServer开源堡垒机" msgstr "欢迎使用JumpServer开源堡垒机"
#: settings/api/ldap.py:189 #: settings/api/ldap.py:189
@ -1987,130 +1981,142 @@ msgstr "用户向导URL"
msgid "User first login update profile done redirect to it" msgid "User first login update profile done redirect to it"
msgstr "用户第一次登录修改profile后重定向到地址, 可以是 wiki 或 其他说明文档" msgstr "用户第一次登录修改profile后重定向到地址, 可以是 wiki 或 其他说明文档"
#: settings/serializers/settings.py:27 #: settings/serializers/settings.py:23
msgid "Forgot password url"
msgstr "忘记密码URL"
#: settings/serializers/settings.py:24
msgid ""
"The forgot password url on login page, If you use ldap or cas external "
"authentication, you can set it"
msgstr ""
"登录页面忘记密码URL, 如果使用了 LDAP, OPENID 等外部认证系统,可以自定义用户重"
"置密码访问的地址"
#: settings/serializers/settings.py:32
msgid "SMTP host" msgid "SMTP host"
msgstr "SMTP 主机" msgstr "SMTP 主机"
#: settings/serializers/settings.py:28 #: settings/serializers/settings.py:33
msgid "SMTP port" msgid "SMTP port"
msgstr "SMTP 端口" msgstr "SMTP 端口"
#: settings/serializers/settings.py:29 #: settings/serializers/settings.py:34
msgid "SMTP account" msgid "SMTP account"
msgstr "SMTP 账号" msgstr "SMTP 账号"
#: settings/serializers/settings.py:31 #: settings/serializers/settings.py:36
msgid "SMTP password" msgid "SMTP password"
msgstr "SMTP 密码" msgstr "SMTP 密码"
#: settings/serializers/settings.py:32 #: settings/serializers/settings.py:37
msgid "Tips: Some provider use token except password" msgid "Tips: Some provider use token except password"
msgstr "提示:一些邮件提供商需要输入的是授权码" msgstr "提示:一些邮件提供商需要输入的是授权码"
#: settings/serializers/settings.py:35 #: settings/serializers/settings.py:40
msgid "Send user" msgid "Send user"
msgstr "发件人" msgstr "发件人"
#: settings/serializers/settings.py:36 #: settings/serializers/settings.py:41
msgid "Tips: Send mail account, default SMTP account as the send account" msgid "Tips: Send mail account, default SMTP account as the send account"
msgstr "提示:发送邮件账号,默认使用 SMTP 账号作为发送账号" msgstr "提示:发送邮件账号,默认使用 SMTP 账号作为发送账号"
#: settings/serializers/settings.py:39 #: settings/serializers/settings.py:44
msgid "Test recipient" msgid "Test recipient"
msgstr "测试收件人" msgstr "测试收件人"
#: settings/serializers/settings.py:40 #: settings/serializers/settings.py:45
msgid "Tips: Used only as a test mail recipient" msgid "Tips: Used only as a test mail recipient"
msgstr "提示:仅用来作为测试邮件收件人" msgstr "提示:仅用来作为测试邮件收件人"
#: settings/serializers/settings.py:43 #: settings/serializers/settings.py:48
msgid "Use SSL" msgid "Use SSL"
msgstr "使用 SSL" msgstr "使用 SSL"
#: settings/serializers/settings.py:44 #: settings/serializers/settings.py:49
msgid "If SMTP port is 465, may be select" msgid "If SMTP port is 465, may be select"
msgstr "如果SMTP端口是465通常需要启用 SSL" msgstr "如果SMTP端口是465通常需要启用 SSL"
#: settings/serializers/settings.py:47 #: settings/serializers/settings.py:52
msgid "Use TLS" msgid "Use TLS"
msgstr "使用 TLS" msgstr "使用 TLS"
#: settings/serializers/settings.py:48 #: settings/serializers/settings.py:53
msgid "If SMTP port is 587, may be select" msgid "If SMTP port is 587, may be select"
msgstr "如果SMTP端口是587通常需要启用 TLS" msgstr "如果SMTP端口是587通常需要启用 TLS"
#: settings/serializers/settings.py:51 #: settings/serializers/settings.py:56
msgid "Subject prefix" msgid "Subject prefix"
msgstr "主题前缀" msgstr "主题前缀"
#: settings/serializers/settings.py:58 #: settings/serializers/settings.py:63
msgid "Create user email subject" msgid "Create user email subject"
msgstr "邮件主题" msgstr "邮件主题"
#: settings/serializers/settings.py:59 #: settings/serializers/settings.py:64
msgid "" msgid ""
"Tips: When creating a user, send the subject of the email (eg:Create account " "Tips: When creating a user, send the subject of the email (eg:Create account "
"successfully)" "successfully)"
msgstr "提示: 创建用户时,发送设置密码邮件的主题 (例如: 创建用户成功)" msgstr "提示: 创建用户时,发送设置密码邮件的主题 (例如: 创建用户成功)"
#: settings/serializers/settings.py:63 #: settings/serializers/settings.py:68
msgid "Create user honorific" msgid "Create user honorific"
msgstr "邮件的敬语" msgstr "邮件的敬语"
#: settings/serializers/settings.py:64 #: settings/serializers/settings.py:69
msgid "Tips: When creating a user, send the honorific of the email (eg:Hello)" msgid "Tips: When creating a user, send the honorific of the email (eg:Hello)"
msgstr "提示: 创建用户时,发送设置密码邮件的敬语 (例如: 您好)" msgstr "提示: 创建用户时,发送设置密码邮件的敬语 (例如: 您好)"
#: settings/serializers/settings.py:68 #: settings/serializers/settings.py:73
msgid "Create user email content" msgid "Create user email content"
msgstr "邮件的内容" msgstr "邮件的内容"
#: settings/serializers/settings.py:69 #: settings/serializers/settings.py:74
msgid "Tips:When creating a user, send the content of the email" msgid "Tips:When creating a user, send the content of the email"
msgstr "提示: 创建用户时,发送设置密码邮件的内容" msgstr "提示: 创建用户时,发送设置密码邮件的内容"
#: settings/serializers/settings.py:72 #: settings/serializers/settings.py:77
msgid "Signature" msgid "Signature"
msgstr "署名" msgstr "署名"
#: settings/serializers/settings.py:73 #: settings/serializers/settings.py:78
msgid "Tips: Email signature (eg:jumpserver)" msgid "Tips: Email signature (eg:jumpserver)"
msgstr "邮件署名 (如:jumpserver)" msgstr "邮件署名 (如:jumpserver)"
#: settings/serializers/settings.py:81 #: settings/serializers/settings.py:86
msgid "LDAP server" msgid "LDAP server"
msgstr "LDAP 地址" msgstr "LDAP 地址"
#: settings/serializers/settings.py:81 #: settings/serializers/settings.py:86
msgid "eg: ldap://localhost:389" msgid "eg: ldap://localhost:389"
msgstr "" msgstr ""
#: settings/serializers/settings.py:83 #: settings/serializers/settings.py:88
msgid "Bind DN" msgid "Bind DN"
msgstr "绑定 DN" msgstr "绑定 DN"
#: settings/serializers/settings.py:86 #: settings/serializers/settings.py:91
msgid "User OU" msgid "User OU"
msgstr "用户 OU" msgstr "用户 OU"
#: settings/serializers/settings.py:87 #: settings/serializers/settings.py:92
msgid "Use | split multi OUs" msgid "Use | split multi OUs"
msgstr "多个 OU 使用 | 分割" msgstr "多个 OU 使用 | 分割"
#: settings/serializers/settings.py:90 #: settings/serializers/settings.py:95
msgid "User search filter" msgid "User search filter"
msgstr "用户过滤器" msgstr "用户过滤器"
#: settings/serializers/settings.py:91 #: settings/serializers/settings.py:96
#, python-format #, python-format
msgid "Choice may be (cn|uid|sAMAccountName)=%(user)s)" msgid "Choice may be (cn|uid|sAMAccountName)=%(user)s)"
msgstr "可能的选项是(cn或uid或sAMAccountName=%(user)s)" msgstr "可能的选项是(cn或uid或sAMAccountName=%(user)s)"
#: settings/serializers/settings.py:94 #: settings/serializers/settings.py:99
msgid "User attr map" msgid "User attr map"
msgstr "用户属性映射" msgstr "用户属性映射"
#: settings/serializers/settings.py:95 #: settings/serializers/settings.py:100
msgid "" msgid ""
"User attr map present how to map LDAP user attr to jumpserver, username,name," "User attr map present how to map LDAP user attr to jumpserver, username,name,"
"email is jumpserver attr" "email is jumpserver attr"
@ -2118,35 +2124,35 @@ msgstr ""
"用户属性映射代表怎样将LDAP中用户属性映射到jumpserver用户上username, name," "用户属性映射代表怎样将LDAP中用户属性映射到jumpserver用户上username, name,"
"email 是jumpserver的用户需要属性" "email 是jumpserver的用户需要属性"
#: settings/serializers/settings.py:97 #: settings/serializers/settings.py:102
msgid "Enable LDAP auth" msgid "Enable LDAP auth"
msgstr "启用 LDAP 认证" msgstr "启用 LDAP 认证"
#: settings/serializers/settings.py:108 #: settings/serializers/settings.py:113
msgid "Auto" msgid "Auto"
msgstr "自动" msgstr "自动"
#: settings/serializers/settings.py:114 #: settings/serializers/settings.py:119
msgid "Password auth" msgid "Password auth"
msgstr "密码认证" msgstr "密码认证"
#: settings/serializers/settings.py:115 #: settings/serializers/settings.py:120
msgid "Public key auth" msgid "Public key auth"
msgstr "密钥认证" msgstr "密钥认证"
#: settings/serializers/settings.py:116 #: settings/serializers/settings.py:121
msgid "List sort by" msgid "List sort by"
msgstr "资产列表排序" msgstr "资产列表排序"
#: settings/serializers/settings.py:117 #: settings/serializers/settings.py:122
msgid "List page size" msgid "List page size"
msgstr "资产列表每页数量" msgstr "资产列表每页数量"
#: settings/serializers/settings.py:119 #: settings/serializers/settings.py:124
msgid "Session keep duration" msgid "Session keep duration"
msgstr "会话日志保存时间" msgstr "会话日志保存时间"
#: settings/serializers/settings.py:120 #: settings/serializers/settings.py:125
msgid "" msgid ""
"Units: days, Session, record, command will be delete if more than duration, " "Units: days, Session, record, command will be delete if more than duration, "
"only in database" "only in database"
@ -2154,64 +2160,64 @@ msgstr ""
"单位:天。 会话、录像、命令记录超过该时长将会被删除(仅影响数据库存储, oss等不" "单位:天。 会话、录像、命令记录超过该时长将会被删除(仅影响数据库存储, oss等不"
"受影响)" "受影响)"
#: settings/serializers/settings.py:122 #: settings/serializers/settings.py:127
msgid "Telnet login regex" msgid "Telnet login regex"
msgstr "Telnet 成功正则表达式" msgstr "Telnet 成功正则表达式"
#: settings/serializers/settings.py:127 #: settings/serializers/settings.py:132
msgid "Global MFA auth" msgid "Global MFA auth"
msgstr "全局启用 MFA 认证" msgstr "全局启用 MFA 认证"
#: settings/serializers/settings.py:128 #: settings/serializers/settings.py:133
msgid "All user enable MFA" msgid "All user enable MFA"
msgstr "强制每个启用多因子认证" msgstr "强制每个启用多因子认证"
#: settings/serializers/settings.py:131 #: settings/serializers/settings.py:136
msgid "Batch command execution" msgid "Batch command execution"
msgstr "批量命令执行" msgstr "批量命令执行"
#: settings/serializers/settings.py:132 #: settings/serializers/settings.py:137
msgid "Allow user run batch command or not using ansible" msgid "Allow user run batch command or not using ansible"
msgstr "是否允许用户使用 ansible 执行批量命令" msgstr "是否允许用户使用 ansible 执行批量命令"
#: settings/serializers/settings.py:135 #: settings/serializers/settings.py:140
msgid "Enable terminal register" msgid "Enable terminal register"
msgstr "终端注册" msgstr "终端注册"
#: settings/serializers/settings.py:136 #: settings/serializers/settings.py:141
msgid "" msgid ""
"Allow terminal register, after all terminal setup, you should disable this " "Allow terminal register, after all terminal setup, you should disable this "
"for security" "for security"
msgstr "是否允许终端注册,当所有终端启动后,为了安全应该关闭" msgstr "是否允许终端注册,当所有终端启动后,为了安全应该关闭"
#: settings/serializers/settings.py:140 #: settings/serializers/settings.py:145
msgid "Limit the number of login failures" msgid "Limit the number of login failures"
msgstr "限制登录失败次数" msgstr "限制登录失败次数"
#: settings/serializers/settings.py:144 #: settings/serializers/settings.py:149
msgid "Block logon interval" msgid "Block logon interval"
msgstr "禁止登录时间间隔" msgstr "禁止登录时间间隔"
#: settings/serializers/settings.py:145 #: settings/serializers/settings.py:150
msgid "" msgid ""
"Tip: (unit/minute) if the user has failed to log in for a limited number of " "Tip: (unit/minute) if the user has failed to log in for a limited number of "
"times, no login is allowed during this time interval." "times, no login is allowed during this time interval."
msgstr "" msgstr ""
"提示:(单位:分)当用户登录失败次数达到限制后,那么在此时间间隔内禁止登录" "提示:(单位:分)当用户登录失败次数达到限制后,那么在此时间间隔内禁止登录"
#: settings/serializers/settings.py:149 #: settings/serializers/settings.py:154
msgid "Connection max idle time" msgid "Connection max idle time"
msgstr "连接最大空闲时间" msgstr "连接最大空闲时间"
#: settings/serializers/settings.py:150 #: settings/serializers/settings.py:155
msgid "If idle time more than it, disconnect connection Unit: minute" msgid "If idle time more than it, disconnect connection Unit: minute"
msgstr "提示:如果超过该配置没有操作,连接会被断开 (单位:分)" msgstr "提示:如果超过该配置没有操作,连接会被断开 (单位:分)"
#: settings/serializers/settings.py:154 #: settings/serializers/settings.py:159
msgid "User password expiration" msgid "User password expiration"
msgstr "用户密码过期时间" msgstr "用户密码过期时间"
#: settings/serializers/settings.py:155 #: settings/serializers/settings.py:160
msgid "" msgid ""
"Tip: (unit: day) If the user does not update the password during the time, " "Tip: (unit: day) If the user does not update the password during the time, "
"the user password will expire failure;The password expiration reminder mail " "the user password will expire failure;The password expiration reminder mail "
@ -2221,35 +2227,35 @@ msgstr ""
"提示:(单位:天)如果用户在此期间没有更新密码,用户密码将过期失效; 密码过期" "提示:(单位:天)如果用户在此期间没有更新密码,用户密码将过期失效; 密码过期"
"提醒邮件将在密码过期前5天内由系统每天自动发送给用户" "提醒邮件将在密码过期前5天内由系统每天自动发送给用户"
#: settings/serializers/settings.py:159 #: settings/serializers/settings.py:164
msgid "Password minimum length" msgid "Password minimum length"
msgstr "密码最小长度" msgstr "密码最小长度"
#: settings/serializers/settings.py:162 #: settings/serializers/settings.py:167
msgid "Must contain capital" msgid "Must contain capital"
msgstr "必须包含大写字符" msgstr "必须包含大写字符"
#: settings/serializers/settings.py:164 #: settings/serializers/settings.py:169
msgid "Must contain lowercase" msgid "Must contain lowercase"
msgstr "必须包含小写字符" msgstr "必须包含小写字符"
#: settings/serializers/settings.py:165 #: settings/serializers/settings.py:170
msgid "Must contain numeric" msgid "Must contain numeric"
msgstr "必须包含数字" msgstr "必须包含数字"
#: settings/serializers/settings.py:166 #: settings/serializers/settings.py:171
msgid "Must contain special" msgid "Must contain special"
msgstr "必须包含特殊字符" msgstr "必须包含特殊字符"
#: settings/serializers/settings.py:167 #: settings/serializers/settings.py:172
msgid "Insecure command alert" msgid "Insecure command alert"
msgstr "危险命令告警" msgstr "危险命令告警"
#: settings/serializers/settings.py:169 #: settings/serializers/settings.py:174
msgid "Email recipient" msgid "Email recipient"
msgstr "邮件收件人" msgstr "邮件收件人"
#: settings/serializers/settings.py:170 #: settings/serializers/settings.py:175
msgid "Multiple user using , split" msgid "Multiple user using , split"
msgstr "多个用户,使用 , 分割" msgstr "多个用户,使用 , 分割"
@ -3720,7 +3726,7 @@ msgid "Reset"
msgstr "重置" msgstr "重置"
#: users/templates/users/_user.html:52 #: users/templates/users/_user.html:52
#: users/templates/users/forgot_password.html:24 #: users/templates/users/forgot_password.html:32
#: users/templates/users/user_bulk_update.html:24 #: users/templates/users/user_bulk_update.html:24
#: users/templates/users/user_list.html:40 #: users/templates/users/user_list.html:40
#: users/templates/users/user_password_update.html:75 #: users/templates/users/user_password_update.html:75
@ -3780,7 +3786,7 @@ msgstr "向导"
msgid " for more information" msgid " for more information"
msgstr "获取更多信息" msgstr "获取更多信息"
#: users/templates/users/forgot_password.html:15 #: users/templates/users/forgot_password.html:23
msgid "Input your email, that will send a mail to your" msgid "Input your email, that will send a mail to your"
msgstr "输入您的邮箱, 将会发一封重置邮件到您的邮箱中" msgstr "输入您的邮箱, 将会发一封重置邮件到您的邮箱中"
@ -4905,16 +4911,12 @@ msgid "AccessKey Secret"
msgstr "" msgstr ""
#: xpack/plugins/cloud/serializers.py:28 #: xpack/plugins/cloud/serializers.py:28
#, fuzzy
#| msgid "Tenant ID"
msgid "Client ID" msgid "Client ID"
msgstr "租户ID" msgstr "Client ID"
#: xpack/plugins/cloud/serializers.py:31 #: xpack/plugins/cloud/serializers.py:31
#, fuzzy
#| msgid "Secret"
msgid "Client Secret" msgid "Client Secret"
msgstr "密文" msgstr "Client Secret"
#: xpack/plugins/cloud/serializers.py:34 #: xpack/plugins/cloud/serializers.py:34
msgid "Tenant ID" msgid "Tenant ID"
@ -5025,6 +5027,9 @@ msgstr "旗舰版"
msgid "Community edition" msgid "Community edition"
msgstr "社区版" msgstr "社区版"
#~ msgid "Captcha invalid"
#~ msgstr "验证码错误"
#~ msgid "" #~ msgid ""
#~ "Not support openssh format key, using ssh-keygen -t rsa -m pem to generate" #~ "Not support openssh format key, using ssh-keygen -t rsa -m pem to generate"
#~ msgstr "暂不支持OPENSSH格式的密钥使用 ssh-keygen -t rsa -m pem生成" #~ msgstr "暂不支持OPENSSH格式的密钥使用 ssh-keygen -t rsa -m pem生成"

View File

@ -107,7 +107,7 @@ class PublicSettingApi(generics.RetrieveAPIView):
@staticmethod @staticmethod
def get_login_title(): def get_login_title():
default_title = _('Welcome to the JumpServer open source fortress') default_title = _('Welcome to the JumpServer open source Bastion Host')
if not settings.XPACK_ENABLED: if not settings.XPACK_ENABLED:
return default_title return default_title
from xpack.plugins.interface.models import Interface from xpack.plugins.interface.models import Interface

View File

@ -16,9 +16,14 @@ class BasicSettingSerializer(serializers.Serializer):
help_text=_('eg: http://demo.jumpserver.org:8080') help_text=_('eg: http://demo.jumpserver.org:8080')
) )
USER_GUIDE_URL = serializers.URLField( USER_GUIDE_URL = serializers.URLField(
required=False, allow_blank=True, label=_("User guide url"), required=False, allow_blank=True, allow_null=True, label=_("User guide url"),
help_text=_('User first login update profile done redirect to it') help_text=_('User first login update profile done redirect to it')
) )
FORGOT_PASSWORD_URL = serializers.URLField(
required=False, allow_blank=True, allow_null=True, label=_("Forgot password url"),
help_text=_('The forgot password url on login page, If you use '
'ldap or cas external authentication, you can set it')
)
class EmailSettingSerializer(serializers.Serializer): class EmailSettingSerializer(serializers.Serializer):