项目作者: JeremyMarshall

项目描述 :
xterm.js based terminal emulator to bridge to docker exec
高级语言: JavaScript
项目地址: git://github.com/JeremyMarshall/xterm.js-docker-bridge.git
创建时间: 2017-10-07T03:26:20Z
项目社区:https://github.com/JeremyMarshall/xterm.js-docker-bridge

开源协议:

下载


This is a project in three parts

  • An Angular 4 front end assembled with angular cli

  • An Express server

  • A terminal application

Description

The front end uses xterm.js to serve up a terminal

this connects via a websocket to the express server

The server conects via a pseudo tty to a node app called sash (Swiss Army Shell)

This shell is based on commander.js which provides
an easily extensible mechanism to do CLI

Currently the commands implemented are

  • docker ps
  • docker exec <container|name> <command>

Docker

I built this to do a docker exec without having access to the docker host so it will run as a docker container

Simply run docker run -d -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock jeremymarshall/angular4-express-dist and connect to it on port 3000

There is a security risk as this exposes the docker daemon and you can exec to the container running the service. But this is a proof of concept

CI

The CI is a bit hand cranked at the moment

TODO

  1. Do the CI
  2. Command History
  3. More commands
    • docker
    • docker compose
    • marathon/mesos
    • haproxy?
    • ssh?
  4. integrate colour
  5. Log commands to a database - what about passwords?)

Please fork and raise PRs