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
c78ab8ed
Commit
c78ab8ed
authored
Dec 17, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 日志记录名称
parent
f8213a1a
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
14 additions
and
139 deletions
+14
-139
connect.py
connect.py
+4
-1
__init__.py
docs/__init__.py
+0
-1
developer_doc.txt
docs/developer_doc.txt
+0
-37
initial_data.yaml
docs/initial_data.yaml
+0
-9
requirements.txt
docs/requirements.txt
+0
-18
zzjumpserver.sh
docs/zzjumpserver.sh
+0
-13
run_websocket.py
run_websocket.py
+3
-0
group_list.html
templates/jasset/group_list.html
+1
-2
log_exec.html
templates/jlog/log_exec.html
+1
-1
log_file.html
templates/jlog/log_file.html
+1
-1
log_offline.html
templates/jlog/log_offline.html
+1
-1
log_online.html
templates/jlog/log_online.html
+1
-1
change_info.html
templates/juser/change_info.html
+1
-1
nav_bar_header.html
templates/nav_bar_header.html
+1
-53
No files found.
connect.py
View file @
c78ab8ed
...
...
@@ -498,7 +498,8 @@ class Nav(object):
6) 输入
\033
[32mE/e
\033
[0m 批量执行命令.
7) 输入
\033
[32mU/u
\033
[0m 批量上传文件.
8) 输入
\033
[32mD/d
\033
[0m 批量下载文件.
9) 输入
\033
[32mQ/q
\033
[0m 退出.
9) 输入
\033
[32mH/h
\033
[0m 帮助.
0) 输入
\033
[32mQ/q
\033
[0m 退出.
"""
print
textwrap
.
dedent
(
msg
)
...
...
@@ -763,6 +764,8 @@ def main():
nav
.
upload
()
elif
option
in
[
'D'
,
'd'
]:
nav
.
download
()
elif
option
in
[
'H'
,
'h'
]:
nav
.
print_nav
()
elif
option
in
[
'Q'
,
'q'
,
'exit'
]:
sys
.
exit
()
else
:
...
...
docs/__init__.py
deleted
100644 → 0
View file @
f8213a1a
__author__
=
'Hudie'
docs/developer_doc.txt
deleted
100644 → 0
View file @
f8213a1a
# coding: utf8
Jumpserver开发者文档
开发规范:
1. 遵守PE8规范 1) 命名规范 2) 导入模块规范 3) 空行规范 4) 长度规范
2. 缩进统一4个空格
3. 变量命名明了易懂多个单词下划线隔开
4. 注释到位
框架说明:
1. 项目名称 Jumpserver
2. APP:
juser 用户管理
jasset 资产管理(设备管理)
jpermission 授权管理
jlog 日志管理
3. connect.py 用户登录入口程序
4. logs 日志保存目录
5. jumpserver.conf 配置文件
6. docs 文档目录
7. static 静态文件目录
8. templates 模板目录
connect.py逻辑说明:
用户登录系统,运行该脚本,p调用get_user_host函数查看有权限的服务器ip
输入部分IP,verify_connect匹配该部分ip,如果是匹配到多个,就显示ip
匹配到0了就显示没有权限或者主机,
匹配到1个则继续
查询该服务器是否支持ldap 如果是,获得ldap用户密码登陆
如果否,查询授权表,查看该服务器授权的系统用户,并返回对应账号密码,登陆
connect函数是登陆函数,采用paramiko 使用channel登陆,posix_shell 来完成交互,并记录日志
signal模块来完成窗口改变导致的tty大小随之改变
PyCrypt是对称加密类
\ No newline at end of file
docs/initial_data.yaml
deleted
100644 → 0
View file @
f8213a1a
-
model
:
juser.user
pk
:
5000
fields
:
username
:
admin
name
:
admin
password
:
pbkdf2_sha256$20000$jBIDGPB2j5JT$orxqGgzzjzykColYm1BswPjgHOiERjZkcgkuVIkD2Hc=
email
:
admin@jumpserver.org
role
:
SU
is_active
:
1
docs/requirements.txt
deleted
100644 → 0
View file @
f8213a1a
#sphinx-me==0.3
django==1.6
pycrypto==2.6.1
paramiko==1.16.0
ecdsa==0.13
MySQL-python==1.2.5
#django-uuidfield==0.5.0
psutil==3.3.0
xlsxwriter==0.7.7
xlrd==0.9.4
django-bootstrap-form==3.2
tornado==4.3
ansible==1.9.4
pyinotify==0.9.6
passlib==1.6.5
argparse==1.4.0
django_crontab==0.6.0
\ No newline at end of file
docs/zzjumpserver.sh
deleted
100644 → 0
View file @
f8213a1a
#!/bin/bash
if
[
"
$USER
"
==
"admin"
]
||
[
"
$USER
"
==
"root"
]
||
[
"
$USER
"
==
""
]
;
then
echo
""
else
python /opt/jumpserver/connect.py
if
[
$USER
==
'guanghongwei'
]
;
then
echo
else
exit
3
echo
fi
fi
run_websocket.py
View file @
c78ab8ed
...
...
@@ -361,6 +361,9 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
self
.
log
.
end_time
=
datetime
.
datetime
.
now
()
self
.
log
.
save
()
self
.
log_time_f
.
close
()
print
"1"
self
.
ssh
.
close
()
print
"2"
self
.
close
()
except
AttributeError
:
pass
...
...
templates/jasset/group_list.html
View file @
c78ab8ed
...
...
@@ -57,11 +57,10 @@
<td
class=
"text-center"
name=
"id"
value=
"{{ asset_group.id }}"
data-editable=
'false'
>
<input
name=
"id"
value=
"{{ asset_group.id }}"
type=
"checkbox"
class=
"i-checks"
>
</td>
<td
class=
"text-center"
>
{{ asset_group.name }}
</td>
<td
class=
"text-center"
>
<a
href=
"{% url 'asset_list' %}?group_id={{ asset_group.id }}"
>
{{ asset_group.name }}
</a>
</td>
<td
class=
"text-center"
>
<a
href=
"{% url 'asset_list' %}?group_id={{ asset_group.id }}"
>
{{ asset_group.asset_set.count }}
</a>
</td>
<td
class=
"text-center"
>
{{ asset_group.comment }}
</td>
<td
class=
"text-center"
>
<a
href=
"{% url 'asset_list' %}?group_id={{ asset_group.id }}"
class=
"btn btn-xs btn-info"
>
详情
</a>
<a
href=
"{% url 'asset_group_edit' %}?id={{ asset_group.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
<a
value=
"{% url 'asset_group_del' %}?id={{ asset_group.id }}"
class=
"btn btn-xs btn-danger group_del"
>
删除
</a>
</td>
...
...
templates/jlog/log_exec.html
View file @
c78ab8ed
...
...
@@ -30,7 +30,7 @@
<div
class=
"panel-options"
>
<ul
class=
"nav nav-tabs"
>
<li><a
href=
"{% url 'log_list' 'online' %}"
class=
"text-center"
><i
class=
"fa fa-laptop"
></i>
在线
</a></li>
<li><a
href=
"{% url 'log_list' 'offline' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
历史记录
</a></li>
<li><a
href=
"{% url 'log_list' 'offline' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
登录历史
</a></li>
<li
class=
"active"
><a
href=
"{% url 'log_list' 'exec' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
命令记录
</a></li>
<li><a
href=
"{% url 'log_list' 'file' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
上传下载
</a></li>
<div
class=
""
style=
"float: right"
>
...
...
templates/jlog/log_file.html
View file @
c78ab8ed
...
...
@@ -30,7 +30,7 @@
<div
class=
"panel-options"
>
<ul
class=
"nav nav-tabs"
>
<li><a
href=
"{% url 'log_list' 'online' %}"
class=
"text-center"
><i
class=
"fa fa-laptop"
></i>
在线
</a></li>
<li><a
href=
"{% url 'log_list' 'offline' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
历史记录
</a></li>
<li><a
href=
"{% url 'log_list' 'offline' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
登录历史
</a></li>
<li><a
href=
"{% url 'log_list' 'exec' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
命令记录
</a></li>
<li
class=
"active"
><a
href=
"{% url 'log_list' 'file' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
上传下载
</a></li>
<div
class=
""
style=
"float: right"
>
...
...
templates/jlog/log_offline.html
View file @
c78ab8ed
...
...
@@ -53,7 +53,7 @@
<div
class=
"panel-options"
>
<ul
class=
"nav nav-tabs"
>
<li><a
href=
"{% url 'log_list' 'online' %}"
class=
"text-center"
><i
class=
"fa fa-laptop"
></i>
在线
</a></li>
<li
class=
"active"
><a
href=
"{% url 'log_list' 'offline' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
历史记录
</a></li>
<li
class=
"active"
><a
href=
"{% url 'log_list' 'offline' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
登录历史
</a></li>
<li><a
href=
"{% url 'log_list' 'exec' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
命令记录
</a></li>
<li><a
href=
"{% url 'log_list' 'file' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
上传下载
</a></li>
</ul>
...
...
templates/jlog/log_online.html
View file @
c78ab8ed
...
...
@@ -68,7 +68,7 @@
<div
class=
"panel-options"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
href=
"{% url 'log_list' 'online' %}"
class=
"text-center"
><i
class=
"fa fa-laptop"
></i>
在线
</a></li>
<li><a
href=
"{% url 'log_list' 'offline' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
历史记录
</a></li>
<li><a
href=
"{% url 'log_list' 'offline' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
登录历史
</a></li>
<li><a
href=
"{% url 'log_list' 'exec' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
命令记录
</a></li>
<li><a
href=
"{% url 'log_list' 'file' %}"
class=
"text-center"
><i
class=
"fa fa-bar-chart-o"
></i>
上传下载
</a></li>
<div
class=
""
style=
"float: right"
>
...
...
templates/juser/change_info.html
View file @
c78ab8ed
...
...
@@ -52,7 +52,7 @@
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<label
for=
"ssh_key_pwd"
class=
"col-sm-2 control-label"
>
SSH密钥
</label>
<div
class=
"col-sm-8"
>
<div
class=
"col-sm-8"
style=
"border: none"
>
<a
value=
"{% url 'key_gen' %}?uuid={{ user.uuid }}"
id=
"regen_ssh_key"
class=
"form-control"
>
重新生成
</a>
<span
class=
"help-block m-b-none"
>
重新生成密钥,需要重新下载并导入
...
...
templates/nav_bar_header.html
View file @
c78ab8ed
...
...
@@ -15,61 +15,9 @@
</li>
<li
class=
"dropdown"
>
<a
class=
"dropdown-toggle count-info"
data-toggle=
"dropdown"
href=
"#"
>
<i
class=
"fa fa-envelope"
></i>
<span
class=
"label label-warning"
>
{{ apply_info.count }}
</span>
<span
class=
"m-r-sm text-muted welcome-message"
>
帮助
</span>
</a>
<ul
class=
"dropdown-menu dropdown-messages"
>
{% if apply_info %}
{% for apply in apply_info %}
<li>
<div
class=
"dropdown-messages-box"
>
<a
href=
""
class=
"pull-left"
>
<img
alt=
"image"
class=
"img-circle"
src=
"/static/img/a4.jpg"
>
</a>
<div
class=
"media-body"
>
{#
<small
class=
"pull-right text-navy"
>
{{ apply.date_add|naturaltime }}
</small>
#}
{#
<strong>
{{ apply.applyer }}
</strong><br>
#}
{#
<small
class=
"text-muted"
>
主机组: {{ apply.bisgroup|ast_to_list }}
</small><br/>
#}
{#
<small
class=
"text-muted"
>
主机: {{ apply.asset|ast_to_list }}
</small><br/>
#}
{#
<small
class=
"text-muted"
>
申请时间: {{ apply.date_add|date:"Y-m-d H:i:s" }}
</small>
#}
</div>
</div>
</li>
<li
class=
"divider"
></li>
{% endfor %}
<li>
<div
class=
"text-center link-block"
>
<a
href=
""
>
<i
class=
"fa fa-envelope"
></i>
<strong>
Read All Messages
</strong>
</a>
</div>
</li>
{% else %}
<li>
<div
class=
"text-center link-block"
>
<i
class=
"fa fa-envelope"
></i>
<strong>
(暂无申请)
</strong>
</div>
</li>
{% endif %}
</ul>
</li>
{#
<li
class=
"dropdown open"
>
#}
{#
<a
class=
"dropdown-toggle count-info"
data-toggle=
"dropdown"
href=
"#"
aria-expanded=
"true"
>
#}
{#
<i
class=
"fa fa-bell"
></i>
<span
class=
"label label-primary"
>
0
</span>
#}
{#
</a>
#}
{#
<ul
class=
"dropdown-menu dropdown-alerts"
>
#}
{#
<li>
#}
{#
<a
href=
"mailbox.html"
>
#}
{#
<div>
#}
{#
<i
class=
"fa fa-envelope"
></i>
<strong>
(暂无告警)
</strong>
#}
{#
<i
class=
"fa fa-envelope fa-fw"
></i>
You have 16 messages#}
{#
<span
class=
"pull-right text-muted small"
>
4 minutes ago
</span>
#}
{#
</div>
#}
{#
</a>
#}
{#
</li>
#}
{#
<li
class=
"divider"
></li>
#}
{##}
{#
</ul>
#}
{#
</li>
#}
<li>
<a
href=
"{% url 'logout' %}"
>
<i
class=
"fa fa-sign-out"
></i>
Log out
...
...
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