Compare commits

...

46 Commits

Author SHA1 Message Date
xiaojunnuo
023db4e04e v1.34.7 2025-05-26 23:24:35 +08:00
xiaojunnuo
5a4b95f5fe build: prepare to build 2025-05-26 23:20:59 +08:00
xiaojunnuo
b091657b5c perf: 优化阿里云DCDN插件,支持多选 2025-05-26 23:10:31 +08:00
xiaojunnuo
f7bf5c9328 chore: 2025-05-26 22:50:58 +08:00
xiaojunnuo
86e521b9aa chore: 2025-05-26 22:44:56 +08:00
xiaojunnuo
e08cf57b72 perf: 支持部署到farcdn 2025-05-26 22:22:39 +08:00
xiaojunnuo
9e06cb9a83 docs: 2025-05-26 00:03:22 +08:00
xiaojunnuo
c65e8622b8 Merge branch 'v2-dev' into v2 2025-05-26 00:00:32 +08:00
xiaojunnuo
7795efeb7a build: publish 2025-05-25 23:46:02 +08:00
xiaojunnuo
e725e0020e build: trigger build image 2025-05-25 23:45:46 +08:00
xiaojunnuo
8478ce25f1 v1.34.6 2025-05-25 23:44:23 +08:00
xiaojunnuo
22cdac6210 build: prepare to build 2025-05-25 23:42:01 +08:00
xiaojunnuo
3422a1a59f perf: 站点证书监控增加通知设置 2025-05-25 23:38:25 +08:00
xiaojunnuo
f807b8cb46 fix: 修复lego模式下每次都重新申请证书的bug 2025-05-25 22:58:30 +08:00
xiaojunnuo
e1e510ce1e fix: 修复公共插件配置修改不生效的bug,优化系统设置参数注入时机
- 将系统设置参数注入移至 outputContext读取输入参数之后
-修复了某些情况下系统设置参数可能被覆盖的问题
- 优化了代码结构,提高了可读性和维护性
2025-05-25 21:08:23 +08:00
xiaojunnuo
36bc3ff22d fix: 优化 RunnableError错误信息展示
- 确保在不同错误场景下都能正确显示错误详情
2025-05-25 20:50:15 +08:00
xiaojunnuo
1db1ffde99 perf: 添加阿里云 ESA证书部署插件
- 新增 AliyunDeployCertToESA 插件类,实现证书上传和部署到阿里云 ESA 功能
- 优化证书名称生成逻辑,支持通配符域名
- 重构部分代码,提高可复用性和可维护性
- 更新相关依赖版本,确保兼容性
2025-05-22 23:21:50 +08:00
xiaojunnuo
7984b625ba fix: 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug 2025-05-20 23:37:24 +08:00
xiaojunnuo
bb22f062ed perf: 二次认证页面中,添加动态验证码输入框的焦点控制,提升用户体验 2025-05-20 23:28:09 +08:00
xiaojunnuo
a3086e6a5b fix(cert): 修正证书过期时间计算逻辑 2025-05-20 23:19:50 +08:00
xiaojunnuo
1eb9bd34fd docs: 2025-05-20 09:36:13 +08:00
xiaojunnuo
cff7baaaad Merge branch 'v2-dev' into v2 2025-05-20 01:42:12 +08:00
xiaojunnuo
47af700375 build: publish 2025-05-20 01:40:26 +08:00
xiaojunnuo
eb7f53a1e3 build: trigger build image 2025-05-20 01:40:08 +08:00
xiaojunnuo
d23792fda2 v1.34.5 2025-05-20 01:38:18 +08:00
xiaojunnuo
b5cbb8e450 build: prepare to build 2025-05-20 01:35:39 +08:00
xiaojunnuo
fc037b4518 Merge remote-tracking branch 'origin/v2-dev' into v2-dev 2025-05-20 01:13:50 +08:00
xiaojunnuo
c04921f42b docs: 2025-05-20 01:13:01 +08:00
xiaojunnuo
8af3463668 perf: aaWaf、cdnfly站点选择支持查询 2025-05-20 01:11:26 +08:00
xiaojunnuo
094565ccd6 perf: 支持部署到宝塔aaWAF 2025-05-20 00:27:18 +08:00
xiaojunnuo
07b9769504 docs: 2025-05-19 11:34:59 +08:00
xiaojunnuo
566b12f5d1 perf: 1panel增加授权测试按钮 2025-05-19 10:58:28 +08:00
xiaojunnuo
a560999d13 perf: 优化钉钉通知标题颜色 2025-05-17 01:13:36 +08:00
xiaojunnuo
a818a3d293 perf: 优化飞书通知为卡片模式 2025-05-17 00:47:28 +08:00
xiaojunnuo
4d68a174cb Merge branch 'v2-dev' into v2 2025-05-17 00:14:16 +08:00
xiaojunnuo
905219e523 build: publish 2025-05-17 00:05:31 +08:00
xiaojunnuo
c675b87040 build: trigger build image 2025-05-17 00:05:13 +08:00
xiaojunnuo
ed1a9fc7aa Merge branch 'v2-dev' into v2 2025-05-16 00:21:55 +08:00
xiaojunnuo
47ebab237b Merge branch 'v2-dev' into v2 2025-05-11 20:29:59 +08:00
xiaojunnuo
f9553e7d44 Merge branch 'v2-dev' into v2 2025-05-06 00:33:19 +08:00
xiaojunnuo
ae51676471 Merge branch 'v2-dev' into v2 2025-04-28 17:31:04 +08:00
xiaojunnuo
f933fb705c Merge branch 'v2-dev' into v2 2025-04-27 02:01:28 +08:00
xiaojunnuo
918ea59b9a Merge branch 'v2-dev' into v2 2025-04-22 22:49:53 +08:00
xiaojunnuo
b9dab77c8b Merge branch 'v2-dev' into v2 2025-04-21 00:18:53 +08:00
xiaojunnuo
4159534a64 Merge branch 'v2-dev' into v2 2025-04-17 23:38:29 +08:00
xiaojunnuo
d00177a9b6 chore: 2025-04-16 00:04:40 +08:00
82 changed files with 1599 additions and 245 deletions

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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
### Performance Improvements
* 优化阿里云DCDN插件支持多选 ([b091657](https://github.com/certd/certd/commit/b091657b5c537acf2442a2bfc345d0a77f5e2c50))
* 支持部署到farcdn ([e08cf57](https://github.com/certd/certd/commit/e08cf57b72128998f487ab6469868052fbce0dba))
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
### Bug Fixes
* 修复公共插件配置修改不生效的bug优化系统设置参数注入时机 ([e1e510c](https://github.com/certd/certd/commit/e1e510ce1e37a5ae82478226b6987a83f22d1ecb))
* 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug ([7984b62](https://github.com/certd/certd/commit/7984b625ba6727132f205db8e25f790bce27b2f7))
* 修复lego模式下每次都重新申请证书的bug ([f807b8c](https://github.com/certd/certd/commit/f807b8cb465cc329fa034ecbef94e18ef394f870))
* 优化 RunnableError错误信息展示 ([36bc3ff](https://github.com/certd/certd/commit/36bc3ff22da93ba342c3c1103d7ee2bbcecf44f2))
* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c))
### Performance Improvements
* 二次认证页面中,添加动态验证码输入框的焦点控制,提升用户体验 ([bb22f06](https://github.com/certd/certd/commit/bb22f062ed4ab4b5b71938270fe4cc666af6b8e7))
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
### Performance Improvements
* 1panel增加授权测试按钮 ([566b12f](https://github.com/certd/certd/commit/566b12f5d14ce10e8f5cf1807c58f7bf27f0d199))
* 优化钉钉通知标题颜色 ([a560999](https://github.com/certd/certd/commit/a560999d13eed18d08dd32ee530166569e3f8746))
* 优化飞书通知为卡片模式 ([a818a3d](https://github.com/certd/certd/commit/a818a3d293e22fb46979bc77055c05621a6fed81))
* 支持部署到宝塔aaWAF ([094565c](https://github.com/certd/certd/commit/094565ccd619ef671c6c11ce5fb7fd54a7a21d1c))
* aaWaf、cdnfly站点选择支持查询 ([8af3463](https://github.com/certd/certd/commit/8af3463668a40b9b99febb02e3b4e0d9d8d719b4))
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
### Bug Fixes

View File

@@ -110,8 +110,7 @@ https://certd.handfree.work/
> * 请务必使用web应用防火墙防护本应用防止XSS、SQL注入等攻击
> * 请务必做好服务器本身的安全防护,防止数据库泄露
> * 请务必做好数据备份,避免数据丢失
> * [更多安全生产建议点我](https://certd.docmirror.cn/guide/feature/safe/)
## 五、更多帮助

View File

@@ -1 +1 @@
00:14
23:45

View File

@@ -16,7 +16,7 @@ services:
- "7001:7001"
# ↓↓↓↓ ---------------------------------------------------------- https端口可以根据实际情况是否暴露该端口
- "7002:7002"
#↓↓↓↓ -------------------------------------------------------------- 如果出现getaddrinfo ENOTFOUND错误可以尝试设置dns
#↓↓↓↓ -------------------------------------------------------------- 如果出现getaddrinfo EAI_AGAIN 或 getaddrinfo ENOTFOUND 错误可以尝试设置dns
# dns:
# - 223.5.5.5 # 阿里云公共dns
# - 223.6.6.6

View File

@@ -91,14 +91,14 @@ export default defineConfig({
{text: "多数据库支持", link: "/guide/install/database.md"},
{text: "开放接口", link: "/guide/open/index.md"},
{
text: "站点安全", link: "/guide/feature/safe"
text: "站点安全", link: "/guide/feature/safe/"
},
{
text: "插件列表", items: [
{text: "授权提供商", link: "/guide/plugins/access"},
{text: "DNS提供商", link: "/guide/plugins/dns-provider"},
{text: "任务插件", link: "/guide/plugins/deploy"},
{text: "通知插件", link: "/guide/plugins/notification"},
{text: "授权提供商", link: "/guide/plugins/access.md"},
{text: "DNS提供商", link: "/guide/plugins/dns-provider.md"},
{text: "任务插件", link: "/guide/plugins/deploy.md"},
{text: "通知插件", link: "/guide/plugins/notification.md"},
]
},
]
@@ -106,7 +106,7 @@ export default defineConfig({
{
text: "常见问题",
items: [
{text: "QA", link: "/guide/qa/use"},
{text: "QA", link: "/guide/qa/use.md"},
{text: "常见报错处理", link: "/guide/qa/"},
{text: "群晖证书部署", link: "/guide/use/synology/"},
{text: "腾讯云密钥获取", link: "/guide/use/tencent/"},
@@ -139,7 +139,6 @@ export default defineConfig({
{text: "捐赠", link: "/guide/donate/"},
{text: "开源协议", link: "/guide/license/"},
{text: "我的其他开源项目", link: "/guide/link/"},
]
}
],

View File

@@ -3,6 +3,45 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
### Bug Fixes
* 修复公共插件配置修改不生效的bug优化系统设置参数注入时机 ([e1e510c](https://github.com/certd/certd/commit/e1e510ce1e37a5ae82478226b6987a83f22d1ecb))
* 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug ([7984b62](https://github.com/certd/certd/commit/7984b625ba6727132f205db8e25f790bce27b2f7))
* 修复lego模式下每次都重新申请证书的bug ([f807b8c](https://github.com/certd/certd/commit/f807b8cb465cc329fa034ecbef94e18ef394f870))
* 优化 RunnableError错误信息展示 ([36bc3ff](https://github.com/certd/certd/commit/36bc3ff22da93ba342c3c1103d7ee2bbcecf44f2))
* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c))
### Performance Improvements
* 二次认证页面中,添加动态验证码输入框的焦点控制,提升用户体验 ([bb22f06](https://github.com/certd/certd/commit/bb22f062ed4ab4b5b71938270fe4cc666af6b8e7))
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
### Performance Improvements
* 1panel增加授权测试按钮 ([566b12f](https://github.com/certd/certd/commit/566b12f5d14ce10e8f5cf1807c58f7bf27f0d199))
* 优化钉钉通知标题颜色 ([a560999](https://github.com/certd/certd/commit/a560999d13eed18d08dd32ee530166569e3f8746))
* 优化飞书通知为卡片模式 ([a818a3d](https://github.com/certd/certd/commit/a818a3d293e22fb46979bc77055c05621a6fed81))
* 支持部署到宝塔aaWAF ([094565c](https://github.com/certd/certd/commit/094565ccd619ef671c6c11ce5fb7fd54a7a21d1c))
* aaWaf、cdnfly站点选择支持查询 ([8af3463](https://github.com/certd/certd/commit/8af3463668a40b9b99febb02e3b4e0d9d8d719b4))
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
### Bug Fixes
* 修复部署flexcdn问题 ([76b19a4](https://github.com/certd/certd/commit/76b19a4980f8edba5238543b82a7811e1003746c))
* 修复插件导入的bug ([677fec0](https://github.com/certd/certd/commit/677fec0a0b6fceb4966705e471bbfeeda91610c7))
* 修复导入在线插件不生效的bug ([fcf8309](https://github.com/certd/certd/commit/fcf8309c238208281ecb4575b2c3cfe50c11d783))
* 修复自建插件保存丢失部署策略的bug ([863e74d](https://github.com/certd/certd/commit/863e74dd2e3912f950ff5025b5ed0070aeb37035))
### Performance Improvements
* 调整小助手,仅在登录之后显示 ([aebb07c](https://github.com/certd/certd/commit/aebb07c5cc8b1f233b9d203ff017ac60e6971a85))
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
### Performance Improvements

View File

@@ -1,12 +1,12 @@
# 常见报错解决
## 1. getaddrinfo ENOTFOUND错误
如果出现`getaddrinfo ENOTFOUND`错误,可以尝试在`docker-compose.yaml`中设置dns
如果出现`getaddrinfo ENOTFOUND`/`getaddrinfo EAI_AGAIN`错误,可以尝试在`docker-compose.yaml`中设置dns
```yaml
version: '3.3' # 兼容旧版docker-compose
services:
certd:
#↓↓↓↓ ------------ # 如果出现getaddrinfo ENOTFOUND错误可以尝试设置dns
#↓↓↓↓ ------------ # 如果出现getaddrinfo ENOTFOUND 或 EAI_AGAIN错误可以尝试设置dns
dns:
- 223.5.5.5 # 阿里云公共dns
- 223.6.6.6

View File

@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.34.4"
"version": "1.34.7"
}

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.7](https://github.com/publishlab/node-acme-client/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/acme-client
## [1.34.6](https://github.com/publishlab/node-acme-client/compare/v1.34.5...v1.34.6) (2025-05-25)
**Note:** Version bump only for package @certd/acme-client
## [1.34.5](https://github.com/publishlab/node-acme-client/compare/v1.34.4...v1.34.5) (2025-05-19)
**Note:** Version bump only for package @certd/acme-client
## [1.34.4](https://github.com/publishlab/node-acme-client/compare/v1.34.3...v1.34.4) (2025-05-16)
**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.34.4",
"version": "1.34.7",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.34.4",
"@certd/basic": "^1.34.7",
"@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5",
"axios": "^1.7.2",
@@ -69,5 +69,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "0b152a3cb8ef13113f9612c1bf555755e6f5b209"
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
}

View File

@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/basic
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
**Note:** Version bump only for package @certd/basic
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
### Performance Improvements
* 支持部署到宝塔aaWAF ([094565c](https://github.com/certd/certd/commit/094565ccd619ef671c6c11ce5fb7fd54a7a21d1c))
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
### Bug Fixes

View File

@@ -1 +1 @@
23:58
23:20

View File

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

View File

@@ -209,6 +209,10 @@ export function createAxiosService({ logger }: { logger: Logger }) {
logger.error("AggregateError", error);
}
const err = new HttpError(error);
if (error.response?.config?.logParams === false) {
delete err.request?.params;
delete err.request?.data;
}
return Promise.reject(err);
}
);

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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/pipeline
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
### Bug Fixes
* 修复公共插件配置修改不生效的bug优化系统设置参数注入时机 ([e1e510c](https://github.com/certd/certd/commit/e1e510ce1e37a5ae82478226b6987a83f22d1ecb))
* 优化 RunnableError错误信息展示 ([36bc3ff](https://github.com/certd/certd/commit/36bc3ff22da93ba342c3c1103d7ee2bbcecf44f2))
### Performance Improvements
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
### Performance Improvements
* 优化钉钉通知标题颜色 ([a560999](https://github.com/certd/certd/commit/a560999d13eed18d08dd32ee530166569e3f8746))
* 优化飞书通知为卡片模式 ([a818a3d](https://github.com/certd/certd/commit/a818a3d293e22fb46979bc77055c05621a6fed81))
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
### Bug Fixes

View File

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

View File

@@ -218,7 +218,7 @@ export class Executor {
returnType: ResultType.error,
runnable: t,
});
errorMessage += `任务${t.title}执行失败,错误详情:${e.message}`;
errorMessage += `任务${t.title}执行失败,错误详情${e.message}`;
}
}
if (errorList.length > 0) {
@@ -295,6 +295,12 @@ export class Executor {
const pluginConfig = await this.options.pluginConfigService.getPluginConfig(pluginName);
//从outputContext读取输入参数
const input = cloneDeep(step.input);
const sysInput = pluginConfig.sysSetting?.input || {};
//注入系统设置参数
for (const sysInputKey in sysInput) {
input[sysInputKey] = sysInput[sysInputKey];
}
Decorator.inject(define.input, instance, input, (item, key) => {
if (item.component?.name === "output-selector") {
const contextKey = input[key];
@@ -314,12 +320,6 @@ export class Executor {
}
});
const sysInput = pluginConfig.sysSetting?.input || {};
//注入系统设置参数
for (const sysInputKey in sysInput) {
input[sysInputKey] = sysInput[sysInputKey];
}
const newInputHash = hashUtils.md5(JSON.stringify(input));
step.status!.inputHash = newInputHash;
//判断是否需要跳过
@@ -438,7 +438,7 @@ export class Executor {
const runnableError = error as RunnableError;
content = `流水线ID:${this.pipeline.id}运行ID:${this.runtime.id}\n\n`;
for (const re of runnableError.errors) {
content += ` - ${re.runnable.title} 执行失败\n 错误详情:${re.e.message}\n\n`;
content += ` - ${re.runnable.title} 执行失败错误详情${re.e?.message || re.e?.error?.message}\n\n`;
}
} else {
content = `流水线ID:${this.pipeline.id}运行ID:${this.runtime.id}\n\n${this.currentStatusMap?.currentStep?.title} 执行失败\n\n错误详情:${error.message}`;

View File

@@ -227,6 +227,11 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
return name + "_" + dayjs().format("YYYYMMDDHHmmssSSS");
}
buildCertName(domain: string) {
domain = domain.replaceAll("*", "_").replaceAll(".", "_");
return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`;
}
async onRequest(req: PluginRequestHandleReq<any>) {
if (!req.action) {
throw new Error("action is required");

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/lib-huawei
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
**Note:** Version bump only for package @certd/lib-huawei
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
**Note:** Version bump only for package @certd/lib-huawei
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
**Note:** Version bump only for package @certd/lib-huawei

View File

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

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/lib-iframe
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
**Note:** Version bump only for package @certd/lib-iframe
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
**Note:** Version bump only for package @certd/lib-iframe
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
**Note:** Version bump only for package @certd/lib-iframe

View File

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

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/jdcloud
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
**Note:** Version bump only for package @certd/jdcloud
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
**Note:** Version bump only for package @certd/jdcloud
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
**Note:** Version bump only for package @certd/jdcloud

View File

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

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/lib-k8s
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
**Note:** Version bump only for package @certd/lib-k8s
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
**Note:** Version bump only for package @certd/lib-k8s
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
**Note:** Version bump only for package @certd/lib-k8s

View File

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

View File

@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/lib-server
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
### Performance Improvements
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
**Note:** Version bump only for package @certd/lib-server
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
**Note:** Version bump only for package @certd/lib-server

View File

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

View File

@@ -204,3 +204,5 @@ export class SysSafeSetting extends BaseSettings {
autoHiddenTimes: 5,
};
}

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

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

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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/plugin-cert
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
### Bug Fixes
* 修复公共插件配置修改不生效的bug优化系统设置参数注入时机 ([e1e510c](https://github.com/certd/certd/commit/e1e510ce1e37a5ae82478226b6987a83f22d1ecb))
* 修复lego模式下每次都重新申请证书的bug ([f807b8c](https://github.com/certd/certd/commit/f807b8cb465cc329fa034ecbef94e18ef394f870))
* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c))
### Performance Improvements
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
**Note:** Version bump only for package @certd/plugin-cert
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
**Note:** Version bump only for package @certd/plugin-cert

View File

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

View File

@@ -81,6 +81,10 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
}
}
getCheckChangeInputKeys() {
//插件哪些字段参与校验是否需要更新
return ["domains", "sslProvider", "privateKeyType", "dnsProviderType", "pfxPassword"];
}
/**
* 是否更新证书
*/
@@ -91,7 +95,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
// return null;
// }
const checkInputChanges = ["domains", "sslProvider", "privateKeyType", "dnsProviderType", "pfxPassword"];
const checkInputChanges = this.getCheckChangeInputKeys();
const oldInput = JSON.stringify(pick(this.lastStatus?.input, checkInputChanges));
const thisInput = JSON.stringify(pick(this, checkInputChanges));
const inputChanged = oldInput !== thisInput;
@@ -145,7 +149,8 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
throw new Error("过期时间不能为空");
}
// 检查有效期
const leftDays = dayjs(expires).diff(dayjs(), "day");
const leftDays = Math.floor((expires - dayjs().valueOf()) / (1000 * 60 * 60 * 24));
this.logger.info(`证书剩余天数:${leftDays}`);
return {
isWillExpire: leftDays <= maxDays,
leftDays,

View File

@@ -93,6 +93,21 @@ export class CertReader {
return domains;
}
getAltNames() {
const { detail } = this.getCrtDetail();
return detail.domains.altNames;
}
static getMainDomain(crt: string) {
const { detail } = CertReader.readCertDetail(crt);
return detail.domains.commonName;
}
getMainDomain() {
const { detail } = this.getCrtDetail();
return detail.domains.commonName;
}
saveToFile(type: "crt" | "key" | "pfx" | "der" | "oc" | "one" | "ic" | "jks", filepath?: string) {
if (!this.cert[type]) {
return;
@@ -164,8 +179,14 @@ export class CertReader {
buildCertFileName(suffix: string, applyTime: any, prefix = "cert") {
const detail = this.getCrtDetail();
let domain = detail.detail.domains.commonName;
domain = domain.replace(".", "_").replace("*", "_");
domain = domain.replaceAll(".", "_").replaceAll("*", "_");
const timeStr = dayjs(applyTime).format("YYYYMMDDHHmmss");
return `${prefix}_${domain}_${timeStr}.${suffix}`;
}
buildCertName() {
let domain = this.getMainDomain();
domain = domain.replaceAll("*", "_").replaceAll("*", "_");
return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`;
}
}

View File

@@ -320,7 +320,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
this.logger.info("当前正在使用 google EAB授权");
eab = await this.getAccess(this.eabAccessId);
} else if (this.googleCommonEabAccessId) {
this.logger.info("当前正在使用 google公共EAB授权");
this.logger.info("当前正在使用 google 公共EAB授权");
eab = await this.getAccess(this.googleCommonEabAccessId, true);
} else {
throw new Error("google需要配置EAB授权或服务账号授权");

View File

@@ -112,9 +112,12 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
})
privateKeyType!: PrivateKeyType;
eab?: EabAccess;
getCheckChangeInputKeys() {
return ["domains", "privateKeyType", "dnsType"];
}
async onInstance() {
this.accessService = this.ctx.accessService;
this.logger = this.ctx.logger;

View File

@@ -0,0 +1,27 @@
import { expect } from "chai";
import { CertApplyPlugin } from "../dist/index.js";
import dayjs from "dayjs";
import { logger } from "@certd/basic";
describe("test/cert-plugin.ts", () => {
const certApplyPlugin = new CertApplyPlugin();
certApplyPlugin.logger = logger;
it("should throw error when expires is null or undefined", () => {
expect(() => {
// @ts-ignore
certApplyPlugin.isWillExpire(undefined);
}).throw("过期时间不能为空");
expect(() => {
// @ts-ignore
certApplyPlugin.isWillExpire(null);
}).throw("过期时间不能为空");
});
it("isWillExpire", () => {
const now = dayjs().add(36, "day") - 10000;
const res = certApplyPlugin.isWillExpire(now.valueOf(), 35);
console.log(res);
expect(res.isWillExpire).eq(true);
});
});

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/plugin-lib
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
### Performance Improvements
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
### Performance Improvements
* aaWaf、cdnfly站点选择支持查询 ([8af3463](https://github.com/certd/certd/commit/8af3463668a40b9b99febb02e3b4e0d9d8d719b4))
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
**Note:** Version bump only for package @certd/plugin-lib

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.34.4",
"version": "1.34.7",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -16,10 +16,12 @@
"pub": "npm publish"
},
"dependencies": {
"@alicloud/openapi-client": "^0.4.14",
"@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.10",
"@aws-sdk/client-s3": "^3.787.0",
"@certd/basic": "^1.34.4",
"@certd/pipeline": "^1.34.4",
"@certd/basic": "^1.34.7",
"@certd/pipeline": "^1.34.7",
"@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5",
@@ -50,5 +52,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "0b152a3cb8ef13113f9612c1bf555755e6f5b209"
"gitHead": "8478ce25f11f8e13b9be508cf44d7090f5c8a663"
}

View File

@@ -1,4 +1,88 @@
import { IsAccess, AccessInput, BaseAccess } from "@certd/pipeline";
import { ILogger } from "@certd/basic";
export type AliyunClientV2Req = {
action: string;
version: string;
protocol?: "HTTPS";
// 接口 HTTP 方法
method?: "GET" | "POST";
authType?: "AK";
style?: "RPC";
// 接口 PATH
pathname?: `/`;
data?: any;
query?: any;
};
export class AliyunClientV2 {
access: AliyunAccess;
logger: ILogger;
endpoint: string;
client: any;
constructor(opts: { access: AliyunAccess; logger: ILogger; endpoint: string }) {
this.access = opts.access;
this.logger = opts.logger;
this.endpoint = opts.endpoint;
}
async getClient() {
if (this.client) {
return this.client;
}
const $OpenApi = await import("@alicloud/openapi-client");
const config = new $OpenApi.Config({
accessKeyId: this.access.accessKeyId,
accessKeySecret: this.access.accessKeySecret,
});
// Endpoint 请参考 https://api.aliyun.com/product/FC
// config.endpoint = `esa.${this.regionId}.aliyuncs.com`;
config.endpoint = this.endpoint;
//@ts-ignore
this.client = new $OpenApi.default.default(config);
return this.client;
}
async doRequest(req: AliyunClientV2Req) {
const client = await this.getClient();
const $OpenApi = await import("@alicloud/openapi-client");
const $Util = await import("@alicloud/tea-util");
const params = new $OpenApi.Params({
// 接口名称
action: req.action,
// 接口版本
version: req.version,
// 接口协议
protocol: "HTTPS",
// 接口 HTTP 方法
method: req.method ?? "POST",
authType: "AK",
style: "RPC",
// 接口 PATH
pathname: `/`,
// 接口请求体内容格式
reqBodyType: "json",
// 接口响应体内容格式
bodyType: "json",
});
const runtime = new $Util.RuntimeOptions({});
const request = new $OpenApi.OpenApiRequest({
body: req.data,
query: req.query,
});
// 复制代码运行请自行打印 API 的返回值
// 返回值实际为 Map 类型,可从 Map 中获得三类数据:响应体 body、响应头 headers、HTTP 返回的状态码 statusCode。
const res = await client.callApi(params, request, runtime);
/**
* res?.body?.
*/
return res?.body;
}
}
@IsAccess({
name: "aliyun",
@@ -27,6 +111,14 @@ export class AliyunAccess extends BaseAccess {
helper: "注意证书申请需要dns解析权限其他阿里云插件需要对应的权限比如证书上传需要证书管理权限嫌麻烦就用主账号的全量权限的accessKey",
})
accessKeySecret = "";
getClient(endpoint: string) {
return new AliyunClientV2({
access: this,
logger: this.ctx.logger,
endpoint: endpoint,
});
}
}
new AliyunAccess();

View File

@@ -83,7 +83,7 @@ export class AliyunSslClient {
method: "POST",
};
this.opts.logger.info("开始上传证书");
this.opts.logger.info(`开始上传证书${req.name}`);
const ret: any = await client.request("UploadUserCertificate", params, requestOption);
this.checkRet(ret);
this.opts.logger.info("证书上传成功aliyunCertId=", ret.CertId);

View File

@@ -38,6 +38,7 @@ export function createRemoteSelectInputDefine(opts?: {
required?: boolean;
rules?: any;
mergeScript?: string;
search?: boolean;
}) {
const title = opts?.title || "请选择";
const certDomainsInputKey = opts?.certDomainsInputKey || "certDomains";
@@ -47,6 +48,7 @@ export function createRemoteSelectInputDefine(opts?: {
const type = opts?.type || "plugin";
const watches = opts?.watches || [];
const helper = opts?.helper || "请选择";
const search = opts?.search ?? false;
let mode = "tags";
if (opts.multi === false) {
mode = undefined;
@@ -63,6 +65,7 @@ export function createRemoteSelectInputDefine(opts?: {
type,
typeName,
action,
search,
watches: [certDomainsInputKey, accessIdInputKey, ...watches],
},
rules: opts?.rules,

View File

@@ -50,9 +50,22 @@ export class TencentSslClient {
const ret = await client.UploadCertificate(params);
this.checkRet(ret);
this.logger.info("证书上传成功tencentCertId=", ret.CertificateId);
await this.switchCertNotify([ret.CertificateId], true);
return ret.CertificateId;
}
async switchCertNotify(certIds: string[], disabled: boolean) {
const client = await this.getSslClient();
const params = {
CertificateIds: certIds,
SwitchStatus: disabled ? 1 : 0, //1是忽略通知0是不忽略
};
const ret = await client.ModifyCertificatesExpiringNotificationSwitch(params);
this.checkRet(ret);
this.logger.info(`关闭证书${certIds}过期通知成功`);
return ret.RequestId;
}
async deployCertificateInstance(params: any) {
const client = await this.getSslClient();
const res = await client.DeployCertificateInstance(params);

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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
**Note:** Version bump only for package @certd/ui-client
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
### Bug Fixes
* 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug ([7984b62](https://github.com/certd/certd/commit/7984b625ba6727132f205db8e25f790bce27b2f7))
* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c))
### Performance Improvements
* 二次认证页面中,添加动态验证码输入框的焦点控制,提升用户体验 ([bb22f06](https://github.com/certd/certd/commit/bb22f062ed4ab4b5b71938270fe4cc666af6b8e7))
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
### Performance Improvements
* aaWaf、cdnfly站点选择支持查询 ([8af3463](https://github.com/certd/certd/commit/8af3463668a40b9b99febb02e3b4e0d9d8d719b4))
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
### Bug Fixes

View File

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

View File

@@ -140,7 +140,7 @@ function createRequestFunction(service: any) {
headers: {
"Content-Type": get(config, "headers.Content-Type", "application/json"),
},
timeout: 20000,
timeout: 30000,
baseURL: env.API,
data: {},
};

View File

@@ -1,7 +1,26 @@
<template>
<div class="remote-select">
<div class="flex flex-row">
<a-select class="remote-select-input" show-search :filter-option="filterOption" :options="optionsRef" :value="value" v-bind="attrs" @click="onClick" @update:value="emit('update:value', $event)" />
<a-select class="remote-select-input" show-search :filter-option="filterOption" :options="optionsRef" :value="value" v-bind="attrs" @click="onClick" @update:value="emit('update:value', $event)">
<template #dropdownRender="{ menuNode: menu }">
<template v-if="search">
<div class="flex w-full" style="padding: 4px 8px">
<a-input ref="inputRef" v-model:value="searchKeyRef" class="flex-1" allow-clear placeholder="查询关键字" @keydown.enter="doSearch" />
<a-button class="ml-2" :loading="loading" type="text" @click="doSearch">
<template #icon>
<search-outlined />
</template>
查询
</a-button>
</div>
<div v-if="hasError" class="helper p-2" :class="{ error: hasError }">
{{ message }}
</div>
<a-divider style="margin: 4px 0" />
</template>
<v-nodes :vnodes="menu" />
</template>
</a-select>
<div class="ml-5">
<fs-button :loading="loading" title="刷新选项" icon="ion:refresh-outline" @click="refreshOptions"></fs-button>
</div>
@@ -13,16 +32,29 @@
</template>
<script setup lang="ts">
import { ComponentPropsType, doRequest } from "/@/components/plugins/lib";
import { inject, ref, useAttrs, watch } from "vue";
import { defineComponent, inject, ref, useAttrs, watch } from "vue";
import { PluginDefine } from "@certd/pipeline";
defineOptions({
name: "RemoteSelect",
});
const VNodes = defineComponent({
props: {
vnodes: {
type: Object,
required: true,
},
},
render() {
return this.vnodes;
},
});
const props = defineProps<
{
watches: string[];
search: boolean;
} & ComponentPropsType
>();
@@ -36,6 +68,7 @@ const getCurrentPluginDefine: any = inject("getCurrentPluginDefine");
const getScope: any = inject("get:scope");
const getPluginType: any = inject("get:plugin:type");
const searchKeyRef = ref("");
const optionsRef = ref([]);
const message = ref("");
const hasError = ref(false);
@@ -81,6 +114,9 @@ const getOptions = async () => {
typeName: form.type,
action: props.action,
input,
data: {
searchKey: props.search ? searchKeyRef.value : "",
},
},
{
onError(err: any) {
@@ -114,6 +150,10 @@ async function refreshOptions() {
await getOptions();
}
async function doSearch() {
await refreshOptions();
}
watch(
() => {
const values = [];

View File

@@ -21,6 +21,13 @@ const menus = computed(() => [
icon: "fa-solid:book",
text: "账号信息",
},
{
handler: () => {
router.push("/certd/mine/security");
},
icon: "fluent:shield-keyhole-16-regular",
text: "认证安全设置",
},
]);
const avatar = computed(() => {

View File

@@ -143,6 +143,17 @@ export const certdResources = [
keepAlive: true,
},
},
{
title: "站点监控设置",
name: "SiteMonitorSetting",
path: "/certd/monitor/setting",
component: "/certd/monitor/site/setting/index.vue",
meta: {
icon: "ion:videocam-outline",
auth: true,
isMenu: true,
},
},
{
title: "认证安全设置",
name: "UserSecurity",

View File

@@ -65,4 +65,10 @@ footer{
.ant-select-multiple .ant-select-selection-item-remove{
display: flex;
align-items: center;
}
.ant-progress.ant-progress-show-info .ant-progress-outer {
margin-inline-end: calc(-3em - 8px);
padding-inline-end: calc(3em + 8px);
}

View File

@@ -35,10 +35,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
pageRequest,
addRequest,
editRequest,
delRequest
delRequest,
},
table: {
remove: {
confirmMessage: "授权如果已经被使用,可能会导致流水线无法正常运行,请谨慎操作",
},
},
rowHandle: {
width: 200
width: 200,
},
columns: {
id: {
@@ -46,24 +51,24 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
key: "id",
type: "number",
column: {
width: 100
width: 100,
},
form: {
show: false
}
show: false,
},
},
name: {
title: "名称",
type: "text",
search: {
show: true
show: true,
},
form: {
rules: [{ required: true, message: "必填项" }]
rules: [{ required: true, message: "必填项" }],
},
column: {
width: 300
}
width: 300,
},
},
from: {
title: "级别",
@@ -71,29 +76,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
dict: dict({
data: [
{ label: "系统", value: "sys" },
{ label: "用户", value: "user" }
]
{ label: "用户", value: "user" },
],
}),
search: {
show: false
show: false,
},
form: {
show: false
show: false,
},
column: {
width: 100,
align: "center",
component: {
color: "auto"
color: "auto",
},
order: 10
order: 10,
},
valueBuilder: ({ row, key, value }) => {
row[key] = row.userId > 0 ? "user" : "sys";
}
},
},
...commonColumnsDefine
}
}
...commonColumnsDefine,
},
},
};
}

View File

@@ -7,7 +7,7 @@ export const siteInfoApi = {
return await request({
url: apiPrefix + "/page",
method: "post",
data: query
data: query,
});
},
@@ -15,7 +15,7 @@ export const siteInfoApi = {
return await request({
url: apiPrefix + "/add",
method: "post",
data: obj
data: obj,
});
},
@@ -23,7 +23,7 @@ export const siteInfoApi = {
return await request({
url: apiPrefix + "/update",
method: "post",
data: obj
data: obj,
});
},
@@ -31,7 +31,7 @@ export const siteInfoApi = {
return await request({
url: apiPrefix + "/delete",
method: "post",
params: { id }
params: { id },
});
},
@@ -39,20 +39,20 @@ export const siteInfoApi = {
return await request({
url: apiPrefix + "/info",
method: "post",
params: { id }
params: { id },
});
},
async DoCheck(id: number) {
return await request({
url: apiPrefix + "/check",
method: "post",
data: { id }
data: { id },
});
},
async CheckAll() {
return await request({
url: apiPrefix + "/checkAll",
method: "post"
method: "post",
});
}
},
};

View File

@@ -4,7 +4,10 @@
<div class="title flex items-center">
站点证书监控
<div class="sub flex-1">
<div>每天0点检查网站证书的过期时间到期前10天时将发出提醒使用默认通知渠道;</div>
<div>
每天0点检查网站证书的过期时间到期前10天时将发出提醒使用默认通知渠道;
<router-link to="/certd/monitor/setting">站点监控设置</router-link>
</div>
<div class="flex items-center">基础版限制1条专业版以上无限制当前<vip-button class="ml-5" mode="nav"></vip-button></div>
</div>
</div>

View File

@@ -0,0 +1,24 @@
// @ts-ignore
import { request } from "/src/api/service";
const apiPrefix = "/monitor/site/setting";
export type UserSiteMonitorSetting = {
notificationId?: number;
};
export async function SiteMonitorSettingsGet() {
const res = await request({
url: apiPrefix + "/get",
method: "post",
});
if (!res) {
return {};
}
return res as UserSiteMonitorSetting;
}
export async function SiteMonitorSettingsSave(data: UserSiteMonitorSetting) {
await request({
url: apiPrefix + "/save",
method: "post",
data: data,
});
}

View File

@@ -0,0 +1,63 @@
<template>
<fs-page class="page-user-settings page-site-monitor-setting">
<template #header>
<div class="title">站点监控设置</div>
</template>
<div class="user-settings-form settings-form">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off">
<a-form-item label="通知渠道" :name="['notificationId']">
<div class="flex">
<NotificationSelector v-model="formState.notificationId" />
</div>
<div class="helper">设置通知渠道</div>
</a-form-item>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
<loading-button type="primary" html-type="button" :click="doSave">保存</loading-button>
</a-form-item>
</a-form>
</div>
</fs-page>
</template>
<script setup lang="tsx">
import { reactive } from "vue";
import * as api from "./api";
import { UserSiteMonitorSetting } from "./api";
import { notification } from "ant-design-vue";
import { merge } from "lodash-es";
import { useSettingStore } from "/src/store/settings";
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
const settingsStore = useSettingStore();
defineOptions({
name: "UserSecurity",
});
const formState = reactive<Partial<UserSiteMonitorSetting>>({
notificationId: 0,
});
async function loadUserSettings() {
const data: any = await api.SiteMonitorSettingsGet();
merge(formState, data);
}
loadUserSettings();
const doSave = async (form: any) => {
await api.SiteMonitorSettingsSave({
...formState,
});
notification.success({
message: "保存成功",
});
};
</script>
<style lang="less">
.page-user-settings {
.user-settings-form {
width: 600px;
margin: 20px;
}
}
</style>

View File

@@ -44,7 +44,7 @@
<a-form-item>
<a-button type="primary" size="large" html-type="submit" :loading="loading" class="login-button">登录</a-button>
<div class="mt-2"><a href="https://certd.docmirror.cn/guide/use/forgotpasswd/" target="_blank">忘记管理员密码</a></div>
<div v-if="!settingStore.isComm" class="mt-2"><a href="https://certd.docmirror.cn/guide/use/forgotpasswd/" target="_blank">忘记管理员密码</a></div>
</a-form-item>
<a-form-item class="user-login-other">
@@ -54,7 +54,7 @@
<a-form v-else ref="twoFactorFormRef" class="user-layout-login" :model="twoFactor" v-bind="layout">
<div class="mb-10 flex flex-center">请打开您的Authenticator APP获取动态验证码</div>
<a-form-item name="verifyCode">
<a-input v-model:value="twoFactor.verifyCode" placeholder="请输入动态验证码" allow-clear>
<a-input ref="verifyCodeInputRef" v-model:value="twoFactor.verifyCode" placeholder="请输入动态验证码" allow-clear @keydown.enter="handleTwoFactorSubmit">
<template #prefix>
<fs-icon icon="ion:lock-closed-outline"></fs-icon>
</template>
@@ -71,7 +71,7 @@
</div>
</template>
<script lang="ts">
import { defineComponent, reactive, ref, toRaw } from "vue";
import { defineComponent, nextTick, reactive, ref, toRaw } from "vue";
import { useUserStore } from "/src/store/user";
import { useSettingStore } from "/@/store/settings";
import { utils } from "@fast-crud/fast-crud";
@@ -82,6 +82,7 @@ export default defineComponent({
name: "LoginPage",
components: { SmsCode, ImageCode },
setup() {
const verifyCodeInputRef = ref();
const loading = ref(false);
const userStore = useUserStore();
const settingStore = useSettingStore();
@@ -149,8 +150,11 @@ export default defineComponent({
} catch (e: any) {
//@ts-ignore
if (e.code === 10020) {
//双重认证
//@ts-ignore
twoFactor.loginId = e.data;
await nextTick();
verifyCodeInputRef.value.focus();
} else {
throw e;
}
@@ -174,6 +178,7 @@ export default defineComponent({
function hasRegisterTypeEnabled() {
return sysPublicSettings.registerEnabled && (sysPublicSettings.usernameRegisterEnabled || sysPublicSettings.emailRegisterEnabled);
}
return {
loading,
formState,
@@ -188,6 +193,8 @@ export default defineComponent({
hasRegisterTypeEnabled,
twoFactor,
handleTwoFactorSubmit,
verifyCodeInputRef,
settingStore,
};
},
});

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.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
### Performance Improvements
* 优化阿里云DCDN插件支持多选 ([b091657](https://github.com/certd/certd/commit/b091657b5c537acf2442a2bfc345d0a77f5e2c50))
* 支持部署到farcdn ([e08cf57](https://github.com/certd/certd/commit/e08cf57b72128998f487ab6469868052fbce0dba))
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
### Bug Fixes
* 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug ([7984b62](https://github.com/certd/certd/commit/7984b625ba6727132f205db8e25f790bce27b2f7))
### Performance Improvements
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
### Performance Improvements
* 1panel增加授权测试按钮 ([566b12f](https://github.com/certd/certd/commit/566b12f5d14ce10e8f5cf1807c58f7bf27f0d199))
* 优化钉钉通知标题颜色 ([a560999](https://github.com/certd/certd/commit/a560999d13eed18d08dd32ee530166569e3f8746))
* 优化飞书通知为卡片模式 ([a818a3d](https://github.com/certd/certd/commit/a818a3d293e22fb46979bc77055c05621a6fed81))
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.34.4",
"version": "1.34.7",
"description": "fast-server base midway",
"private": true,
"type": "module",
@@ -41,19 +41,19 @@
"@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.34.4",
"@certd/basic": "^1.34.4",
"@certd/commercial-core": "^1.34.4",
"@certd/jdcloud": "^1.34.4",
"@certd/lib-huawei": "^1.34.4",
"@certd/lib-k8s": "^1.34.4",
"@certd/lib-server": "^1.34.4",
"@certd/midway-flyway-js": "^1.34.4",
"@certd/pipeline": "^1.34.4",
"@certd/plugin-cert": "^1.34.4",
"@certd/plugin-lib": "^1.34.4",
"@certd/plugin-plus": "^1.34.4",
"@certd/plus-core": "^1.34.4",
"@certd/acme-client": "^1.34.7",
"@certd/basic": "^1.34.7",
"@certd/commercial-core": "^1.34.7",
"@certd/jdcloud": "^1.34.7",
"@certd/lib-huawei": "^1.34.7",
"@certd/lib-k8s": "^1.34.7",
"@certd/lib-server": "^1.34.7",
"@certd/midway-flyway-js": "^1.34.7",
"@certd/pipeline": "^1.34.7",
"@certd/plugin-cert": "^1.34.7",
"@certd/plugin-lib": "^1.34.7",
"@certd/plugin-plus": "^1.34.7",
"@certd/plus-core": "^1.34.7",
"@corsinvest/cv4pve-api-javascript": "^8.3.0",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",

View File

@@ -1,7 +1,9 @@
import { ALL, Body, Controller, Inject, Post, Provide, Query } from '@midwayjs/core';
import { Constants, CrudController } from '@certd/lib-server';
import { AuthService } from '../../../modules/sys/authority/service/auth-service.js';
import { SiteInfoService } from '../../../modules/monitor/service/site-info-service.js';
import { ALL, Body, Controller, Inject, Post, Provide, Query } from "@midwayjs/core";
import { Constants, CrudController } from "@certd/lib-server";
import { AuthService } from "../../../modules/sys/authority/service/auth-service.js";
import { SiteInfoService } from "../../../modules/monitor/service/site-info-service.js";
import { UserSiteMonitorSetting } from "../../../modules/mine/service/models.js";
import { merge } from "lodash-es";
/**
*/
@@ -94,4 +96,23 @@ export class SiteInfoController extends CrudController<SiteInfoService> {
await this.service.checkAllByUsers(userId);
return this.ok();
}
@Post("/setting/get", { summary: Constants.per.authOnly })
async get() {
const userId = this.getUserId();
const setting = await this.service.getSetting(userId)
return this.ok(setting);
}
@Post("/setting/save", { summary: Constants.per.authOnly })
async save(@Body(ALL) bean: any) {
const userId = this.getUserId();
const setting = new UserSiteMonitorSetting();
merge(setting, bean);
await this.service.saveSetting(userId, setting);
return this.ok({});
}
}

View File

@@ -19,3 +19,10 @@ export class UserTwoFactorSetting extends BaseSettings {
}
export class UserSiteMonitorSetting extends BaseSettings {
static __title__ = "站点监控设置";
static __key__ = "user.site.monitor";
notificationId?:number= 0;
}

View File

@@ -10,6 +10,8 @@ import { PeerCertificate } from 'tls';
import { NotificationService } from '../../pipeline/service/notification-service.js';
import { isComm, isPlus } from '@certd/plus-core';
import { UserSuiteService } from '@certd/commercial-core';
import { UserSettingsService } from "../../mine/service/user-settings-service.js";
import { UserSiteMonitorSetting } from "../../mine/service/models.js";
@Provide()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
@@ -26,6 +28,10 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
@Inject()
userSuiteService: UserSuiteService;
@Inject()
userSettingsService: UserSettingsService;
//@ts-ignore
getRepository() {
return this.repository;
@@ -236,4 +242,12 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
await utils.sleep(200);
}
}
async getSetting(userId: number){
return await this.userSettingsService.getSetting<UserSiteMonitorSetting>(userId, UserSiteMonitorSetting);
}
async saveSetting(userId: number, bean: UserSiteMonitorSetting) {
await this.userSettingsService.saveSetting(userId, bean);
}
}

View File

@@ -151,6 +151,9 @@ export class UserService extends BaseService<UserEntity> {
async buildPlainPassword(rawPassword: string) {
const setting: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
if (!setting.siteId) {
throw new CommonException('站点ID还未初始化');
}
const prefixSiteId = setting.siteId.substring(1, 5);
return rawPassword + prefixSiteId;
}

View File

@@ -57,15 +57,12 @@ export class SafeService {
async reloadHiddenStatus(immediate = false) {
const hidden = await this.getHiddenSetting()
if (hidden.enabled) {
logger.error("启动站点隐藏");
hiddenStatus.isHidden = false
if (immediate) {
hiddenStatus.isHidden = true;
}
logger.info("启动站点隐藏");
hiddenStatus.isHidden = immediate;
const autoHiddenTimes = hidden.autoHiddenTimes || 5;
hiddenStatus.startCheck(autoHiddenTimes);
} else {
logger.error("关闭站点隐藏");
logger.info("当前站点隐藏已关闭");
hiddenStatus.isHidden = false;
hiddenStatus.stopCheck()
}

View File

@@ -21,3 +21,4 @@ export * from './plugin-jdcloud/index.js'
export * from './plugin-51dns/index.js'
export * from './plugin-notification/index.js'
export * from './plugin-flex/index.js'
export * from './plugin-farcdn/index.js'

View File

@@ -1,5 +1,5 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { CertInfo ,CertApplyPluginNames} from '@certd/plugin-cert';
import { CertInfo ,CertApplyPluginNames, CertReader} from '@certd/plugin-cert';
import { AliyunAccess, AliyunClient, AliyunSslClient, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
@IsTaskPlugin({
@@ -143,8 +143,9 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
endpoint: this.casEndpoint,
});
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt))
certId = await sslClient.uploadCert({
name: this.appendTimeSuffix('certd'),
name: certName,
cert: this.cert,
});
}

View File

@@ -1,7 +1,7 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { AliyunAccess, AliyunClient, AliyunSslClient, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
import { optionsUtils } from '@certd/basic/dist/utils/util.options.js';
import { CertApplyPluginNames} from '@certd/plugin-cert';
import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert";
@IsTaskPlugin({
name: 'DeployCertToAliyunCDN',
title: '阿里云-部署证书至CDN',
@@ -107,9 +107,11 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
let certId: any = this.cert;
const certName = this.appendTimeSuffix(this.certName);
let certName = this.appendTimeSuffix(this.certName);
if (typeof this.cert === 'object') {
// @ts-ignore
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt))
certId = await sslClient.uploadCert({
name:certName,
cert: this.cert,

View File

@@ -1,8 +1,14 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import dayjs from 'dayjs';
import { AliyunAccess, AliyunClient, createCertDomainGetterInputDefine } from '@certd/plugin-lib';
import {
AliyunAccess,
AliyunClient,
createCertDomainGetterInputDefine,
createRemoteSelectInputDefine
} from "@certd/plugin-lib";
import { CertInfo } from '@certd/plugin-cert';
import { CertApplyPluginNames} from '@certd/plugin-cert';
import { optionsUtils } from "@certd/basic/dist/utils/util.options.js";
@IsTaskPlugin({
name: 'DeployCertToAliyunDCDN',
title: '阿里云-部署证书至DCDN',
@@ -41,12 +47,6 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
})
accessId!: string;
@TaskInput({
title: 'DCDN加速域名',
helper: '你在阿里云上配置的CDN加速域名比如:certd.docmirror.cn',
required: true,
})
domainName!: string;
@TaskInput({
title: '证书名称',
@@ -54,13 +54,37 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
})
certName!: string;
@TaskInput(
createRemoteSelectInputDefine({
title: 'DCDN加速域名',
helper: '你在阿里云上配置的DCDN加速域名比如:certd.docmirror.cn',
action: DeployCertToAliyunDCDN.prototype.onGetDomainList.name,
watches: ['certDomains', 'accessId'],
required: true,
})
)
domainName!: string | string[];
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云DCDN');
if(!this.domainName){
throw new Error('您还未选择DCDN域名');
}
const access = (await this.getAccess(this.accessId)) as AliyunAccess;
const client = await this.getClient(access);
const params = await this.buildParams();
await this.doRequest(client, params);
if(typeof this.domainName === 'string'){
this.domainName = [this.domainName];
}
for (const domainName of this.domainName ) {
this.logger.info(`[${this.domainName}]开始部署`)
const params = await this.buildParams(domainName);
await this.doRequest(client, params);
this.logger.info(`[${this.domainName}]部署成功`)
}
this.logger.info('部署完成');
}
@@ -75,14 +99,14 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
return client;
}
async buildParams() {
async buildParams(domainName:string) {
const CertName = (this.certName ?? 'certd') + '-' + dayjs().format('YYYYMMDDHHmmss');
if (typeof this.cert !== 'object') {
const certId = this.cert;
this.logger.info('使用已上传的证书:', certId);
return {
DomainName: this.domainName,
DomainName: domainName,
SSLProtocol: 'on',
CertType: 'cas',
CertName: CertName,
@@ -93,7 +117,7 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
this.logger.info('上传证书:', CertName);
const cert: any = this.cert;
return {
DomainName: this.domainName,
DomainName: domainName,
SSLProtocol: 'on',
CertName: CertName,
CertType: 'upload',
@@ -117,5 +141,40 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
throw new Error('执行失败:' + ret.Message);
}
}
async onGetDomainList(data: any) {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getClient(access);
const params = {
// 'DomainName': 'aaa',
PageSize: 500,
};
const requestOption = {
method: 'POST',
formatParams: false,
};
const res = await client.request('DescribeDcdnUserDomains', params, requestOption);
this.checkRet(res);
const pageData = res?.Domains?.PageData;
if (!pageData || pageData.length === 0) {
throw new Error('找不到CDN域名您可以手动输入');
}
const options = pageData.map((item: any) => {
return {
value: item.DomainName,
label: item.DomainName,
domain: item.DomainName,
};
});
return optionsUtils.buildGroupOptions(options, this.certDomains);
}
}
new DeployCertToAliyunDCDN();

View File

@@ -0,0 +1,226 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { CertApplyPluginNames, CertInfo, CertReader } from "@certd/plugin-cert";
import {
AliyunAccess, AliyunClientV2,
AliyunSslClient,
createCertDomainGetterInputDefine,
createRemoteSelectInputDefine
} from "@certd/plugin-lib";
@IsTaskPlugin({
name: "AliyunDeployCertToESA",
title: "阿里云-部署至ESA",
icon: "svg:icon-aliyun",
group: pluginGroups.aliyun.key,
desc: "部署证书到阿里云ESA(边缘安全加速)",
needPlus: false,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed
}
}
})
export class AliyunDeployCertToESA extends AbstractTaskPlugin {
@TaskInput({
title: "域名证书",
helper: "请选择证书申请任务输出的域名证书",
component: {
name: "output-selector",
from: [...CertApplyPluginNames]
},
required: true
})
cert!: CertInfo;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[];
@TaskInput({
title: "大区",
value: "cn-hangzhou",
component: {
name: "a-auto-complete",
vModel: "value",
options: [
{ value: "cn-hangzhou", label: "华东1杭州" },
{ value: "ap-southeast-1", label: "新加坡" }
]
},
required: true
})
regionId!: string;
@TaskInput({
title: "证书接入点",
helper: "不会选就保持默认即可",
value: "cas.aliyuncs.com",
component: {
name: "a-select",
options: [
{ value: "cas.aliyuncs.com", label: "中国大陆" },
{ value: "cas.ap-southeast-1.aliyuncs.com", label: "新加坡" },
{ value: "cas.eu-central-1.aliyuncs.com", label: "德国(法兰克福)" }
]
},
required: true
})
casEndpoint!: string;
@TaskInput({
title: "Access授权",
helper: "阿里云授权AccessKeyId、AccessKeySecret",
component: {
name: "access-selector",
type: "aliyun"
},
required: true
})
accessId!: string;
@TaskInput(
createRemoteSelectInputDefine({
title: "站点",
helper: "请选择要部署证书的站点",
action: AliyunDeployCertToESA.prototype.onGetSiteList.name,
watches: ["accessId", "regionId"]
})
)
siteIds!: string[];
async onInstance() {
}
async getAliyunCertId(access: AliyunAccess) {
let certId: any = this.cert;
let certName: any = this.appendTimeSuffix("certd");
if (typeof this.cert === "object") {
const sslClient = new AliyunSslClient({
access,
logger: this.logger,
endpoint: this.casEndpoint
});
certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt));
certId = await sslClient.uploadCert({
name: certName,
cert: this.cert
});
this.logger.info("上传证书成功", certId, certName);
}
return {
certId,
certName
};
}
async execute(): Promise<void> {
this.logger.info("开始部署证书到阿里云");
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getClient(access);
const { certId, certName } = await this.getAliyunCertId(access);
for (const siteId of this.siteIds) {
try {
const res = await client.doRequest({
// 接口名称
action: "SetCertificate",
// 接口版本
version: "2024-09-10",
data: {
SiteId: siteId,
CasId: certId,
Type: "cas",
Name: certName
}
});
this.logger.info(`部署站点[${siteId}]证书成功:${JSON.stringify(res)}`);
} catch (e) {
if (e.message.includes("Certificate.Duplicated")) {
this.logger.info(`站点[${siteId}]证书已存在,无需重复部署`);
}else{
throw e;
}
}
try{
await this.clearSiteCert(client,siteId);
}catch (e) {
this.logger.error("清理站点[${siteId}]证书失败",e)
}
}
}
async getClient(access: AliyunAccess) {
const endpoint = `esa.${this.regionId}.aliyuncs.com`;
return access.getClient(endpoint);
}
async onGetSiteList(data: any) {
if (!this.accessId) {
throw new Error("请选择Access授权");
}
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getClient(access);
const res = await client.doRequest({
action: "ListSites",
version: "2024-09-10",
method: "GET",
data: {}
});
const list = res?.Sites;
if (!list || list.length === 0) {
throw new Error("没有找到站点,请先创建站点");
}
const options = list.map((item: any) => {
return {
label: item.SiteName,
value: item.SiteId,
domain: item.SiteName
};
});
return this.ctx.utils.options.buildGroupOptions(options, this.certDomains);
}
async clearSiteCert(client: AliyunClientV2, siteId: string) {
this.logger.info(`开始清理站点[${siteId}]过期证书`);
const certListRes = await client.doRequest({
action: "ListCertificates",
version: "2024-09-10",
method: "GET",
query: {
SiteId: siteId
}
});
const list = certListRes.Result;
for (const item of list) {
this.logger.info(`证书${item.Name}状态:${item.Status}`);
if (item.Status === "Expired") {
this.logger.info(`证书${item.Name}已过期,执行删除`);
await client.doRequest({
action: "DeleteCertificate",
version: "2024-09-10",
// 接口 HTTP 方法
method: "GET",
query: {
SiteId: siteId,
Id: item.id
}
});
this.logger.info(`证书${item.Name}已删除`);
}
}
}
}
new AliyunDeployCertToESA();

View File

@@ -1,5 +1,5 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { CertApplyPluginNames, CertInfo, CertReader } from "@certd/plugin-cert";
import { AliyunAccess, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
@IsTaskPlugin({
@@ -141,9 +141,11 @@ export class AliyunDeployCertToFC extends AbstractTaskPlugin {
bodyType: 'json',
});
// body params
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt))
const body: { [key: string]: any } = {
certConfig: {
certName: this.appendTimeSuffix('certd_fc'),
certName: certName,
certificate: this.cert.crt,
privateKey: this.cert.key,
},

View File

@@ -1,5 +1,5 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { CertInfo } from '@certd/plugin-cert';
import { CertInfo, CertReader } from "@certd/plugin-cert";
import { AliyunAccess, AliyunClient, AliyunSslClient, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
import { CertApplyPluginNames} from '@certd/plugin-cert';
@IsTaskPlugin({
@@ -139,8 +139,10 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
endpoint: this.casEndpoint,
});
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt))
certId = await sslClient.uploadCert({
name: this.appendTimeSuffix('certd'),
name: certName,
cert: this.cert,
});
}

View File

@@ -1,5 +1,5 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { CertApplyPluginNames, CertInfo, CertReader } from "@certd/plugin-cert";
import {
AliyunAccess,
AliyunClient,
@@ -124,7 +124,7 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
});
certId = await sslClient.uploadCert({
name: this.appendTimeSuffix('certd'),
name: this.buildCertName(CertReader.getMainDomain(this.cert.crt)),
cert: this.cert,
});
}

View File

@@ -1,7 +1,7 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline';
import { AliyunAccess } from '@certd/plugin-lib';
import { AliyunSslClient } from '@certd/plugin-lib';
import { CertApplyPluginNames} from '@certd/plugin-cert';
import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert";
/**
* 华东1杭州 cn-hangzhou cas.aliyuncs.com cas-vpc.cn-hangzhou.aliyuncs.com
* 马来西亚(吉隆坡) ap-southeast-3 cas.ap-southeast-3.aliyuncs.com cas-vpc.ap-southeast-3.aliyuncs.com
@@ -97,8 +97,9 @@ export class UploadCertToAliyun extends AbstractTaskPlugin {
logger: this.logger,
endpoint,
});
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt))
this.aliyunCertId = await client.uploadCert({
name: this.appendTimeSuffix('certd'),
name: certName,
cert: this.cert,
});
}

View File

@@ -0,0 +1,195 @@
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
import { HttpRequestConfig } from "@certd/basic";
import { CertInfo, CertReader } from "@certd/plugin-cert";
/**
*/
@IsAccess({
name: "farcdn",
title: "farcdn授权",
desc: "",
icon: "svg:icon-lucky"
})
export class FarcdnAccess extends BaseAccess {
@AccessInput({
title: "接口地址",
component: {
placeholder: "https://open.farcdn.net/api/source",
name: "a-input",
vModel: "value"
},
required: true
})
endpoint!: 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: "HttpProxy",
component: {
placeholder: "http://192.168.x.x:10811",
component: {
name: "a-input",
vModel: "value"
}
},
encrypt: false,
required: true
})
httpProxy!: string;
@AccessInput({
title: "测试",
component: {
name: "api-test",
action: "TestRequest"
},
helper: "点击测试接口是否正常"
})
testRequest = true;
async onTestRequest() {
try{
const data = await this.findSSLCertConfig(1);
if (data) {
return "ok";
}
}catch (e) {
if(e.message.indexOf("11111111")>-1){
return "ok";
}
throw e;
}
throw "测试失败,未知错误";
}
async findSSLCertConfig(sslCertId: number) {
/**
* 接口地址
* POST /findSSLCertConfig
* 🎯 功能说明
* 根据证书ID和认证信息查询SSL证书的详细配置信息包括证书状态、域名绑定、有效期等关键信息。
*
* 📥 请求参数
* 参数名 类型 必填 说明 示例值
* sslCertId int ✅ 证书唯一标识ID 2106
* accessKeyId string ✅ 访问密钥ID u2ZF6k63dFCOS7It
* accessKey string ✅ 访问密钥 mTGaNRGUFHj3r3YxMrrg5XSGIXd6rBWG',
* 响应结构:
*
* {
* "code": 200,
* "data": {...},
* "message": "获取成功"
* }
*/
const params = {
sslCertId,
};
const res= await this.doRequest({
url: "/findSSLCertConfig",
data: params
});
this.ctx.logger.info(`找到证书${sslCertId}: name=${res.name},domain=${res.commonNames},dnsNames=${res.dnsNames}`);
return res
}
async updateSSLCert(req:{
sslCertId: number,
cert:CertInfo,
}){
/**
* isOn boolean ✅ 是否启用证书 true
* name string ✅ 证书显示名称 "example.com"
* description string ✅ 证书描述信息 "主域名SSL证书"
* serverName string ✅ 关联的服务器名称 "web-server-01"
* isCA boolean ✅ 是否为CA根证书 false
* certData string ✅ 证书内容PEM格式 "-----BEGIN CERTIFICATE-----..."
* keyData string ✅ 私钥内容PEM格式 "-----BEGIN PRIVATE KEY-----..."
* timeBeginAt int/long ✅ 证书生效时间(毫秒时间戳) 1719830400000
* timeEndAt int/long ✅ 证书过期时间(毫秒时间戳) 1751366400000
* dnsNames string[] ✅ 证书绑定的域名列表 ["example.com", "*.example.com"]
* commonNames string[] ✅ 证书的通用名称列表 ["example.com"]
*/
const oldCert = await this.findSSLCertConfig(req.sslCertId)
const certReader = new CertReader(req.cert)
const {detail} = certReader.getCrtDetail();
const params = {
sslCertId: req.sslCertId,
certData: req.cert.crt,
keyData: req.cert.key,
isOn: true,
isCA: false,
serverName: oldCert.serverName,
commonNames: [certReader.getMainDomain()],
dnsNames: certReader.getAltNames(),
timeBeginAt: detail.notBefore,
timeEndAt: detail.notAfter,
name: oldCert.name|| certReader.buildCertName(),
description:oldCert.description||""
}
return await this.doRequest({
url: "/updateSSLCert",
data: params
});
}
async doRequest(req:HttpRequestConfig){
const params = {
...req.data,
accessKeyId: this.accessKeyId,
accessKey: this.accessKey
};
const res = await this.ctx.http.request({
url: req.url,
baseURL:this.endpoint,
method: "POST",
data: params,
httpProxy: this.httpProxy||undefined,
});
if (res.code === "200") {
return res.data;
}
throw new Error(res.message || res);
}
}
new FarcdnAccess();

View File

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

View File

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

View File

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

View File

@@ -125,15 +125,17 @@ export class DingTalkNotification extends BaseNotification {
at.isAtAll = true;
}
const color = body.errorMessage?'red':'green';
const res = await this.http.request({
url: webhook,
method: 'POST',
data: {
at: at,
text: {
content: `${body.title}\n${body.content}\n查看详情: ${body.url}`,
markdown: {
title: body.title,
text: `<font color='${color}'>${body.title}</font>\n\n\n ${body.content}\n\n\n[查看详情](${body.url})`,
},
msgtype:"text"
msgtype:"markdown"
},
});
if(res.errcode>100){

View File

@@ -98,11 +98,11 @@ export class DingTalkNotification extends BaseNotification {
if(nameIndex>0){
name = id.substring(nameIndex+1)
}
return `<at user_id="${id}">${name}</at>`
return `<at id=${id}>${name}</at>`
}).join("");
}
if(this.isAtAll){
atText = `<at user_id="all">所有人</at>`
atText = `<at id=all>所有人</at>`
}
if (atText){
@@ -118,16 +118,78 @@ export class DingTalkNotification extends BaseNotification {
}
}
const cardBody = {
"msg_type": "interactive",
"card": {
"schema": "2.0",
"config": {
"update_multi": true,
"style": {
"text_size": {
"normal_v2": {
"default": "normal",
"pc": "normal",
"mobile": "heading"
}
}
}
},
"header": {
"title": {
"tag": "plain_text",
"content": body.title
},
"subtitle": {
"tag": "plain_text",
"content": ""
},
"template": body.errorMessage?"red":"green",
"padding": "12px 12px 12px 12px"
},
"body": {
"direction": "vertical",
"padding": "12px 12px 12px 12px",
"elements": [
{
"tag": "markdown",
"content": body.content+atText,
"text_align": "left",
"text_size": "normal_v2",
"margin": "0px 0px 0px 0px"
},
{
"tag": "button",
"text": {
"tag": "plain_text",
"content": "查看详情"
},
"type": "default",
"width": "default",
"size": "medium",
"behaviors": [
{
"type": "open_url",
"default_url": body.url,
"pc_url": "",
"ios_url": "",
"android_url": ""
}
],
"margin": "0px 0px 0px 0px"
}
]
},
}
}
const res = await this.http.request({
url: webhook,
method: 'POST',
data: {
...sign,
content: {
text: `${body.title}\n${body.content}\n查看详情: ${body.url}${atText}`,
},
msg_type:"text"
...cardBody
},
});
if(res.code>100){

View File

@@ -1,6 +1,6 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { CertInfo } from '@certd/plugin-cert';
import { createRemoteSelectInputDefine } from '@certd/plugin-lib';
import { CertInfo ,CertReader} from '@certd/plugin-cert';
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { TencentAccess, TencentSslClient } from '@certd/plugin-lib';
import { CertApplyPluginNames} from '@certd/plugin-cert';
@IsTaskPlugin({
@@ -16,26 +16,6 @@ import { CertApplyPluginNames} from '@certd/plugin-cert';
},
})
export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
@TaskInput({
title: 'Access提供者',
helper: 'access 授权',
component: {
name: 'access-selector',
type: 'tencent',
},
required: true,
})
accessId!: string;
@TaskInput(
createRemoteSelectInputDefine({
title: 'CDN域名',
helper: '请选择域名或输入域名',
typeName: 'TencentDeployCertToCDNv2',
action: TencentDeployCertToCDNv2.prototype.onGetDomainList.name,
})
)
domains!: string | string[];
@TaskInput({
title: '域名证书',
@@ -48,8 +28,35 @@ export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
})
cert!: CertInfo | string;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[];
@TaskInput({
title: 'Access提供者',
helper: 'access 授权',
component: {
name: 'access-selector',
type: 'tencent',
},
required: true,
})
accessId!: string;
@TaskInput(
createRemoteSelectInputDefine({
title: 'CDN域名',
helper: '请选择域名或输入域名',
typeName: 'TencentDeployCertToCDNv2',
action: TencentDeployCertToCDNv2.prototype.onGetDomainList.name,
})
)
domains!: string | string[];
async onInstance() {}
async execute(): Promise<void> {
const access = await this.getAccess<TencentAccess>(this.accessId);
const sslClient = new TencentSslClient({
@@ -59,8 +66,9 @@ export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
let tencentCertId = this.cert as string;
if (typeof this.cert !== 'string') {
const certReader = new CertReader(this.cert);
tencentCertId = await sslClient.uploadToTencent({
certName: this.appendTimeSuffix('certd'),
certName: certReader.buildCertName(),
cert: this.cert,
});
}
@@ -108,11 +116,13 @@ export class TencentDeployCertToCDNv2 extends AbstractTaskPlugin {
Limit: 1000,
});
this.checkRet(res);
return res.Domains.map((item: any) => {
const options = res.Domains.map((item: any) => {
return {
label: item.Domain,
value: item.Domain,
domain: item.Domain
};
});
return this.ctx.utils.options.buildGroupOptions(options, this.certDomains);
}
}

View File

@@ -112,27 +112,42 @@ export class UpyunDeployToCdn extends AbstractTaskPlugin {
this.logger.info(`上传证书成功:${certId}`);
for (const item of this.cdnList) {
const data :any= {
this.logger.info(`开始部署证书:${item}`);
const data1 :any= {
crt_id: certId,
domain_name: item,
}
const res1=await upyunClient.doRequest({
cookie: cookie,
url: "https://console.upyun.com/api/https/migrate/domain",
method: "POST",
data: data1
});
this.logger.info(`设置证书成功:${JSON.stringify(res1)}`);
const data2 :any= {
certificate_id: certId,
domain: item,
}
if (this.forceHttps !== 'keep') {
data.force_https = Boolean(this.forceHttps);
data2.force_https = Boolean(this.forceHttps);
}
if (this.https !=='keep') {
data.https = Boolean(this.https);
data2.https = Boolean(this.https);
}
this.logger.info(`开始部署证书:${item}`);
const res = await upyunClient.doRequest({
this.logger.info(`设置证书参数:${JSON.stringify(data2)}`);
const res2 = await upyunClient.doRequest({
cookie: cookie,
url: "https://console.upyun.com/api/https/certificate/manager",
method: "POST",
data: data
data: data2
});
this.logger.info(`部署成功:${JSON.stringify(res)}`);
this.logger.info(`设置证书参数成功:${JSON.stringify(res2)}`);
}
this.logger.info("部署成功");

112
pnpm-lock.yaml generated
View File

@@ -46,7 +46,7 @@ importers:
packages/core/acme-client:
dependencies:
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../basic
'@peculiar/x509':
specifier: ^1.11.0
@@ -207,10 +207,10 @@ importers:
packages/core/pipeline:
dependencies:
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../basic
'@certd/plus-core':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../pro/plus-core
dayjs:
specifier: ^1.11.7
@@ -415,7 +415,7 @@ importers:
packages/libs/lib-k8s:
dependencies:
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/basic
'@kubernetes/client-node':
specifier: 0.21.0
@@ -455,16 +455,16 @@ importers:
packages/libs/lib-server:
dependencies:
'@certd/acme-client':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/pipeline
'@certd/plus-core':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../pro/plus-core
'@midwayjs/cache':
specifier: ~3.14.0
@@ -607,16 +607,16 @@ importers:
packages/plugins/plugin-cert:
dependencies:
'@certd/acme-client':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/pipeline
'@certd/plugin-lib':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../plugin-lib
'@google-cloud/publicca':
specifier: ^1.3.0
@@ -682,17 +682,23 @@ importers:
packages/plugins/plugin-lib:
dependencies:
'@alicloud/openapi-client':
specifier: ^0.4.14
version: 0.4.14
'@alicloud/pop-core':
specifier: ^1.7.10
version: 1.8.0
'@alicloud/tea-util':
specifier: ^1.4.10
version: 1.4.10
'@aws-sdk/client-s3':
specifier: ^3.787.0
version: 3.810.0(aws-crt@1.26.2)
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/pipeline
'@kubernetes/client-node':
specifier: 0.21.0
@@ -780,19 +786,19 @@ importers:
packages/pro/commercial-core:
dependencies:
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/basic
'@certd/lib-server':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../libs/lib-server
'@certd/pipeline':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/pipeline
'@certd/plugin-plus':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../plugin-plus
'@certd/plus-core':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../plus-core
'@midwayjs/core':
specifier: ~3.20.3
@@ -877,22 +883,22 @@ importers:
specifier: ^1.0.2
version: 1.0.3
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/basic
'@certd/lib-k8s':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../libs/lib-k8s
'@certd/pipeline':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/pipeline
'@certd/plugin-cert':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../plugins/plugin-cert
'@certd/plugin-lib':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../plugins/plugin-lib
'@certd/plus-core':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../plus-core
ali-oss:
specifier: ^6.21.0
@@ -995,7 +1001,7 @@ importers:
packages/pro/plus-core:
dependencies:
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/basic
dayjs:
specifier: ^1.11.7
@@ -1285,10 +1291,10 @@ importers:
version: 0.1.3(zod@3.24.4)
devDependencies:
'@certd/lib-iframe':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../libs/lib-iframe
'@certd/pipeline':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/pipeline
'@rollup/plugin-commonjs':
specifier: ^25.0.7
@@ -1468,43 +1474,43 @@ importers:
specifier: ^3.705.0
version: 3.810.0(aws-crt@1.26.2)
'@certd/acme-client':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/basic
'@certd/commercial-core':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../pro/commercial-core
'@certd/jdcloud':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../libs/lib-jdcloud
'@certd/lib-huawei':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../libs/lib-huawei
'@certd/lib-k8s':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../libs/lib-k8s
'@certd/lib-server':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../libs/lib-server
'@certd/midway-flyway-js':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../libs/midway-flyway-js
'@certd/pipeline':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../core/pipeline
'@certd/plugin-cert':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../plugins/plugin-cert
'@certd/plugin-lib':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../plugins/plugin-lib
'@certd/plugin-plus':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../pro/plugin-plus
'@certd/plus-core':
specifier: ^1.34.2
specifier: ^1.34.5
version: link:../../pro/plus-core
'@corsinvest/cv4pve-api-javascript':
specifier: ^8.3.0
@@ -15652,7 +15658,7 @@ snapshots:
'@jest/schemas': 29.6.3
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/yargs': 17.0.33
chalk: 4.1.2
@@ -17108,7 +17114,7 @@ snapshots:
'@types/body-parser@1.19.5':
dependencies:
'@types/connect': 3.4.38
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/cache-manager@4.0.6': {}
@@ -17122,7 +17128,7 @@ snapshots:
'@types/connect@3.4.38':
dependencies:
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/content-disposition@0.5.8': {}
@@ -17146,7 +17152,7 @@ snapshots:
'@types/express-serve-static-core@5.0.6':
dependencies:
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/qs': 6.9.18
'@types/range-parser': 1.2.7
'@types/send': 0.17.4
@@ -17159,7 +17165,7 @@ snapshots:
'@types/got@9.6.12':
dependencies:
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/tough-cookie': 4.0.5
form-data: 2.5.3
@@ -17198,7 +17204,7 @@ snapshots:
'@types/keyv@3.1.4':
dependencies:
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/koa-compose@3.2.8':
dependencies:
@@ -17293,19 +17299,19 @@ snapshots:
'@types/responselike@1.0.3':
dependencies:
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/semver@7.7.0': {}
'@types/send@0.17.4':
dependencies:
'@types/mime': 1.3.5
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/serve-static@1.15.7':
dependencies:
'@types/http-errors': 2.0.4
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/send': 0.17.4
'@types/ssh2@1.15.5':
@@ -17337,7 +17343,7 @@ snapshots:
'@types/ws@6.0.4':
dependencies:
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/ws@8.18.1':
dependencies:
@@ -17345,7 +17351,7 @@ snapshots:
'@types/xml2js@0.4.14':
dependencies:
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/yargs-parser@21.0.3': {}
@@ -22357,7 +22363,7 @@ snapshots:
jest-util@29.7.0:
dependencies:
'@jest/types': 29.6.3
'@types/node': 18.19.100
'@types/node': 20.17.47
chalk: 4.1.2
ci-info: 3.9.0
graceful-fs: 4.2.11