集群增加自动安装nftables配置

This commit is contained in:
GoEdgeLab
2022-09-18 09:26:01 +08:00
parent 4e38fff336
commit 7f7e9414df
6 changed files with 4355 additions and 4318 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -62,11 +62,12 @@ type NodeConfig struct {
HTTPFirewallPolicies []*firewallconfigs.HTTPFirewallPolicy `yaml:"httpFirewallPolicies" json:"httpFirewallPolicies"`
HTTPCachePolicies []*serverconfigs.HTTPCachePolicy `yaml:"httpCachePolicies" json:"httpCachePolicies"`
TOA *TOAConfig `yaml:"toa" json:"toa"`
SystemServices map[string]maps.Map `yaml:"systemServices" json:"systemServices"` // 系统服务配置 type => params
FirewallActions []*firewallconfigs.FirewallActionConfig `yaml:"firewallActions" json:"firewallActions"`
TimeZone string `yaml:"timeZone" json:"timeZone"` // 自动设置时区
AutoOpenPorts bool `yaml:"autoOpenPorts" json:"autoOpenPorts"` // 自动开放所需端口
Clock *ClockConfig `yaml:"clock" json:"clock"` // 时钟配置
SystemServices map[string]maps.Map `yaml:"systemServices" json:"systemServices"` // 系统服务配置 type => params
FirewallActions []*firewallconfigs.FirewallActionConfig `yaml:"firewallActions" json:"firewallActions"` // 防火墙动作
TimeZone string `yaml:"timeZone" json:"timeZone"` // 自动设置时区
AutoOpenPorts bool `yaml:"autoOpenPorts" json:"autoOpenPorts"` // 自动开放所需端口
Clock *ClockConfig `yaml:"clock" json:"clock"` // 时钟配置
AutoInstallNftables bool `yaml:"autoInstallNftables" json:"autoInstallNftables"` // 自动安装nftables
// 指标
MetricItems []*serverconfigs.MetricItemConfig `yaml:"metricItems" json:"metricItems"`

View File

@@ -48,6 +48,7 @@ type NodeCluster struct {
IsPinned bool `protobuf:"varint,17,opt,name=isPinned,proto3" json:"isPinned,omitempty"`
ClockJSON []byte `protobuf:"bytes,18,opt,name=clockJSON,proto3" json:"clockJSON,omitempty"`
AutoRemoteStart bool `protobuf:"varint,19,opt,name=autoRemoteStart,proto3" json:"autoRemoteStart,omitempty"`
AutoInstallNftables bool `protobuf:"varint,20,opt,name=autoInstallNftables,proto3" json:"autoInstallNftables,omitempty"`
}
func (x *NodeCluster) Reset() {
@@ -208,12 +209,19 @@ func (x *NodeCluster) GetAutoRemoteStart() bool {
return false
}
func (x *NodeCluster) GetAutoInstallNftables() bool {
if x != nil {
return x.AutoInstallNftables
}
return false
}
var File_models_model_node_cluster_proto protoreflect.FileDescriptor
var file_models_model_node_cluster_proto_rawDesc = []byte{
0x0a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xc5, 0x04, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xf7, 0x04, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65,
@@ -249,8 +257,11 @@ var file_models_model_node_cluster_proto_rawDesc = []byte{
0x4f, 0x4e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x4a,
0x53, 0x4f, 0x4e, 0x12, 0x28, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74,
0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, 0x75,
0x74, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x30, 0x0a,
0x13, 0x61, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4e, 0x66, 0x74, 0x61,
0x62, 0x6c, 0x65, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x75, 0x74, 0x6f,
0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4e, 0x66, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

File diff suppressed because it is too large Load Diff

View File

@@ -22,4 +22,5 @@ message NodeCluster {
bool isPinned = 17;
bytes clockJSON = 18;
bool autoRemoteStart = 19;
bool autoInstallNftables = 20;
}

View File

@@ -163,6 +163,7 @@ message CreateNodeClusterRequest {
int64 httpFirewallPolicyId = 7;
bytes systemServicesJSON = 8; // 系统服务设置
bytes globalServerConfigJSON = 10; // 服务全局设置
bool autoInstallNftables = 11; // 自动安装nftables
}
message CreateNodeClusterResponse {
@@ -180,6 +181,7 @@ message UpdateNodeClusterRequest {
bool autoOpenPorts = 8;
bytes clockJSON = 9;
bool autoRemoteStart = 10;
bool autoInstallNftables = 11;
}
// 删除集群