logo
Orchestrate containers with an Express API.
We need to orchestrate container for a CTF by a simple way. So we created this.
Some things than you can do with Kubi :
- You can run containers with a simple web request on a random port.
- You can upload docker images to run it.
- You have a (not really) nice web interface to interact with endpoints.
Feel free to send us feedback. File an issue.
At the moment, only MAK'HACK members can contribute to this project.
- Docker
- MongoDB
- NodeJS
- express
- mongoose
- dockerode
- dotenv
- body-parser
First, install Docker.
For the first launch, build a random image (like ubuntu) to test running :
docker pull ubuntu
First, you have to install Mongo, create a database and a user for the database with readWrite
permissions.
Also don't forget to enable Access Control for your MongoDB instance.
If your MongoDB instance is not on the same machine, change your bind_ip in /etc/mongod.conf
to 0.0.0.0.
If you built the docker image ubuntu previously, Add a line in your mongoDB just created (don't forget to auth):
db.containers.insert({name:"My Nice Ubuntu Image", name_container:"ubuntu", "exposed_port":22})
Now, clone the project :
git clone https://github.com/M-k-Hack/Kubi.git
Create a .env
file under a directory called ./vars/
, and add your credententials, etc... :
ADMIN_TOKEN=
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_NAME=
DB_PORT=
Install dependencies and run project :
npm install
sudo node server.js
GET /api/docker/start/:id --> Start a container with and id specified
GET /api/docker/stop/:id --> Stop container (only for admin)
GET /api/container/ --> Get all containers stored in Mongo Databases
GET / --> Web Interface (Pure HTML/CSS/JS)
Express App serves a web interface. You can use to test good functionalities or in your projet. But you can also create your own front-end app to use the API.
Thanks to MAK'HACK members and creators of dockerode.
MIT License.