mirror of
https://github.com/certd/certd.git
synced 2026-04-04 23:10:56 +08:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
023db4e04e | ||
|
|
5a4b95f5fe | ||
|
|
b091657b5c | ||
|
|
f7bf5c9328 | ||
|
|
86e521b9aa | ||
|
|
e08cf57b72 | ||
|
|
9e06cb9a83 | ||
|
|
c65e8622b8 | ||
|
|
7795efeb7a | ||
|
|
e725e0020e | ||
|
|
cff7baaaad | ||
|
|
4d68a174cb | ||
|
|
ed1a9fc7aa | ||
|
|
47ebab237b | ||
|
|
f9553e7d44 | ||
|
|
ae51676471 | ||
|
|
f933fb705c | ||
|
|
918ea59b9a | ||
|
|
b9dab77c8b | ||
|
|
4159534a64 | ||
|
|
d00177a9b6 |
@@ -3,6 +3,13 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 优化阿里云DCDN插件,支持多选 ([b091657](https://github.com/certd/certd/commit/b091657b5c537acf2442a2bfc345d0a77f5e2c50))
|
||||
* 支持部署到farcdn ([e08cf57](https://github.com/certd/certd/commit/e08cf57b72128998f487ab6469868052fbce0dba))
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -110,8 +110,7 @@ https://certd.handfree.work/
|
||||
> * 请务必使用web应用防火墙防护本应用,防止XSS、SQL注入等攻击
|
||||
> * 请务必做好服务器本身的安全防护,防止数据库泄露
|
||||
> * 请务必做好数据备份,避免数据丢失
|
||||
|
||||
|
||||
> * [更多安全生产建议点我](https://certd.docmirror.cn/guide/feature/safe/)
|
||||
|
||||
|
||||
## 五、更多帮助
|
||||
|
||||
@@ -1 +1 @@
|
||||
01:40
|
||||
23:45
|
||||
|
||||
@@ -3,6 +3,22 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复公共插件配置修改不生效的bug,优化系统设置参数注入时机 ([e1e510c](https://github.com/certd/certd/commit/e1e510ce1e37a5ae82478226b6987a83f22d1ecb))
|
||||
* 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug ([7984b62](https://github.com/certd/certd/commit/7984b625ba6727132f205db8e25f790bce27b2f7))
|
||||
* 修复lego模式下每次都重新申请证书的bug ([f807b8c](https://github.com/certd/certd/commit/f807b8cb465cc329fa034ecbef94e18ef394f870))
|
||||
* 优化 RunnableError错误信息展示 ([36bc3ff](https://github.com/certd/certd/commit/36bc3ff22da93ba342c3c1103d7ee2bbcecf44f2))
|
||||
* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 二次认证页面中,添加动态验证码输入框的焦点控制,提升用户体验 ([bb22f06](https://github.com/certd/certd/commit/bb22f062ed4ab4b5b71938270fe4cc666af6b8e7))
|
||||
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
|
||||
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.34.6"
|
||||
"version": "1.34.7"
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/publishlab/node-acme-client/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.34.6](https://github.com/publishlab/node-acme-client/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.6",
|
||||
"@certd/basic": "^1.34.7",
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"asn1js": "^3.0.5",
|
||||
"axios": "^1.7.2",
|
||||
@@ -69,5 +69,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
@@ -1 +1 @@
|
||||
23:42
|
||||
23:20
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -45,5 +45,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,8 +17,8 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.6",
|
||||
"@certd/plus-core": "^1.34.6",
|
||||
"@certd/basic": "^1.34.7",
|
||||
"@certd/plus-core": "^1.34.7",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
@@ -44,5 +44,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -228,13 +228,10 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
}
|
||||
|
||||
buildCertName(domain: string) {
|
||||
if (domain.includes("*")) {
|
||||
domain = domain.replaceAll("*", "_");
|
||||
}
|
||||
domain = domain.replaceAll("*", "_").replaceAll(".", "_");
|
||||
return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`;
|
||||
}
|
||||
|
||||
|
||||
async onRequest(req: PluginRequestHandleReq<any>) {
|
||||
if (!req.action) {
|
||||
throw new Error("action is required");
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
@@ -24,5 +24,5 @@
|
||||
"prettier": "^2.8.8",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -31,5 +31,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
@@ -61,5 +61,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.6",
|
||||
"@certd/basic": "^1.34.7",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,5 +32,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -27,10 +27,10 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.34.6",
|
||||
"@certd/basic": "^1.34.6",
|
||||
"@certd/pipeline": "^1.34.6",
|
||||
"@certd/plus-core": "^1.34.6",
|
||||
"@certd/acme-client": "^1.34.7",
|
||||
"@certd/basic": "^1.34.7",
|
||||
"@certd/pipeline": "^1.34.7",
|
||||
"@certd/plus-core": "^1.34.7",
|
||||
"@midwayjs/cache": "~3.14.0",
|
||||
"@midwayjs/core": "~3.20.3",
|
||||
"@midwayjs/i18n": "~3.20.3",
|
||||
@@ -61,5 +61,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -46,5 +46,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -16,10 +16,10 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.34.6",
|
||||
"@certd/basic": "^1.34.6",
|
||||
"@certd/pipeline": "^1.34.6",
|
||||
"@certd/plugin-lib": "^1.34.6",
|
||||
"@certd/acme-client": "^1.34.7",
|
||||
"@certd/basic": "^1.34.7",
|
||||
"@certd/pipeline": "^1.34.7",
|
||||
"@certd/plugin-lib": "^1.34.7",
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"dayjs": "^1.11.7",
|
||||
"jszip": "^3.10.1",
|
||||
@@ -43,5 +43,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -93,6 +93,11 @@ export class CertReader {
|
||||
return domains;
|
||||
}
|
||||
|
||||
getAltNames() {
|
||||
const { detail } = this.getCrtDetail();
|
||||
return detail.domains.altNames;
|
||||
}
|
||||
|
||||
static getMainDomain(crt: string) {
|
||||
const { detail } = CertReader.readCertDetail(crt);
|
||||
return detail.domains.commonName;
|
||||
@@ -174,8 +179,14 @@ export class CertReader {
|
||||
buildCertFileName(suffix: string, applyTime: any, prefix = "cert") {
|
||||
const detail = this.getCrtDetail();
|
||||
let domain = detail.detail.domains.commonName;
|
||||
domain = domain.replace(".", "_").replace("*", "_");
|
||||
domain = domain.replaceAll(".", "_").replaceAll("*", "_");
|
||||
const timeStr = dayjs(applyTime).format("YYYYMMDDHHmmss");
|
||||
return `${prefix}_${domain}_${timeStr}.${suffix}`;
|
||||
}
|
||||
|
||||
buildCertName() {
|
||||
let domain = this.getMainDomain();
|
||||
domain = domain.replaceAll("*", "_").replaceAll("*", "_");
|
||||
return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -20,8 +20,8 @@
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@alicloud/tea-util": "^1.4.10",
|
||||
"@aws-sdk/client-s3": "^3.787.0",
|
||||
"@certd/basic": "^1.34.6",
|
||||
"@certd/pipeline": "^1.34.6",
|
||||
"@certd/basic": "^1.34.7",
|
||||
"@certd/pipeline": "^1.34.7",
|
||||
"@kubernetes/client-node": "0.21.0",
|
||||
"ali-oss": "^6.22.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
@@ -52,5 +52,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "d23792fda2a185e8ba038434460792f738878a42"
|
||||
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export class AliyunSslClient {
|
||||
method: "POST",
|
||||
};
|
||||
|
||||
this.opts.logger.info("开始上传证书");
|
||||
this.opts.logger.info(`开始上传证书:${req.name}`);
|
||||
const ret: any = await client.request("UploadUserCertificate", params, requestOption);
|
||||
this.checkRet(ret);
|
||||
this.opts.logger.info("证书上传成功:aliyunCertId=", ret.CertId);
|
||||
|
||||
@@ -50,9 +50,22 @@ export class TencentSslClient {
|
||||
const ret = await client.UploadCertificate(params);
|
||||
this.checkRet(ret);
|
||||
this.logger.info("证书上传成功:tencentCertId=", ret.CertificateId);
|
||||
await this.switchCertNotify([ret.CertificateId], true);
|
||||
return ret.CertificateId;
|
||||
}
|
||||
|
||||
async switchCertNotify(certIds: string[], disabled: boolean) {
|
||||
const client = await this.getSslClient();
|
||||
const params = {
|
||||
CertificateIds: certIds,
|
||||
SwitchStatus: disabled ? 1 : 0, //1是忽略通知,0是不忽略
|
||||
};
|
||||
const ret = await client.ModifyCertificatesExpiringNotificationSwitch(params);
|
||||
this.checkRet(ret);
|
||||
this.logger.info(`关闭证书${certIds}过期通知成功`);
|
||||
return ret.RequestId;
|
||||
}
|
||||
|
||||
async deployCertificateInstance(params: any) {
|
||||
const client = await this.getSslClient();
|
||||
const res = await client.DeployCertificateInstance(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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/ui-client
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -102,8 +102,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.34.6",
|
||||
"@certd/pipeline": "^1.34.6",
|
||||
"@certd/lib-iframe": "^1.34.7",
|
||||
"@certd/pipeline": "^1.34.7",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -140,7 +140,7 @@ function createRequestFunction(service: any) {
|
||||
headers: {
|
||||
"Content-Type": get(config, "headers.Content-Type", "application/json"),
|
||||
},
|
||||
timeout: 20000,
|
||||
timeout: 30000,
|
||||
baseURL: env.API,
|
||||
data: {},
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<a-form-item>
|
||||
<a-button type="primary" size="large" html-type="submit" :loading="loading" class="login-button">登录</a-button>
|
||||
|
||||
<div class="mt-2"><a href="https://certd.docmirror.cn/guide/use/forgotpasswd/" target="_blank">忘记管理员密码?</a></div>
|
||||
<div v-if="!settingStore.isComm" class="mt-2"><a href="https://certd.docmirror.cn/guide/use/forgotpasswd/" target="_blank">忘记管理员密码?</a></div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="user-login-other">
|
||||
@@ -178,6 +178,7 @@ export default defineComponent({
|
||||
function hasRegisterTypeEnabled() {
|
||||
return sysPublicSettings.registerEnabled && (sysPublicSettings.usernameRegisterEnabled || sysPublicSettings.emailRegisterEnabled);
|
||||
}
|
||||
|
||||
return {
|
||||
loading,
|
||||
formState,
|
||||
@@ -193,6 +194,7 @@ export default defineComponent({
|
||||
twoFactor,
|
||||
handleTwoFactorSubmit,
|
||||
verifyCodeInputRef,
|
||||
settingStore,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 优化阿里云DCDN插件,支持多选 ([b091657](https://github.com/certd/certd/commit/b091657b5c537acf2442a2bfc345d0a77f5e2c50))
|
||||
* 支持部署到farcdn ([e08cf57](https://github.com/certd/certd/commit/e08cf57b72128998f487ab6469868052fbce0dba))
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.34.6",
|
||||
"version": "1.34.7",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -41,19 +41,19 @@
|
||||
"@aws-sdk/client-acm": "^3.699.0",
|
||||
"@aws-sdk/client-cloudfront": "^3.699.0",
|
||||
"@aws-sdk/client-s3": "^3.705.0",
|
||||
"@certd/acme-client": "^1.34.6",
|
||||
"@certd/basic": "^1.34.6",
|
||||
"@certd/commercial-core": "^1.34.6",
|
||||
"@certd/jdcloud": "^1.34.6",
|
||||
"@certd/lib-huawei": "^1.34.6",
|
||||
"@certd/lib-k8s": "^1.34.6",
|
||||
"@certd/lib-server": "^1.34.6",
|
||||
"@certd/midway-flyway-js": "^1.34.6",
|
||||
"@certd/pipeline": "^1.34.6",
|
||||
"@certd/plugin-cert": "^1.34.6",
|
||||
"@certd/plugin-lib": "^1.34.6",
|
||||
"@certd/plugin-plus": "^1.34.6",
|
||||
"@certd/plus-core": "^1.34.6",
|
||||
"@certd/acme-client": "^1.34.7",
|
||||
"@certd/basic": "^1.34.7",
|
||||
"@certd/commercial-core": "^1.34.7",
|
||||
"@certd/jdcloud": "^1.34.7",
|
||||
"@certd/lib-huawei": "^1.34.7",
|
||||
"@certd/lib-k8s": "^1.34.7",
|
||||
"@certd/lib-server": "^1.34.7",
|
||||
"@certd/midway-flyway-js": "^1.34.7",
|
||||
"@certd/pipeline": "^1.34.7",
|
||||
"@certd/plugin-cert": "^1.34.7",
|
||||
"@certd/plugin-lib": "^1.34.7",
|
||||
"@certd/plugin-plus": "^1.34.7",
|
||||
"@certd/plus-core": "^1.34.7",
|
||||
"@corsinvest/cv4pve-api-javascript": "^8.3.0",
|
||||
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
|
||||
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
|
||||
|
||||
@@ -151,6 +151,9 @@ export class UserService extends BaseService<UserEntity> {
|
||||
|
||||
async buildPlainPassword(rawPassword: string) {
|
||||
const setting: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||
if (!setting.siteId) {
|
||||
throw new CommonException('站点ID还未初始化');
|
||||
}
|
||||
const prefixSiteId = setting.siteId.substring(1, 5);
|
||||
return rawPassword + prefixSiteId;
|
||||
}
|
||||
|
||||
@@ -21,3 +21,4 @@ export * from './plugin-jdcloud/index.js'
|
||||
export * from './plugin-51dns/index.js'
|
||||
export * from './plugin-notification/index.js'
|
||||
export * from './plugin-flex/index.js'
|
||||
export * from './plugin-farcdn/index.js'
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
|
||||
import dayjs from 'dayjs';
|
||||
import { AliyunAccess, AliyunClient, createCertDomainGetterInputDefine } from '@certd/plugin-lib';
|
||||
import {
|
||||
AliyunAccess,
|
||||
AliyunClient,
|
||||
createCertDomainGetterInputDefine,
|
||||
createRemoteSelectInputDefine
|
||||
} from "@certd/plugin-lib";
|
||||
import { CertInfo } from '@certd/plugin-cert';
|
||||
import { CertApplyPluginNames} from '@certd/plugin-cert';
|
||||
import { optionsUtils } from "@certd/basic/dist/utils/util.options.js";
|
||||
@IsTaskPlugin({
|
||||
name: 'DeployCertToAliyunDCDN',
|
||||
title: '阿里云-部署证书至DCDN',
|
||||
@@ -41,12 +47,6 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
|
||||
})
|
||||
accessId!: string;
|
||||
|
||||
@TaskInput({
|
||||
title: 'DCDN加速域名',
|
||||
helper: '你在阿里云上配置的CDN加速域名,比如:certd.docmirror.cn',
|
||||
required: true,
|
||||
})
|
||||
domainName!: string;
|
||||
|
||||
@TaskInput({
|
||||
title: '证书名称',
|
||||
@@ -54,13 +54,37 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
|
||||
})
|
||||
certName!: string;
|
||||
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: 'DCDN加速域名',
|
||||
helper: '你在阿里云上配置的DCDN加速域名,比如:certd.docmirror.cn',
|
||||
action: DeployCertToAliyunDCDN.prototype.onGetDomainList.name,
|
||||
watches: ['certDomains', 'accessId'],
|
||||
required: true,
|
||||
})
|
||||
)
|
||||
domainName!: string | string[];
|
||||
|
||||
|
||||
async onInstance() {}
|
||||
async execute(): Promise<void> {
|
||||
this.logger.info('开始部署证书到阿里云DCDN');
|
||||
if(!this.domainName){
|
||||
throw new Error('您还未选择DCDN域名');
|
||||
}
|
||||
const access = (await this.getAccess(this.accessId)) as AliyunAccess;
|
||||
const client = await this.getClient(access);
|
||||
const params = await this.buildParams();
|
||||
await this.doRequest(client, params);
|
||||
if(typeof this.domainName === 'string'){
|
||||
this.domainName = [this.domainName];
|
||||
}
|
||||
for (const domainName of this.domainName ) {
|
||||
this.logger.info(`[${this.domainName}]开始部署`)
|
||||
const params = await this.buildParams(domainName);
|
||||
await this.doRequest(client, params);
|
||||
this.logger.info(`[${this.domainName}]部署成功`)
|
||||
}
|
||||
|
||||
this.logger.info('部署完成');
|
||||
}
|
||||
|
||||
@@ -75,14 +99,14 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
|
||||
return client;
|
||||
}
|
||||
|
||||
async buildParams() {
|
||||
async buildParams(domainName:string) {
|
||||
const CertName = (this.certName ?? 'certd') + '-' + dayjs().format('YYYYMMDDHHmmss');
|
||||
|
||||
if (typeof this.cert !== 'object') {
|
||||
const certId = this.cert;
|
||||
this.logger.info('使用已上传的证书:', certId);
|
||||
return {
|
||||
DomainName: this.domainName,
|
||||
DomainName: domainName,
|
||||
SSLProtocol: 'on',
|
||||
CertType: 'cas',
|
||||
CertName: CertName,
|
||||
@@ -93,7 +117,7 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
|
||||
this.logger.info('上传证书:', CertName);
|
||||
const cert: any = this.cert;
|
||||
return {
|
||||
DomainName: this.domainName,
|
||||
DomainName: domainName,
|
||||
SSLProtocol: 'on',
|
||||
CertName: CertName,
|
||||
CertType: 'upload',
|
||||
@@ -117,5 +141,40 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
|
||||
throw new Error('执行失败:' + ret.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async onGetDomainList(data: any) {
|
||||
if (!this.accessId) {
|
||||
throw new Error('请选择Access授权');
|
||||
}
|
||||
const access = await this.getAccess<AliyunAccess>(this.accessId);
|
||||
|
||||
const client = await this.getClient(access);
|
||||
|
||||
const params = {
|
||||
// 'DomainName': 'aaa',
|
||||
PageSize: 500,
|
||||
};
|
||||
|
||||
const requestOption = {
|
||||
method: 'POST',
|
||||
formatParams: false,
|
||||
};
|
||||
|
||||
const res = await client.request('DescribeDcdnUserDomains', params, requestOption);
|
||||
this.checkRet(res);
|
||||
const pageData = res?.Domains?.PageData;
|
||||
if (!pageData || pageData.length === 0) {
|
||||
throw new Error('找不到CDN域名,您可以手动输入');
|
||||
}
|
||||
const options = pageData.map((item: any) => {
|
||||
return {
|
||||
value: item.DomainName,
|
||||
label: item.DomainName,
|
||||
domain: item.DomainName,
|
||||
};
|
||||
});
|
||||
return optionsUtils.buildGroupOptions(options, this.certDomains);
|
||||
}
|
||||
}
|
||||
new DeployCertToAliyunDCDN();
|
||||
|
||||
195
packages/ui/certd-server/src/plugins/plugin-farcdn/access.ts
Normal file
195
packages/ui/certd-server/src/plugins/plugin-farcdn/access.ts
Normal file
@@ -0,0 +1,195 @@
|
||||
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
|
||||
import { HttpRequestConfig } from "@certd/basic";
|
||||
import { CertInfo, CertReader } from "@certd/plugin-cert";
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
@IsAccess({
|
||||
name: "farcdn",
|
||||
title: "farcdn授权",
|
||||
desc: "",
|
||||
icon: "svg:icon-lucky"
|
||||
})
|
||||
export class FarcdnAccess extends BaseAccess {
|
||||
@AccessInput({
|
||||
title: "接口地址",
|
||||
component: {
|
||||
placeholder: "https://open.farcdn.net/api/source",
|
||||
name: "a-input",
|
||||
vModel: "value"
|
||||
},
|
||||
required: true
|
||||
})
|
||||
endpoint!: string;
|
||||
|
||||
|
||||
@AccessInput({
|
||||
title: "accessKeyId",
|
||||
component: {
|
||||
placeholder: "accessKeyId",
|
||||
component: {
|
||||
name: "a-input",
|
||||
vModel: "value"
|
||||
}
|
||||
},
|
||||
encrypt: false,
|
||||
required: true
|
||||
})
|
||||
accessKeyId!: string;
|
||||
|
||||
@AccessInput({
|
||||
title: "accessKey",
|
||||
component: {
|
||||
placeholder: "accessKey",
|
||||
component: {
|
||||
name: "a-input",
|
||||
vModel: "value"
|
||||
}
|
||||
},
|
||||
encrypt: true,
|
||||
required: true
|
||||
})
|
||||
accessKey!: string;
|
||||
|
||||
|
||||
@AccessInput({
|
||||
title: "HttpProxy",
|
||||
component: {
|
||||
placeholder: "http://192.168.x.x:10811",
|
||||
component: {
|
||||
name: "a-input",
|
||||
vModel: "value"
|
||||
}
|
||||
},
|
||||
encrypt: false,
|
||||
required: true
|
||||
})
|
||||
httpProxy!: string;
|
||||
|
||||
|
||||
@AccessInput({
|
||||
title: "测试",
|
||||
component: {
|
||||
name: "api-test",
|
||||
action: "TestRequest"
|
||||
},
|
||||
helper: "点击测试接口是否正常"
|
||||
})
|
||||
testRequest = true;
|
||||
|
||||
async onTestRequest() {
|
||||
try{
|
||||
const data = await this.findSSLCertConfig(1);
|
||||
if (data) {
|
||||
return "ok";
|
||||
}
|
||||
}catch (e) {
|
||||
if(e.message.indexOf("11111111")>-1){
|
||||
return "ok";
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
throw "测试失败,未知错误";
|
||||
}
|
||||
|
||||
|
||||
async findSSLCertConfig(sslCertId: number) {
|
||||
/**
|
||||
* 接口地址
|
||||
* POST /findSSLCertConfig
|
||||
* 🎯 功能说明
|
||||
* 根据证书ID和认证信息查询SSL证书的详细配置信息,包括证书状态、域名绑定、有效期等关键信息。
|
||||
*
|
||||
* 📥 请求参数
|
||||
* 参数名 类型 必填 说明 示例值
|
||||
* sslCertId int ✅ 证书唯一标识ID 2106
|
||||
* accessKeyId string ✅ 访问密钥ID u2ZF6k63dFCOS7It
|
||||
* accessKey string ✅ 访问密钥 mTGaNRGUFHj3r3YxMrrg5XSGIXd6rBWG',
|
||||
* 响应结构:
|
||||
*
|
||||
* {
|
||||
* "code": 200,
|
||||
* "data": {...},
|
||||
* "message": "获取成功"
|
||||
* }
|
||||
*/
|
||||
|
||||
const params = {
|
||||
sslCertId,
|
||||
};
|
||||
const res= await this.doRequest({
|
||||
url: "/findSSLCertConfig",
|
||||
data: params
|
||||
});
|
||||
this.ctx.logger.info(`找到证书${sslCertId}: name=${res.name},domain=${res.commonNames},dnsNames=${res.dnsNames}`);
|
||||
return res
|
||||
}
|
||||
|
||||
async updateSSLCert(req:{
|
||||
sslCertId: number,
|
||||
cert:CertInfo,
|
||||
}){
|
||||
/**
|
||||
* isOn boolean ✅ 是否启用证书 true
|
||||
* name string ✅ 证书显示名称 "example.com"
|
||||
* description string ✅ 证书描述信息 "主域名SSL证书"
|
||||
* serverName string ✅ 关联的服务器名称 "web-server-01"
|
||||
* isCA boolean ✅ 是否为CA根证书 false
|
||||
* certData string ✅ 证书内容(PEM格式) "-----BEGIN CERTIFICATE-----..."
|
||||
* keyData string ✅ 私钥内容(PEM格式) "-----BEGIN PRIVATE KEY-----..."
|
||||
* timeBeginAt int/long ✅ 证书生效时间(毫秒时间戳) 1719830400000
|
||||
* timeEndAt int/long ✅ 证书过期时间(毫秒时间戳) 1751366400000
|
||||
* dnsNames string[] ✅ 证书绑定的域名列表 ["example.com", "*.example.com"]
|
||||
* commonNames string[] ✅ 证书的通用名称列表 ["example.com"]
|
||||
*/
|
||||
|
||||
const oldCert = await this.findSSLCertConfig(req.sslCertId)
|
||||
const certReader = new CertReader(req.cert)
|
||||
const {detail} = certReader.getCrtDetail();
|
||||
const params = {
|
||||
sslCertId: req.sslCertId,
|
||||
certData: req.cert.crt,
|
||||
keyData: req.cert.key,
|
||||
isOn: true,
|
||||
isCA: false,
|
||||
serverName: oldCert.serverName,
|
||||
commonNames: [certReader.getMainDomain()],
|
||||
dnsNames: certReader.getAltNames(),
|
||||
timeBeginAt: detail.notBefore,
|
||||
timeEndAt: detail.notAfter,
|
||||
name: oldCert.name|| certReader.buildCertName(),
|
||||
description:oldCert.description||""
|
||||
}
|
||||
|
||||
return await this.doRequest({
|
||||
url: "/updateSSLCert",
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
async doRequest(req:HttpRequestConfig){
|
||||
const params = {
|
||||
...req.data,
|
||||
accessKeyId: this.accessKeyId,
|
||||
accessKey: this.accessKey
|
||||
};
|
||||
const res = await this.ctx.http.request({
|
||||
url: req.url,
|
||||
baseURL:this.endpoint,
|
||||
method: "POST",
|
||||
data: params,
|
||||
httpProxy: this.httpProxy||undefined,
|
||||
});
|
||||
|
||||
if (res.code === "200") {
|
||||
return res.data;
|
||||
}
|
||||
throw new Error(res.message || res);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
new FarcdnAccess();
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from "./plugins/index.js";
|
||||
export * from "./access.js";
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./plugin-refresh-cert.js";
|
||||
@@ -0,0 +1,106 @@
|
||||
import { IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
|
||||
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
|
||||
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
|
||||
import { FarcdnAccess } from "../access.js";
|
||||
import { AbstractPlusTaskPlugin } from "@certd/plugin-plus";
|
||||
|
||||
@IsTaskPlugin({
|
||||
//命名规范,插件类型+功能(就是目录plugin-demo中的demo),大写字母开头,驼峰命名
|
||||
name: "FarcdnRefreshCert",
|
||||
title: "farcdn-更新证书",
|
||||
icon: "svg:icon-lucky",
|
||||
//插件分组
|
||||
group: pluginGroups.cdn.key,
|
||||
needPlus: true,
|
||||
default: {
|
||||
//默认值配置照抄即可
|
||||
strategy: {
|
||||
runStrategy: RunStrategy.SkipWhenSucceed
|
||||
}
|
||||
}
|
||||
})
|
||||
//类名规范,跟上面插件名称(name)一致
|
||||
export class FarcdnRefreshCert extends AbstractPlusTaskPlugin {
|
||||
//证书选择,此项必须要有
|
||||
@TaskInput({
|
||||
title: "域名证书",
|
||||
helper: "请选择前置任务输出的域名证书",
|
||||
component: {
|
||||
name: "output-selector",
|
||||
from: [...CertApplyPluginNames]
|
||||
}
|
||||
// required: true, // 必填
|
||||
})
|
||||
cert!: CertInfo;
|
||||
|
||||
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
|
||||
certDomains!: string[];
|
||||
|
||||
//授权选择框
|
||||
@TaskInput({
|
||||
title: "Farcdn授权",
|
||||
component: {
|
||||
name: "access-selector",
|
||||
type: "farcdn" //固定授权类型
|
||||
},
|
||||
required: true //必填
|
||||
})
|
||||
accessId!: string;
|
||||
//
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: "证书Id",
|
||||
helper: "要更新的Farcdn证书id",
|
||||
action: FarcdnRefreshCert.prototype.onGetCertList.name
|
||||
})
|
||||
)
|
||||
certList!: number[];
|
||||
|
||||
//插件实例化时执行的方法
|
||||
async onInstance() {
|
||||
}
|
||||
|
||||
//插件执行方法
|
||||
async execute(): Promise<void> {
|
||||
const access = await this.getAccess<FarcdnAccess>(this.accessId);
|
||||
|
||||
for (const item of this.certList) {
|
||||
this.logger.info(`----------- 开始更新证书:${item}`);
|
||||
await access.updateSSLCert({
|
||||
sslCertId:item,
|
||||
cert: this.cert,
|
||||
})
|
||||
this.logger.info(`----------- 更新证书${item}成功`);
|
||||
}
|
||||
|
||||
this.logger.info("部署完成");
|
||||
}
|
||||
|
||||
async onGetCertList() {
|
||||
throw new Error("暂无查询证书列表接口,您需要手动输入证书id");
|
||||
// const access = await this.getAccess<FarcdnAccess>(this.accessId);
|
||||
|
||||
// const res = await access.doRequest({
|
||||
// url: "/SSLCertService/listSSLCerts",
|
||||
// data: { size: 1000 },
|
||||
// method: "POST"
|
||||
// });
|
||||
// const list = JSON.parse(this.ctx.utils.hash.base64Decode(res.sslCertsJSON));
|
||||
// if (!list || list.length === 0) {
|
||||
// throw new Error("没有找到证书,请先在控制台上传一次证书且关联网站");
|
||||
// }
|
||||
//
|
||||
// const options = list.map((item: any) => {
|
||||
// return {
|
||||
// label: `${item.name}<${item.id}-${item.dnsNames[0]}>`,
|
||||
// value: item.id,
|
||||
// domain: item.dnsNames
|
||||
// };
|
||||
// });
|
||||
// return this.ctx.utils.options.buildGroupOptions(options, this.certDomains);
|
||||
}
|
||||
}
|
||||
|
||||
//实例化一下,注册插件
|
||||
new FarcdnRefreshCert();
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
|
||||
import { CertInfo } from '@certd/plugin-cert';
|
||||
import { createRemoteSelectInputDefine } from '@certd/plugin-lib';
|
||||
import { CertInfo ,CertReader} from '@certd/plugin-cert';
|
||||
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
|
||||
import { TencentAccess, TencentSslClient } from '@certd/plugin-lib';
|
||||
import { CertApplyPluginNames} from '@certd/plugin-cert';
|
||||
@IsTaskPlugin({
|
||||
@@ -16,26 +16,6 @@ import { CertApplyPluginNames} from '@certd/plugin-cert';
|
||||
},
|
||||
})
|
||||
export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
|
||||
@TaskInput({
|
||||
title: 'Access提供者',
|
||||
helper: 'access 授权',
|
||||
component: {
|
||||
name: 'access-selector',
|
||||
type: 'tencent',
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
accessId!: string;
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: 'CDN域名',
|
||||
helper: '请选择域名或输入域名',
|
||||
typeName: 'TencentDeployCertToCDNv2',
|
||||
action: TencentDeployCertToCDNv2.prototype.onGetDomainList.name,
|
||||
})
|
||||
)
|
||||
domains!: string | string[];
|
||||
|
||||
@TaskInput({
|
||||
title: '域名证书',
|
||||
@@ -48,8 +28,35 @@ export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
|
||||
})
|
||||
cert!: CertInfo | string;
|
||||
|
||||
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
|
||||
certDomains!: string[];
|
||||
|
||||
@TaskInput({
|
||||
title: 'Access提供者',
|
||||
helper: 'access 授权',
|
||||
component: {
|
||||
name: 'access-selector',
|
||||
type: 'tencent',
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
accessId!: string;
|
||||
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: 'CDN域名',
|
||||
helper: '请选择域名或输入域名',
|
||||
typeName: 'TencentDeployCertToCDNv2',
|
||||
action: TencentDeployCertToCDNv2.prototype.onGetDomainList.name,
|
||||
})
|
||||
)
|
||||
domains!: string | string[];
|
||||
|
||||
|
||||
async onInstance() {}
|
||||
|
||||
|
||||
async execute(): Promise<void> {
|
||||
const access = await this.getAccess<TencentAccess>(this.accessId);
|
||||
const sslClient = new TencentSslClient({
|
||||
@@ -59,8 +66,9 @@ export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
|
||||
|
||||
let tencentCertId = this.cert as string;
|
||||
if (typeof this.cert !== 'string') {
|
||||
const certReader = new CertReader(this.cert);
|
||||
tencentCertId = await sslClient.uploadToTencent({
|
||||
certName: this.appendTimeSuffix('certd'),
|
||||
certName: certReader.buildCertName(),
|
||||
cert: this.cert,
|
||||
});
|
||||
}
|
||||
@@ -108,11 +116,13 @@ export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
|
||||
Limit: 1000,
|
||||
});
|
||||
this.checkRet(res);
|
||||
return res.Domains.map((item: any) => {
|
||||
const options = res.Domains.map((item: any) => {
|
||||
return {
|
||||
label: item.Domain,
|
||||
value: item.Domain,
|
||||
domain: item.Domain
|
||||
};
|
||||
});
|
||||
return this.ctx.utils.options.buildGroupOptions(options, this.certDomains);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user