minccino/README.md
2022-09-23 22:39:17 -07:00

1.5 KiB

minccino - Lightweight cloud-init server

Server application that provides cloud-init metadata via the nocloud-net provider. Uses the link-local IPv6 address for "authentication" by pulling MAC address information.

Requirements

Only sqlite3 dev libraries are required for Diesel.

Configuration

Configuration is handled either via minccino.toml or MINCCINO_ environment variables. To use the API (required for managing instances), you'll need to generate an API key and relevant hash in the config file. To generate this, run:

minccino genkey

This outputs the API key and the relevant config snippet you'll need to add to minccino.toml for the key.

API Usage

All API endpoints require an X-API-Key header with the key generated above, and for the API client to be connected via localhost. \todo Allow overriding the latter requirement, if needed

To create an instance (all requests sent to http://[::1]):

> POST /_yui/instances HTTP/1.1
> X-API-Key: Your_API_Key
> Content-type: application/json
> [...]
> 
> {
>     "name": "instance_hostname",
>     "os_name": "netbsd|debian|invalid",
>     "mac_address": "0a:42:01:23:45:67"
> }
> 
< HTTP/1.1 201 Created
< Content-type: application/json
< [...]
< 
< {
<     "error": null,
<     "instances": [
<         {
<             "id": 591750913,
<             "name": "instance_hostname",
<             "os_name": "netbsd|debian|invalid",
<             "mac_address": "0a:42:01:23:45:67"
<         }
<     ]
< }
}