Compare commits

...

21 Commits

Author SHA1 Message Date
xiaojunnuo
7feece597a v1.35.5 2025-06-20 17:14:13 +08:00
xiaojunnuo
fa16c782ca build: prepare to build 2025-06-20 17:10:08 +08:00
xiaojunnuo
a03d0b6a4a chore: 2025-06-20 17:09:59 +08:00
xiaojunnuo
dff76b8912 build: prepare to build 2025-06-20 17:07:59 +08:00
xiaojunnuo
cffea9a9bc chore: 2025-06-20 17:07:26 +08:00
xiaojunnuo
43fee42198 perf: 首次打开任务日志查看页面,自动滚动到底部 2025-06-20 17:06:34 +08:00
xiaojunnuo
5cd3968929 fix: 腾讯云授权支持设置是否国际站,部署到EO插件支持国际站 2025-06-20 16:58:20 +08:00
xiaojunnuo
65dcae79f8 fix: 修复邮箱包含.号校验失败的bug 2025-06-20 16:45:29 +08:00
xiaojunnuo
e11b3becfd perf: 支持批量修改通知和定时 2025-06-18 12:29:43 +08:00
xiaojunnuo
73fa937f5c chore: 2025-06-17 13:39:40 +08:00
xiaojunnuo
6ebe2e54ac chore: 2025-06-16 23:57:11 +08:00
xiaojunnuo
fb29a11cc9 build: publish 2025-06-13 12:24:08 +08:00
xiaojunnuo
a9e06cbf92 build: trigger build image 2025-06-13 12:23:51 +08:00
xiaojunnuo
93017c044d v1.35.4 2025-06-13 12:22:12 +08:00
xiaojunnuo
c223ddbb9a build: prepare to build 2025-06-13 12:19:21 +08:00
xiaojunnuo
f00aeacb8b perf: 支持s3 access做测试 2025-06-13 12:18:26 +08:00
xiaojunnuo
5b49071d6b Merge remote-tracking branch 'origin/v2-dev' into v2-dev 2025-06-13 09:53:30 +08:00
xiaojunnuo
17053a882b chore: 2025-06-13 09:53:07 +08:00
xiaojunnuo
5e723d31a4 chore: 2025-06-13 00:40:54 +08:00
xiaojunnuo
3283bd8b75 build: publish 2025-06-13 00:40:05 +08:00
xiaojunnuo
770d3c0015 build: trigger build image 2025-06-13 00:39:33 +08:00
55 changed files with 688 additions and 189 deletions

View File

