mirror of
https://github.com/certd/certd.git
synced 2026-04-03 14:10:54 +08:00
chore: 优化阿里云cdn
This commit is contained in:
@@ -588,7 +588,8 @@ class AcmeClient {
|
||||
|
||||
if (invalidStates.includes(resp.data.status)) {
|
||||
abort();
|
||||
throw new Error(util.formatResponseError(resp));
|
||||
this.log(`[${d}] : 检查状态 = ${resp.data.status} : ${JSON.stringify(resp.data)}`);
|
||||
throw new Error("校验失败:" + util.formatResponseError(resp));
|
||||
}
|
||||
else if (pendingStates.includes(resp.data.status)) {
|
||||
throw new Error(`[${d}] Operation is pending or processing(当前仍然在等待状态)`);
|
||||
|
||||
@@ -379,9 +379,9 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
targetName: string;
|
||||
getCertDomains: () => Promise<string[]>;
|
||||
uploadCert: () => Promise<any>;
|
||||
deployOne: (req: { target: any; cert: any }) => Promise<void>;
|
||||
deployOne: (req: { target: CertTargetItem; cert: any }) => Promise<void>;
|
||||
getDeployTargetList: (req: PageSearch) => Promise<{ list: CertTargetItem[]; total: number }>;
|
||||
}): Promise<{ result: any; deployedList: any[] }> {
|
||||
}): Promise<{ result: string; deployedList: string[] }> {
|
||||
this.logger.info("证书匹配模式部署");
|
||||
const certDomains = await req.getCertDomains();
|
||||
const certTargetList = await this.getAutoMatchedTargets({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { optionsUtils } from '@certd/basic';
|
||||
import { AbstractTaskPlugin, IsTaskPlugin, Pager, PageSearch, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline';
|
||||
import { AbstractTaskPlugin, CertTargetItem, IsTaskPlugin, Pager, PageSearch, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline';
|
||||
import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert";
|
||||
import { CertInfo, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
|
||||
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
|
||||
@@ -10,11 +10,12 @@ import { AliyunClient, AliyunSslClient, CasCertId } from "../../../plugin-lib/al
|
||||
icon: 'svg:icon-aliyun',
|
||||
group: pluginGroups.aliyun.key,
|
||||
desc: '自动部署域名证书至阿里云CDN',
|
||||
default: {
|
||||
strategy: {
|
||||
runStrategy: RunStrategy.SkipWhenSucceed,
|
||||
},
|
||||
},
|
||||
runStrategy: RunStrategy.AlwaysRun,
|
||||
// default: {
|
||||
// strategy: {
|
||||
// runStrategy: RunStrategy.SkipWhenSucceed,
|
||||
// },
|
||||
// },
|
||||
})
|
||||
export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
|
||||
@TaskInput({
|
||||
@@ -143,8 +144,8 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
|
||||
uploadCert: async () => {
|
||||
return await sslClient.uploadCertOrGet(this.cert);
|
||||
},
|
||||
deployOne: async (req: { target: any, cert: any }) => {
|
||||
return await this.deployOne(client, req.target, req.cert);
|
||||
deployOne: async (req: { target: CertTargetItem, cert: any }) => {
|
||||
return await this.deployOne(client, req.target.value, req.cert);
|
||||
},
|
||||
getCertDomains:async ()=>{
|
||||
return sslClient.getCertDomains(this.cert);
|
||||
|
||||
@@ -108,7 +108,7 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
|
||||
uploadCert: async () => {
|
||||
return await sslClient.uploadCertOrGet(this.cert);
|
||||
},
|
||||
deployOne: async (req: { target: any, cert: any }) => {
|
||||
deployOne: async (req: { target: CertTargetItem, cert: any }) => {
|
||||
return await this.deployOne(client, req.target.value, req.cert);
|
||||
},
|
||||
getCertDomains: async ()=>{
|
||||
|
||||
Reference in New Issue
Block a user