Merge remote-tracking branch 'origin/v2-dev' into v2-dev

pull/436/head
xiaojunnuo 2025-06-13 09:53:30 +08:00
commit 5b49071d6b
44 changed files with 426 additions and 172 deletions

View File

@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
* 支持雨云dns解析 ([8354348](https://github.com/certd/certd/commit/83543487e7418683bd79cfe3b9e0d792bdb977f7))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
* github 版本检查支持执行脚本 ([bad3504](https://github.com/certd/certd/commit/bad3504d4a15e6989b967b66aa9da8c6981f25bf))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes ### Bug Fixes

View File

@ -1 +1 @@
23:58 00:39

View File

@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
* 支持雨云dns解析 ([8354348](https://github.com/certd/certd/commit/83543487e7418683bd79cfe3b9e0d792bdb977f7))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
* github 版本检查支持执行脚本 ([bad3504](https://github.com/certd/certd/commit/bad3504d4a15e6989b967b66aa9da8c6981f25bf))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes ### Bug Fixes

View File

@ -9,5 +9,5 @@
} }
}, },
"npmClient": "pnpm", "npmClient": "pnpm",
"version": "1.35.2" "version": "1.35.3"
} }

View File

@ -20,7 +20,7 @@
"afterpublishOnly": "npm run copylogs && time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push", "afterpublishOnly": "npm run copylogs && time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push",
"transform-sql": "cd ./packages/ui/certd-server/db/ && node --experimental-json-modules transform.js", "transform-sql": "cd ./packages/ui/certd-server/db/ && node --experimental-json-modules transform.js",
"commitAll": "git add . && git commit -m \"build: publish\" && git push && npm run commitPro", "commitAll": "git add . && git commit -m \"build: publish\" && git push && npm run commitPro",
"commitPro": "cd ./packages/core/ && git add . && git commit -m \"build: publish\" && git push", "commitPro": "cd ./packages/pro/ && git add . && git commit -m \"build: publish\" && git push",
"copylogs": "copyfiles \"CHANGELOG.md\" ./docs/guide/changelogs/", "copylogs": "copyfiles \"CHANGELOG.md\" ./docs/guide/changelogs/",
"prepublishOnly1": "npm run check && lerna run build ", "prepublishOnly1": "npm run check && lerna run build ",
"prepublishOnly2": "npm run check && npm run before-build && lerna run build ", "prepublishOnly2": "npm run check && npm run before-build && lerna run build ",

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/publishlab/node-acme-client/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/acme-client
## [1.35.2](https://github.com/publishlab/node-acme-client/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/publishlab/node-acme-client/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/acme-client **Note:** Version bump only for package @certd/acme-client

View File

@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client", "description": "Simple and unopinionated ACME client",
"private": false, "private": false,
"author": "nmorsman", "author": "nmorsman",
"version": "1.35.2", "version": "1.35.3",
"type": "module", "type": "module",
"module": "scr/index.js", "module": "scr/index.js",
"main": "src/index.js", "main": "src/index.js",
@ -18,7 +18,7 @@
"types" "types"
], ],
"dependencies": { "dependencies": {
"@certd/basic": "^1.35.2", "@certd/basic": "^1.35.3",
"@peculiar/x509": "^1.11.0", "@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5", "asn1js": "^3.0.5",
"axios": "^1.7.2", "axios": "^1.7.2",
@ -69,5 +69,5 @@
"bugs": { "bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues" "url": "https://github.com/publishlab/node-acme-client/issues"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/basic
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/basic **Note:** Version bump only for package @certd/basic

View File

@ -1 +1 @@
23:54 00:27

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/basic", "name": "@certd/basic",
"private": false, "private": false,
"version": "1.35.2", "version": "1.35.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@ -45,5 +45,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/pipeline **Note:** Version bump only for package @certd/pipeline

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/pipeline", "name": "@certd/pipeline",
"private": false, "private": false,
"version": "1.35.2", "version": "1.35.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@ -17,8 +17,8 @@
"pub": "npm publish" "pub": "npm publish"
}, },
"dependencies": { "dependencies": {
"@certd/basic": "^1.35.2", "@certd/basic": "^1.35.3",
"@certd/plus-core": "^1.35.2", "@certd/plus-core": "^1.35.3",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13" "reflect-metadata": "^0.1.13"
@ -44,5 +44,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -121,9 +121,13 @@ export abstract class BaseNotification implements INotification {
async onTestRequest() { async onTestRequest() {
return await this.doSend({ return await this.doSend({
userId: 0, userId: 0,
title: "【Certd】测试通知【*.foo.com】标题长度测试、测试、测试", title: "【标题】测试通知【*.foo.com】标题长度测试、测试、测试",
content: `测试通知,*.foo.com content: `测试通知
: *.foo.com
()
<>
[]
`, `,
pipeline: { pipeline: {
id: 1, id: 1,

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-huawei
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-huawei **Note:** Version bump only for package @certd/lib-huawei

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-huawei", "name": "@certd/lib-huawei",
"private": false, "private": false,
"version": "1.35.2", "version": "1.35.3",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts", "types": "./dist/d/index.d.ts",
@ -24,5 +24,5 @@
"prettier": "^2.8.8", "prettier": "^2.8.8",
"tslib": "^2.8.1" "tslib": "^2.8.1"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-iframe
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-iframe **Note:** Version bump only for package @certd/lib-iframe

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-iframe", "name": "@certd/lib-iframe",
"private": false, "private": false,
"version": "1.35.2", "version": "1.35.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@ -31,5 +31,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/jdcloud
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/jdcloud **Note:** Version bump only for package @certd/jdcloud

View File

@ -1,6 +1,6 @@
{ {
"name": "@certd/jdcloud", "name": "@certd/jdcloud",
"version": "1.35.2", "version": "1.35.3",
"description": "jdcloud openApi sdk", "description": "jdcloud openApi sdk",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
@ -61,5 +61,5 @@
"fetch" "fetch"
] ]
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-k8s
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-k8s **Note:** Version bump only for package @certd/lib-k8s

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-k8s", "name": "@certd/lib-k8s",
"private": false, "private": false,
"version": "1.35.2", "version": "1.35.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@ -17,7 +17,7 @@
"pub": "npm publish" "pub": "npm publish"
}, },
"dependencies": { "dependencies": {
"@certd/basic": "^1.35.2", "@certd/basic": "^1.35.3",
"@kubernetes/client-node": "0.21.0" "@kubernetes/client-node": "0.21.0"
}, },
"devDependencies": { "devDependencies": {
@ -32,5 +32,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-server
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-server **Note:** Version bump only for package @certd/lib-server

View File

@ -1,6 +1,6 @@
{ {
"name": "@certd/lib-server", "name": "@certd/lib-server",
"version": "1.35.2", "version": "1.35.3",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
@ -27,10 +27,10 @@
], ],
"license": "AGPL", "license": "AGPL",
"dependencies": { "dependencies": {
"@certd/acme-client": "^1.35.2", "@certd/acme-client": "^1.35.3",
"@certd/basic": "^1.35.2", "@certd/basic": "^1.35.3",
"@certd/pipeline": "^1.35.2", "@certd/pipeline": "^1.35.3",
"@certd/plus-core": "^1.35.2", "@certd/plus-core": "^1.35.3",
"@midwayjs/cache": "~3.14.0", "@midwayjs/cache": "~3.14.0",
"@midwayjs/core": "~3.20.3", "@midwayjs/core": "~3.20.3",
"@midwayjs/i18n": "~3.20.3", "@midwayjs/i18n": "~3.20.3",
@ -61,5 +61,5 @@
"typeorm": "^0.3.11", "typeorm": "^0.3.11",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/midway-flyway-js **Note:** Version bump only for package @certd/midway-flyway-js

View File

@ -1,6 +1,6 @@
{ {
"name": "@certd/midway-flyway-js", "name": "@certd/midway-flyway-js",
"version": "1.35.2", "version": "1.35.3",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
@ -46,5 +46,5 @@
"typeorm": "^0.3.11", "typeorm": "^0.3.11",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/plugin-cert
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/plugin-cert **Note:** Version bump only for package @certd/plugin-cert

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-cert", "name": "@certd/plugin-cert",
"private": false, "private": false,
"version": "1.35.2", "version": "1.35.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@ -16,10 +16,10 @@
"pub": "npm publish" "pub": "npm publish"
}, },
"dependencies": { "dependencies": {
"@certd/acme-client": "^1.35.2", "@certd/acme-client": "^1.35.3",
"@certd/basic": "^1.35.2", "@certd/basic": "^1.35.3",
"@certd/pipeline": "^1.35.2", "@certd/pipeline": "^1.35.3",
"@certd/plugin-lib": "^1.35.2", "@certd/plugin-lib": "^1.35.3",
"@google-cloud/publicca": "^1.3.0", "@google-cloud/publicca": "^1.3.0",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"jszip": "^3.10.1", "jszip": "^3.10.1",
@ -43,5 +43,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/plugin-lib
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes ### Bug Fixes

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-lib", "name": "@certd/plugin-lib",
"private": false, "private": false,
"version": "1.35.2", "version": "1.35.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@ -21,8 +21,8 @@
"@alicloud/pop-core": "^1.7.10", "@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.10", "@alicloud/tea-util": "^1.4.10",
"@aws-sdk/client-s3": "^3.787.0", "@aws-sdk/client-s3": "^3.787.0",
"@certd/basic": "^1.35.2", "@certd/basic": "^1.35.3",
"@certd/pipeline": "^1.35.2", "@certd/pipeline": "^1.35.3",
"@kubernetes/client-node": "0.21.0", "@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0", "ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5", "basic-ftp": "^5.0.5",
@ -53,5 +53,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "f252871fb892af015c99052e3728fb0a0535b012" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Performance Improvements ### Performance Improvements

View File

@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-client", "name": "@certd/ui-client",
"version": "1.35.2", "version": "1.35.3",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite --open", "dev": "vite --open",
@ -102,8 +102,8 @@
"zod-defaults": "^0.1.3" "zod-defaults": "^0.1.3"
}, },
"devDependencies": { "devDependencies": {
"@certd/lib-iframe": "^1.35.2", "@certd/lib-iframe": "^1.35.3",
"@certd/pipeline": "^1.35.2", "@certd/pipeline": "^1.35.3",
"@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12", "@types/chai": "^4.3.12",

View File

@ -49,38 +49,38 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
pageRequest, pageRequest,
addRequest, addRequest,
editRequest, editRequest,
delRequest delRequest,
}, },
toolbar: { toolbar: {
show: false show: false,
}, },
search: { search: {
show: false show: false,
}, },
form: { form: {
wrapper: { wrapper: {
width: "1050px" width: "1050px",
} },
}, },
rowHandle: { rowHandle: {
width: 200 width: 200,
}, },
table: { table: {
scroll: { scroll: {
x: 800 x: 800,
}, },
rowSelection: { rowSelection: {
type: "radio", type: "radio",
selectedRowKeys: selectedRowKey, selectedRowKeys: selectedRowKey,
onChange: onSelectChange onChange: onSelectChange,
}, },
customRow: (record: any) => { customRow: (record: any) => {
return { return {
onClick: () => { onClick: () => {
onSelectChange([record.id]); onSelectChange([record.id]);
} // 点击行 }, // 点击行
}; };
} },
}, },
columns: { columns: {
id: { id: {
@ -88,25 +88,25 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
key: "id", key: "id",
type: "number", type: "number",
column: { column: {
width: 50 width: 50,
}, },
form: { form: {
show: false show: false,
} },
}, },
name: { name: {
title: "名称", title: "名称",
search: { search: {
show: true show: true,
}, },
type: ["text"], type: ["text"],
form: { form: {
rules: [{ required: true, message: "请填写名称" }], rules: [{ required: true, message: "请填写名称" }],
helper: "随便填,当多个相同类型的授权时,便于区分" helper: "随便填,当多个相同类型的授权时,便于区分",
}, },
column: { column: {
width: 200 width: 200,
} },
}, },
from: { from: {
title: "级别", title: "级别",
@ -114,29 +114,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
dict: dict({ dict: dict({
data: [ data: [
{ label: "系统", value: "sys" }, { label: "系统", value: "sys" },
{ label: "用户", value: "user" } { label: "用户", value: "user" },
] ],
}), }),
search: { search: {
show: false show: false,
}, },
form: { form: {
show: false show: false,
}, },
column: { column: {
width: 100, width: 100,
align: "center", align: "center",
component: { component: {
color: "auto" color: "auto",
}, },
order: 10 order: 10,
}, },
valueBuilder: ({ row, key, value }) => { valueBuilder: ({ row, key, value }) => {
row[key] = row.userId > 0 ? "user" : "sys"; row[key] = row.userId > 0 ? "user" : "sys";
} },
}, },
...commonColumnsDefine ...commonColumnsDefine,
} },
} },
}; };
} }

View File

@ -130,7 +130,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await api.DoCheck(row.id); await api.DoCheck(row.id);
await crudExpose.doRefresh(); await crudExpose.doRefresh();
notification.success({ notification.success({
message: "检查完成", message: "检查任务已提交,请稍后刷新查看结果",
}); });
}, },
}, },

View File

@ -137,7 +137,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await api.DoCheck(row.id); await api.DoCheck(row.id);
await crudExpose.doRefresh(); await crudExpose.doRefresh();
notification.success({ notification.success({
message: "检查任务已提交", message: "检查任务已提交,请稍后刷新查看结果",
}); });
}, },
}, },

View File

@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 支持雨云dns解析 ([8354348](https://github.com/certd/certd/commit/83543487e7418683bd79cfe3b9e0d792bdb977f7))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
* github 版本检查支持执行脚本 ([bad3504](https://github.com/certd/certd/commit/bad3504d4a15e6989b967b66aa9da8c6981f25bf))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes ### Bug Fixes

View File

@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-server", "name": "@certd/ui-server",
"version": "1.35.2", "version": "1.35.3",
"description": "fast-server base midway", "description": "fast-server base midway",
"private": true, "private": true,
"type": "module", "type": "module",
@ -42,20 +42,20 @@
"@aws-sdk/client-cloudfront": "^3.699.0", "@aws-sdk/client-cloudfront": "^3.699.0",
"@aws-sdk/client-iam": "^3.699.0", "@aws-sdk/client-iam": "^3.699.0",
"@aws-sdk/client-s3": "^3.705.0", "@aws-sdk/client-s3": "^3.705.0",
"@certd/acme-client": "^1.35.2", "@certd/acme-client": "^1.35.3",
"@certd/basic": "^1.35.2", "@certd/basic": "^1.35.3",
"@certd/commercial-core": "^1.35.2", "@certd/commercial-core": "^1.35.3",
"@certd/cv4pve-api-javascript": "^8.4.1", "@certd/cv4pve-api-javascript": "^8.4.1",
"@certd/jdcloud": "^1.35.2", "@certd/jdcloud": "^1.35.3",
"@certd/lib-huawei": "^1.35.2", "@certd/lib-huawei": "^1.35.3",
"@certd/lib-k8s": "^1.35.2", "@certd/lib-k8s": "^1.35.3",
"@certd/lib-server": "^1.35.2", "@certd/lib-server": "^1.35.3",
"@certd/midway-flyway-js": "^1.35.2", "@certd/midway-flyway-js": "^1.35.3",
"@certd/pipeline": "^1.35.2", "@certd/pipeline": "^1.35.3",
"@certd/plugin-cert": "^1.35.2", "@certd/plugin-cert": "^1.35.3",
"@certd/plugin-lib": "^1.35.2", "@certd/plugin-lib": "^1.35.3",
"@certd/plugin-plus": "^1.35.2", "@certd/plugin-plus": "^1.35.3",
"@certd/plus-core": "^1.35.2", "@certd/plus-core": "^1.35.3",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120", "@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120", "@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
"@koa/cors": "^5.0.0", "@koa/cors": "^5.0.0",

View File

@ -104,7 +104,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
* @param notify * @param notify
* @param retryTimes * @param retryTimes
*/ */
async doCheck(site: SiteInfoEntity, notify = true, retryTimes = 3) { async doCheck(site: SiteInfoEntity, notify = true, retryTimes = null) {
if (!site?.domain) { if (!site?.domain) {
throw new Error("站点域名不能为空"); throw new Error("站点域名不能为空");
} }
@ -152,7 +152,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
//检查ip //检查ip
await this.checkAllIp(site); await this.checkAllIp(site,retryTimes);
if (!notify) { if (!notify) {
return; return;
@ -181,7 +181,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
} }
} }
async checkAllIp(site: SiteInfoEntity) { async checkAllIp(site: SiteInfoEntity,retryTimes = null) {
if (!site.ipCheck) { if (!site.ipCheck) {
return; return;
} }
@ -225,7 +225,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
logger.error("send notify error", e); logger.error("send notify error", e);
} }
}; };
await this.siteIpService.checkAll(site, onFinished); await this.siteIpService.checkAll(site, retryTimes,onFinished);
} }
/** /**
@ -234,7 +234,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
* @param notify * @param notify
* @param retryTimes * @param retryTimes
*/ */
async check(id: number, notify = false, retryTimes = 3) { async check(id: number, notify = false, retryTimes = null) {
const site = await this.info(id); const site = await this.info(id);
if (!site) { if (!site) {
throw new Error("站点不存在"); throw new Error("站点不存在");
@ -326,7 +326,6 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
return setting; return setting;
} }
for (const site of sites) { for (const site of sites) {
let retryTimes = 3;
const setting = await getFromCache(site.userId) const setting = await getFromCache(site.userId)
if (isCommon) { if (isCommon) {
//公共的检查排除有设置cron的用户 //公共的检查排除有设置cron的用户
@ -334,8 +333,8 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
//设置了cron跳过公共检查 //设置了cron跳过公共检查
continue; continue;
} }
retryTimes = setting.retryTimes??retryTimes
} }
let retryTimes = setting?.retryTimes
this.doCheck(site,true,retryTimes).catch(e => { this.doCheck(site,true,retryTimes).catch(e => {
logger.error(`检查站点证书失败,${site.domain}`, e.message); logger.error(`检查站点证书失败,${site.domain}`, e.message);
}); });

View File

@ -88,7 +88,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
await this.updateIpCount(entity.id) await this.updateIpCount(entity.id)
} }
async check(ipId: number, domain: string, port: number) { async check(ipId: number, domain: string, port: number,retryTimes = null) {
if(!ipId){ if(!ipId){
return return
} }
@ -105,7 +105,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
const res = await siteTester.test({ const res = await siteTester.test({
host: domain, host: domain,
port: port, port: port,
retryTimes: 3, retryTimes : retryTimes??3,
ipAddress: entity.ipAddress ipAddress: entity.ipAddress
}); });
@ -154,7 +154,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
} }
} }
async checkAll(siteInfo: SiteInfoEntity,onFinish?: (e: any) => void) { async checkAll(siteInfo: SiteInfoEntity,retryTimes = null,onFinish?: (e: any) => void) {
const siteId = siteInfo.id; const siteId = siteInfo.id;
const ips = await this.repository.find({ const ips = await this.repository.find({
where: { where: {
@ -167,7 +167,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
for (const item of ips) { for (const item of ips) {
const func = async () => { const func = async () => {
try { try {
return await this.check(item.id, domain, port); return await this.check(item.id, domain, port,retryTimes);
} catch (e) { } catch (e) {
logger.error("check site item error", e); logger.error("check site item error", e);
return { return {

View File

@ -18,7 +18,7 @@ export type SiteTestRes = {
export class SiteTester { export class SiteTester {
async test(req: SiteTestReq): Promise<SiteTestRes> { async test(req: SiteTestReq): Promise<SiteTestRes> {
logger.info("测试站点:", JSON.stringify(req)); logger.info("测试站点:", JSON.stringify(req));
const maxRetryTimes = req.retryTimes ?? 3; const maxRetryTimes = req.retryTimes==null ? 3 : req.retryTimes;
let tryCount = 0; let tryCount = 0;
let result: SiteTestRes = {}; let result: SiteTestRes = {};
while (true) { while (true) {
@ -28,12 +28,12 @@ export class SiteTester {
} catch (e) { } catch (e) {
tryCount++; tryCount++;
if (tryCount > maxRetryTimes) { if (tryCount > maxRetryTimes) {
logger.error(`测试站点出错,重试${maxRetryTimes}次。`, e.message); logger.error(`测试站点出错,已超过最大重试次数(${maxRetryTimes}`, e.message);
throw e; throw e;
} }
//指数退避 //指数退避
const time = 2 ** tryCount; const time = 2 ** tryCount;
logger.error(`测试站点出错,${time}s后重试`, e); logger.error(`测试站点出错,${time}s后重试(${tryCount}/${maxRetryTimes})`, e);
await utils.sleep(time * 1000); await utils.sleep(time * 1000);
} }
} }

View File

@ -24,3 +24,4 @@ export * from './plugin-notification/index.js'
export * from './plugin-flex/index.js' export * from './plugin-flex/index.js'
export * from './plugin-farcdn/index.js' export * from './plugin-farcdn/index.js'
export * from './plugin-fnos/index.js' export * from './plugin-fnos/index.js'
export * from './plugin-rainyun/index.js'

View File

@ -59,7 +59,8 @@ export class TelegramNotification extends BaseNotification {
skipSslVerify: boolean; skipSslVerify: boolean;
replaceText(text: string) { replaceText(text: string) {
return text.replaceAll('.', '\\.').replaceAll('*', '\\*'); // .*()<> 等都需要用\\进行替换
return text.replace(/[\\.*()<>]/g, '\\$&');
} }
async send(body: NotificationBody) { async send(body: NotificationBody) {
if (!this.botToken || !this.chatId) { if (!this.botToken || !this.chatId) {

View File

@ -1,5 +1,6 @@
import {AccessInput, BaseAccess, IsAccess} from "@certd/pipeline"; import {AccessInput, BaseAccess, IsAccess} from "@certd/pipeline";
import {HttpRequestConfig} from "@certd/basic"; import {HttpRequestConfig} from "@certd/basic";
import { CertInfo } from "@certd/plugin-cert";
/** /**
@ -41,13 +42,13 @@ export class RainyunAccess extends BaseAccess {
testRequest = true; testRequest = true;
async onTestRequest() { async onTestRequest() {
await this.getDomainList({}); await this.getDomainList({limit:1});
return "ok" return "ok"
} }
// {"columnFilters":{"domains.Domain":"domain"},"sort":[],"page":1,"perPage":20} // {"columnFilters":{"domains.Domain":"domain"},"sort":[],"page":1,"perPage":20}
async getDomainList(req:{offset?:number,size?:number,query?:string}){ async getDomainList(req:{offset?:number,limit?:number,query?:string}){
const size = req.size ?? 20; const size = req.limit ?? 20;
const offset = req.offset ?? 0; const offset = req.offset ?? 0;
let page = Math.floor(offset / size); let page = Math.floor(offset / size);
if(offset % size === 0 ){ if(offset % size === 0 ){
@ -60,10 +61,70 @@ export class RainyunAccess extends BaseAccess {
"domains.Domain": req.query??"" "domains.Domain": req.query??""
}, },
} }
return await this.doRequest({ const res = await this.doRequest({
url: `/product/domain/?options=${encodeURIComponent(JSON.stringify(options))}`, url: `/product/domain/?options=${encodeURIComponent(JSON.stringify(options))}`,
method: "GET", method: "GET",
}); });
return {
total: res.TotalRecords,
list: res.Records || [],
limit: size,
offset: offset
}
}
async getCertList(req:{offset?:number,limit?:number,query?:string}){
const size = req.limit ?? 20;
const offset = req.offset ?? 0;
let page = Math.floor(offset / size);
if(offset % size === 0 ){
page++
}
const options ={
columnFilters: {
Domain: req.query??""
},
sort:[],
page: page,
perPage: size,
}
const res = await this.doRequest({
url: `product/sslcenter/?options=${encodeURIComponent(JSON.stringify(options))}`,
method: "GET",
});
return {
total: res.TotalRecords,
list: res.Records || [],
limit: size,
offset: offset
}
}
async doCertReplace(req:{certId:number,cert:CertInfo}){
// /product/sslcenter/{id}
return await this.doRequest({
url: `product/sslcenter/${req.certId}`,
method: "PUT",
data: {
cert: req.cert.crt,
key: req.cert.key,
}
});
}
async getDomainId(domain:string){
const res = await this.getDomainList({query: domain,limit:1});
if (res.list.length === 0) {
throw new Error(`域名${domain}不存在` );
}
return res.list[0].id;
} }
async doRequest(req:HttpRequestConfig){ async doRequest(req:HttpRequestConfig){

View File

@ -1,87 +1,65 @@
import {AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions} from '@certd/plugin-cert'; import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
import {RainyunAccess} from "./access.js"; import { RainyunAccess } from "./access.js";
@IsDnsProvider({ @IsDnsProvider({
name: 'rainyun', name: "rainyun",
title: '雨云', title: "雨云",
desc: '雨云DNS解析提供商', desc: "雨云DNS解析提供商",
accessType: 'rainyun', accessType: "rainyun",
icon: 'svg:icon-lucky', icon: "svg:icon-lucky",
order:0, order: 0
}) })
export class RainyunDnsProvider extends AbstractDnsProvider { export class RainyunDnsProvider extends AbstractDnsProvider {
client: any; client: any;
async onInstance() { async onInstance() {
} }
async createRecord(options: CreateRecordOptions): Promise<any> { async createRecord(options: CreateRecordOptions): Promise<any> {
const access: RainyunAccess = this.ctx.access as RainyunAccess const access: RainyunAccess = this.ctx.access as RainyunAccess;
console.log(access)
const { fullRecord,hostRecord, value, type, domain } = options; const domainId = await access.getDomainId(options.domain);
this.logger.info('添加域名解析:', fullRecord, value, domain); if (!domainId) {
// const domain = await this.matchDomain(fullRecord); throw new Error(`域名${options.domain}未找到`);
const params = { }
RegionId: 'cn-hangzhou',
DomainName: domain, const { fullRecord, hostRecord, value, type, domain } = options;
RR: hostRecord, this.logger.info("添加域名解析:", fullRecord, value, domain);
Type: type,
Value: value, const ret = await access.doRequest({
// Line: 'oversea' // 海外 url: `/product/domain/${domainId}/dns`,
method: "POST",
data: {
host: hostRecord,
value: value,
level: 1,
type: type,
line: "DEFAULT",
ttl: 60
}
});
this.logger.info("添加域名解析成功:", JSON.stringify(options), ret);
return {
recordId: ret,
domainId: domainId
}; };
const requestOption = {
method: 'POST',
};
try {
const ret = await this.client.request('AddDomainRecord', params, requestOption);
this.logger.info('添加域名解析成功:', JSON.stringify(options), ret.RecordId);
return ret.RecordId;
} catch (e: any) {
if (e.code === 'DomainRecordDuplicate') {
return;
}
if(e.code === "LastOperationNotFinished"){
this.logger.info('上一个操作还未完成5s后重试')
await this.ctx.utils.sleep(5000)
return this.createRecord(options)
}
this.logger.info('添加域名解析出错', e);
this.resolveError(e, options);
}
} }
resolveError(e: any, req: CreateRecordOptions) {
if (e.message?.indexOf('The specified domain name does not exist') > -1) {
throw new Error(`阿里云账号中不存在此域名:${req.domain}`);
}
throw e;
}
async removeRecord(options: RemoveRecordOptions<any>): Promise<any> { async removeRecord(options: RemoveRecordOptions<any>): Promise<any> {
const { fullRecord, value } = options.recordReq; const { fullRecord, value } = options.recordReq;
const access: RainyunAccess = this.ctx.access as RainyunAccess;
const record = options.recordRes; const record = options.recordRes;
const params = { const ret = await access.doRequest({
RegionId: 'cn-hangzhou', url: `/product/domain/${record.domainId}/dns?record_id=${record.recordId}`,
RecordId: record, method: "DELETE",
}; });
this.logger.info("删除域名解析成功:", fullRecord, value, ret);
const requestOption = { return ret;
method: 'POST',
};
try{
const ret = await this.client.request('DeleteDomainRecord', params, requestOption);
this.logger.info('删除域名解析成功:', fullRecord, value, ret.RecordId);
return ret.RecordId;
}catch (e) {
if(e.code === "LastOperationNotFinished"){
this.logger.info('上一个操作还未完成5s后重试')
await this.ctx.utils.sleep(5000)
return this.removeRecord(options)
}
throw e
}
} }
} }

View File

@ -0,0 +1,113 @@
import { AbstractTaskPlugin, IsTaskPlugin, PageReq, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { RainyunAccess } from "../access.js";
@IsTaskPlugin({
//命名规范,插件类型+功能就是目录plugin-demo中的demo大写字母开头驼峰命名
name: "RainyunRefreshCert",
title: "雨云-更新证书",
desc: "app.rainyun.com",
icon: "svg:icon-lucky",
//插件分组
group: pluginGroups.cdn.key,
needPlus: false,
default: {
//默认值配置照抄即可
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed
}
}
})
//类名规范跟上面插件名称name一致
export class RainyunRefreshCert extends AbstractTaskPlugin {
//证书选择,此项必须要有
@TaskInput({
title: "域名证书",
helper: "请选择前置任务输出的域名证书",
component: {
name: "output-selector",
from: [...CertApplyPluginNames]
}
// required: true, // 必填
})
cert!: CertInfo;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[];
//授权选择框
@TaskInput({
title: "雨云授权",
component: {
name: "access-selector",
type: "rainyun" //固定授权类型
},
required: true //必填
})
accessId!: string;
//
@TaskInput(
createRemoteSelectInputDefine({
title: "证书Id",
helper: "要更新的rainyun证书id",
action: RainyunRefreshCert.prototype.onGetCertList.name
})
)
certList!: number[];
//插件实例化时执行的方法
async onInstance() {
}
//插件执行方法
async execute(): Promise<void> {
const access = await this.getAccess<RainyunAccess>(this.accessId);
for (const item of this.certList) {
this.logger.info(`----------- 开始更新证书:${item}`);
await access.doCertReplace({
certId: item,
cert: this.cert
});
this.logger.info(`----------- 更新证书${item}成功`);
}
this.logger.info("部署完成");
}
async onGetCertList(req: PageReq = {}) {
const access = await this.getAccess<RainyunAccess>(this.accessId);
const offset = req.offset ?? 0;
const limit = req.limit ?? 100;
const res = await access.getCertList({
offset,
limit
});
const total = res.total;
const list = res.list;
if (!list || list.length === 0) {
throw new Error("没有找到证书,请先在控制台上传一次证书且关联站点");
}
const options = list.map((item: any) => {
return {
label: `${item.Domain}<${item.ID}>`,
value: item.ID,
domain: item.Domain.split(",").map(item => item.trim())
};
});
return {
list: this.ctx.utils.options.buildGroupOptions(options, this.certDomains),
total: total,
offset: offset,
limit: limit
};
}
}
//实例化一下,注册插件
new RainyunRefreshCert();