@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
### Bug Fixes
* 腾讯云授权支持设置是否国际站部署到EO插件支持国际站 ([5cd3968](https://github.com/certd/certd/commit/5cd3968929acef333cf30d3b20cf21cea6c82c5f))
* 修复邮箱包含.号校验失败的bug ([65dcae7](https://github.com/certd/certd/commit/65dcae79f8faa7a6cb425e10a0fdb6758b0719f3))
### Performance Improvements
* 首次打开任务日志查看页面,自动滚动到底部 ([43fee42](https://github.com/certd/certd/commit/43fee42198e8697185b427b1fa3eb79409603393))
* 支持批量修改通知和定时 ([e11b3be](https://github.com/certd/certd/commit/e11b3becfd4abe6547e84d09adc38ebd6e1c4b87))
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes

View File

@@ -1,11 +1,9 @@
# Certd
Certd 是一个免费全自动申请和自动部署更新SSL证书管理系统。
后缀d取自linux守护进程的命名风格意为证书守护进程。
Certd® 是一个免费全自动证书管理系统,让你的网站证书永不过期
首创流水线申请部署证书模式,已被多个项目“借鉴”,被抄也是一种成功。
> 首创流水线模式自动申请和部署证书,已被多个项目“借鉴”,被抄也是一种成功。
关键字:证书自动申请、证书自动更新、证书自动续期、证书自动续签、证书管理工具
>后缀d取自linux守护进程的命名风格意为证书守护进程。
> 关于证书续期:
>* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。
@@ -15,6 +13,7 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
> 流水线数量现已调整为无限制,欢迎大家使用
## 一、特性
本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。
@@ -34,9 +33,6 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
![](./docs/images/intro/intro.svg)
## 二、在线体验
官方Demo地址自助注册后体验

View File

@@ -1 +1 @@
23:58
12:23

View File

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

View File

@@ -10,15 +10,15 @@
* 登录宝塔面板,在菜单栏中点击 Docker首次进入会提示安装Docker服务点击立即安装按提示完成安装
### 2、部署certd
#### 2.1 应用商店一键部署【推荐】
以下两种方式人选一种:
#### 2.1 应用商店方式一键部署【推荐】
* 在宝塔Docker应用商店中找到`certd`(要先点右上角更新应用)
* 点击安装,配置域名等基本信息即可完成安装
> 需要宝塔9.2.0及以上版本才支持
#### 2.2 容器编排部署
#### 2.2 容器编排方式部署
1. 打开`docker-compose.yaml`,整个内容复制下来
https://gitee.com/certd/certd/raw/v2/docker/run/docker-compose.yaml
@@ -43,12 +43,15 @@ admin/123456
## 三、如何升级
宝塔升级certd非常简单
`docker`->`容器编排`->`左侧选择Certd`->`更新镜像`
打开容器页面: `docker`->`容器编排`->`左侧选择Certd`->`更新镜像`
![img.png](./images/upgrade.png)
## 四、数据备份
部署方式不同,数据保存位置不同
### 4.1 应用商店部署方式
点击进入安装路径,数据保存在`./data`目录下,可以手动备份
@@ -62,7 +65,6 @@ admin/123456
数据默认保存在`/data/certd`目录下,可以手动备份
### 4.3 自动备份
> 建议配置一条 [数据库备份流水线](../../use/backup/),自动备份

View File

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

View File

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

View File

@@ -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.35.5](https://github.com/publishlab/node-acme-client/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/acme-client
## [1.35.4](https://github.com/publishlab/node-acme-client/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/acme-client
## [1.35.3](https://github.com/publishlab/node-acme-client/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/acme-client

View File

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

View File

@@ -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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/basic
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/basic
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/basic

View File

@@ -1 +1 @@
00:27
17:10

View File

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

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
### Performance Improvements
* 支持批量修改通知和定时 ([e11b3be](https://github.com/certd/certd/commit/e11b3becfd4abe6547e84d09adc38ebd6e1c4b87))
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes

View File

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

View File

@@ -37,6 +37,7 @@ export type AccessContext = {
http: HttpClient;
logger: ILogger;
utils: typeof utils;
accessService: IAccessService;
};
export abstract class BaseAccess implements IAccess {

View File

@@ -1,5 +1,5 @@
// src/decorator/memoryCache.decorator.ts
import { AccessContext, AccessDefine, AccessInputDefine } from "./api.js";
import { AccessContext, AccessDefine, AccessInputDefine, IAccessService } from "./api.js";
import { Decorator } from "../decorator/index.js";
import * as _ from "lodash-es";
import { accessRegistry } from "./registry.js";
@@ -41,7 +41,7 @@ export function AccessInput(input?: AccessInputDefine): PropertyDecorator {
};
}
export async function newAccess(type: string, input: any, 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`);
@@ -58,6 +58,7 @@ export async function newAccess(type: string, input: any, ctx?: AccessContext) {
http,
logger,
utils,
accessService,
};
}
access.setCtx(ctx);

View File

@@ -452,12 +452,12 @@ export class Executor {
continue;
}
if (notification.type === "email") {
if (notification.type === "email" && notification.options?.receivers) {
try {
await this.options.emailService?.send({
subject,
content,
receivers: notification.options.receivers,
receivers: notification.options?.receivers,
});
} catch (e) {
logger.error("send email error", e);

View File

@@ -52,7 +52,9 @@ export type Stage = Runnable & {
export type Trigger = {
id: string;
title: string;
cron: string;
props: {
cron: string;
};
type: string;
};
@@ -78,14 +80,13 @@ export type EmailOptions = {
receivers: string[];
};
export type NotificationWhen = "error" | "success" | "turnToSuccess" | "start";
export type NotificationType = "email" | "url";
export type NotificationType = "email" | "other";
export type Notification = {
type: NotificationType;
when: NotificationWhen[];
options: EmailOptions;
options?: EmailOptions;
notificationId: number;
title: string;
subType: string;
};
export type Pipeline = Runnable & {

View File

@@ -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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/lib-huawei
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/lib-huawei
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-huawei

View File

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

View File

@@ -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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/lib-iframe
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/lib-iframe
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-iframe

View File

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

View File

@@ -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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/jdcloud
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/jdcloud
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/jdcloud

View File

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

View File

@@ -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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/lib-k8s
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/lib-k8s
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-k8s

View File

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

View File

@@ -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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/lib-server
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-server

View File

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

View File

@@ -1,16 +1,16 @@
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { BaseService, PageReq, PermissionException, ValidateException } from '../../../index.js';
import { AccessEntity } from '../entity/access.js';
import { AccessDefine, accessRegistry, newAccess } from '@certd/pipeline';
import { EncryptService } from './encrypt-service.js';
import {Inject, Provide, Scope, ScopeEnum} from '@midwayjs/core';
import {InjectEntityModel} from '@midwayjs/typeorm';
import {Repository} from 'typeorm';
import {AccessGetter, BaseService, PageReq, PermissionException, ValidateException} from '../../../index.js';
import {AccessEntity} from '../entity/access.js';
import {AccessDefine, accessRegistry, newAccess} from '@certd/pipeline';
import {EncryptService} from './encrypt-service.js';
/**
* 授权
*/
@Provide()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
@Scope(ScopeEnum.Request, {allowDowngrade: true})
export class AccessService extends BaseService<AccessEntity> {
@InjectEntityModel(AccessEntity)
repository: Repository<AccessEntity>;
@@ -95,6 +95,7 @@ export class AccessService extends BaseService<AccessEntity> {
param.encryptSetting = JSON.stringify(encryptSetting);
param.setting = JSON.stringify(json);
}
/**
* 修改
* @param param 数据
@@ -140,7 +141,8 @@ export class AccessService extends BaseService<AccessEntity> {
id: entity.id,
...setting,
};
return await newAccess(entity.type, input);
const accessGetter = new AccessGetter(userId, this.getById.bind(this));
return await newAccess(entity.type, input,accessGetter);
}
async getById(id: any, userId: number): Promise<any> {

View File

@@ -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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

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

View File

@@ -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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/plugin-cert
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/plugin-cert
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/plugin-cert

View File

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

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
### Bug Fixes
* 腾讯云授权支持设置是否国际站部署到EO插件支持国际站 ([5cd3968](https://github.com/certd/certd/commit/5cd3968929acef333cf30d3b20cf21cea6c82c5f))
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/plugin-lib

View File

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

View File

@@ -54,6 +54,9 @@ export default class S3OssClientImpl extends BaseOssClient<S3Access> {
Prefix: dirKey, // The name of the object. For example, 'sample_upload.txt'.
};
const res = await this.client.send(new ListObjectsCommand({ ...params }));
if (!res.Contents) {
return [];
}
return res.Contents.map(item => {
return {
path: item.Key,

View File

@@ -1,4 +1,6 @@
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
import { ossClientFactory } from "../oss/index.js";
import S3OssClientImpl from "../oss/impls/s3.js";
/**
* 这个注解将注册一个授权配置
@@ -82,6 +84,32 @@ export class S3Access extends BaseAccess {
required: true,
})
bucket!: string;
@AccessInput({
title: "测试",
component: {
name: "api-test",
action: "TestRequest",
},
helper: "点击测试接口是否正常",
})
testRequest = true;
async onTestRequest() {
const client: S3OssClientImpl = await ossClientFactory.createOssClientByType("s3", {
access: this,
rootDir: "",
ctx: {
accessService: this.ctx.accessService,
logger: this.ctx.logger,
utils: this.ctx.utils,
},
});
await client.listDir("/");
return "ok";
}
}
new S3Access();

View File

@@ -8,8 +8,7 @@ import { IsAccess, AccessInput, BaseAccess } from "@certd/pipeline";
export class TencentAccess extends BaseAccess {
@AccessInput({
title: "secretId",
helper:
"使用对应的插件需要有对应的权限,比如上传证书,需要证书管理权限;部署到clb需要clb相关权限\n前往[密钥管理](https://console.cloud.tencent.com/cam/capi)进行创建",
helper: "使用对应的插件需要有对应的权限,比如上传证书,需要证书管理权限;部署到clb需要clb相关权限\n前往[密钥管理](https://console.cloud.tencent.com/cam/capi)进行创建",
component: {
placeholder: "secretId",
},
@@ -25,4 +24,29 @@ export class TencentAccess extends BaseAccess {
rules: [{ required: true, message: "该项必填" }],
})
secretKey = "";
@AccessInput({
title: "站点类型",
value: "cn",
component: {
name: "a-select",
options: [
{
label: "国内站",
value: "cn",
},
{
label: "国际站",
value: "intl",
},
],
},
encrypt: true,
rules: [{ required: true, message: "该项必填" }],
})
accountType: string;
isIntl() {
return this.accountType === "intl";
}
}

View File

@@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
### Bug Fixes
* 修复邮箱包含.号校验失败的bug ([65dcae7](https://github.com/certd/certd/commit/65dcae79f8faa7a6cb425e10a0fdb6758b0719f3))
### Performance Improvements
* 首次打开任务日志查看页面,自动滚动到底部 ([43fee42](https://github.com/certd/certd/commit/43fee42198e8697185b427b1fa3eb79409603393))
* 支持批量修改通知和定时 ([e11b3be](https://github.com/certd/certd/commit/e11b3becfd4abe6547e84d09adc38ebd6e1c4b87))
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/ui-client
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes

View File

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

View File

@@ -54,7 +54,9 @@ onMounted(async () => {
async function addItem() {
const email = newEmail.value;
//验证邮箱格式
if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(newEmail.value)) {
const regExp =
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/;
if (!regExp.test(email)) {
notification.error({
message: "请填写正确的邮箱地址",
});

View File

@@ -84,6 +84,23 @@ export async function BatchUpdateGroup(pipelineIds: number[], groupId: number):
});
}
export async function BatchUpdateTrigger(pipelineIds: number[], trigger: any): Promise<void> {
return await request({
url: apiPrefix + "/batchUpdateTrigger",
method: "post",
data: { ids: pipelineIds, trigger },
});
}
export async function BatchUpdateNotificaiton(pipelineIds: number[], notification: any): Promise<void> {
return await request({
url: apiPrefix + "/batchUpdateNotification",
method: "post",
data: { ids: pipelineIds, notification },
});
}
export async function BatchDelete(pipelineIds: number[]): Promise<void> {
return await request({
url: apiPrefix + "/batchDelete",
@@ -99,6 +116,8 @@ export async function BatchRerun(pipelineIds: number[]): Promise<void> {
});
}
export async function GetFiles(pipelineId: number) {
return await request({
url: historyApiPrefix + "/files",

View File

@@ -0,0 +1,96 @@
<template>
<fs-button icon="mdi:format-list-group" type="link" text="修改通知" @click="openFormDialog"></fs-button>
</template>
<script setup lang="ts">
import * as api from "../api";
import { useFormWrapper } from "@fast-crud/fast-crud";
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
import { ref } from "vue";
const props = defineProps<{
selectedRowKeys: any[];
}>();
const emit = defineEmits<{
change: any;
}>();
async function batchUpdateRequest(form: any) {
/**
* type: NotificationType;
* when: NotificationWhen[];
* options?: EmailOptions;
* notificationId: number;
* title: string;
*/
await api.BatchUpdateNotificaiton(props.selectedRowKeys, {
type: "other",
title: form.title || "通知",
when: form.when,
notificationId: form.notificationId,
});
emit("change");
}
const { openCrudFormDialog } = useFormWrapper();
async function openFormDialog() {
const crudOptions: any = {
columns: {
when: {
title: "触发时机",
form: {
value: ["error", "turnToSuccess"],
component: {
name: "a-select",
vModel: "value",
mode: "multiple",
options: [
{ value: "start", label: "开始时" },
{ value: "success", label: "成功时" },
{ value: "turnToSuccess", label: "失败转成功时" },
{ value: "error", label: "失败时" },
],
},
helper: `建议仅选择'失败时'和'失败转成功'两种即可`,
rules: [{ required: true, message: "此项必填" }],
},
},
notificationId: {
title: "通知配置",
form: {
component: {
name: NotificationSelector,
on: {
selectedChange({ form, $event }: any) {
form.title = $event?.name || "通知";
},
},
},
helper: "请选择通知方式",
rules: [{ required: true, message: "此项必填" }],
},
},
},
form: {
mode: "edit",
//@ts-ignore
async doSubmit({ form }) {
await batchUpdateRequest(form);
},
col: {
span: 22,
},
labelCol: {
style: {
width: "100px",
},
},
wrapper: {
title: "批量修改通知",
width: 600,
},
},
} as any;
await openCrudFormDialog({ crudOptions });
}
</script>

View File

@@ -0,0 +1,62 @@
<template>
<fs-button icon="mdi:format-list-group" type="link" text="修改定时" @click="openFormDialog"></fs-button>
</template>
<script setup lang="ts">
import * as api from "../api";
import { useFormWrapper } from "@fast-crud/fast-crud";
const props = defineProps<{
selectedRowKeys: any[];
}>();
const emit = defineEmits<{
change: any;
}>();
async function batchUpdateRequest(form: any) {
await api.BatchUpdateTrigger(props.selectedRowKeys, {
title: "定时触发",
type: "timer",
props: form.props,
});
emit("change");
}
const { openCrudFormDialog } = useFormWrapper();
async function openFormDialog() {
const crudOptions: any = {
columns: {
"props.cron": {
title: "定时",
form: {
component: {
name: "cron-editor",
vModel: "modelValue",
},
rules: [{ required: true, message: "请选择定时Cron" }],
},
},
},
form: {
mode: "edit",
//@ts-ignore
async doSubmit({ form }) {
await batchUpdateRequest(form);
},
col: {
span: 22,
},
labelCol: {
style: {
width: "100px",
},
},
wrapper: {
title: "批量修改定时",
width: 600,
},
},
} as any;
await openCrudFormDialog({ crudOptions });
}
</script>

View File

@@ -7,9 +7,11 @@
<div v-if="selectedRowKeys.length > 0" class="batch-actions">
<div class="batch-actions-inner">
<span> 已选择 {{ selectedRowKeys.length }} </span>
<fs-button icon="ion:trash-outline" class="color-green" type="link" text="批量删除" @click="batchDelete"></fs-button>
<change-group class="color-green" :selected-row-keys="selectedRowKeys" @change="groupChanged"></change-group>
<fs-button icon="ion:trash-outline" class="color-red" type="link" text="批量删除" @click="batchDelete"></fs-button>
<fs-button icon="icon-park-outline:replay-music" class="need-plus" type="link" text="强制重新运行" @click="batchRerun"></fs-button>
<change-group class="color-green" :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-group>
<change-notification class="color-green" :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-notification>
<change-trigger class="color-green" :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-trigger>
</div>
</div>
<template #actionbar-right> </template>
@@ -26,8 +28,10 @@ import { dict, useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import PiCertdForm from "./certd-form/index.vue";
import ChangeGroup from "./components/change-group.vue";
import ChangeTrigger from "./components/change-trigger.vue";
import { Modal, notification } from "ant-design-vue";
import * as api from "./api";
import ChangeNotification from "/@/views/certd/pipeline/components/change-notification.vue";
defineOptions({
name: "PipelineManager",
@@ -55,7 +59,7 @@ onActivated(async () => {
await crudExpose.doRefresh();
});
function groupChanged() {
function batchFinished() {
crudExpose.doRefresh();
selectedRowKeys.value = [];
}

View File

@@ -24,17 +24,17 @@
disabled: !editMode,
options: [
{ value: 'email', label: '邮件' },
{ value: 'other', label: '其他通知方式' }
]
{ value: 'other', label: '其他通知方式' },
],
},
rules: [{ required: true, message: '此项必填' }]
rules: [{ required: true, message: '此项必填' }],
}"
/>
<fs-form-item
v-model="currentNotification.when"
:item="{
title: '触发时机',
key: 'type',
key: 'when',
value: ['error'],
component: {
name: 'a-select',
@@ -45,11 +45,11 @@
{ value: 'start', label: '开始时' },
{ value: 'success', label: '成功时' },
{ value: 'turnToSuccess', label: '失败转成功时' },
{ value: 'error', label: '失败时' }
]
{ value: 'error', label: '失败时' },
],
},
helper: `建议仅选择'失败时'和'失败转成功'两种即可`,
rules: [{ required: true, message: '此项必填' }]
rules: [{ required: true, message: '此项必填' }],
}"
/>
<pi-notification-form-email v-if="currentNotification.type === 'email'" ref="optionsRef" v-model:options="currentNotification.options"></pi-notification-form-email>
@@ -59,14 +59,14 @@
v-model="currentNotification.notificationId"
:item="{
title: '通知配置',
key: 'type',
key: 'notificationId',
component: {
disabled: !editMode,
name: NotificationSelector,
onSelectedChange
onSelectedChange,
},
helper: '请选择通知方式',
rules: [{ required: true, message: '此项必填' }]
rules: [{ required: true, message: '此项必填' }],
}"
/>
</a-form>
@@ -96,8 +96,8 @@ export default {
props: {
editMode: {
type: Boolean,
default: true
}
default: true,
},
},
emits: ["update"],
setup(props: any, context: any) {
@@ -118,23 +118,23 @@ export default {
{
type: "string",
required: true,
message: "请选择类型"
}
message: "请选择类型",
},
],
when: [
{
type: "string",
required: true,
message: "请选择通知时机"
}
message: "请选择通知时机",
},
],
notificationId: [
{
type: "number",
required: true,
message: "请选择通知配置"
}
]
message: "请选择通知配置",
},
],
});
const notificationDrawerShow = () => {
@@ -195,7 +195,7 @@ export default {
async onOk() {
callback.value("delete");
notificationDrawerClose();
}
},
});
};
@@ -222,21 +222,21 @@ export default {
notificationDelete,
rules,
blankFn,
optionsRef
optionsRef,
};
}
return {
...useNotificationForm(),
labelCol: { span: 6 },
wrapperCol: { span: 16 }
wrapperCol: { span: 16 },
};
},
computed: {
NotificationSelector() {
return NotificationSelector;
}
}
},
},
};
</script>

View File

@@ -119,6 +119,31 @@ export default {
logs: [],
});
}
async function scrollBottom(node: any, force = false) {
let el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
if (!el) {
return;
}
//判断当前是否在底部
let isBottom = true;
if (el) {
isBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 5;
}
if (force) {
isBottom = true;
}
await nextTick();
el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
//如果在底部则滚动到底部
if (isBottom && el) {
el?.scrollTo({
top: el.scrollHeight,
behavior: "smooth",
});
}
}
for (let node of nodes) {
if (currentHistory?.value?.logs != null) {
node.logs = computed(() => {
@@ -146,30 +171,12 @@ export default {
return node.logs.value.length;
},
async () => {
let el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
if (!el) {
return;
}
//判断当前是否在底部
let isBottom = true;
if (el) {
isBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 5;
console.log("isBottom", isBottom, el.scrollHeight, el.scrollTop, el.clientHeight);
}
await nextTick();
el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
//如果在底部则滚动到底部
if (isBottom && el) {
el?.scrollTo({
top: el.scrollHeight,
behavior: "smooth",
});
}
},
{
immediate: true,
await scrollBottom(node);
}
);
nextTick(() => {
scrollBottom(node, true);
});
}
}
@@ -178,8 +185,6 @@ export default {
}
detail.value = { nodes };
console.log("nodes", nodes);
};
const taskViewClose = () => {

View File

@@ -1,12 +1,5 @@
<template>
<a-drawer
v-model:open="triggerDrawerVisible"
placement="right"
:closable="true"
width="650px"
class="pi-trigger-form"
@after-open-change="triggerDrawerOnAfterVisibleChange"
>
<a-drawer v-model:open="triggerDrawerVisible" placement="right" :closable="true" width="650px" class="pi-trigger-form" @after-open-change="triggerDrawerOnAfterVisibleChange">
<template #title>
<div>
编辑触发器
@@ -26,9 +19,9 @@
component: {
name: 'a-input',
vModel: 'value',
disabled: !editMode
disabled: !editMode,
},
rules: [{ required: true, message: '此项必填' }]
rules: [{ required: true, message: '此项必填' }],
}"
/>
@@ -42,9 +35,9 @@
name: 'a-select',
vModel: 'value',
disabled: !editMode,
options: [{ value: 'timer', label: '定时' }]
options: [{ value: 'timer', label: '定时' }],
},
rules: [{ required: true, message: '此项必填' }]
rules: [{ required: true, message: '此项必填' }],
}"
/>
@@ -56,10 +49,10 @@
component: {
disabled: !editMode,
name: 'cron-editor',
vModel: 'modelValue'
vModel: 'modelValue',
},
helper: '点击上面的按钮,选择每天几点定时执行。\n建议设置为每天触发一次证书未到期之前任务会跳过不会重复执行',
rules: [{ required: true, message: '此项必填' }]
rules: [{ required: true, message: '此项必填' }],
}"
/>
</a-form>
@@ -84,8 +77,8 @@ export default {
props: {
editMode: {
type: Boolean,
default: true
}
default: true,
},
},
emits: ["update"],
setup(props, context) {
@@ -105,9 +98,9 @@ export default {
{
type: "string",
required: true,
message: "请输入名称"
}
]
message: "请输入名称",
},
],
});
const triggerDrawerShow = () => {
@@ -117,7 +110,7 @@ export default {
triggerDrawerVisible.value = false;
};
const triggerDrawerOnAfterVisibleChange = (val) => {
const triggerDrawerOnAfterVisibleChange = val => {
console.log("triggerDrawerOnAfterVisibleChange", val);
};
@@ -128,7 +121,7 @@ export default {
triggerDrawerShow();
};
const triggerAdd = (emit) => {
const triggerAdd = emit => {
mode.value = "add";
const trigger = { id: nanoid(), title: "定时触发", type: "timer", props: {} };
triggerOpen(trigger, emit);
@@ -144,7 +137,7 @@ export default {
triggerOpen(trigger, emit);
};
const triggerSave = async (e) => {
const triggerSave = async e => {
console.log("currentTriggerSave", currentTrigger.value);
try {
await triggerFormRef.value.validate();
@@ -164,7 +157,7 @@ export default {
async onOk() {
callback.value("delete");
triggerDrawerClose();
}
},
});
};
@@ -185,16 +178,16 @@ export default {
triggerSave,
triggerDelete,
rules,
blankFn
blankFn,
};
}
return {
...useTriggerForm(),
labelCol: { span: 6 },
wrapperCol: { span: 16 }
wrapperCol: { span: 16 },
};
}
},
};
</script>

View File

@@ -26,4 +26,4 @@ typeorm:
account:
server:
baseUrl: 'http://127.0.0.1:1017/subject'
baseUrl: 'http://localhost:1017/subject'

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
### Bug Fixes
* 腾讯云授权支持设置是否国际站部署到EO插件支持国际站 ([5cd3968](https://github.com/certd/certd/commit/5cd3968929acef333cf30d3b20cf21cea6c82c5f))
### Performance Improvements
* 支持批量修改通知和定时 ([e11b3be](https://github.com/certd/certd/commit/e11b3becfd4abe6547e84d09adc38ebd6e1c4b87))
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes

View File

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

View File

@@ -1,5 +1,5 @@
import {ALL, Body, Controller, Inject, Post, Provide} from '@midwayjs/core';
import {AccessService, BaseController, Constants} from '@certd/lib-server';
import {AccessGetter, AccessService, BaseController, Constants} from '@certd/lib-server';
import {
AccessRequestHandleReq,
IAccessService,
@@ -33,6 +33,7 @@ export class HandleController extends BaseController {
@Post('/access', { summary: Constants.per.authOnly })
async accessRequest(@Body(ALL) body: AccessRequestHandleReq) {
const userId = this.getUserId();
let inputAccess = body.input.access;
if (body.input.id > 0) {
const oldEntity = await this.accessService.info(body.input.id);
@@ -48,8 +49,8 @@ export class HandleController extends BaseController {
inputAccess = this.accessService.decryptAccessEntity(param);
}
}
const access = await newAccess(body.typeName, inputAccess);
const accessGetter = new AccessGetter(userId, this.accessService.getById.bind(this.accessService));
const access = await newAccess(body.typeName, inputAccess,accessGetter);
const res = await access.onRequest(body);

View File

@@ -123,6 +123,19 @@ export class PipelineController extends CrudController<PipelineService> {
return this.ok({});
}
@Post('/batchUpdateTrigger', { summary: Constants.per.authOnly })
async batchUpdateTrigger(@Body('ids') ids: number[], @Body('trigger') trigger: any) {
await this.service.batchUpdateTrigger(ids, trigger, this.getUserId());
return this.ok({});
}
@Post('/batchUpdateNotification', { summary: Constants.per.authOnly })
async batchUpdateNotification(@Body('ids') ids: number[], @Body('notification') notification: any) {
await this.service.batchUpdateNotifications(ids, notification, this.getUserId());
return this.ok({});
}
@Post('/batchRerun', { summary: Constants.per.authOnly })
async batchRerun(@Body('ids') ids: number[]) {
await this.service.batchRerun(ids, this.getUserId());

View File

@@ -17,7 +17,7 @@ import {
Executor,
IAccessService,
ICnameProxyService,
INotificationService,
INotificationService, Notification,
Pipeline,
ResultType,
RunHistory,
@@ -45,6 +45,7 @@ import {NotificationService} from "./notification-service.js";
import {UserSuiteEntity, UserSuiteService} from "@certd/commercial-core";
import {CertInfoService} from "../../monitor/service/cert-info-service.js";
import {TaskServiceBuilder} from "./task-service-getter.js";
import {nanoid} from "nanoid";
const runningTasks: Map<string | number, Executor> = new Map();
@@ -149,8 +150,17 @@ export class PipelineService extends BaseService<PipelineEntity> {
const info = await this.info(pipelineId);
if (info && !info.disabled) {
const pipeline = JSON.parse(info.content);
// 手动触发不要await
this.registerTriggers(pipeline);
this.registerTriggers(pipeline,false);
}
}
public async registerTrigger(info:PipelineEntity) {
if (info == null) {
return;
}
if (info && !info.disabled) {
const pipeline = JSON.parse(info.content);
this.registerTriggers(pipeline,false);
}
}
@@ -174,10 +184,11 @@ export class PipelineService extends BaseService<PipelineEntity> {
//修改
old = await this.info(bean.id);
}
const pipeline = JSON.parse(bean.content || '{}');
RunnableCollection.initPipelineRunnableType(pipeline);
const isUpdate = bean.id > 0 && old != null;
const pipeline = JSON.parse(bean.content || '{}');
RunnableCollection.initPipelineRunnableType(pipeline);
let domains = [];
if (pipeline.stages) {
RunnableCollection.each(pipeline.stages, (runnable: any) => {
@@ -199,22 +210,32 @@ export class PipelineService extends BaseService<PipelineEntity> {
//如果是添加先保存一下获取到id更新pipeline.id
await this.addOrUpdate(bean);
}
await this.clearTriggers(bean.id);
await this.doUpdatePipelineJson(bean, pipeline);
//保存域名信息到certInfo表
let fromType = 'pipeline';
if (bean.type === 'cert_upload') {
fromType = 'upload';
}
await this.certInfoService.updateDomains(pipeline.id, pipeline.userId || bean.userId, domains, fromType);
return bean;
}
/**
* 更新Pipeline 包括trigger
* @param bean
* @param pipeline
*/
async doUpdatePipelineJson(bean: PipelineEntity, pipeline:Pipeline) {
await this.clearTriggers(bean);
if (pipeline.title) {
bean.title = pipeline.title;
}
pipeline.id = bean.id;
bean.content = JSON.stringify(pipeline);
await this.addOrUpdate(bean);
await this.registerTriggerById(bean.id);
//保存域名信息到certInfo表
let fromType = 'pipeline';
if(bean.type === 'cert_upload') {
fromType = 'upload';
}
await this.certInfoService.updateDomains(pipeline.id, pipeline.userId || bean.userId, domains,fromType);
return bean;
await this.registerTrigger(bean);
}
private async checkMaxPipelineCount(bean: PipelineEntity, pipeline: Pipeline, domains: string[]) {
@@ -375,11 +396,16 @@ export class PipelineService extends BaseService<PipelineEntity> {
await this.certInfoService.deleteByPipelineId(id);
}
async clearTriggers(id: number) {
async clearTriggers(id: number | PipelineEntity) {
if (id == null) {
return;
}
const pipeline = await this.info(id);
let pipeline:PipelineEntity = null
if (typeof id === 'number') {
pipeline = await this.info(id);
}else{
pipeline = id
}
if (!pipeline) {
return;
}
@@ -703,6 +729,58 @@ export class PipelineService extends BaseService<PipelineEntity> {
{ groupId }
);
}
async batchUpdateTrigger(ids: number[], trigger: any, userId: any){
const list = await this.find({
where:{
id: In(ids),
userId
}
})
for (const item of list) {
const pipeline = JSON.parse(item.content);
pipeline.triggers = [{
id: nanoid(),
title: '定时触发',
...trigger
}]
await this.doUpdatePipelineJson(item,pipeline)
}
}
async batchUpdateNotifications(ids: number[], notification: Notification, userId: any){
const list = await this.find({
where:{
id: In(ids),
userId
}
})
for (const item of list) {
const pipeline = JSON.parse(item.content);
pipeline.notifications = [{
id: nanoid(),
title: '通知',
/**
* type: NotificationType;
* when: NotificationWhen[];
* options: EmailOptions;
* notificationId: number;
* title: string;
* subType: string;
*/
type: "other",
...notification
}]
await this.doUpdatePipelineJson(item,pipeline)
}
}
async batchRerun(ids: number[], userId: any) {
if (!isPlus()){
throw new NeedVIPException("此功能需要升级专业版")

View File

@@ -89,6 +89,7 @@ export class DeployCertToTencentEO extends AbstractTaskPlugin {
getClient(accessProvider: TencentAccess) {
const TeoClient = this.Client;
const endpoint = accessProvider.isIntl()?"teo.intl.tencentcloudapi.com": "teo.tencentcloudapi.com";
const clientConfig = {
credential: {
secretId: accessProvider.secretId,
@@ -97,7 +98,7 @@ export class DeployCertToTencentEO extends AbstractTaskPlugin {
region: '',
profile: {
httpProfile: {
endpoint: 'teo.tencentcloudapi.com',
endpoint,
},
},
};