Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iBug/podzol
A docker container scaling, port forwarding & lifetime manager
https://github.com/iBug/podzol
Last synced: 3 months ago
JSON representation
A docker container scaling, port forwarding & lifetime manager
- Host: GitHub
- URL: https://github.com/iBug/podzol
- Owner: iBug
- License: mit
- Created: 2023-08-04T16:23:31.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-13T19:59:42.000Z (about 1 year ago)
- Last Synced: 2024-06-30T05:31:54.531Z (4 months ago)
- Language: Go
- Size: 140 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# podzol
A docker container scaling, port forwarding & lifetime manager
## Usage
See `podzol help` for usage instructions.
### Configuration
Use `podzol defaultconfig` to generate a default configuration file. Edit as you see fit. Place the configuration file at `/etc/podzol/config.yaml` for the system-wide configuration.
### Deployment
Please run the server using `127.0.0.1:port` as listen address and place Nginx or Apache2 in front of it. Then you can configure SSL/TLS and access control with Nginx.
## API Reference
All API expects JSON input and produces JSON output. It is always recommended to set `Content-Type: application/json`. Certain GET endpoints may accept query parameters.
All client commands produce their request URL and body on standard error if `-v` / `--verbose` is specified.
### Base types
Base request type:
```go
type ContainerOptions struct {
// User ID
User int `json:"user"`// Token to be supplied to the container
Token string `json:"token"`// For identification purposes
AppName string `json:"app"`// First segment of the Host header, for reverse proxying
Hostname string `json:"hostname"`// Docker image to be used
Image string `json:"image"`// How long should podzol auto-destroy the container, in seconds
Lifetime time.Duration `json:"lifetime"`
}
```Base response type:
```go
type ContainerInfo struct {
// Container name, ID, reverse proxy hostname
Name string `json:"name"`
ID string `json:"id"`
Hostname string `json:"hostname"`// When the container will expire, in Unix timestamp
Deadline time.Time `json:"deadline"`
}
```### Create container
```
POST /create
```All fields are required.
Returns a single `ContainerInfo` struct.
### Remove container
```
POST /remove
```Only `user` and `app` fields are required.
Returns an empty object.
### List containers
```
GET /list?opts=...
POST /list
````opts` is a JSON-encoded `ContainerOptions` struct. Only `user` and `app` fields are respected, if supplied.
Returns a list of `ContainerInfo` structs.
### Purge containers
This endpoint purges all "expired" containers.
```
POST /purge
```No body is required.
Returns a list of `ContainerInfo` structs for the containers that have been attempted to remove.
Usually this endpoint is not called by an application, but rather by a cron job.
## Known Issues
- None