Skip to content

Commit

Permalink
added custom vps configs
Browse files Browse the repository at this point in the history
  • Loading branch information
xm1k3 committed Sep 19, 2023
1 parent 9ec58ba commit d1db1a3
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 8 deletions.
42 changes: 41 additions & 1 deletion configs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,45 @@
"username": "op",
"password": "USER_PASSWORD"
}
}
},
"custom_vms": [
{
"provider": "aws",
"instance_id": "i-customid",
"public_ip": "1.2.3.4",
"ssh_port": 22,
"username": "ec2-user",
"password": "USER_PASSWORD",
"key_path": "/path/to/your/private-key.pem",
"tags": [
"web-server",
"production"
]
},
{
"provider": "utm",
"instance_id": "i-customid2",
"public_ip": "1.2.3.4",
"ssh_port": 22,
"username": "user",
"password": "USER_PASSWORD",
"key_path": "/path/to/your/private-key.pem",
"tags": [
"test",
"production"
]
},
{
"provider": "virtualbox",
"instance_id": "i-customid3",
"public_ip": "1.2.3.4",
"ssh_port": 22,
"username": "user",
"password": "USER_PASSWORD",
"key_path": "/path/to/your/private-key.pem",
"tags": [
"staging"
]
}
]
}
26 changes: 19 additions & 7 deletions pkg/models/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,33 @@ package models

type Config struct {
Providers map[string]Provider `json:"providers"`
CustomVMs []CustomVM `json:"custom_vms"`
SSHKeys SSHKeys `json:"ssh_keys"`
Settings Settings `json:"settings"`
}

type Provider struct {
Token string `json:"token"`
Region string `json:"region"`
Size string `json:"size"`
Image string `json:"image"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
Token string `json:"token,omitempty"`
Region string `json:"region,omitempty"`
Size string `json:"size,omitempty"`
Image string `json:"image,omitempty"`
Port int `json:"port,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Tags []string `json:"tags,omitempty"`
}

type CustomVM struct {
Provider string `json:"provider"`
InstanceID string `json:"instance_id"`
PublicIP string `json:"public_ip"`
SSHPort int `json:"ssh_port"`
Username string `json:"username"`
Password string `json:"password"`
KeyPath string `json:"key_path"`
Tags []string `json:"tags"`
}

type SSHKeys struct {
PublicFile string `json:"public_file"`
PrivateFile string `json:"private_file"`
Expand Down

0 comments on commit d1db1a3

Please sign in to comment.