Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
719bea68
Unverified
Commit
719bea68
authored
Oct 09, 2019
by
老广
Committed by
GitHub
Oct 09, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3313 from jumpserver/dev
Dev
parents
7502a372
dc5598f8
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
363 additions
and
264 deletions
+363
-264
node.py
apps/assets/serializers/node.py
+4
-2
const.py
apps/assets/tasks/const.py
+4
-1
conf.py
apps/jumpserver/conf.py
+5
-1
settings.py
apps/jumpserver/settings.py
+8
-0
django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/locale/zh/LC_MESSAGES/django.po
+169
-154
tasks.py
apps/ops/tasks.py
+0
-2
celery_task_log.html
apps/ops/templates/ops/celery_task_log.html
+10
-0
celery.py
apps/ops/views/celery.py
+5
-1
api.py
apps/settings/api.py
+4
-2
forms.py
apps/settings/forms.py
+4
-0
serializers.py
apps/settings/serializers.py
+1
-0
utils.py
apps/settings/utils.py
+3
-2
tasks.py
apps/users/tasks.py
+35
-0
config_example.yml
config_example.yml
+7
-0
jms
jms
+104
-99
No files found.
apps/assets/serializers/node.py
View file @
719bea68
...
@@ -25,10 +25,12 @@ class NodeSerializer(BulkOrgResourceModelSerializer):
...
@@ -25,10 +25,12 @@ class NodeSerializer(BulkOrgResourceModelSerializer):
read_only_fields
=
[
'key'
,
'org_id'
]
read_only_fields
=
[
'key'
,
'org_id'
]
def
validate_value
(
self
,
data
):
def
validate_value
(
self
,
data
):
if
not
self
.
instance
and
not
data
:
if
self
.
instance
:
return
data
instance
=
self
.
instance
instance
=
self
.
instance
siblings
=
instance
.
get_siblings
()
siblings
=
instance
.
get_siblings
()
else
:
instance
=
Node
.
org_root
()
siblings
=
instance
.
get_children
()
if
siblings
.
filter
(
value
=
data
):
if
siblings
.
filter
(
value
=
data
):
raise
serializers
.
ValidationError
(
raise
serializers
.
ValidationError
(
_
(
'The same level node name cannot be the same'
)
_
(
'The same level node name cannot be the same'
)
...
...
apps/assets/tasks/const.py
View file @
719bea68
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
#
import
os
import
os
from
django.conf
import
settings
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
PERIOD_TASK_ENABLED
=
os
.
environ
.
get
(
"PERIOD_TASK"
,
"on"
)
==
'on'
ENV_PERIOD_TASK
=
os
.
environ
.
get
(
"PERIOD_TASK"
,
"on"
)
==
'on'
PERIOD_TASK_ENABLED
=
settings
.
PERIOD_TASK_ENABLED
and
ENV_PERIOD_TASK
UPDATE_ASSETS_HARDWARE_TASKS
=
[
UPDATE_ASSETS_HARDWARE_TASKS
=
[
{
{
...
...
apps/jumpserver/conf.py
View file @
719bea68
...
@@ -374,6 +374,10 @@ defaults = {
...
@@ -374,6 +374,10 @@ defaults = {
'RADIUS_SERVER'
:
'localhost'
,
'RADIUS_SERVER'
:
'localhost'
,
'RADIUS_PORT'
:
1812
,
'RADIUS_PORT'
:
1812
,
'RADIUS_SECRET'
:
''
,
'RADIUS_SECRET'
:
''
,
'AUTH_LDAP_SEARCH_PAGED_SIZE'
:
1000
,
'AUTH_LDAP_SYNC_IS_PERIODIC'
:
False
,
'AUTH_LDAP_SYNC_INTERVAL'
:
None
,
'AUTH_LDAP_SYNC_CRONTAB'
:
None
,
'HTTP_BIND_HOST'
:
'0.0.0.0'
,
'HTTP_BIND_HOST'
:
'0.0.0.0'
,
'HTTP_LISTEN_PORT'
:
8080
,
'HTTP_LISTEN_PORT'
:
8080
,
'WS_LISTEN_PORT'
:
8070
,
'WS_LISTEN_PORT'
:
8070
,
...
@@ -386,8 +390,8 @@ defaults = {
...
@@ -386,8 +390,8 @@ defaults = {
'PERM_SINGLE_ASSET_TO_UNGROUP_NODE'
:
False
,
'PERM_SINGLE_ASSET_TO_UNGROUP_NODE'
:
False
,
'WINDOWS_SSH_DEFAULT_SHELL'
:
'cmd'
,
'WINDOWS_SSH_DEFAULT_SHELL'
:
'cmd'
,
'FLOWER_URL'
:
"127.0.0.1:5555"
,
'FLOWER_URL'
:
"127.0.0.1:5555"
,
'AUTH_LDAP_SEARCH_PAGED_SIZE'
:
1000
,
'DEFAULT_ORG_SHOW_ALL_USERS'
:
True
,
'DEFAULT_ORG_SHOW_ALL_USERS'
:
True
,
'PERIOD_TASK_ENABLED'
:
True
,
}
}
...
...
apps/jumpserver/settings.py
View file @
719bea68
...
@@ -357,6 +357,7 @@ EMAIL_PORT = 25
...
@@ -357,6 +357,7 @@ EMAIL_PORT = 25
EMAIL_HOST_USER
=
'noreply@jumpserver.org'
EMAIL_HOST_USER
=
'noreply@jumpserver.org'
EMAIL_HOST_PASSWORD
=
''
EMAIL_HOST_PASSWORD
=
''
EMAIL_FROM
=
''
EMAIL_FROM
=
''
EMAIL_RECIPIENT
=
''
EMAIL_USE_SSL
=
False
EMAIL_USE_SSL
=
False
EMAIL_USE_TLS
=
False
EMAIL_USE_TLS
=
False
EMAIL_SUBJECT_PREFIX
=
'[JMS] '
EMAIL_SUBJECT_PREFIX
=
'[JMS] '
...
@@ -425,6 +426,10 @@ OTP_VALID_WINDOW = CONFIG.OTP_VALID_WINDOW
...
@@ -425,6 +426,10 @@ OTP_VALID_WINDOW = CONFIG.OTP_VALID_WINDOW
# Auth LDAP settings
# Auth LDAP settings
AUTH_LDAP
=
False
AUTH_LDAP
=
False
AUTH_LDAP_SEARCH_PAGED_SIZE
=
CONFIG
.
AUTH_LDAP_SEARCH_PAGED_SIZE
AUTH_LDAP_SEARCH_PAGED_SIZE
=
CONFIG
.
AUTH_LDAP_SEARCH_PAGED_SIZE
AUTH_LDAP_SYNC_IS_PERIODIC
=
CONFIG
.
AUTH_LDAP_SYNC_IS_PERIODIC
AUTH_LDAP_SYNC_INTERVAL
=
CONFIG
.
AUTH_LDAP_SYNC_INTERVAL
AUTH_LDAP_SYNC_CRONTAB
=
CONFIG
.
AUTH_LDAP_SYNC_CRONTAB
AUTH_LDAP_SERVER_URI
=
'ldap://localhost:389'
AUTH_LDAP_SERVER_URI
=
'ldap://localhost:389'
AUTH_LDAP_BIND_DN
=
'cn=admin,dc=jumpserver,dc=org'
AUTH_LDAP_BIND_DN
=
'cn=admin,dc=jumpserver,dc=org'
AUTH_LDAP_BIND_PASSWORD
=
''
AUTH_LDAP_BIND_PASSWORD
=
''
...
@@ -645,3 +650,6 @@ CHANNEL_LAYERS = {
...
@@ -645,3 +650,6 @@ CHANNEL_LAYERS = {
},
},
},
},
}
}
# Enable internal period task
PERIOD_TASK_ENABLED
=
CONFIG
.
PERIOD_TASK_ENABLED
apps/locale/zh/LC_MESSAGES/django.mo
View file @
719bea68
No preview for this file type
apps/locale/zh/LC_MESSAGES/django.po
View file @
719bea68
...
@@ -8,7 +8,7 @@ msgid ""
...
@@ -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: 2019-
09-25 15:11
+0800\n"
"POT-Creation-Date: 2019-
10-08 17:09
+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"
...
@@ -86,11 +86,11 @@ msgstr "运行参数"
...
@@ -86,11 +86,11 @@ msgstr "运行参数"
#: assets/templates/assets/system_user_list.html:55 audits/models.py:19
#: assets/templates/assets/system_user_list.html:55 audits/models.py:19
#: audits/templates/audits/ftp_log_list.html:44
#: audits/templates/audits/ftp_log_list.html:44
#: audits/templates/audits/ftp_log_list.html:74
#: audits/templates/audits/ftp_log_list.html:74
#: perms/forms/asset_permission.py:
79
perms/models/asset_permission.py:80
#: perms/forms/asset_permission.py:
80
perms/models/asset_permission.py:80
#: perms/templates/perms/asset_permission_create_update.html:45
#: perms/templates/perms/asset_permission_create_update.html:45
#: perms/templates/perms/asset_permission_list.html:52
#: perms/templates/perms/asset_permission_list.html:52
#: perms/templates/perms/asset_permission_list.html:121
#: perms/templates/perms/asset_permission_list.html:121
#: terminal/backends/command/models.py:13 terminal/models.py:15
6
#: terminal/backends/command/models.py:13 terminal/models.py:15
7
#: terminal/templates/terminal/command_list.html:30
#: terminal/templates/terminal/command_list.html:30
#: terminal/templates/terminal/command_list.html:66
#: terminal/templates/terminal/command_list.html:66
#: terminal/templates/terminal/session_list.html:28
#: terminal/templates/terminal/session_list.html:28
...
@@ -127,7 +127,7 @@ msgstr "资产"
...
@@ -127,7 +127,7 @@ msgstr "资产"
#: assets/templates/assets/system_user_detail.html:58
#: assets/templates/assets/system_user_detail.html:58
#: assets/templates/assets/system_user_list.html:51 ops/models/adhoc.py:37
#: assets/templates/assets/system_user_list.html:51 ops/models/adhoc.py:37
#: ops/templates/ops/task_detail.html:60 ops/templates/ops/task_list.html:11
#: ops/templates/ops/task_detail.html:60 ops/templates/ops/task_list.html:11
#: orgs/models.py:1
1
perms/models/base.py:48
#: orgs/models.py:1
2
perms/models/base.py:48
#: perms/templates/perms/asset_permission_detail.html:62
#: perms/templates/perms/asset_permission_detail.html:62
#: perms/templates/perms/asset_permission_list.html:49
#: perms/templates/perms/asset_permission_list.html:49
#: perms/templates/perms/asset_permission_list.html:68
#: perms/templates/perms/asset_permission_list.html:68
...
@@ -141,8 +141,8 @@ msgstr "资产"
...
@@ -141,8 +141,8 @@ msgstr "资产"
#: settings/templates/settings/command_storage_create.html:41
#: settings/templates/settings/command_storage_create.html:41
#: settings/templates/settings/replay_storage_create.html:44
#: settings/templates/settings/replay_storage_create.html:44
#: settings/templates/settings/terminal_setting.html:83
#: settings/templates/settings/terminal_setting.html:83
#: settings/templates/settings/terminal_setting.html:105 terminal/models.py:2
2
#: settings/templates/settings/terminal_setting.html:105 terminal/models.py:2
3
#: terminal/models.py:2
59
terminal/templates/terminal/terminal_detail.html:43
#: terminal/models.py:2
60
terminal/templates/terminal/terminal_detail.html:43
#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14
#: terminal/templates/terminal/terminal_list.html:29 users/models/group.py:14
#: users/models/user.py:373 users/templates/users/_select_user_modal.html:13
#: users/models/user.py:373 users/templates/users/_select_user_modal.html:13
#: users/templates/users/user_detail.html:63
#: users/templates/users/user_detail.html:63
...
@@ -193,7 +193,7 @@ msgstr "参数"
...
@@ -193,7 +193,7 @@ msgstr "参数"
#: assets/templates/assets/cmd_filter_detail.html:77
#: assets/templates/assets/cmd_filter_detail.html:77
#: assets/templates/assets/domain_detail.html:72
#: assets/templates/assets/domain_detail.html:72
#: assets/templates/assets/system_user_detail.html:100
#: assets/templates/assets/system_user_detail.html:100
#: ops/templates/ops/adhoc_detail.html:86 orgs/models.py:1
5
#: ops/templates/ops/adhoc_detail.html:86 orgs/models.py:1
6
#: perms/models/base.py:54
#: perms/models/base.py:54
#: perms/templates/perms/asset_permission_detail.html:98
#: perms/templates/perms/asset_permission_detail.html:98
#: perms/templates/perms/remote_app_permission_detail.html:90
#: perms/templates/perms/remote_app_permission_detail.html:90
...
@@ -218,7 +218,7 @@ msgstr "创建者"
...
@@ -218,7 +218,7 @@ msgstr "创建者"
#: assets/templates/assets/domain_detail.html:68
#: assets/templates/assets/domain_detail.html:68
#: assets/templates/assets/system_user_detail.html:96 ops/models/adhoc.py:45
#: assets/templates/assets/system_user_detail.html:96 ops/models/adhoc.py:45
#: ops/templates/ops/adhoc_detail.html:90 ops/templates/ops/task_detail.html:64
#: ops/templates/ops/adhoc_detail.html:90 ops/templates/ops/task_detail.html:64
#: orgs/models.py:1
6
perms/models/base.py:55
#: orgs/models.py:1
7
perms/models/base.py:55
#: perms/templates/perms/asset_permission_detail.html:94
#: perms/templates/perms/asset_permission_detail.html:94
#: perms/templates/perms/remote_app_permission_detail.html:86
#: perms/templates/perms/remote_app_permission_detail.html:86
#: terminal/templates/terminal/terminal_detail.html:59 users/models/group.py:17
#: terminal/templates/terminal/terminal_detail.html:59 users/models/group.py:17
...
@@ -252,10 +252,10 @@ msgstr "创建日期"
...
@@ -252,10 +252,10 @@ msgstr "创建日期"
#: assets/templates/assets/domain_list.html:28
#: assets/templates/assets/domain_list.html:28
#: assets/templates/assets/system_user_detail.html:104
#: assets/templates/assets/system_user_detail.html:104
#: assets/templates/assets/system_user_list.html:59 ops/models/adhoc.py:43
#: assets/templates/assets/system_user_list.html:59 ops/models/adhoc.py:43
#: orgs/models.py:1
7
perms/models/base.py:56
#: orgs/models.py:1
8
perms/models/base.py:56
#: perms/templates/perms/asset_permission_detail.html:102
#: perms/templates/perms/asset_permission_detail.html:102
#: perms/templates/perms/remote_app_permission_detail.html:94
#: perms/templates/perms/remote_app_permission_detail.html:94
#: settings/models.py:34 terminal/models.py:3
2
#: settings/models.py:34 terminal/models.py:3
3
#: terminal/templates/terminal/terminal_detail.html:63 users/models/group.py:15
#: terminal/templates/terminal/terminal_detail.html:63 users/models/group.py:15
#: users/models/user.py:406 users/templates/users/user_detail.html:129
#: users/models/user.py:406 users/templates/users/user_detail.html:129
#: users/templates/users/user_group_detail.html:67
#: users/templates/users/user_group_detail.html:67
...
@@ -275,7 +275,7 @@ msgstr "创建日期"
...
@@ -275,7 +275,7 @@ msgstr "创建日期"
msgid "Comment"
msgid "Comment"
msgstr "备注"
msgstr "备注"
#: applications/models/remote_app.py:49 perms/forms/remote_app_permission.py:
37
#: applications/models/remote_app.py:49 perms/forms/remote_app_permission.py:
40
#: perms/models/remote_app_permission.py:15
#: perms/models/remote_app_permission.py:15
#: perms/templates/perms/remote_app_permission_create_update.html:48
#: perms/templates/perms/remote_app_permission_create_update.html:48
#: perms/templates/perms/remote_app_permission_detail.html:27
#: perms/templates/perms/remote_app_permission_detail.html:27
...
@@ -390,7 +390,7 @@ msgstr "详情"
...
@@ -390,7 +390,7 @@ msgstr "详情"
#: applications/templates/applications/remote_app_detail.html:21
#: applications/templates/applications/remote_app_detail.html:21
#: applications/templates/applications/remote_app_list.html:54
#: applications/templates/applications/remote_app_list.html:54
#: assets/templates/assets/_asset_user_list.html:
69
#: assets/templates/assets/_asset_user_list.html:
74
#: assets/templates/assets/admin_user_detail.html:24
#: assets/templates/assets/admin_user_detail.html:24
#: assets/templates/assets/admin_user_list.html:26
#: assets/templates/assets/admin_user_list.html:26
#: assets/templates/assets/admin_user_list.html:111
#: assets/templates/assets/admin_user_list.html:111
...
@@ -452,7 +452,7 @@ msgstr "更新"
...
@@ -452,7 +452,7 @@ msgstr "更新"
#: assets/templates/assets/label_list.html:40
#: assets/templates/assets/label_list.html:40
#: assets/templates/assets/system_user_detail.html:30
#: assets/templates/assets/system_user_detail.html:30
#: assets/templates/assets/system_user_list.html:86 audits/models.py:34
#: assets/templates/assets/system_user_list.html:86 audits/models.py:34
#: authentication/templates/authentication/_access_key_modal.html:6
4
#: authentication/templates/authentication/_access_key_modal.html:6
5
#: ops/templates/ops/task_list.html:69
#: ops/templates/ops/task_list.html:69
#: perms/templates/perms/asset_permission_detail.html:34
#: perms/templates/perms/asset_permission_detail.html:34
#: perms/templates/perms/asset_permission_list.html:179
#: perms/templates/perms/asset_permission_list.html:179
...
@@ -499,7 +499,7 @@ msgstr "创建远程应用"
...
@@ -499,7 +499,7 @@ msgstr "创建远程应用"
#: applications/templates/applications/remote_app_list.html:24
#: applications/templates/applications/remote_app_list.html:24
#: applications/templates/applications/user_remote_app_list.html:20
#: applications/templates/applications/user_remote_app_list.html:20
#: assets/models/cmd_filter.py:54
#: assets/models/cmd_filter.py:54
#: assets/templates/assets/_asset_user_list.html:2
0
#: assets/templates/assets/_asset_user_list.html:2
5
#: assets/templates/assets/admin_user_list.html:51
#: assets/templates/assets/admin_user_list.html:51
#: assets/templates/assets/asset_list.html:100
#: assets/templates/assets/asset_list.html:100
#: assets/templates/assets/cmd_filter_list.html:28
#: assets/templates/assets/cmd_filter_list.html:28
...
@@ -510,7 +510,7 @@ msgstr "创建远程应用"
...
@@ -510,7 +510,7 @@ msgstr "创建远程应用"
#: assets/templates/assets/system_user_list.html:60 audits/models.py:38
#: assets/templates/assets/system_user_list.html:60 audits/models.py:38
#: audits/templates/audits/operate_log_list.html:47
#: audits/templates/audits/operate_log_list.html:47
#: audits/templates/audits/operate_log_list.html:73
#: audits/templates/audits/operate_log_list.html:73
#: authentication/templates/authentication/_access_key_modal.html:3
3
#: authentication/templates/authentication/_access_key_modal.html:3
4
#: ops/templates/ops/adhoc_history.html:59 ops/templates/ops/task_adhoc.html:64
#: ops/templates/ops/adhoc_history.html:59 ops/templates/ops/task_adhoc.html:64
#: ops/templates/ops/task_history.html:65 ops/templates/ops/task_list.html:18
#: ops/templates/ops/task_history.html:65 ops/templates/ops/task_list.html:18
#: perms/forms/asset_permission.py:21
#: perms/forms/asset_permission.py:21
...
@@ -624,9 +624,9 @@ msgid "Domain"
...
@@ -624,9 +624,9 @@ msgid "Domain"
msgstr "网域"
msgstr "网域"
#: assets/forms/asset.py:72 assets/forms/asset.py:106 assets/forms/asset.py:119
#: assets/forms/asset.py:72 assets/forms/asset.py:106 assets/forms/asset.py:119
#: assets/forms/asset.py:155 assets/models/node.py:4
13
#: assets/forms/asset.py:155 assets/models/node.py:4
09
#: assets/templates/assets/asset_create.html:42
#: assets/templates/assets/asset_create.html:42
#: perms/forms/asset_permission.py:8
2 perms/forms/asset_permission.py:89
#: perms/forms/asset_permission.py:8
3 perms/forms/asset_permission.py:90
#: perms/templates/perms/asset_permission_list.html:53
#: perms/templates/perms/asset_permission_list.html:53
#: perms/templates/perms/asset_permission_list.html:74
#: perms/templates/perms/asset_permission_list.html:74
#: perms/templates/perms/asset_permission_list.html:124
#: perms/templates/perms/asset_permission_list.html:124
...
@@ -680,7 +680,7 @@ msgstr "SSH网关,支持代理SSH,RDP和VNC"
...
@@ -680,7 +680,7 @@ msgstr "SSH网关,支持代理SSH,RDP和VNC"
#: assets/models/base.py:29 assets/models/gathered_user.py:16
#: assets/models/base.py:29 assets/models/gathered_user.py:16
#: assets/templates/assets/_asset_user_auth_update_modal.html:15
#: assets/templates/assets/_asset_user_auth_update_modal.html:15
#: assets/templates/assets/_asset_user_auth_view_modal.html:21
#: assets/templates/assets/_asset_user_auth_view_modal.html:21
#: assets/templates/assets/_asset_user_list.html:
16
#: assets/templates/assets/_asset_user_list.html:
21
#: assets/templates/assets/admin_user_detail.html:60
#: assets/templates/assets/admin_user_detail.html:60
#: assets/templates/assets/admin_user_list.html:45
#: assets/templates/assets/admin_user_list.html:45
#: assets/templates/assets/domain_gateway_list.html:71
#: assets/templates/assets/domain_gateway_list.html:71
...
@@ -719,7 +719,7 @@ msgstr "密码或密钥密码"
...
@@ -719,7 +719,7 @@ msgstr "密码或密钥密码"
#: authentication/forms.py:15
#: authentication/forms.py:15
#: authentication/templates/authentication/login.html:68
#: authentication/templates/authentication/login.html:68
#: authentication/templates/authentication/new_login.html:95
#: authentication/templates/authentication/new_login.html:95
#: settings/forms.py:11
0
users/forms.py:16 users/forms.py:28
#: settings/forms.py:11
4
users/forms.py:16 users/forms.py:28
#: users/templates/users/reset_password.html:53
#: users/templates/users/reset_password.html:53
#: users/templates/users/user_password_authentication.html:18
#: users/templates/users/user_password_authentication.html:18
#: users/templates/users/user_password_update.html:44
#: users/templates/users/user_password_update.html:44
...
@@ -776,13 +776,13 @@ msgstr "使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig"
...
@@ -776,13 +776,13 @@ msgstr "使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig"
#: assets/models/asset.py:135 assets/models/domain.py:49
#: assets/models/asset.py:135 assets/models/domain.py:49
#: assets/serializers/asset_user.py:28
#: assets/serializers/asset_user.py:28
#: assets/templates/assets/_asset_list_modal.html:47
#: assets/templates/assets/_asset_list_modal.html:47
#: assets/templates/assets/_asset_user_list.html:
15
#: assets/templates/assets/_asset_user_list.html:
20
#: assets/templates/assets/asset_detail.html:64
#: assets/templates/assets/asset_detail.html:64
#: assets/templates/assets/asset_list.html:97
#: assets/templates/assets/asset_list.html:97
#: assets/templates/assets/domain_gateway_list.html:68
#: assets/templates/assets/domain_gateway_list.html:68
#: assets/templates/assets/user_asset_list.html:49
#: assets/templates/assets/user_asset_list.html:49
#: audits/templates/audits/login_log_list.html:60
#: audits/templates/audits/login_log_list.html:60
#: perms/templates/perms/asset_permission_asset.html:58 settings/forms.py:14
0
#: perms/templates/perms/asset_permission_asset.html:58 settings/forms.py:14
4
#: users/templates/users/_granted_assets.html:26
#: users/templates/users/_granted_assets.html:26
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:54
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:54
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:73
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:73
...
@@ -794,12 +794,12 @@ msgstr "IP"
...
@@ -794,12 +794,12 @@ msgstr "IP"
#: assets/templates/assets/_asset_list_modal.html:46
#: assets/templates/assets/_asset_list_modal.html:46
#: assets/templates/assets/_asset_user_auth_update_modal.html:9
#: assets/templates/assets/_asset_user_auth_update_modal.html:9
#: assets/templates/assets/_asset_user_auth_view_modal.html:15
#: assets/templates/assets/_asset_user_auth_view_modal.html:15
#: assets/templates/assets/_asset_user_list.html:1
4
#: assets/templates/assets/_asset_user_list.html:1
9
#: assets/templates/assets/asset_detail.html:60
#: assets/templates/assets/asset_detail.html:60
#: assets/templates/assets/asset_list.html:96
#: assets/templates/assets/asset_list.html:96
#: assets/templates/assets/user_asset_list.html:48
#: assets/templates/assets/user_asset_list.html:48
#: perms/templates/perms/asset_permission_asset.html:57
#: perms/templates/perms/asset_permission_asset.html:57
#: perms/templates/perms/asset_permission_list.html:73 settings/forms.py:1
39
#: perms/templates/perms/asset_permission_list.html:73 settings/forms.py:1
43
#: users/templates/users/_granted_assets.html:25
#: users/templates/users/_granted_assets.html:25
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:53
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:53
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:72
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:72
...
@@ -908,7 +908,7 @@ msgid "Latest version"
...
@@ -908,7 +908,7 @@ msgid "Latest version"
msgstr "最新版本"
msgstr "最新版本"
#: assets/models/authbook.py:26
#: assets/models/authbook.py:26
#: assets/templates/assets/_asset_user_list.html:
17
#: assets/templates/assets/_asset_user_list.html:
22
#: ops/templates/ops/adhoc_history.html:58
#: ops/templates/ops/adhoc_history.html:58
#: ops/templates/ops/adhoc_history_detail.html:57
#: ops/templates/ops/adhoc_history_detail.html:57
#: ops/templates/ops/task_adhoc.html:58 ops/templates/ops/task_history.html:64
#: ops/templates/ops/task_adhoc.html:58 ops/templates/ops/task_history.html:64
...
@@ -999,7 +999,7 @@ msgid "Regex"
...
@@ -999,7 +999,7 @@ msgid "Regex"
msgstr "正则表达式"
msgstr "正则表达式"
#: assets/models/cmd_filter.py:39 ops/models/command.py:21
#: assets/models/cmd_filter.py:39 ops/models/command.py:21
#: ops/templates/ops/command_execution_list.html:64 terminal/models.py:16
2
#: ops/templates/ops/command_execution_list.html:64 terminal/models.py:16
3
#: terminal/templates/terminal/command_list.html:28
#: terminal/templates/terminal/command_list.html:28
#: terminal/templates/terminal/command_list.html:68
#: terminal/templates/terminal/command_list.html:68
#: terminal/templates/terminal/session_detail.html:48
#: terminal/templates/terminal/session_detail.html:48
...
@@ -1086,7 +1086,7 @@ msgstr "默认资产组"
...
@@ -1086,7 +1086,7 @@ msgstr "默认资产组"
#: audits/templates/audits/password_change_log_list.html:56
#: audits/templates/audits/password_change_log_list.html:56
#: ops/templates/ops/command_execution_list.html:38
#: ops/templates/ops/command_execution_list.html:38
#: ops/templates/ops/command_execution_list.html:63
#: ops/templates/ops/command_execution_list.html:63
#: perms/forms/asset_permission.py:7
3 perms/forms/remote_app_permission.py:31
#: perms/forms/asset_permission.py:7
4 perms/forms/remote_app_permission.py:34
#: perms/models/base.py:49
#: perms/models/base.py:49
#: perms/templates/perms/asset_permission_create_update.html:41
#: perms/templates/perms/asset_permission_create_update.html:41
#: perms/templates/perms/asset_permission_list.html:50
#: perms/templates/perms/asset_permission_list.html:50
...
@@ -1094,20 +1094,20 @@ msgstr "默认资产组"
...
@@ -1094,20 +1094,20 @@ msgstr "默认资产组"
#: perms/templates/perms/remote_app_permission_create_update.html:43
#: perms/templates/perms/remote_app_permission_create_update.html:43
#: perms/templates/perms/remote_app_permission_list.html:15
#: perms/templates/perms/remote_app_permission_list.html:15
#: templates/index.html:87 terminal/backends/command/models.py:12
#: templates/index.html:87 terminal/backends/command/models.py:12
#: terminal/models.py:15
5
terminal/templates/terminal/command_list.html:29
#: terminal/models.py:15
6
terminal/templates/terminal/command_list.html:29
#: terminal/templates/terminal/command_list.html:65
#: terminal/templates/terminal/command_list.html:65
#: terminal/templates/terminal/session_list.html:27
#: terminal/templates/terminal/session_list.html:27
#: terminal/templates/terminal/session_list.html:71 users/forms.py:312
#: terminal/templates/terminal/session_list.html:71 users/forms.py:312
#: users/models/user.py:127 users/models/user.py:143 users/models/user.py:500
#: users/models/user.py:127 users/models/user.py:143 users/models/user.py:500
#: users/serializers/v1.py:130 users/templates/users/user_group_detail.html:78
#: users/serializers/v1.py:130 users/templates/users/user_group_detail.html:78
#: users/templates/users/user_group_list.html:36 users/views/user.py:250
#: users/templates/users/user_group_list.html:36 users/views/user.py:250
#: xpack/plugins/orgs/forms.py:2
6
#: xpack/plugins/orgs/forms.py:2
8
#: xpack/plugins/orgs/templates/orgs/org_detail.html:113
#: xpack/plugins/orgs/templates/orgs/org_detail.html:113
#: xpack/plugins/orgs/templates/orgs/org_list.html:15
#: xpack/plugins/orgs/templates/orgs/org_list.html:15
msgid "User"
msgid "User"
msgstr "用户"
msgstr "用户"
#: assets/models/label.py:19 assets/models/node.py:40
4
#: assets/models/label.py:19 assets/models/node.py:40
0
#: assets/templates/assets/label_list.html:15 settings/models.py:30
#: assets/templates/assets/label_list.html:15 settings/models.py:30
msgid "Value"
msgid "Value"
msgstr "值"
msgstr "值"
...
@@ -1120,15 +1120,15 @@ msgstr "分类"
...
@@ -1120,15 +1120,15 @@ msgstr "分类"
msgid "New node"
msgid "New node"
msgstr "新节点"
msgstr "新节点"
#: assets/models/node.py:32
8
#: assets/models/node.py:32
4
msgid "ungrouped"
msgid "ungrouped"
msgstr "未分组"
msgstr "未分组"
#: assets/models/node.py:3
30
#: assets/models/node.py:3
26
msgid "empty"
msgid "empty"
msgstr "空"
msgstr "空"
#: assets/models/node.py:
403
#: assets/models/node.py:
399
msgid "Key"
msgid "Key"
msgstr "键"
msgstr "键"
...
@@ -1185,7 +1185,7 @@ msgstr "登录模式"
...
@@ -1185,7 +1185,7 @@ msgstr "登录模式"
#: assets/models/user.py:162 assets/templates/assets/user_asset_list.html:52
#: assets/models/user.py:162 assets/templates/assets/user_asset_list.html:52
#: audits/models.py:20 audits/templates/audits/ftp_log_list.html:52
#: audits/models.py:20 audits/templates/audits/ftp_log_list.html:52
#: audits/templates/audits/ftp_log_list.html:75
#: audits/templates/audits/ftp_log_list.html:75
#: perms/forms/asset_permission.py:8
5 perms/forms/remote_app_permission.py:40
#: perms/forms/asset_permission.py:8
6 perms/forms/remote_app_permission.py:43
#: perms/models/asset_permission.py:82 perms/models/remote_app_permission.py:16
#: perms/models/asset_permission.py:82 perms/models/remote_app_permission.py:16
#: perms/templates/perms/asset_permission_detail.html:140
#: perms/templates/perms/asset_permission_detail.html:140
#: perms/templates/perms/asset_permission_list.html:54
#: perms/templates/perms/asset_permission_list.html:54
...
@@ -1194,7 +1194,7 @@ msgstr "登录模式"
...
@@ -1194,7 +1194,7 @@ msgstr "登录模式"
#: perms/templates/perms/remote_app_permission_detail.html:131
#: perms/templates/perms/remote_app_permission_detail.html:131
#: perms/templates/perms/remote_app_permission_list.html:18
#: perms/templates/perms/remote_app_permission_list.html:18
#: templates/_nav.html:45 terminal/backends/command/models.py:14
#: templates/_nav.html:45 terminal/backends/command/models.py:14
#: terminal/models.py:15
7
terminal/templates/terminal/command_list.html:31
#: terminal/models.py:15
8
terminal/templates/terminal/command_list.html:31
#: terminal/templates/terminal/command_list.html:67
#: terminal/templates/terminal/command_list.html:67
#: terminal/templates/terminal/session_list.html:29
#: terminal/templates/terminal/session_list.html:29
#: terminal/templates/terminal/session_list.html:73
#: terminal/templates/terminal/session_list.html:73
...
@@ -1231,7 +1231,7 @@ msgid "Protocol duplicate: {}"
...
@@ -1231,7 +1231,7 @@ msgid "Protocol duplicate: {}"
msgstr "协议重复: {}"
msgstr "协议重复: {}"
#: assets/serializers/asset.py:65 assets/serializers/asset_user.py:29
#: assets/serializers/asset.py:65 assets/serializers/asset_user.py:29
#: assets/templates/assets/_asset_user_list.html:
18
#: assets/templates/assets/_asset_user_list.html:
23
msgid "Connectivity"
msgid "Connectivity"
msgstr "连接"
msgstr "连接"
...
@@ -1273,7 +1273,7 @@ msgstr "密钥不合法"
...
@@ -1273,7 +1273,7 @@ msgstr "密钥不合法"
msgid "value"
msgid "value"
msgstr "值"
msgstr "值"
#: assets/serializers/node.py:3
4
#: assets/serializers/node.py:3
6
msgid "The same level node name cannot be the same"
msgid "The same level node name cannot be the same"
msgstr "同级别节点名字不能重复"
msgstr "同级别节点名字不能重复"
...
@@ -1443,7 +1443,7 @@ msgid "Please input password"
...
@@ -1443,7 +1443,7 @@ msgid "Please input password"
msgstr "请输入密码"
msgstr "请输入密码"
#: assets/templates/assets/_asset_user_auth_update_modal.html:68
#: assets/templates/assets/_asset_user_auth_update_modal.html:68
#: assets/templates/assets/asset_detail.html:30
6
#: assets/templates/assets/asset_detail.html:30
4
#: users/templates/users/user_detail.html:313
#: users/templates/users/user_detail.html:313
#: users/templates/users/user_detail.html:340
#: users/templates/users/user_detail.html:340
#: xpack/plugins/interface/views.py:35
#: xpack/plugins/interface/views.py:35
...
@@ -1464,14 +1464,14 @@ msgstr "获取认证信息错误"
...
@@ -1464,14 +1464,14 @@ msgstr "获取认证信息错误"
#: assets/templates/assets/_asset_user_auth_view_modal.html:97
#: assets/templates/assets/_asset_user_auth_view_modal.html:97
#: assets/templates/assets/_user_asset_detail_modal.html:23
#: assets/templates/assets/_user_asset_detail_modal.html:23
#: authentication/templates/authentication/_access_key_modal.html:14
1
#: authentication/templates/authentication/_access_key_modal.html:14
2
#: authentication/templates/authentication/_mfa_confirm_modal.html:53
#: authentication/templates/authentication/_mfa_confirm_modal.html:53
#: settings/templates/settings/_ldap_list_users_modal.html:92
#: settings/templates/settings/_ldap_list_users_modal.html:92
#: templates/_modal.html:22
#: templates/_modal.html:22
msgid "Close"
msgid "Close"
msgstr "关闭"
msgstr "关闭"
#: assets/templates/assets/_asset_user_list.html:
19
#: assets/templates/assets/_asset_user_list.html:
24
#: audits/templates/audits/operate_log_list.html:77
#: audits/templates/audits/operate_log_list.html:77
#: audits/templates/audits/password_change_log_list.html:59
#: audits/templates/audits/password_change_log_list.html:59
#: ops/templates/ops/task_adhoc.html:63
#: ops/templates/ops/task_adhoc.html:63
...
@@ -1480,16 +1480,16 @@ msgstr "关闭"
...
@@ -1480,16 +1480,16 @@ msgstr "关闭"
msgid "Datetime"
msgid "Datetime"
msgstr "日期"
msgstr "日期"
#: assets/templates/assets/_asset_user_list.html:
36
#: assets/templates/assets/_asset_user_list.html:
41
#: assets/templates/assets/asset_list.html:137
#: assets/templates/assets/asset_list.html:137
msgid "Test datetime: "
msgid "Test datetime: "
msgstr "测试日期: "
msgstr "测试日期: "
#: assets/templates/assets/_asset_user_list.html:
68
#: assets/templates/assets/_asset_user_list.html:
73
msgid "View"
msgid "View"
msgstr "查看"
msgstr "查看"
#: assets/templates/assets/_asset_user_list.html:7
0
#: assets/templates/assets/_asset_user_list.html:7
5
#: assets/templates/assets/admin_user_assets.html:61
#: assets/templates/assets/admin_user_assets.html:61
#: assets/templates/assets/asset_asset_user_list.html:57
#: assets/templates/assets/asset_asset_user_list.html:57
#: assets/templates/assets/asset_detail.html:178
#: assets/templates/assets/asset_detail.html:178
...
@@ -1498,7 +1498,7 @@ msgstr "查看"
...
@@ -1498,7 +1498,7 @@ msgstr "查看"
msgid "Test"
msgid "Test"
msgstr "测试"
msgstr "测试"
#: assets/templates/assets/_asset_user_list.html:7
1
#: assets/templates/assets/_asset_user_list.html:7
6
#: assets/templates/assets/system_user_assets.html:72
#: assets/templates/assets/system_user_assets.html:72
#: assets/templates/assets/system_user_detail.html:142
#: assets/templates/assets/system_user_detail.html:142
msgid "Push"
msgid "Push"
...
@@ -1508,7 +1508,7 @@ msgstr "推送"
...
@@ -1508,7 +1508,7 @@ msgstr "推送"
msgid "Test gateway test connection"
msgid "Test gateway test connection"
msgstr "测试连接网关"
msgstr "测试连接网关"
#: assets/templates/assets/_gateway_test_modal.html:10 terminal/models.py:2
4
#: assets/templates/assets/_gateway_test_modal.html:10 terminal/models.py:2
5
msgid "SSH Port"
msgid "SSH Port"
msgstr "SSH端口"
msgstr "SSH端口"
...
@@ -1754,7 +1754,7 @@ msgid "Date joined"
...
@@ -1754,7 +1754,7 @@ msgid "Date joined"
msgstr "创建日期"
msgstr "创建日期"
#: assets/templates/assets/asset_detail.html:150 authentication/models.py:15
#: assets/templates/assets/asset_detail.html:150 authentication/models.py:15
#: authentication/templates/authentication/_access_key_modal.html:3
1
#: authentication/templates/authentication/_access_key_modal.html:3
2
#: perms/models/base.py:51
#: perms/models/base.py:51
#: perms/templates/perms/asset_permission_create_update.html:55
#: perms/templates/perms/asset_permission_create_update.html:55
#: perms/templates/perms/asset_permission_detail.html:120
#: perms/templates/perms/asset_permission_detail.html:120
...
@@ -2171,7 +2171,7 @@ msgstr "系统用户资产"
...
@@ -2171,7 +2171,7 @@ msgstr "系统用户资产"
#: audits/templates/audits/ftp_log_list.html:76
#: audits/templates/audits/ftp_log_list.html:76
#: audits/templates/audits/operate_log_list.html:76
#: audits/templates/audits/operate_log_list.html:76
#: audits/templates/audits/password_change_log_list.html:58
#: audits/templates/audits/password_change_log_list.html:58
#: terminal/models.py:1
59
terminal/templates/terminal/session_list.html:30
#: terminal/models.py:1
60
terminal/templates/terminal/session_list.html:30
#: terminal/templates/terminal/session_list.html:74
#: terminal/templates/terminal/session_list.html:74
#: terminal/templates/terminal/terminal_detail.html:47
#: terminal/templates/terminal/terminal_detail.html:47
msgid "Remote addr"
msgid "Remote addr"
...
@@ -2197,7 +2197,7 @@ msgid "Success"
...
@@ -2197,7 +2197,7 @@ msgid "Success"
msgstr "成功"
msgstr "成功"
#: audits/models.py:32
#: audits/models.py:32
#: authentication/templates/authentication/_access_key_modal.html:2
1
#: authentication/templates/authentication/_access_key_modal.html:2
2
#: xpack/plugins/vault/templates/vault/vault.html:46
#: xpack/plugins/vault/templates/vault/vault.html:46
msgid "Create"
msgid "Create"
msgstr "创建"
msgstr "创建"
...
@@ -2282,7 +2282,7 @@ msgstr "登录日期"
...
@@ -2282,7 +2282,7 @@ msgstr "登录日期"
#: ops/templates/ops/task_history.html:58 perms/models/base.py:52
#: ops/templates/ops/task_history.html:58 perms/models/base.py:52
#: perms/templates/perms/asset_permission_detail.html:86
#: perms/templates/perms/asset_permission_detail.html:86
#: perms/templates/perms/remote_app_permission_detail.html:78
#: perms/templates/perms/remote_app_permission_detail.html:78
#: terminal/models.py:16
6
terminal/templates/terminal/session_list.html:34
#: terminal/models.py:16
7
terminal/templates/terminal/session_list.html:34
#: xpack/plugins/change_auth_plan/models.py:249
#: xpack/plugins/change_auth_plan/models.py:249
#: xpack/plugins/change_auth_plan/models.py:419
#: xpack/plugins/change_auth_plan/models.py:419
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:59
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:59
...
@@ -2310,7 +2310,7 @@ msgid "Search"
...
@@ -2310,7 +2310,7 @@ msgid "Search"
msgstr "搜索"
msgstr "搜索"
#: audits/templates/audits/login_log_list.html:56
#: audits/templates/audits/login_log_list.html:56
#: authentication/templates/authentication/_access_key_modal.html:
29
#: authentication/templates/authentication/_access_key_modal.html:
30
#: ops/templates/ops/adhoc_detail.html:49
#: ops/templates/ops/adhoc_detail.html:49
#: ops/templates/ops/adhoc_history_detail.html:49
#: ops/templates/ops/adhoc_history_detail.html:49
#: ops/templates/ops/task_detail.html:56
#: ops/templates/ops/task_detail.html:56
...
@@ -2329,7 +2329,7 @@ msgid "City"
...
@@ -2329,7 +2329,7 @@ msgid "City"
msgstr "城市"
msgstr "城市"
#: audits/templates/audits/login_log_list.html:65
#: audits/templates/audits/login_log_list.html:65
#: authentication/templates/authentication/_access_key_modal.html:3
2
#: authentication/templates/authentication/_access_key_modal.html:3
3
#: ops/templates/ops/task_list.html:16
#: ops/templates/ops/task_list.html:16
msgid "Date"
msgid "Date"
msgstr "日期"
msgstr "日期"
...
@@ -2490,27 +2490,27 @@ msgstr "API Key列表"
...
@@ -2490,27 +2490,27 @@ msgstr "API Key列表"
msgid "Using api key sign api header, every requests header difference"
msgid "Using api key sign api header, every requests header difference"
msgstr "使用api key签名请求头,每个请求的头部是不一样的"
msgstr "使用api key签名请求头,每个请求的头部是不一样的"
#: authentication/templates/authentication/_access_key_modal.html:1
8
#: authentication/templates/authentication/_access_key_modal.html:1
9
msgid "docs"
msgid "docs"
msgstr "文档"
msgstr "文档"
#: authentication/templates/authentication/_access_key_modal.html:3
0
#: authentication/templates/authentication/_access_key_modal.html:3
1
msgid "Secret"
msgid "Secret"
msgstr "密文"
msgstr "密文"
#: authentication/templates/authentication/_access_key_modal.html:4
7
#: authentication/templates/authentication/_access_key_modal.html:4
8
#: users/templates/users/_granted_assets.html:75
#: users/templates/users/_granted_assets.html:75
msgid "Show"
msgid "Show"
msgstr "显示"
msgstr "显示"
#: authentication/templates/authentication/_access_key_modal.html:6
5
#: authentication/templates/authentication/_access_key_modal.html:6
6
#: users/models/user.py:330 users/templates/users/user_profile.html:94
#: users/models/user.py:330 users/templates/users/user_profile.html:94
#: users/templates/users/user_profile.html:163
#: users/templates/users/user_profile.html:163
#: users/templates/users/user_profile.html:166
#: users/templates/users/user_profile.html:166
msgid "Disable"
msgid "Disable"
msgstr "禁用"
msgstr "禁用"
#: authentication/templates/authentication/_access_key_modal.html:6
6
#: authentication/templates/authentication/_access_key_modal.html:6
7
#: users/models/user.py:331 users/templates/users/user_profile.html:92
#: users/models/user.py:331 users/templates/users/user_profile.html:92
#: users/templates/users/user_profile.html:170
#: users/templates/users/user_profile.html:170
msgid "Enable"
msgid "Enable"
...
@@ -2740,6 +2740,10 @@ msgstr ""
...
@@ -2740,6 +2740,10 @@ msgstr ""
"<div>Luna是单独部署的一个程序,你需要部署luna,koko, </div><div>如果你看到了"
"<div>Luna是单独部署的一个程序,你需要部署luna,koko, </div><div>如果你看到了"
"这个页面,证明你访问的不是nginx监听的端口,祝你好运</div>"
"这个页面,证明你访问的不是nginx监听的端口,祝你好运</div>"
#: jumpserver/views.py:233
msgid "Websocket server run on port: {}, you should proxy it on nginx"
msgstr ""
#: ops/api/celery.py:54
#: ops/api/celery.py:54
msgid "Waiting task start"
msgid "Waiting task start"
msgstr "等待任务开始"
msgstr "等待任务开始"
...
@@ -2752,7 +2756,7 @@ msgstr ""
...
@@ -2752,7 +2756,7 @@ msgstr ""
msgid "Interval"
msgid "Interval"
msgstr "间隔"
msgstr "间隔"
#: ops/models/adhoc.py:38 settings/forms.py:1
58
#: ops/models/adhoc.py:38 settings/forms.py:1
62
msgid "Units: seconds"
msgid "Units: seconds"
msgstr "单位: 秒"
msgstr "单位: 秒"
...
@@ -3064,7 +3068,7 @@ msgstr "版本"
...
@@ -3064,7 +3068,7 @@ msgstr "版本"
msgid "Run"
msgid "Run"
msgstr "执行"
msgstr "执行"
#: ops/templates/ops/task_list.html:10
9
#: ops/templates/ops/task_list.html:10
8
msgid "Task start: "
msgid "Task start: "
msgstr "任务开始: "
msgstr "任务开始: "
...
@@ -3095,7 +3099,7 @@ msgstr "命令执行列表"
...
@@ -3095,7 +3099,7 @@ msgstr "命令执行列表"
msgid "Command execution"
msgid "Command execution"
msgstr "命令执行"
msgstr "命令执行"
#: orgs/mixins/models.py:61 orgs/mixins/serializers.py:26 orgs/models.py:3
0
#: orgs/mixins/models.py:61 orgs/mixins/serializers.py:26 orgs/models.py:3
1
msgid "Organization"
msgid "Organization"
msgstr "组织"
msgstr "组织"
...
@@ -3107,7 +3111,7 @@ msgstr "未分组"
...
@@ -3107,7 +3111,7 @@ msgstr "未分组"
msgid "Empty"
msgid "Empty"
msgstr "空"
msgstr "空"
#: perms/forms/asset_permission.py:7
6 perms/forms/remote_app_permission.py:34
#: perms/forms/asset_permission.py:7
7 perms/forms/remote_app_permission.py:37
#: perms/models/base.py:50 perms/templates/perms/asset_permission_list.html:51
#: perms/models/base.py:50 perms/templates/perms/asset_permission_list.html:51
#: perms/templates/perms/asset_permission_list.html:71
#: perms/templates/perms/asset_permission_list.html:71
#: perms/templates/perms/asset_permission_list.html:118
#: perms/templates/perms/asset_permission_list.html:118
...
@@ -3120,21 +3124,21 @@ msgstr "空"
...
@@ -3120,21 +3124,21 @@ msgstr "空"
msgid "User group"
msgid "User group"
msgstr "用户组"
msgstr "用户组"
#: perms/forms/asset_permission.py:9
2
#: perms/forms/asset_permission.py:9
3
msgid ""
msgid ""
"Tips: The RDP protocol does not support separate controls for uploading or "
"Tips: The RDP protocol does not support separate controls for uploading or "
"downloading files"
"downloading files"
msgstr "提示:RDP 协议不支持单独控制上传或下载文件"
msgstr "提示:RDP 协议不支持单独控制上传或下载文件"
#: perms/forms/asset_permission.py:10
2 perms/forms/remote_app_permission.py:50
#: perms/forms/asset_permission.py:10
3 perms/forms/remote_app_permission.py:53
msgid "User or group at least one required"
msgid "User or group at least one required"
msgstr "用户和用户组至少选一个"
msgstr "用户和用户组至少选一个"
#: perms/forms/asset_permission.py:11
1
#: perms/forms/asset_permission.py:11
2
msgid "Asset or group at least one required"
msgid "Asset or group at least one required"
msgstr "资产和节点至少选一个"
msgstr "资产和节点至少选一个"
#: perms/models/asset_permission.py:31 settings/forms.py:14
3
#: perms/models/asset_permission.py:31 settings/forms.py:14
7
msgid "All"
msgid "All"
msgstr "全部"
msgstr "全部"
...
@@ -3382,29 +3386,29 @@ msgstr "远程应用授权远程应用列表"
...
@@ -3382,29 +3386,29 @@ msgstr "远程应用授权远程应用列表"
msgid "Test mail sent to {}, please check"
msgid "Test mail sent to {}, please check"
msgstr "邮件已经发送{}, 请检查"
msgstr "邮件已经发送{}, 请检查"
#: settings/api.py:5
3
#: settings/api.py:5
5
msgid "Test ldap success"
msgid "Test ldap success"
msgstr "连接LDAP成功"
msgstr "连接LDAP成功"
#: settings/api.py:9
0
#: settings/api.py:9
2
msgid "Match {} s users"
msgid "Match {} s users"
msgstr "匹配 {} 个用户"
msgstr "匹配 {} 个用户"
#: settings/api.py:16
1
#: settings/api.py:16
3
msgid "succeed: {} failed: {} total: {}"
msgid "succeed: {} failed: {} total: {}"
msgstr "成功:{} 失败:{} 总数:{}"
msgstr "成功:{} 失败:{} 总数:{}"
#: settings/api.py:18
3 settings/api.py:219
#: settings/api.py:18
5 settings/api.py:221
msgid ""
msgid ""
"Error: Account invalid (Please make sure the information such as Access key "
"Error: Account invalid (Please make sure the information such as Access key "
"or Secret key is correct)"
"or Secret key is correct)"
msgstr "错误:账户无效 (请确保 Access key 或 Secret key 等信息正确)"
msgstr "错误:账户无效 (请确保 Access key 或 Secret key 等信息正确)"
#: settings/api.py:1
89 settings/api.py:225
#: settings/api.py:1
91 settings/api.py:227
msgid "Create succeed"
msgid "Create succeed"
msgstr "创建成功"
msgstr "创建成功"
#: settings/api.py:20
7 settings/api.py:245
#: settings/api.py:20
9 settings/api.py:247
#: settings/templates/settings/terminal_setting.html:154
#: settings/templates/settings/terminal_setting.html:154
msgid "Delete succeed"
msgid "Delete succeed"
msgstr "删除成功"
msgstr "删除成功"
...
@@ -3458,51 +3462,59 @@ msgid "Tips: Send mail account, default SMTP account as the send account"
...
@@ -3458,51 +3462,59 @@ msgid "Tips: Send mail account, default SMTP account as the send account"
msgstr "提示:发送邮件账号,默认使用SMTP账号作为发送账号"
msgstr "提示:发送邮件账号,默认使用SMTP账号作为发送账号"
#: settings/forms.py:93
#: settings/forms.py:93
msgid "Test recipient"
msgstr "测试收件人"
#: settings/forms.py:94
msgid "Tips: Used only as a test mail recipient"
msgstr "提示:仅用来作为测试邮件收件人"
#: settings/forms.py:97
msgid "Use SSL"
msgid "Use SSL"
msgstr "使用SSL"
msgstr "使用SSL"
#: settings/forms.py:9
4
#: settings/forms.py:9
8
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/forms.py:
97
#: settings/forms.py:
101
msgid "Use TLS"
msgid "Use TLS"
msgstr "使用TLS"
msgstr "使用TLS"
#: settings/forms.py:
98
#: settings/forms.py:
102
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/forms.py:10
4
#: settings/forms.py:10
8
msgid "LDAP server"
msgid "LDAP server"
msgstr "LDAP地址"
msgstr "LDAP地址"
#: settings/forms.py:1
07
#: settings/forms.py:1
11
msgid "Bind DN"
msgid "Bind DN"
msgstr "绑定DN"
msgstr "绑定DN"
#: settings/forms.py:11
4
#: settings/forms.py:11
8
msgid "User OU"
msgid "User OU"
msgstr "用户OU"
msgstr "用户OU"
#: settings/forms.py:11
5
#: settings/forms.py:11
9
msgid "Use | split User OUs"
msgid "Use | split User OUs"
msgstr "使用|分隔各OU"
msgstr "使用|分隔各OU"
#: settings/forms.py:1
19
#: settings/forms.py:1
23
msgid "User search filter"
msgid "User search filter"
msgstr "用户过滤器"
msgstr "用户过滤器"
#: settings/forms.py:12
0
#: settings/forms.py:12
4
#, 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/forms.py:12
3
#: settings/forms.py:12
7
msgid "User attr map"
msgid "User attr map"
msgstr "LDAP属性映射"
msgstr "LDAP属性映射"
#: settings/forms.py:12
5
#: settings/forms.py:12
9
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"
...
@@ -3510,39 +3522,39 @@ msgstr ""
...
@@ -3510,39 +3522,39 @@ msgstr ""
"用户属性映射代表怎样将LDAP中用户属性映射到jumpserver用户上,username, name,"
"用户属性映射代表怎样将LDAP中用户属性映射到jumpserver用户上,username, name,"
"email 是jumpserver的属性"
"email 是jumpserver的属性"
#: settings/forms.py:13
4
#: settings/forms.py:13
8
msgid "Enable LDAP auth"
msgid "Enable LDAP auth"
msgstr "启用LDAP认证"
msgstr "启用LDAP认证"
#: settings/forms.py:14
4
#: settings/forms.py:14
8
msgid "Auto"
msgid "Auto"
msgstr "自动"
msgstr "自动"
#: settings/forms.py:15
1
#: settings/forms.py:15
5
msgid "Password auth"
msgid "Password auth"
msgstr "密码认证"
msgstr "密码认证"
#: settings/forms.py:15
4
#: settings/forms.py:15
8
msgid "Public key auth"
msgid "Public key auth"
msgstr "密钥认证"
msgstr "密钥认证"
#: settings/forms.py:1
57
#: settings/forms.py:1
61
msgid "Heartbeat interval"
msgid "Heartbeat interval"
msgstr "心跳间隔"
msgstr "心跳间隔"
#: settings/forms.py:16
1
#: settings/forms.py:16
5
msgid "List sort by"
msgid "List sort by"
msgstr "资产列表排序"
msgstr "资产列表排序"
#: settings/forms.py:16
4
#: settings/forms.py:16
8
msgid "List page size"
msgid "List page size"
msgstr "资产分页每页数量"
msgstr "资产分页每页数量"
#: settings/forms.py:1
67
#: settings/forms.py:1
71
msgid "Session keep duration"
msgid "Session keep duration"
msgstr "会话保留时长"
msgstr "会话保留时长"
#: settings/forms.py:1
68
#: settings/forms.py:1
72
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"
...
@@ -3550,72 +3562,72 @@ msgstr ""
...
@@ -3550,72 +3562,72 @@ msgstr ""
"单位:天。 会话、录像、命令记录超过该时长将会被删除(仅影响数据库存储, oss等不"
"单位:天。 会话、录像、命令记录超过该时长将会被删除(仅影响数据库存储, oss等不"
"受影响)"
"受影响)"
#: settings/forms.py:17
2
#: settings/forms.py:17
6
msgid "Telnet login regex"
msgid "Telnet login regex"
msgstr "Telnet 成功正则表达式"
msgstr "Telnet 成功正则表达式"
#: settings/forms.py:17
3
#: settings/forms.py:17
7
msgid "ex: Last\\s*login|success|成功"
msgid "ex: Last\\s*login|success|成功"
msgstr ""
msgstr ""
"登录telnet服务器成功后的提示正则表达式,如: Last\\s*login|success|成功 "
"登录telnet服务器成功后的提示正则表达式,如: Last\\s*login|success|成功 "
#: settings/forms.py:18
4
#: settings/forms.py:18
8
msgid "MFA Secondary certification"
msgid "MFA Secondary certification"
msgstr "MFA 二次认证"
msgstr "MFA 二次认证"
#: settings/forms.py:1
86
#: settings/forms.py:1
90
msgid ""
msgid ""
"After opening, the user login must use MFA secondary authentication (valid "
"After opening, the user login must use MFA secondary authentication (valid "
"for all users, including administrators)"
"for all users, including administrators)"
msgstr "开启后,用户登录必须使用MFA二次认证(对所有用户有效,包括管理员)"
msgstr "开启后,用户登录必须使用MFA二次认证(对所有用户有效,包括管理员)"
#: settings/forms.py:19
2
#: settings/forms.py:19
6
msgid "Batch execute commands"
msgid "Batch execute commands"
msgstr "批量命令"
msgstr "批量命令"
#: settings/forms.py:19
3
#: settings/forms.py:19
7
msgid "Allow user batch execute commands"
msgid "Allow user batch execute commands"
msgstr "允许用户批量执行命令"
msgstr "允许用户批量执行命令"
#: settings/forms.py:
196
#: settings/forms.py:
200
msgid "Service account registration"
msgid "Service account registration"
msgstr "终端注册"
msgstr "终端注册"
#: settings/forms.py:
197
#: settings/forms.py:
201
msgid ""
msgid ""
"Allow using bootstrap token register service account, when terminal setup, "
"Allow using bootstrap token register service account, when terminal setup, "
"can disable it"
"can disable it"
msgstr "允许使用bootstrap token注册终端, 当终端注册成功后可以禁止"
msgstr "允许使用bootstrap token注册终端, 当终端注册成功后可以禁止"
#: settings/forms.py:20
3
#: settings/forms.py:20
7
msgid "Limit the number of login failures"
msgid "Limit the number of login failures"
msgstr "限制登录失败次数"
msgstr "限制登录失败次数"
#: settings/forms.py:2
07
#: settings/forms.py:2
11
msgid "No logon interval"
msgid "No logon interval"
msgstr "禁止登录时间间隔"
msgstr "禁止登录时间间隔"
#: settings/forms.py:2
09
#: settings/forms.py:2
13
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/forms.py:2
16
#: settings/forms.py:2
20
msgid "Connection max idle time"
msgid "Connection max idle time"
msgstr "SSH最大空闲时间"
msgstr "SSH最大空闲时间"
#: settings/forms.py:2
18
#: settings/forms.py:2
22
msgid ""
msgid ""
"If idle time more than it, disconnect connection(only ssh now) Unit: minute"
"If idle time more than it, disconnect connection(only ssh now) Unit: minute"
msgstr "提示:(单位:分)如果超过该配置没有操作,连接会被断开(仅ssh)"
msgstr "提示:(单位:分)如果超过该配置没有操作,连接会被断开(仅ssh)"
#: settings/forms.py:22
4
#: settings/forms.py:22
8
msgid "Password expiration time"
msgid "Password expiration time"
msgstr "密码过期时间"
msgstr "密码过期时间"
#: settings/forms.py:2
26
#: settings/forms.py:2
30
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 "
...
@@ -3625,81 +3637,81 @@ msgstr ""
...
@@ -3625,81 +3637,81 @@ msgstr ""
"提示:(单位:天)如果用户在此期间没有更新密码,用户密码将过期失效; 密码过期"
"提示:(单位:天)如果用户在此期间没有更新密码,用户密码将过期失效; 密码过期"
"提醒邮件将在密码过期前5天内由系统(每天)自动发送给用户"
"提醒邮件将在密码过期前5天内由系统(每天)自动发送给用户"
#: settings/forms.py:23
5
#: settings/forms.py:23
9
msgid "Password minimum length"
msgid "Password minimum length"
msgstr "密码最小长度 "
msgstr "密码最小长度 "
#: settings/forms.py:2
39
#: settings/forms.py:2
43
msgid "Must contain capital letters"
msgid "Must contain capital letters"
msgstr "必须包含大写字母"
msgstr "必须包含大写字母"
#: settings/forms.py:24
1
#: settings/forms.py:24
5
msgid ""
msgid ""
"After opening, the user password changes and resets must contain uppercase "
"After opening, the user password changes and resets must contain uppercase "
"letters"
"letters"
msgstr "开启后,用户密码修改、重置必须包含大写字母"
msgstr "开启后,用户密码修改、重置必须包含大写字母"
#: settings/forms.py:2
46
#: settings/forms.py:2
50
msgid "Must contain lowercase letters"
msgid "Must contain lowercase letters"
msgstr "必须包含小写字母"
msgstr "必须包含小写字母"
#: settings/forms.py:2
47
#: settings/forms.py:2
51
msgid ""
msgid ""
"After opening, the user password changes and resets must contain lowercase "
"After opening, the user password changes and resets must contain lowercase "
"letters"
"letters"
msgstr "开启后,用户密码修改、重置必须包含小写字母"
msgstr "开启后,用户密码修改、重置必须包含小写字母"
#: settings/forms.py:25
2
#: settings/forms.py:25
6
msgid "Must contain numeric characters"
msgid "Must contain numeric characters"
msgstr "必须包含数字字符"
msgstr "必须包含数字字符"
#: settings/forms.py:25
3
#: settings/forms.py:25
7
msgid ""
msgid ""
"After opening, the user password changes and resets must contain numeric "
"After opening, the user password changes and resets must contain numeric "
"characters"
"characters"
msgstr "开启后,用户密码修改、重置必须包含数字字符"
msgstr "开启后,用户密码修改、重置必须包含数字字符"
#: settings/forms.py:2
58
#: settings/forms.py:2
62
msgid "Must contain special characters"
msgid "Must contain special characters"
msgstr "必须包含特殊字符"
msgstr "必须包含特殊字符"
#: settings/forms.py:2
59
#: settings/forms.py:2
63
msgid ""
msgid ""
"After opening, the user password changes and resets must contain special "
"After opening, the user password changes and resets must contain special "
"characters"
"characters"
msgstr "开启后,用户密码修改、重置必须包含特殊字符"
msgstr "开启后,用户密码修改、重置必须包含特殊字符"
#: settings/forms.py:2
66
#: settings/forms.py:2
70
msgid "Create user email subject"
msgid "Create user email subject"
msgstr "创建用户邮件的主题"
msgstr "创建用户邮件的主题"
#: settings/forms.py:2
67
#: settings/forms.py:2
71
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/forms.py:27
1
#: settings/forms.py:27
5
msgid "Create user honorific"
msgid "Create user honorific"
msgstr "创建用户邮件的敬语"
msgstr "创建用户邮件的敬语"
#: settings/forms.py:27
2
#: settings/forms.py:27
6
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/forms.py:2
77
#: settings/forms.py:2
81
msgid "Create user email content"
msgid "Create user email content"
msgstr "创建用户邮件的内容"
msgstr "创建用户邮件的内容"
#: settings/forms.py:2
78
#: settings/forms.py:2
82
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/forms.py:28
1
#: settings/forms.py:28
5
msgid "Signature"
msgid "Signature"
msgstr "署名"
msgstr "署名"
#: settings/forms.py:28
2
#: settings/forms.py:28
6
msgid "Tips: Email signature (eg:jumpserver)"
msgid "Tips: Email signature (eg:jumpserver)"
msgstr "提示: 邮件的署名 (例如: jumpserver)"
msgstr "提示: 邮件的署名 (例如: jumpserver)"
...
@@ -3894,12 +3906,12 @@ msgid "Password check rule"
...
@@ -3894,12 +3906,12 @@ msgid "Password check rule"
msgstr "密码校验规则"
msgstr "密码校验规则"
#: settings/templates/settings/terminal_setting.html:79 terminal/forms.py:27
#: settings/templates/settings/terminal_setting.html:79 terminal/forms.py:27
#: terminal/models.py:2
6
#: terminal/models.py:2
7
msgid "Command storage"
msgid "Command storage"
msgstr "命令存储"
msgstr "命令存储"
#: settings/templates/settings/terminal_setting.html:101 terminal/forms.py:32
#: settings/templates/settings/terminal_setting.html:101 terminal/forms.py:32
#: terminal/models.py:2
7
#: terminal/models.py:2
8
msgid "Replay storage"
msgid "Replay storage"
msgstr "录像存储"
msgstr "录像存储"
...
@@ -3911,11 +3923,11 @@ msgstr "删除失败"
...
@@ -3911,11 +3923,11 @@ msgstr "删除失败"
msgid "Are you sure about deleting it?"
msgid "Are you sure about deleting it?"
msgstr "您确定删除吗?"
msgstr "您确定删除吗?"
#: settings/utils.py:9
0
#: settings/utils.py:9
1
msgid "Search no entry matched in ou {}"
msgid "Search no entry matched in ou {}"
msgstr "在ou:{}中没有匹配条目"
msgstr "在ou:{}中没有匹配条目"
#: settings/utils.py:1
22
#: settings/utils.py:1
46
msgid "The user source is not LDAP"
msgid "The user source is not LDAP"
msgstr "用户来源不是LDAP"
msgstr "用户来源不是LDAP"
...
@@ -4340,51 +4352,51 @@ msgstr ""
...
@@ -4340,51 +4352,51 @@ msgstr ""
"录像文件支持存储到服务器端硬盘、AWS S3、 阿里云 OSS 中,默认存储到服务器端硬"
"录像文件支持存储到服务器端硬盘、AWS S3、 阿里云 OSS 中,默认存储到服务器端硬"
"盘, 更多查看文档"
"盘, 更多查看文档"
#: terminal/models.py:2
3
#: terminal/models.py:2
4
msgid "Remote Address"
msgid "Remote Address"
msgstr "远端地址"
msgstr "远端地址"
#: terminal/models.py:2
5
#: terminal/models.py:2
6
msgid "HTTP Port"
msgid "HTTP Port"
msgstr "HTTP端口"
msgstr "HTTP端口"
#: terminal/models.py:12
5
#: terminal/models.py:12
6
msgid "Session Online"
msgid "Session Online"
msgstr "在线会话"
msgstr "在线会话"
#: terminal/models.py:12
6
#: terminal/models.py:12
7
msgid "CPU Usage"
msgid "CPU Usage"
msgstr "CPU使用"
msgstr "CPU使用"
#: terminal/models.py:12
7
#: terminal/models.py:12
8
msgid "Memory Used"
msgid "Memory Used"
msgstr "内存使用"
msgstr "内存使用"
#: terminal/models.py:12
8
#: terminal/models.py:12
9
msgid "Connections"
msgid "Connections"
msgstr "连接数"
msgstr "连接数"
#: terminal/models.py:1
29
#: terminal/models.py:1
30
msgid "Threads"
msgid "Threads"
msgstr "线程数"
msgstr "线程数"
#: terminal/models.py:13
0
#: terminal/models.py:13
1
msgid "Boot Time"
msgid "Boot Time"
msgstr "运行时间"
msgstr "运行时间"
#: terminal/models.py:16
1
terminal/templates/terminal/session_list.html:136
#: terminal/models.py:16
2
terminal/templates/terminal/session_list.html:136
msgid "Replay"
msgid "Replay"
msgstr "回放"
msgstr "回放"
#: terminal/models.py:16
5
#: terminal/models.py:16
6
msgid "Date last active"
msgid "Date last active"
msgstr "最后活跃日期"
msgstr "最后活跃日期"
#: terminal/models.py:16
7
#: terminal/models.py:16
8
msgid "Date end"
msgid "Date end"
msgstr "结束日期"
msgstr "结束日期"
#: terminal/models.py:26
0
#: terminal/models.py:26
1
msgid "Args"
msgid "Args"
msgstr "参数"
msgstr "参数"
...
@@ -4512,7 +4524,7 @@ msgid ""
...
@@ -4512,7 +4524,7 @@ msgid ""
"You should use your ssh client tools connect terminal: {} <br /> <br />{}"
"You should use your ssh client tools connect terminal: {} <br /> <br />{}"
msgstr "你可以使用ssh客户端工具连接终端"
msgstr "你可以使用ssh客户端工具连接终端"
#: users/api/user.py:17
3
#: users/api/user.py:17
6
msgid "Could not reset self otp, use profile reset instead"
msgid "Could not reset self otp, use profile reset instead"
msgstr "不能再该页面重置MFA, 请去个人信息页面重置"
msgstr "不能再该页面重置MFA, 请去个人信息页面重置"
...
@@ -4626,7 +4638,7 @@ msgid "Paste your id_rsa.pub here."
...
@@ -4626,7 +4638,7 @@ msgid "Paste your id_rsa.pub here."
msgstr "复制你的公钥到这里"
msgstr "复制你的公钥到这里"
#: users/forms.py:269 users/forms.py:274 users/forms.py:316
#: users/forms.py:269 users/forms.py:274 users/forms.py:316
#: xpack/plugins/orgs/forms.py:
30
#: xpack/plugins/orgs/forms.py:
18
msgid "Select users"
msgid "Select users"
msgstr "选择用户"
msgstr "选择用户"
...
@@ -4643,7 +4655,7 @@ msgstr "管理员"
...
@@ -4643,7 +4655,7 @@ msgstr "管理员"
msgid "Application"
msgid "Application"
msgstr "应用程序"
msgstr "应用程序"
#: users/models/user.py:129 xpack/plugins/orgs/forms.py:3
8
#: users/models/user.py:129 xpack/plugins/orgs/forms.py:3
0
#: xpack/plugins/orgs/templates/orgs/org_list.html:14
#: xpack/plugins/orgs/templates/orgs/org_list.html:14
msgid "Auditor"
msgid "Auditor"
msgstr "审计员"
msgstr "审计员"
...
@@ -5639,9 +5651,9 @@ msgstr "否"
...
@@ -5639,9 +5651,9 @@ msgstr "否"
msgid "Run plan manually"
msgid "Run plan manually"
msgstr "手动执行计划"
msgstr "手动执行计划"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:17
9
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:17
8
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:10
3
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:10
2
#: xpack/plugins/gathered_user/templates/gathered_user/task_list.html:9
1
#: xpack/plugins/gathered_user/templates/gathered_user/task_list.html:9
0
msgid "Execute failed"
msgid "Execute failed"
msgstr "执行失败"
msgstr "执行失败"
...
@@ -5658,7 +5670,7 @@ msgstr "日志"
...
@@ -5658,7 +5670,7 @@ msgstr "日志"
msgid "Retry"
msgid "Retry"
msgstr "重试"
msgstr "重试"
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:9
6
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:9
5
msgid "Run failed"
msgid "Run failed"
msgstr "执行失败"
msgstr "执行失败"
...
@@ -5707,7 +5719,7 @@ msgstr "选择实例"
...
@@ -5707,7 +5719,7 @@ msgstr "选择实例"
msgid "Select node"
msgid "Select node"
msgstr "选择节点"
msgstr "选择节点"
#: xpack/plugins/cloud/forms.py:82 xpack/plugins/orgs/forms.py:
18
#: xpack/plugins/cloud/forms.py:82 xpack/plugins/orgs/forms.py:
21
msgid "Select admins"
msgid "Select admins"
msgstr "选择管理员"
msgstr "选择管理员"
...
@@ -6127,24 +6139,24 @@ msgstr "许可证导入成功"
...
@@ -6127,24 +6139,24 @@ msgstr "许可证导入成功"
msgid "License is invalid"
msgid "License is invalid"
msgstr "无效的许可证"
msgstr "无效的许可证"
#: xpack/plugins/orgs/forms.py:14
#: xpack/plugins/orgs/forms.py:24
msgid "Select auditor"
msgstr "选择审计员"
#: xpack/plugins/orgs/forms.py:29
#: xpack/plugins/orgs/templates/orgs/org_detail.html:76
#: xpack/plugins/orgs/templates/orgs/org_detail.html:76
#: xpack/plugins/orgs/templates/orgs/org_list.html:13
#: xpack/plugins/orgs/templates/orgs/org_list.html:13
msgid "Admin"
msgid "Admin"
msgstr "管理员"
msgstr "管理员"
#: xpack/plugins/orgs/forms.py:42
msgid "Select auditor"
msgstr "选择审计员"
#: xpack/plugins/orgs/meta.py:8 xpack/plugins/orgs/views.py:26
#: xpack/plugins/orgs/meta.py:8 xpack/plugins/orgs/views.py:26
#: xpack/plugins/orgs/views.py:43 xpack/plugins/orgs/views.py:6
0
#: xpack/plugins/orgs/views.py:43 xpack/plugins/orgs/views.py:6
1
#: xpack/plugins/orgs/views.py:7
7
#: xpack/plugins/orgs/views.py:7
9
msgid "Organizations"
msgid "Organizations"
msgstr "组织管理"
msgstr "组织管理"
#: xpack/plugins/orgs/templates/orgs/org_detail.html:22
#: xpack/plugins/orgs/templates/orgs/org_detail.html:22
#: xpack/plugins/orgs/views.py:
78
#: xpack/plugins/orgs/views.py:
80
msgid "Org detail"
msgid "Org detail"
msgstr "组织详情"
msgstr "组织详情"
...
@@ -6164,7 +6176,7 @@ msgstr "组织列表"
...
@@ -6164,7 +6176,7 @@ msgstr "组织列表"
msgid "Create org"
msgid "Create org"
msgstr "创建组织"
msgstr "创建组织"
#: xpack/plugins/orgs/views.py:6
1
#: xpack/plugins/orgs/views.py:6
2
msgid "Update org"
msgid "Update org"
msgstr "更新组织"
msgstr "更新组织"
...
@@ -6185,6 +6197,9 @@ msgstr "密码匣子"
...
@@ -6185,6 +6197,9 @@ msgstr "密码匣子"
msgid "vault create"
msgid "vault create"
msgstr "创建"
msgstr "创建"
#~ msgid "Recipient"
#~ msgstr "收件人"
#~ msgid "Gather user plan"
#~ msgid "Gather user plan"
#~ msgstr "收集用户计划"
#~ msgstr "收集用户计划"
...
...
apps/ops/tasks.py
View file @
719bea68
...
@@ -114,8 +114,6 @@ def hello(name, callback=None):
...
@@ -114,8 +114,6 @@ def hello(name, callback=None):
# @after_app_shutdown_clean_periodic
# @after_app_shutdown_clean_periodic
# @register_as_period_task(interval=30)
# @register_as_period_task(interval=30)
def
hello123
():
def
hello123
():
p
=
subprocess
.
Popen
(
'ls /tmp'
,
shell
=
True
)
print
(
"{} Hello world"
.
format
(
datetime
.
datetime
.
now
()
.
strftime
(
"
%
H:
%
M:
%
S"
)))
return
None
return
None
...
...
apps/ops/templates/ops/celery_task_log.html
View file @
719bea68
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
var
port
=
document
.
location
.
port
?
":"
+
document
.
location
.
port
:
""
;
var
port
=
document
.
location
.
port
?
":"
+
document
.
location
.
port
:
""
;
var
url
=
"/ws/ops/tasks/"
+
"{{ task_id }}"
+
"/log/"
;
var
url
=
"/ws/ops/tasks/"
+
"{{ task_id }}"
+
"/log/"
;
var
wsURL
=
scheme
+
"://"
+
document
.
location
.
hostname
+
port
+
url
;
var
wsURL
=
scheme
+
"://"
+
document
.
location
.
hostname
+
port
+
url
;
var
failOverPort
=
"{{ ws_port }}"
;
var
failOverWsURL
=
scheme
+
"://"
+
document
.
location
.
hostname
+
':'
+
failOverPort
+
url
;
var
term
;
var
term
;
var
ws
;
var
ws
;
...
@@ -38,13 +40,21 @@
...
@@ -38,13 +40,21 @@
});
});
term
.
open
(
document
.
getElementById
(
'term'
));
term
.
open
(
document
.
getElementById
(
'term'
));
term
.
resize
(
120
,
30
);
term
.
resize
(
120
,
30
);
ws
=
new
WebSocket
(
wsURL
);
ws
=
new
WebSocket
(
wsURL
);
ws
.
onmessage
=
function
(
e
)
{
ws
.
onmessage
=
function
(
e
)
{
var
data
=
JSON
.
parse
(
e
.
data
);
var
data
=
JSON
.
parse
(
e
.
data
);
term
.
write
(
data
.
message
);
term
.
write
(
data
.
message
);
};
};
ws
.
onerror
=
function
(
e
)
{
ws
=
new
WebSocket
(
failOverWsURL
);
ws
.
onmessage
=
function
(
e
)
{
var
data
=
JSON
.
parse
(
e
.
data
);
term
.
write
(
data
.
message
);
};
ws
.
onerror
=
function
(
e
)
{
ws
.
onerror
=
function
(
e
)
{
term
.
write
(
"Connect websocket server error"
)
term
.
write
(
"Connect websocket server error"
)
}
}
}
});
});
</script>
</script>
apps/ops/views/celery.py
View file @
719bea68
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
#
from
django.views.generic
import
TemplateView
from
django.views.generic
import
TemplateView
from
django.conf
import
settings
from
common.permissions
import
PermissionsMixin
,
IsOrgAdmin
,
IsOrgAuditor
from
common.permissions
import
PermissionsMixin
,
IsOrgAdmin
,
IsOrgAuditor
...
@@ -14,5 +15,8 @@ class CeleryTaskLogView(PermissionsMixin, TemplateView):
...
@@ -14,5 +15,8 @@ class CeleryTaskLogView(PermissionsMixin, TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
()
.
get_context_data
(
**
kwargs
)
context
=
super
()
.
get_context_data
(
**
kwargs
)
context
.
update
({
'task_id'
:
self
.
kwargs
.
get
(
'pk'
)})
context
.
update
({
'task_id'
:
self
.
kwargs
.
get
(
'pk'
),
'ws_port'
:
settings
.
CONFIG
.
WS_LISTEN_PORT
})
return
context
return
context
apps/settings/api.py
View file @
719bea68
...
@@ -30,6 +30,7 @@ class MailTestingAPI(APIView):
...
@@ -30,6 +30,7 @@ class MailTestingAPI(APIView):
serializer
=
self
.
serializer_class
(
data
=
request
.
data
)
serializer
=
self
.
serializer_class
(
data
=
request
.
data
)
if
serializer
.
is_valid
():
if
serializer
.
is_valid
():
email_from
=
serializer
.
validated_data
[
"EMAIL_FROM"
]
email_from
=
serializer
.
validated_data
[
"EMAIL_FROM"
]
email_recipient
=
serializer
.
validated_data
[
"EMAIL_RECIPIENT"
]
email_host_user
=
serializer
.
validated_data
[
"EMAIL_HOST_USER"
]
email_host_user
=
serializer
.
validated_data
[
"EMAIL_HOST_USER"
]
for
k
,
v
in
serializer
.
validated_data
.
items
():
for
k
,
v
in
serializer
.
validated_data
.
items
():
if
k
.
startswith
(
'EMAIL'
):
if
k
.
startswith
(
'EMAIL'
):
...
@@ -38,11 +39,12 @@ class MailTestingAPI(APIView):
...
@@ -38,11 +39,12 @@ class MailTestingAPI(APIView):
subject
=
"Test"
subject
=
"Test"
message
=
"Test smtp setting"
message
=
"Test smtp setting"
email_from
=
email_from
or
email_host_user
email_from
=
email_from
or
email_host_user
send_mail
(
subject
,
message
,
email_from
,
[
email_from
])
email_recipient
=
email_recipient
or
email_from
send_mail
(
subject
,
message
,
email_from
,
[
email_recipient
])
except
Exception
as
e
:
except
Exception
as
e
:
return
Response
({
"error"
:
str
(
e
)},
status
=
401
)
return
Response
({
"error"
:
str
(
e
)},
status
=
401
)
return
Response
({
"msg"
:
self
.
success_message
.
format
(
email_
host_user
)})
return
Response
({
"msg"
:
self
.
success_message
.
format
(
email_
recipient
)})
else
:
else
:
return
Response
({
"error"
:
str
(
serializer
.
errors
)},
status
=
401
)
return
Response
({
"error"
:
str
(
serializer
.
errors
)},
status
=
401
)
...
...
apps/settings/forms.py
View file @
719bea68
...
@@ -89,6 +89,10 @@ class EmailSettingForm(BaseForm):
...
@@ -89,6 +89,10 @@ class EmailSettingForm(BaseForm):
"Tips: Send mail account, default SMTP account as the send account"
"Tips: Send mail account, default SMTP account as the send account"
)
)
)
)
EMAIL_RECIPIENT
=
forms
.
CharField
(
max_length
=
128
,
label
=
_
(
"Test recipient"
),
initial
=
''
,
required
=
False
,
help_text
=
_
(
"Tips: Used only as a test mail recipient"
)
)
EMAIL_USE_SSL
=
forms
.
BooleanField
(
EMAIL_USE_SSL
=
forms
.
BooleanField
(
label
=
_
(
"Use SSL"
),
initial
=
False
,
required
=
False
,
label
=
_
(
"Use SSL"
),
initial
=
False
,
required
=
False
,
help_text
=
_
(
"If SMTP port is 465, may be select"
)
help_text
=
_
(
"If SMTP port is 465, may be select"
)
...
...
apps/settings/serializers.py
View file @
719bea68
...
@@ -7,6 +7,7 @@ class MailTestSerializer(serializers.Serializer):
...
@@ -7,6 +7,7 @@ class MailTestSerializer(serializers.Serializer):
EMAIL_HOST_USER
=
serializers
.
CharField
(
max_length
=
1024
)
EMAIL_HOST_USER
=
serializers
.
CharField
(
max_length
=
1024
)
EMAIL_HOST_PASSWORD
=
serializers
.
CharField
(
required
=
False
,
allow_blank
=
True
)
EMAIL_HOST_PASSWORD
=
serializers
.
CharField
(
required
=
False
,
allow_blank
=
True
)
EMAIL_FROM
=
serializers
.
CharField
(
required
=
False
,
allow_blank
=
True
)
EMAIL_FROM
=
serializers
.
CharField
(
required
=
False
,
allow_blank
=
True
)
EMAIL_RECIPIENT
=
serializers
.
CharField
(
required
=
False
,
allow_blank
=
True
)
EMAIL_USE_SSL
=
serializers
.
BooleanField
(
default
=
False
)
EMAIL_USE_SSL
=
serializers
.
BooleanField
(
default
=
False
)
EMAIL_USE_TLS
=
serializers
.
BooleanField
(
default
=
False
)
EMAIL_USE_TLS
=
serializers
.
BooleanField
(
default
=
False
)
...
...
apps/settings/utils.py
View file @
719bea68
...
@@ -170,7 +170,7 @@ class LDAPUtil:
...
@@ -170,7 +170,7 @@ class LDAPUtil:
email
=
construct_user_email
(
username
,
email
)
email
=
construct_user_email
(
username
,
email
)
return
email
return
email
def
create_or_update_users
(
self
,
user_items
,
force_update
=
True
):
def
create_or_update_users
(
self
,
user_items
):
succeed
=
failed
=
0
succeed
=
failed
=
0
for
user_item
in
user_items
:
for
user_item
in
user_items
:
exist
=
user_item
.
pop
(
'existing'
,
False
)
exist
=
user_item
.
pop
(
'existing'
,
False
)
...
@@ -180,13 +180,14 @@ class LDAPUtil:
...
@@ -180,13 +180,14 @@ class LDAPUtil:
else
:
else
:
ok
,
error
=
self
.
update_user
(
user_item
)
ok
,
error
=
self
.
update_user
(
user_item
)
if
not
ok
:
if
not
ok
:
logger
.
info
(
"Failed User: {}"
.
format
(
user_item
))
failed
+=
1
failed
+=
1
else
:
else
:
succeed
+=
1
succeed
+=
1
result
=
{
'total'
:
len
(
user_items
),
'succeed'
:
succeed
,
'failed'
:
failed
}
result
=
{
'total'
:
len
(
user_items
),
'succeed'
:
succeed
,
'failed'
:
failed
}
return
result
return
result
def
sync_users
(
self
,
username_list
):
def
sync_users
(
self
,
username_list
=
None
):
user_items
=
self
.
search_filter_user_items
(
username_list
)
user_items
=
self
.
search_filter_user_items
(
username_list
)
result
=
self
.
create_or_update_users
(
user_items
)
result
=
self
.
create_or_update_users
(
user_items
)
return
result
return
result
apps/users/tasks.py
View file @
719bea68
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#
#
from
celery
import
shared_task
from
celery
import
shared_task
from
django.conf
import
settings
from
ops.celery.utils
import
create_or_update_celery_periodic_tasks
from
ops.celery.utils
import
create_or_update_celery_periodic_tasks
from
ops.celery.decorator
import
after_app_ready_start
from
ops.celery.decorator
import
after_app_ready_start
...
@@ -10,6 +11,7 @@ from .models import User
...
@@ -10,6 +11,7 @@ from .models import User
from
.utils
import
(
from
.utils
import
(
send_password_expiration_reminder_mail
,
send_user_expiration_reminder_mail
send_password_expiration_reminder_mail
,
send_user_expiration_reminder_mail
)
)
from
settings.utils
import
LDAPUtil
logger
=
get_logger
(
__file__
)
logger
=
get_logger
(
__file__
)
...
@@ -66,3 +68,36 @@ def check_user_expired_periodic():
...
@@ -66,3 +68,36 @@ def check_user_expired_periodic():
}
}
create_or_update_celery_periodic_tasks
(
tasks
)
create_or_update_celery_periodic_tasks
(
tasks
)
@shared_task
def
sync_ldap_user
():
logger
.
info
(
"Start sync ldap user periodic task"
)
util
=
LDAPUtil
()
result
=
util
.
sync_users
()
logger
.
info
(
"Result: {}"
.
format
(
result
))
@shared_task
@after_app_ready_start
def
sync_ldap_user_periodic
():
if
not
settings
.
AUTH_LDAP
:
return
if
not
settings
.
AUTH_LDAP_SYNC_IS_PERIODIC
:
return
interval
=
settings
.
AUTH_LDAP_SYNC_INTERVAL
if
isinstance
(
interval
,
int
):
interval
=
interval
*
3600
else
:
interval
=
None
crontab
=
settings
.
AUTH_LDAP_SYNC_CRONTAB
tasks
=
{
'sync_ldap_user_periodic'
:
{
'task'
:
sync_ldap_user
.
name
,
'interval'
:
interval
,
'crontab'
:
crontab
,
'enabled'
:
True
,
}
}
create_or_update_celery_periodic_tasks
(
tasks
)
config_example.yml
View file @
719bea68
...
@@ -72,6 +72,13 @@ REDIS_PORT: 6379
...
@@ -72,6 +72,13 @@ REDIS_PORT: 6379
# RADIUS_PORT: 1812
# RADIUS_PORT: 1812
# RADIUS_SECRET:
# RADIUS_SECRET:
# LDAP/AD 设置定时同步参数
# 启用/禁用
# AUTH_LDAP_SYNC_IS_PERIODIC: True
# 单位: 时
# AUTH_LDAP_SYNC_INTERVAL: 12
# Crontab 表达式
# AUTH_LDAP_SYNC_CRONTAB: * 6 * * *
# OTP settings
# OTP settings
# OTP/MFA 配置
# OTP/MFA 配置
...
...
jms
View file @
719bea68
...
@@ -4,11 +4,13 @@
...
@@ -4,11 +4,13 @@
import
os
import
os
import
subprocess
import
subprocess
import
threading
import
threading
import
datetime
import
logging
import
logging
import
logging.handlers
import
logging.handlers
import
time
import
time
import
argparse
import
argparse
import
sys
import
sys
import
shutil
import
signal
import
signal
from
collections
import
defaultdict
from
collections
import
defaultdict
import
daemon
import
daemon
...
@@ -21,15 +23,15 @@ try:
...
@@ -21,15 +23,15 @@ try:
from
apps.jumpserver
import
const
from
apps.jumpserver
import
const
__version__
=
const
.
VERSION
__version__
=
const
.
VERSION
except
ImportError
as
e
:
except
ImportError
as
e
:
print
(
"Not found __version__: {}"
.
format
(
e
))
logging
.
info
(
"Not found __version__: {}"
.
format
(
e
))
print
(
"Sys path: {}"
.
format
(
sys
.
path
))
logging
.
info
(
"Sys path: {}"
.
format
(
sys
.
path
))
print
(
"Python is: "
)
logging
.
info
(
"Python is: "
)
print
(
subprocess
.
call
(
'which python'
,
shell
=
True
))
logging
.
info
(
subprocess
.
call
(
'which python'
,
shell
=
True
))
__version__
=
'Unknown'
__version__
=
'Unknown'
try
:
try
:
import
apps
import
apps
print
(
"List apps: {}"
.
format
(
os
.
listdir
(
'apps'
)))
logging
.
info
(
"List apps: {}"
.
format
(
os
.
listdir
(
'apps'
)))
print
(
'apps is: {}'
.
format
(
apps
))
logging
.
info
(
'apps is: {}'
.
format
(
apps
))
except
:
except
:
pass
pass
...
@@ -37,8 +39,8 @@ try:
...
@@ -37,8 +39,8 @@ try:
from
apps.jumpserver.conf
import
load_user_config
from
apps.jumpserver.conf
import
load_user_config
CONFIG
=
load_user_config
()
CONFIG
=
load_user_config
()
except
ImportError
as
e
:
except
ImportError
as
e
:
print
(
"Import error: {}"
.
format
(
e
))
logging
.
info
(
"Import error: {}"
.
format
(
e
))
print
(
"Could not find config file, `cp config_example.yml config.yml`"
)
logging
.
info
(
"Could not find config file, `cp config_example.yml config.yml`"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
os
.
environ
[
"PYTHONIOENCODING"
]
=
"UTF-8"
os
.
environ
[
"PYTHONIOENCODING"
]
=
"UTF-8"
...
@@ -54,11 +56,17 @@ LOG_LEVEL = CONFIG.LOG_LEVEL or 'INFO'
...
@@ -54,11 +56,17 @@ LOG_LEVEL = CONFIG.LOG_LEVEL or 'INFO'
START_TIMEOUT
=
40
START_TIMEOUT
=
40
WORKERS
=
4
WORKERS
=
4
DAEMON
=
False
DAEMON
=
False
LOG_KEEP_DAYS
=
7
logging
.
basicConfig
(
format
=
'
%(asctime)
s
%(message)
s'
,
level
=
logging
.
INFO
,
datefmt
=
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
EXIT_EVENT
=
threading
.
Event
()
EXIT_EVENT
=
threading
.
Event
()
LOCK
=
threading
.
Lock
()
LOCK
=
threading
.
Lock
()
daemon_pid_file
=
''
files_preserve
=
[]
logger
=
logging
.
getLogger
()
try
:
try
:
os
.
makedirs
(
os
.
path
.
join
(
BASE_DIR
,
"data"
,
"static"
))
os
.
makedirs
(
os
.
path
.
join
(
BASE_DIR
,
"data"
,
"static"
))
...
@@ -67,83 +75,32 @@ except:
...
@@ -67,83 +75,32 @@ except:
pass
pass
class
LogPipe
(
threading
.
Thread
):
def
__init__
(
self
,
name
,
file_path
,
to_stdout
=
False
):
"""Setup the object with a logger and a loglevel
and start the thread
"""
threading
.
Thread
.
__init__
(
self
)
self
.
daemon
=
False
self
.
name
=
name
self
.
file_path
=
file_path
self
.
to_stdout
=
to_stdout
self
.
fdRead
,
self
.
fdWrite
=
os
.
pipe
()
self
.
pipeReader
=
os
.
fdopen
(
self
.
fdRead
)
self
.
logger
=
self
.
init_logger
()
self
.
start
()
def
init_logger
(
self
):
_logger
=
logging
.
getLogger
(
self
.
name
)
_logger
.
setLevel
(
logging
.
INFO
)
_formatter
=
logging
.
Formatter
(
'
%(message)
s'
)
_handler
=
logging
.
handlers
.
RotatingFileHandler
(
self
.
file_path
,
mode
=
'a'
,
maxBytes
=
5
*
1024
*
1024
,
backupCount
=
5
)
_handler
.
setFormatter
(
_formatter
)
_handler
.
setLevel
(
logging
.
INFO
)
_logger
.
addHandler
(
_handler
)
if
self
.
to_stdout
:
_console
=
logging
.
StreamHandler
()
_console
.
setLevel
(
logging
.
INFO
)
_console
.
setFormatter
(
_formatter
)
_logger
.
addHandler
(
_console
)
return
_logger
def
fileno
(
self
):
"""Return the write file descriptor of the pipe
"""
return
self
.
fdWrite
def
run
(
self
):
"""Run the thread, logging everything.
"""
for
line
in
iter
(
self
.
pipeReader
.
readline
,
''
):
self
.
logger
.
info
(
line
.
strip
(
'
\n
'
))
self
.
pipeReader
.
close
()
def
close
(
self
):
"""Close the write end of the pipe.
"""
os
.
close
(
self
.
fdWrite
)
def
check_database_connection
():
def
check_database_connection
():
os
.
chdir
(
os
.
path
.
join
(
BASE_DIR
,
'apps'
))
os
.
chdir
(
os
.
path
.
join
(
BASE_DIR
,
'apps'
))
for
i
in
range
(
60
):
for
i
in
range
(
60
):
print
(
"Check database connection ..."
)
logging
.
info
(
"Check database connection ..."
)
code
=
subprocess
.
call
(
"python manage.py showmigrations users "
,
shell
=
True
)
code
=
subprocess
.
call
(
"python manage.py showmigrations users "
,
shell
=
True
)
if
code
==
0
:
if
code
==
0
:
print
(
"Database connect success"
)
logging
.
info
(
"Database connect success"
)
return
return
time
.
sleep
(
1
)
time
.
sleep
(
1
)
print
(
"Connection database failed, exist"
)
logging
.
info
(
"Connection database failed, exist"
)
sys
.
exit
(
10
)
sys
.
exit
(
10
)
def
make_migrations
():
def
make_migrations
():
print
(
"Check database structure change ..."
)
logging
.
info
(
"Check database structure change ..."
)
os
.
chdir
(
os
.
path
.
join
(
BASE_DIR
,
'apps'
))
os
.
chdir
(
os
.
path
.
join
(
BASE_DIR
,
'apps'
))
print
(
"Migrate model change to database ..."
)
logging
.
info
(
"Migrate model change to database ..."
)
subprocess
.
call
(
'python3 manage.py migrate'
,
shell
=
True
)
subprocess
.
call
(
'python3 manage.py migrate'
,
shell
=
True
)
def
collect_static
():
def
collect_static
():
print
(
"Collect static files"
)
logging
.
info
(
"Collect static files"
)
os
.
chdir
(
os
.
path
.
join
(
BASE_DIR
,
'apps'
))
os
.
chdir
(
os
.
path
.
join
(
BASE_DIR
,
'apps'
))
command
=
'python3 manage.py collectstatic --no-input -c &> /dev/null '
\
command
=
'python3 manage.py collectstatic --no-input -c &> /dev/null '
'&& echo "Collect static file done"'
subprocess
.
call
(
command
,
shell
=
True
)
subprocess
.
call
(
command
,
shell
=
True
)
logging
.
info
(
"Collect static files done"
)
def
prepare
():
def
prepare
():
...
@@ -213,8 +170,6 @@ def parse_service(s):
...
@@ -213,8 +170,6 @@ def parse_service(s):
return
[
'daphne'
]
return
[
'daphne'
]
elif
s
==
"task"
:
elif
s
==
"task"
:
return
[
"celery_ansible"
,
"celery_default"
,
"beat"
]
return
[
"celery_ansible"
,
"celery_default"
,
"beat"
]
elif
s
==
'gunicorn'
:
return
[
'gunicorn'
,
'flower'
]
elif
s
==
"celery"
:
elif
s
==
"celery"
:
return
[
"celery_ansible"
,
"celery_default"
]
return
[
"celery_ansible"
,
"celery_default"
]
elif
","
in
s
:
elif
","
in
s
:
...
@@ -326,40 +281,76 @@ processes = {}
...
@@ -326,40 +281,76 @@ processes = {}
def
watch_services
():
def
watch_services
():
max_retry
=
3
max_retry
=
3
signal
.
signal
(
signal
.
SIGTERM
,
lambda
x
,
y
:
clean_up
())
services_retry
=
defaultdict
(
int
)
services_retry
=
defaultdict
(
int
)
stopped_services
=
{}
stopped_services
=
{}
def
check_services
():
def
check_services
():
now
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
for
s
,
p
in
processes
.
items
():
for
s
,
p
in
processes
.
items
():
print
(
"{} Check service status: {} -> "
.
format
(
now
,
s
),
end
=
''
)
try
:
try
:
p
.
wait
(
timeout
=
1
)
p
.
wait
(
timeout
=
1
)
stopped_services
[
s
]
=
''
except
subprocess
.
TimeoutExpired
:
except
subprocess
.
TimeoutExpired
:
pass
ok
=
is_running
(
s
)
if
not
ok
:
stopped_services
[
s
]
=
''
print
(
"stopped with code: {}({})"
.
format
(
p
.
returncode
,
p
.
pid
))
else
:
print
(
"running at {}"
.
format
(
p
.
pid
))
stopped_services
.
pop
(
s
,
None
)
stopped_services
.
pop
(
s
,
None
)
services_retry
.
pop
(
s
,
None
)
services_retry
.
pop
(
s
,
None
)
continue
def
retry_start_stopped_services
():
def
retry_start_stopped_services
():
for
s
in
stopped_services
:
for
s
in
stopped_services
:
if
services_retry
[
s
]
>
max_retry
:
if
services_retry
[
s
]
>
max_retry
:
print
(
"
\n
Service start failed, exit: "
,
s
)
logging
.
info
(
"
Service start failed, exit: "
,
s
)
EXIT_EVENT
.
set
()
EXIT_EVENT
.
set
()
break
break
print
(
"
\n
> Find {} stopped, retry {}"
.
format
(
s
,
services_retry
[
s
]
+
1
)
)
p
=
start_service
(
s
)
p
=
start_service
(
s
)
logging
.
info
(
"> Find {} stopped, retry {}, {}"
.
format
(
s
,
services_retry
[
s
]
+
1
,
p
.
pid
)
)
processes
[
s
]
=
p
processes
[
s
]
=
p
services_retry
[
s
]
+=
1
services_retry
[
s
]
+=
1
def
rotate_log_if_need
():
now
=
datetime
.
datetime
.
now
()
tm
=
now
.
strftime
(
'
%
H:
%
M'
)
if
tm
!=
'23:59'
:
return
suffix
=
now
.
strftime
(
'
%
Y-
%
m-
%
d'
)
services
=
list
(
processes
.
keys
())
services
.
append
(
'jms'
)
for
s
in
services
:
log_path
=
get_log_file_path
(
s
)
log_dir
=
os
.
path
.
dirname
(
log_path
)
filename
=
os
.
path
.
basename
(
log_path
)
pre_log_dir
=
os
.
path
.
join
(
log_dir
,
suffix
)
if
not
os
.
path
.
exists
(
pre_log_dir
):
os
.
mkdir
(
pre_log_dir
)
pre_log_path
=
os
.
path
.
join
(
pre_log_dir
,
filename
)
if
os
.
path
.
isfile
(
log_path
)
and
not
os
.
path
.
isfile
(
pre_log_path
):
logging
.
info
(
"Rotate log file: {} => {}"
.
format
(
log_path
,
pre_log_path
))
shutil
.
copy
(
log_path
,
pre_log_path
)
with
open
(
log_path
,
'w'
)
as
f
:
pass
some_days_ago
=
now
-
datetime
.
timedelta
(
days
=
LOG_KEEP_DAYS
)
days_ago_dir
=
os
.
path
.
join
(
LOG_DIR
,
some_days_ago
.
strftime
(
'
%
Y-
%
m-
%
d'
))
if
os
.
path
.
exists
(
days_ago_dir
):
logger
.
info
(
"Remove old log: {}"
.
format
(
days_ago_dir
))
shutil
.
rmtree
(
days_ago_dir
,
ignore_errors
=
True
)
while
not
EXIT_EVENT
.
is_set
():
while
not
EXIT_EVENT
.
is_set
():
try
:
try
:
with
LOCK
:
with
LOCK
:
check_services
()
check_services
()
retry_start_stopped_services
()
retry_start_stopped_services
()
time
.
sleep
(
10
)
rotate_log_if_need
()
time
.
sleep
(
30
)
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
time
.
sleep
(
1
)
time
.
sleep
(
1
)
break
break
...
@@ -383,13 +374,11 @@ def start_service(s):
...
@@ -383,13 +374,11 @@ def start_service(s):
os
.
unlink
(
pid_file
)
os
.
unlink
(
pid_file
)
cmd
=
kwargs
.
pop
(
'cmd'
)
cmd
=
kwargs
.
pop
(
'cmd'
)
to_stdout
=
False
log_file_path
=
get_log_file_path
(
s
)
if
not
DAEMON
:
log_file_f
=
open
(
log_file_path
,
'a'
)
to_stdout
=
True
files_preserve
.
append
(
log_file_f
)
log_file
=
get_log_file_path
(
s
)
kwargs
[
'stderr'
]
=
log_file_f
_logger
=
LogPipe
(
s
,
log_file
,
to_stdout
=
to_stdout
)
kwargs
[
'stdout'
]
=
log_file_f
stderr
=
stdout
=
_logger
kwargs
.
update
({
"stderr"
:
stderr
,
"stdout"
:
stdout
})
p
=
subprocess
.
Popen
(
cmd
,
**
kwargs
)
p
=
subprocess
.
Popen
(
cmd
,
**
kwargs
)
with
open
(
pid_file
,
'w'
)
as
f
:
with
open
(
pid_file
,
'w'
)
as
f
:
f
.
write
(
str
(
p
.
pid
))
f
.
write
(
str
(
p
.
pid
))
...
@@ -397,8 +386,8 @@ def start_service(s):
...
@@ -397,8 +386,8 @@ def start_service(s):
def
start_services_and_watch
(
s
):
def
start_services_and_watch
(
s
):
print
(
time
.
ctime
())
logging
.
info
(
time
.
ctime
())
print
(
'Jumpserver version {}, more see https://www.jumpserver.org'
.
format
(
logging
.
info
(
'Jumpserver version {}, more see https://www.jumpserver.org'
.
format
(
__version__
)
__version__
)
)
)
...
@@ -415,34 +404,50 @@ def start_services_and_watch(s):
...
@@ -415,34 +404,50 @@ def start_services_and_watch(s):
watch_services
()
watch_services
()
else
:
else
:
show_service_status
(
s
)
show_service_status
(
s
)
global
daemon_pid_file
context
=
get_daemon_context
()
with
context
:
watch_services
()
def
get_daemon_context
():
daemon_pid_file
=
get_pid_file_path
(
'jms'
)
daemon_pid_file
=
get_pid_file_path
(
'jms'
)
daemon_log_f
=
open
(
get_log_file_path
(
'jms'
),
'a'
)
files_preserve
.
append
(
daemon_log_f
)
context
=
daemon
.
DaemonContext
(
context
=
daemon
.
DaemonContext
(
pidfile
=
pidfile
.
TimeoutPIDLockFile
(
daemon_pid_file
),
pidfile
=
pidfile
.
TimeoutPIDLockFile
(
daemon_pid_file
),
signal_map
=
{
signal_map
=
{
signal
.
SIGTERM
:
clean_up
,
signal
.
SIGTERM
:
lambda
x
,
y
:
clean_up
()
,
signal
.
SIGHUP
:
'terminate'
,
signal
.
SIGHUP
:
'terminate'
,
},
},
stdout
=
daemon_log_f
,
stderr
=
daemon_log_f
,
files_preserve
=
files_preserve
,
detach_process
=
True
,
)
)
with
context
:
return
context
watch_services
()
def
stop_service
(
s
,
sig
=
15
):
def
stop_service
(
s
rv
,
sig
=
15
):
services_set
=
parse_service
(
s
)
services_set
=
parse_service
(
s
rv
)
for
s
in
services_set
:
for
s
in
services_set
:
if
not
is_running
(
s
):
if
not
is_running
(
s
):
show_service_status
(
s
)
show_service_status
(
s
)
continue
continue
print
(
"Stop service: {}"
.
format
(
s
))
logging
.
info
(
"Stop service: {}"
.
format
(
s
))
pid
=
get_pid
(
s
)
pid
=
get_pid
(
s
)
os
.
kill
(
pid
,
sig
)
os
.
kill
(
pid
,
sig
)
with
LOCK
:
with
LOCK
:
processes
.
pop
(
s
,
None
)
processes
.
pop
(
s
,
None
)
if
s
==
"all"
:
if
srv
==
"all"
:
stop_daemon_service
()
def
stop_daemon_service
():
pid
=
get_pid
(
'jms'
)
pid
=
get_pid
(
'jms'
)
os
.
kill
(
pid
,
sig
)
logging
.
info
(
"Daemon pid is: {}"
.
format
(
pid
))
if
pid
:
os
.
kill
(
pid
,
15
)
def
stop_multi_services
(
services
):
def
stop_multi_services
(
services
):
...
@@ -468,9 +473,9 @@ def show_service_status(s):
...
@@ -468,9 +473,9 @@ def show_service_status(s):
for
ns
in
services_set
:
for
ns
in
services_set
:
if
is_running
(
ns
):
if
is_running
(
ns
):
pid
=
get_pid
(
ns
)
pid
=
get_pid
(
ns
)
print
(
"{} is running: {}"
.
format
(
ns
,
pid
))
logging
.
info
(
"{} is running: {}"
.
format
(
ns
,
pid
))
else
:
else
:
print
(
"{} is stopped"
.
format
(
ns
))
logging
.
info
(
"{} is stopped"
.
format
(
ns
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
@@ -490,7 +495,7 @@ if __name__ == '__main__':
...
@@ -490,7 +495,7 @@ if __name__ == '__main__':
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"service"
,
type
=
str
,
default
=
"all"
,
nargs
=
"?"
,
"service"
,
type
=
str
,
default
=
"all"
,
nargs
=
"?"
,
choices
=
(
"all"
,
"web"
,
"task"
,
"gunicorn"
,
"celery"
,
"beat"
,
"celery,beat"
,
"flower"
),
choices
=
(
"all"
,
"web"
,
"task"
,
"gunicorn"
,
"celery"
,
"beat"
,
"celery,beat"
,
"flower"
,
"ws"
),
help
=
"The service to start"
,
help
=
"The service to start"
,
)
)
parser
.
add_argument
(
'-d'
,
'--daemon'
,
nargs
=
"?"
,
const
=
1
)
parser
.
add_argument
(
'-d'
,
'--daemon'
,
nargs
=
"?"
,
const
=
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment