diff --git a/internal/deployer/aliyun_alb.go b/internal/deployer/aliyun_alb.go index 979f25f8..b676e043 100644 --- a/internal/deployer/aliyun_alb.go +++ b/internal/deployer/aliyun_alb.go @@ -110,6 +110,8 @@ func (d *AliyunALBDeployer) deployToLoadbalancer(ctx context.Context) error { return errors.New("`loadbalancerId` is required") } + aliListenerIds := make([]string, 0) + // 查询负载均衡实例的详细信息 // REF: https://help.aliyun.com/zh/slb/application-load-balancer/developer-reference/api-alb-2020-06-16-getloadbalancerattribute getLoadBalancerAttributeReq := &alb20200616.GetLoadBalancerAttributeRequest{ @@ -122,9 +124,8 @@ func (d *AliyunALBDeployer) deployToLoadbalancer(ctx context.Context) error { d.infos = append(d.infos, toStr("已查询到 ALB 负载均衡实例", getLoadBalancerAttributeResp)) - // 查询监听列表 + // 查询 HTTPS 监听列表 // REF: https://help.aliyun.com/zh/slb/application-load-balancer/developer-reference/api-alb-2020-06-16-listlisteners - aliListenerIds := make([]string, 0) listListenersPage := 1 listListenersLimit := int32(100) var listListenersToken *string = nil @@ -156,6 +157,38 @@ func (d *AliyunALBDeployer) deployToLoadbalancer(ctx context.Context) error { d.infos = append(d.infos, toStr("已查询到 ALB 负载均衡实例下的全部 HTTPS 监听", aliListenerIds)) + // 查询 QUIC 监听列表 + // REF: https://help.aliyun.com/zh/slb/application-load-balancer/developer-reference/api-alb-2020-06-16-listlisteners + listListenersPage = 1 + listListenersToken = nil + for { + listListenersReq := &alb20200616.ListListenersRequest{ + MaxResults: tea.Int32(listListenersLimit), + NextToken: listListenersToken, + LoadBalancerIds: []*string{tea.String(aliLoadbalancerId)}, + ListenerProtocol: tea.String("QUIC"), + } + listListenersResp, err := d.sdkClient.ListListeners(listListenersReq) + if err != nil { + return fmt.Errorf("failed to execute sdk request 'alb.ListListeners': %w", err) + } + + if listListenersResp.Body.Listeners != nil { + for _, listener := range listListenersResp.Body.Listeners { + aliListenerIds = append(aliListenerIds, *listener.ListenerId) + } + } + + if listListenersResp.Body.NextToken == nil { + break + } else { + listListenersToken = listListenersResp.Body.NextToken + listListenersPage += 1 + } + } + + d.infos = append(d.infos, toStr("已查询到 ALB 负载均衡实例下的全部 QUIC 监听", aliListenerIds)) + // 上传证书到 SSL uploadResult, err := d.sslUploader.Upload(ctx, d.option.Certificate.Certificate, d.option.Certificate.PrivateKey) if err != nil { diff --git a/internal/deployer/aliyun_clb.go b/internal/deployer/aliyun_clb.go index 0c6466a7..11384ba8 100644 --- a/internal/deployer/aliyun_clb.go +++ b/internal/deployer/aliyun_clb.go @@ -113,6 +113,8 @@ func (d *AliyunCLBDeployer) deployToLoadbalancer(ctx context.Context) error { return errors.New("`loadbalancerId` is required") } + aliListenerPorts := make([]int32, 0) + // 查询负载均衡实例的详细信息 // REF: https://help.aliyun.com/zh/slb/classic-load-balancer/developer-reference/api-slb-2014-05-15-describeloadbalancerattribute describeLoadBalancerAttributeReq := &slb20140515.DescribeLoadBalancerAttributeRequest{ @@ -126,9 +128,8 @@ func (d *AliyunCLBDeployer) deployToLoadbalancer(ctx context.Context) error { d.infos = append(d.infos, toStr("已查询到 CLB 负载均衡实例", describeLoadBalancerAttributeResp)) - // 查询监听列表 + // 查询 HTTPS 监听列表 // REF: https://help.aliyun.com/zh/slb/classic-load-balancer/developer-reference/api-slb-2014-05-15-describeloadbalancerlisteners - aliListenerPorts := make([]int32, 0) listListenersPage := 1 listListenersLimit := int32(100) var listListenersToken *string = nil diff --git a/internal/deployer/aliyun_nlb.go b/internal/deployer/aliyun_nlb.go index 8e4d8d84..cb9d8c43 100644 --- a/internal/deployer/aliyun_nlb.go +++ b/internal/deployer/aliyun_nlb.go @@ -110,6 +110,8 @@ func (d *AliyunNLBDeployer) deployToLoadbalancer(ctx context.Context) error { return errors.New("`loadbalancerId` is required") } + aliListenerIds := make([]string, 0) + // 查询负载均衡实例的详细信息 // REF: https://help.aliyun.com/zh/slb/network-load-balancer/developer-reference/api-nlb-2022-04-30-getloadbalancerattribute getLoadBalancerAttributeReq := &nlb20220430.GetLoadBalancerAttributeRequest{ @@ -122,9 +124,8 @@ func (d *AliyunNLBDeployer) deployToLoadbalancer(ctx context.Context) error { d.infos = append(d.infos, toStr("已查询到 NLB 负载均衡实例", getLoadBalancerAttributeResp)) - // 查询监听列表 + // 查询 TCPSSL 监听列表 // REF: https://help.aliyun.com/zh/slb/network-load-balancer/developer-reference/api-nlb-2022-04-30-listlisteners - aliListenerIds := make([]string, 0) listListenersPage := 1 listListenersLimit := int32(100) var listListenersToken *string = nil diff --git a/internal/deployer/huaweicloud_elb.go b/internal/deployer/huaweicloud_elb.go index fc5920bb..f9f26338 100644 --- a/internal/deployer/huaweicloud_elb.go +++ b/internal/deployer/huaweicloud_elb.go @@ -208,6 +208,8 @@ func (d *HuaweiCloudELBDeployer) deployToLoadbalancer(ctx context.Context) error return errors.New("`loadbalancerId` is required") } + hcListenerIds := make([]string, 0) + // 查询负载均衡器详情 // REF: https://support.huaweicloud.com/api-elb/ShowLoadBalancer.html showLoadBalancerReq := &hcElbModel.ShowLoadBalancerRequest{ @@ -222,7 +224,6 @@ func (d *HuaweiCloudELBDeployer) deployToLoadbalancer(ctx context.Context) error // 查询监听器列表 // REF: https://support.huaweicloud.com/api-elb/ListListeners.html - hcListenerIds := make([]string, 0) listListenersLimit := int32(2000) var listListenersMarker *string = nil for { diff --git a/ui/src/i18n/locales/zh/nls.domain.json b/ui/src/i18n/locales/zh/nls.domain.json index 0e850ca0..6ad1cb27 100644 --- a/ui/src/i18n/locales/zh/nls.domain.json +++ b/ui/src/i18n/locales/zh/nls.domain.json @@ -75,7 +75,7 @@ "domain.deployment.form.aliyun_alb_region.placeholder": "请输入地域(如 cn-hangzhou)", "domain.deployment.form.aliyun_alb_resource_type.label": "替换方式", "domain.deployment.form.aliyun_alb_resource_type.placeholder": "请选择替换方式", - "domain.deployment.form.aliyun_alb_resource_type.option.loadbalancer.label": "替换指定负载均衡器的全部监听的证书(仅支持 HTTPS 监听)", + "domain.deployment.form.aliyun_alb_resource_type.option.loadbalancer.label": "替换指定负载均衡器的全部监听的证书(仅支持 HTTPS/QUIC 监听)", "domain.deployment.form.aliyun_alb_resource_type.option.listener.label": "替换指定监听器的证书", "domain.deployment.form.aliyun_alb_loadbalancer_id.label": "负载均衡器 ID", "domain.deployment.form.aliyun_alb_loadbalancer_id.placeholder": "请输入负载均衡器 ID",