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
29ff0efd
Commit
29ff0efd
authored
Dec 17, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:jumpserver/jumpserver into dev
parents
c7ac93fc
985bd6fc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
43 additions
and
14 deletions
+43
-14
tasks.py
apps/assets/tasks.py
+11
-10
forms.py
apps/common/forms.py
+11
-0
models.py
apps/common/models.py
+2
-0
conf.py
apps/jumpserver/conf.py
+6
-1
settings.py
apps/jumpserver/settings.py
+6
-0
django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/locale/zh/LC_MESSAGES/django.po
+0
-0
serializers.py
apps/ops/serializers.py
+1
-1
api_urls.py
apps/ops/urls/api_urls.py
+1
-0
adhoc.py
apps/ops/views/adhoc.py
+5
-2
No files found.
apps/assets/tasks.py
View file @
29ff0efd
...
...
@@ -141,11 +141,11 @@ def update_assets_hardware_info_period():
logger
.
debug
(
"Period task disabled, update assets hardware info pass"
)
return
from
ops.utils
import
update_or_create_ansible_task
from
orgs.models
import
Organization
orgs
=
Organization
.
objects
.
all
()
.
values_list
(
'id'
,
flat
=
True
)
orgs
.
append
(
''
)
task_name
=
_
(
"Update assets hardware info period"
)
#
from ops.utils import update_or_create_ansible_task
#
from orgs.models import Organization
#
orgs = Organization.objects.all().values_list('id', flat=True)
#
orgs.append('')
#
task_name = _("Update assets hardware info period")
# for org_id in orgs:
# org_id = str(org_id)
# hostname_list = [
...
...
@@ -354,11 +354,12 @@ def test_system_user_connectability_period():
if
PERIOD_TASK
!=
"on"
:
logger
.
debug
(
"Period task disabled, test system user connectability pass"
)
return
system_users
=
SystemUser
.
objects
.
all
()
for
system_user
in
system_users
:
task_name
=
_
(
"Test system user connectability period: {}"
)
.
format
(
system_user
)
# task_name = _("定期测试系统用户可连接性: {}".format(system_user))
test_system_user_connectability_util
(
system_user
,
task_name
)
# Todo: 暂时禁用定期测试
# system_users = SystemUser.objects.all()
# for system_user in system_users:
# task_name = _("Test system user connectability period: {}").format(system_user)
# # task_name = _("定期测试系统用户可连接性: {}".format(system_user))
# test_system_user_connectability_util(system_user, task_name)
#### Push system user tasks ####
...
...
apps/common/forms.py
View file @
29ff0efd
...
...
@@ -134,6 +134,14 @@ class TerminalSettingForm(BaseForm):
(
'hostname'
,
_
(
'Hostname'
)),
(
'ip'
,
_
(
'IP'
)),
)
PAGE_SIZE_CHOICES
=
(
(
'all'
,
_
(
'All'
)),
(
'auto'
,
_
(
'Auto'
)),
(
10
,
10
),
(
15
,
15
),
(
25
,
25
),
(
50
,
50
),
)
TERMINAL_PASSWORD_AUTH
=
forms
.
BooleanField
(
initial
=
True
,
required
=
False
,
label
=
_
(
"Password auth"
)
)
...
...
@@ -146,6 +154,9 @@ class TerminalSettingForm(BaseForm):
TERMINAL_ASSET_LIST_SORT_BY
=
forms
.
ChoiceField
(
choices
=
SORT_BY_CHOICES
,
initial
=
'hostname'
,
label
=
_
(
"List sort by"
)
)
TERMINAL_ASSET_LIST_PAGE_SIZE
=
forms
.
ChoiceField
(
choices
=
PAGE_SIZE_CHOICES
,
initial
=
'auto'
,
label
=
_
(
"List page size"
),
)
class
TerminalCommandStorage
(
BaseForm
):
...
...
apps/common/models.py
View file @
29ff0efd
...
...
@@ -45,6 +45,8 @@ class Setting(models.Model):
def
cleaned_value
(
self
):
try
:
value
=
self
.
value
if
not
isinstance
(
value
,
(
str
,
bytes
)):
return
value
if
self
.
encrypted
:
value
=
signer
.
unsign
(
value
)
value
=
json
.
loads
(
value
)
...
...
apps/jumpserver/conf.py
View file @
29ff0efd
...
...
@@ -312,7 +312,12 @@ defaults = {
'SESSION_COOKIE_AGE'
:
3600
*
24
,
'SESSION_EXPIRE_AT_BROWSER_CLOSE'
:
False
,
'AUTH_OPENID'
:
False
,
'EMAIL_SUFFIX'
:
'jumpserver.org'
'EMAIL_SUFFIX'
:
'jumpserver.org'
,
'TERMINAL_PASSWORD_AUTH'
:
True
,
'TERMINAL_PUBLIC_KEY_AUTH'
:
True
,
'TERMINAL_HEARTBEAT_INTERVAL'
:
5
,
'TERMINAL_ASSET_LIST_SORT_BY'
:
'hostname'
,
'TERMINAL_ASSET_LIST_PAGE_SIZE'
:
'auto'
,
}
...
...
apps/jumpserver/settings.py
View file @
29ff0efd
...
...
@@ -484,6 +484,12 @@ SECURITY_PASSWORD_RULES = [
'SECURITY_PASSWORD_SPECIAL_CHAR'
]
TERMINAL_PASSWORD_AUTH
=
CONFIG
.
TERMINAL_PASSWORD_AUTH
TERMINAL_PUBLIC_KEY_AUTH
=
CONFIG
.
TERMINAL_PUBLIC_KEY_AUTH
TERMINAL_HEARTBEAT_INTERVAL
=
CONFIG
.
TERMINAL_HEARTBEAT_INTERVAL
TERMINAL_ASSET_LIST_SORT_BY
=
CONFIG
.
TERMINAL_ASSET_LIST_SORT_BY
TERMINAL_ASSET_LIST_PAGE_SIZE
=
CONFIG
.
TERMINAL_ASSET_LIST_PAGE_SIZE
# Django bootstrap3 setting, more see http://django-bootstrap3.readthedocs.io/en/latest/settings.html
BOOTSTRAP3
=
{
'horizontal_label_class'
:
'col-md-2'
,
...
...
apps/locale/zh/LC_MESSAGES/django.mo
View file @
29ff0efd
No preview for this file type
apps/locale/zh/LC_MESSAGES/django.po
View file @
29ff0efd
This diff is collapsed.
Click to expand it.
apps/ops/serializers.py
View file @
29ff0efd
...
...
@@ -53,7 +53,7 @@ class AdHocRunHistorySerializer(serializers.ModelSerializer):
@staticmethod
def
get_stat
(
obj
):
return
{
"total"
:
len
(
obj
.
adhoc
.
hosts
),
"total"
:
obj
.
adhoc
.
hosts
.
count
(
),
"success"
:
len
(
obj
.
summary
.
get
(
"contacted"
,
[])),
"failed"
:
len
(
obj
.
summary
.
get
(
"dark"
,
[])),
}
...
...
apps/ops/urls/api_urls.py
View file @
29ff0efd
...
...
@@ -11,6 +11,7 @@ app_name = "ops"
router
=
DefaultRouter
()
router
.
register
(
r'tasks'
,
api
.
TaskViewSet
,
'task'
)
router
.
register
(
r'adhoc'
,
api
.
AdHocViewSet
,
'adhoc'
)
router
.
register
(
r'history'
,
api
.
AdHocRunHistoryViewSet
,
'history'
)
router
.
register
(
r'command-executions'
,
api
.
CommandExecutionViewSet
,
'command-execution'
)
urlpatterns
=
[
...
...
apps/ops/views/adhoc.py
View file @
29ff0efd
...
...
@@ -27,7 +27,7 @@ class TaskListView(AdminUserRequiredMixin, DatetimeSearchMixin, ListView):
def
get_queryset
(
self
):
queryset
=
super
()
.
get_queryset
()
if
current_org
.
is_real
()
:
if
current_org
:
queryset
=
queryset
.
filter
(
created_by
=
current_org
.
id
)
else
:
queryset
=
queryset
.
filter
(
created_by
=
''
)
...
...
@@ -62,8 +62,11 @@ class TaskDetailView(AdminUserRequiredMixin, DetailView):
def
get_queryset
(
self
):
queryset
=
super
()
.
get_queryset
()
if
current_org
:
# Todo: 需要整理默认组织等东西
if
current_org
.
is_real
():
queryset
=
queryset
.
filter
(
created_by
=
current_org
.
id
)
else
:
queryset
=
queryset
.
filter
(
created_by
=
''
)
return
queryset
def
get_context_data
(
self
,
**
kwargs
):
...
...
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