Compare commits

...

42 Commits

Author SHA1 Message Date
xiaojunnuo
5d6a945763 v1.30.6 2025-02-25 01:05:51 +08:00
xiaojunnuo
4fe5939d0b build: prepare to build 2025-02-25 01:03:46 +08:00
xiaojunnuo
bcaf54d4cb perf: 支持部署到阿里云FC3.0 2025-02-25 01:02:29 +08:00
xiaojunnuo
44d43f45cb perf: 支持新版本LeCDN 2025-02-24 18:07:08 +08:00
xiaojunnuo
9f0ee219d0 perf: 上传到阿里云证书名称后缀增加毫秒时间戳 2025-02-20 11:13:46 +08:00
xiaojunnuo
5164116bde perf: 禁止爬虫爬取本网站 2025-02-18 15:23:56 +08:00
xiaojunnuo
02404bc97e docs: deploy 2025-02-17 17:38:22 +08:00
xiaojunnuo
0ebdb037b5 Merge remote-tracking branch 'origin/v2-dev' into v2-dev 2025-02-17 17:37:57 +08:00
xiaojunnuo
a8b60c32b3 docs: deploy 2025-02-17 17:27:07 +08:00
xiaojunnuo
416621d503 docs: deploy 2025-02-17 17:18:41 +08:00
xiaojunnuo
b917eb447c chore: 2025-02-14 15:36:02 +08:00
xiaojunnuo
2ce3c71b88 chore: 2025-02-14 15:26:34 +08:00
xiaojunnuo
ca13bfa5f8 build: publish 2025-02-14 15:10:22 +08:00
xiaojunnuo
d8812196f3 build: trigger build image 2025-02-14 15:10:01 +08:00
xiaojunnuo
4e750bdbe1 v1.30.5 2025-02-14 15:07:36 +08:00
xiaojunnuo
f59a37b77c build: prepare to build 2025-02-14 15:05:55 +08:00
xiaojunnuo
ea3db93db9 chore: 2025-02-14 15:05:13 +08:00
xiaojunnuo
26f2c9fea2 v1.30.4 2025-02-14 14:58:54 +08:00
xiaojunnuo
290cc0d1bb build: prepare to build 2025-02-14 14:56:19 +08:00
xiaojunnuo
78044c062e fix: 适配最新版1panel密码编码方式 2025-02-14 14:55:15 +08:00
xiaojunnuo
3a2f653229 build: publish 2025-02-14 01:49:16 +08:00
xiaojunnuo
bbe22e6f36 build: trigger build image 2025-02-14 01:48:53 +08:00
xiaojunnuo
d4474ff0fb v1.30.3 2025-02-14 01:46:30 +08:00
xiaojunnuo
c7979f1be5 build: prepare to build 2025-02-14 01:44:45 +08:00
xiaojunnuo
ada0b7106e fix: 修复新版本1panel密码需要加密,无法登录的问题 2025-02-14 01:43:52 +08:00
xiaojunnuo
c3a5542935 fix: 修复腾讯云CLB多域名同证书部署报错的bug
https://github.com/certd/certd/issues/314
2025-02-14 00:42:25 +08:00
xiaojunnuo
287c3688fd build: publish 2025-02-09 16:12:21 +08:00
xiaojunnuo
3948b3993f build: trigger build image 2025-02-09 16:12:04 +08:00
xiaojunnuo
bcacafeb84 v1.30.2 2025-02-09 16:09:40 +08:00
xiaojunnuo
2193ddfabe build: prepare to build 2025-02-09 16:07:13 +08:00
xiaojunnuo
29ae0b7dca build: prepare to build 2025-02-09 16:06:03 +08:00
xiaojunnuo
904837df12 chore: 2025-02-09 16:05:36 +08:00
xiaojunnuo
00c2da444f fix: 修复cloudflare删除解析记录报错的bug 2025-02-09 15:50:08 +08:00
xiaojunnuo
13d0dde9f4 chore: 2025-02-08 22:21:45 +08:00
xiaojunnuo
548f2a960c chore: 增加切换数据库文档 2025-02-08 22:16:27 +08:00
xiaojunnuo
71803f891d chore: 2025-01-24 20:02:11 +08:00
xiaojunnuo
75a38d95f3 perf: 上传自定义证书 2025-01-24 18:04:17 +08:00
xiaojunnuo
c89686a2fd fix: 当前置任务被删除时进行校验 2025-01-24 16:35:40 +08:00
xiaojunnuo
398323533a chore: 2025-01-22 15:43:37 +08:00
xiaojunnuo
a773872cf3 chore: 2025-01-22 15:35:46 +08:00
xiaojunnuo
2eb0d55f92 build: publish 2025-01-20 23:40:07 +08:00
xiaojunnuo
54bd1ad0fa build: trigger build image 2025-01-20 23:39:49 +08:00
59 changed files with 1035 additions and 139 deletions

View File

