mirror of
https://github.com/certd/certd.git
synced 2026-07-12 16:27:34 +08:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 584b7b6f45 | |||
| 2312c444ef | |||
| 0373d019f8 | |||
| fe09e75b80 | |||
| 432c9c6cc1 | |||
| 5fc1d55879 | |||
| 268cd6cc9c | |||
| 20ffe31638 | |||
| 02d30067ea | |||
| 0ce7808e08 | |||
| d609ee2b7a | |||
| 083df61fcc | |||
| a524988be6 | |||
| 8517a0b564 | |||
| ec69b8f11b | |||
| edda1b57f3 | |||
| 5a7766992d | |||
| 02dabe11db | |||
| 58024128d8 | |||
| e44bf9d773 | |||
| 1114223bda | |||
| 55022e5fa6 | |||
| ae732fb298 |
@@ -281,12 +281,12 @@ export class DemoTest extends AbstractTaskPlugin {
|
||||
return {
|
||||
value: item.siteName,
|
||||
label: item.siteName,
|
||||
domain: item.siteName,
|
||||
domain: item.siteName, //这里必须要包含domain 否则后面分组时候全部分配到未匹配中
|
||||
};
|
||||
});
|
||||
//将站点域名名称根据证书域名进行匹配分组,分成匹配的和不匹配的两组选项,返回给前端,供用户选择
|
||||
return {
|
||||
list: optionsUtils.buildGroupOptions(options, this.certDomains),
|
||||
list: optionsUtils.buildGroupOptions(options, this.certDomains), //分组后的列表
|
||||
total: siteRes.length,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.42.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复火山引擎查不到自定义源站域名的问题 ([02dabe1](https://github.com/certd/certd/commit/02dabe11db3e9b13ca4621ce9ddd2b808bfca390))
|
||||
* 修复火山引擎自定义源站域名查询不到的问题 ([e44bf9d](https://github.com/certd/certd/commit/e44bf9d77375d48ac7fd1582e69fae02dfd248fa))
|
||||
* **pipeline:** 重构运行时依赖加载逻辑,修复火山引擎DNS解析报runtimeDepsService未初始化的bug ([ec69b8f](https://github.com/certd/certd/commit/ec69b8f11bfd4b20991aef74a72a47182ca79a9d))
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -3,6 +3,20 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.42.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复火山引擎查不到自定义源站域名的问题 ([02dabe1](https://github.com/certd/certd/commit/02dabe11db3e9b13ca4621ce9ddd2b808bfca390))
|
||||
* 修复火山引擎自定义源站域名查询不到的问题 ([e44bf9d](https://github.com/certd/certd/commit/e44bf9d77375d48ac7fd1582e69fae02dfd248fa))
|
||||
* **pipeline:** 重构运行时依赖加载逻辑,修复火山引擎DNS解析报runtimeDepsService未初始化的bug ([ec69b8f](https://github.com/certd/certd/commit/ec69b8f11bfd4b20991aef74a72a47182ca79a9d))
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **volcengine-alb:** 修复火山引擎ALB 默认证书部署类型会部署到扩展证书的问题 ([0a068a2](https://github.com/certd/certd/commit/0a068a274673e9768954e9f7367c267d44f3b530))
|
||||
|
||||
## [1.42.2](https://github.com/certd/certd/compare/v1.42.1...v1.42.2) (2026-07-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.42.3"
|
||||
"version": "1.42.4"
|
||||
}
|
||||
|
||||
@@ -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.4](https://github.com/publishlab/node-acme-client/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.42.3](https://github.com/publishlab/node-acme-client/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**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.42.3",
|
||||
"version": "1.42.4",
|
||||
"type": "module",
|
||||
"module": "./dist/index.js",
|
||||
"main": "./dist/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.42.3",
|
||||
"@certd/basic": "^1.42.4",
|
||||
"@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": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
@@ -1 +1 @@
|
||||
23:45
|
||||
02:45
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -54,5 +54,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **pipeline:** 重构运行时依赖加载逻辑,修复火山引擎DNS解析报runtimeDepsService未初始化的bug ([ec69b8f](https://github.com/certd/certd/commit/ec69b8f11bfd4b20991aef74a72a47182ca79a9d))
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -21,8 +21,8 @@
|
||||
"lint": "eslint --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.42.3",
|
||||
"@certd/plus-core": "^1.42.3",
|
||||
"@certd/basic": "^1.42.4",
|
||||
"@certd/plus-core": "^1.42.4",
|
||||
"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": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -62,9 +62,6 @@ export abstract class BaseAccess implements IAccess {
|
||||
if (!this.runtimeDepsService && this.ctx.serviceGetter) {
|
||||
this.runtimeDepsService = await this.ctx.serviceGetter.get("runtimeDepsService");
|
||||
}
|
||||
if (this.runtimeDepsService && this.ctx.define?.name) {
|
||||
await this.runtimeDepsService.ensureRuntimeDependencies({ pluginKeys: `access:${this.ctx.define.name}`, logger: this.ctx.logger });
|
||||
}
|
||||
}
|
||||
|
||||
async onRequest(req: AccessRequestHandleReq) {
|
||||
|
||||
@@ -47,7 +47,7 @@ export function AccessInput(input?: AccessInputDefine): PropertyDecorator {
|
||||
};
|
||||
}
|
||||
|
||||
export async function newAccess(type: string, input: any, accessService: IAccessService, ctx?: AccessContext) {
|
||||
export async function newAccess(type: string, input: any, accessService: IAccessService, ctx: AccessContext) {
|
||||
const register = accessRegistry.get(type);
|
||||
if (register == null) {
|
||||
throw new Error(`access ${type} not found`);
|
||||
|
||||
@@ -112,9 +112,6 @@ export abstract class BaseNotification implements INotification {
|
||||
if (!this.runtimeDepsService && this.ctx.serviceGetter) {
|
||||
this.runtimeDepsService = await this.ctx.serviceGetter.get("runtimeDepsService");
|
||||
}
|
||||
if (this.runtimeDepsService && this.ctx.define?.name) {
|
||||
await this.runtimeDepsService.ensureRuntimeDependencies({ pluginKeys: `notification:${this.ctx.define.name}`, logger: this.logger });
|
||||
}
|
||||
}
|
||||
setDefine = (define: NotificationDefine) => {
|
||||
this.define = define;
|
||||
|
||||
@@ -181,9 +181,6 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
if (!this.runtimeDepsService && this.ctx.serviceGetter) {
|
||||
this.runtimeDepsService = await this.ctx.serviceGetter.get("runtimeDepsService");
|
||||
}
|
||||
if (this.runtimeDepsService && this.ctx.define?.name) {
|
||||
await this.runtimeDepsService.ensureRuntimeDependencies({ pluginKeys: `plugin:${this.ctx.define.name}`, logger: this.logger });
|
||||
}
|
||||
// 将证书加入secret
|
||||
// @ts-ignore
|
||||
if (this.cert && this.cert.crt && this.cert.key) {
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
@@ -30,5 +30,5 @@
|
||||
"prettier": "3.3.3",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -37,5 +37,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
@@ -62,5 +62,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -21,7 +21,7 @@
|
||||
"lint": "eslint --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.42.3",
|
||||
"@certd/basic": "^1.42.4",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **pipeline:** 重构运行时依赖加载逻辑,修复火山引擎DNS解析报runtimeDepsService未初始化的bug ([ec69b8f](https://github.com/certd/certd/commit/ec69b8f11bfd4b20991aef74a72a47182ca79a9d))
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -29,11 +29,11 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.42.3",
|
||||
"@certd/basic": "^1.42.3",
|
||||
"@certd/pipeline": "^1.42.3",
|
||||
"@certd/plugin-lib": "^1.42.3",
|
||||
"@certd/plus-core": "^1.42.3",
|
||||
"@certd/acme-client": "^1.42.4",
|
||||
"@certd/basic": "^1.42.4",
|
||||
"@certd/pipeline": "^1.42.4",
|
||||
"@certd/plugin-lib": "^1.42.4",
|
||||
"@certd/plus-core": "^1.42.4",
|
||||
"@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": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ export abstract class BaseService<T> {
|
||||
return item != null && item != "";
|
||||
});
|
||||
}
|
||||
async batchDelete(ids: number[], userId: number, projectId?: number) {
|
||||
async batchDelete(ids: number[], userId: number, projectId?: number): Promise<number> {
|
||||
ids = this.filterIds(ids);
|
||||
if (userId != null) {
|
||||
const userProjectQuery = this.buildUserProjectQuery(userId, projectId);
|
||||
@@ -295,6 +295,7 @@ export abstract class BaseService<T> {
|
||||
}
|
||||
|
||||
await this.delete(ids);
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
async findOne(options: FindOneOptions<T>) {
|
||||
|
||||
@@ -1,29 +1,20 @@
|
||||
import { IAccessService, IRuntimeDepsService } from "@certd/pipeline";
|
||||
|
||||
export type AccessRuntimeDepsService = IRuntimeDepsService;
|
||||
import { IAccessService } from "@certd/pipeline";
|
||||
|
||||
export class AccessGetter implements IAccessService {
|
||||
userId: number;
|
||||
projectId?: number;
|
||||
runtimeDepsService?: AccessRuntimeDepsService;
|
||||
getter: <T>(id: any, userId?: number, projectId?: number, ignorePermission?: boolean, runtimeDepsService?: AccessRuntimeDepsService) => Promise<T>;
|
||||
constructor(
|
||||
userId: number,
|
||||
projectId: number,
|
||||
getter: (id: any, userId: number, projectId?: number, ignorePermission?: boolean, runtimeDepsService?: AccessRuntimeDepsService) => Promise<any>,
|
||||
runtimeDepsService?: AccessRuntimeDepsService
|
||||
) {
|
||||
getter: <T>(id: any, userId?: number, projectId?: number, ignorePermission?: boolean) => Promise<T>;
|
||||
constructor(userId: number, projectId: number, getter: (id: any, userId: number, projectId?: number, ignorePermission?: boolean) => Promise<any>) {
|
||||
this.userId = userId;
|
||||
this.projectId = projectId;
|
||||
this.getter = getter;
|
||||
this.runtimeDepsService = runtimeDepsService;
|
||||
}
|
||||
|
||||
async getById<T = any>(id: any) {
|
||||
return await this.getter<T>(id, this.userId, this.projectId, false, this.runtimeDepsService);
|
||||
return await this.getter<T>(id, this.userId, this.projectId, false);
|
||||
}
|
||||
|
||||
async getCommonById<T = any>(id: any) {
|
||||
return await this.getter<T>(id, 0, null, false, this.runtimeDepsService);
|
||||
return await this.getter<T>(id, 0, null, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import { ApplicationContext, Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import type { IMidwayContainer } from "@midwayjs/core";
|
||||
import { InjectEntityModel } from "@midwayjs/typeorm";
|
||||
import { In, Repository } from "typeorm";
|
||||
import { AccessGetter, BaseService, PageReq, PermissionException, ValidateException } from "../../../index.js";
|
||||
import type { AccessRuntimeDepsService } from "./access-getter.js";
|
||||
import { AccessEntity } from "../entity/access.js";
|
||||
import { AccessDefine, accessRegistry, newAccess } from "@certd/pipeline";
|
||||
import { EncryptService } from "./encrypt-service.js";
|
||||
@@ -20,6 +20,9 @@ export class AccessService extends BaseService<AccessEntity> {
|
||||
@Inject()
|
||||
encryptService: EncryptService;
|
||||
|
||||
@ApplicationContext()
|
||||
applicationContext: IMidwayContainer;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
//@ts-ignore
|
||||
getRepository() {
|
||||
@@ -161,7 +164,7 @@ export class AccessService extends BaseService<AccessEntity> {
|
||||
};
|
||||
}
|
||||
|
||||
async getAccessById(id: any, checkUserId: boolean, userId?: number, projectId?: number, runtimeDepsService?: AccessRuntimeDepsService): Promise<any> {
|
||||
async getAccessById(id: any, checkUserId: boolean, userId?: number, projectId?: number): Promise<any> {
|
||||
const entity = await this.info(id);
|
||||
if (entity == null) {
|
||||
throw new Error(`该授权配置不存在,请确认是否已被删除:id=${id}`);
|
||||
@@ -184,20 +187,23 @@ export class AccessService extends BaseService<AccessEntity> {
|
||||
id: entity.id,
|
||||
...setting,
|
||||
};
|
||||
const taskServiceBuilder: any = await this.applicationContext.getAsync("taskServiceBuilder");
|
||||
const serviceGetter = taskServiceBuilder.create({ userId: userId || 0, projectId });
|
||||
const getAccessById = this.getById.bind(this);
|
||||
const accessGetter = new AccessGetter(userId, projectId, getAccessById, runtimeDepsService);
|
||||
const accessGetter = new AccessGetter(userId, projectId, getAccessById);
|
||||
const accessContext = {
|
||||
logger,
|
||||
http,
|
||||
utils,
|
||||
accessService: accessGetter,
|
||||
serviceGetter,
|
||||
} as any;
|
||||
const access = await newAccess(entity.type, input, accessGetter, accessContext);
|
||||
return access;
|
||||
}
|
||||
|
||||
async getById(id: any, userId: number, projectId?: number, _ignorePermission?: boolean, runtimeDepsService?: AccessRuntimeDepsService): Promise<any> {
|
||||
return await this.getAccessById(id, true, userId, projectId, runtimeDepsService);
|
||||
async getById(id: any, userId: number, projectId?: number, _ignorePermission?: boolean): Promise<any> {
|
||||
return await this.getAccessById(id, true, userId, projectId);
|
||||
}
|
||||
|
||||
decryptAccessEntity(entity: AccessEntity): any {
|
||||
|
||||
@@ -121,9 +121,6 @@ export abstract class BaseAddon implements IAddon {
|
||||
if (!this.runtimeDepsService && this.ctx.serviceGetter) {
|
||||
this.runtimeDepsService = await this.ctx.serviceGetter.get("runtimeDepsService");
|
||||
}
|
||||
if (this.runtimeDepsService && this.define?.addonType && this.define?.name) {
|
||||
await this.runtimeDepsService.ensureRuntimeDependencies({ pluginKeys: `addon:${this.define.addonType}:${this.define.name}`, logger: this.logger });
|
||||
}
|
||||
}
|
||||
setDefine = (define:AddonDefine) => {
|
||||
this.define = define;
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -52,5 +52,5 @@
|
||||
"typeorm": "^0.3.20",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -20,7 +20,7 @@
|
||||
"lint": "eslint --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/plugin-lib": "^1.42.3"
|
||||
"@certd/plugin-lib": "^1.42.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.3.12",
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **pipeline:** 重构运行时依赖加载逻辑,修复火山引擎DNS解析报runtimeDepsService未初始化的bug ([ec69b8f](https://github.com/certd/certd/commit/ec69b8f11bfd4b20991aef74a72a47182ca79a9d))
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -17,9 +17,9 @@
|
||||
"lint": "eslint --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.42.3",
|
||||
"@certd/basic": "^1.42.3",
|
||||
"@certd/pipeline": "^1.42.3",
|
||||
"@certd/acme-client": "^1.42.4",
|
||||
"@certd/basic": "^1.42.4",
|
||||
"@certd/pipeline": "^1.42.4",
|
||||
"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": "7808d028e9c7e1b1e3ebc41f12b023d7b553300b"
|
||||
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
|
||||
}
|
||||
|
||||
@@ -45,9 +45,6 @@ export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
|
||||
if (!this.runtimeDepsService && this.ctx.serviceGetter) {
|
||||
this.runtimeDepsService = await this.ctx.serviceGetter.get("runtimeDepsService");
|
||||
}
|
||||
if (this.runtimeDepsService && this.ctx.define?.name) {
|
||||
await this.runtimeDepsService.ensureRuntimeDependencies({ pluginKeys: `dnsProvider:${this.ctx.define.name}`, logger: this.logger });
|
||||
}
|
||||
}
|
||||
|
||||
async parseDomain(fullDomain: string) {
|
||||
|
||||
@@ -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.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/ui-client
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
**Note:** Version bump only for package @certd/ui-client
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -105,8 +105,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.42.3",
|
||||
"@certd/pipeline": "^1.42.3",
|
||||
"@certd/lib-iframe": "^1.42.4",
|
||||
"@certd/pipeline": "^1.42.4",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.42.4](https://github.com/certd/certd/compare/v1.42.3...v1.42.4) (2026-07-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复火山引擎查不到自定义源站域名的问题 ([02dabe1](https://github.com/certd/certd/commit/02dabe11db3e9b13ca4621ce9ddd2b808bfca390))
|
||||
* 修复火山引擎自定义源站域名查询不到的问题 ([e44bf9d](https://github.com/certd/certd/commit/e44bf9d77375d48ac7fd1582e69fae02dfd248fa))
|
||||
* **pipeline:** 重构运行时依赖加载逻辑,修复火山引擎DNS解析报runtimeDepsService未初始化的bug ([ec69b8f](https://github.com/certd/certd/commit/ec69b8f11bfd4b20991aef74a72a47182ca79a9d))
|
||||
|
||||
## [1.42.3](https://github.com/certd/certd/compare/v1.42.2...v1.42.3) (2026-07-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -96,24 +96,11 @@ input:
|
||||
label: 点播加速域名
|
||||
- value: image
|
||||
label: 封面加速域名
|
||||
- value: third
|
||||
label: 自定义源站
|
||||
value: play
|
||||
required: true
|
||||
order: 0
|
||||
sourceStationType:
|
||||
title: 源站类型
|
||||
helper: 选择源站类型
|
||||
value: 1
|
||||
component:
|
||||
name: a-select
|
||||
vModel: value
|
||||
options:
|
||||
- value: 1
|
||||
label: 点播源站
|
||||
- value: 2
|
||||
label: 自定义源站
|
||||
helper: 注意:封面加速域名不支持自定义源站
|
||||
required: false
|
||||
order: 0
|
||||
domainList:
|
||||
title: 域名
|
||||
component:
|
||||
@@ -132,7 +119,6 @@ input:
|
||||
- accessId
|
||||
- spaceName
|
||||
- domainType
|
||||
- sourceStationType
|
||||
required: true
|
||||
mergeScript: |2-
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.42.3",
|
||||
"version": "1.42.4",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -41,20 +41,20 @@
|
||||
"lint1": "eslint --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.42.3",
|
||||
"@certd/basic": "^1.42.3",
|
||||
"@certd/commercial-core": "^1.42.3",
|
||||
"@certd/acme-client": "^1.42.4",
|
||||
"@certd/basic": "^1.42.4",
|
||||
"@certd/commercial-core": "^1.42.4",
|
||||
"@certd/cv4pve-api-javascript": "^8.4.2",
|
||||
"@certd/jdcloud": "^1.42.3",
|
||||
"@certd/lib-huawei": "^1.42.3",
|
||||
"@certd/lib-k8s": "^1.42.3",
|
||||
"@certd/lib-server": "^1.42.3",
|
||||
"@certd/midway-flyway-js": "^1.42.3",
|
||||
"@certd/pipeline": "^1.42.3",
|
||||
"@certd/plugin-cert": "^1.42.3",
|
||||
"@certd/plugin-lib": "^1.42.3",
|
||||
"@certd/plugin-plus": "^1.42.3",
|
||||
"@certd/plus-core": "^1.42.3",
|
||||
"@certd/jdcloud": "^1.42.4",
|
||||
"@certd/lib-huawei": "^1.42.4",
|
||||
"@certd/lib-k8s": "^1.42.4",
|
||||
"@certd/lib-server": "^1.42.4",
|
||||
"@certd/midway-flyway-js": "^1.42.4",
|
||||
"@certd/pipeline": "^1.42.4",
|
||||
"@certd/plugin-cert": "^1.42.4",
|
||||
"@certd/plugin-lib": "^1.42.4",
|
||||
"@certd/plugin-plus": "^1.42.4",
|
||||
"@certd/plus-core": "^1.42.4",
|
||||
"@koa/cors": "^5.0.0",
|
||||
"@midwayjs/bootstrap": "3.20.11",
|
||||
"@midwayjs/cache": "3.14.0",
|
||||
@@ -71,7 +71,6 @@
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"@simplewebauthn/browser": "^13.2.2",
|
||||
"@simplewebauthn/server": "^13.2.3",
|
||||
"alipay-sdk": "^4.13.0",
|
||||
"axios": "^1.9.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"better-sqlite3": "^11.1.2",
|
||||
@@ -96,8 +95,6 @@
|
||||
"nanoid": "^5.0.7",
|
||||
"node-forge": "^1.3.1",
|
||||
"nodemailer": "^6.9.16",
|
||||
"openid-client": "^6.8.1",
|
||||
"otplib": "^12.0.1",
|
||||
"pg": "^8.12.0",
|
||||
"psl": "^1.15.0",
|
||||
"punycode.js": "^2.3.1",
|
||||
@@ -113,7 +110,6 @@
|
||||
"svg-captcha": "^1.4.0",
|
||||
"typeorm": "^0.3.20",
|
||||
"uuid": "^10.0.0",
|
||||
"wechatpay-node-v3": "^2.2.1",
|
||||
"whoiser": "2.0.0-beta.10",
|
||||
"xml2js": "^0.6.2"
|
||||
},
|
||||
@@ -170,7 +166,11 @@
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
"esdk-obs-nodejs": "^3.25.6",
|
||||
"qiniu": "^7.12.0"
|
||||
"qiniu": "^7.12.0",
|
||||
"alipay-sdk": "^4.13.0",
|
||||
"wechatpay-node-v3": "^2.2.1",
|
||||
"openid-client": "^6.8.1",
|
||||
"otplib": "^12.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
|
||||
@@ -132,6 +132,5 @@ export class MainConfiguration {
|
||||
logger.info(text);
|
||||
});
|
||||
logger.info("当前环境:", this.app.getEnv()); // prod
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { http, logger, utils } from "@certd/basic";
|
||||
import { ApiTags } from "@midwayjs/swagger";
|
||||
import { CodeService } from "../../../modules/basic/service/code-service.js";
|
||||
import { EmailService } from "../../../modules/basic/service/email-service.js";
|
||||
import { TaskServiceBuilder } from "../../../modules/pipeline/service/getter/task-service-getter.js";
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -40,6 +41,9 @@ export class MineController extends BaseController {
|
||||
@Inject()
|
||||
emailService: EmailService;
|
||||
|
||||
@Inject()
|
||||
taskServiceBuilder: TaskServiceBuilder;
|
||||
|
||||
@Post("/info", { description: Constants.per.authOnly, summary: "查询用户信息" })
|
||||
public async info() {
|
||||
const userId = this.getUserId();
|
||||
@@ -150,7 +154,7 @@ export class MineController extends BaseController {
|
||||
|
||||
@Post("/accountInit", { description: Constants.per.authOnly, summary: "初始化Let's Encrypt ACME账号和邮件通知" })
|
||||
public async accountInit(@Body("email") email?: string) {
|
||||
let userId = this.getUserId();
|
||||
const userId = this.getUserId();
|
||||
let userEmail = email;
|
||||
let user: any = null;
|
||||
if (!userEmail) {
|
||||
@@ -176,11 +180,13 @@ export class MineController extends BaseController {
|
||||
|
||||
const getAccessById = this.accessService.getById.bind(this.accessService);
|
||||
const accessGetter = new AccessGetter(userId, undefined, getAccessById);
|
||||
const serviceGetter = this.taskServiceBuilder.create({ userId });
|
||||
const accessContext = {
|
||||
http,
|
||||
logger,
|
||||
utils,
|
||||
accessService: accessGetter,
|
||||
serviceGetter,
|
||||
define: undefined,
|
||||
} as any;
|
||||
const access = await newAccess("acmeAccount", { caType: "letsencrypt", email: userEmail }, accessGetter, accessContext);
|
||||
@@ -190,7 +196,7 @@ export class MineController extends BaseController {
|
||||
type: "acmeAccount",
|
||||
name: "Let's Encrypt",
|
||||
userId,
|
||||
projectId:undefined,
|
||||
projectId: undefined,
|
||||
setting: JSON.stringify({
|
||||
caType: "letsencrypt",
|
||||
email: userEmail,
|
||||
|
||||
@@ -8,7 +8,6 @@ import { TaskServiceBuilder } from "../../../modules/pipeline/service/getter/tas
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import { ApiTags } from "@midwayjs/swagger";
|
||||
import { AuthService } from "../../../modules/sys/authority/service/auth-service.js";
|
||||
import { RuntimeDepsService } from "../../../modules/runtime-deps/runtime-deps-service.js";
|
||||
|
||||
@Provide()
|
||||
@Controller("/api/pi/handle")
|
||||
@@ -29,9 +28,6 @@ export class HandleController extends BaseController {
|
||||
@Inject()
|
||||
notificationService: NotificationService;
|
||||
|
||||
@Inject()
|
||||
runtimeDepsService: RuntimeDepsService;
|
||||
|
||||
@Post("/access", { description: Constants.per.authOnly, summary: "处理授权请求" })
|
||||
async accessRequest(@Body(ALL) body: AccessRequestHandleReq) {
|
||||
let { projectId, userId } = await this.getProjectUserIdRead();
|
||||
@@ -64,12 +60,14 @@ export class HandleController extends BaseController {
|
||||
}
|
||||
}
|
||||
const getAccessById = this.accessService.getById.bind(this.accessService);
|
||||
const accessGetter = new AccessGetter(userId, projectId, getAccessById, this.runtimeDepsService);
|
||||
const accessGetter = new AccessGetter(userId, projectId, getAccessById);
|
||||
const serviceGetter = this.taskServiceBuilder.create({ userId, projectId });
|
||||
const accessContext = {
|
||||
http,
|
||||
logger,
|
||||
utils,
|
||||
accessService: accessGetter,
|
||||
serviceGetter,
|
||||
define: undefined,
|
||||
} as any;
|
||||
const access = await newAccess(body.typeName, inputAccess, accessGetter, accessContext);
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import { logger } from "@certd/basic";
|
||||
import { PluginService } from "../plugin/service/plugin-service.js";
|
||||
import { registerPaymentProviders } from "../suite/payments/index.js";
|
||||
import { RuntimeDepsService } from "../runtime-deps/runtime-deps-service.js";
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@@ -9,6 +10,9 @@ export class AutoLoadPlugins {
|
||||
@Inject()
|
||||
pluginService: PluginService;
|
||||
|
||||
@Inject()
|
||||
runtimeDepsService: RuntimeDepsService;
|
||||
|
||||
async init() {
|
||||
logger.info(`加载插件开始,加载模式:${process.env.certd_plugin_loadmode}`);
|
||||
if (process.env.certd_plugin_loadmode === "metadata") {
|
||||
@@ -30,5 +34,8 @@ export class AutoLoadPlugins {
|
||||
|
||||
await registerPaymentProviders();
|
||||
logger.info(`加载插件完成,加载模式:${process.env.certd_plugin_loadmode}`);
|
||||
|
||||
// 收集插件 dependPackages 并安装
|
||||
await this.runtimeDepsService.refreshPluginDeps();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import { UserSettingsService } from "./user-settings-service.js";
|
||||
import { UserTwoFactorSetting } from "./models.js";
|
||||
import { UserService } from "../../sys/authority/service/user-service.js";
|
||||
import { RuntimeDepsService } from "../../runtime-deps/runtime-deps-service.js";
|
||||
|
||||
/**
|
||||
* 授权
|
||||
@@ -13,13 +14,15 @@ export class TwoFactorService {
|
||||
userSettingsService: UserSettingsService;
|
||||
@Inject()
|
||||
userService: UserService;
|
||||
@Inject()
|
||||
runtimeDepsService: RuntimeDepsService;
|
||||
|
||||
async getAuthenticatorQrCode(userId: any) {
|
||||
const setting = await this.getSetting(userId);
|
||||
|
||||
const authenticatorSetting = setting.authenticator;
|
||||
if (!authenticatorSetting.secret) {
|
||||
const { authenticator } = await import("otplib");
|
||||
const { authenticator } = await this.runtimeDepsService.importRuntime("otplib");
|
||||
|
||||
authenticatorSetting.secret = authenticator.generateSecret();
|
||||
await this.userSettingsService.saveSetting(userId, null, setting);
|
||||
@@ -38,7 +41,7 @@ export class TwoFactorService {
|
||||
|
||||
async saveAuthenticator(req: { userId: any; verifyCode: any }) {
|
||||
const userId = req.userId;
|
||||
const { authenticator } = await import("otplib");
|
||||
const { authenticator } = await this.runtimeDepsService.importRuntime("otplib");
|
||||
const setting = await this.getSetting(userId);
|
||||
|
||||
const authenticatorSetting = setting.authenticator;
|
||||
@@ -77,7 +80,7 @@ export class TwoFactorService {
|
||||
}
|
||||
|
||||
async verifyAuthenticatorCode(userId: any, verifyCode: string) {
|
||||
const { authenticator } = await import("otplib");
|
||||
const { authenticator } = await this.runtimeDepsService.importRuntime("otplib");
|
||||
const setting = await this.getSetting(userId);
|
||||
if (!setting.authenticator.enabled) {
|
||||
throw new Error("authenticator 未开启");
|
||||
|
||||
@@ -805,11 +805,12 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
||||
});
|
||||
}
|
||||
|
||||
async batchDelete(ids: number[], userId: number, projectId?: number): Promise<void> {
|
||||
async batchDelete(ids: number[], userId: number, projectId?: number): Promise<number> {
|
||||
const userProjectQuery = this.buildUserProjectQuery(userId, projectId);
|
||||
await this.repository.delete({
|
||||
id: In(ids),
|
||||
...userProjectQuery,
|
||||
});
|
||||
return ids.length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,9 +66,8 @@ export class TaskServiceGetter implements IServiceGetter {
|
||||
|
||||
async getAccessService(): Promise<AccessGetter> {
|
||||
const accessService: AccessService = await this.appCtx.getAsync("accessService");
|
||||
const runtimeDepsService = await this.getRuntimeDepsService();
|
||||
const getAccessById = accessService.getById.bind(accessService);
|
||||
return new AccessGetter(this.userId, this.projectId, getAccessById, runtimeDepsService);
|
||||
return new AccessGetter(this.userId, this.projectId, getAccessById);
|
||||
}
|
||||
|
||||
async getCnameProxyService(): Promise<CnameProxyService> {
|
||||
|
||||
@@ -962,7 +962,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
return result;
|
||||
}
|
||||
|
||||
async batchDelete(ids: number[], userId?: number, projectId?: number) {
|
||||
async batchDelete(ids: number[], userId?: number, projectId?: number):Promise<number> {
|
||||
if (!isPlus()) {
|
||||
throw new NeedVIPException("此功能需要升级Certd专业版");
|
||||
}
|
||||
@@ -974,7 +974,9 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
await this.checkUserId(id, projectId, "projectId");
|
||||
}
|
||||
await this.delete(id);
|
||||
ids.push(id);
|
||||
}
|
||||
return ids.length
|
||||
}
|
||||
|
||||
async batchUpdateGroup(ids: number[], groupId: number, userId: any, projectId?: number) {
|
||||
|
||||
@@ -87,7 +87,7 @@ export class TemplateService extends BaseService<TemplateEntity> {
|
||||
};
|
||||
}
|
||||
|
||||
async batchDelete(ids: number[], userId: number, projectId?: number) {
|
||||
async batchDelete(ids: number[], userId: number, projectId?: number): Promise<number> {
|
||||
const where: any = {
|
||||
id: In(ids),
|
||||
};
|
||||
@@ -102,6 +102,7 @@ export class TemplateService extends BaseService<TemplateEntity> {
|
||||
const pipelineIds = list.map(item => item.pipelineId);
|
||||
await this.delete(ids);
|
||||
await this.pipelineService.batchDelete(pipelineIds, userId, projectId);
|
||||
return ids.length;
|
||||
}
|
||||
|
||||
async createPipelineByTemplate(body: PipelineEntity) {
|
||||
|
||||
@@ -270,6 +270,7 @@ export class PluginService extends BaseService<PluginEntity> {
|
||||
return;
|
||||
}
|
||||
await this.registerPlugin(item);
|
||||
await this.runtimeDepsService.refreshPluginDeps();
|
||||
}
|
||||
|
||||
async unRegisterById(id: any) {
|
||||
@@ -297,6 +298,7 @@ export class PluginService extends BaseService<PluginEntity> {
|
||||
} else {
|
||||
logger.warn(`不支持的插件类型:${item.pluginType}`);
|
||||
}
|
||||
await this.runtimeDepsService.refreshPluginDeps();
|
||||
}
|
||||
|
||||
async update(param: any) {
|
||||
|
||||
@@ -150,6 +150,11 @@ export class RuntimeDepsService {
|
||||
@Config("runtimeDeps.lazyDependencies")
|
||||
lazyDependencies: Record<string, string> = {};
|
||||
|
||||
/**
|
||||
* 从插件 registry 收集到的懒加载依赖,键为包名,值为版本范围
|
||||
*/
|
||||
pluginLazyDependencies: Record<string, string> = {};
|
||||
|
||||
@Inject()
|
||||
registryResolver!: NpmRegistryResolver;
|
||||
|
||||
@@ -339,7 +344,8 @@ export class RuntimeDepsService {
|
||||
|
||||
private async resolveMissingRuntimeSpecifier(specifier: string, runtimeError: any, logger?: ILogger) {
|
||||
const packageName = this.parsePackageName(specifier);
|
||||
const lazyRange = this.lazyDependencies?.[packageName];
|
||||
const mergedDeps = this.getMergedLazyDependencies();
|
||||
const lazyRange = mergedDeps[packageName];
|
||||
if (!lazyRange) {
|
||||
try {
|
||||
return this.resolveProjectSpecifier(specifier, runtimeError).resolved;
|
||||
@@ -565,6 +571,56 @@ export class RuntimeDepsService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 合并 package.json 的 lazyDependencies 和插件注册表收集到的 dependPackages
|
||||
* 插件依赖优先(同名时使用插件声明的版本)
|
||||
*/
|
||||
getMergedLazyDependencies(): Record<string, string> {
|
||||
return { ...this.lazyDependencies, ...this.pluginLazyDependencies };
|
||||
}
|
||||
|
||||
/**
|
||||
* 从所有插件注册表中收集 dependPackages,合并到 pluginLazyDependencies
|
||||
*/
|
||||
collectPluginDeps() {
|
||||
const registries: Array<{ registry: Registry<any>; keyFormatter?: (name: string) => string }> = [
|
||||
{ registry: pluginRegistry },
|
||||
{ registry: accessRegistry },
|
||||
{ registry: notificationRegistry },
|
||||
{ registry: dnsProviderRegistry },
|
||||
{ registry: addonRegistry },
|
||||
];
|
||||
|
||||
const deps: Record<string, string> = {};
|
||||
for (const { registry } of registries) {
|
||||
const defineList = registry.getDefineList();
|
||||
for (const define of defineList) {
|
||||
const dependPackages = (define as any).dependPackages as Record<string, string> | undefined;
|
||||
if (!dependPackages) {
|
||||
continue;
|
||||
}
|
||||
for (const [pkgName, range] of Object.entries(dependPackages)) {
|
||||
const existing = deps[pkgName];
|
||||
if (existing && !areRangesCompatible(existing, range)) {
|
||||
logger.warn(`懒加载依赖版本冲突: ${pkgName} => ${existing} vs ${range},保留已有版本`);
|
||||
continue;
|
||||
}
|
||||
deps[pkgName] = range;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.pluginLazyDependencies = deps;
|
||||
logger.info(`从插件注册表收集到 ${Object.keys(deps).length} 个懒加载依赖`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新插件懒加载依赖:收集所有插件的 dependPackages 到内存列表,实际安装延迟到 importRuntime 时触发
|
||||
*/
|
||||
async refreshPluginDeps() {
|
||||
this.collectPluginDeps();
|
||||
}
|
||||
|
||||
private readInstallState(statePath: string): any {
|
||||
if (!fs.existsSync(statePath)) {
|
||||
return null;
|
||||
|
||||
@@ -105,7 +105,7 @@ export class PaymentAlipay implements IPaymentProvider {
|
||||
}
|
||||
|
||||
private async createAlipaySdk() {
|
||||
const AlipaySdk = await import("alipay-sdk");
|
||||
const AlipaySdk = await this.access.importRuntime("alipay-sdk");
|
||||
|
||||
const alipaySdk = new AlipaySdk.AlipaySdk({
|
||||
appId: this.access.appId,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { IPaymentProvider, TradeEntity, UpdateTrade, UpdateTradeInfo } from "@certd/commercial-core";
|
||||
import WxPay from "wechatpay-node-v3";
|
||||
import dayjs from "dayjs";
|
||||
import { logger } from "@certd/basic"; // 支持使用require
|
||||
import { logger } from "@certd/basic";
|
||||
import { WxpayAccess } from "../../../plugins/plugin-plus/wxpay/access.js";
|
||||
export class PaymentWxpay implements IPaymentProvider {
|
||||
access: WxpayAccess;
|
||||
@@ -26,7 +25,7 @@ export class PaymentWxpay implements IPaymentProvider {
|
||||
* }
|
||||
*/
|
||||
|
||||
const pay = this.createSdk();
|
||||
const pay = await this.createSdk();
|
||||
|
||||
const result: any = await pay.query({ out_trade_no: tradeNo });
|
||||
logger.info(`微信支付查询订单返回:${JSON.stringify(result)}`);
|
||||
@@ -58,7 +57,7 @@ export class PaymentWxpay implements IPaymentProvider {
|
||||
async createOrder(trade: TradeEntity, opts: { bindUrl: string; clientIp: string }) {
|
||||
const notify_url = `${opts.bindUrl}/api/payment/notify/wxpay`;
|
||||
|
||||
const pay = this.createSdk();
|
||||
const pay = await this.createSdk();
|
||||
|
||||
const params = {
|
||||
description: trade.title,
|
||||
@@ -83,7 +82,9 @@ export class PaymentWxpay implements IPaymentProvider {
|
||||
};
|
||||
}
|
||||
|
||||
private createSdk() {
|
||||
private async createSdk() {
|
||||
const WxPayLib = await this.access.importRuntime("wechatpay-node-v3");
|
||||
const WxPay = WxPayLib.default;
|
||||
const pay = new WxPay({
|
||||
appid: this.access.appId,
|
||||
mchid: this.access.mchid,
|
||||
@@ -94,7 +95,7 @@ export class PaymentWxpay implements IPaymentProvider {
|
||||
}
|
||||
|
||||
async onNotify(notifyData: any, updateTrade: UpdateTrade) {
|
||||
const pay = this.createSdk();
|
||||
const pay = await this.createSdk();
|
||||
const { ciphertext, associated_data, nonce } = notifyData.resource;
|
||||
logger.info(`微信支付notify:${JSON.stringify(notifyData)}`);
|
||||
const key = this.access.key;
|
||||
|
||||
@@ -114,7 +114,7 @@ export class AsiaIspClient {
|
||||
|
||||
if (response.code !== "0") {
|
||||
this.logger.error(`接口请求失败: code=${response.code}, msg=${response.msg}`);
|
||||
const e= new Error(response.msg || "接口请求失败");
|
||||
const e = new Error(response.msg || "接口请求失败");
|
||||
// @ts-ignore
|
||||
e.errorCode = response.code;
|
||||
throw e;
|
||||
@@ -122,9 +122,9 @@ export class AsiaIspClient {
|
||||
|
||||
return response;
|
||||
} catch (error: any) {
|
||||
const response = error.response
|
||||
const response = error.response;
|
||||
if (response && response.data) {
|
||||
const e = new Error(response.data.msg || error.message || "接口请求失败");
|
||||
const e = new Error(response.data.msg || error.message || "接口请求失败");
|
||||
// @ts-ignore
|
||||
e.errorCode = response.data.code;
|
||||
throw e;
|
||||
@@ -245,7 +245,7 @@ export class AsiaIspClient {
|
||||
this.logger.info(`域名 ${req.domain} 已绑定该证书 ${req.certId},无需重复绑定`);
|
||||
return;
|
||||
}
|
||||
throw e
|
||||
throw e;
|
||||
}
|
||||
this.logger.info(`部署证书到域名成功: ${req.domain}, certId=${req.certId}`);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
|
||||
import FormData from "form-data";
|
||||
import { authenticator } from "otplib";
|
||||
|
||||
export interface ProxyHost {
|
||||
id: number;
|
||||
@@ -274,6 +273,7 @@ export class NginxProxyManagerAccess extends BaseAccess {
|
||||
|
||||
let code: string;
|
||||
try {
|
||||
const { authenticator } = await this.importRuntime("otplib");
|
||||
code = authenticator.generate(this.totpSecret);
|
||||
} catch (error) {
|
||||
throw this.describeError(error, "Generating TOTP code");
|
||||
|
||||
+9
-6
@@ -57,12 +57,12 @@ input:
|
||||
action: TestRequest
|
||||
helper: 测试登录并拉取代理主机列表。
|
||||
content: |
|
||||
const { BaseAccess } = await import("@certd/pipeline");
|
||||
const httpsModule = await import("node:https");
|
||||
const { URL } = await import("node:url");
|
||||
const axiosModule = await import("axios");
|
||||
const formDataModule = await import("form-data");
|
||||
const { authenticator } = await import("otplib");
|
||||
const runtimeImport = import;
|
||||
const { BaseAccess } = await runtimeImport("@certd/pipeline");
|
||||
const httpsModule = await runtimeImport("node:https");
|
||||
const { URL } = await runtimeImport("node:url");
|
||||
const axiosModule = await runtimeImport("axios");
|
||||
const formDataModule = await runtimeImport("form-data");
|
||||
|
||||
const https = httpsModule.default ?? httpsModule;
|
||||
const axios = axiosModule.default ?? axiosModule;
|
||||
@@ -114,6 +114,7 @@ content: |
|
||||
class NginxProxyManagerClient {
|
||||
constructor(options) {
|
||||
this.options = options;
|
||||
this.importFn = options.importFn;
|
||||
this.endpoint = normalizeEndpoint(options.endpoint);
|
||||
this.apiBaseUrl = `${this.endpoint}/api`;
|
||||
this.token = undefined;
|
||||
@@ -267,6 +268,7 @@ content: |
|
||||
|
||||
let code;
|
||||
try {
|
||||
const { authenticator } = await this.importFn("otplib");
|
||||
code = authenticator.generate(this.options.totpSecret);
|
||||
} catch (error) {
|
||||
throw describeError(error, "Generating TOTP code");
|
||||
@@ -327,6 +329,7 @@ content: |
|
||||
password: this.password,
|
||||
totpSecret: this.totpSecret || undefined,
|
||||
ignoreTls: this.ignoreTls === true,
|
||||
importFn: this.importRuntime.bind(this),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ export class OidcOauthProvider extends BaseAddon implements IOauthProvider {
|
||||
issuerUrl = "";
|
||||
|
||||
async getClient() {
|
||||
const client = await import("openid-client");
|
||||
const client = await this.importRuntime("openid-client");
|
||||
const server = new URL(this.issuerUrl); // Authorization Server's Issuer Identifier
|
||||
|
||||
const config = await client.discovery(server, this.clientId, this.clientSecretKey);
|
||||
|
||||
@@ -14,7 +14,8 @@ export class VolcengineCdnClient {
|
||||
if (this.service) {
|
||||
return this.service;
|
||||
}
|
||||
const { cdn } = await this.opts.access.importRuntime("@volcengine/openapi");
|
||||
const importRuntime = this.opts.importRuntime || this.opts.access.importRuntime.bind(this.opts.access);
|
||||
const { cdn } = await importRuntime("@volcengine/openapi");
|
||||
const service = new cdn.CdnService();
|
||||
// 设置ak、sk
|
||||
service.setAccessKeyId(this.opts.access.accessKeyId);
|
||||
|
||||
@@ -21,7 +21,8 @@ export class VolcengineDnsClient {
|
||||
}
|
||||
|
||||
async doRequest(req: VolcengineReq) {
|
||||
const { Signer } = await this.opts.access.importRuntime("@volcengine/openapi");
|
||||
const importRuntime = this.opts.importRuntime || this.opts.access.importRuntime.bind(this.opts.access);
|
||||
const { Signer } = await importRuntime("@volcengine/openapi");
|
||||
|
||||
// http request data
|
||||
const openApiRequestData: any = {
|
||||
|
||||
+41
-48
@@ -78,6 +78,7 @@ export class VolcengineDeployToVOD extends AbstractTaskPlugin {
|
||||
options: [
|
||||
{ value: "play", label: "点播加速域名" },
|
||||
{ value: "image", label: "封面加速域名" },
|
||||
{ value: "third", label: "自定义源站" },
|
||||
],
|
||||
},
|
||||
value: "play",
|
||||
@@ -85,29 +86,12 @@ export class VolcengineDeployToVOD extends AbstractTaskPlugin {
|
||||
})
|
||||
domainType!: string;
|
||||
|
||||
@TaskInput({
|
||||
title: "源站类型",
|
||||
helper: "选择源站类型",
|
||||
value: 1,
|
||||
component: {
|
||||
name: "a-select",
|
||||
vModel: "value",
|
||||
options: [
|
||||
{ value: 1, label: "点播源站" },
|
||||
{ value: 2, label: "自定义源站" },
|
||||
],
|
||||
helper: "注意:封面加速域名不支持自定义源站",
|
||||
},
|
||||
required: false,
|
||||
})
|
||||
sourceStationType!: number | undefined;
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: "域名",
|
||||
helper: "选择要部署证书的域名\n需要先在域名管理页面进行证书中心访问授权(即点击去配置SSL证书)",
|
||||
action: VolcengineDeployToVOD.prototype.onGetDomainList.name,
|
||||
watches: ["certDomains", "accessId", "spaceName", "domainType", "sourceStationType"],
|
||||
watches: ["certDomains", "accessId", "spaceName", "domainType"],
|
||||
required: true,
|
||||
})
|
||||
)
|
||||
@@ -124,19 +108,25 @@ export class VolcengineDeployToVOD extends AbstractTaskPlugin {
|
||||
|
||||
const access = await this.getAccess<VolcengineAccess>(this.accessId);
|
||||
const certId = await this.uploadOrGetCertId(access);
|
||||
await this.ctx.utils.sleep(3000);
|
||||
const domainTypeMapping: Record<string, string> = {
|
||||
play: "vod_play",
|
||||
image: "vod_image",
|
||||
};
|
||||
const apiDomainType = domainTypeMapping[this.domainType] || this.domainType;
|
||||
|
||||
const service = await this.getVodService({ version: "2023-07-01", region: this.regionId });
|
||||
const service = await this.getVodService({ version: "2026-01-01", region: this.regionId });
|
||||
const domains = Array.isArray(this.domainList) ? this.domainList : [this.domainList];
|
||||
for (const domain of domains) {
|
||||
this.logger.info(`开始部署域名${domain}证书`);
|
||||
await service.request({
|
||||
action: "UpdateDomainConfig",
|
||||
action: "UpdateVodDomainConfig",
|
||||
method: "POST",
|
||||
body: {
|
||||
SpaceName: this.spaceName,
|
||||
DomainType: this.domainType,
|
||||
Domain: domain,
|
||||
Config: {
|
||||
DomainType: apiDomainType,
|
||||
UpdateCdnConfigParam: {
|
||||
Domain: domain,
|
||||
HTTPS: {
|
||||
Switch: true,
|
||||
CertInfo: {
|
||||
@@ -221,38 +211,41 @@ export class VolcengineDeployToVOD extends AbstractTaskPlugin {
|
||||
if (!this.spaceName) {
|
||||
throw new Error("请先选择空间名称");
|
||||
}
|
||||
const service = await this.getVodService({ version: "2023-01-01", region: this.regionId });
|
||||
const service = await this.getVodService({ version: "2026-01-01", region: this.regionId });
|
||||
|
||||
const query: Record<string, any> = {
|
||||
SpaceName: this.spaceName,
|
||||
DomainType: this.domainType,
|
||||
const domainTypeMapping: Record<string, string> = {
|
||||
play: "vod_play",
|
||||
image: "vod_image",
|
||||
};
|
||||
if (this.sourceStationType !== undefined) {
|
||||
query.SourceStationType = this.sourceStationType;
|
||||
}
|
||||
const apiDomainType = domainTypeMapping[this.domainType] || this.domainType;
|
||||
|
||||
const body: Record<string, any> = {
|
||||
SpaceName: this.spaceName,
|
||||
ListCdnDomainsParam: {
|
||||
PageNum: 1,
|
||||
PageSize: 100,
|
||||
},
|
||||
};
|
||||
if (apiDomainType) {
|
||||
body.DomainType = apiDomainType;
|
||||
}
|
||||
const res = await service.request({
|
||||
action: "ListDomain",
|
||||
query,
|
||||
action: "ListVodDomains",
|
||||
method: "POST",
|
||||
body,
|
||||
});
|
||||
|
||||
const instances = res.Result?.PlayInstanceInfo?.ByteInstances;
|
||||
if (!instances || instances.length === 0) {
|
||||
throw new Error("找不到域名,您也可以手动输入域名");
|
||||
}
|
||||
const list = [];
|
||||
for (const item of instances) {
|
||||
if (item.Domains && item.Domains.length > 0) {
|
||||
for (const domain of item.Domains) {
|
||||
if (domain.Domain) {
|
||||
list.push({
|
||||
value: domain.Domain,
|
||||
label: domain.Domain,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
const domains = res.Result?.VodInfo?.Domains;
|
||||
if (!domains || domains.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const list = domains.map((item: any) => {
|
||||
return {
|
||||
value: item.Domain,
|
||||
label: item.Domain,
|
||||
domain : item.Domain,
|
||||
};
|
||||
});
|
||||
return this.ctx.utils.options.buildGroupOptions(list, this.certDomains);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { VolcengineAccess } from "./access.js";
|
||||
import { HttpClient, ILogger } from "@certd/basic";
|
||||
import { ImportRuntime } from "@certd/pipeline";
|
||||
|
||||
export type VolcengineOpts = {
|
||||
access: VolcengineAccess;
|
||||
logger: ILogger;
|
||||
http: HttpClient;
|
||||
importRuntime?: ImportRuntime;
|
||||
};
|
||||
|
||||
export class VolcengineClient {
|
||||
@@ -140,7 +142,8 @@ export class VolcengineClient {
|
||||
}
|
||||
|
||||
async getTOSService(opts: { region?: string }) {
|
||||
const { TosClient } = await this.opts.access.importRuntime("@volcengine/tos-sdk");
|
||||
const importRuntime = this.opts.importRuntime || this.opts.access.importRuntime.bind(this.opts.access);
|
||||
const { TosClient } = await importRuntime("@volcengine/tos-sdk");
|
||||
|
||||
const client = new TosClient({
|
||||
accessKeyId: this.opts.access.accessKeyId,
|
||||
@@ -169,7 +172,8 @@ export class VolcengineClient {
|
||||
if (this.CommonService) {
|
||||
return this.CommonService;
|
||||
}
|
||||
const { Service } = await this.opts.access.importRuntime("@volcengine/openapi");
|
||||
const importRuntime = this.opts.importRuntime || this.opts.access.importRuntime.bind(this.opts.access);
|
||||
const { Service } = await importRuntime("@volcengine/openapi");
|
||||
|
||||
class CommonService extends Service {
|
||||
Generic: any;
|
||||
|
||||
@@ -22,6 +22,7 @@ export class VolcengineDnsProvider extends AbstractDnsProvider {
|
||||
access: this.access,
|
||||
logger: this.logger,
|
||||
http: this.http,
|
||||
importRuntime: this.importRuntime.bind(this),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
20:04
|
||||
02:48
|
||||
|
||||
@@ -1 +1 @@
|
||||
21:20
|
||||
03:41
|
||||
|
||||
Reference in New Issue
Block a user