xingjianwei / webconsole Goto Github PK
View Code? Open in Web Editor NEWThis project forked from shibingli/webconsole
基于Golang、WebSocket、TermJS的SSH远程终端
License: Apache License 2.0
This project forked from shibingli/webconsole
基于Golang、WebSocket、TermJS的SSH远程终端
License: Apache License 2.0
欢迎大家踊跃报名,利用业余时间来拓展此项目,增加更多的功能服务大家。 更新日志 2016.05.13 修证: 1、修证 Ubuntu 下无法使用 VIM 的 BUG; 替换: 2、更换 Gorilla 的 Websocket 库。 感谢 @玩蝴蝶的法师 提出的建议和BUG。 2016.03.05 新增: 1、增加 Dockerfile 2016.03.04 发布 v1.1 新增: 1、增加命令行的启动、停止、状态查看功能. 如: ./apibox start/stop/status 2016.03.03 修证: 1、修改独立模式时登陆JS验证问题. 新增: 1、增加后台运行模式(conf/conf.json. daemon:true/false); 2、增加程序运行时的PID文件(log/apibox.pid); 大概的数据流向: 浏览器--》WebSocket--》SSH--》Linux OS Git@OSC: http://git.oschina.net/shibingli/webconsole Github: https://github.com/shibingli/webconsole 演示地址: http://www.pangu.cloud (通过DaoCloud的Docker服务构建) 程序包结构: ├── bin │ └── apibox ├── conf │ ├── ssl_cert.crt (默认不存在) │ ├── ssl_cert.key (默认不存在) │ ├── conf.json │ └── mime.types ├── log ├── pkg ├── static │ ├── images │ └── scripts └── template 运行环境要求: 1、Intel 架构 2、Linux Kernel 3.x/x86_64 及更高版本 3、建议 Linux 发行版 CentOS 7.x 4、启用支持 SSL/TLS 模式访问时,需要生成对应的 SSL 证书文件且放置到 "conf" 文件夹下并配置 "conf.json" 文件 5、客户端要求使用 IE9、Chrome 40、Firefox 38、Safari 9 或更高版本的浏览器访问 6、服务器端需要对防火墙开启对应的外部访问端口。具体需要开放的端口请参考 "conf" 文件夹下的 "conf.json" 文件中的端口部分的配置 7、本程序只能对 Linux 类的操作系统且支持 SSH 协议的 OS 进行远程操作 8、基于Go1.6,原生支持 http2 一、部署 1、将程序解压至任一目录,运行 "bin" 文件夹下的 "apibox" 文件即可。如:"./apibox start/stop" 2、配置文件在 "conf" 文件夹下,核心配置文件为 "conf.json" 3、后台运行可以配置 "conf" 文件夹下的 "conf.json" 文件,将 "daemon" 项配置为 "true" 4、运行时日志文件存放在 "log" 文件夹下,以当天时期命名 5、也可以配置程序以 Nginx 的 fcgi 模式运行,以 Nginx 做为访问入口 二、使用 1、程序部署完成后,直接通过浏览器访问即可。如: http(s)://ip:port。 2、外部系统引用步骤: 1)、以 GET 或 POST 的方式,提交 "vm_addr" 参数至 "http(s)://ip:port/console/chksshdaddr" ,成功后可获取到加密后的 "en_addr" 信息。注:vm_addr 格式为: "ip:port" ,若不携带端口,默认端口为 "22" 。 获取到的结果为 JSON 格式(注:以下数据为测试数据): 成功: { "ok": true, "msg": "", "data": { "en_addr": "0b-nDgcazQKTmUw4oBLfxott", "sshd_addr": "192.168.220.173:22" } } 失败: { "ok": false, "msg": "Unable to resolve host address.", "data": null } 2)、成功获取到加密的 en_addr 信息后,以 GET 或 POST 方式访问 "http(s)://ip:port/console/login/'en_addr'" 即可。注: "en_addr" 是通过第 1)步操作获取的数据。 JQuery Demo: $.post("/console/chksshdaddr?rnd=" + Math.random(), { "vm_addr": "192.168.220.177:22" }, function(data) { var json = data; if (typeof(data) != "object") { json = $.parseJSON(data); } if (json.ok) { alert(json.data.en_addr); } });
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.