@@ -3,6 +3,43 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
### Performance Improvements
* 禁止爬虫爬取本网站 ([5164116](https://github.com/certd/certd/commit/5164116bde60dabac774cdf94f5317ff386e95ca))
* 上传到阿里云证书名称后缀增加毫秒时间戳 ([9f0ee21](https://github.com/certd/certd/commit/9f0ee219d02907ffe128a5cf10173397d934ccd7))
* 支持部署到阿里云FC3.0 ([bcaf54d](https://github.com/certd/certd/commit/bcaf54d4cb7bc469486aae6cdb127ae017eb3abb))
* 支持新版本LeCDN ([44d43f4](https://github.com/certd/certd/commit/44d43f45cb9094619df7494c2a64a51ba77ad116))
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package root
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
### Bug Fixes
* 适配最新版1panel密码编码方式 ([78044c0](https://github.com/certd/certd/commit/78044c062e20cdd04f08baef9fb6745bf25eddcf))
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
### Bug Fixes
* 修复腾讯云CLB多域名同证书部署报错的bug ([c3a5542](https://github.com/certd/certd/commit/c3a55429357e78f4b78c9592d3e5897db2d4d549))
* 修复新版本1panel密码需要加密无法登录的问题 ([ada0b71](https://github.com/certd/certd/commit/ada0b7106e97e551783829e4e719f76793a7123d))
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
### Bug Fixes
* 当前置任务被删除时进行校验 ([c89686a](https://github.com/certd/certd/commit/c89686a2fda251484930f0ae715417b618c21690))
* 修复cloudflare删除解析记录报错的bug ([00c2da4](https://github.com/certd/certd/commit/00c2da444f84adb89f3f1226d03294d7c6e3e4f1))
### Performance Improvements
* 上传自定义证书 ([75a38d9](https://github.com/certd/certd/commit/75a38d95f305b4271d9106babe7cffc1c89ae8f3))
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
### Bug Fixes

View File

@@ -16,7 +16,6 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
* 私有化部署数据保存本地授权信息加密存储镜像由Github Actions构建过程公开透明
* 支持SQLitePostgreSQL、MySQL数据库
>
> 流水线数量现已调整为无限制,欢迎大家使用
>

View File

@@ -1 +1 @@
00:38
15:10

View File

@@ -7,6 +7,7 @@ services:
restart: unless-stopped # 自动重启
volumes:
# ↓↓↓↓↓ -------------------------------------------------------- 数据库以及证书存储路径,默认存在宿主机的/data/certd/目录下,【您需要定时备份此目录,以保障数据容灾】
# 只要修改冒号前面的,冒号后面的别动
- /data/certd:/app/data
ports: # 端口映射
# ↓↓↓↓ ---------------------------------------------------------- 如果端口有冲突可以修改第一个7001为其他不冲突的端口号

View File

@@ -85,7 +85,9 @@ export default defineConfig({
text: "特性",
items: [
{ text: "CNAME代理校验", link: "/guide/feature/cname/index.md" },
{ text: "插件列表", link: "/guide/plugins.md" }
{ text: "插件列表", link: "/guide/plugins.md" },
{ text: "多数据库支持", link: "/guide/install/database.md" },
{ text: "开放接口", link: "/guide/open/index.md" }
]
},
{
@@ -102,12 +104,12 @@ export default defineConfig({
{ text: "js脚本插件使用", link: "/guide/use/custom-script/index.md" },
{ text: "邮箱配置", link: "/guide/use/email/index.md" },
{ text: "IPv6支持", link: "/guide/use/setting/ipv6.md" },
{ text: "如何贡献代码", link: "/guide/development/index.md" },
]
},
{
text: "其他",
items: [
{ text: "贡献代码", link: "/guide/development/index.md" },
{ text: "更新日志", link: "/guide/changelogs/CHANGELOG.md" },
{ text: "镜像说明", link: "/guide/image.md" },
{ text: "联系我们", link: "/guide/contact/" },

View File

@@ -3,6 +3,47 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package root
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
### Bug Fixes
* 适配最新版1panel密码编码方式 ([78044c0](https://github.com/certd/certd/commit/78044c062e20cdd04f08baef9fb6745bf25eddcf))
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
### Bug Fixes
* 修复腾讯云CLB多域名同证书部署报错的bug ([c3a5542](https://github.com/certd/certd/commit/c3a55429357e78f4b78c9592d3e5897db2d4d549))
* 修复新版本1panel密码需要加密无法登录的问题 ([ada0b71](https://github.com/certd/certd/commit/ada0b7106e97e551783829e4e719f76793a7123d))
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
### Bug Fixes
* 当前置任务被删除时进行校验 ([c89686a](https://github.com/certd/certd/commit/c89686a2fda251484930f0ae715417b618c21690))
* 修复cloudflare删除解析记录报错的bug ([00c2da4](https://github.com/certd/certd/commit/00c2da444f84adb89f3f1226d03294d7c6e3e4f1))
### Performance Improvements
* 上传自定义证书 ([75a38d9](https://github.com/certd/certd/commit/75a38d95f305b4271d9106babe7cffc1c89ae8f3))
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
### Bug Fixes
* 修复部署到阿里云ALB、NLB插件加载混乱的bug ([6ab83b6](https://github.com/certd/certd/commit/6ab83b662a2c5e715b9cb7eb1244de2ebb7f47b0))
* 修复腾讯clb重复执行会报错的bug ([e95d29f](https://github.com/certd/certd/commit/e95d29f446d06eced315a3087fc9e105a30b20bd))
* 修复tg消息内容中存在.和*就会发送失败的bug ([ae5dfc3](https://github.com/certd/certd/commit/ae5dfc3bee950267123ae2fbd1c11e7ce36626ea))
### Performance Improvements
* 创建流水线时,默认成功时也发送通知 ([52ae690](https://github.com/certd/certd/commit/52ae6902d203ca56e0312692b50c55cb6ddd3e39))
* http方式校验选择sftp时支持修改文件访问权限比如777 ([15d6eaf](https://github.com/certd/certd/commit/15d6eaf5532ed25acd4f8d58c429353a2f44206c))
# [1.30.0](https://github.com/certd/certd/compare/v1.29.5...v1.30.0) (2025-01-19)
### Bug Fixes

View File

@@ -19,7 +19,8 @@ https://1panel.cn/docs/installation/online_installation/
3. 点击确定,启动容器
![](./images/2.png)
> 默认数据保存在`/data/certd`目录下,可以手动备份
> 默认使用sqlite数据库数据保存在`/data/certd`目录下,可以手动备份该目录
> certd还支持`mysql`和`postgresql`数据库,[点我了解如何切换其他数据库](../database)
3. 访问测试

View File

@@ -29,6 +29,9 @@
点击确定,等待启动完成
![](./images/2.png)
> certd默认使用sqlite数据库另外支持`mysql`和`postgresql`数据库,[点我了解如何切换其他数据库](../database)
## 二、访问应用
http://ip:7001
@@ -59,6 +62,7 @@ admin/123456
数据默认保存在`/data/certd`目录下,可以手动备份
### 4.3 自动备份
> 建议配置一条 [数据库备份流水线](../../use/backup/),自动备份

View File

@@ -0,0 +1,73 @@
# 切换数据库
certd支持如下几种数据库
1. sqlite3 (默认)
2. mysql
3. postgresql
您可以按如下两种方式切换数据库
## 一、全新安装
::: tip
以下按照`docker-compose`安装方式介绍如何使用mysql或postgresql数据库
如果您使用其他方式部署,请自行修改对应的环境变量即可。
:::
### 1.1、使用mysql数据库
1. 安装mysql创建数据库 `(注意charset=utf8mb4, collation=utf8mb4_bin)`
2. 下载最新的docker-compose.yaml
3. 修改环境变量配置
```yaml
services:
certd:
environment:
# 使用mysql数据库需要提前创建数据库 charset=utf8mb4, collation=utf8mb4_bin
- certd_flyway_scriptDir=./db/migration-mysql # 升级脚本目录 【照抄】
- certd_typeorm_dataSource_default_type=mysql # 数据库类型, 或者 mariadb
- certd_typeorm_dataSource_default_host=localhost # 数据库地址
- certd_typeorm_dataSource_default_port=3306 # 数据库端口
- certd_typeorm_dataSource_default_username=root # 用户名
- certd_typeorm_dataSource_default_password=yourpasswd # 密码
- certd_typeorm_dataSource_default_database=certd # 数据库名
```
4. 启动certd
```shell
docker-compose up -d
```
### 1.2、使用Postgresql数据库
1. 安装postgresql创建数据库
2. 下载最新的docker-compose.yaml
3. 修改环境变量配置
```yaml
services:
certd:
environment:
# 使用postgresql数据库需要提前创建数据库
- certd_flyway_scriptDir=./db/migration-pg # 升级脚本目录 【照抄】
- certd_typeorm_dataSource_default_type=postgres # 数据库类型 【照抄】
- certd_typeorm_dataSource_default_host=localhost # 数据库地址
- certd_typeorm_dataSource_default_port=5433 # 数据库端口
- certd_typeorm_dataSource_default_username=postgres # 用户名
- certd_typeorm_dataSource_default_password=yourpasswd # 密码
- certd_typeorm_dataSource_default_database=certd # 数据库名
```
4. 启动certd
```shell
docker-compose up -d
```
## 二、从旧版的sqlite切换数据库
1. 先将`旧certd`升级到最新版 `建议备份sqlite数据库`
2. 按照上面全新安装方式部署一套`新的certd` `注意新旧版本的certd要一致`
3. 使用数据库工具将数据从sqlite导入到mysql或postgresql `注意flyway_history数据表不要导入`
4. 重启新certd
5. 确认没有问题之后删除旧版certd

View File

@@ -42,6 +42,8 @@ docker compose up -d
> 如果提示 没有docker compose命令,请安装docker-compose
> https://docs.docker.com/compose/install/linux/
> certd默认使用sqlite数据库另外还支持`mysql`和`postgresql`数据库,[点我了解如何切换其他数据库](../database)
### 3. 访问测试

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

21
docs/guide/open/index.md Normal file
View File

@@ -0,0 +1,21 @@
# 开放接口
被动方式对第三方提供证书, 支持根据域名或证书id获取证书。
## 获取keyId和KeySecret
![](./images/1.png)
## 接口文档
https://apifox.com/apidoc/shared-2e76f8c4-7c58-413b-a32d-a1316529af44/254949529e0
## Token生成方法
header中传入x-certd-token即可调用开放接口
1、首先从OpenKey页面生成keyIdkeySecret
2、准备一个content( json字符串) content={"keyId":keyId, t:时间戳秒数, encrypt:false, signType:"md5"} `// encrypt返回结果是否加密`
3、将content加上keySecret进行签名 sign = md5(content + keySecret)
4、然后将content和sign分别base64后用.号连接: x-certd-token = base64(content) +"."+base64(sign)
## SDK
待开发

View File

@@ -1,2 +1,2 @@
User-agent: *
Allow: /
Disallow: /

View File

@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.30.1"
"version": "1.30.6"
}

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.30.6](https://github.com/publishlab/node-acme-client/compare/v1.30.5...v1.30.6) (2025-02-24)
**Note:** Version bump only for package @certd/acme-client
## [1.30.5](https://github.com/publishlab/node-acme-client/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/acme-client
## [1.30.4](https://github.com/publishlab/node-acme-client/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/acme-client
## [1.30.3](https://github.com/publishlab/node-acme-client/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/acme-client
## [1.30.2](https://github.com/publishlab/node-acme-client/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/acme-client
## [1.30.1](https://github.com/publishlab/node-acme-client/compare/v1.30.0...v1.30.1) (2025-01-20)
**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.30.1",
"version": "1.30.6",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.30.1",
"@certd/basic": "^1.30.6",
"@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5",
"axios": "^1.7.2",
@@ -65,5 +65,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

View File

@@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
### Performance Improvements
* 支持新版本LeCDN ([44d43f4](https://github.com/certd/certd/commit/44d43f45cb9094619df7494c2a64a51ba77ad116))
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/basic
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/basic
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/basic
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/basic
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
**Note:** Version bump only for package @certd/basic

View File

@@ -1 +1 @@
23:35
01:03

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.30.1",
"version": "1.30.6",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -44,5 +44,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

View File

@@ -6,7 +6,12 @@ function md5(data: string) {
function sha256(data: string) {
return crypto.createHash('sha256').update(data).digest('hex');
}
function base64(data: string) {
return Buffer.from(data).toString('base64');
}
export const hashUtils = {
md5,
sha256,
base64,
};

View File

@@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
### Performance Improvements
* 上传到阿里云证书名称后缀增加毫秒时间戳 ([9f0ee21](https://github.com/certd/certd/commit/9f0ee219d02907ffe128a5cf10173397d934ccd7))
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/pipeline
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/pipeline
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/pipeline
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/pipeline
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
### Bug Fixes

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.30.1",
"version": "1.30.6",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -16,8 +16,8 @@
"test": "mocha --loader=ts-node/esm"
},
"dependencies": {
"@certd/basic": "^1.30.1",
"@certd/plus-core": "^1.30.1",
"@certd/basic": "^1.30.6",
"@certd/plus-core": "^1.30.6",
"dayjs": "^1.11.7",
"lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13"
@@ -43,5 +43,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

View File

@@ -193,7 +193,7 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
if (name == null) {
name = "certd";
}
return name + "_" + dayjs().format("YYYYMMDDHHmmss");
return name + "_" + dayjs().format("YYYYMMDDHHmmssSSS");
}
async onRequest(req: PluginRequestHandleReq<any>) {

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.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
**Note:** Version bump only for package @certd/lib-huawei
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/lib-huawei
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/lib-huawei
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/lib-huawei
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/lib-huawei
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
**Note:** Version bump only for package @certd/lib-huawei

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.30.1",
"version": "1.30.6",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts",
@@ -21,5 +21,5 @@
"prettier": "^2.8.8",
"tslib": "^2.8.1"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

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.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
**Note:** Version bump only for package @certd/lib-iframe
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/lib-iframe
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/lib-iframe
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/lib-iframe
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/lib-iframe
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
**Note:** Version bump only for package @certd/lib-iframe

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.30.1",
"version": "1.30.6",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -30,5 +30,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

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.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
**Note:** Version bump only for package @certd/lib-k8s
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/lib-k8s
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/lib-k8s
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/lib-k8s
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/lib-k8s
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
**Note:** Version bump only for package @certd/lib-k8s

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.30.1",
"version": "1.30.6",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -16,7 +16,7 @@
"preview": "vite preview"
},
"dependencies": {
"@certd/basic": "^1.30.1",
"@certd/basic": "^1.30.6",
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
@@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

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.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
**Note:** Version bump only for package @certd/lib-server
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/lib-server
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/lib-server
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/lib-server
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/lib-server
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
**Note:** Version bump only for package @certd/lib-server

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.30.1",
"version": "1.30.6",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -27,10 +27,10 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.30.1",
"@certd/basic": "^1.30.1",
"@certd/pipeline": "^1.30.1",
"@certd/plus-core": "^1.30.1",
"@certd/acme-client": "^1.30.6",
"@certd/basic": "^1.30.6",
"@certd/pipeline": "^1.30.6",
"@certd/plus-core": "^1.30.6",
"@midwayjs/cache": "~3.14.0",
"@midwayjs/core": "~3.17.1",
"@midwayjs/i18n": "~3.17.3",
@@ -61,5 +61,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

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.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.30.1",
"version": "1.30.6",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

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.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
**Note:** Version bump only for package @certd/plugin-cert
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/plugin-cert
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/plugin-cert
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/plugin-cert
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/plugin-cert
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
### Performance Improvements

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.30.1",
"version": "1.30.6",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -15,10 +15,10 @@
"preview": "vite preview"
},
"dependencies": {
"@certd/acme-client": "^1.30.1",
"@certd/basic": "^1.30.1",
"@certd/pipeline": "^1.30.1",
"@certd/plugin-lib": "^1.30.1",
"@certd/acme-client": "^1.30.6",
"@certd/basic": "^1.30.6",
"@certd/pipeline": "^1.30.6",
"@certd/plugin-lib": "^1.30.6",
"@google-cloud/publicca": "^1.3.0",
"dayjs": "^1.11.7",
"jszip": "^3.10.1",
@@ -41,5 +41,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

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.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
**Note:** Version bump only for package @certd/plugin-lib
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/plugin-lib
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/plugin-lib
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/plugin-lib
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
**Note:** Version bump only for package @certd/plugin-lib
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
### Performance Improvements

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.30.1",
"version": "1.30.6",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -16,8 +16,8 @@
},
"dependencies": {
"@alicloud/pop-core": "^1.7.10",
"@certd/basic": "^1.30.1",
"@certd/pipeline": "^1.30.1",
"@certd/basic": "^1.30.6",
"@certd/pipeline": "^1.30.6",
"@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.21.0",
"basic-ftp": "^5.0.5",
@@ -48,5 +48,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "9a78dad57619e02d1390cf5a013695a2aaf20e64"
"gitHead": "4e750bdbe109e300a5a17a783aa00d2f0eb6daac"
}

View File

@@ -3,6 +3,32 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
**Note:** Version bump only for package @certd/ui-client
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/ui-client
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
**Note:** Version bump only for package @certd/ui-client
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
**Note:** Version bump only for package @certd/ui-client
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
### Bug Fixes
* 当前置任务被删除时进行校验 ([c89686a](https://github.com/certd/certd/commit/c89686a2fda251484930f0ae715417b618c21690))
### Performance Improvements
* 上传自定义证书 ([75a38d9](https://github.com/certd/certd/commit/75a38d95f305b4271d9106babe7cffc1c89ae8f3))
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
### Performance Improvements

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.30.1",
"version": "1.30.6",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -66,8 +66,8 @@
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@certd/lib-iframe": "^1.30.1",
"@certd/pipeline": "^1.30.1",
"@certd/lib-iframe": "^1.30.6",
"@certd/pipeline": "^1.30.6",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",

View File

@@ -10,9 +10,8 @@
<script lang="ts" setup>
import zhCN from "ant-design-vue/es/locale/zh_CN";
import enUS from "ant-design-vue/es/locale/en_US";
import { nextTick, provide, ref } from "vue";
import { provide, ref } from "vue";
import { usePageStore } from "/src/store/modules/page";
import { useResourceStore } from "/src/store/modules/resource";
import { useSettingStore } from "/@/store/modules/settings";
import "dayjs/locale/zh-cn";
import "dayjs/locale/en";

View File

@@ -44,8 +44,15 @@ export default {
options.value = options.value.filter((item: any) => props.from.includes(item.type));
}
}
if (props.modelValue == null && options.value.length > 0) {
ctx.emit("update:modelValue", options.value[0].value);
if (props.modelValue != null) {
const found = options.value.find((item: any) => item.value === props.modelValue);
if (!found) {
ctx.emit("update:modelValue", undefined);
}
} else {
const value = options.value.length > 0 ? options.value[0].value : undefined;
ctx.emit("update:modelValue", value);
}
}
onMounted(() => {

View File

@@ -70,7 +70,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
key: "id",
type: "number",
column: {
width: 100
width: 80
},
form: {
show: false

View File

@@ -1,54 +1,57 @@
import { request } from "/src/api/service";
export function createApi() {
const apiPrefix = "/monitor/cert";
return {
async GetList(query: any) {
return await request({
url: apiPrefix + "/page",
method: "post",
data: query
});
},
const apiPrefix = "/monitor/cert";
export const certInfoApi = {
async GetList(query: any) {
return await request({
url: apiPrefix + "/page",
method: "post",
data: query
});
},
async AddObj(obj: any) {
return await request({
url: apiPrefix + "/add",
method: "post",
data: obj
});
},
async AddObj(obj: any) {
return await request({
url: apiPrefix + "/add",
method: "post",
data: obj
});
},
async UpdateObj(obj: any) {
return await request({
url: apiPrefix + "/update",
method: "post",
data: obj
});
},
async UpdateObj(obj: any) {
return await request({
url: apiPrefix + "/update",
method: "post",
data: obj
});
},
async DelObj(id: number) {
return await request({
url: apiPrefix + "/delete",
method: "post",
params: { id }
});
},
async DelObj(id: number) {
return await request({
url: apiPrefix + "/delete",
method: "post",
params: { id }
});
},
async GetObj(id: number) {
return await request({
url: apiPrefix + "/info",
method: "post",
params: { id }
});
},
async ListAll() {
return await request({
url: apiPrefix + "/all",
method: "post"
});
}
};
}
export const pipelineGroupApi = createApi();
async GetObj(id: number) {
return await request({
url: apiPrefix + "/info",
method: "post",
params: { id }
});
},
async ListAll() {
return await request({
url: apiPrefix + "/all",
method: "post"
});
},
async Upload(body: { id?: number; cert: { crt: string; key: string } }) {
return await request({
url: apiPrefix + "/upload",
method: "post",
data: body
});
}
};

View File

@@ -1,12 +1,14 @@
// @ts-ignore
import { useI18n } from "vue-i18n";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { pipelineGroupApi } from "./api";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, useFormWrapper, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { certInfoApi } from "./api";
import dayjs from "dayjs";
import { useUserStore } from "/@/store/modules/user";
import { useRouter } from "vue-router";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
const api = pipelineGroupApi;
const api = certInfoApi;
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
return await api.GetList(query);
};
@@ -26,7 +28,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const res = await api.AddObj(form);
return res;
};
const { openCrudFormDialog } = useFormWrapper();
const router = useRouter();
return {
crudOptions: {
request: {
@@ -50,7 +53,68 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
width: 600
}
},
actionbar: { show: false },
actionbar: {
show: true,
buttons: {
add: {
text: "上传自定义证书",
type: "primary",
show: false,
async click() {
function createCrudOptions() {
return {
crudOptions: {
request: {
addRequest: async (form: any) => {
return await api.Upload(form);
},
editRequest: async (form: any) => {
return await api.Upload(form);
}
},
columns: {
id: {
title: "ID",
type: "number",
form: {
show: false
}
},
"cert.crt": {
title: "证书",
type: "textarea",
form: {
component: {
rows: 4
},
rules: [{ required: true, message: "此项必填" }]
}
},
"cert.key": {
title: "私钥",
type: "textarea",
form: {
component: {
rows: 4
},
rules: [{ required: true, message: "此项必填" }]
}
}
},
form: {
wrapper: {
title: "上传自定义证书"
}
}
}
};
}
const { crudOptions } = createCrudOptions();
const wrapperRef = await openCrudFormDialog({ crudOptions });
}
}
}
},
rowHandle: {
width: 200,
fixed: "right",
@@ -176,7 +240,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}
},
"pipeline.title": {
title: "关联流水线",
title: "关联流水线",
search: { show: false },
type: "link",
form: {
@@ -185,7 +249,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
column: {
width: 350,
sorter: true,
component: {}
component: {
on: {
onClick({ row }) {
router.push({ path: "/certd/pipeline/detail", query: { id: row.pipelineId, editMode: "false" } });
}
}
}
}
}
}

View File

@@ -78,7 +78,8 @@
<div
class="task-container"
:class="{
'first-task': taskIndex === 0
'first-task': taskIndex === 0,
'validate-error': hasValidateError(task.id)
}"
>
<div class="line line-left">
@@ -171,7 +172,6 @@
<div class="task">
<a-button shape="round" type="dashed" @click="notificationAdd()">
<fs-icon icon="ion:add-circle-outline"></fs-icon>
添加通知
</a-button>
</div>
@@ -626,7 +626,78 @@ export default defineComponent({
function toggleEditMode(editMode: boolean) {
ctx.emit("update:editMode", editMode);
}
const validateErrors: Ref = ref({});
function addValidateError(taskId: string, error: any) {
const errors = validateErrors.value[taskId] || [];
validateErrors.value[taskId] = errors;
errors.push(error);
}
function doValidate() {
validateErrors.value = {};
const stepIds: string[] = [];
//校验output id是否正确
const pp = pipeline.value;
function eachSteps(callback: any) {
if (pp.stages) {
for (const stage of pp.stages) {
if (stage.tasks) {
for (const task of stage.tasks) {
if (task.steps) {
for (const step of task.steps) {
callback(step, task, stage);
}
}
}
}
}
}
}
//检查输出的stepid是否存在
let hasError = false;
let errorMessage = "";
eachSteps((step: any, task: any, stage: any) => {
stepIds.push(step.id);
if (step.input) {
for (const key in step.input) {
const value = step.input[key];
if (value == null || typeof value != "string" || !value.startsWith("step.")) {
continue;
}
const arr = value.split(".");
if (arr.length != 3) {
continue;
}
const stepId = arr[1];
const paramName = arr[2];
if (!stepIds.includes(stepId)) {
hasError = true;
const message = `任务${step.title}的前置输出步骤${paramName}不存在,请重新修改此任务`;
addValidateError(task.id, {
message
});
addValidateError(step.id, {
message
});
errorMessage += message + "";
}
}
}
});
if (hasError) {
notification.error({ message: errorMessage });
throw new Error(errorMessage);
}
}
function hasValidateError(taskId: string) {
return validateErrors.value[taskId] != null;
}
const save = async () => {
doValidate();
saveLoading.value = true;
try {
if (props.options.doSave) {
@@ -663,7 +734,8 @@ export default defineComponent({
save,
edit,
cancel,
saveLoading
saveLoading,
hasValidateError
};
}
@@ -875,6 +947,14 @@ export default defineComponent({
justify-content: center;
align-items: center;
position: relative;
&.validate-error {
.task {
.ant-btn {
border-color: red;
}
}
}
.task {
display: flex;
flex-direction: column;

View File

@@ -217,9 +217,9 @@ async function loadPluginGroups() {
const pluginGroups = ref();
onMounted(async () => {
await userStore.loadUserInfo();
await loadLatestVersion();
await loadCount();
await loadPluginGroups();
loadLatestVersion();
loadCount();
loadPluginGroups();
});
function openUpgradeUrl() {

View File

@@ -3,6 +3,39 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.30.6](https://github.com/certd/certd/compare/v1.30.5...v1.30.6) (2025-02-24)
### Performance Improvements
* 上传到阿里云证书名称后缀增加毫秒时间戳 ([9f0ee21](https://github.com/certd/certd/commit/9f0ee219d02907ffe128a5cf10173397d934ccd7))
* 支持部署到阿里云FC3.0 ([bcaf54d](https://github.com/certd/certd/commit/bcaf54d4cb7bc469486aae6cdb127ae017eb3abb))
## [1.30.5](https://github.com/certd/certd/compare/v1.30.4...v1.30.5) (2025-02-14)
**Note:** Version bump only for package @certd/ui-server
## [1.30.4](https://github.com/certd/certd/compare/v1.30.3...v1.30.4) (2025-02-14)
### Bug Fixes
* 适配最新版1panel密码编码方式 ([78044c0](https://github.com/certd/certd/commit/78044c062e20cdd04f08baef9fb6745bf25eddcf))
## [1.30.3](https://github.com/certd/certd/compare/v1.30.2...v1.30.3) (2025-02-13)
### Bug Fixes
* 修复腾讯云CLB多域名同证书部署报错的bug ([c3a5542](https://github.com/certd/certd/commit/c3a55429357e78f4b78c9592d3e5897db2d4d549))
## [1.30.2](https://github.com/certd/certd/compare/v1.30.1...v1.30.2) (2025-02-09)
### Bug Fixes
* 修复cloudflare删除解析记录报错的bug ([00c2da4](https://github.com/certd/certd/commit/00c2da444f84adb89f3f1226d03294d7c6e3e4f1))
### Performance Improvements
* 上传自定义证书 ([75a38d9](https://github.com/certd/certd/commit/75a38d95f305b4271d9106babe7cffc1c89ae8f3))
## [1.30.1](https://github.com/certd/certd/compare/v1.30.0...v1.30.1) (2025-01-20)
### Bug Fixes

View File

@@ -11,6 +11,5 @@
```shell
npm run heap
```

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.30.1",
"version": "1.30.6",
"description": "fast-server base midway",
"private": true,
"type": "module",
@@ -30,22 +30,26 @@
"slimming": "node ./slimming.js"
},
"dependencies": {
"@alicloud/fc20230330": "^4.1.7",
"@alicloud/openapi-client": "^0.4.12",
"@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-typescript": "^1.8.0",
"@alicloud/tea-util": "^1.4.10",
"@aws-sdk/client-acm": "^3.699.0",
"@aws-sdk/client-cloudfront": "^3.699.0",
"@aws-sdk/client-s3": "^3.705.0",
"@certd/acme-client": "^1.30.1",
"@certd/basic": "^1.30.1",
"@certd/commercial-core": "^1.30.1",
"@certd/lib-huawei": "^1.30.1",
"@certd/lib-k8s": "^1.30.1",
"@certd/lib-server": "^1.30.1",
"@certd/midway-flyway-js": "^1.30.1",
"@certd/pipeline": "^1.30.1",
"@certd/plugin-cert": "^1.30.1",
"@certd/plugin-lib": "^1.30.1",
"@certd/plugin-plus": "^1.30.1",
"@certd/plus-core": "^1.30.1",
"@certd/acme-client": "^1.30.6",
"@certd/basic": "^1.30.6",
"@certd/commercial-core": "^1.30.6",
"@certd/lib-huawei": "^1.30.6",
"@certd/lib-k8s": "^1.30.6",
"@certd/lib-server": "^1.30.6",
"@certd/midway-flyway-js": "^1.30.6",
"@certd/pipeline": "^1.30.6",
"@certd/plugin-cert": "^1.30.6",
"@certd/plugin-lib": "^1.30.6",
"@certd/plugin-plus": "^1.30.6",
"@certd/plus-core": "^1.30.6",
"@corsinvest/cv4pve-api-javascript": "^8.3.0",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",

View File

@@ -15,12 +15,13 @@ export class AppController extends BaseController {
@Get('/latest', { summary: Constants.per.authOnly })
async latest(): Promise<any> {
const res = await http.request({
url: 'https://registry.npmmirror.com/@certd/pipeline',
method: 'get',
logRes: false,
});
try {
const res = await http.request({
url: 'https://registry.npmmirror.com/@certd/pipeline',
method: 'get',
logRes: false,
timeout: 5000,
});
const latest = res['dist-tags'].latest;
return this.ok(latest);
} catch (e: any) {

View File

@@ -11,6 +11,7 @@ import {
SysSuiteSetting,
} from '@certd/lib-server';
import { AppKey, getPlusInfo, isComm } from '@certd/plus-core';
import { cloneDeep } from 'lodash-es';
/**
*/
@@ -62,7 +63,10 @@ export class BasicSettingsController extends BaseController {
}
async plusInfo() {
return getPlusInfo();
const res = getPlusInfo();
const copy = cloneDeep(res);
delete copy.secret;
return copy;
}
@Get('/all', { summary: Constants.per.guest })

View File

@@ -84,4 +84,15 @@ export class CertInfoController extends CrudController<CertInfoService> {
});
return this.ok(list);
}
@Post('/upload', { summary: Constants.per.authOnly })
async upload(@Body(ALL) body: any) {
if (body.id) {
await this.service.checkUserId(body.id, this.getUserId());
}
const res = await this.service.upload(body);
return this.ok(res);
}
}

View File

@@ -16,7 +16,7 @@ export class AutoEPipelineEmitterRegister {
}
async onCertApplySuccess() {
pipelineEmitter.on(EVENT_CERT_APPLY_SUCCESS, async (event: PipelineEvent<CertReader>) => {
await this.certInfoService.updateCert(event.pipeline.id, event.event);
await this.certInfoService.updateCertByPipelineId(event.pipeline.id, event.event);
});
}
}

View File

@@ -1,11 +1,17 @@
import { Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { BaseService, CodeException, Constants, PageReq } from '@certd/lib-server';
import { BaseService, CodeException, CommonException, Constants, PageReq } from '@certd/lib-server';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { CertInfoEntity } from '../entity/cert-info.js';
import { utils } from '@certd/basic';
import { CertInfo, CertReader } from '@certd/plugin-cert';
export type UploadCertReq = {
id?: number;
certReader: CertReader;
fromType?: string;
};
@Provide()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
export class CertInfoService extends BaseService<CertInfoEntity> {
@@ -125,15 +131,27 @@ export class CertInfoService extends BaseService<CertInfoEntity> {
return certReader.toCertInfo();
}
async updateCert(pipelineId: number, certReader: CertReader) {
async updateCertByPipelineId(pipelineId: number, certReader: CertReader, fromType = 'pipeline') {
const found = await this.repository.findOne({
where: {
pipelineId,
},
});
const bean = await this.updateCert({
id: found?.id,
certReader,
fromType,
});
return bean;
}
private async updateCert(req: UploadCertReq) {
const bean = new CertInfoEntity();
if (found) {
bean.id = found.id;
const { id, fromType, certReader } = req;
if (id) {
bean.id = id;
} else {
bean.fromType = fromType;
}
const certInfo = certReader.toCertInfo();
bean.certInfo = JSON.stringify(certInfo);
@@ -146,5 +164,19 @@ export class CertInfoService extends BaseService<CertInfoEntity> {
bean.certProvider = certReader.detail.issuer.commonName;
await this.addOrUpdate(bean);
return bean;
}
async upload(body: { id?: number; cert: CertInfo }) {
const { id, cert } = body;
if (!cert) {
throw new CommonException("cert can't be empty");
}
const res = await this.updateCert({
id,
certReader: new CertReader(cert),
fromType: 'upload',
});
return res.id;
}
}

View File

@@ -87,7 +87,7 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
let certId: any = this.cert;
if (typeof this.cert === 'object') {
certId = await sslClient.uploadCert({
name: this.appendTimeSuffix('certd'),
name: this.appendTimeSuffix(this.certName),
cert: this.cert,
});
}

View File

@@ -0,0 +1,215 @@
import { IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { CertInfo } from '@certd/plugin-cert';
import { AliyunAccess, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
import { AbstractPlusTaskPlugin } from '@certd/plugin-plus';
@IsTaskPlugin({
name: 'AliyunDeployCertToFC',
title: '阿里云-部署至阿里云FC(3.0)',
icon: 'ant-design:aliyun-outlined',
group: pluginGroups.aliyun.key,
desc: '部署证书到阿里云函数计算FC3.0,【注意】证书的加密算法必须选择【pkcs1旧版】',
needPlus: true,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,
},
},
})
export class AliyunDeployCertToFC extends AbstractPlusTaskPlugin {
@TaskInput({
title: '域名证书',
helper: '请选择证书申请任务输出的域名证书',
component: {
name: 'output-selector',
from: ['CertApply', 'CertApplyLego'],
},
required: true,
})
cert!: CertInfo;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[];
@TaskInput({
title: 'FC大区',
value: 'cn-hangzhou',
component: {
name: 'a-auto-complete',
vModel: 'value',
options: [
{ value: 'cn-qingdao', label: '华北1青岛' },
{ value: 'cn-beijing', label: '华北2北京' },
{ value: 'cn-zhangjiakou', label: '华北 3张家口' },
{ value: 'cn-huhehaote', label: '华北5呼和浩特' },
{ value: 'cn-hangzhou', label: '华东1杭州' },
{ value: 'cn-shanghai', label: '华东2上海' },
{ value: 'cn-shenzhen', label: '华南1深圳' },
{ value: 'ap-southeast-2', label: '澳大利亚(悉尼)' },
{ value: 'eu-central-1', label: '德国(法兰克福)' },
{ value: 'ap-southeast-3', label: '马来西亚(吉隆坡)' },
{ value: 'us-east-1', label: '美国(弗吉尼亚)' },
{ value: 'us-west-1', label: '美国(硅谷)' },
{ value: 'ap-northeast-1', label: '日本(东京)' },
{ value: 'ap-southeast-7', label: '泰国(曼谷)' },
{ value: 'cn-chengdu', label: '西南1成都' },
{ value: 'ap-southeast-1', label: '新加坡' },
{ value: 'ap-south-1', label: '印度(孟买)' },
{ value: 'ap-southeast-5', label: '印度尼西亚(雅加达)' },
{ value: 'eu-west-1', label: '英国(伦敦)' },
{ value: 'cn-hongkong', label: '中国香港' },
],
},
required: true,
})
regionId!: string;
@TaskInput({
title: 'Access授权',
helper: '阿里云授权AccessKeyId、AccessKeySecret',
component: {
name: 'access-selector',
type: 'aliyun',
},
required: true,
})
accessId!: string;
@TaskInput(
createRemoteSelectInputDefine({
title: 'FC域名',
helper: "请选择要部署证书的域名\n【注意】证书的加密算法必须选择【pkcs1旧版】否则会报'private key' has to be in PEM format错误",
typeName: 'AliyunDeployCertToFC',
action: AliyunDeployCertToFC.prototype.onGetDomainList.name,
watches: ['accessId', 'regionId'],
})
)
fcDomains!: string[];
@TaskInput({
title: '域名支持的协议类型',
component: {
name: 'a-select',
value: '',
options: [
{ value: '', label: '保持原样适用于原来已经开启了HTTPS' },
{ value: 'HTTPS', label: '仅HTTPS' },
{ value: 'HTTP,HTTPS', label: 'HTTP与HTTPS同时支持' },
],
},
})
protocol!: string;
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云');
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const client = await this.getClient(access);
const $Util = await import('@alicloud/tea-util');
const $OpenApi = await import('@alicloud/openapi-client');
for (const domainName of this.fcDomains) {
const params = new $OpenApi.Params({
// 接口名称
action: 'UpdateCustomDomain',
// 接口版本
version: '2023-03-30',
// 接口协议
protocol: 'HTTPS',
// 接口 HTTP 方法
method: 'PUT',
authType: 'AK',
style: 'FC',
// 接口 PATH
pathname: `/2023-03-30/custom-domains/${domainName}`,
// 接口请求体内容格式
reqBodyType: 'json',
// 接口响应体内容格式
bodyType: 'json',
});
// body params
const body: { [key: string]: any } = {
certConfig: {
certName: this.appendTimeSuffix('certd_fc'),
certificate: this.cert.crt,
privateKey: this.cert.key,
},
};
if (this.protocol) {
body.protocol = this.protocol;
}
const runtime = new $Util.RuntimeOptions({});
const request = new $OpenApi.OpenApiRequest({ body });
// 复制代码运行请自行打印 API 的返回值
// 返回值实际为 Map 类型,可从 Map 中获得三类数据:响应体 body、响应头 headers、HTTP 返回的状态码 statusCode。
await client.callApi(params, request, runtime);
this.logger.info(`部署[${domainName}]成功`);
}
}
async getClient(access: AliyunAccess) {
const $OpenApi = await import('@alicloud/openapi-client');
const config = new $OpenApi.Config({
accessKeyId: access.accessKeyId,
accessKeySecret: access.accessKeySecret,
});
// Endpoint 请参考 https://api.aliyun.com/product/FC
config.endpoint = `1831228848739566.${this.regionId}.fc.aliyuncs.com`;
return new $OpenApi.default.default(config);
}
async onGetDomainList(data: any) {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const client = await this.getClient(access);
const $OpenApi = await import('@alicloud/openapi-client');
const $Util = await import('@alicloud/tea-util');
const params = new $OpenApi.Params({
// 接口名称
action: 'ListCustomDomains',
// 接口版本
version: '2023-03-30',
// 接口协议
protocol: 'HTTPS',
// 接口 HTTP 方法
method: 'GET',
authType: 'AK',
style: 'FC',
// 接口 PATH
pathname: `/2023-03-30/custom-domains`,
// 接口请求体内容格式
reqBodyType: 'json',
// 接口响应体内容格式
bodyType: 'json',
});
const runtime = new $Util.RuntimeOptions({});
const request = new $OpenApi.OpenApiRequest({});
// 复制代码运行请自行打印 API 的返回值
// 返回值实际为 Map 类型,可从 Map 中获得三类数据:响应体 body、响应头 headers、HTTP 返回的状态码 statusCode。
const res = await client.callApi(params, request, runtime);
const list = res?.body?.customDomains;
if (!list || list.length === 0) {
throw new Error('没有找到FC域名请先创建FC域名');
}
const options = list.map((item: any) => {
return {
label: item.domainName,
value: item.domainName,
title: item.domainName,
domain: item.domainName,
};
});
return this.ctx.utils.options.buildGroupOptions(options, this.certDomains);
}
}
new AliyunDeployCertToFC();

View File

@@ -3,3 +3,7 @@ export * from './deploy-to-dcdn/index.js';
export * from './deploy-to-oss/index.js';
export * from './upload-to-aliyun/index.js';
export * from './deploy-to-waf/index.js';
export * from './deploy-to-alb/index.js';
export * from './deploy-to-nlb/index.js';
export * from './deploy-to-slb/index.js';
export * from './deploy-to-fc/index.js';

View File

@@ -106,6 +106,7 @@ export class CloudflareDnsProvider extends AbstractDnsProvider<CloudflareRecord>
this.logger.info(`dns解析记录:${JSON.stringify(record)}`);
}
//本接口需要返回本次创建的dns解析记录这个记录会在删除的时候用到
record.zone_id = zoneId;
return record;
}

View File

@@ -206,7 +206,24 @@ export class DeployCertToTencentCLB extends AbstractTaskPlugin {
params.Domain = domain;
const ret = await client.ModifyDomainAttributes(params);
this.checkRet(ret);
this.logger.info('设置腾讯云CLB证书(sni)成功:', ret.RequestId, '->loadBalancerId:', this.loadBalancerId, 'listenerId', this.listenerId, 'domain:', domain);
this.logger.info(
`[${domain}] 设置腾讯云CLB证书(sni)任务已提交:taskId${ret.RequestId}loadBalancerId:${this.loadBalancerId}listenerId:${this.listenerId}`
);
const requestId = ret.RequestId;
while (true) {
const statusRes = await client.DescribeTaskStatus({ TaskId: requestId });
if (statusRes.Status === 0) {
this.logger.info(`[${domain}] 腾讯云CLB证书(sni)设置成功`);
break;
} else if (statusRes.Status === 2) {
this.logger.info(`[${domain}] 腾讯云CLB证书(sni)设置进行中,请耐心等待`);
} else if (statusRes.Status === 1) {
throw new Error(`[${domain}] 腾讯云CLB证书(sni)设置失败:` + statusRes.Message);
}
await this.ctx.utils.sleep(5000);
}
return ret;
}
appendTimeSuffix(name: string) {