Giter Site home page Giter Site logo

user_command_web's Introduction

更新说明

此项目会根据使用情况,不定期更新,如有需要沟通可联系QQ:247435333

简介

此平台是 跨平台的账号管理,命令下发,使用。
使用场景,多平台都是通过vpn来登陆服务器操作的,此时不方便统一管理各平台,
这时是最适合使用此平台

功能:
    账号功能:增加,sudo,删除,密码修改,禁用。
    命令执行。
    服务器基础信息搜集



架构说明:
    
    前端使用:Vue, element-ui, axios
    服务端:django
    客户端:requests,fabric


    client ---> server
    客户端主动向server端请求api,来获取任务,推送数据,为了保证数据安全 之间使用了api认证。

    服务端下发任务,客户端主动获取。

平台使用说明

1、api认证设置 与平台认证

api认证:

服务端 execute_task/execute_task/settings.py    内的 APPID 参数是自定义api认证鉴权码
客户端 client/settings.py                       也有一个 APPID 需要和服务端的配置成一样的鉴权码,否则会认证失败。


平台认证:

服务端:http://192.168.6.125:8008/admin/    内部有一个Groups表,在里面添加平台名称。
                                            只有添加了平台名称客户端才能正常上报。
客户端:client/settings.py                  参数 QY_NAME 是以什么平台名称来上报数据。

2、平台权限管理。

平台管理的粒度很细,可以针对 各种请求,携带的各种参数,来做认证,也可以针对业务来做认证。

execute_task/task/permission_list.py 是权限管理的条目, 它是一个字典。

字典解析:

   command_post_cmd 权限对应的自定义代码,在admin内设置权限时使用
   command 是url.py内对应的url name 
   POST 指定是什么请求
   [] 需要携带什么参数
   {"status":"cmd"} 明确指定携带参数的value是什么
   custom_perm_logic.only_view_own_customers 是权限自定义钩子,可以针对自己的业务来自定义权限,返回True/False

'command_post_cmd': ['command', 'POST', [], {"status":"cmd"}, custom_perm_logic.only_view_own_customers]

使用方法:
    在admin内打开,设置权限条目,设置用户组,和用户,来对其进行权限控制。

3、平台部署

服务端安装:
    默认使用的数据库是 sqlit3,如需更换请自行修改配置,python需要使用 3

客户端安装:
    安装fabric模块和 requsts模块即可。
    启动: bash start.sh start 

4、客户端管理其它服务器的方法

使用的fabric来管理此平台下的其它服务器。
1、可以使用文件类型的方式记录主机ip和密码
    data/ip.conf  第一列是ip 空行后 第二列是密码

2、使用ssh认证免密码登陆,但是也需要在 data/ip.conf内写入ip地址,密码列可以随便填写。

平台展示

登陆页面

image

主页面

image

用户页面

image

命令执行

image

image

主机信息

image

admin后台groups管理与权限控制

image

image

user_command_web's People

Contributors

s57445560 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.