mirror of
https://github.com/certimate-go/certimate.git
synced 2026-09-24 23:10:13 +08:00
feat(provider): new deployment provider: ksyun slb
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package deployers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/certimate-go/certimate/internal/domain"
|
||||
"github.com/certimate-go/certimate/pkg/core/deployer"
|
||||
ksyunslb "github.com/certimate-go/certimate/pkg/core/deployer/providers/ksyun-slb"
|
||||
xmaps "github.com/certimate-go/certimate/pkg/utils/maps"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Registries.MustRegister(domain.DeploymentProviderTypeKsyunSLB, func(options *ProviderFactoryOptions) (deployer.Provider, error) {
|
||||
credentials := domain.AccessConfigForKsyun{}
|
||||
if err := xmaps.Populate(options.ProviderAccessConfig, &credentials); err != nil {
|
||||
return nil, fmt.Errorf("failed to populate provider access config: %w", err)
|
||||
}
|
||||
|
||||
provider, err := ksyunslb.NewDeployer(&ksyunslb.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ResourceType: xmaps.GetString(options.ProviderExtendedConfig, "resourceType"),
|
||||
CertificateId: xmaps.GetString(options.ProviderExtendedConfig, "certificateId"),
|
||||
})
|
||||
return provider, err
|
||||
})
|
||||
}
|
||||
@@ -329,6 +329,7 @@ const (
|
||||
DeploymentProviderTypeKong = DeploymentProviderType(AccessProviderTypeKong)
|
||||
DeploymentProviderTypeKubernetesSecret = DeploymentProviderType(AccessProviderTypeKubernetes + "-secret")
|
||||
DeploymentProviderTypeKsyunCDN = DeploymentProviderType(AccessProviderTypeKsyun + "-cdn")
|
||||
DeploymentProviderTypeKsyunSLB = DeploymentProviderType(AccessProviderTypeKsyun + "-slb")
|
||||
DeploymentProviderTypeLeCDN = DeploymentProviderType(AccessProviderTypeLeCDN)
|
||||
DeploymentProviderTypeLocal = DeploymentProviderType(AccessProviderTypeLocal)
|
||||
DeploymentProviderTypeMohuaMVH = DeploymentProviderType(AccessProviderTypeMohua + "-mvh")
|
||||
|
||||
@@ -181,11 +181,10 @@ func (d *Deployer) deployToCertificate(ctx context.Context, certPEM, privkeyPEM
|
||||
"ServerCertificate": certPEM,
|
||||
"PrivateKey": privkeyPEM,
|
||||
}
|
||||
setCertificateReq, setCertificateOutput := d.sdkClient.SetCertificatePostRequest(&setCertificateInput)
|
||||
setCertificateErr := setCertificateReq.Send()
|
||||
setCertificateOutput, err := d.sdkClient.SetCertificatePostWithContext(ctx, &setCertificateInput)
|
||||
d.logger.Debug("sdk request 'cdn.SetCertificate'", slog.Any("request", setCertificateInput), slog.Any("response", setCertificateOutput))
|
||||
if setCertificateErr != nil {
|
||||
return fmt.Errorf("failed to execute sdk request 'cdn.SetCertificate': %w", setCertificateErr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute sdk request 'cdn.SetCertificate': %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -209,11 +208,10 @@ func (d *Deployer) getAllDomains(ctx context.Context) ([]string, error) {
|
||||
"PageNumber": getCdnDomainsPageNumber,
|
||||
"PageSize": getCdnDomainsPageSize,
|
||||
}
|
||||
getCdnDomainsReq, getCdnDomainsOutput := d.sdkClient.GetCdnDomainsPostRequest(&getCdnDomainsInput)
|
||||
getCdnDomainsErr := getCdnDomainsReq.Send()
|
||||
getCdnDomainsOutput, err := d.sdkClient.GetCdnDomainsPostWithContext(ctx, &getCdnDomainsInput)
|
||||
d.logger.Debug("sdk request 'cdn.GetCdnDomains'", slog.Any("request", getCdnDomainsInput), slog.Any("response", getCdnDomainsOutput))
|
||||
if getCdnDomainsErr != nil {
|
||||
return nil, fmt.Errorf("failed to execute sdk request 'cdn.GetCdnDomains': %w", getCdnDomainsErr)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to execute sdk request 'cdn.GetCdnDomains': %w", err)
|
||||
}
|
||||
|
||||
type GetCdnDomainsResponse struct {
|
||||
@@ -268,11 +266,10 @@ func (d *Deployer) findDomainIdByDomain(ctx context.Context, domain string) (str
|
||||
"DomainName": domain,
|
||||
"FuzzyMatch": "off",
|
||||
}
|
||||
getCdnDomainsReq, getCdnDomainsOutput := d.sdkClient.GetCdnDomainsPostRequest(&getCdnDomainsInput)
|
||||
getCdnDomainsErr := getCdnDomainsReq.Send()
|
||||
getCdnDomainsOutput, err := d.sdkClient.GetCdnDomainsPostWithContext(ctx, &getCdnDomainsInput)
|
||||
d.logger.Debug("sdk request 'cdn.GetCdnDomains'", slog.Any("request", getCdnDomainsInput), slog.Any("response", getCdnDomainsOutput))
|
||||
if getCdnDomainsErr != nil {
|
||||
return "", fmt.Errorf("failed to execute sdk request 'cdn.GetCdnDomains': %w", getCdnDomainsErr)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to execute sdk request 'cdn.GetCdnDomains': %w", err)
|
||||
}
|
||||
|
||||
type GetCdnDomainsResponse struct {
|
||||
@@ -327,11 +324,10 @@ func (d *Deployer) updateDomainCertificate(ctx context.Context, domain string, c
|
||||
"ServerCertificate": certPEM,
|
||||
"PrivateKey": privkeyPEM,
|
||||
}
|
||||
configCertificateReq, configCertificateOutput := d.sdkClient.ConfigCertificatePostRequest(&configCertificateInput)
|
||||
configCertificateErr := configCertificateReq.Send()
|
||||
configCertificateOutput, err := d.sdkClient.ConfigCertificatePostWithContext(ctx, &configCertificateInput)
|
||||
d.logger.Debug("sdk request 'cdn.ConfigCertificate'", slog.Any("request", configCertificateInput), slog.Any("response", configCertificateOutput))
|
||||
if configCertificateErr != nil {
|
||||
return fmt.Errorf("failed to execute sdk request 'cdn.ConfigCertificate': %w", configCertificateErr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute sdk request 'cdn.ConfigCertificate': %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -45,7 +45,7 @@ Shell command to run this test:
|
||||
func TestDeploy(t *testing.T) {
|
||||
flag.Parse()
|
||||
|
||||
t.Run("Deploy", func(t *testing.T) {
|
||||
t.Run("Deploy_ToDomain", func(t *testing.T) {
|
||||
t.Log(strings.Join([]string{
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
@@ -53,15 +53,46 @@ func TestDeploy(t *testing.T) {
|
||||
fmt.Sprintf("ACCESSKEYID: %v", fAccessKeyId),
|
||||
fmt.Sprintf("SECRETACCESSKEY: %v", fSecretAccessKey),
|
||||
fmt.Sprintf("DOMAIN: %v", fDomain),
|
||||
fmt.Sprintf("CERTIFICATEID: %v", fCertificateId),
|
||||
}, "\n"))
|
||||
|
||||
provider, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
ResourceType: provider.RESOURCE_TYPE_DOMAIN,
|
||||
DomainMatchPattern: provider.DOMAIN_MATCH_PATTERN_EXACT,
|
||||
Domain: fDomain,
|
||||
CertificateId: fCertificateId,
|
||||
})
|
||||
if err != nil {
|
||||
t.Errorf("err: %+v", err)
|
||||
return
|
||||
}
|
||||
|
||||
fInputCertData, _ := os.ReadFile(fInputCertPath)
|
||||
fInputKeyData, _ := os.ReadFile(fInputKeyPath)
|
||||
res, err := provider.Deploy(context.Background(), string(fInputCertData), string(fInputKeyData))
|
||||
if err != nil {
|
||||
t.Errorf("err: %+v", err)
|
||||
return
|
||||
}
|
||||
|
||||
t.Logf("ok: %v", res)
|
||||
})
|
||||
|
||||
t.Run("Deploy_ToCertificate", func(t *testing.T) {
|
||||
t.Log(strings.Join([]string{
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("ACCESSKEYID: %v", fAccessKeyId),
|
||||
fmt.Sprintf("SECRETACCESSKEY: %v", fSecretAccessKey),
|
||||
fmt.Sprintf("CERTIFICATEID: %v", fCertificateId),
|
||||
}, "\n"))
|
||||
|
||||
provider, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
ResourceType: provider.RESOURCE_TYPE_CERTIFICATE,
|
||||
CertificateId: fCertificateId,
|
||||
})
|
||||
if err != nil {
|
||||
t.Errorf("err: %+v", err)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package ksyunslb
|
||||
|
||||
const (
|
||||
// 资源类型:替换指定证书。
|
||||
RESOURCE_TYPE_CERTIFICATE = "certificate"
|
||||
)
|
||||
@@ -0,0 +1,102 @@
|
||||
package ksyunslb
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"time"
|
||||
|
||||
"github.com/KscSDK/ksc-sdk-go/ksc"
|
||||
ksckcm "github.com/KscSDK/ksc-sdk-go/service/kcm"
|
||||
|
||||
"github.com/certimate-go/certimate/pkg/core/deployer"
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 金山云 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 金山云 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 部署资源类型。
|
||||
ResourceType string `json:"resourceType"`
|
||||
// 证书 ID。
|
||||
// 部署资源类型为 [RESOURCE_TYPE_CERTIFICATE] 时必填。
|
||||
CertificateId string `json:"certificateId,omitempty"`
|
||||
}
|
||||
|
||||
type Deployer struct {
|
||||
config *DeployerConfig
|
||||
logger *slog.Logger
|
||||
sdkClient *ksckcm.Kcm
|
||||
}
|
||||
|
||||
var _ deployer.Provider = (*Deployer)(nil)
|
||||
|
||||
func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("the configuration of the deployer provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
return &Deployer{
|
||||
config: config,
|
||||
logger: slog.Default(),
|
||||
sdkClient: client,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (d *Deployer) SetLogger(logger *slog.Logger) {
|
||||
if logger == nil {
|
||||
d.logger = slog.New(slog.DiscardHandler)
|
||||
} else {
|
||||
d.logger = logger
|
||||
}
|
||||
}
|
||||
|
||||
func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*deployer.DeployResult, error) {
|
||||
// 根据部署资源类型决定部署方式
|
||||
switch d.config.ResourceType {
|
||||
case RESOURCE_TYPE_CERTIFICATE:
|
||||
if err := d.deployToCertificate(ctx, certPEM, privkeyPEM); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported resource type '%s'", d.config.ResourceType)
|
||||
}
|
||||
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func (d *Deployer) deployToCertificate(ctx context.Context, certPEM, privkeyPEM string) error {
|
||||
if d.config.CertificateId == "" {
|
||||
return errors.New("config `certificateId` is required")
|
||||
}
|
||||
|
||||
// 更新证书信息
|
||||
// https://docs.ksyun.com/documents/2121
|
||||
modifyCertificateInput := map[string]any{
|
||||
"CertificateId": d.config.CertificateId,
|
||||
"CertificateName": fmt.Sprintf("certimate_%d", time.Now().UnixMilli()),
|
||||
"PublicKey": certPEM,
|
||||
"PrivateKey": privkeyPEM,
|
||||
}
|
||||
modifyCertificateOutput, err := d.sdkClient.ModifyCertificateWithContext(ctx, &modifyCertificateInput)
|
||||
d.logger.Debug("sdk request 'kcm.ModifyCertificate'", slog.Any("request", modifyCertificateInput), slog.Any("response", modifyCertificateOutput))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute sdk request 'kcm.ModifyCertificate': %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, secretAccessKey string) (*ksckcm.Kcm, error) {
|
||||
region := "cn-beijing-6"
|
||||
client := ksckcm.SdkNew(ksc.NewClient(accessKeyId, secretAccessKey), &ksc.Config{Region: ®ion})
|
||||
return client, nil
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package ksyunslb_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
provider "github.com/certimate-go/certimate/pkg/core/deployer/providers/ksyun-slb"
|
||||
)
|
||||
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fAccessKeyId string
|
||||
fSecretAccessKey string
|
||||
fCertificateId string
|
||||
)
|
||||
|
||||
func init() {
|
||||
argsPrefix := "KSYUNSLB_"
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fAccessKeyId, argsPrefix+"ACCESSKEYID", "", "")
|
||||
flag.StringVar(&fSecretAccessKey, argsPrefix+"SECRETACCESSKEY", "", "")
|
||||
flag.StringVar(&fCertificateId, argsPrefix+"CERTIFICATEID", "", "")
|
||||
}
|
||||
|
||||
/*
|
||||
Shell command to run this test:
|
||||
|
||||
go test -v ./ksyun_slb_test.go -args \
|
||||
--KSYUNSLB_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--KSYUNSLB_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--KSYUNSLB_ACCESSKEYID="your-access-key-id" \
|
||||
--KSYUNSLB_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--KSYUNSLB_CERTIFICATEID="your-certificate-id"
|
||||
*/
|
||||
func TestDeploy(t *testing.T) {
|
||||
flag.Parse()
|
||||
|
||||
t.Run("Deploy_ToCertificate", func(t *testing.T) {
|
||||
t.Log(strings.Join([]string{
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("ACCESSKEYID: %v", fAccessKeyId),
|
||||
fmt.Sprintf("SECRETACCESSKEY: %v", fSecretAccessKey),
|
||||
fmt.Sprintf("CERTIFICATEID: %v", fCertificateId),
|
||||
}, "\n"))
|
||||
|
||||
provider, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
ResourceType: provider.RESOURCE_TYPE_CERTIFICATE,
|
||||
CertificateId: fCertificateId,
|
||||
})
|
||||
if err != nil {
|
||||
t.Errorf("err: %+v", err)
|
||||
return
|
||||
}
|
||||
|
||||
fInputCertData, _ := os.ReadFile(fInputCertPath)
|
||||
fInputKeyData, _ := os.ReadFile(fInputKeyPath)
|
||||
res, err := provider.Deploy(context.Background(), string(fInputCertData), string(fInputKeyData))
|
||||
if err != nil {
|
||||
t.Errorf("err: %+v", err)
|
||||
return
|
||||
}
|
||||
|
||||
t.Logf("ok: %v", res)
|
||||
})
|
||||
}
|
||||
@@ -65,6 +65,7 @@ import BizDeployNodeConfigFieldsProviderJDCloudVOD from "./BizDeployNodeConfigFi
|
||||
import BizDeployNodeConfigFieldsProviderJDCloudWAF from "./BizDeployNodeConfigFieldsProviderJDCloudWAF";
|
||||
import BizDeployNodeConfigFieldsProviderKong from "./BizDeployNodeConfigFieldsProviderKong";
|
||||
import BizDeployNodeConfigFieldsProviderKsyunCDN from "./BizDeployNodeConfigFieldsProviderKsyunCDN";
|
||||
import BizDeployNodeConfigFieldsProviderKsyunSLB from "./BizDeployNodeConfigFieldsProviderKsyunSLB";
|
||||
import BizDeployNodeConfigFieldsProviderKubernetesSecret from "./BizDeployNodeConfigFieldsProviderKubernetesSecret";
|
||||
import BizDeployNodeConfigFieldsProviderLeCDN from "./BizDeployNodeConfigFieldsProviderLeCDN";
|
||||
import BizDeployNodeConfigFieldsProviderLocal from "./BizDeployNodeConfigFieldsProviderLocal";
|
||||
@@ -189,6 +190,7 @@ const providerComponentMap: Partial<Record<DeploymentProviderType, React.Compone
|
||||
[DEPLOYMENT_PROVIDERS.KONG]: BizDeployNodeConfigFieldsProviderKong,
|
||||
[DEPLOYMENT_PROVIDERS.KUBERNETES_SECRET]: BizDeployNodeConfigFieldsProviderKubernetesSecret,
|
||||
[DEPLOYMENT_PROVIDERS.KSYUN_CDN]: BizDeployNodeConfigFieldsProviderKsyunCDN,
|
||||
[DEPLOYMENT_PROVIDERS.KSYUN_SLB]: BizDeployNodeConfigFieldsProviderKsyunSLB,
|
||||
[DEPLOYMENT_PROVIDERS.LECDN]: BizDeployNodeConfigFieldsProviderLeCDN,
|
||||
[DEPLOYMENT_PROVIDERS.LOCAL]: BizDeployNodeConfigFieldsProviderLocal,
|
||||
[DEPLOYMENT_PROVIDERS.MOHUA_MVH]: BizDeployNodeConfigFieldsProviderMohuaMVH,
|
||||
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
import { getI18n, useTranslation } from "react-i18next";
|
||||
import { Form, Input, Select } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import Show from "@/components/Show";
|
||||
|
||||
import { useFormNestedFieldsContext } from "./_context";
|
||||
|
||||
const RESOURCE_TYPE_CERTIFICATE = "certificate" as const;
|
||||
|
||||
const BizDeployNodeConfigFieldsProviderKsyunSLB = () => {
|
||||
const { i18n, t } = useTranslation();
|
||||
|
||||
const { parentNamePath } = useFormNestedFieldsContext();
|
||||
const formSchema = z.object({
|
||||
[parentNamePath]: getSchema({ i18n }),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const formInst = Form.useFormInstance();
|
||||
const initialValues = getInitialValues();
|
||||
|
||||
const fieldResourceType = Form.useWatch([parentNamePath, "resourceType"], formInst);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Item
|
||||
name={[parentNamePath, "resourceType"]}
|
||||
initialValue={initialValues.resourceType}
|
||||
label={t("workflow_node.deploy.form.shared_resource_type.label")}
|
||||
rules={[formRule]}
|
||||
>
|
||||
<Select
|
||||
options={[RESOURCE_TYPE_CERTIFICATE].map((s) => ({
|
||||
value: s,
|
||||
label: t(`workflow_node.deploy.form.ksyun_slb_resource_type.option.${s}.label`),
|
||||
}))}
|
||||
placeholder={t("workflow_node.deploy.form.shared_resource_type.placeholder")}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Show when={fieldResourceType === RESOURCE_TYPE_CERTIFICATE}>
|
||||
<Form.Item
|
||||
name={[parentNamePath, "certificateId"]}
|
||||
initialValue={initialValues.certificateId}
|
||||
label={t("workflow_node.deploy.form.ksyun_slb_certificate_id.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.ksyun_slb_certificate_id.tooltip") }}></span>}
|
||||
>
|
||||
<Input allowClear placeholder={t("workflow_node.deploy.form.ksyun_slb_certificate_id.placeholder")} />
|
||||
</Form.Item>
|
||||
</Show>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const getInitialValues = (): Nullish<z.infer<ReturnType<typeof getSchema>>> => {
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_CERTIFICATE,
|
||||
certificateId: "",
|
||||
};
|
||||
};
|
||||
|
||||
const getSchema = ({ i18n = getI18n() }: { i18n?: ReturnType<typeof getI18n> }) => {
|
||||
const { t } = i18n;
|
||||
|
||||
return z
|
||||
.object({
|
||||
resourceType: z.literal([RESOURCE_TYPE_CERTIFICATE], t("workflow_node.deploy.form.shared_resource_type.placeholder")),
|
||||
certificateId: z.string().nullish(),
|
||||
})
|
||||
.superRefine((values, ctx) => {
|
||||
switch (values.resourceType) {
|
||||
case RESOURCE_TYPE_CERTIFICATE:
|
||||
{
|
||||
if (!values.certificateId) {
|
||||
ctx.addIssue({
|
||||
code: "custom",
|
||||
message: t("workflow_node.deploy.form.ksyun_slb_certificate_id.placeholder"),
|
||||
path: ["certificateId"],
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const _default = Object.assign(BizDeployNodeConfigFieldsProviderKsyunSLB, {
|
||||
getInitialValues,
|
||||
getSchema,
|
||||
});
|
||||
|
||||
export default _default;
|
||||
@@ -623,6 +623,7 @@ export const DEPLOYMENT_PROVIDERS = Object.freeze({
|
||||
KONG: `${ACCESS_PROVIDERS.KONG}`,
|
||||
KUBERNETES_SECRET: `${ACCESS_PROVIDERS.KUBERNETES}-secret`,
|
||||
KSYUN_CDN: `${ACCESS_PROVIDERS.KSYUN}-cdn`,
|
||||
KSYUN_SLB: `${ACCESS_PROVIDERS.KSYUN}-slb`,
|
||||
LECDN: `${ACCESS_PROVIDERS.LECDN}`,
|
||||
LOCAL: `${ACCESS_PROVIDERS.LOCAL}`,
|
||||
MOHUA_MVH: `${ACCESS_PROVIDERS.MOHUA}-mvh`,
|
||||
@@ -784,6 +785,7 @@ export const deploymentProvidersMap: Map<DeploymentProvider["type"] | string, De
|
||||
[DEPLOYMENT_PROVIDERS.WANGSU_CERTIFICATE, "provider.wangsu_certificate_upload", DEPLOYMENT_CATEGORIES.SSL],
|
||||
[DEPLOYMENT_PROVIDERS.DOGECLOUD_CDN, "provider.dogecloud_cdn", DEPLOYMENT_CATEGORIES.CDN],
|
||||
[DEPLOYMENT_PROVIDERS.KSYUN_CDN, "provider.ksyun_cdn", DEPLOYMENT_CATEGORIES.CDN],
|
||||
[DEPLOYMENT_PROVIDERS.KSYUN_SLB, "provider.ksyun_slb", DEPLOYMENT_CATEGORIES.LOADBALANCE],
|
||||
[DEPLOYMENT_PROVIDERS.BYTEPLUS_CDN, "provider.byteplus_cdn", DEPLOYMENT_CATEGORIES.CDN],
|
||||
[DEPLOYMENT_PROVIDERS.UCLOUD_US3, "provider.ucloud_us3", DEPLOYMENT_CATEGORIES.STORAGE],
|
||||
[DEPLOYMENT_PROVIDERS.UCLOUD_UCDN, "provider.ucloud_ucdn", DEPLOYMENT_CATEGORIES.CDN],
|
||||
|
||||
@@ -133,6 +133,7 @@
|
||||
"provider.kubernetes_secret": "Kubernetes - Secret",
|
||||
"provider.ksyun": "Kingsoft Cloud",
|
||||
"provider.ksyun_cdn": "Kingsoft Cloud - CDN (Content Delivery Network)",
|
||||
"provider.ksyun_slb": "Kingsoft Cloud - SLB (Server Load Balancing)",
|
||||
"provider.larkbot": "Lark Bot",
|
||||
"provider.lecdn": "LeCDN",
|
||||
"provider.letsencrypt": "Let's Encrypt",
|
||||
|
||||
@@ -714,6 +714,10 @@
|
||||
"workflow_node.deploy.form.ksyun_cdn_certificate_id.label": "Kingsoft Cloud CDN certificate ID",
|
||||
"workflow_node.deploy.form.ksyun_cdn_certificate_id.placeholder": "Please enter Kingsoft Cloud CDN certificate ID",
|
||||
"workflow_node.deploy.form.ksyun_cdn_certificate_id.tooltip": "For more information, see <a href=\"https://cdn.console.ksyun.com/\" target=\"_blank\">https://cdn.console.ksyun.com/</a>",
|
||||
"workflow_node.deploy.form.ksyun_slb_resource_type.option.certificate.label": "Certificate",
|
||||
"workflow_node.deploy.form.ksyun_slb_certificate_id.label": "Kingsoft Cloud SLB certificate ID",
|
||||
"workflow_node.deploy.form.ksyun_slb_certificate_id.placeholder": "Please enter Kingsoft Cloud SLB certificate ID",
|
||||
"workflow_node.deploy.form.ksyun_slb_certificate_id.tooltip": "For more information, see <a href=\"https://network.console.ksyun.com/index.html#!/slb/slbIndex\" target=\"_blank\">https://network.console.ksyun.com/index.html#!/slb/slbIndex</a>",
|
||||
"workflow_node.deploy.form.lecdn_resource_type.option.certificate.label": "Certificate",
|
||||
"workflow_node.deploy.form.lecdn_certificate_id.label": "LeCDN certificate ID",
|
||||
"workflow_node.deploy.form.lecdn_certificate_id.placeholder": "Please enter LeCDN certificate ID",
|
||||
|
||||
@@ -133,6 +133,7 @@
|
||||
"provider.kubernetes_secret": "Kubernetes - Secret",
|
||||
"provider.ksyun": "金山云",
|
||||
"provider.ksyun_cdn": "金山云 - 内容分发网络 CDN",
|
||||
"provider.ksyun_slb": "金山云 - 负载均衡 SLB",
|
||||
"provider.larkbot": "飞书群机器人",
|
||||
"provider.lecdn": "LeCDN",
|
||||
"provider.letsencrypt": "Let's Encrypt",
|
||||
|
||||
@@ -712,6 +712,10 @@
|
||||
"workflow_node.deploy.form.ksyun_cdn_certificate_id.label": "金山云 CDN 证书 ID",
|
||||
"workflow_node.deploy.form.ksyun_cdn_certificate_id.placeholder": "请输入金山云 CDN 证书 ID",
|
||||
"workflow_node.deploy.form.ksyun_cdn_certificate_id.tooltip": "这是什么?请参阅 <a href=\"https://cdn.console.ksyun.com/\" target=\"_blank\">https://cdn.console.ksyun.com/</a>",
|
||||
"workflow_node.deploy.form.ksyun_slb_resource_type.option.certificate.label": "替换指定证书",
|
||||
"workflow_node.deploy.form.ksyun_slb_certificate_id.label": "金山云 SLB 证书 ID",
|
||||
"workflow_node.deploy.form.ksyun_slb_certificate_id.placeholder": "请输入金山云 SLB 证书 ID",
|
||||
"workflow_node.deploy.form.ksyun_slb_certificate_id.tooltip": "这是什么?请参阅 <a href=\"https://network.console.ksyun.com/index.html#!/slb/slbIndex\" target=\"_blank\">https://network.console.ksyun.com/index.html#!/slb/slbIndex</a>",
|
||||
"workflow_node.deploy.form.lecdn_resource_type.option.certificate.label": "替换指定证书",
|
||||
"workflow_node.deploy.form.lecdn_certificate_id.label": "LeCDN 证书 ID",
|
||||
"workflow_node.deploy.form.lecdn_certificate_id.placeholder": "请输入 LeCDN 证书 ID",
|
||||
|
||||
Reference in New Issue
Block a user