add firewall rules option

This commit is contained in:
2025-11-16 17:03:39 +07:00
parent 36fa9644b4
commit 1655151d29
3 changed files with 141 additions and 18 deletions

42
main.go
View File

@@ -6,22 +6,34 @@ import (
"os"
)
type FirewallRule struct {
Type string `yaml:"type"`
Action string `yaml:"action"`
Protocol string `yaml:"protocol"`
Dport string `yaml:"dport"`
Sport string `yaml:"sport"`
Source string `yaml:"source"`
Dest string `yaml:"dest"`
Comment string `yaml:"comment"`
}
type Config struct {
ImageURL string `yaml:"image_url"`
VMName string `yaml:"vm_name"`
VMID int `yaml:"vm_id"`
Storage string `yaml:"storage"`
Memory int `yaml:"memory"`
Cores int `yaml:"cores"`
DiskSize string `yaml:"disk_size"`
Bridge string `yaml:"bridge"`
VlanTag int `yaml:"vlan_tag"`
SSHKey string `yaml:"ssh_key"`
ProxmoxHost string `yaml:"proxmox_host"`
ProxmoxUser string `yaml:"proxmox_user"`
ProxmoxPass string `yaml:"proxmox_pass"`
GuestAgent bool `yaml:"guest_agent"`
Firewall bool `yaml:"firewall"`
ImageURL string `yaml:"image_url"`
VMName string `yaml:"vm_name"`
VMID int `yaml:"vm_id"`
Storage string `yaml:"storage"`
Memory int `yaml:"memory"`
Cores int `yaml:"cores"`
DiskSize string `yaml:"disk_size"`
Bridge string `yaml:"bridge"`
VlanTag int `yaml:"vlan_tag"`
SSHKey string `yaml:"ssh_key"`
ProxmoxHost string `yaml:"proxmox_host"`
ProxmoxUser string `yaml:"proxmox_user"`
ProxmoxPass string `yaml:"proxmox_pass"`
GuestAgent bool `yaml:"guest_agent"`
Firewall bool `yaml:"firewall"`
FirewallRules []FirewallRule `yaml:"firewall_rules"`
}
func main() {