diff --git a/CHANGELOG.md b/CHANGELOG.md index 646b5926..2d436ff6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/build.trigger b/build.trigger index 973150e9..179d3280 100644 --- a/build.trigger +++ b/build.trigger @@ -1 +1 @@ -01:40 +23:45 diff --git a/docker/run/docker-compose.yaml b/docker/run/docker-compose.yaml index 2192012d..12e99ec7 100644 --- a/docker/run/docker-compose.yaml +++ b/docker/run/docker-compose.yaml @@ -16,7 +16,7 @@ services: - "7001:7001" # ↓↓↓↓ ---------------------------------------------------------- https端口,可以根据实际情况,是否暴露该端口 - "7002:7002" - #↓↓↓↓ -------------------------------------------------------------- 如果出现getaddrinfo ENOTFOUND错误,可以尝试设置dns + #↓↓↓↓ -------------------------------------------------------------- 如果出现getaddrinfo EAI_AGAIN 或 getaddrinfo ENOTFOUND 错误,可以尝试设置dns # dns: # - 223.5.5.5 # 阿里云公共dns # - 223.6.6.6 diff --git a/docs/guide/changelogs/CHANGELOG.md b/docs/guide/changelogs/CHANGELOG.md index 646b5926..2d436ff6 100644 --- a/docs/guide/changelogs/CHANGELOG.md +++ b/docs/guide/changelogs/CHANGELOG.md @@ -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 diff --git a/docs/guide/qa/index.md b/docs/guide/qa/index.md index adab1b3e..7171795b 100644 --- a/docs/guide/qa/index.md +++ b/docs/guide/qa/index.md @@ -1,12 +1,12 @@ # 常见报错解决 ## 1. getaddrinfo ENOTFOUND错误 -如果出现`getaddrinfo ENOTFOUND`错误,可以尝试在`docker-compose.yaml`中设置dns +如果出现`getaddrinfo ENOTFOUND`/`getaddrinfo EAI_AGAIN`错误,可以尝试在`docker-compose.yaml`中设置dns ```yaml version: '3.3' # 兼容旧版docker-compose services: certd: - #↓↓↓↓ ------------ # 如果出现getaddrinfo ENOTFOUND错误,可以尝试设置dns + #↓↓↓↓ ------------ # 如果出现getaddrinfo ENOTFOUND 或 EAI_AGAIN错误,可以尝试设置dns dns: - 223.5.5.5 # 阿里云公共dns - 223.6.6.6 diff --git a/lerna.json b/lerna.json index c700a1f6..8c473b52 100644 --- a/lerna.json +++ b/lerna.json @@ -9,5 +9,5 @@ } }, "npmClient": "pnpm", - "version": "1.34.5" + "version": "1.34.6" } diff --git a/packages/core/acme-client/CHANGELOG.md b/packages/core/acme-client/CHANGELOG.md index 99dcc431..7b321daf 100644 --- a/packages/core/acme-client/CHANGELOG.md +++ b/packages/core/acme-client/CHANGELOG.md @@ -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.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 + ## [1.34.5](https://github.com/publishlab/node-acme-client/compare/v1.34.4...v1.34.5) (2025-05-19) **Note:** Version bump only for package @certd/acme-client diff --git a/packages/core/acme-client/package.json b/packages/core/acme-client/package.json index cc8f9841..7e5523b0 100644 --- a/packages/core/acme-client/package.json +++ b/packages/core/acme-client/package.json @@ -3,7 +3,7 @@ "description": "Simple and unopinionated ACME client", "private": false, "author": "nmorsman", - "version": "1.34.5", + "version": "1.34.6", "type": "module", "module": "scr/index.js", "main": "src/index.js", @@ -18,7 +18,7 @@ "types" ], "dependencies": { - "@certd/basic": "^1.34.5", + "@certd/basic": "^1.34.6", "@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" } diff --git a/packages/core/basic/CHANGELOG.md b/packages/core/basic/CHANGELOG.md index 30798957..c107b119 100644 --- a/packages/core/basic/CHANGELOG.md +++ b/packages/core/basic/CHANGELOG.md @@ -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.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.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19) ### Performance Improvements diff --git a/packages/core/basic/build.md b/packages/core/basic/build.md index c2f5faaf..9da31454 100644 --- a/packages/core/basic/build.md +++ b/packages/core/basic/build.md @@ -1 +1 @@ -01:35 +23:42 diff --git a/packages/core/basic/package.json b/packages/core/basic/package.json index e891303c..2178bdab 100644 --- a/packages/core/basic/package.json +++ b/packages/core/basic/package.json @@ -1,7 +1,7 @@ { "name": "@certd/basic", "private": false, - "version": "1.34.5", + "version": "1.34.6", "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" } diff --git a/packages/core/pipeline/CHANGELOG.md b/packages/core/pipeline/CHANGELOG.md index bbe59390..4eef657b 100644 --- a/packages/core/pipeline/CHANGELOG.md +++ b/packages/core/pipeline/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.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)) +* 优化 RunnableError错误信息展示 ([36bc3ff](https://github.com/certd/certd/commit/36bc3ff22da93ba342c3c1103d7ee2bbcecf44f2)) + +### Performance Improvements + +* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26)) + ## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19) ### Performance Improvements diff --git a/packages/core/pipeline/package.json b/packages/core/pipeline/package.json index d5ee3f4a..49a60c9f 100644 --- a/packages/core/pipeline/package.json +++ b/packages/core/pipeline/package.json @@ -1,7 +1,7 @@ { "name": "@certd/pipeline", "private": false, - "version": "1.34.5", + "version": "1.34.6", "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", @@ -17,8 +17,8 @@ "pub": "npm publish" }, "dependencies": { - "@certd/basic": "^1.34.5", - "@certd/plus-core": "^1.34.5", + "@certd/basic": "^1.34.6", + "@certd/plus-core": "^1.34.6", "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" } diff --git a/packages/core/pipeline/src/core/executor.ts b/packages/core/pipeline/src/core/executor.ts index dd6d23d2..7c01dd48 100644 --- a/packages/core/pipeline/src/core/executor.ts +++ b/packages/core/pipeline/src/core/executor.ts @@ -295,6 +295,12 @@ export class Executor { const pluginConfig = await this.options.pluginConfigService.getPluginConfig(pluginName); //从outputContext读取输入参数 const input = cloneDeep(step.input); + const sysInput = pluginConfig.sysSetting?.input || {}; + //注入系统设置参数 + for (const sysInputKey in sysInput) { + input[sysInputKey] = sysInput[sysInputKey]; + } + Decorator.inject(define.input, instance, input, (item, key) => { if (item.component?.name === "output-selector") { const contextKey = input[key]; @@ -314,12 +320,6 @@ export class Executor { } }); - const sysInput = pluginConfig.sysSetting?.input || {}; - //注入系统设置参数 - for (const sysInputKey in sysInput) { - input[sysInputKey] = sysInput[sysInputKey]; - } - const newInputHash = hashUtils.md5(JSON.stringify(input)); step.status!.inputHash = newInputHash; //判断是否需要跳过 @@ -438,7 +438,7 @@ export class Executor { const runnableError = error as RunnableError; content = `流水线ID:${this.pipeline.id},运行ID:${this.runtime.id}\n\n`; for (const re of runnableError.errors) { - content += ` - ${re.runnable.title} 执行失败,错误详情:${re.e?.error?.message}\n\n`; + content += ` - ${re.runnable.title} 执行失败,错误详情:${re.e?.message || re.e?.error?.message}\n\n`; } } else { content = `流水线ID:${this.pipeline.id},运行ID:${this.runtime.id}\n\n${this.currentStatusMap?.currentStep?.title} 执行失败\n\n错误详情:${error.message}`; diff --git a/packages/core/pipeline/src/plugin/api.ts b/packages/core/pipeline/src/plugin/api.ts index ba3dfc89..f6184dd9 100644 --- a/packages/core/pipeline/src/plugin/api.ts +++ b/packages/core/pipeline/src/plugin/api.ts @@ -227,6 +227,14 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin { return name + "_" + dayjs().format("YYYYMMDDHHmmssSSS"); } + buildCertName(domain: string) { + if (domain.includes("*")) { + domain = domain.replaceAll("*", "_"); + } + return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`; + } + + async onRequest(req: PluginRequestHandleReq) { if (!req.action) { throw new Error("action is required"); diff --git a/packages/libs/lib-huawei/CHANGELOG.md b/packages/libs/lib-huawei/CHANGELOG.md index 5653208b..9a7a832a 100644 --- a/packages/libs/lib-huawei/CHANGELOG.md +++ b/packages/libs/lib-huawei/CHANGELOG.md @@ -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.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.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19) **Note:** Version bump only for package @certd/lib-huawei diff --git a/packages/libs/lib-huawei/package.json b/packages/libs/lib-huawei/package.json index ca44a90c..713efba1 100644 --- a/packages/libs/lib-huawei/package.json +++ b/packages/libs/lib-huawei/package.json @@ -1,7 +1,7 @@ { "name": "@certd/lib-huawei", "private": false, - "version": "1.34.5", + "version": "1.34.6", "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" } diff --git a/packages/libs/lib-iframe/CHANGELOG.md b/packages/libs/lib-iframe/CHANGELOG.md index f3c9bf9f..0a58deb1 100644 --- a/packages/libs/lib-iframe/CHANGELOG.md +++ b/packages/libs/lib-iframe/CHANGELOG.md @@ -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.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.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19) **Note:** Version bump only for package @certd/lib-iframe diff --git a/packages/libs/lib-iframe/package.json b/packages/libs/lib-iframe/package.json index 62e0f030..0445d334 100644 --- a/packages/libs/lib-iframe/package.json +++ b/packages/libs/lib-iframe/package.json @@ -1,7 +1,7 @@ { "name": "@certd/lib-iframe", "private": false, - "version": "1.34.5", + "version": "1.34.6", "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" } diff --git a/packages/libs/lib-jdcloud/CHANGELOG.md b/packages/libs/lib-jdcloud/CHANGELOG.md index 09feb8ed..75d02d26 100644 --- a/packages/libs/lib-jdcloud/CHANGELOG.md +++ b/packages/libs/lib-jdcloud/CHANGELOG.md @@ -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.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.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19) **Note:** Version bump only for package @certd/jdcloud diff --git a/packages/libs/lib-jdcloud/package.json b/packages/libs/lib-jdcloud/package.json index 05266ee0..0a3f9dfb 100644 --- a/packages/libs/lib-jdcloud/package.json +++ b/packages/libs/lib-jdcloud/package.json @@ -1,6 +1,6 @@ { "name": "@certd/jdcloud", - "version": "1.34.5", + "version": "1.34.6", "description": "jdcloud openApi sdk", "main": "./dist/bundle.js", "module": "./dist/bundle.js", @@ -61,5 +61,5 @@ "fetch" ] }, - "gitHead": "d23792fda2a185e8ba038434460792f738878a42" + "gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663" } diff --git a/packages/libs/lib-k8s/CHANGELOG.md b/packages/libs/lib-k8s/CHANGELOG.md index 0b3b630f..2f1acbe2 100644 --- a/packages/libs/lib-k8s/CHANGELOG.md +++ b/packages/libs/lib-k8s/CHANGELOG.md @@ -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.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.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19) **Note:** Version bump only for package @certd/lib-k8s diff --git a/packages/libs/lib-k8s/package.json b/packages/libs/lib-k8s/package.json index 8b237b80..49ac93e8 100644 --- a/packages/libs/lib-k8s/package.json +++ b/packages/libs/lib-k8s/package.json @@ -1,7 +1,7 @@ { "name": "@certd/lib-k8s", "private": false, - "version": "1.34.5", + "version": "1.34.6", "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", @@ -17,7 +17,7 @@ "pub": "npm publish" }, "dependencies": { - "@certd/basic": "^1.34.5", + "@certd/basic": "^1.34.6", "@kubernetes/client-node": "0.21.0" }, "devDependencies": { @@ -32,5 +32,5 @@ "tslib": "^2.8.1", "typescript": "^5.4.2" }, - "gitHead": "d23792fda2a185e8ba038434460792f738878a42" + "gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663" } diff --git a/packages/libs/lib-server/CHANGELOG.md b/packages/libs/lib-server/CHANGELOG.md index d3a820e0..fe45520b 100644 --- a/packages/libs/lib-server/CHANGELOG.md +++ b/packages/libs/lib-server/CHANGELOG.md @@ -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.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25) + +### Performance Improvements + +* 站点证书监控增加通知设置 ([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) **Note:** Version bump only for package @certd/lib-server diff --git a/packages/libs/lib-server/package.json b/packages/libs/lib-server/package.json index 85ca3d35..52419018 100644 --- a/packages/libs/lib-server/package.json +++ b/packages/libs/lib-server/package.json @@ -1,6 +1,6 @@ { "name": "@certd/lib-server", - "version": "1.34.5", + "version": "1.34.6", "description": "midway with flyway, sql upgrade way ", "private": false, "type": "module", @@ -27,10 +27,10 @@ ], "license": "AGPL", "dependencies": { - "@certd/acme-client": "^1.34.5", - "@certd/basic": "^1.34.5", - "@certd/pipeline": "^1.34.5", - "@certd/plus-core": "^1.34.5", + "@certd/acme-client": "^1.34.6", + "@certd/basic": "^1.34.6", + "@certd/pipeline": "^1.34.6", + "@certd/plus-core": "^1.34.6", "@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" } diff --git a/packages/libs/lib-server/src/system/settings/service/models.ts b/packages/libs/lib-server/src/system/settings/service/models.ts index 1da84c35..e16ff77b 100644 --- a/packages/libs/lib-server/src/system/settings/service/models.ts +++ b/packages/libs/lib-server/src/system/settings/service/models.ts @@ -204,3 +204,5 @@ export class SysSafeSetting extends BaseSettings { autoHiddenTimes: 5, }; } + + diff --git a/packages/libs/midway-flyway-js/CHANGELOG.md b/packages/libs/midway-flyway-js/CHANGELOG.md index 3b2a8293..d93e8a18 100644 --- a/packages/libs/midway-flyway-js/CHANGELOG.md +++ b/packages/libs/midway-flyway-js/CHANGELOG.md @@ -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.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.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19) **Note:** Version bump only for package @certd/midway-flyway-js diff --git a/packages/libs/midway-flyway-js/package.json b/packages/libs/midway-flyway-js/package.json index d865bfed..0fc2eb2b 100644 --- a/packages/libs/midway-flyway-js/package.json +++ b/packages/libs/midway-flyway-js/package.json @@ -1,6 +1,6 @@ { "name": "@certd/midway-flyway-js", - "version": "1.34.5", + "version": "1.34.6", "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" } diff --git a/packages/plugins/plugin-cert/CHANGELOG.md b/packages/plugins/plugin-cert/CHANGELOG.md index 8bf66a30..4193c887 100644 --- a/packages/plugins/plugin-cert/CHANGELOG.md +++ b/packages/plugins/plugin-cert/CHANGELOG.md @@ -3,6 +3,18 @@ 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)) +* 修复lego模式下每次都重新申请证书的bug ([f807b8c](https://github.com/certd/certd/commit/f807b8cb465cc329fa034ecbef94e18ef394f870)) +* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c)) + +### Performance Improvements + +* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26)) + ## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19) **Note:** Version bump only for package @certd/plugin-cert diff --git a/packages/plugins/plugin-cert/package.json b/packages/plugins/plugin-cert/package.json index 31b6e8f4..c678eca6 100644 --- a/packages/plugins/plugin-cert/package.json +++ b/packages/plugins/plugin-cert/package.json @@ -1,7 +1,7 @@ { "name": "@certd/plugin-cert", "private": false, - "version": "1.34.5", + "version": "1.34.6", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -16,10 +16,10 @@ "pub": "npm publish" }, "dependencies": { - "@certd/acme-client": "^1.34.5", - "@certd/basic": "^1.34.5", - "@certd/pipeline": "^1.34.5", - "@certd/plugin-lib": "^1.34.5", + "@certd/acme-client": "^1.34.6", + "@certd/basic": "^1.34.6", + "@certd/pipeline": "^1.34.6", + "@certd/plugin-lib": "^1.34.6", "@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" } diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/base.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/base.ts index 46bf9efb..6692b6ad 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/base.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/base.ts @@ -81,6 +81,10 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin { } } + getCheckChangeInputKeys() { + //插件哪些字段参与校验是否需要更新 + return ["domains", "sslProvider", "privateKeyType", "dnsProviderType", "pfxPassword"]; + } /** * 是否更新证书 */ @@ -91,7 +95,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin { // return null; // } - const checkInputChanges = ["domains", "sslProvider", "privateKeyType", "dnsProviderType", "pfxPassword"]; + const checkInputChanges = this.getCheckChangeInputKeys(); const oldInput = JSON.stringify(pick(this.lastStatus?.input, checkInputChanges)); const thisInput = JSON.stringify(pick(this, checkInputChanges)); const inputChanged = oldInput !== thisInput; @@ -145,7 +149,8 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin { throw new Error("过期时间不能为空"); } // 检查有效期 - const leftDays = dayjs(expires).diff(dayjs(), "day"); + const leftDays = Math.floor((expires - dayjs().valueOf()) / (1000 * 60 * 60 * 24)); + this.logger.info(`证书剩余天数:${leftDays}`); return { isWillExpire: leftDays <= maxDays, leftDays, diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/cert-reader.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/cert-reader.ts index 08df4d9d..1c331d8b 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/cert-reader.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/cert-reader.ts @@ -93,6 +93,16 @@ export class CertReader { return domains; } + static getMainDomain(crt: string) { + const { detail } = CertReader.readCertDetail(crt); + return detail.domains.commonName; + } + + getMainDomain() { + const { detail } = this.getCrtDetail(); + return detail.domains.commonName; + } + saveToFile(type: "crt" | "key" | "pfx" | "der" | "oc" | "one" | "ic" | "jks", filepath?: string) { if (!this.cert[type]) { return; diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/index.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/index.ts index 39a1e552..6f6a58c4 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/index.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/index.ts @@ -320,7 +320,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin { this.logger.info("当前正在使用 google EAB授权"); eab = await this.getAccess(this.eabAccessId); } else if (this.googleCommonEabAccessId) { - this.logger.info("当前正在使用 google公共EAB授权"); + this.logger.info("当前正在使用 google 公共EAB授权"); eab = await this.getAccess(this.googleCommonEabAccessId, true); } else { throw new Error("google需要配置EAB授权或服务账号授权"); diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/lego/index.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/lego/index.ts index 28f33ebb..9a4d760d 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/lego/index.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/lego/index.ts @@ -112,9 +112,12 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin { }) privateKeyType!: PrivateKeyType; - eab?: EabAccess; + getCheckChangeInputKeys() { + return ["domains", "privateKeyType", "dnsType"]; + } + async onInstance() { this.accessService = this.ctx.accessService; this.logger = this.ctx.logger; diff --git a/packages/plugins/plugin-cert/test/cert-plugin.test.mjs b/packages/plugins/plugin-cert/test/cert-plugin.test.mjs new file mode 100644 index 00000000..7af120ee --- /dev/null +++ b/packages/plugins/plugin-cert/test/cert-plugin.test.mjs @@ -0,0 +1,27 @@ +import { expect } from "chai"; +import { CertApplyPlugin } from "../dist/index.js"; +import dayjs from "dayjs"; +import { logger } from "@certd/basic"; + +describe("test/cert-plugin.ts", () => { + const certApplyPlugin = new CertApplyPlugin(); + certApplyPlugin.logger = logger; + it("should throw error when expires is null or undefined", () => { + expect(() => { + // @ts-ignore + certApplyPlugin.isWillExpire(undefined); + }).throw("过期时间不能为空"); + + expect(() => { + // @ts-ignore + certApplyPlugin.isWillExpire(null); + }).throw("过期时间不能为空"); + }); + + it("isWillExpire", () => { + const now = dayjs().add(36, "day") - 10000; + const res = certApplyPlugin.isWillExpire(now.valueOf(), 35); + console.log(res); + expect(res.isWillExpire).eq(true); + }); +}); diff --git a/packages/plugins/plugin-lib/CHANGELOG.md b/packages/plugins/plugin-lib/CHANGELOG.md index dd39cfb3..b996d52b 100644 --- a/packages/plugins/plugin-lib/CHANGELOG.md +++ b/packages/plugins/plugin-lib/CHANGELOG.md @@ -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.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25) + +### Performance Improvements + +* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26)) + ## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19) ### Performance Improvements diff --git a/packages/plugins/plugin-lib/package.json b/packages/plugins/plugin-lib/package.json index 40fcd1b0..6efe4881 100644 --- a/packages/plugins/plugin-lib/package.json +++ b/packages/plugins/plugin-lib/package.json @@ -1,7 +1,7 @@ { "name": "@certd/plugin-lib", "private": false, - "version": "1.34.5", + "version": "1.34.6", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -16,10 +16,12 @@ "pub": "npm publish" }, "dependencies": { + "@alicloud/openapi-client": "^0.4.14", "@alicloud/pop-core": "^1.7.10", + "@alicloud/tea-util": "^1.4.10", "@aws-sdk/client-s3": "^3.787.0", - "@certd/basic": "^1.34.5", - "@certd/pipeline": "^1.34.5", + "@certd/basic": "^1.34.6", + "@certd/pipeline": "^1.34.6", "@kubernetes/client-node": "0.21.0", "ali-oss": "^6.22.0", "basic-ftp": "^5.0.5", @@ -50,5 +52,5 @@ "tslib": "^2.8.1", "typescript": "^5.4.2" }, - "gitHead": "d23792fda2a185e8ba038434460792f738878a42" + "gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663" } diff --git a/packages/plugins/plugin-lib/src/aliyun/access/aliyun-access.ts b/packages/plugins/plugin-lib/src/aliyun/access/aliyun-access.ts index 5d05a3d6..6a20ab92 100644 --- a/packages/plugins/plugin-lib/src/aliyun/access/aliyun-access.ts +++ b/packages/plugins/plugin-lib/src/aliyun/access/aliyun-access.ts @@ -1,4 +1,88 @@ import { IsAccess, AccessInput, BaseAccess } from "@certd/pipeline"; +import { ILogger } from "@certd/basic"; + +export type AliyunClientV2Req = { + action: string; + version: string; + protocol?: "HTTPS"; + // 接口 HTTP 方法 + method?: "GET" | "POST"; + authType?: "AK"; + style?: "RPC"; + // 接口 PATH + pathname?: `/`; + + data?: any; + query?: any; +}; +export class AliyunClientV2 { + access: AliyunAccess; + logger: ILogger; + endpoint: string; + + client: any; + constructor(opts: { access: AliyunAccess; logger: ILogger; endpoint: string }) { + this.access = opts.access; + this.logger = opts.logger; + this.endpoint = opts.endpoint; + } + + async getClient() { + if (this.client) { + return this.client; + } + const $OpenApi = await import("@alicloud/openapi-client"); + const config = new $OpenApi.Config({ + accessKeyId: this.access.accessKeyId, + accessKeySecret: this.access.accessKeySecret, + }); + // Endpoint 请参考 https://api.aliyun.com/product/FC + // config.endpoint = `esa.${this.regionId}.aliyuncs.com`; + config.endpoint = this.endpoint; + //@ts-ignore + this.client = new $OpenApi.default.default(config); + return this.client; + } + + async doRequest(req: AliyunClientV2Req) { + const client = await this.getClient(); + + const $OpenApi = await import("@alicloud/openapi-client"); + const $Util = await import("@alicloud/tea-util"); + + const params = new $OpenApi.Params({ + // 接口名称 + action: req.action, + // 接口版本 + version: req.version, + // 接口协议 + protocol: "HTTPS", + // 接口 HTTP 方法 + method: req.method ?? "POST", + authType: "AK", + style: "RPC", + // 接口 PATH + pathname: `/`, + // 接口请求体内容格式 + reqBodyType: "json", + // 接口响应体内容格式 + bodyType: "json", + }); + + const runtime = new $Util.RuntimeOptions({}); + const request = new $OpenApi.OpenApiRequest({ + body: req.data, + query: req.query, + }); + // 复制代码运行请自行打印 API 的返回值 + // 返回值实际为 Map 类型,可从 Map 中获得三类数据:响应体 body、响应头 headers、HTTP 返回的状态码 statusCode。 + const res = await client.callApi(params, request, runtime); + /** + * res?.body?. + */ + return res?.body; + } +} @IsAccess({ name: "aliyun", @@ -27,6 +111,14 @@ export class AliyunAccess extends BaseAccess { helper: "注意:证书申请需要dns解析权限;其他阿里云插件,需要对应的权限,比如证书上传需要证书管理权限;嫌麻烦就用主账号的全量权限的accessKey", }) accessKeySecret = ""; + + getClient(endpoint: string) { + return new AliyunClientV2({ + access: this, + logger: this.ctx.logger, + endpoint: endpoint, + }); + } } new AliyunAccess(); diff --git a/packages/ui/certd-client/CHANGELOG.md b/packages/ui/certd-client/CHANGELOG.md index 5583149e..45877613 100644 --- a/packages/ui/certd-client/CHANGELOG.md +++ b/packages/ui/certd-client/CHANGELOG.md @@ -3,6 +3,18 @@ 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 + +* 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug ([7984b62](https://github.com/certd/certd/commit/7984b625ba6727132f205db8e25f790bce27b2f7)) +* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c)) + +### Performance Improvements + +* 二次认证页面中,添加动态验证码输入框的焦点控制,提升用户体验 ([bb22f06](https://github.com/certd/certd/commit/bb22f062ed4ab4b5b71938270fe4cc666af6b8e7)) +* 站点证书监控增加通知设置 ([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 diff --git a/packages/ui/certd-client/package.json b/packages/ui/certd-client/package.json index 54f635e1..3ca731cf 100644 --- a/packages/ui/certd-client/package.json +++ b/packages/ui/certd-client/package.json @@ -1,6 +1,6 @@ { "name": "@certd/ui-client", - "version": "1.34.5", + "version": "1.34.6", "private": true, "scripts": { "dev": "vite --open", @@ -102,8 +102,8 @@ "zod-defaults": "^0.1.3" }, "devDependencies": { - "@certd/lib-iframe": "^1.34.5", - "@certd/pipeline": "^1.34.5", + "@certd/lib-iframe": "^1.34.6", + "@certd/pipeline": "^1.34.6", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", "@types/chai": "^4.3.12", diff --git a/packages/ui/certd-client/src/layout/layout-basic.vue b/packages/ui/certd-client/src/layout/layout-basic.vue index 0a549702..c38fd64d 100644 --- a/packages/ui/certd-client/src/layout/layout-basic.vue +++ b/packages/ui/certd-client/src/layout/layout-basic.vue @@ -21,6 +21,13 @@ const menus = computed(() => [ icon: "fa-solid:book", text: "账号信息", }, + { + handler: () => { + router.push("/certd/mine/security"); + }, + icon: "fluent:shield-keyhole-16-regular", + text: "认证安全设置", + }, ]); const avatar = computed(() => { diff --git a/packages/ui/certd-client/src/router/source/modules/certd.ts b/packages/ui/certd-client/src/router/source/modules/certd.ts index a9c992be..15d42512 100644 --- a/packages/ui/certd-client/src/router/source/modules/certd.ts +++ b/packages/ui/certd-client/src/router/source/modules/certd.ts @@ -143,6 +143,17 @@ export const certdResources = [ keepAlive: true, }, }, + { + title: "站点监控设置", + name: "SiteMonitorSetting", + path: "/certd/monitor/setting", + component: "/certd/monitor/site/setting/index.vue", + meta: { + icon: "ion:videocam-outline", + auth: true, + isMenu: true, + }, + }, { title: "认证安全设置", name: "UserSecurity", diff --git a/packages/ui/certd-client/src/style/antdv4.less b/packages/ui/certd-client/src/style/antdv4.less index 40c79d3b..227c9096 100644 --- a/packages/ui/certd-client/src/style/antdv4.less +++ b/packages/ui/certd-client/src/style/antdv4.less @@ -65,4 +65,10 @@ footer{ .ant-select-multiple .ant-select-selection-item-remove{ display: flex; align-items: center; +} + + +.ant-progress.ant-progress-show-info .ant-progress-outer { + margin-inline-end: calc(-3em - 8px); + padding-inline-end: calc(3em + 8px); } \ No newline at end of file diff --git a/packages/ui/certd-client/src/views/certd/access/crud.tsx b/packages/ui/certd-client/src/views/certd/access/crud.tsx index 77c34caf..ff6ad138 100644 --- a/packages/ui/certd-client/src/views/certd/access/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/access/crud.tsx @@ -35,10 +35,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat pageRequest, addRequest, editRequest, - delRequest + delRequest, + }, + table: { + remove: { + confirmMessage: "授权如果已经被使用,可能会导致流水线无法正常运行,请谨慎操作", + }, }, rowHandle: { - width: 200 + width: 200, }, columns: { id: { @@ -46,24 +51,24 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat key: "id", type: "number", column: { - width: 100 + width: 100, }, form: { - show: false - } + show: false, + }, }, name: { title: "名称", type: "text", search: { - show: true + show: true, }, form: { - rules: [{ required: true, message: "必填项" }] + rules: [{ required: true, message: "必填项" }], }, column: { - width: 300 - } + width: 300, + }, }, from: { title: "级别", @@ -71,29 +76,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat dict: dict({ data: [ { label: "系统", value: "sys" }, - { label: "用户", value: "user" } - ] + { label: "用户", value: "user" }, + ], }), search: { - show: false + show: false, }, form: { - show: false + show: false, }, column: { width: 100, align: "center", component: { - color: "auto" + color: "auto", }, - order: 10 + order: 10, }, valueBuilder: ({ row, key, value }) => { row[key] = row.userId > 0 ? "user" : "sys"; - } + }, }, - ...commonColumnsDefine - } - } + ...commonColumnsDefine, + }, + }, }; } diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/api.ts b/packages/ui/certd-client/src/views/certd/monitor/site/api.ts index d8ae199e..f5e7a64f 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/site/api.ts +++ b/packages/ui/certd-client/src/views/certd/monitor/site/api.ts @@ -7,7 +7,7 @@ export const siteInfoApi = { return await request({ url: apiPrefix + "/page", method: "post", - data: query + data: query, }); }, @@ -15,7 +15,7 @@ export const siteInfoApi = { return await request({ url: apiPrefix + "/add", method: "post", - data: obj + data: obj, }); }, @@ -23,7 +23,7 @@ export const siteInfoApi = { return await request({ url: apiPrefix + "/update", method: "post", - data: obj + data: obj, }); }, @@ -31,7 +31,7 @@ export const siteInfoApi = { return await request({ url: apiPrefix + "/delete", method: "post", - params: { id } + params: { id }, }); }, @@ -39,20 +39,20 @@ export const siteInfoApi = { return await request({ url: apiPrefix + "/info", method: "post", - params: { id } + params: { id }, }); }, async DoCheck(id: number) { return await request({ url: apiPrefix + "/check", method: "post", - data: { id } + data: { id }, }); }, async CheckAll() { return await request({ url: apiPrefix + "/checkAll", - method: "post" + method: "post", }); - } + }, }; diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/index.vue b/packages/ui/certd-client/src/views/certd/monitor/site/index.vue index 60db2b2a..b3521df3 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/site/index.vue +++ b/packages/ui/certd-client/src/views/certd/monitor/site/index.vue @@ -4,7 +4,10 @@
站点证书监控
-
每天0点,检查网站证书的过期时间,到期前10天时将发出提醒(使用默认通知渠道);
+
+ 每天0点,检查网站证书的过期时间,到期前10天时将发出提醒(使用默认通知渠道); + 站点监控设置 +
基础版限制1条,专业版以上无限制,当前
diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/setting/api.ts b/packages/ui/certd-client/src/views/certd/monitor/site/setting/api.ts new file mode 100644 index 00000000..2a96d9f1 --- /dev/null +++ b/packages/ui/certd-client/src/views/certd/monitor/site/setting/api.ts @@ -0,0 +1,24 @@ +// @ts-ignore +import { request } from "/src/api/service"; +const apiPrefix = "/monitor/site/setting"; +export type UserSiteMonitorSetting = { + notificationId?: number; +}; + +export async function SiteMonitorSettingsGet() { + const res = await request({ + url: apiPrefix + "/get", + method: "post", + }); + if (!res) { + return {}; + } + return res as UserSiteMonitorSetting; +} +export async function SiteMonitorSettingsSave(data: UserSiteMonitorSetting) { + await request({ + url: apiPrefix + "/save", + method: "post", + data: data, + }); +} diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/setting/index.vue b/packages/ui/certd-client/src/views/certd/monitor/site/setting/index.vue new file mode 100644 index 00000000..1bb62400 --- /dev/null +++ b/packages/ui/certd-client/src/views/certd/monitor/site/setting/index.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/packages/ui/certd-client/src/views/framework/login/index.vue b/packages/ui/certd-client/src/views/framework/login/index.vue index 6ccc92fa..5badc566 100644 --- a/packages/ui/certd-client/src/views/framework/login/index.vue +++ b/packages/ui/certd-client/src/views/framework/login/index.vue @@ -54,7 +54,7 @@
请打开您的Authenticator APP,获取动态验证码。
- + @@ -71,7 +71,7 @@