dogeorg / dogeboxd

Dogebox system manager service
MIT License
1 stars 0 forks source link

Add APIs for System Installation #69

Closed SomeoneWeird closed 3 weeks ago

SomeoneWeird commented 1 month ago

This adds web APIs for system installation.

GET /system/bootstrap is modified to return a new setupFact named installationMode.

{
    "assets": {},
    "states": {},
    "stats": {},
    "setupFacts": {
        "installationMode": "canInstall",
        ...
    }
}

There are 4 modes that can be returned:

A new GET /system/install/disks is added that returns a list of possible disk-installation targets:

➜  http 127.0.0.1:3000/system/install/disks
[
    {
        "Name": "/dev/vdb",
        "Size": 8796093022208,
        "SizePretty": "8.00 TB"
    }
]

A new POST /system/install call is added that actually performs the system installation. It expects a body of:

{
  "disk": "/dev/vdb",
  "secret": "yes-i-will-destroy-everything-on-this-disk"
}