GithubHelp home page GithubHelp logo

containerhive's Introduction

ContainerHive

ContainerHive is a web API built using .NET 7 that provides docker container management and deployment functionality. This API allows users to manage Projects, add Deployment-Configurations and view all relevant Docker Images and Containers with State and Logs.

It also allows users to automate deployment via a Webhook to deploy or kill all configured Deployments.

Note: This Project is still in WIP. So expect some Bugs, incomplete Features...

Getting Started

To use ContainerHive, you'll need to have .NET 7 installed on your machine. You can download it from the official .NET website.

Once you have .NET 7 installed, you can clone the repository from GitHub by running the following command:

git clone https://github.com/AlexMi-Ha/ContainerHive.git

After cloning the repository, you have to add a file named appsettings.json in ContainerHive/ContainerHive/ which should look something like this:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ApiPrivateKey": "YOUR API PRIVATE KEY",
  "ConnectionStrings": {
    "DefaultConnection": "YOUR DATABASE CONNECTION STRING"
  },
  "DatabaseConfig": {
    "Version": "YOUR DATABASE VERSION"
  },
  "DockerDaemonSocket": "URL OF THE DOCKER SOCKET YOUR USING",
  "RepoPath": "PATH TO THE REPO WHERE ALL THE PROJECTS WILL BE STORED"
}

Finally, you can build and run the project using the following command:

dotnet run

This will start the API, which you can access at http://localhost:5214/swagger/index.html to open the swagger documentation.

API Endpoints

The ContainerHive API has the following endpoints:

Projects

POST /projects

Creates a new Project

PUT /projects

Updates an existing Project

GET /projects

Retrieves a list of all Projects

DELETE /projects/{id}

Deletes a project with a given id

GET /projects/{id}

Retrieves a project with a given id

GET /projects/{id}/deployments

Retrieves all Deployment Configurations of a project

POST /projects/{id}/webhook/regenerate

Regenerates the Api Token for a project

POST /projects/{id}/deploy

Starts the Deployment Process (Does not wait for it to finish)

POST /projects/{id}/kill

Starts the Killing and Pruning Process (Does not wait for it to finish)

Deployments

POST /deployments

Creates a new Deployment Configuration

PUT /deployments

Updates a given Deployment Configuration

GET /deployments

Retrieves all Deployment Configurations (of every project - you may want to take a look at /projects/{id}/deployments)

DELETE /deployments/{id}

Deletes an existing Deployment Config with the specified id

GET /deployments/{id}

Retrieves the Deployment Config with the specified id

Webhooks

POST /webhooks/{id}/deploy

Starts the Deployment Process (Does not wait for it to finish)

POST /webhooks/{id}/kill

Starts the Killing and Pruning Process (Does not wait for it to finish)

Authentication

All normal API Endpoints (Projects, Deployments) need a x-api-private-token Header to be set. Its value should be the ApiPrivateToken specified in your appsettings.json.

The Webhook endpoints need a apiToken in the Request-Body. This is the project specific Webhook-Token specified in the Project-Model. Note: The Project's WebhookActive property needs to be set to true for the request to go through!

containerhive's People

Contributors

alexmi-ha avatar

Stargazers

 avatar

Watchers

 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.