Compare commits
10 Commits
v0.3.11
...
archive/v0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42f9fba82c | ||
|
|
d653ab442f | ||
|
|
a924a2df77 | ||
|
|
7590bb5cbc | ||
|
|
5042930aaa | ||
|
|
9d36df211e | ||
|
|
cec56b6e49 | ||
|
|
dfd2fccc1e | ||
|
|
4ffb7ae969 | ||
|
|
302ddcdd07 |
@@ -161,7 +161,7 @@ func (d *TencentCDNDeployer) getDomainsByCertificateId(tcCertId string) ([]strin
|
||||
}
|
||||
|
||||
domains := make([]string, 0)
|
||||
if describeCertDomainsResp.Response.Domains == nil {
|
||||
if describeCertDomainsResp.Response.Domains != nil {
|
||||
for _, domain := range describeCertDomainsResp.Response.Domains {
|
||||
domains = append(domains, *domain)
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ func (d *TencentECDNDeployer) getDomainsByCertificateId(tcCertId string) ([]stri
|
||||
}
|
||||
|
||||
domains := make([]string, 0)
|
||||
if describeCertDomainsResp.Response.Domains == nil {
|
||||
if describeCertDomainsResp.Response.Domains != nil {
|
||||
for _, domain := range describeCertDomainsResp.Response.Domains {
|
||||
domains = append(domains, *domain)
|
||||
}
|
||||
|
||||
@@ -74,6 +74,12 @@ func (d *TencentTEODeployer) Deploy(ctx context.Context) error {
|
||||
return xerrors.New("`zoneId` is required")
|
||||
}
|
||||
|
||||
tcDomain := strings.ReplaceAll(strings.TrimSpace(d.option.DeployConfig.GetConfigAsString("domain")), "\r", "")
|
||||
tcDomains := strings.Split(tcDomain, "\n")
|
||||
if len(tcDomains) == 0 {
|
||||
return xerrors.New("`domain` is required")
|
||||
}
|
||||
|
||||
// 上传证书到 SSL
|
||||
upres, err := d.sslUploader.Upload(ctx, d.option.Certificate.Certificate, d.option.Certificate.PrivateKey)
|
||||
if err != nil {
|
||||
@@ -87,7 +93,7 @@ func (d *TencentTEODeployer) Deploy(ctx context.Context) error {
|
||||
modifyHostsCertificateReq := tcTeo.NewModifyHostsCertificateRequest()
|
||||
modifyHostsCertificateReq.ZoneId = common.StringPtr(tcZoneId)
|
||||
modifyHostsCertificateReq.Mode = common.StringPtr("sslcert")
|
||||
modifyHostsCertificateReq.Hosts = common.StringPtrs(strings.Split(strings.ReplaceAll(d.option.Domain, "\r\n", "\n"), "\n"))
|
||||
modifyHostsCertificateReq.Hosts = common.StringPtrs(tcDomains)
|
||||
modifyHostsCertificateReq.ServerCertInfo = []*tcTeo.ServerCertInfo{{CertId: common.StringPtr(upres.CertId)}}
|
||||
modifyHostsCertificateResp, err := d.sdkClients.teo.ModifyHostsCertificate(modifyHostsCertificateReq)
|
||||
if err != nil {
|
||||
|
||||
@@ -146,7 +146,7 @@ func (d *TencentCloudCDNDeployer) getDomainsByCertificateId(cloudCertId string)
|
||||
}
|
||||
|
||||
domains := make([]string, 0)
|
||||
if describeCertDomainsResp.Response.Domains == nil {
|
||||
if describeCertDomainsResp.Response.Domains != nil {
|
||||
for _, domain := range describeCertDomainsResp.Response.Domains {
|
||||
domains = append(domains, *domain)
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ func (d *TencentCloudECDNDeployer) getDomainsByCertificateId(cloudCertId string)
|
||||
}
|
||||
|
||||
domains := make([]string, 0)
|
||||
if describeCertDomainsResp.Response.Domains == nil {
|
||||
if describeCertDomainsResp.Response.Domains != nil {
|
||||
for _, domain := range describeCertDomainsResp.Response.Domains {
|
||||
domains = append(domains, *domain)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import (
|
||||
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core"
|
||||
hcCdn "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdn/v2"
|
||||
hcCdnModel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdn/v2/model"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
@@ -21,6 +22,7 @@ func (c *Client) UploadDomainMultiCertificatesEx(request *UpdateDomainMultiCerti
|
||||
if resp, err := c.HcClient.Sync(request, requestDef); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return resp.(*UpdateDomainMultiCertificatesExResponse), nil
|
||||
temp := resp.(*hcCdnModel.UpdateDomainMultiCertificatesResponse)
|
||||
return &UpdateDomainMultiCertificatesExResponse{UpdateDomainMultiCertificatesResponse: *temp}, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,17 @@ const DeployToTencentTEO = () => {
|
||||
|
||||
const formSchema = z.object({
|
||||
zoneId: z.string().min(1, t("domain.deployment.form.tencent_teo_zone_id.placeholder")),
|
||||
domain: z.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/, {
|
||||
domain: z.string().refine(
|
||||
(v) =>
|
||||
!!v &&
|
||||
v
|
||||
.trim()
|
||||
.split("\n")
|
||||
.every((s) => /^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(s)),
|
||||
{
|
||||
message: t("common.errmsg.domain_invalid"),
|
||||
}),
|
||||
}
|
||||
),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const version = "Certimate v0.2.21";
|
||||
export const version = "Certimate v0.2.24-beta";
|
||||
|
||||
Reference in New Issue
Block a user