Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gjl2004yn
jumpserver
提交
50c1b3ed
J
jumpserver
项目概览
gjl2004yn
/
jumpserver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jumpserver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
50c1b3ed
编写于
1月 10, 2019
作者:
baltery
提交者:
GitHub
1月 10, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Update] 统一coco host key (#2336)
上级
131e588d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
31 addition
and
11 deletion
+31
-11
apps/common/signals_handler.py
apps/common/signals_handler.py
+12
-1
apps/jumpserver/conf.py
apps/jumpserver/conf.py
+1
-0
apps/jumpserver/settings.py
apps/jumpserver/settings.py
+1
-0
apps/locale/zh/LC_MESSAGES/django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
apps/locale/zh/LC_MESSAGES/django.po
apps/locale/zh/LC_MESSAGES/django.po
+6
-6
apps/terminal/models.py
apps/terminal/models.py
+3
-2
apps/users/api/user.py
apps/users/api/user.py
+5
-0
config_example.yml
config_example.yml
+3
-2
未找到文件。
apps/common/signals_handler.py
浏览文件 @
50c1b3ed
# -*- coding: utf-8 -*-
#
import
json
from
django.dispatch
import
receiver
from
django.db.models.signals
import
post_save
,
pre_save
from
django.conf
import
LazySettings
,
empty
...
...
@@ -8,7 +10,7 @@ from django.core.cache import cache
from
jumpserver.utils
import
current_request
from
.models
import
Setting
from
.utils
import
get_logger
from
.utils
import
get_logger
,
ssh_key_gen
from
.signals
import
django_ready
logger
=
get_logger
(
__file__
)
...
...
@@ -62,6 +64,15 @@ def refresh_all_settings_on_django_ready(sender, **kwargs):
pass
@
receiver
(
django_ready
)
def
auto_generate_terminal_host_key
(
sender
,
**
kwargs
):
if
Setting
.
objects
.
filter
(
name
=
'TERMINAL_HOST_KEY'
).
exists
():
return
private_key
,
public_key
=
ssh_key_gen
()
value
=
json
.
dumps
(
private_key
)
Setting
.
objects
.
create
(
name
=
'TERMINAL_HOST_KEY'
,
value
=
value
)
@
receiver
(
pre_save
,
dispatch_uid
=
"my_unique_identifier"
)
def
on_create_set_created_by
(
sender
,
instance
=
None
,
**
kwargs
):
if
getattr
(
instance
,
'_ignore_auto_created_by'
,
False
)
is
True
:
...
...
apps/jumpserver/conf.py
浏览文件 @
50c1b3ed
...
...
@@ -321,6 +321,7 @@ defaults = {
'TERMINAL_ASSET_LIST_SORT_BY'
:
'hostname'
,
'TERMINAL_ASSET_LIST_PAGE_SIZE'
:
'auto'
,
'TERMINAL_SESSION_KEEP_DURATION'
:
9999
,
'TERMINAL_HOST_KEY'
:
''
,
'SECURITY_MFA_AUTH'
:
False
,
'SECURITY_LOGIN_LIMIT_COUNT'
:
7
,
'SECURITY_LOGIN_LIMIT_TIME'
:
30
,
...
...
apps/jumpserver/settings.py
浏览文件 @
50c1b3ed
...
...
@@ -504,6 +504,7 @@ 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
TERMINAL_SESSION_KEEP_DURATION
=
CONFIG
.
TERMINAL_SESSION_KEEP_DURATION
TERMINAL_HOST_KEY
=
CONFIG
.
TERMINAL_HOST_KEY
# Django bootstrap3 setting, more see http://django-bootstrap3.readthedocs.io/en/latest/settings.html
BOOTSTRAP3
=
{
...
...
apps/locale/zh/LC_MESSAGES/django.mo
浏览文件 @
50c1b3ed
无法预览此类型文件
apps/locale/zh/LC_MESSAGES/django.po
浏览文件 @
50c1b3ed
...
...
@@ -2989,7 +2989,7 @@ msgstr "一个月内历史汇总"
#: templates/index.html:277 templates/index.html:301
msgid "Login count"
msgstr "登
陆
次数"
msgstr "登
录
次数"
#: templates/index.html:277 templates/index.html:308
msgid "Active users"
...
...
@@ -3009,7 +3009,7 @@ msgstr "禁用用户"
#: templates/index.html:342 templates/index.html:394
msgid "Month not logged in user"
msgstr "月未登
陆
用户"
msgstr "月未登
录
用户"
#: templates/index.html:368 templates/index.html:444
msgid "Access to the source"
...
...
@@ -3017,7 +3017,7 @@ msgstr "访问来源"
#: templates/index.html:418 templates/index.html:468
msgid "Month is logged into the host"
msgstr "月被登
陆
主机"
msgstr "月被登
录
主机"
#: templates/index.html:418 templates/index.html:469
msgid "Disable host"
...
...
@@ -3025,7 +3025,7 @@ msgstr "禁用主机"
#: templates/index.html:418 templates/index.html:470
msgid "Month not logged on host"
msgstr "月未登
陆
主机"
msgstr "月未登
录
主机"
#: templates/rest_framework/base.html:128
msgid "Filters"
...
...
@@ -3583,7 +3583,7 @@ msgstr "更新ssh密钥"
#: users/templates/users/first_login.html:19
#: users/templates/users/first_login_done.html:19
msgid "First Login"
msgstr "首次登
陆
"
msgstr "首次登
录
"
#: users/templates/users/first_login.html:72
msgid "I agree with the terms and conditions."
...
...
@@ -4326,7 +4326,7 @@ msgstr "* 您的密码不符合要求"
#: users/views/login.py:349
msgid "First login"
msgstr "首次登
陆
"
msgstr "首次登
录
"
#: users/views/user.py:145
msgid "Bulk update user success"
...
...
apps/terminal/models.py
浏览文件 @
50c1b3ed
...
...
@@ -61,8 +61,9 @@ class Terminal(models.Model):
def
config
(
self
):
configs
=
{}
for
k
in
dir
(
settings
):
if
k
.
startswith
(
'TERMINAL'
):
configs
[
k
]
=
getattr
(
settings
,
k
)
if
not
k
.
startswith
(
'TERMINAL'
):
continue
configs
[
k
]
=
getattr
(
settings
,
k
)
configs
.
update
(
self
.
get_common_storage
())
configs
.
update
(
self
.
get_replay_storage
())
configs
.
update
({
...
...
apps/users/api/user.py
浏览文件 @
50c1b3ed
...
...
@@ -19,6 +19,7 @@ from orgs.utils import current_org
from
..serializers
import
UserSerializer
,
UserPKUpdateSerializer
,
\
UserUpdateGroupSerializer
,
ChangeUserPasswordSerializer
from
..models
import
User
from
..signals
import
post_user_create
logger
=
get_logger
(
__name__
)
...
...
@@ -37,6 +38,10 @@ class UserViewSet(IDInFilterMixin, BulkModelViewSet):
permission_classes
=
(
IsOrgAdmin
,)
pagination_class
=
LimitOffsetPagination
def
perform_create
(
self
,
serializer
):
user
=
serializer
.
save
()
post_user_create
.
send
(
self
.
__class__
,
user
=
user
)
def
get_queryset
(
self
):
queryset
=
current_org
.
get_org_users
()
return
queryset
...
...
config_example.yml
浏览文件 @
50c1b3ed
# SECURITY WARNING: keep the secret key used in production secret!
# 加密秘钥 生产环境中请修改为随机字符串,请勿外泄
# 加密秘钥 生产环境中请修改为随机字符串,请勿外泄, 可使用命令生成
# $ cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 49;echo
SECRET_KEY
:
# SECURITY WARNING: keep the bootstrap token used in production secret!
...
...
@@ -64,4 +65,4 @@ REDIS_PORT: 6379
# OTP settings
# OTP/MFA 配置
# OTP_VALID_WINDOW: 0
# OTP_ISSUER_NAME: Jumpserver
\ No newline at end of file
# OTP_ISSUER_NAME: Jumpserver
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录