perf: 关闭腾讯云证书通知提醒

pull/409/head
xiaojunnuo 2025-05-27 00:10:50 +08:00
parent 378c777a38
commit 231a875bb4
2 changed files with 20 additions and 18 deletions

View File

@ -49,7 +49,7 @@ export class TencentSslClient {
};
const ret = await client.UploadCertificate(params);
this.checkRet(ret);
this.logger.info("证书上传成功tencentCertId=", ret.CertificateId);
this.logger.info(`证书[${opts.certName}]上传成功tencentCertId=`, ret.CertificateId);
await this.switchCertNotify([ret.CertificateId], true);
return ret.CertificateId;
}

View File

@ -1,6 +1,8 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline';
import dayjs from 'dayjs';
import { CertApplyPluginNames} from '@certd/plugin-cert';
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline";
import dayjs from "dayjs";
import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert";
import { TencentAccess, TencentSslClient } from "@certd/plugin-lib";
@IsTaskPlugin({
name: 'UploadCertToTencent',
title: '腾讯云-上传证书到腾讯云',
@ -14,8 +16,8 @@ import { CertApplyPluginNames} from '@certd/plugin-cert';
},
})
export class UploadCertToTencent extends AbstractTaskPlugin {
@TaskInput({ title: '证书名称' })
name!: string;
// @TaskInput({ title: '证书名称' })
// name!: string;
@TaskInput({
title: 'Access授权',
@ -51,19 +53,19 @@ export class UploadCertToTencent extends AbstractTaskPlugin {
}
async execute(): Promise<void> {
const { accessId, name, cert } = this;
const accessProvider = await this.getAccess(accessId);
const certName = this.appendTimeSuffix(name || cert.domain);
const client = this.getClient(accessProvider);
const access = await this.getAccess<TencentAccess>(this.accessId);
const sslClient = new TencentSslClient({
access,
logger: this.logger,
});
const params = {
CertificatePublicKey: cert.crt,
CertificatePrivateKey: cert.key,
Alias: certName,
};
const ret = await client.UploadCertificate(params);
this.checkRet(ret);
this.logger.info('证书上传成功tencentCertId=', ret.CertificateId);
const certReader = new CertReader(this.cert);
const tencentCertId = await sslClient.uploadToTencent({
certName: certReader.buildCertName(),
cert: this.cert,
});
this.logger.info('证书上传成功tencentCertId=', tencentCertId);
this.tencentCertId = ret.CertificateId;
}