FleexSecurity / fleex

Fleex makes it easy to create multiple VPS on cloud providers and use them to distribute workloads.
https://fleexsecurity.github.io/fleex-docs/
Apache License 2.0
250 stars 30 forks source link

Create logic with also CustomVps #39

Closed xm1k3 closed 1 year ago

xm1k3 commented 1 year ago
type Provider interface {
    SpawnFleet(fleetName string, fleetCount int) error
    GetBoxes() (boxes []Box, err error)
    GetFleet(fleetName string) (fleet []Box, err error)
    GetBox(boxName string) (Box, error)
    ListImages() error
    RemoveImages(name string) error
    RunCommand(name, command string, port int, username, password string) error
    CountFleet(fleetName string, boxes []Box) (count int)
    DeleteFleet(name string) error
    DeleteBoxByID(id string) error
    DeleteBoxByLabel(label string) error
    CreateImage(diskID int, label string) error
}

implement for custom vps

{
    "settings": {
        "provider": "custom"
    },
    "ssh_keys": {
        "public_file": "id_rsa.pub",
        "private_file": "id_rsa"
    },
    ...
    ...
     "custom_vms": [
        {
            "provider": "utm",
            "instance_id": "fleex-1",
            "public_ip": "IP",
            "ssh_port": 22,
            "username": "USERNAME",
            "password": "PASSWORD",
            "key_path": "/path/to/your/private-key.pem",
            "tags": [
                "staging"
            ]
        }
    ]
}