From c78ab8edf76b644e945d7781b933df8d5a9efdc9 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 17 Dec 2015 17:35:57 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=20=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connect.py | 5 ++- docs/__init__.py | 1 - docs/developer_doc.txt | 36 --------------------- docs/initial_data.yaml | 9 ------ docs/requirements.txt | 17 ---------- docs/zzjumpserver.sh | 13 -------- run_websocket.py | 3 ++ templates/jasset/group_list.html | 3 +- templates/jlog/log_exec.html | 2 +- templates/jlog/log_file.html | 2 +- templates/jlog/log_offline.html | 2 +- templates/jlog/log_online.html | 2 +- templates/juser/change_info.html | 2 +- templates/nav_bar_header.html | 54 +------------------------------- 14 files changed, 14 insertions(+), 137 deletions(-) delete mode 100644 docs/__init__.py delete mode 100644 docs/developer_doc.txt delete mode 100644 docs/initial_data.yaml delete mode 100644 docs/requirements.txt delete mode 100644 docs/zzjumpserver.sh diff --git a/connect.py b/connect.py index 587a5da82..e1d4829b8 100644 --- a/connect.py +++ b/connect.py @@ -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: diff --git a/docs/__init__.py b/docs/__init__.py deleted file mode 100644 index bfd53d39f..000000000 --- a/docs/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'Hudie' diff --git a/docs/developer_doc.txt b/docs/developer_doc.txt deleted file mode 100644 index aa7b0db9f..000000000 --- a/docs/developer_doc.txt +++ /dev/null @@ -1,36 +0,0 @@ -# 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 diff --git a/docs/initial_data.yaml b/docs/initial_data.yaml deleted file mode 100644 index 1d82565cb..000000000 --- a/docs/initial_data.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- 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 diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 23ab9d3b0..000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -#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 diff --git a/docs/zzjumpserver.sh b/docs/zzjumpserver.sh deleted file mode 100644 index 98598ff18..000000000 --- a/docs/zzjumpserver.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/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 diff --git a/run_websocket.py b/run_websocket.py index 75d9b3c7d..7af850f24 100644 --- a/run_websocket.py +++ b/run_websocket.py @@ -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 diff --git a/templates/jasset/group_list.html b/templates/jasset/group_list.html index e8f8e9c07..327a5621a 100644 --- a/templates/jasset/group_list.html +++ b/templates/jasset/group_list.html @@ -57,11 +57,10 @@ - {{ asset_group.name }} + {{ asset_group.name }} {{ asset_group.asset_set.count }} {{ asset_group.comment }} - 详情 编辑 删除 diff --git a/templates/jlog/log_exec.html b/templates/jlog/log_exec.html index 72f392b90..f900f9f63 100644 --- a/templates/jlog/log_exec.html +++ b/templates/jlog/log_exec.html @@ -30,7 +30,7 @@