Skip to content

Commit

Permalink
Merge branch 'main' of github.com:usual2970/certimate
Browse files Browse the repository at this point in the history
  • Loading branch information
usual2970 committed Oct 20, 2024
2 parents 0095600 + 84e2fd4 commit ec6f100
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions internal/deployer/aliyun_esa.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/*
* @Author: Bin
* @Date: 2024-09-17
* @FilePath: /github.com/usual2970/certimate/internal/deployer/aliyun_esa.go
* @FilePath: /certimate/internal/deployer/aliyun_esa.go
*/
package deployer

import (
"context"
"encoding/json"
"fmt"
"strings"

openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
dcdn20180115 "github.com/alibabacloud-go/dcdn-20180115/v3/client"
Expand Down Expand Up @@ -55,8 +56,15 @@ func (d *AliyunESADeployer) GetInfo() []string {

func (d *AliyunESADeployer) Deploy(ctx context.Context) error {
certName := fmt.Sprintf("%s-%s-%s", d.option.Domain, d.option.DomainId, rand.RandStr(6))

// 支持泛解析域名,在 Aliyun DCND 中泛解析域名表示为 .example.com
domain := getDeployString(d.option.DeployConfig, "domain")
if strings.HasPrefix(domain, "*") {
domain = strings.TrimPrefix(domain, "*")
}

setDcdnDomainSSLCertificateRequest := &dcdn20180115.SetDcdnDomainSSLCertificateRequest{
DomainName: tea.String(getDeployString(d.option.DeployConfig, "domain")),
DomainName: tea.String(domain),
CertName: tea.String(certName),
CertType: tea.String("upload"),
SSLProtocol: tea.String("on"),
Expand Down

0 comments on commit ec6f100

Please sign in to comment.