diff --git a/CHANGELOG.md b/CHANGELOG.md index e9a5b57a3..f1540c10d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +### Bug Fixes + +* 修复正常批量删除流水线报权限不足的bug ([5b50083](https://github.com/certd/certd/commit/5b500830a122c6c42dab054e57fed509050f94da)) + +### Performance Improvements + +* 优化动态加载依赖镜像地址,多次重试 ([5f53b81](https://github.com/certd/certd/commit/5f53b81c75dd242b4260ac08cae14c6d1a08a883)) + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) ### Bug Fixes diff --git a/docs/guide/changelogs/CHANGELOG.md b/docs/guide/changelogs/CHANGELOG.md index e9a5b57a3..f1540c10d 100644 --- a/docs/guide/changelogs/CHANGELOG.md +++ b/docs/guide/changelogs/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +### Bug Fixes + +* 修复正常批量删除流水线报权限不足的bug ([5b50083](https://github.com/certd/certd/commit/5b500830a122c6c42dab054e57fed509050f94da)) + +### Performance Improvements + +* 优化动态加载依赖镜像地址,多次重试 ([5f53b81](https://github.com/certd/certd/commit/5f53b81c75dd242b4260ac08cae14c6d1a08a883)) + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) ### Bug Fixes diff --git a/lerna.json b/lerna.json index 99c74acca..08426f9ad 100644 --- a/lerna.json +++ b/lerna.json @@ -9,5 +9,5 @@ } }, "npmClient": "pnpm", - "version": "1.42.5" + "version": "1.42.6" } diff --git a/packages/core/acme-client/CHANGELOG.md b/packages/core/acme-client/CHANGELOG.md index 0583e7eb8..eef4fbcd5 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.42.6](https://github.com/publishlab/node-acme-client/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/acme-client + ## [1.42.5](https://github.com/publishlab/node-acme-client/compare/v1.42.4...v1.42.5) (2026-07-15) **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 a974def44..c03e5710c 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.42.5", + "version": "1.42.6", "type": "module", "module": "./dist/index.js", "main": "./dist/index.js", @@ -18,7 +18,7 @@ "types" ], "dependencies": { - "@certd/basic": "^1.42.5", + "@certd/basic": "^1.42.6", "@peculiar/x509": "^1.11.0", "asn1js": "^3.0.5", "axios": "^1.9.0", @@ -75,5 +75,5 @@ "bugs": { "url": "https://github.com/publishlab/node-acme-client/issues" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/core/basic/CHANGELOG.md b/packages/core/basic/CHANGELOG.md index 7e26ded27..5e2ab94f8 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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/basic + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) **Note:** Version bump only for package @certd/basic diff --git a/packages/core/basic/build.md b/packages/core/basic/build.md index e2c91fe7d..0b4a3bfd5 100644 --- a/packages/core/basic/build.md +++ b/packages/core/basic/build.md @@ -1 +1 @@ -23:31 +01:12 diff --git a/packages/core/basic/package.json b/packages/core/basic/package.json index 8a0adb355..7e460b2b4 100644 --- a/packages/core/basic/package.json +++ b/packages/core/basic/package.json @@ -1,7 +1,7 @@ { "name": "@certd/basic", "private": false, - "version": "1.42.5", + "version": "1.42.6", "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", @@ -54,5 +54,5 @@ "tslib": "^2.8.1", "typescript": "^5.4.2" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/core/pipeline/CHANGELOG.md b/packages/core/pipeline/CHANGELOG.md index 023e40e68..b1f5d2b7d 100644 --- a/packages/core/pipeline/CHANGELOG.md +++ b/packages/core/pipeline/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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +### Performance Improvements + +* 优化动态加载依赖镜像地址,多次重试 ([5f53b81](https://github.com/certd/certd/commit/5f53b81c75dd242b4260ac08cae14c6d1a08a883)) + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) ### Bug Fixes diff --git a/packages/core/pipeline/package.json b/packages/core/pipeline/package.json index 6eaf3f489..ecc01e70e 100644 --- a/packages/core/pipeline/package.json +++ b/packages/core/pipeline/package.json @@ -1,7 +1,7 @@ { "name": "@certd/pipeline", "private": false, - "version": "1.42.5", + "version": "1.42.6", "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", @@ -21,8 +21,8 @@ "lint": "eslint --fix" }, "dependencies": { - "@certd/basic": "^1.42.5", - "@certd/plus-core": "^1.42.5", + "@certd/basic": "^1.42.6", + "@certd/plus-core": "^1.42.6", "dayjs": "^1.11.7", "lodash-es": "^4.17.21", "reflect-metadata": "^0.2.2" @@ -51,5 +51,5 @@ "tslib": "^2.8.1", "typescript": "^5.4.2" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/core/pipeline/src/service/runtime.ts b/packages/core/pipeline/src/service/runtime.ts index 29dd9416e..b1aacbdfa 100644 --- a/packages/core/pipeline/src/service/runtime.ts +++ b/packages/core/pipeline/src/service/runtime.ts @@ -571,8 +571,14 @@ export class RuntimeDepsService { log.info("第三方依赖安装完成"); return { registryUrl: tryUrl, packageJsonPath }; } - lastError = result.stderr || result.stdout || "unknown error"; - log.warn?.(`镜像 ${tryUrl || "默认"} 安装失败${urlsToTry.length > 1 ? ",尝试下一个镜像..." : ""}`); + const errOutput = (result.stderr || "").trim(); + const outOutput = (result.stdout || "").trim(); + lastError = errOutput || outOutput || "unknown error"; + log.info(`镜像 ${tryUrl || "默认"} 安装失败,退出码: ${result.code}${urlsToTry.length > 1 ? ",尝试下一个镜像..." : ""}`); + log.info(` pnpm stderr: ${(errOutput || "(空)").slice(0, 2000)}`); + if (outOutput) { + log.info(` pnpm stdout: ${outOutput.slice(0, 2000)}`); + } } this.writeInstallState(statePath, { ...currentState, diff --git a/packages/libs/lib-huawei/CHANGELOG.md b/packages/libs/lib-huawei/CHANGELOG.md index 89efeba72..35e8c2865 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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/lib-huawei + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) **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 e29042ee6..de95fd22a 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.42.5", + "version": "1.42.6", "main": "./dist/bundle.js", "module": "./dist/bundle.js", "types": "./dist/d/index.d.ts", @@ -31,5 +31,5 @@ "prettier": "3.3.3", "tslib": "^2.8.1" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/libs/lib-iframe/CHANGELOG.md b/packages/libs/lib-iframe/CHANGELOG.md index 28e35d779..9db0cbcda 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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/lib-iframe + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) **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 c40afe542..85b1c01a0 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.42.5", + "version": "1.42.6", "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", @@ -37,5 +37,5 @@ "tslib": "^2.8.1", "typescript": "^5.4.2" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/libs/lib-jdcloud/CHANGELOG.md b/packages/libs/lib-jdcloud/CHANGELOG.md index dc18b8c78..2f8c2d0d8 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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/jdcloud + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) **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 2f5d6ba3f..da4bce87d 100644 --- a/packages/libs/lib-jdcloud/package.json +++ b/packages/libs/lib-jdcloud/package.json @@ -1,6 +1,6 @@ { "name": "@certd/jdcloud", - "version": "1.42.5", + "version": "1.42.6", "description": "jdcloud openApi sdk", "main": "./dist/bundle.js", "module": "./dist/bundle.js", @@ -63,5 +63,5 @@ "fetch" ] }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/libs/lib-k8s/CHANGELOG.md b/packages/libs/lib-k8s/CHANGELOG.md index 864a19912..bba2ae8cd 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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/lib-k8s + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) **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 d003e926a..989b7838a 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.42.5", + "version": "1.42.6", "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", @@ -21,7 +21,7 @@ "lint": "eslint --fix" }, "dependencies": { - "@certd/basic": "^1.42.5", + "@certd/basic": "^1.42.6", "@kubernetes/client-node": "0.21.0" }, "devDependencies": { @@ -38,5 +38,5 @@ "tslib": "^2.8.1", "typescript": "^5.4.2" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/libs/lib-server/CHANGELOG.md b/packages/libs/lib-server/CHANGELOG.md index a67c6677c..b66f883dd 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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +### Bug Fixes + +* 修复正常批量删除流水线报权限不足的bug ([5b50083](https://github.com/certd/certd/commit/5b500830a122c6c42dab054e57fed509050f94da)) + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) ### Bug Fixes diff --git a/packages/libs/lib-server/package.json b/packages/libs/lib-server/package.json index 74cd4cfcf..34ec9ccba 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.42.5", + "version": "1.42.6", "description": "midway with flyway, sql upgrade way ", "private": false, "type": "module", @@ -29,11 +29,11 @@ ], "license": "AGPL", "dependencies": { - "@certd/acme-client": "^1.42.5", - "@certd/basic": "^1.42.5", - "@certd/pipeline": "^1.42.5", - "@certd/plugin-lib": "^1.42.5", - "@certd/plus-core": "^1.42.5", + "@certd/acme-client": "^1.42.6", + "@certd/basic": "^1.42.6", + "@certd/pipeline": "^1.42.6", + "@certd/plugin-lib": "^1.42.6", + "@certd/plus-core": "^1.42.6", "@midwayjs/cache": "3.14.0", "@midwayjs/core": "3.20.11", "@midwayjs/i18n": "3.20.13", @@ -69,5 +69,5 @@ "typeorm": "^0.3.20", "typescript": "^5.4.2" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/libs/lib-server/src/basic/base-service.ts b/packages/libs/lib-server/src/basic/base-service.ts index 9538c4861..df9b3da21 100644 --- a/packages/libs/lib-server/src/basic/base-service.ts +++ b/packages/libs/lib-server/src/basic/base-service.ts @@ -253,7 +253,6 @@ export abstract class BaseService { if (!Array.isArray(ids)) { ids = [ids]; } - ids = this.filterIds(ids); const res = await this.getRepository().find({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore @@ -266,7 +265,7 @@ export abstract class BaseService { }, }); if (!res || res.length === ids.length) { - return; + return ids; } throw new PermissionException("权限不足"); } @@ -280,6 +279,12 @@ export abstract class BaseService { }); } async batchDelete(ids: number[], userId: number, projectId?: number): Promise { + if (!ids || ids.length === 0) { + throw new ValidateException("ids不能为空"); + } + if (!Array.isArray(ids)) { + ids = [ids]; + } ids = this.filterIds(ids); if (userId != null) { const userProjectQuery = this.buildUserProjectQuery(userId, projectId); diff --git a/packages/libs/midway-flyway-js/CHANGELOG.md b/packages/libs/midway-flyway-js/CHANGELOG.md index 2a2505c57..0b76bb1e1 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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/midway-flyway-js + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) ### Performance Improvements diff --git a/packages/libs/midway-flyway-js/package.json b/packages/libs/midway-flyway-js/package.json index a44ceab29..5433c1218 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.42.5", + "version": "1.42.6", "description": "midway with flyway, sql upgrade way ", "private": false, "type": "module", @@ -52,5 +52,5 @@ "typeorm": "^0.3.20", "typescript": "^5.4.2" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/libs/midway-flyway-js/src/flyway.ts b/packages/libs/midway-flyway-js/src/flyway.ts index 569d9e5c5..bab2897ee 100644 --- a/packages/libs/midway-flyway-js/src/flyway.ts +++ b/packages/libs/midway-flyway-js/src/flyway.ts @@ -93,19 +93,21 @@ export class Flyway { await queryRunner.commitTransaction(); } catch (err) { this.logger.error(err); + this.errorTip(err); await this.storeSqlExecLog(file.script, filepath, false, queryRunner); await queryRunner.rollbackTransaction(); - - if (err.code === "SQLITE_IOERR_WRITE") { - this.logger.warn("SQLite数据库写入失败,可能您的操作系统版本太低,请将「certd:latest」镜像改为「certd:slim」即可。(如需指定版本可以修改成「certd:[version]-slim」)", file.script); - } - throw err; } } this.logger.info("[ midfly ] end-------------"); } + private errorTip(err: any) { + if (err.code === "SQLITE_IOERR_WRITE") { + this.logger.warn("SQLite数据库写入失败,可能您的操作系统版本太低,请将「certd:latest」镜像改为「certd:slim」即可。(如需指定版本可以修改成「certd:[version]-slim」)"); + } + } + private async storeSqlExecLog(filename: string, filepath: string, success: boolean, queryRunner: QueryRunner) { const hash = await this.getFileHash(filepath); //先删除 @@ -265,6 +267,7 @@ export class Flyway { await queryRunner.query(sql); } catch (err: any) { this.logger.error("exec sql error : ", err.message, err); + this.errorTip(err); throw err; } } diff --git a/packages/plugins/plugin-cert/CHANGELOG.md b/packages/plugins/plugin-cert/CHANGELOG.md index 035afaaa3..6ef5ac8f0 100644 --- a/packages/plugins/plugin-cert/CHANGELOG.md +++ b/packages/plugins/plugin-cert/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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/plugin-cert + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) **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 e93247fab..be2217e75 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.42.5", + "version": "1.42.6", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -20,7 +20,7 @@ "lint": "eslint --fix" }, "dependencies": { - "@certd/plugin-lib": "^1.42.5" + "@certd/plugin-lib": "^1.42.6" }, "devDependencies": { "@types/chai": "^4.3.12", @@ -38,5 +38,5 @@ "tslib": "^2.8.1", "typescript": "^5.4.2" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/plugins/plugin-lib/CHANGELOG.md b/packages/plugins/plugin-lib/CHANGELOG.md index 6f5bbe21e..f8b25d886 100644 --- a/packages/plugins/plugin-lib/CHANGELOG.md +++ b/packages/plugins/plugin-lib/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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/plugin-lib + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) ### Bug Fixes diff --git a/packages/plugins/plugin-lib/package.json b/packages/plugins/plugin-lib/package.json index 76b662484..51ad14983 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.42.5", + "version": "1.42.6", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -17,9 +17,9 @@ "lint": "eslint --fix" }, "dependencies": { - "@certd/acme-client": "^1.42.5", - "@certd/basic": "^1.42.5", - "@certd/pipeline": "^1.42.5", + "@certd/acme-client": "^1.42.6", + "@certd/basic": "^1.42.6", + "@certd/pipeline": "^1.42.6", "dayjs": "^1.11.7", "jszip": "^3.10.1", "lodash-es": "^4.17.21", @@ -45,5 +45,5 @@ "tslib": "^2.8.1", "typescript": "^5.4.2" }, - "gitHead": "83495b32138cf831b4ea02054d12981d9787ebf0" + "gitHead": "246ee83015bf5589adc2a5fa3d1388c8d9a2a252" } diff --git a/packages/ui/certd-client/CHANGELOG.md b/packages/ui/certd-client/CHANGELOG.md index 97aa3dfc1..5f1fba9d4 100644 --- a/packages/ui/certd-client/CHANGELOG.md +++ b/packages/ui/certd-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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +**Note:** Version bump only for package @certd/ui-client + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) ### Bug Fixes diff --git a/packages/ui/certd-client/package.json b/packages/ui/certd-client/package.json index 05d2cd75f..2851810a1 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.42.5", + "version": "1.42.6", "private": true, "scripts": { "dev": "vite --open", @@ -104,8 +104,8 @@ "zod-defaults": "^0.1.3" }, "devDependencies": { - "@certd/lib-iframe": "^1.42.5", - "@certd/pipeline": "^1.42.5", + "@certd/lib-iframe": "^1.42.6", + "@certd/pipeline": "^1.42.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-server/CHANGELOG.md b/packages/ui/certd-server/CHANGELOG.md index 3feb25809..6fa88f0fc 100644 --- a/packages/ui/certd-server/CHANGELOG.md +++ b/packages/ui/certd-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.42.6](https://github.com/certd/certd/compare/v1.42.5...v1.42.6) (2026-07-18) + +### Bug Fixes + +* 修复正常批量删除流水线报权限不足的bug ([5b50083](https://github.com/certd/certd/commit/5b500830a122c6c42dab054e57fed509050f94da)) + ## [1.42.5](https://github.com/certd/certd/compare/v1.42.4...v1.42.5) (2026-07-15) ### Bug Fixes diff --git a/packages/ui/certd-server/package.json b/packages/ui/certd-server/package.json index 0389ecdce..ca34f99b1 100644 --- a/packages/ui/certd-server/package.json +++ b/packages/ui/certd-server/package.json @@ -1,6 +1,6 @@ { "name": "@certd/ui-server", - "version": "1.42.5", + "version": "1.42.6", "description": "fast-server base midway", "private": true, "type": "module", @@ -42,20 +42,20 @@ "lint1": "eslint --fix" }, "dependencies": { - "@certd/acme-client": "^1.42.5", - "@certd/basic": "^1.42.5", - "@certd/commercial-core": "^1.42.5", + "@certd/acme-client": "^1.42.6", + "@certd/basic": "^1.42.6", + "@certd/commercial-core": "^1.42.6", "@certd/cv4pve-api-javascript": "^8.4.2", - "@certd/jdcloud": "^1.42.5", - "@certd/lib-huawei": "^1.42.5", - "@certd/lib-k8s": "^1.42.5", - "@certd/lib-server": "^1.42.5", - "@certd/midway-flyway-js": "^1.42.5", - "@certd/pipeline": "^1.42.5", - "@certd/plugin-cert": "^1.42.5", - "@certd/plugin-lib": "^1.42.5", - "@certd/plugin-plus": "^1.42.5", - "@certd/plus-core": "^1.42.5", + "@certd/jdcloud": "^1.42.6", + "@certd/lib-huawei": "^1.42.6", + "@certd/lib-k8s": "^1.42.6", + "@certd/lib-server": "^1.42.6", + "@certd/midway-flyway-js": "^1.42.6", + "@certd/pipeline": "^1.42.6", + "@certd/plugin-cert": "^1.42.6", + "@certd/plugin-lib": "^1.42.6", + "@certd/plugin-plus": "^1.42.6", + "@certd/plus-core": "^1.42.6", "@koa/cors": "^5.0.0", "@midwayjs/bootstrap": "3.20.11", "@midwayjs/cache": "3.14.0", diff --git a/packages/ui/certd-server/src/modules/monitor/service/site-info-service.ts b/packages/ui/certd-server/src/modules/monitor/service/site-info-service.ts index f2e714f09..2297ec842 100644 --- a/packages/ui/certd-server/src/modules/monitor/service/site-info-service.ts +++ b/packages/ui/certd-server/src/modules/monitor/service/site-info-service.ts @@ -806,6 +806,8 @@ export class SiteInfoService extends BaseService { } async batchDelete(ids: number[], userId: number, projectId?: number): Promise { + + ids = this.filterIds(ids); const userProjectQuery = this.buildUserProjectQuery(userId, projectId); const result = await this.repository.delete({ id: In(ids), diff --git a/packages/ui/certd-server/src/modules/pipeline/service/pipeline-service.ts b/packages/ui/certd-server/src/modules/pipeline/service/pipeline-service.ts index a4640829a..a679a55bc 100644 --- a/packages/ui/certd-server/src/modules/pipeline/service/pipeline-service.ts +++ b/packages/ui/certd-server/src/modules/pipeline/service/pipeline-service.ts @@ -1,7 +1,7 @@ import { Config, Inject, Provide, Scope, ScopeEnum, sleep } from "@midwayjs/core"; import { InjectEntityModel } from "@midwayjs/typeorm"; import { In, MoreThan, Repository } from "typeorm"; -import { AccessService, BaseService, isEnterprise, NeedSuiteException, NeedVIPException, PageReq, SysPublicSettings, SysSettingsService, SysSiteInfo } from "@certd/lib-server"; +import { AccessService, BaseService, isEnterprise, NeedSuiteException, NeedVIPException, PageReq, SysPublicSettings, SysSettingsService, SysSiteInfo, ValidateException } from "@certd/lib-server"; import { PipelineEntity } from "../entity/pipeline.js"; import { PipelineDetail } from "../entity/vo/pipeline-detail.js"; import { Executor, IAccessService, ICnameProxyService, INotificationService, Notification, Pipeline, pluginRegistry, ResultType, RunHistory, RunnableCollection, SysInfo, UserInfo } from "@certd/pipeline"; @@ -966,15 +966,19 @@ export class PipelineService extends BaseService { if (!isPlus()) { throw new NeedVIPException("此功能需要升级Certd专业版"); } + if (!ids || ids.length === 0) { + throw new ValidateException("ids不能为空"); + } + ids = this.filterIds(ids); + + if (userId && userId > 0) { + await this.checkUserId(ids, userId); + } + if (projectId) { + await this.checkUserId(ids, projectId, "projectId"); + } for (const id of ids) { - if (userId && userId > 0) { - await this.checkUserId(id, userId); - } - if (projectId) { - await this.checkUserId(id, projectId, "projectId"); - } await this.delete(id); - ids.push(id); } return ids.length; } diff --git a/packages/ui/certd-server/src/modules/pipeline/service/template-service.ts b/packages/ui/certd-server/src/modules/pipeline/service/template-service.ts index ade3e691a..e5ca65b3b 100644 --- a/packages/ui/certd-server/src/modules/pipeline/service/template-service.ts +++ b/packages/ui/certd-server/src/modules/pipeline/service/template-service.ts @@ -88,6 +88,7 @@ export class TemplateService extends BaseService { } async batchDelete(ids: number[], userId: number, projectId?: number): Promise { + ids = this.filterIds(ids); const where: any = { id: In(ids), }; diff --git a/packages/ui/certd-server/src/plugins/plugin-plus/baota/lib/client.ts b/packages/ui/certd-server/src/plugins/plugin-plus/baota/lib/client.ts index f64a1b5a7..d795c7458 100644 --- a/packages/ui/certd-server/src/plugins/plugin-plus/baota/lib/client.ts +++ b/packages/ui/certd-server/src/plugins/plugin-plus/baota/lib/client.ts @@ -1,15 +1,17 @@ import crypto from "node:crypto"; import { BaotaAccess } from "../access.js"; -import { HttpClient, HttpRequestConfig } from "@certd/basic"; +import { HttpClient, HttpRequestConfig, ILogger } from "@certd/basic"; import * as querystring from "node:querystring"; export class BaotaClient { access: BaotaAccess; http: HttpClient; + logger: ILogger constructor(access: BaotaAccess, http: HttpClient) { this.access = access; this.http = http; + this.logger = access.ctx.logger; } //将以上 java代码 翻译成nodejs 代码 diff --git a/packages/ui/certd-server/src/plugins/plugin-plus/baota/plugins/plugin-deploy-to-website.ts b/packages/ui/certd-server/src/plugins/plugin-plus/baota/plugins/plugin-deploy-to-website.ts index f41e2b14a..6ccb722bc 100644 --- a/packages/ui/certd-server/src/plugins/plugin-plus/baota/plugins/plugin-deploy-to-website.ts +++ b/packages/ui/certd-server/src/plugins/plugin-plus/baota/plugins/plugin-deploy-to-website.ts @@ -88,7 +88,7 @@ export class BaotaDeployWebSiteCert extends AbstractTaskPlugin { }) siteName!: string | string[]; - async onInstance() {} + async onInstance() { } async execute(): Promise { const { cert, accessId } = this; const access = await this.getAccess(accessId); @@ -104,26 +104,37 @@ export class BaotaDeployWebSiteCert extends AbstractTaskPlugin { } const lockKey = `baota-lock-${accessId}`; - + if (this.isDockerSite) { + this.logger.info(`当前已勾选docker站点(如果部署失败,请确认站点:${siteNames}, 是否全部为docker站点)`); + } for (const site of siteNames) { // 加锁,防止并发部署证书, 宝塔并发部署会导致nginx的conf错乱 await this.ctx.utils.locker.execute(lockKey, async () => { - this.logger.info(`为站点:${site}设置证书,目前支持宝塔网站站点、docker站点`); - if (this.isDockerSite) { - const res = await client.doRequest("/mod/docker/com/set_ssl", "", { - site_name: site, - key: cert.key, - csr: cert.crt, - }); - this.logger.info(res?.msg); - } else { - const res = await client.doRequest("/site", "SetSSL", { - type: 0, - siteName: site, - key: cert.key, - csr: cert.crt, - }); - this.logger.info(res?.msg); + try { + if (this.isDockerSite) { + this.logger.info(`为Docker站点:${site} 设置证书`); + const res = await client.doRequest("/mod/docker/com/set_ssl", "", { + site_name: site, + key: cert.key, + csr: cert.crt, + }); + this.logger.info(res?.msg); + } else { + this.logger.info(`为非Docker站点:${site} 设置证书`); + const res = await client.doRequest("/site", "SetSSL", { + type: 0, + siteName: site, + key: cert.key, + csr: cert.crt, + }); + this.logger.info(res?.msg); + } + } catch (e: any) { + if (e?.message?.includes("没有服务器配置文件")) { + this.logger.error(e.message); + this.logger.warn(`首先请确认站点 ${site} 是否存在,如果存在,请到宝塔上手动保存一下该站点证书试试`); + } + throw e } }); } diff --git a/packages/ui/certd-server/src/plugins/plugin-tencent/plugin/deploy-to-clb/index.test.ts b/packages/ui/certd-server/src/plugins/plugin-tencent/plugin/deploy-to-clb/index.test.ts new file mode 100644 index 000000000..1f5086fc4 --- /dev/null +++ b/packages/ui/certd-server/src/plugins/plugin-tencent/plugin/deploy-to-clb/index.test.ts @@ -0,0 +1,111 @@ +/// + +import assert from "node:assert/strict"; +import { DeployCertToTencentCLB } from "./index.js"; + +describe("DeployCertToTencentCLB", () => { + it("uses remote single-select inputs for CLB and HTTPS listener", () => { + const input = (DeployCertToTencentCLB as any).define.input; + + assert.equal(input.loadBalancerId.component.name, "remote-select"); + assert.equal(input.loadBalancerId.component.single, true); + assert.equal(input.loadBalancerId.component.action, "onGetCLBList"); + assert.equal(input.loadBalancerId.required, true); + + assert.equal(input.listenerId.component.name, "remote-select"); + assert.equal(input.listenerId.component.single, true); + assert.equal(input.listenerId.component.action, "onGetListenerList"); + assert.deepEqual(input.listenerId.component.watches, ["certDomains", "accessId", "region", "loadBalancerId"]); + assert.equal(input.listenerId.required, true); + + assert.equal(input.domain.component.name, "remote-select"); + assert.equal(input.domain.component.single, false); + assert.equal(input.domain.component.action, "onGetDomainList"); + assert.deepEqual(input.domain.component.watches, ["certDomains", "accessId", "region", "loadBalancerId", "listenerId"]); + assert.equal(input.domain.required, false); + }); + + it("maps CLB API results to remote-select options", async () => { + const plugin = new DeployCertToTencentCLB(); + plugin.accessId = "access-1"; + plugin.logger = { info: () => undefined } as any; + (plugin as any).getClient = async () => ({}); + (plugin as any).getCLBList = async () => [ + { + LoadBalancerId: "lb-1", + LoadBalancerName: "业务负载均衡", + }, + ]; + + const options = await plugin.onGetCLBList({}); + + assert.deepEqual(options, [ + { + value: "lb-1", + label: "业务负载均衡", + }, + ]); + }); + + it("maps HTTPS listener API results after selecting a CLB", async () => { + const plugin = new DeployCertToTencentCLB(); + plugin.accessId = "access-1"; + plugin.loadBalancerId = "lb-1"; + plugin.logger = { info: () => undefined } as any; + (plugin as any).getClient = async () => ({}); + (plugin as any).getListenerList = async (_client: any, loadBalancerId: string, listenerIds: any) => { + assert.equal(loadBalancerId, "lb-1"); + assert.equal(listenerIds, null); + return [ + { + ListenerId: "listener-1", + ListenerName: "HTTPS监听器", + Port: 443, + }, + ]; + }; + + const options = await plugin.onGetListenerList({}); + + assert.deepEqual(options, [ + { + value: "listener-1", + label: "HTTPS监听器:443", + }, + ]); + }); + + it("maps SNI domains from the selected listener rules", async () => { + const plugin = new DeployCertToTencentCLB(); + plugin.accessId = "access-1"; + plugin.loadBalancerId = "lb-1"; + plugin.listenerId = "listener-1"; + plugin.logger = { info: () => undefined } as any; + (plugin as any).getClient = async () => ({}); + (plugin as any).getListenerList = async (_client: any, loadBalancerId: string, listenerIds: string[]) => { + assert.equal(loadBalancerId, "lb-1"); + assert.deepEqual(listenerIds, ["listener-1"]); + return [ + { + ListenerId: "listener-1", + Rules: [{ Domain: "www.example.com" }, { Domain: "api.example.com" }], + }, + ]; + }; + + const options = await plugin.onGetDomainList({}); + + assert.deepEqual(options, [ + { + value: "www.example.com", + label: "www.example.com", + domain: "www.example.com", + }, + { + value: "api.example.com", + label: "api.example.com", + domain: "api.example.com", + }, + ]); + }); +}); diff --git a/packages/ui/certd-server/src/plugins/plugin-tencent/plugin/deploy-to-clb/index.ts b/packages/ui/certd-server/src/plugins/plugin-tencent/plugin/deploy-to-clb/index.ts index 5a49d739d..4737e69b9 100644 --- a/packages/ui/certd-server/src/plugins/plugin-tencent/plugin/deploy-to-clb/index.ts +++ b/packages/ui/certd-server/src/plugins/plugin-tencent/plugin/deploy-to-clb/index.ts @@ -1,7 +1,8 @@ -import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline"; +import { AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline"; import dayjs from "dayjs"; import { TencentAccess } from "../../../plugin-lib/tencent/index.js"; import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert"; +import { createRemoteSelectInputDefine } from "@certd/plugin-lib"; @IsTaskPlugin({ name: "DeployCertToTencentCLB", title: "腾讯云-部署到CLB", @@ -73,29 +74,44 @@ export class DeployCertToTencentCLB extends AbstractTaskPlugin { }) region!: string; - @TaskInput({ - title: "负载均衡ID", - required: true, - }) + @TaskInput( + createRemoteSelectInputDefine({ + title: "负载均衡ID", + helper: "请选择要部署证书的负载均衡", + action: DeployCertToTencentCLB.prototype.onGetCLBList.name, + watches: ["region"], + single: true, + pager: false, + search: false, + }) + ) loadBalancerId!: string; - @TaskInput({ - title: "监听器ID", - required: true, - }) + @TaskInput( + createRemoteSelectInputDefine({ + title: "监听器ID", + helper: "请选择要部署证书的HTTPS监听器", + action: DeployCertToTencentCLB.prototype.onGetListenerList.name, + watches: ["region", "loadBalancerId"], + single: true, + pager: false, + search: false, + }) + ) listenerId!: string; - @TaskInput({ - title: "域名", - required: false, - component: { - name: "a-select", - vModel: "value", - open: false, - mode: "tags", - }, - helper: "如果开启了sni,则此项必须填写,未开启,则不要填写", - }) + @TaskInput( + createRemoteSelectInputDefine({ + title: "域名", + helper: "如果开启了SNI,请选择要部署证书的域名;未开启SNI时可以留空", + action: DeployCertToTencentCLB.prototype.onGetDomainList.name, + watches: ["region", "loadBalancerId", "listenerId"], + required: false, + single: false, + pager: false, + search: false, + }) + ) domain!: string | string[]; @TaskInput({ @@ -272,6 +288,27 @@ export class DeployCertToTencentCLB extends AbstractTaskPlugin { return ret.LoadBalancerSet; } + async onGetCLBList(data: PageSearch) { + if (!this.accessId) { + throw new Error("请选择Access提供者"); + } + + const client = await this.getClient(); + const list = await this.getCLBList(client); + if (!list || list.length === 0) { + return []; + } + + return list.map((item: any) => { + const loadBalancerId = item.LoadBalancerId; + const loadBalancerName = item.LoadBalancerName || loadBalancerId; + return { + value: loadBalancerId, + label: `${loadBalancerName}<${loadBalancerId}>`, + }; + }); + } + async getListenerList(client: any, balancerId: any, listenerIds: any) { // HTTPS const params = { @@ -284,6 +321,57 @@ export class DeployCertToTencentCLB extends AbstractTaskPlugin { return ret.Listeners; } + async onGetListenerList(data: PageSearch) { + if (!this.accessId) { + throw new Error("请选择Access提供者"); + } + if (!this.loadBalancerId) { + throw new Error("请先选择负载均衡"); + } + + const client = await this.getClient(); + const list = await this.getListenerList(client, this.loadBalancerId, null); + if (!list || list.length === 0) { + return []; + } + + return list.map((item: any) => { + const listenerId = item.ListenerId; + const listenerName = item.ListenerName || "HTTPS监听器"; + const port = item.Port ? `:${item.Port}` : ""; + return { + value: listenerId, + label: `${listenerName}${port}<${listenerId}>`, + }; + }); + } + + async onGetDomainList(data: PageSearch) { + if (!this.accessId) { + throw new Error("请选择Access提供者"); + } + if (!this.loadBalancerId) { + throw new Error("请先选择负载均衡"); + } + if (!this.listenerId) { + throw new Error("请先选择监听器"); + } + + const client = await this.getClient(); + const listeners = await this.getListenerList(client, this.loadBalancerId, [this.listenerId]); + const listener = listeners?.[0]; + const domains = listener?.Rules?.map((rule: any) => rule.Domain).filter(Boolean) || []; + const uniqueDomains = [...new Set(domains)]; + + return uniqueDomains.map(domain => { + return { + value: domain, + label: domain, + domain, + }; + }); + } + checkRet(ret: any) { if (!ret || ret.Error) { throw new Error("执行失败:" + ret.Error.Code + "," + ret.Error.Message); diff --git a/trigger/build.trigger b/trigger/build.trigger index f1d0cff04..1d3b516af 100644 --- a/trigger/build.trigger +++ b/trigger/build.trigger @@ -1 +1 @@ -23:35 +01:14 diff --git a/trigger/release.trigger b/trigger/release.trigger index 6a639182c..9497b7868 100644 --- a/trigger/release.trigger +++ b/trigger/release.trigger @@ -1 +1 @@ -23:54 +01:28