Merge branch 'v2-dev' into v2

pull/409/head
xiaojunnuo 2025-05-16 00:21:55 +08:00
commit ed1a9fc7aa
72 changed files with 4219 additions and 4637 deletions

1
.gitignore vendored
View File

@ -17,6 +17,7 @@ gen
/test/*.private.* /test/*.private.*
/*.log /*.log
nohup.out
/packages/ui/*/.idea /packages/ui/*/.idea
/packages/ui/*/node_modules /packages/ui/*/node_modules

View File

@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
### Performance Improvements
* 宝塔插件、1panel 改成完全免费版 ([a53b6cd](https://github.com/certd/certd/commit/a53b6cd28ff2ce5662ada82379ea44a06b179b81))
* 添加 FlexCDN 更新证书插件 ([bf040d4](https://github.com/certd/certd/commit/bf040d4c428d29c06fbaca5e29100e0c583b2b0b))
* 小助手可以关闭 ([3e2101a](https://github.com/certd/certd/commit/3e2101aa5b56548614102e900d59819ce8c7e97c))
* 支持部署到maoyun cdn ([68f333f](https://github.com/certd/certd/commit/68f333fb87ce85eed27436ecb0f76351c0ccb0d1))
* 支持AI分析报错 ([aa96859](https://github.com/certd/certd/commit/aa96859798166426e485947a6590464de189de05))
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
### Bug Fixes ### Bug Fixes

View File

@ -149,14 +149,14 @@ https://afdian.com/a/greper
专业版特权对比 专业版特权对比
| 功能 | 免费版 | 专业版 | | 功能 | 免费版 | 专业版 |
|---------|--------------------|-----------------------------| |---------|---------------------------------------|--------------------------------|
| 免费证书申请 | 免费无限制 | 免费无限制 | | 免费证书申请 | 免费无限制 | 免费无限制 |
| 域名数量 | 无限制 | 无限制 | | 域名数量 | 无限制 | 无限制 |
| 证书流水线条数 | 无限制 | 无限制 | | 证书流水线条数 | 无限制 | 无限制 |
| 站点证书监控 | 限制1条 | 无限制 | | 站点证书监控 | 限制1条 | 无限制 |
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署等 | 支持群晖、宝塔、1Panel等持续开发中 | | 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖 |
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、飞书、anpush、server酱等 | | 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、钉钉、飞书、anpush、server酱等 |
************************ ************************

View File

@ -1 +1 @@
20:28 00:14

View File

@ -106,6 +106,7 @@ export default defineConfig({
{ {
text: "常见问题", text: "常见问题",
items: [ items: [
{text: "QA", link: "/guide/qa/use"},
{text: "常见报错处理", link: "/guide/qa/"}, {text: "常见报错处理", link: "/guide/qa/"},
{text: "群晖证书部署", link: "/guide/use/synology/"}, {text: "群晖证书部署", link: "/guide/use/synology/"},
{text: "腾讯云密钥获取", link: "/guide/use/tencent/"}, {text: "腾讯云密钥获取", link: "/guide/use/tencent/"},

View File

@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
### Performance Improvements
* 宝塔插件、1panel 改成完全免费版 ([a53b6cd](https://github.com/certd/certd/commit/a53b6cd28ff2ce5662ada82379ea44a06b179b81))
* 添加 FlexCDN 更新证书插件 ([bf040d4](https://github.com/certd/certd/commit/bf040d4c428d29c06fbaca5e29100e0c583b2b0b))
* 小助手可以关闭 ([3e2101a](https://github.com/certd/certd/commit/3e2101aa5b56548614102e900d59819ce8c7e97c))
* 支持部署到maoyun cdn ([68f333f](https://github.com/certd/certd/commit/68f333fb87ce85eed27436ecb0f76351c0ccb0d1))
* 支持AI分析报错 ([aa96859](https://github.com/certd/certd/commit/aa96859798166426e485947a6590464de189de05))
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
### Bug Fixes ### Bug Fixes

View File

@ -0,0 +1,88 @@
# 授权插件Demo
```ts
import { AccessInput, BaseAccess, IsAccess } from '@certd/pipeline';
import { isDev } from '../../utils/env.js';
/**
* 这个注解将注册一个授权配置
* 在certd的后台管理系统中用户可以选择添加此类型的授权
*/
@IsAccess({
name: 'demo',
title: '授权插件示例',
icon: 'clarity:plugin-line',
desc: '',
})
export class DemoAccess extends BaseAccess {
/**
* 授权属性配置
*/
@AccessInput({
title: '密钥Id',
component: {
placeholder: 'demoKeyId',
},
required: true,
})
demoKeyId = '';
/**
* 授权属性配置
*/
@AccessInput({
//标题
title: '密钥串',
component: {
//input组件的placeholder
placeholder: 'demoKeySecret',
},
//是否必填
required: true,
//改属性是否需要加密
encrypt: true,
})
//属性名称
demoKeySecret = '';
}
new DemoAccess();
```
# 阿里云授权
```ts
import { IsAccess, AccessInput, BaseAccess } from "@certd/pipeline";
@IsAccess({
name: "aliyun",
title: "阿里云授权",
desc: "",
icon: "ant-design:aliyun-outlined",
order: 0,
})
export class AliyunAccess extends BaseAccess {
@AccessInput({
title: "accessKeyId",
component: {
placeholder: "accessKeyId",
},
helper: "登录阿里云控制台->AccessKey管理页面获取。",
required: true,
})
accessKeyId = "";
@AccessInput({
title: "accessKeySecret",
component: {
placeholder: "accessKeySecret",
},
required: true,
encrypt: true,
helper: "注意证书申请需要dns解析权限其他阿里云插件需要对应的权限比如证书上传需要证书管理权限嫌麻烦就用主账号的全量权限的accessKey",
})
accessKeySecret = "";
}
new AliyunAccess();
```

View File

@ -45,4 +45,5 @@ Certd 存储了证书以及授权等敏感数据,所以需要严格保障安
* 请`务必`使用`web应用防火墙`防护本应用防止XSS、SQL注入等攻击 * 请`务必`使用`web应用防火墙`防护本应用防止XSS、SQL注入等攻击
* 请`务必`做好`服务器本身`的安全防护,防止数据库泄露 * 请`务必`做好`服务器本身`的安全防护,防止数据库泄露
* 请`务必`做好[`数据备份`](../../use/backup/),避免数据丢失 * 请`务必`做好[`数据备份`](../../use/backup/),避免数据丢失
* 请`务必`修改管理员账号用户名且建议将admin注册为普通用户且设置为禁用。
* 建议开启[`站点隐藏`](./hidden/)功能 * 建议开启[`站点隐藏`](./hidden/)功能

View File

@ -1,5 +1,6 @@
# 源码部署 # 源码部署
如果没有`git`和`nodejs`基础,则不推荐 如果没有开发基础、没有运维基础、没有`git`和`nodejs`基础,强烈不推荐此方式
## 一、源码安装 ## 一、源码安装
### 环境要求 ### 环境要求
@ -42,8 +43,8 @@ git pull
kill -9 $(lsof -t -i:7001) kill -9 $(lsof -t -i:7001)
# 重新编译启动 # 重新编译启动
./start.sh ./start.sh
```
```
::: warning ::: warning
升级certd版本前切记切记先备份一下数据 升级certd版本前切记切记先备份一下数据
::: :::

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -17,3 +17,57 @@ services:
# - 8.8.8.8 # 谷歌公共dns # - 8.8.8.8 # 谷歌公共dns
# - 8.8.4.4 # - 8.8.4.4
``` ```
如果仍然有问题,按如下步骤检查是否能够ping通域名
```shell
docker exec -it certd /bin/sh
ping www.baidu.com
ping gg.px.certd.handfree.work
ping app.handfree.work
```
如果您是宝塔部署的
可以试试将容器网络加入brige网络看是否解决问题
![img.png](images/baota-net.png)
如果还是不行,请联系我们
## 2. 连接IPv6超时
docker-compose 需要放开IPv6网络的配置
```yaml
services:
certd:
networks:
- ip6net
# ↓↓↓↓ -------------------------------------------------------------- 启用ipv6网络还需要把上面networks的注释放开
networks:
ip6net:
enable_ipv6: true
ipam:
config:
- subnet: 2001:db8::/64
```
## 3. SSL_CERT_NOT_MATCH_DOMAIN_ERROR
部署证书任务报类似 `SSL_CERT_NOT_MATCH_DOMAIN_ERROR`错误
这是由于当前流水线的证书域名与要部署的目标站点的域名不匹配导致的,在申请证书任务中,增加目标站点域名,重新运行流水线即可
## 4. 没有服务器配置文件,请检查是否开启了外网映射!
宝塔网站证书部署报错:`Error: 没有服务器配置文件,请检查是否开启了外网映射!`
解决方案:先手动在宝塔网站中设置一次证书
## 5. 如何查看容器日志
```shell
docker logs -f --tail 200 certd
```

14
docs/guide/qa/use.md Normal file
View File

@ -0,0 +1,14 @@
# 使用问题
## 1. 是否支持IP证书
因为ACME协议不支持IP证书所以certd目前也不支持IP证书
## 2. 建议设置多长时间运行一次流水线
建议每天运行一次,检查证书过期时间
当证书没过期时,自动跳过部署
当证书到期前35天创建流水线时可以修改将会自动重新申请证书自动部署

View File

@ -18,6 +18,8 @@ CERTD_HTTPS_port=7002
### 2、配置复制到本机任务 ### 2、配置复制到本机任务
将证书复制到certd的证书安装位置 将证书复制到certd的证书安装位置
证书路径:`ssl/cert.crt`
私钥路径:`ssl/cert.key`
![](./images/1.png) ![](./images/1.png)
![](./images/2.png) ![](./images/2.png)

View File

@ -9,5 +9,5 @@
} }
}, },
"npmClient": "pnpm", "npmClient": "pnpm",
"version": "1.34.2" "version": "1.34.3"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/publishlab/node-acme-client/compare/v1.34.2...v1.34.3) (2025-05-15)
**Note:** Version bump only for package @certd/acme-client
## [1.34.2](https://github.com/publishlab/node-acme-client/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/publishlab/node-acme-client/compare/v1.34.1...v1.34.2) (2025-05-11)
### Performance Improvements ### Performance Improvements

View File

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

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
**Note:** Version bump only for package @certd/basic
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
**Note:** Version bump only for package @certd/basic **Note:** Version bump only for package @certd/basic

View File

@ -1 +1 @@
20:23 00:08

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/basic", "name": "@certd/basic",
"private": false, "private": false,
"version": "1.34.2", "version": "1.34.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@ -45,5 +45,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "a1e504c1387e9b0554c8d030cb53c5058e7d683a" "gitHead": "0b152a3cb8ef13113f9612c1bf555755e6f5b209"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
**Note:** Version bump only for package @certd/pipeline
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
**Note:** Version bump only for package @certd/pipeline **Note:** Version bump only for package @certd/pipeline

View File

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

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
**Note:** Version bump only for package @certd/lib-huawei
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
**Note:** Version bump only for package @certd/lib-huawei **Note:** Version bump only for package @certd/lib-huawei

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-huawei", "name": "@certd/lib-huawei",
"private": false, "private": false,
"version": "1.34.2", "version": "1.34.3",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts", "types": "./dist/d/index.d.ts",
@ -24,5 +24,5 @@
"prettier": "^2.8.8", "prettier": "^2.8.8",
"tslib": "^2.8.1" "tslib": "^2.8.1"
}, },
"gitHead": "a1e504c1387e9b0554c8d030cb53c5058e7d683a" "gitHead": "0b152a3cb8ef13113f9612c1bf555755e6f5b209"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
**Note:** Version bump only for package @certd/lib-iframe
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
**Note:** Version bump only for package @certd/lib-iframe **Note:** Version bump only for package @certd/lib-iframe

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-iframe", "name": "@certd/lib-iframe",
"private": false, "private": false,
"version": "1.34.2", "version": "1.34.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@ -31,5 +31,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "a1e504c1387e9b0554c8d030cb53c5058e7d683a" "gitHead": "0b152a3cb8ef13113f9612c1bf555755e6f5b209"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
**Note:** Version bump only for package @certd/jdcloud
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
**Note:** Version bump only for package @certd/jdcloud **Note:** Version bump only for package @certd/jdcloud

View File

@ -1,6 +1,6 @@
{ {
"name": "@certd/jdcloud", "name": "@certd/jdcloud",
"version": "1.34.2", "version": "1.34.3",
"description": "jdcloud openApi sdk", "description": "jdcloud openApi sdk",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
@ -61,5 +61,5 @@
"fetch" "fetch"
] ]
}, },
"gitHead": "a1e504c1387e9b0554c8d030cb53c5058e7d683a" "gitHead": "0b152a3cb8ef13113f9612c1bf555755e6f5b209"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
**Note:** Version bump only for package @certd/lib-k8s
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
**Note:** Version bump only for package @certd/lib-k8s **Note:** Version bump only for package @certd/lib-k8s

View File

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

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
### Performance Improvements
* 小助手可以关闭 ([3e2101a](https://github.com/certd/certd/commit/3e2101aa5b56548614102e900d59819ce8c7e97c))
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
### Performance Improvements ### Performance Improvements

View File

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

View File

@ -27,6 +27,7 @@ export class SysPublicSettings extends BaseSettings {
icpNo?: string; icpNo?: string;
mpsNo?: string; mpsNo?: string;
robots?: boolean = true; robots?: boolean = true;
aiChatEnabled = true;
} }
export class SysPrivateSettings extends BaseSettings { export class SysPrivateSettings extends BaseSettings {

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
**Note:** Version bump only for package @certd/midway-flyway-js **Note:** Version bump only for package @certd/midway-flyway-js

View File

@ -1,6 +1,6 @@
{ {
"name": "@certd/midway-flyway-js", "name": "@certd/midway-flyway-js",
"version": "1.34.2", "version": "1.34.3",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
@ -46,5 +46,5 @@
"typeorm": "^0.3.11", "typeorm": "^0.3.11",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "a1e504c1387e9b0554c8d030cb53c5058e7d683a" "gitHead": "0b152a3cb8ef13113f9612c1bf555755e6f5b209"
} }

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
**Note:** Version bump only for package @certd/plugin-cert
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
**Note:** Version bump only for package @certd/plugin-cert **Note:** Version bump only for package @certd/plugin-cert

View File

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

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
### Performance Improvements
* 支持部署到maoyun cdn ([68f333f](https://github.com/certd/certd/commit/68f333fb87ce85eed27436ecb0f76351c0ccb0d1))
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
### Performance Improvements ### Performance Improvements

View File

@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-lib", "name": "@certd/plugin-lib",
"private": false, "private": false,
"version": "1.34.2", "version": "1.34.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@ -18,8 +18,8 @@
"dependencies": { "dependencies": {
"@alicloud/pop-core": "^1.7.10", "@alicloud/pop-core": "^1.7.10",
"@aws-sdk/client-s3": "^3.787.0", "@aws-sdk/client-s3": "^3.787.0",
"@certd/basic": "^1.34.2", "@certd/basic": "^1.34.3",
"@certd/pipeline": "^1.34.2", "@certd/pipeline": "^1.34.3",
"@kubernetes/client-node": "0.21.0", "@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0", "ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5", "basic-ftp": "^5.0.5",
@ -50,5 +50,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "a1e504c1387e9b0554c8d030cb53c5058e7d683a" "gitHead": "0b152a3cb8ef13113f9612c1bf555755e6f5b209"
} }

View File

@ -1,87 +1 @@
import { merge } from "lodash-es"; export * from "./util.js";
export function createCertDomainGetterInputDefine(opts?: { certInputKey?: string; props?: any }) {
const certInputKey = opts?.certInputKey || "cert";
return merge(
{
title: "当前证书域名",
component: {
name: "cert-domains-getter",
},
mergeScript: `
return {
component:{
inputKey: ctx.compute(({form})=>{
return form.${certInputKey}
}),
}
}
`,
required: true,
},
opts?.props
);
}
export function createRemoteSelectInputDefine(opts?: {
title: string;
certDomainsInputKey?: string;
accessIdInputKey?: string;
typeName?: string;
action: string;
type?: string;
watches?: string[];
helper?: string;
formItem?: any;
mode?: string;
multi?: boolean;
required?: boolean;
rules?: any;
mergeScript?: string;
}) {
const title = opts?.title || "请选择";
const certDomainsInputKey = opts?.certDomainsInputKey || "certDomains";
const accessIdInputKey = opts?.accessIdInputKey || "accessId";
const typeName = opts?.typeName;
const action = opts?.action;
const type = opts?.type || "plugin";
const watches = opts?.watches || [];
const helper = opts?.helper || "请选择";
let mode = "tags";
if (opts.multi === false) {
mode = undefined;
} else {
mode = opts?.mode ?? "tags";
}
const item = {
title,
component: {
name: "remote-select",
vModel: "value",
mode,
type,
typeName,
action,
watches: [certDomainsInputKey, accessIdInputKey, ...watches],
},
rules: opts?.rules,
required: opts.required ?? true,
mergeScript:
opts.mergeScript ??
`
return {
component:{
form: ctx.compute(({form})=>{
return form
})
},
}
`,
helper,
};
return merge(item, opts?.formItem);
}

View File

@ -0,0 +1,85 @@
import { merge } from "lodash-es";
export function createCertDomainGetterInputDefine(opts?: { certInputKey?: string; props?: any }) {
const certInputKey = opts?.certInputKey || "cert";
return merge(
{
title: "当前证书域名",
component: {
name: "cert-domains-getter",
},
mergeScript: `
return {
component:{
inputKey: ctx.compute(({form})=>{
return form.${certInputKey}
}),
}
}
`,
required: true,
},
opts?.props
);
}
export function createRemoteSelectInputDefine(opts?: {
title: string;
certDomainsInputKey?: string;
accessIdInputKey?: string;
typeName?: string;
action: string;
type?: string;
watches?: string[];
helper?: string;
formItem?: any;
mode?: string;
multi?: boolean;
required?: boolean;
rules?: any;
mergeScript?: string;
}) {
const title = opts?.title || "请选择";
const certDomainsInputKey = opts?.certDomainsInputKey || "certDomains";
const accessIdInputKey = opts?.accessIdInputKey || "accessId";
const typeName = opts?.typeName;
const action = opts?.action;
const type = opts?.type || "plugin";
const watches = opts?.watches || [];
const helper = opts?.helper || "请选择";
let mode = "tags";
if (opts.multi === false) {
mode = undefined;
} else {
mode = opts?.mode ?? "tags";
}
const item = {
title,
component: {
name: "remote-select",
vModel: "value",
mode,
type,
typeName,
action,
watches: [certDomainsInputKey, accessIdInputKey, ...watches],
},
rules: opts?.rules,
required: opts.required ?? true,
mergeScript:
opts.mergeScript ??
`
return {
component:{
form: ctx.compute(({form})=>{
return form
})
},
}
`,
helper,
};
return merge(item, opts?.formItem);
}

View File

@ -24,7 +24,7 @@ export class FtpAccess extends BaseAccess {
host!: string; host!: string;
@AccessInput({ @AccessInput({
title: "host", title: "端口",
value: 21, value: 21,
component: { component: {
placeholder: "21", placeholder: "21",

View File

@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
### Performance Improvements
* 小助手可以关闭 ([3e2101a](https://github.com/certd/certd/commit/3e2101aa5b56548614102e900d59819ce8c7e97c))
* 支持AI分析报错 ([aa96859](https://github.com/certd/certd/commit/aa96859798166426e485947a6590464de189de05))
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
### Bug Fixes ### Bug Fixes

View File

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

View File

@ -3,7 +3,7 @@
<FsFormProvider> <FsFormProvider>
<contextHolder /> <contextHolder />
<router-view /> <router-view />
<MaxKBChat ref="chatBox" /> <MaxKBChat v-if="settingsStore.sysPublic.aiChatEnabled !== false" ref="chatBox" />
</FsFormProvider> </FsFormProvider>
</AConfigProvider> </AConfigProvider>
</template> </template>
@ -22,7 +22,7 @@ import AConfigProvider from "ant-design-vue/es/config-provider";
import { Modal } from "ant-design-vue"; import { Modal } from "ant-design-vue";
import MaxKBChat from "/@/components/ai/index.vue"; import MaxKBChat from "/@/components/ai/index.vue";
import { util } from "/@/utils"; import { util } from "/@/utils";
import { useSettingStore } from "/@/store/settings";
defineOptions({ defineOptions({
name: "App", name: "App",
}); });
@ -49,6 +49,7 @@ localeChanged("zh-cn");
provide("fn:router.reload", reload); provide("fn:router.reload", reload);
provide("fn:locale.changed", localeChanged); provide("fn:locale.changed", localeChanged);
const settingsStore = useSettingStore();
const { isDark } = usePreferences(); const { isDark } = usePreferences();
const { tokens } = useAntdDesignTokens(); const { tokens } = useAntdDesignTokens();
@ -74,8 +75,12 @@ const tokenTheme = computed(() => {
// settingStore.init(); // settingStore.init();
const chatBox = ref(); const chatBox = ref();
onMounted(async () => { // onMounted(async () => {
// await util.sleep(5000); // await util.sleep(2000);
// await chatBox.value.openChat({ q: "hello" }); // await chatBox.value.openChat({ q: "hello" });
}); // });
const openChat = (q: string) => {
chatBox.value.openChat({ q });
};
provide("fn:ai.open", openChat);
</script> </script>

View File

@ -24,7 +24,7 @@
</div> </div>
<!-- 聊天按钮 --> <!-- 聊天按钮 -->
<div v-show="!chatVisible" class="maxkb-chat-button" :style="buttonPosition" @click="toggleChat"> <div v-show="!chatVisible" class="maxkb-chat-button" @click="toggleChat">
<img src="https://maxkb.handfree.work/ui/MaxKB.gif" /> <img src="https://maxkb.handfree.work/ui/MaxKB.gif" />
</div> </div>
@ -123,7 +123,10 @@ onMounted(() => {
}); });
async function openChat(req: { q: string }) { async function openChat(req: { q: string }) {
showGuide.value = true; if (!req.q) {
return;
}
chatVisible.value = true;
const iframeId = "maxkb-chat"; const iframeId = "maxkb-chat";
@ -132,7 +135,13 @@ async function openChat(req: { q: string }) {
throw new Error("iframe not found"); throw new Error("iframe not found");
return; return;
} }
iframe.contentWindow?.postMessage(req, "*"); iframe.contentWindow?.postMessage(
{
...req,
from: "certd",
},
"*"
);
} }
defineExpose({ defineExpose({
@ -227,10 +236,10 @@ defineExpose({
#maxkb .maxkb-tips .maxkb-button button::after { #maxkb .maxkb-tips .maxkb-button button::after {
border: none; border: none;
} }
#maxkb .maxkb-tips . { #maxkb .maxkb-tips {
position: absolute; position: absolute;
right: 20px; right: 20px;
top: 20px; //top: 20px;
cursor: pointer; cursor: pointer;
} }
#maxkb-chat-container { #maxkb-chat-container {
@ -248,7 +257,7 @@ defineExpose({
#maxkb .maxkb-chat-button { #maxkb .maxkb-chat-button {
position: fixed; position: fixed;
right: 0px; right: 10px;
bottom: 30px; bottom: 30px;
cursor: pointer; cursor: pointer;
z-index: 10000; z-index: 10000;

View File

@ -18,7 +18,7 @@ const props = defineProps<{
modelValue: string; modelValue: string;
title: string; title: string;
action: string; action: string;
form: any; form?: any;
button?: any; button?: any;
}>(); }>();

View File

@ -52,6 +52,10 @@ onErrorCaptured(e => {
onMounted(async () => { onMounted(async () => {
await settingStore.checkUrlBound(); await settingStore.checkUrlBound();
}); });
function goGithub() {
window.open("https://github.com/certd/certd");
}
</script> </script>
<template> <template>
@ -63,14 +67,14 @@ onMounted(async () => {
<LockScreen :avatar @to-login="handleLogout" /> <LockScreen :avatar @to-login="handleLogout" />
</template> </template>
<template #header-right-0> <template #header-right-0>
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block"> <div v-if="!settingStore.isComm" class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block">
<tutorial-button v-if="!settingStore.isComm" class="flex-center header-btn" /> <tutorial-button class="flex-center header-btn" />
</div> </div>
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full"> <div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
<vip-button class="flex-center header-btn" mode="nav" /> <vip-button class="flex-center header-btn" mode="nav" />
</div> </div>
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full"> <div v-if="!settingStore.isComm" class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
<fs-icon icon="ion:logo-github" /> <fs-button shape="circle" type="text" icon="ion:logo-github" :text="null" @click="goGithub" />
</div> </div>
</template> </template>
<template #footer> <template #footer>

View File

@ -41,6 +41,7 @@ export type SysPublicSetting = {
icpNo?: string; icpNo?: string;
mpsNo?: string; mpsNo?: string;
robots?: boolean; robots?: boolean;
aiChatEnabled?: boolean;
}; };
export type SuiteSetting = { export type SuiteSetting = {
enabled?: boolean; enabled?: boolean;

View File

@ -18,11 +18,11 @@ interface Props {
} }
defineOptions({ defineOptions({
name: "LayoutHeader" name: "LayoutHeader",
}); });
withDefaults(defineProps<Props>(), { withDefaults(defineProps<Props>(), {
theme: "light" theme: "light",
}); });
const emit = defineEmits<{ clearPreferencesAndLogout: [] }>(); const emit = defineEmits<{ clearPreferencesAndLogout: [] }>();
@ -39,42 +39,42 @@ const rightSlots = computed(() => {
if (preferences.widget.globalSearch) { if (preferences.widget.globalSearch) {
list.push({ list.push({
index: REFERENCE_VALUE, index: REFERENCE_VALUE,
name: "global-search" name: "global-search",
}); });
} }
if (preferencesButtonPosition.value.header) { if (preferencesButtonPosition.value.header) {
list.push({ list.push({
index: REFERENCE_VALUE + 10, index: REFERENCE_VALUE + 10,
name: "preferences" name: "preferences",
}); });
} }
if (preferences.widget.themeToggle) { if (preferences.widget.themeToggle) {
list.push({ list.push({
index: REFERENCE_VALUE + 20, index: REFERENCE_VALUE + 20,
name: "theme-toggle" name: "theme-toggle",
}); });
} }
if (preferences.widget.languageToggle) { if (preferences.widget.languageToggle) {
list.push({ list.push({
index: REFERENCE_VALUE + 30, index: REFERENCE_VALUE + 30,
name: "language-toggle" name: "language-toggle",
}); });
} }
if (preferences.widget.fullscreen) { if (preferences.widget.fullscreen) {
list.push({ list.push({
index: REFERENCE_VALUE + 40, index: REFERENCE_VALUE + 40,
name: "fullscreen" name: "fullscreen",
}); });
} }
if (preferences.widget.notification) { if (preferences.widget.notification) {
list.push({ list.push({
index: REFERENCE_VALUE + 50, index: REFERENCE_VALUE + 50,
name: "notification" name: "notification",
}); });
} }
Object.keys(slots).forEach((key) => { Object.keys(slots).forEach(key => {
const name = key.split("-"); const name = key.split("-");
if (key.startsWith("header-right")) { if (key.startsWith("header-right")) {
list.push({ index: Number(name[2]), name: key }); list.push({ index: Number(name[2]), name: key });
@ -89,11 +89,11 @@ const leftSlots = computed(() => {
if (preferences.widget.refresh) { if (preferences.widget.refresh) {
list.push({ list.push({
index: 0, index: 0,
name: "refresh" name: "refresh",
}); });
} }
Object.keys(slots).forEach((key) => { Object.keys(slots).forEach(key => {
const name = key.split("-"); const name = key.split("-");
if (key.startsWith("header-left")) { if (key.startsWith("header-left")) {
list.push({ index: Number(name[2]), name: key }); list.push({ index: Number(name[2]), name: key });
@ -108,7 +108,7 @@ function clearPreferencesAndLogout() {
</script> </script>
<template> <template>
<template v-for="slot in leftSlots.filter((item) => item.index < REFERENCE_VALUE)" :key="slot.name"> <template v-for="slot in leftSlots.filter(item => item.index < REFERENCE_VALUE)" :key="slot.name">
<slot :name="slot.name"> <slot :name="slot.name">
<template v-if="slot.name === 'refresh'"> <template v-if="slot.name === 'refresh'">
<VbenIconButton class="my-0 mr-1 rounded-md" @click="refresh"> <VbenIconButton class="my-0 mr-1 rounded-md" @click="refresh">
@ -120,7 +120,7 @@ function clearPreferencesAndLogout() {
<div class="flex-center hidden lg:block"> <div class="flex-center hidden lg:block">
<slot name="breadcrumb"></slot> <slot name="breadcrumb"></slot>
</div> </div>
<template v-for="slot in leftSlots.filter((item) => item.index > REFERENCE_VALUE)" :key="slot.name"> <template v-for="slot in leftSlots.filter(item => item.index > REFERENCE_VALUE)" :key="slot.name">
<slot :name="slot.name"></slot> <slot :name="slot.name"></slot>
</template> </template>
<div :class="`menu-align-${preferences.header.menuAlign}`" class="flex h-full min-w-0 flex-1 items-center"> <div :class="`menu-align-${preferences.header.menuAlign}`" class="flex h-full min-w-0 flex-1 items-center">

View File

@ -9,15 +9,15 @@ import { preferences, updatePreferences } from "/@/vben/preferences";
import { VbenDropdownRadioMenu, VbenIconButton } from "/@/vben//shadcn-ui"; import { VbenDropdownRadioMenu, VbenIconButton } from "/@/vben//shadcn-ui";
defineOptions({ defineOptions({
name: "LanguageToggle" name: "LanguageToggle",
}); });
async function handleUpdate(value: string) { async function handleUpdate(value: string) {
const locale = value as SupportedLanguagesType; const locale = value as SupportedLanguagesType;
updatePreferences({ updatePreferences({
app: { app: {
locale locale,
} },
}); });
await loadLocaleMessages(locale); await loadLocaleMessages(locale);
} }

View File

@ -11,11 +11,11 @@ interface Props {
} }
defineOptions({ defineOptions({
name: "ThemeToggleButton" name: "ThemeToggleButton",
}); });
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
type: "normal" type: "normal",
}); });
const isDark = defineModel<boolean>(); const isDark = defineModel<boolean>();
@ -29,13 +29,13 @@ const bindProps = computed(() => {
return type === "normal" return type === "normal"
? { ? {
variant: "heavy" as const variant: "heavy" as const,
} }
: { : {
class: "rounded-full", class: "rounded-full",
size: "icon" as const, size: "icon" as const,
style: { padding: "7px" }, style: { padding: "7px" },
variant: "icon" as const variant: "icon" as const,
}; };
}); });
@ -59,12 +59,12 @@ function toggleTheme(event: MouseEvent) {
const clipPath = [`circle(0px at ${x}px ${y}px)`, `circle(${endRadius}px at ${x}px ${y}px)`]; const clipPath = [`circle(0px at ${x}px ${y}px)`, `circle(${endRadius}px at ${x}px ${y}px)`];
document.documentElement.animate( document.documentElement.animate(
{ {
clipPath: isDark.value ? [...clipPath].reverse() : clipPath clipPath: isDark.value ? [...clipPath].reverse() : clipPath,
}, },
{ {
duration: 450, duration: 450,
easing: "ease-in", easing: "ease-in",
pseudoElement: isDark.value ? "::view-transition-old(root)" : "::view-transition-new(root)" pseudoElement: isDark.value ? "::view-transition-old(root)" : "::view-transition-new(root)",
} }
); );
}); });

View File

@ -10,16 +10,16 @@ import { ToggleGroup, ToggleGroupItem, VbenTooltip } from "/@/vben//shadcn-ui";
import ThemeButton from "./theme-button.vue"; import ThemeButton from "./theme-button.vue";
defineOptions({ defineOptions({
name: "ThemeToggle" name: "ThemeToggle",
}); });
withDefaults(defineProps<{ shouldOnHover?: boolean }>(), { withDefaults(defineProps<{ shouldOnHover?: boolean }>(), {
shouldOnHover: false shouldOnHover: false,
}); });
function handleChange(isDark: boolean) { function handleChange(isDark: boolean) {
updatePreferences({ updatePreferences({
theme: { mode: isDark ? "dark" : "light" } theme: { mode: isDark ? "dark" : "light" },
}); });
} }
@ -29,18 +29,18 @@ const PRESETS = [
{ {
icon: Sun, icon: Sun,
name: "light", name: "light",
title: $t("preferences.theme.light") title: $t("preferences.theme.light"),
}, },
{ {
icon: MoonStar, icon: MoonStar,
name: "dark", name: "dark",
title: $t("preferences.theme.dark") title: $t("preferences.theme.dark"),
}, },
{ {
icon: SunMoon, icon: SunMoon,
name: "auto", name: "auto",
title: $t("preferences.followSystem") title: $t("preferences.followSystem"),
} },
]; ];
</script> </script>
<template> <template>
@ -49,7 +49,7 @@ const PRESETS = [
<template #trigger> <template #trigger>
<ThemeButton :model-value="isDark" type="icon" @update:model-value="handleChange" /> <ThemeButton :model-value="isDark" type="icon" @update:model-value="handleChange" />
</template> </template>
<ToggleGroup :model-value="preferences.theme.mode" class="gap-2" type="single" variant="outline" @update:model-value="(val) => updatePreferences({ theme: { mode: val as ThemeModeType } })"> <ToggleGroup :model-value="preferences.theme.mode" class="gap-2" type="single" variant="outline" @update:model-value="val => updatePreferences({ theme: { mode: val as ThemeModeType } })">
<ToggleGroupItem v-for="item in PRESETS" :key="item.name" :value="item.name"> <ToggleGroupItem v-for="item in PRESETS" :key="item.name" :value="item.name">
<component :is="item.icon" class="size-5" /> <component :is="item.icon" class="size-5" />
</ToggleGroupItem> </ToggleGroupItem>

View File

@ -18,7 +18,7 @@ const props = withDefaults(defineProps<Props>(), {
disabled: false, disabled: false,
loading: false, loading: false,
size: "default", size: "default",
variant: "default" variant: "default",
}); });
const isDisabled = computed(() => { const isDisabled = computed(() => {

View File

@ -1,13 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ButtonVariants } from '../../ui'; import type { ButtonVariants } from "../../ui";
import type { VbenButtonProps } from './button'; import type { VbenButtonProps } from "./button";
import { computed, useSlots } from 'vue'; import { computed, useSlots } from "vue";
import { cn } from '/@/vben/shared/utils'; import { cn } from "/@/vben/shared/utils";
import { VbenTooltip } from '../tooltip'; import { VbenTooltip } from "../tooltip";
import VbenButton from './button.vue'; import VbenButton from "./button.vue";
interface Props extends VbenButtonProps { interface Props extends VbenButtonProps {
class?: any; class?: any;
@ -15,7 +15,7 @@ interface Props extends VbenButtonProps {
onClick?: () => void; onClick?: () => void;
tooltip?: string; tooltip?: string;
tooltipDelayDuration?: number; tooltipDelayDuration?: number;
tooltipSide?: 'bottom' | 'left' | 'right' | 'top'; tooltipSide?: "bottom" | "left" | "right" | "top";
variant?: ButtonVariants; variant?: ButtonVariants;
} }
@ -23,8 +23,8 @@ const props = withDefaults(defineProps<Props>(), {
disabled: false, disabled: false,
onClick: () => {}, onClick: () => {},
tooltipDelayDuration: 200, tooltipDelayDuration: 200,
tooltipSide: 'bottom', tooltipSide: "bottom",
variant: 'icon', variant: "icon",
}); });
const slots = useSlots(); const slots = useSlots();
@ -33,30 +33,13 @@ const showTooltip = computed(() => !!slots.tooltip || !!props.tooltip);
</script> </script>
<template> <template>
<VbenButton <VbenButton v-if="!showTooltip" :class="cn('rounded-full', props.class)" :disabled="disabled" :variant="variant" size="icon" @click="onClick">
v-if="!showTooltip"
:class="cn('rounded-full', props.class)"
:disabled="disabled"
:variant="variant"
size="icon"
@click="onClick"
>
<slot></slot> <slot></slot>
</VbenButton> </VbenButton>
<VbenTooltip <VbenTooltip v-else :delay-duration="tooltipDelayDuration" :side="tooltipSide">
v-else
:delay-duration="tooltipDelayDuration"
:side="tooltipSide"
>
<template #trigger> <template #trigger>
<VbenButton <VbenButton :class="cn('rounded-full', props.class)" :disabled="disabled" :variant="variant" size="icon" @click="onClick">
:class="cn('rounded-full', props.class)"
:disabled="disabled"
:variant="variant"
size="icon"
@click="onClick"
>
<slot></slot> <slot></slot>
</VbenButton> </VbenButton>
</template> </template>

View File

@ -11,13 +11,13 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
return "access"; return "access";
}); });
const AccessTypeDictRef = dict({ const AccessTypeDictRef = dict({
url: "/pi/access/accessTypeDict" url: "/pi/access/accessTypeDict",
}); });
const defaultPluginConfig = { const defaultPluginConfig = {
component: { component: {
name: "a-input", name: "a-input",
vModel: "value" vModel: "value",
} },
}; };
function buildDefineFields(define: any, form: any, mode: string) { function buildDefineFields(define: any, form: any, mode: string) {
@ -34,7 +34,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
const key = "access." + mapKey; const key = "access." + mapKey;
const field = { const field = {
...value, ...value,
key key,
}; };
const column = merge({ title: key }, defaultPluginConfig, field); const column = merge({ title: key }, defaultPluginConfig, field);
@ -77,13 +77,13 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
type: "dict-select", type: "dict-select",
dict: AccessTypeDictRef, dict: AccessTypeDictRef,
search: { search: {
show: true show: true,
}, },
column: { column: {
width: 200, width: 200,
component: { component: {
color: "auto" color: "auto",
} },
}, },
form: { form: {
component: { component: {
@ -100,7 +100,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
{item.label} {item.label}
</span> </span>
); );
} },
}, },
rules: [{ required: true, message: "请选择类型" }], rules: [{ required: true, message: "请选择类型" }],
valueChange: { valueChange: {
@ -116,7 +116,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
form.access = {}; form.access = {};
} }
buildDefineFields(define, form, mode); buildDefineFields(define, form, mode);
} },
}, },
helper: { helper: {
render: () => { render: () => {
@ -125,12 +125,12 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
return ""; return "";
} }
return <div innerHTML={utils.transformLink(define.desc)}></div>; return <div innerHTML={utils.transformLink(define.desc)}></div>;
} },
} },
}, },
addForm: { addForm: {
value: typeRef value: typeRef,
} },
} as ColumnCompositionProps, } as ColumnCompositionProps,
setting: { setting: {
column: { show: false }, column: { show: false },
@ -149,8 +149,8 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
valueResolve({ form }) { valueResolve({ form }) {
const setting = form.access; const setting = form.access;
form.setting = JSON.stringify(setting); form.setting = JSON.stringify(setting);
} },
} },
} as ColumnCompositionProps } as ColumnCompositionProps,
}; };
} }

View File

@ -21,7 +21,7 @@ async function batchUpdateGroupRequest(groupId: number) {
const pipelineGroupDictRef = dict({ const pipelineGroupDictRef = dict({
url: "/pi/pipeline/group/all", url: "/pi/pipeline/group/all",
value: "id", value: "id",
label: "name" label: "name",
}); });
const { openCrudFormDialog } = useFormWrapper(); const { openCrudFormDialog } = useFormWrapper();
@ -33,9 +33,9 @@ async function openGroupSelectDialog() {
type: "dict-select", type: "dict-select",
dict: pipelineGroupDictRef, dict: pipelineGroupDictRef,
form: { form: {
rules: [{ required: true, message: "请选择分组" }] rules: [{ required: true, message: "请选择分组" }],
} },
} },
}, },
form: { form: {
mode: "edit", mode: "edit",
@ -44,18 +44,18 @@ async function openGroupSelectDialog() {
await batchUpdateGroupRequest(form.groupId); await batchUpdateGroupRequest(form.groupId);
}, },
col: { col: {
span: 22 span: 22,
}, },
labelCol: { labelCol: {
style: { style: {
width: "100px" width: "100px",
} },
}, },
wrapper: { wrapper: {
title: "批量修改分组", title: "批量修改分组",
width: 600 width: 600,
} },
} },
} as any; } as any;
await openCrudFormDialog({ crudOptions }); await openCrudFormDialog({ crudOptions });
} }

View File

@ -22,6 +22,11 @@
</div> </div>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<template #footer>
<fs-button key="aiChat" type="primary" icon="ion:color-wand-outline" @click="taskModal.onAiChat">AI</fs-button>
<fs-button key="cancel" icon="ion:close-circle-outline" @click="taskModal.onOk"></fs-button>
<fs-button key="submit" icon="ion:checkmark-circle-outline" type="primary" @click="taskModal.onOk"></fs-button>
</template>
</a-modal> </a-modal>
</template> </template>
@ -37,11 +42,15 @@ export default {
props: {}, props: {},
emits: ["run"], emits: ["run"],
setup(props: any, ctx: any) { setup(props: any, ctx: any) {
const openAiChat: any = inject("fn:ai.open", (q: string) => {});
const taskModal = ref({ const taskModal = ref({
open: false, open: false,
onOk() { onOk() {
taskViewClose(); taskViewClose();
}, },
onAiChat() {
onAiChat();
},
cancelText: "关闭", cancelText: "关闭",
}); });
const { isMobile } = usePreferences(); const { isMobile } = usePreferences();
@ -52,6 +61,24 @@ export default {
return "left"; return "left";
}); });
function onAiChat() {
const logs = currentHistory.value?.logs[activeKey.value];
if (!logs || logs.length === 0) {
return;
}
let logText = "";
for (let log of logs) {
logText += log + "\n";
}
const maxLength = 5000;
if (logText.length > maxLength) {
logText = logText.substring(logText.length - maxLength);
}
if (openAiChat) {
openAiChat(logText);
}
}
const detail = ref({ nodes: [] }); const detail = ref({ nodes: [] });
const activeKey = ref(); const activeKey = ref();
const currentHistory: Ref<RunHistory> | undefined = inject("currentHistory"); const currentHistory: Ref<RunHistory> | undefined = inject("currentHistory");

View File

@ -9,7 +9,10 @@
<a-col :span="6"> <a-col :span="6">
<statistic-card title="用户总数" :count="count.userCount"> <statistic-card title="用户总数" :count="count.userCount">
<template #footer> <template #footer>
<router-link to="/sys/authority/user" class="flex"><fs-icon icon="ion:settings-outline" class="mr-5 fs-16" /> 管理用户</router-link> <router-link to="/sys/authority/user" class="flex">
<fs-icon icon="ion:settings-outline" class="mr-5 fs-16" />
管理用户
</router-link>
</template> </template>
</statistic-card> </statistic-card>
</a-col> </a-col>
@ -21,7 +24,10 @@
<a-col :span="6"> <a-col :span="6">
<statistic-card title="全站流水线总数" :count="count.pipelineCount"> <statistic-card title="全站流水线总数" :count="count.pipelineCount">
<template #footer> <template #footer>
<router-link to="/certd/pipeline" class="flex"><fs-icon icon="ion:settings-outline" class="mr-5 fs-16" /> 管理流水线</router-link> <router-link to="/certd/pipeline" class="flex">
<fs-icon icon="ion:settings-outline" class="mr-5 fs-16" />
管理流水线
</router-link>
</template> </template>
</statistic-card> </statistic-card>
</a-col> </a-col>
@ -42,21 +48,23 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from "vue"; import { onMounted, ref, Ref } from "vue";
import { FsIcon } from "@fast-crud/fast-crud"; import { FsIcon } from "@fast-crud/fast-crud";
import StatisticCard from "/@/views/framework/home/dashboard/statistic-card.vue"; import StatisticCard from "/@/views/framework/home/dashboard/statistic-card.vue";
import DayCount from "/@/views/framework/home/dashboard/charts/day-count.vue"; import DayCount from "/@/views/framework/home/dashboard/charts/day-count.vue";
import { GetStatisticCount } from "./api"; import { GetStatisticCount } from "./api";
const count = ref({}); const count: Ref = ref({});
function transformCountPerDayToChartData(key) {
count.value[key] = count.value[key].map((item) => { function transformCountPerDayToChartData(key: string) {
count.value[key] = count.value[key].map((item:any) => {
return { return {
name: item.date, name: item.date,
value: item.count value: item.count,
}; };
}); });
} }
async function loadCount() { async function loadCount() {
count.value = await GetStatisticCount(); count.value = await GetStatisticCount();
transformCountPerDayToChartData("userRegisterCountPerDay"); transformCountPerDayToChartData("userRegisterCountPerDay");

View File

@ -8,6 +8,9 @@
<a-input v-model:value="formState.public.mpsNo" placeholder="京公网安备xxxxxxx号" /> <a-input v-model:value="formState.public.mpsNo" placeholder="京公网安备xxxxxxx号" />
</a-form-item> </a-form-item>
<a-form-item label="开启小助手" :name="['public', 'aiChatEnabled']">
<a-switch v-model:checked="formState.public.aiChatEnabled" />
</a-form-item>
<a-form-item label="允许爬虫" :name="['public', 'robots']"> <a-form-item label="允许爬虫" :name="['public', 'robots']">
<a-switch v-model:checked="formState.public.robots" /> <a-switch v-model:checked="formState.public.robots" />
</a-form-item> </a-form-item>

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
### Performance Improvements
* 添加 FlexCDN 更新证书插件 ([bf040d4](https://github.com/certd/certd/commit/bf040d4c428d29c06fbaca5e29100e0c583b2b0b))
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11) ## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
### Bug Fixes ### Bug Fixes

View File

@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-server", "name": "@certd/ui-server",
"version": "1.34.2", "version": "1.34.3",
"description": "fast-server base midway", "description": "fast-server base midway",
"private": true, "private": true,
"type": "module", "type": "module",
@ -41,19 +41,19 @@
"@aws-sdk/client-acm": "^3.699.0", "@aws-sdk/client-acm": "^3.699.0",
"@aws-sdk/client-cloudfront": "^3.699.0", "@aws-sdk/client-cloudfront": "^3.699.0",
"@aws-sdk/client-s3": "^3.705.0", "@aws-sdk/client-s3": "^3.705.0",
"@certd/acme-client": "^1.34.2", "@certd/acme-client": "^1.34.3",
"@certd/basic": "^1.34.2", "@certd/basic": "^1.34.3",
"@certd/commercial-core": "^1.34.2", "@certd/commercial-core": "^1.34.3",
"@certd/jdcloud": "^1.34.2", "@certd/jdcloud": "^1.34.3",
"@certd/lib-huawei": "^1.34.2", "@certd/lib-huawei": "^1.34.3",
"@certd/lib-k8s": "^1.34.2", "@certd/lib-k8s": "^1.34.3",
"@certd/lib-server": "^1.34.2", "@certd/lib-server": "^1.34.3",
"@certd/midway-flyway-js": "^1.34.2", "@certd/midway-flyway-js": "^1.34.3",
"@certd/pipeline": "^1.34.2", "@certd/pipeline": "^1.34.3",
"@certd/plugin-cert": "^1.34.2", "@certd/plugin-cert": "^1.34.3",
"@certd/plugin-lib": "^1.34.2", "@certd/plugin-lib": "^1.34.3",
"@certd/plugin-plus": "^1.34.2", "@certd/plugin-plus": "^1.34.3",
"@certd/plus-core": "^1.34.2", "@certd/plus-core": "^1.34.3",
"@corsinvest/cv4pve-api-javascript": "^8.3.0", "@corsinvest/cv4pve-api-javascript": "^8.3.0",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120", "@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120", "@huaweicloud/huaweicloud-sdk-core": "^3.1.120",

View File

@ -1,16 +1,16 @@
import {Inject, Provide, Scope, ScopeEnum} from "@midwayjs/core"; import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
import {BaseService, PageReq} from "@certd/lib-server"; import { BaseService, PageReq } from "@certd/lib-server";
import {PluginEntity} from "../entity/plugin.js"; import { PluginEntity } from "../entity/plugin.js";
import {InjectEntityModel} from "@midwayjs/typeorm"; import { InjectEntityModel } from "@midwayjs/typeorm";
import {Repository} from "typeorm"; import { Repository } from "typeorm";
import {isComm} from "@certd/plus-core"; import { isComm } from "@certd/plus-core";
import {BuiltInPluginService} from "../../pipeline/service/builtin-plugin-service.js"; import { BuiltInPluginService } from "../../pipeline/service/builtin-plugin-service.js";
import {merge} from "lodash-es"; import { merge } from "lodash-es";
import {accessRegistry, notificationRegistry, pluginRegistry} from "@certd/pipeline"; import { accessRegistry, notificationRegistry, pluginRegistry } from "@certd/pipeline";
import {dnsProviderRegistry} from "@certd/plugin-cert"; import { dnsProviderRegistry } from "@certd/plugin-cert";
import {logger} from "@certd/basic"; import { logger } from "@certd/basic";
import yaml from "js-yaml"; import yaml from "js-yaml";
import {getDefaultAccessPlugin, getDefaultDeployPlugin, getDefaultDnsPlugin} from "./default-plugin.js"; import { getDefaultAccessPlugin, getDefaultDeployPlugin, getDefaultDnsPlugin } from "./default-plugin.js";
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";

View File

@ -0,0 +1,110 @@
import { IsAccess, AccessInput, BaseAccess } from "@certd/pipeline";
import { HttpClient } from "@certd/basic";
import { FlexCDNClient } from "./client.js";
/**
*/
@IsAccess({
name: "flexcdn",
title: "FlexCDN授权",
desc: "",
icon: "svg:icon-lucky"
})
export class FlexCDNAccess extends BaseAccess {
@AccessInput({
title: "接口地址",
component: {
placeholder: "http://xxxxxxx:8080",
name: "a-input",
vModel: "value"
},
required: true
})
endpoint!: string;
@AccessInput({
title: "用户类型",
component: {
placeholder: "请选择",
name: "a-select",
vModel: "value",
options: [
{
value: "user",
label: "普通用户"
},
{
value: "admin",
label: "管理员"
}
]
},
required: true
})
type!: string;
@AccessInput({
title: "accessKeyId",
component: {
placeholder: "accessKeyId",
component: {
name: "a-input",
vModel: "value"
}
},
encrypt: false,
required: true
})
accessKeyId!: string;
@AccessInput({
title: "accessKey",
component: {
placeholder: "accessKey",
component: {
name: "a-input",
vModel: "value"
}
},
encrypt: true,
required: true
})
accessKey!: string;
@AccessInput({
title: "忽略证书校验",
component: {
name: "a-switch",
vModel: "checked"
},
encrypt: false,
required: true
})
skipSslVerify!: boolean;
@AccessInput({
title: "测试",
component: {
name: "api-test",
action: "TestRequest"
},
helper: "点击测试接口看是否正常"
})
testRequest = true;
async onTestRequest() {
const http: HttpClient = this.ctx.http;
const client = new FlexCDNClient({
logger: this.ctx.logger,
http,
access: this
});
const token = await client.getToken();
if (token) {
return "ok";
}
throw "测试失败,未知错误";
}
}
new FlexCDNAccess();

View File

@ -0,0 +1,81 @@
import { HttpClient, HttpRequestConfig, ILogger } from "@certd/basic";
import { FlexCDNAccess } from "./access.js";
export class FlexCDNClient {
http: HttpClient;
logger: ILogger;
access: FlexCDNAccess;
token: string;
constructor(opts: { logger: ILogger; http: HttpClient; access: FlexCDNAccess }) {
this.logger = opts.logger;
this.http = opts.http;
this.access = opts.access;
}
async getToken() {
/*
2APIAccessToken
/APIAccessTokenService/getAPIAccessToken
POST
{
"type": "admin",
"accessKeyId": "zr9cmR42AEZxRyIV",
"accessKey": "2w5p5NSZZuplUPsfPMzM7dFmTrI7xyja"
}
type - AccessKey userAccessKey admin
accessKeyId accessKey 1AccessKey
{
"code": 200,
"data": {
"token": "IKNSMufZ1vDiXp5rSd9QR01m1174Oum5sah4amWFgbRb7lOKjuk62Spl7hgcazctzGhGG7jPgfmYUPojulC0FK5cLbrj8n7kxW7BtSawH9gWW14IWOzBY6UcpyXQndFu",
"expiresAt": 1609686945
},
"message": "ok"
}
*/
const res = await this.doRequest({
url: "/APIAccessTokenService/getAPIAccessToken",
method: "POST",
data: {
type: this.access.type,
accessKeyId: this.access.accessKeyId,
accessKey: this.access.accessKey,
},
});
this.token = res.token
return this.token
}
async doRequest(req: HttpRequestConfig) {
const headers = {
...req.headers,
}
if(this.token){
headers[ "X-Cloud-Access-Token"] = this.token
}
const res = await this.http.request({
...req,
headers,
baseURL: this.access.endpoint,
logRes:false,
logParams:false,
skipSslVerify: true,
});
if (res.code === 200) {
return res.data;
} else {
throw new Error(res.message);
}
}
}

View File

@ -0,0 +1,3 @@
export * from "./plugins/index.js";
export * from "./access.js";
export * from "./client.js";

View File

@ -0,0 +1 @@
export * from "./plugin-refresh-cert.js";

View File

@ -0,0 +1,128 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { FlexCDNAccess } from "../access.js";
import { FlexCDNClient } from "../client.js";
@IsTaskPlugin({
//命名规范,插件类型+功能就是目录plugin-demo中的demo大写字母开头驼峰命名
name: "FlexCDNRefreshCert",
title: "FlexCDN-更新证书",
icon: "svg:icon-lucky",
//插件分组
group: pluginGroups.cdn.key,
needPlus: false,
default: {
//默认值配置照抄即可
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,
},
},
})
//类名规范跟上面插件名称name一致
export class FlexCDNRefreshCert extends AbstractTaskPlugin {
//证书选择,此项必须要有
@TaskInput({
title: "域名证书",
helper: "请选择前置任务输出的域名证书",
component: {
name: "output-selector",
from: [...CertApplyPluginNames],
},
// required: true, // 必填
})
cert!: CertInfo;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[];
//授权选择框
@TaskInput({
title: "FlexCDN授权",
component: {
name: "access-selector",
type: "FlexCDN", //固定授权类型
},
required: true, //必填
})
accessId!: string;
//
@TaskInput(
createRemoteSelectInputDefine({
title: "证书Id",
helper: "要更新的Flex证书id",
action: FlexCDNRefreshCert.prototype.onGetCertList.name,
})
)
certList!: number[];
//插件实例化时执行的方法
async onInstance() {}
//插件执行方法
async execute(): Promise<void> {
const access: FlexCDNAccess = await this.getAccess<FlexCDNAccess>(this.accessId);
const client = new FlexCDNClient({
http: this.ctx.http,
logger: this.logger,
access,
});
await client.getToken();
for (const item of this.certList) {
this.logger.info(`开始更新证书:${item}`);
const res = await client.doRequest({
url: `/SSLCertService/findEnabledSSLCertConfig`,
data: {
sslCertId: item,
},
});
await client.doRequest({
url: `/SSLCertService/updateSSLCert`,
data: {
...res,
sslCertId: item,
certData: this.cert.crt,
keyData: this.cert.key,
},
});
this.logger.info(`更新证书${item}成功`);
}
this.logger.info("部署完成");
}
async onGetCertList() {
const access: FlexCDNAccess = await this.getAccess<FlexCDNAccess>(this.accessId);
const client = new FlexCDNClient({
http: this.ctx.http,
logger: this.logger,
access,
});
await client.getToken();
const res = await client.doRequest({
url: "/SSLCertService/listSSLCerts",
data: { size: 1000},
method: "POST",
});
const list = res.sslCertsJSON;
if (!list || list.length === 0) {
throw new Error("没有找到证书,请先在控制台上传一次证书且关联网站");
}
const options = list.map((item: any) => {
return {
label: `${item.name}<${item.id}-${item.firstServerName}>`,
value: item.id,
domain: JSON.parse(item.serverNamesJSON),
};
});
return this.ctx.utils.options.buildGroupOptions(options, this.certDomains);
}
}
//实例化一下,注册插件
new FlexCDNRefreshCert();

View File

@ -64,7 +64,7 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
crtPath!: string; crtPath!: string;
@TaskInput({ @TaskInput({
title: '私钥保存路径', title: '私钥保存路径',
helper: '需要有写入权限,路径要包含私钥文件名,例如:/tmp/cert.key', helper: '原本的私钥保存路径,需要有写入权限,路径要包含私钥文件名,例如:/tmp/cert.key',
component: { component: {
placeholder: '/root/deploy/nginx/cert.key', placeholder: '/root/deploy/nginx/cert.key',
}, },
@ -212,8 +212,9 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
name: 'a-textarea', name: 'a-textarea',
vModel: 'value', vModel: 'value',
rows: 6, rows: 6,
placeholder: 'systemctl restart nginx ',
}, },
helper: '上传后执行脚本命令,不填则不执行\n注意如果目标主机是windows且终端是cmd系统会自动将多行命令通过“&&”连接成一行', helper: '上传后执行脚本命令,让证书生效比如重启nginx,不填则不执行\n注意如果目标主机是windows且终端是cmd系统会自动将多行命令通过“&&”连接成一行',
required: false, required: false,
}) })
script!: string; script!: string;

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,31 @@
# #
set -e set -e
echo "即将删除packages下除ui之外的其他目录按y确认如果您没有修改过源码按y即可" echo "即将删除packages下除ui之外的其他目录按y确认如果您没有修改过源码按y即可"
read -p "y/n: " confirm read -p "y/n: " confirm
if [ $confirm != "y" ]; then if [ $confirm != "y" ]; then
echo "取消操作" echo "取消操作"
exit 1 exit 1
fi fi
find ./packages -mindepth 1 -maxdepth 1 -type d ! -name 'ui' -exec rm -rf {} +
find ./packages -mindepth 1 -maxdepth 1 -type d ! -name 'ui' -exec rm -rf {} +
echo "删除成功" echo "删除成功"
# 检查输入是否正确 循环输入
while true; do
echo "是否后台运行(第一次运行建议选择n调试没有问题之后重新运行选择y)"
read -p "y/n: " confirmNohup
# 校验输入是否正确
if [ $confirmNohup != "y" ] && [ $confirmNohup != "n" ]; then
echo "输入错误"
else
break
fi
done
echo "安装pnpm, 前提是已经安装了nodejs" echo "安装pnpm, 前提是已经安装了nodejs"
npm install -g pnpm@ --registry https://registry.npmmirror.com npm install -g pnpm --registry https://registry.npmmirror.com
echo "安装依赖" echo "安装依赖"
pnpm install --registry https://registry.npmmirror.com pnpm install --registry https://registry.npmmirror.com
@ -27,8 +41,14 @@ cd ../certd-server
npm run build npm run build
echo "构建完成" echo "构建完成"
echo "启动服务" echo "启动服务"
# 前台运行
npm run start
# 后台运行 # 前台运行
# nohup npm run start & if [ $confirmNohup != "y" ]; then
echo "当前运行模式为前台运行ctrl+c或者关闭ssh将会停止运行"
npm run start
else
echo "当前运行模式为后台运行可以通过tail -f ./certd.log 命令查看日志"
nohup npm run start > certd.log &
fi

View File

@ -10,6 +10,7 @@
3. 准备好以上DNS解析服务商的AccessKey 和 AccessSecret 3. 准备好以上DNS解析服务商的AccessKey 和 AccessSecret
4. 证书要部署的目标(可选,单纯当成证书申请工具用也不错) 4. 证书要部署的目标(可选,单纯当成证书申请工具用也不错)
## 自动化流水线创建 ## 自动化流水线创建
### 1. 创建证书申请部署流水线 ### 1. 创建证书申请部署流水线