2021-04-20 21:31:37 +00:00
|
|
|
package crypticnet
|
|
|
|
|
|
|
|
type ConfigFirewall struct {
|
|
|
|
Conntrack ConfigConntrack `yaml:"conntrack"`
|
|
|
|
Outbound []ConfigFirewallRule `yaml:"outbound"`
|
|
|
|
Inbound []ConfigFirewallRule `yaml:"inbound"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ConfigConntrack struct {
|
|
|
|
TCPTimeout string `yaml:"tcp_timeout"`
|
|
|
|
UDPTimeout string `yaml:"udp_timeout"`
|
|
|
|
DefaultTimeout string `yaml:"default_timeout"`
|
|
|
|
MaxConnections int `yaml:"max_connections"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ConfigFirewallRule struct {
|
|
|
|
Port string `yaml:"port,omitempty"`
|
|
|
|
Code string `yaml:"code,omitempty"`
|
|
|
|
Proto string `yaml:"proto,omitempty"`
|
|
|
|
Host string `yaml:"host,omitempty"`
|
|
|
|
Group string `yaml:"group,omitempty"`
|
|
|
|
Groups []string `yaml:"groups,omitempty"`
|
|
|
|
CIDR string `yaml:"cidr,omitempty"`
|
|
|
|
CASha string `yaml:"ca_sha,omitempty"`
|
|
|
|
CAName string `yaml:"ca_name,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// DaemonYmlStorageAllocation describes the structure of each storage allocation
|
|
|
|
// within the daemon.yml file.
|
|
|
|
type DaemonYmlStorageAllocation struct {
|
2022-10-15 14:28:03 +00:00
|
|
|
DataPath string `yaml:"data_path"`
|
|
|
|
MetaPath string `yaml:"meta_path"`
|
|
|
|
Capacity int `yaml:"capacity"`
|
2022-10-16 19:12:33 +00:00
|
|
|
S3APIPort int `yaml:"s3_api_port"`
|
2022-10-15 14:28:03 +00:00
|
|
|
RPCPort int `yaml:"rpc_port"`
|
2021-04-20 21:31:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// DaemonYml describes the structure of the daemon.yml file.
|
|
|
|
type DaemonYml struct {
|
|
|
|
DNS struct {
|
|
|
|
Resolvers []string `yaml:"resolvers"`
|
|
|
|
} `yaml:"dns"`
|
|
|
|
VPN struct {
|
|
|
|
PublicAddr string `yaml:"public_addr"`
|
|
|
|
Firewall ConfigFirewall `yaml:"firewall"`
|
|
|
|
} `yaml:"vpn"`
|
|
|
|
Storage struct {
|
|
|
|
Allocations []DaemonYmlStorageAllocation
|
|
|
|
} `yaml:"storage"`
|
|
|
|
}
|