mirror of https://github.com/certd/certd
Merge remote-tracking branch 'origin/v2' into v2
commit
939b8d4aa9
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -3,6 +3,17 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复某些地区被屏蔽无法激活专业版的bug ([7532a96](https://github.com/certd/certd/commit/7532a960851b84d4f2cc3dba02353c5235e1a364))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 上传到主机,支持socks代理 ([d91026d](https://github.com/certd/certd/commit/d91026dc4fbfe5fedc4ee8e43dc0d08f1cf88356))
|
||||
* 支持上传到七牛云oss ([bf024bd](https://github.com/certd/certd/commit/bf024bdda8bc2a463475be5761acf0da7317a08a))
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
|
|
@ -1 +1 @@
|
|||
10:11
|
||||
02:35
|
||||
|
|
|
@ -9,5 +9,5 @@
|
|||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.25.6"
|
||||
"version": "1.25.7"
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"scripts": {
|
||||
"start": "lerna bootstrap --hoist",
|
||||
"i-all": "lerna link && lerna exec npm install ",
|
||||
"publish": "npm run prepublishOnly2 && lerna publish --conventional-commits --create-release github && npm run afterpublishOnly",
|
||||
"publish": "npm run prepublishOnly2 && lerna publish --force-publish=pro/plus-core --conventional-commits --create-release github && npm run afterpublishOnly",
|
||||
"afterpublishOnly": "time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push",
|
||||
"prepublishOnly1": "npm run check && lerna run build ",
|
||||
"prepublishOnly2": "npm run check && npm run before-build && lerna run build ",
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/publishlab/node-acme-client/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.25.6](https://github.com/publishlab/node-acme-client/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"main": "src/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复某些地区被屏蔽无法激活专业版的bug ([7532a96](https://github.com/certd/certd/commit/7532a960851b84d4f2cc3dba02353c5235e1a364))
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
@ -15,7 +15,7 @@
|
|||
"test": "mocha --loader=ts-node/esm"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/plus-core": "^1.25.4",
|
||||
"@certd/plus-core": "^1.25.6",
|
||||
"axios": "^1.7.2",
|
||||
"fix-path": "^4.0.0",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
|
|
|
@ -8,7 +8,7 @@ export class HttpError extends Error {
|
|||
status?: number;
|
||||
statusText?: string;
|
||||
code?: string;
|
||||
request?: { url: string; method: string; params?: any; data?: any };
|
||||
request?: { baseURL: string; url: string; method: string; params?: any; data?: any };
|
||||
response?: { data: any };
|
||||
cause?: any;
|
||||
constructor(error: any) {
|
||||
|
@ -23,6 +23,7 @@ export class HttpError extends Error {
|
|||
this.status = error.response?.status;
|
||||
this.statusText = error.response?.statusText;
|
||||
this.request = {
|
||||
baseURL: error.config?.baseURL,
|
||||
url: error.config?.url,
|
||||
method: error.config?.method,
|
||||
params: error.config?.params,
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-jdcloud
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-jdcloud
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/lib-jdcloud",
|
||||
"private": false,
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"main": "./dist/bundle.mjs",
|
||||
"module": "./dist/bundle.mjs",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
@ -17,7 +17,7 @@
|
|||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/pipeline": "^1.25.6",
|
||||
"@certd/pipeline": "^1.25.7",
|
||||
"@rollup/plugin-commonjs": "^23.0.4",
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
@ -14,8 +14,9 @@
|
|||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.25.6",
|
||||
"@certd/pipeline": "^1.25.6",
|
||||
"@certd/acme-client": "^1.25.7",
|
||||
"@certd/pipeline": "^1.25.7",
|
||||
"dayjs": "^1.11.7",
|
||||
"jszip": "^3.10.1",
|
||||
"node-forge": "^0.10.0",
|
||||
"psl": "^1.9.0",
|
||||
|
@ -37,7 +38,6 @@
|
|||
"@typescript-eslint/eslint-plugin": "^5.38.1",
|
||||
"@typescript-eslint/parser": "^5.38.1",
|
||||
"chai": "^4.3.6",
|
||||
"dayjs": "^1.11.6",
|
||||
"eslint": "^8.24.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
**Note:** Version bump only for package @certd/ui-client
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
### Performance Improvements
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
|
@ -58,8 +58,8 @@
|
|||
"vuedraggable": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.25.6",
|
||||
"@certd/pipeline": "^1.25.6",
|
||||
"@certd/lib-iframe": "^1.25.7",
|
||||
"@certd/pipeline": "^1.25.7",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
#plus:
|
||||
# server:
|
||||
# baseUrl: 'http://127.0.0.1:11007'
|
||||
|
||||
plus:
|
||||
server:
|
||||
baseUrl: 'https://api.ai.handsfree.work'
|
||||
baseUrls: ['https://api.ai.handsfree.work', 'https://api.ai.docmirror.cn']
|
||||
#typeorm:
|
||||
# dataSource:
|
||||
# default:
|
||||
|
|
|
@ -9,8 +9,7 @@ typeorm:
|
|||
|
||||
plus:
|
||||
server:
|
||||
baseUrl: 'https://api.ai.handsfree.work'
|
||||
|
||||
baseUrls: ['https://api.ai.handsfree.work', 'https://api.ai.docmirror.cn']
|
||||
account:
|
||||
server:
|
||||
baseUrl: 'https://ai.handsfree.work/subject'
|
||||
|
|
|
@ -3,6 +3,17 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.25.7](https://github.com/certd/certd/compare/v1.25.6...v1.25.7) (2024-09-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复某些地区被屏蔽无法激活专业版的bug ([7532a96](https://github.com/certd/certd/commit/7532a960851b84d4f2cc3dba02353c5235e1a364))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 上传到主机,支持socks代理 ([d91026d](https://github.com/certd/certd/commit/d91026dc4fbfe5fedc4ee8e43dc0d08f1cf88356))
|
||||
* 支持上传到七牛云oss ([bf024bd](https://github.com/certd/certd/commit/bf024bdda8bc2a463475be5761acf0da7317a08a))
|
||||
|
||||
## [1.25.6](https://github.com/certd/certd/compare/v1.25.5...v1.25.6) (2024-09-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.25.6",
|
||||
"version": "1.25.7",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
|
@ -22,15 +22,15 @@
|
|||
"dependencies": {
|
||||
"@alicloud/cs20151215": "^3.0.3",
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@certd/acme-client": "^1.25.6",
|
||||
"@certd/lib-huawei": "^1.25.6",
|
||||
"@certd/lib-jdcloud": "^1.25.6",
|
||||
"@certd/lib-k8s": "^1.25.6",
|
||||
"@certd/midway-flyway-js": "^1.25.6",
|
||||
"@certd/pipeline": "^1.25.6",
|
||||
"@certd/plugin-cert": "^1.25.6",
|
||||
"@certd/plugin-plus": "^1.25.6",
|
||||
"@certd/plus-core": "^1.25.4",
|
||||
"@certd/acme-client": "^1.25.7",
|
||||
"@certd/lib-huawei": "^1.25.7",
|
||||
"@certd/lib-jdcloud": "^1.25.7",
|
||||
"@certd/lib-k8s": "^1.25.7",
|
||||
"@certd/midway-flyway-js": "^1.25.7",
|
||||
"@certd/pipeline": "^1.25.7",
|
||||
"@certd/plugin-cert": "^1.25.7",
|
||||
"@certd/plugin-plus": "^1.25.7",
|
||||
"@certd/plus-core": "^1.25.6",
|
||||
"@koa/cors": "^5.0.0",
|
||||
"@midwayjs/bootstrap": "^3.16.2",
|
||||
"@midwayjs/cache": "^3.14.0",
|
||||
|
|
|
@ -86,7 +86,7 @@ const development = {
|
|||
resetAdminPasswd: false,
|
||||
},
|
||||
plus: {
|
||||
serverBaseUrl: 'http://127.0.0.1:11007',
|
||||
serverBaseUrls: ['http://127.0.0.1:11007'],
|
||||
},
|
||||
} as MidwayConfig;
|
||||
mergeConfig(development, 'development');
|
||||
|
|
|
@ -9,8 +9,8 @@ import { logger } from '../../../utils/logger.js';
|
|||
export class PlusService {
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
@Config('plus.server.baseUrl')
|
||||
plusServerBaseUrl;
|
||||
@Config('plus.server.baseUrls')
|
||||
plusServerBaseUrls: string[];
|
||||
|
||||
plusRequestService: PlusRequestService;
|
||||
|
||||
|
@ -18,7 +18,7 @@ export class PlusService {
|
|||
async init() {
|
||||
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||
this.plusRequestService = new PlusRequestService({
|
||||
plusServerBaseUrl: this.plusServerBaseUrl,
|
||||
plusServerBaseUrls: this.plusServerBaseUrls,
|
||||
http: http,
|
||||
logger,
|
||||
subjectId: installInfo.siteId,
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
import { AccessInput, IAccess, IsAccess } from '@certd/pipeline';
|
||||
|
||||
@IsAccess({
|
||||
name: 'qiniu',
|
||||
title: '七牛云授权',
|
||||
desc: '',
|
||||
input: {},
|
||||
})
|
||||
export class QiniuAccess implements IAccess {
|
||||
@AccessInput({
|
||||
title: 'AccessKey',
|
||||
rules: [{ required: true, message: '此项必填' }],
|
||||
helper: 'AK,前往[密钥管理](https://portal.qiniu.com/developer/user/key)获取',
|
||||
})
|
||||
accessKey!: string;
|
||||
@AccessInput({
|
||||
title: 'SecretKey',
|
||||
encrypt: true,
|
||||
helper: 'SK',
|
||||
})
|
||||
secretKey!: string;
|
||||
}
|
||||
|
||||
new QiniuAccess();
|
|
@ -1 +0,0 @@
|
|||
export * from './access.js';
|
|
@ -1,2 +1 @@
|
|||
export * from './plugin/index.js';
|
||||
export * from './access/index.js';
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
|
||||
import { QiniuAccess } from '../../access/index.js';
|
||||
import { QiniuAccess, QiniuClient } from '@certd/plugin-plus';
|
||||
import { CertInfo } from '@certd/plugin-cert';
|
||||
import { doRequest, uploadCert } from '../lib/sdk.js';
|
||||
|
||||
@IsTaskPlugin({
|
||||
name: 'QiniuDeployCertToCDN',
|
||||
|
@ -49,24 +48,27 @@ export class QiniuDeployCertToCDN extends AbstractTaskPlugin {
|
|||
async execute(): Promise<void> {
|
||||
this.logger.info('开始部署证书到七牛云cdn');
|
||||
const access = await this.accessService.getById<QiniuAccess>(this.accessId);
|
||||
|
||||
const qiniuClient = new QiniuClient({
|
||||
http: this.ctx.http,
|
||||
access,
|
||||
});
|
||||
const url = `https://api.qiniu.com/domain/${this.domainName}/httpsconf`;
|
||||
let certId = null;
|
||||
if (typeof this.cert !== 'string') {
|
||||
// 是证书id,直接上传即可
|
||||
this.logger.info('先上传证书');
|
||||
certId = await uploadCert(this.ctx.http, access, this.cert, this.appendTimeSuffix('certd'));
|
||||
certId = await qiniuClient.uploadCert(this.cert, this.appendTimeSuffix('certd'));
|
||||
} else {
|
||||
certId = this.cert;
|
||||
}
|
||||
|
||||
//开始修改证书
|
||||
this.logger.info('开始修改证书');
|
||||
this.logger.info(`开始修改证书,certId:${certId},domain:${this.domainName}`);
|
||||
const body = {
|
||||
certID: certId,
|
||||
};
|
||||
|
||||
await doRequest(this.ctx.http, access, url, 'put', body);
|
||||
await qiniuClient.doRequest(url, 'put', body);
|
||||
|
||||
this.logger.info('部署完成');
|
||||
}
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
import { HttpClient } from '@certd/pipeline';
|
||||
import { QiniuAccess } from '../../access/index.js';
|
||||
import { CertInfo } from '@certd/plugin-cert';
|
||||
|
||||
export async function doRequest(http: HttpClient, access: QiniuAccess, url: string, method: string, body: any) {
|
||||
const { generateAccessToken } = await import('qiniu/qiniu/util.js');
|
||||
const token = generateAccessToken(access, url);
|
||||
const res = await http.request({
|
||||
url,
|
||||
method: method,
|
||||
headers: {
|
||||
Authorization: token,
|
||||
},
|
||||
data: body,
|
||||
});
|
||||
|
||||
if (res.code !== 200 || res.error) {
|
||||
throw new Error('请求失败:' + res.error);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function uploadCert(http: HttpClient, access: QiniuAccess, cert: CertInfo, certName?: string) {
|
||||
const url = 'https://api.qiniu.com/sslcert';
|
||||
|
||||
const body = {
|
||||
name: certName,
|
||||
common_name: 'certd',
|
||||
pri: cert.key,
|
||||
ca: cert.crt,
|
||||
};
|
||||
|
||||
const res = await doRequest(http, access, url, 'post', body);
|
||||
|
||||
return res.certID;
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline';
|
||||
import { QiniuAccess } from '../../access/index.js';
|
||||
import { QiniuAccess, QiniuClient } from '@certd/plugin-plus';
|
||||
import { CertInfo } from '@certd/plugin-cert';
|
||||
import { uploadCert } from '../lib/sdk.js';
|
||||
|
||||
@IsTaskPlugin({
|
||||
name: 'QiniuCertUpload',
|
||||
|
@ -53,7 +52,11 @@ export class QiniuCertUpload extends AbstractTaskPlugin {
|
|||
async execute(): Promise<void> {
|
||||
this.logger.info('开始上传证书到七牛云');
|
||||
const access = (await this.accessService.getById(this.accessId)) as QiniuAccess;
|
||||
this.qiniuCertId = await uploadCert(this.ctx.http, access, this.cert, this.appendTimeSuffix(this.certName));
|
||||
const qiniuClient = new QiniuClient({
|
||||
http: this.ctx.http,
|
||||
access,
|
||||
});
|
||||
this.qiniuCertId = await qiniuClient.uploadCert(this.cert, this.appendTimeSuffix(this.certName));
|
||||
this.logger.info('上传完成,id:', this.qiniuCertId);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue