Compare commits

...

133 Commits

Author SHA1 Message Date
xiaojunnuo
7feece597a v1.35.5 2025-06-20 17:14:13 +08:00
xiaojunnuo
fa16c782ca build: prepare to build 2025-06-20 17:10:08 +08:00
xiaojunnuo
a03d0b6a4a chore: 2025-06-20 17:09:59 +08:00
xiaojunnuo
dff76b8912 build: prepare to build 2025-06-20 17:07:59 +08:00
xiaojunnuo
cffea9a9bc chore: 2025-06-20 17:07:26 +08:00
xiaojunnuo
43fee42198 perf: 首次打开任务日志查看页面,自动滚动到底部 2025-06-20 17:06:34 +08:00
xiaojunnuo
5cd3968929 fix: 腾讯云授权支持设置是否国际站,部署到EO插件支持国际站 2025-06-20 16:58:20 +08:00
xiaojunnuo
65dcae79f8 fix: 修复邮箱包含.号校验失败的bug 2025-06-20 16:45:29 +08:00
xiaojunnuo
e11b3becfd perf: 支持批量修改通知和定时 2025-06-18 12:29:43 +08:00
xiaojunnuo
73fa937f5c chore: 2025-06-17 13:39:40 +08:00
xiaojunnuo
6ebe2e54ac chore: 2025-06-16 23:57:11 +08:00
xiaojunnuo
fb29a11cc9 build: publish 2025-06-13 12:24:08 +08:00
xiaojunnuo
a9e06cbf92 build: trigger build image 2025-06-13 12:23:51 +08:00
xiaojunnuo
93017c044d v1.35.4 2025-06-13 12:22:12 +08:00
xiaojunnuo
c223ddbb9a build: prepare to build 2025-06-13 12:19:21 +08:00
xiaojunnuo
f00aeacb8b perf: 支持s3 access做测试 2025-06-13 12:18:26 +08:00
xiaojunnuo
5b49071d6b Merge remote-tracking branch 'origin/v2-dev' into v2-dev 2025-06-13 09:53:30 +08:00
xiaojunnuo
17053a882b chore: 2025-06-13 09:53:07 +08:00
xiaojunnuo
5e723d31a4 chore: 2025-06-13 00:40:54 +08:00
xiaojunnuo
3283bd8b75 build: publish 2025-06-13 00:40:05 +08:00
xiaojunnuo
770d3c0015 build: trigger build image 2025-06-13 00:39:33 +08:00
xiaojunnuo
d15dfafd5d v1.35.3 2025-06-13 00:29:59 +08:00
xiaojunnuo
545c13d55c build: prepare to build 2025-06-13 00:27:18 +08:00
xiaojunnuo
e2099ac9ca fix: 修复重试次数设置无效的bug 2025-06-13 00:25:08 +08:00
xiaojunnuo
c937583a50 fix: 修复消息内容存在()<>等括号情况下无法发送tg通知的bug 2025-06-13 00:24:55 +08:00
xiaojunnuo
43c7a19849 perf: 支持雨云dns解析以及雨云证书更新 2025-06-12 23:51:21 +08:00
xiaojunnuo
83543487e7 perf: 支持雨云dns解析 2025-06-12 22:41:08 +08:00
xiaojunnuo
434b259525 chore: 2025-06-11 22:40:21 +08:00
xiaojunnuo
add8efaba8 chore: 2025-06-10 18:44:32 +08:00
xiaojunnuo
12ed79ca60 chore: 雨云支持 2025-06-10 18:41:25 +08:00
xiaojunnuo
1e863382d3 perf: 授权列表类型颜色优化 2025-06-10 18:40:23 +08:00
xiaojunnuo
bad3504d4a perf: github 版本检查支持执行脚本 2025-06-10 12:13:04 +08:00
xiaojunnuo
d94f207162 chore: 首创流水线模式自动申请和部署证书,已被多个项目“借鉴”,被抄也是一种成功。 2025-06-10 10:59:40 +08:00
xiaojunnuo
2c4b7781a4 chore: 2025-06-10 10:52:58 +08:00
xiaojunnuo
4574c6ff07 chore: 2025-06-10 10:52:30 +08:00
xiaojunnuo
7b5043e87b chore: 增加专业版过期通知 2025-06-10 10:21:09 +08:00
xiaojunnuo
a06f3ac5da build: publish 2025-06-09 23:58:39 +08:00
xiaojunnuo
721346a40a build: trigger build image 2025-06-09 23:58:23 +08:00
xiaojunnuo
f252871fb8 v1.35.2 2025-06-09 23:57:04 +08:00
xiaojunnuo
107196122c build: prepare to build 2025-06-09 23:54:50 +08:00
xiaojunnuo
563c02d8da build: prepare to build 2025-06-09 23:50:44 +08:00
xiaojunnuo
765934970a chore: 数据库 2025-06-09 23:50:19 +08:00
xiaojunnuo
9cbdfda829 perf: 优化阿里云nlb支持部署扩展证书 2025-06-09 23:41:44 +08:00
xiaojunnuo
c1fbc8cd68 fix: 修复阿里云新加坡clb无法部署证书的bug 2025-06-09 23:41:21 +08:00
xiaojunnuo
a92107cc47 fix: 修复检查github release 插件无法保存最后版本的bug 2025-06-09 23:35:17 +08:00
xiaojunnuo
3e84e116e8 fix: 修复阿里云新加坡clb无法部署证书的bug 2025-06-09 22:46:59 +08:00
xiaojunnuo
7c0cdd169e perf: 子域名托管帮助链接优化为打开新窗口
Closes https://github.com/certd/certd/issues/419
2025-06-09 22:28:56 +08:00
xiaojunnuo
424fd96615 perf: 阿里云dns操作增加重试机制 2025-06-09 11:42:25 +08:00
xiaojunnuo
ebfcea88da chore: 2025-06-09 11:38:07 +08:00
xiaojunnuo
3c7eb2f5e2 chore: 小优化 2025-06-09 11:32:06 +08:00
xiaojunnuo
936167972f fix: 修复站点监控定时器多次添加的bug 2025-06-09 11:14:45 +08:00
xiaojunnuo
7f6070c960 perf: history增加触发类型显示 2025-06-09 11:13:51 +08:00
xiaojunnuo
0aea9c129c build: publish 2025-06-07 09:12:22 +08:00
xiaojunnuo
d20fb7daa8 build: trigger build image 2025-06-07 09:12:06 +08:00
xiaojunnuo
a619f8a2fe v1.35.1 2025-06-07 09:10:46 +08:00
xiaojunnuo
0acb858d7b build: prepare to build 2025-06-07 09:08:51 +08:00
xiaojunnuo
e459be76fe build: prepare to build 2025-06-07 09:05:35 +08:00
xiaojunnuo
c4c59ccc75 revert: 2025-06-07 01:19:47 +08:00
xiaojunnuo
c820315409 perf: 优化流水线页面,增加下次执行时间、查看证书显示 2025-06-07 01:19:37 +08:00
xiaojunnuo
2a19b61b7a perf: aliyun alb支持部署扩展证书 2025-06-07 00:15:16 +08:00
xiaojunnuo
e1cf64ae16 perf: 修改 HTTPS 服务器监听地址
- 将 HTTPS服务器的监听地址从 '0.0.0.0' 修改为 '::',以支持 IPv6

https://github.com/certd/certd/issues/416
2025-06-06 22:27:41 +08:00
xiaojunnuo
d3c2f8eb43 perf: 站点证书监控支持定时设置,重试次数设置 2025-06-06 18:20:30 +08:00
xiaojunnuo
a00453c83a fix: 修复站点监控通知渠道设置无效的bug 2025-06-06 16:12:30 +08:00
xiaojunnuo
2eb0e54909 perf: 证书申请支持letencrypt profile选项 2025-06-06 15:12:24 +08:00
xiaojunnuo
ac87bc57e9 fix: 某些证书提供商的证书确实commonName导致无法转换证书的问题 2025-06-06 13:53:05 +08:00
xiaojunnuo
2b8ea857f0 build: publish 2025-06-06 00:12:42 +08:00
xiaojunnuo
11c52114b2 build: trigger build image 2025-06-06 00:12:26 +08:00
xiaojunnuo
f55f9b4dd3 v1.35.0 2025-06-06 00:11:09 +08:00
xiaojunnuo
cdd369ea98 build: prepare to build 2025-06-06 00:09:15 +08:00
xiaojunnuo
f2aab9f476 build: prepare to build 2025-06-06 00:02:00 +08:00
xiaojunnuo
2619dc3556 chore: 2025-06-06 00:01:39 +08:00
xiaojunnuo
1bbed351ba Merge branch 'v2-dev' into v2 2025-06-05 23:56:47 +08:00
xiaojunnuo
4cfb2644c6 build: publish 2025-06-05 23:52:05 +08:00
xiaojunnuo
5b85c7ad39 build: trigger build image 2025-06-05 23:51:48 +08:00
xiaojunnuo
ab3a3156f2 v1.34.11 2025-06-05 23:50:29 +08:00
xiaojunnuo
28a582025e build: prepare to build 2025-06-05 23:48:30 +08:00
xiaojunnuo
8451a83a3a chore: 2025-06-05 23:48:14 +08:00
xiaojunnuo
92c8dcc666 build: prepare to build 2025-06-05 23:43:24 +08:00
xiaojunnuo
da68b02e1e chore: 2025-06-05 23:43:14 +08:00
xiaojunnuo
2d7729dbe9 perf: 站点监控支持批量导入域名和ip 2025-06-05 23:31:36 +08:00
xiaojunnuo
6467edb843 fix: 修复flexcdn部署证书的顶级CA名称显示 2025-06-05 20:31:18 +08:00
xiaojunnuo
1f01b3a9ff chore: 2025-06-05 16:57:49 +08:00
xiaojunnuo
8aa1f8926d chore: 2025-06-05 16:54:35 +08:00
xiaojunnuo
ace363fa35 fix: 修复flexcdn证书commonNames错误的问题 2025-06-05 16:53:39 +08:00
xiaojunnuo
919f70a5fd fix: 修复用户最大流水线数量校验的问题 2025-06-05 16:29:13 +08:00
greper
9d6ad771a3 perf: AWS 中国区 CloudFront 证书部署(IAM 证书)@wifi9984
feat: AWS 中国区 CloudFront 证书部署(IAM 证书) @wifi9984
2025-06-05 15:50:31 +08:00
greper
bafccb20c6 perf: 为proxmox登录添加领域字段(@yajiedesign)
为proxmox登录添加领域字段
2025-06-05 15:48:32 +08:00
xiaojunnuo
cef30c2af0 chore: 2025-06-05 14:59:29 +08:00
yajiedesign
ca58056a75 根据要求修改 2025-06-05 14:25:36 +08:00
xiaojunnuo
03e2e99498 perf: 分组选择支持清空选项 2025-06-05 13:49:27 +08:00
yajiedesign
fba7afc4e9 为proxmox登录添加领域字段 2025-06-05 13:39:10 +08:00
xiaojunnuo
d7dda336ec chore: 2025-06-05 13:25:17 +08:00
xiaojunnuo
55d4395160 chore: 2025-06-05 11:26:27 +08:00
xiaojunnuo
f7d5baa6d0 fix: 修复中文域名使用cname方式校验无法通过的问题 2025-06-05 11:25:16 +08:00
xiaojunnuo
6ff509d263 perf: 增加下载日志按钮 2025-06-04 23:18:40 +08:00
xiaojunnuo
57778981a7 chore: 2025-06-04 23:06:07 +08:00
xiaojunnuo
6ac3bc564f perf: 支持设置用户有效期 2025-06-04 23:00:37 +08:00
xiaojunnuo
82d08e2153 chore: 2025-06-04 18:43:35 +08:00
xiaojunnuo
6212cd77e8 chore: 2025-06-04 17:31:40 +08:00
xiaojunnuo
170034f943 chore: 2025-06-04 17:28:56 +08:00
xiaojunnuo
e639a8f9f1 perf: 优化cname检查,当有冲突的cname记录时,给出提示 2025-06-04 17:26:56 +08:00
greper
9d10c45dac Merge pull request #411 from 5aaee9/v2
支持为 Lego 添加额外的命令参数
2025-06-04 16:41:17 +08:00
Indexyz
b84159f2f1 feat(lego): support for command options 2025-06-04 16:31:25 +08:00
xiaojunnuo
49f26b4049 fix: 修复cv4pve sdk (proxmox插件连接失败时无法正常结束任务的bug) 2025-06-04 13:36:31 +08:00
xiaojunnuo
0e7e44cee2 build: publish 2025-06-03 23:57:43 +08:00
xiaojunnuo
36e769502c build: trigger build image 2025-06-03 23:57:27 +08:00
xiaojunnuo
a4b6580247 v1.34.10 2025-06-03 23:56:13 +08:00
xiaojunnuo
84fb1c5127 build: prepare to build 2025-06-03 23:54:07 +08:00
xiaojunnuo
ddfd0fb81d perf: 支持部署到飞牛OS 2025-06-03 23:52:43 +08:00
xiaojunnuo
37edbf5824 perf: 支持日志写入文件 2025-06-03 18:16:35 +08:00
xiaojunnuo
e15212bf49 Merge branch 'v2' into v2-dev 2025-06-03 17:45:50 +08:00
xiaojunnuo
6a0cc1b1f3 perf: 优化流水线名称过长时的显示 2025-06-03 17:40:26 +08:00
xiaojunnuo
0e8339c701 perf: 阿里云CLB支持部署到扩展域名 2025-06-03 17:39:52 +08:00
greper
5d71a4dbde Merge pull request #409 from 5aaee9/v2
修复 FlexCDN 的问题
2025-06-03 11:09:24 +08:00
xiaojunnuo
0b78030c59 Merge remote-tracking branch 'origin/v2-dev' into v2-dev 2025-06-03 10:24:21 +08:00
xiaojunnuo
24237c16bf chore: 隐藏导出按钮 2025-06-03 10:23:28 +08:00
5aaee9
c48da5dea7 fix(flexcdn): fix cert upload and skipSslVerify required 2025-06-01 01:23:44 +08:00
wifi9984
6702ca10a1 feat: 完善注释 2025-05-31 22:19:34 +08:00
wifi9984
4b44bd5e61 reset pnpm-lock 2025-05-31 22:00:32 +08:00
wifi9984
8a55beda92 feat: AWS 中国区 CloudFront 证书部署(IAM 证书) 2025-05-31 21:46:21 +08:00
xiaojunnuo
a12b824339 build: publish 2025-05-31 00:57:52 +08:00
xiaojunnuo
c4a743189e build: trigger build image 2025-05-31 00:57:34 +08:00
xiaojunnuo
85f9ef35f6 v1.34.9 2025-05-31 00:56:14 +08:00
xiaojunnuo
6de220e38a build: prepare to build 2025-05-31 00:54:04 +08:00
xiaojunnuo
0d455d8c2f chore: email-selector 优化 2025-05-31 00:53:05 +08:00
xiaojunnuo
f7b0b44ef6 perf: 邮箱支持保存和选择 2025-05-31 00:45:54 +08:00
xiaojunnuo
81282a9c88 chore: 通知优化 2025-05-29 23:31:39 +08:00
xiaojunnuo
a9b302e38d perf: 不止证书自动化,插件解锁无限可能 2025-05-29 20:41:55 +08:00
xiaojunnuo
1fe4c367f7 fix: 修复Farcdn证书有效期错误的问题 2025-05-29 20:37:17 +08:00
xiaojunnuo
2de7583900 chore: 2025-05-29 09:41:21 +08:00
xiaojunnuo
356703c83e perf: 支持github 新版本检查并发布通知 2025-05-29 00:08:10 +08:00
xiaojunnuo
1cae709b2b build: publish 2025-05-28 23:14:49 +08:00
xiaojunnuo
46a492248f build: trigger build image 2025-05-28 23:14:34 +08:00
173 changed files with 5711 additions and 866 deletions

View File

@@ -3,6 +3,120 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
### Bug Fixes
* 腾讯云授权支持设置是否国际站部署到EO插件支持国际站 ([5cd3968](https://github.com/certd/certd/commit/5cd3968929acef333cf30d3b20cf21cea6c82c5f))
* 修复邮箱包含.号校验失败的bug ([65dcae7](https://github.com/certd/certd/commit/65dcae79f8faa7a6cb425e10a0fdb6758b0719f3))
### Performance Improvements
* 首次打开任务日志查看页面,自动滚动到底部 ([43fee42](https://github.com/certd/certd/commit/43fee42198e8697185b427b1fa3eb79409603393))
* 支持批量修改通知和定时 ([e11b3be](https://github.com/certd/certd/commit/e11b3becfd4abe6547e84d09adc38ebd6e1c4b87))
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
* 支持雨云dns解析 ([8354348](https://github.com/certd/certd/commit/83543487e7418683bd79cfe3b9e0d792bdb977f7))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
* github 版本检查支持执行脚本 ([bad3504](https://github.com/certd/certd/commit/bad3504d4a15e6989b967b66aa9da8c6981f25bf))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes
* 修复阿里云新加坡clb无法部署证书的bug ([c1fbc8c](https://github.com/certd/certd/commit/c1fbc8cd68ae020ef342e4e92f4d9b4869ca1ead))
* 修复阿里云新加坡clb无法部署证书的bug ([3e84e11](https://github.com/certd/certd/commit/3e84e116e863b54c6b4d7db160af372dacc5857f))
* 修复检查github release 插件无法保存最后版本的bug ([a92107c](https://github.com/certd/certd/commit/a92107cc47133883b099d5228b06373e84c8bb50))
* 修复站点监控定时器多次添加的bug ([9361679](https://github.com/certd/certd/commit/936167972fe83e519bc01a0dd961d9c0635d24ab))
### Performance Improvements
* 阿里云dns操作增加重试机制 ([424fd96](https://github.com/certd/certd/commit/424fd96615c05e949af8c837c261c1400bdffba2))
* 优化阿里云nlb支持部署扩展证书 ([9cbdfda](https://github.com/certd/certd/commit/9cbdfda829b231733d54c66c5024d46e6fc11af3))
* 子域名托管帮助链接优化为打开新窗口 ([7c0cdd1](https://github.com/certd/certd/commit/7c0cdd169e2f943e703e433677f2f437d4aa02ee))
* history增加触发类型显示 ([7f6070c](https://github.com/certd/certd/commit/7f6070c960ed7bf02add5ab36436de6573f2f1fa))
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
### Bug Fixes
* 某些证书提供商的证书确实commonName导致无法转换证书的问题 ([ac87bc5](https://github.com/certd/certd/commit/ac87bc57e957ea4679707bfd38d6840e26319bed))
* 修复站点监控通知渠道设置无效的bug ([a00453c](https://github.com/certd/certd/commit/a00453c83a58114ce2873dd6e6aaf313f1ce0f87))
### Performance Improvements
* 修改 HTTPS 服务器监听地址 ([e1cf64a](https://github.com/certd/certd/commit/e1cf64ae16d4abfe4299ff16d5088c30cf3c6365))
* 优化流水线页面,增加下次执行时间、查看证书显示 ([c820315](https://github.com/certd/certd/commit/c8203154094fae3d17198747f49f5f41ddf29a4e))
* 站点证书监控支持定时设置,重试次数设置 ([d3c2f8e](https://github.com/certd/certd/commit/d3c2f8eb436e670772d14a54acd6b541c5aa3978))
* 证书申请支持letencrypt profile选项 ([2eb0e54](https://github.com/certd/certd/commit/2eb0e54909d8ad36708e07c12fd598998159bc43))
* aliyun alb支持部署扩展证书 ([2a19b61](https://github.com/certd/certd/commit/2a19b61b7a78620c06396c2cc37cc77d738b6d12))
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
### Features
* 完善注释 ([6702ca1](https://github.com/certd/certd/commit/6702ca10a17f5d7dbff789b039f7269496f66b97))
* AWS 中国区 CloudFront 证书部署IAM 证书) ([8a55bed](https://github.com/certd/certd/commit/8a55beda924b3be2a53b9ba80d9487cefa8bf887))
* **lego:** support for command options ([b84159f](https://github.com/certd/certd/commit/b84159f2f11531f058837c2e82d66499f3740f20))
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
### Bug Fixes
* 修复用户最大流水线数量校验的问题 ([919f70a](https://github.com/certd/certd/commit/919f70a5fd2842ca69f96f1659bb5a7ba3f73776))
* 修复中文域名使用cname方式校验无法通过的问题 ([f7d5baa](https://github.com/certd/certd/commit/f7d5baa6d04cb83c572b06e62f885890cfa0143a))
* 修复cv4pve sdk (proxmox插件连接失败时无法正常结束任务的bug) ([49f26b4](https://github.com/certd/certd/commit/49f26b4049a0549b0270395157e96e8f04a68bc4))
* 修复flexcdn部署证书的顶级CA名称显示 ([6467edb](https://github.com/certd/certd/commit/6467edb84324d7c80a85212675dbacedc459df83))
* 修复flexcdn证书commonNames错误的问题 ([ace363f](https://github.com/certd/certd/commit/ace363fa355436e769b27f71cc487d30d6441780))
### Performance Improvements
* 分组选择支持清空选项 ([03e2e99](https://github.com/certd/certd/commit/03e2e9949837b34eb3ea56d14a9e8a5dabc96063))
* 优化cname检查当有冲突的cname记录时给出提示 ([e639a8f](https://github.com/certd/certd/commit/e639a8f9f12640ffcca69f1a6a0324459924afbd))
* 增加下载日志按钮 ([6ff509d](https://github.com/certd/certd/commit/6ff509d263c0182645b4692c10b5fedb192db964))
* 站点监控支持批量导入域名和ip ([2d7729d](https://github.com/certd/certd/commit/2d7729dbe98f29088f5f317db2b52cc1ede223a6))
* 支持设置用户有效期 ([6ac3bc5](https://github.com/certd/certd/commit/6ac3bc564f407dad2cd0b0b0744e887387aa5da3))
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Bug Fixes
* **flexcdn:** fix cert upload and skipSslVerify required ([c48da5d](https://github.com/certd/certd/commit/c48da5dea7f0f0cdeae643b106b4a678acc3b14b))
### Performance Improvements
* 阿里云CLB支持部署到扩展域名 ([0e8339c](https://github.com/certd/certd/commit/0e8339c70190890d449099e1d26e5ed06ff135fb))
* 优化流水线名称过长时的显示 ([6a0cc1b](https://github.com/certd/certd/commit/6a0cc1b1f3ad508f9e4093b3b682b163f12389eb))
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
* 支持日志写入文件 ([37edbf5](https://github.com/certd/certd/commit/37edbf5824d6aaae68ea1ef7259c6f739d418d2c))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Bug Fixes
* 修复Farcdn证书有效期错误的问题 ([1fe4c36](https://github.com/certd/certd/commit/1fe4c367f7128de9ba5e3395ae06bc81e63a7d5a))
### Performance Improvements
* 不止证书自动化,插件解锁无限可能 ([a9b302e](https://github.com/certd/certd/commit/a9b302e38d3328d75df8b2da3d8b914851e55e9c))
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
* 支持github 新版本检查并发布通知 ([356703c](https://github.com/certd/certd/commit/356703c83ea18c6efb8931402e181280d7b7e696))
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
### Bug Fixes ### Bug Fixes

View File

@@ -1,9 +1,9 @@
# Certd # Certd
Certd 是一个免费全自动申请和自动部署更新SSL证书管理系统。 Certd® 是一个免费全自动证书管理系统,让你的网站证书永不过期
后缀d取自linux守护进程的命名风格意为证书守护进程。 首创流水线申请部署证书模式,已被多个项目“借鉴”,被抄也是一种成功。
关键字:证书自动申请、证书自动更新、证书自动续期、证书自动续签、证书管理工具 >后缀d取自linux守护进程的命名风格意为证书守护进程。
> 关于证书续期: > 关于证书续期:
>* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。 >* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。
@@ -13,6 +13,7 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
> 流水线数量现已调整为无限制,欢迎大家使用 > 流水线数量现已调整为无限制,欢迎大家使用
## 一、特性 ## 一、特性
本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。 本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。
@@ -32,9 +33,6 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
![](./docs/images/intro/intro.svg) ![](./docs/images/intro/intro.svg)
## 二、在线体验 ## 二、在线体验
官方Demo地址自助注册后体验 官方Demo地址自助注册后体验
@@ -168,7 +166,11 @@ https://afdian.com/a/greper
1. 可以调整开源协议以使其更严格或更宽松。 1. 可以调整开源协议以使其更严格或更宽松。
2. 可以用于商业用途。 2. 可以用于商业用途。
感谢以下贡献者做出的贡献。
<a href="https://github.com/certd/certd/graphs/contributors">
<img src="https://contrib.rocks/image?repo=certd/certd" />
</a>
## 九、 开源许可 ## 九、 开源许可
* 本项目遵循 GNU Affero General Public LicenseAGPL开源协议。 * 本项目遵循 GNU Affero General Public LicenseAGPL开源协议。

View File

@@ -1 +1 @@
23:34 12:23

View File

@@ -3,6 +3,127 @@
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.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
* 支持雨云dns解析 ([8354348](https://github.com/certd/certd/commit/83543487e7418683bd79cfe3b9e0d792bdb977f7))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
* github 版本检查支持执行脚本 ([bad3504](https://github.com/certd/certd/commit/bad3504d4a15e6989b967b66aa9da8c6981f25bf))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes
* 修复阿里云新加坡clb无法部署证书的bug ([c1fbc8c](https://github.com/certd/certd/commit/c1fbc8cd68ae020ef342e4e92f4d9b4869ca1ead))
* 修复阿里云新加坡clb无法部署证书的bug ([3e84e11](https://github.com/certd/certd/commit/3e84e116e863b54c6b4d7db160af372dacc5857f))
* 修复检查github release 插件无法保存最后版本的bug ([a92107c](https://github.com/certd/certd/commit/a92107cc47133883b099d5228b06373e84c8bb50))
* 修复站点监控定时器多次添加的bug ([9361679](https://github.com/certd/certd/commit/936167972fe83e519bc01a0dd961d9c0635d24ab))
### Performance Improvements
* 阿里云dns操作增加重试机制 ([424fd96](https://github.com/certd/certd/commit/424fd96615c05e949af8c837c261c1400bdffba2))
* 优化阿里云nlb支持部署扩展证书 ([9cbdfda](https://github.com/certd/certd/commit/9cbdfda829b231733d54c66c5024d46e6fc11af3))
* 子域名托管帮助链接优化为打开新窗口 ([7c0cdd1](https://github.com/certd/certd/commit/7c0cdd169e2f943e703e433677f2f437d4aa02ee))
* history增加触发类型显示 ([7f6070c](https://github.com/certd/certd/commit/7f6070c960ed7bf02add5ab36436de6573f2f1fa))
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
### Bug Fixes
* 某些证书提供商的证书确实commonName导致无法转换证书的问题 ([ac87bc5](https://github.com/certd/certd/commit/ac87bc57e957ea4679707bfd38d6840e26319bed))
* 修复站点监控通知渠道设置无效的bug ([a00453c](https://github.com/certd/certd/commit/a00453c83a58114ce2873dd6e6aaf313f1ce0f87))
### Performance Improvements
* 修改 HTTPS 服务器监听地址 ([e1cf64a](https://github.com/certd/certd/commit/e1cf64ae16d4abfe4299ff16d5088c30cf3c6365))
* 优化流水线页面,增加下次执行时间、查看证书显示 ([c820315](https://github.com/certd/certd/commit/c8203154094fae3d17198747f49f5f41ddf29a4e))
* 站点证书监控支持定时设置,重试次数设置 ([d3c2f8e](https://github.com/certd/certd/commit/d3c2f8eb436e670772d14a54acd6b541c5aa3978))
* 证书申请支持letencrypt profile选项 ([2eb0e54](https://github.com/certd/certd/commit/2eb0e54909d8ad36708e07c12fd598998159bc43))
* aliyun alb支持部署扩展证书 ([2a19b61](https://github.com/certd/certd/commit/2a19b61b7a78620c06396c2cc37cc77d738b6d12))
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
### Features
* 完善注释 ([6702ca1](https://github.com/certd/certd/commit/6702ca10a17f5d7dbff789b039f7269496f66b97))
* AWS 中国区 CloudFront 证书部署IAM 证书) ([8a55bed](https://github.com/certd/certd/commit/8a55beda924b3be2a53b9ba80d9487cefa8bf887))
* **lego:** support for command options ([b84159f](https://github.com/certd/certd/commit/b84159f2f11531f058837c2e82d66499f3740f20))
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
### Bug Fixes
* 修复用户最大流水线数量校验的问题 ([919f70a](https://github.com/certd/certd/commit/919f70a5fd2842ca69f96f1659bb5a7ba3f73776))
* 修复中文域名使用cname方式校验无法通过的问题 ([f7d5baa](https://github.com/certd/certd/commit/f7d5baa6d04cb83c572b06e62f885890cfa0143a))
* 修复cv4pve sdk (proxmox插件连接失败时无法正常结束任务的bug) ([49f26b4](https://github.com/certd/certd/commit/49f26b4049a0549b0270395157e96e8f04a68bc4))
* 修复flexcdn部署证书的顶级CA名称显示 ([6467edb](https://github.com/certd/certd/commit/6467edb84324d7c80a85212675dbacedc459df83))
* 修复flexcdn证书commonNames错误的问题 ([ace363f](https://github.com/certd/certd/commit/ace363fa355436e769b27f71cc487d30d6441780))
### Performance Improvements
* 分组选择支持清空选项 ([03e2e99](https://github.com/certd/certd/commit/03e2e9949837b34eb3ea56d14a9e8a5dabc96063))
* 优化cname检查当有冲突的cname记录时给出提示 ([e639a8f](https://github.com/certd/certd/commit/e639a8f9f12640ffcca69f1a6a0324459924afbd))
* 增加下载日志按钮 ([6ff509d](https://github.com/certd/certd/commit/6ff509d263c0182645b4692c10b5fedb192db964))
* 站点监控支持批量导入域名和ip ([2d7729d](https://github.com/certd/certd/commit/2d7729dbe98f29088f5f317db2b52cc1ede223a6))
* 支持设置用户有效期 ([6ac3bc5](https://github.com/certd/certd/commit/6ac3bc564f407dad2cd0b0b0744e887387aa5da3))
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Bug Fixes
* **flexcdn:** fix cert upload and skipSslVerify required ([c48da5d](https://github.com/certd/certd/commit/c48da5dea7f0f0cdeae643b106b4a678acc3b14b))
### Performance Improvements
* 阿里云CLB支持部署到扩展域名 ([0e8339c](https://github.com/certd/certd/commit/0e8339c70190890d449099e1d26e5ed06ff135fb))
* 优化流水线名称过长时的显示 ([6a0cc1b](https://github.com/certd/certd/commit/6a0cc1b1f3ad508f9e4093b3b682b163f12389eb))
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
* 支持日志写入文件 ([37edbf5](https://github.com/certd/certd/commit/37edbf5824d6aaae68ea1ef7259c6f739d418d2c))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Bug Fixes
* 修复Farcdn证书有效期错误的问题 ([1fe4c36](https://github.com/certd/certd/commit/1fe4c367f7128de9ba5e3395ae06bc81e63a7d5a))
### Performance Improvements
* 不止证书自动化,插件解锁无限可能 ([a9b302e](https://github.com/certd/certd/commit/a9b302e38d3328d75df8b2da3d8b914851e55e9c))
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
* 支持github 新版本检查并发布通知 ([356703c](https://github.com/certd/certd/commit/356703c83ea18c6efb8931402e181280d7b7e696))
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
### Bug Fixes
* 更新 1panel API 版本支持v1/v2设置 ([e6195ad](https://github.com/certd/certd/commit/e6195ade3ec54b138825b8d6738f86eb8afdd720))
* 同步更新namesilo接口修复无法创建和删除dns记录的问题 ([36b02c2](https://github.com/certd/certd/commit/36b02c2cec145c13d4ef29d49aba5b6b4f697df2))
* 修复阿里云 esa 证书获取站点列表错误的问题 ([0c2ea5d](https://github.com/certd/certd/commit/0c2ea5da4c836f8a0df132a3f22d399bd9ee1de9))
* 修复部署到华为cdn子账号ak查询不到域名的bug ([ebb292a](https://github.com/certd/certd/commit/ebb292a2f7a425c1bc810f59468beb3f1d5bc3f0))
* 修复证书申请任务无法修改dns提供商类型的bug ([8802274](https://github.com/certd/certd/commit/88022747bebe2054223e0241d68d410771405e68))
### Performance Improvements
* 关闭腾讯云证书通知提醒 ([231a875](https://github.com/certd/certd/commit/231a875bb481420c39bf76ec9ff4e50954ab9fe4))
* 优化站点选择组件,切换选择时不刷新列表 ([3a14714](https://github.com/certd/certd/commit/3a147141b1a5d67c92a5ce88a5313eaa62859e03))
* 优化站点ip检查 ([a463711](https://github.com/certd/certd/commit/a463711b03a20120f2a298be15d71ca152d27f21))
* 站点监控支持监控IP ([9cc4c01](https://github.com/certd/certd/commit/9cc4c017ae646a18284e732769b82636feda01d3))
* 支持批量重新运行 ([8189982](https://github.com/certd/certd/commit/818998259ddc75e722196ac5c365038818539b9b))
* farcdn优化 ([a06ef07](https://github.com/certd/certd/commit/a06ef07178ed73c537e21c7d57e5e5144d2c056d))
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26) ## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
### Performance Improvements ### Performance Improvements

View File

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

View File

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

View File

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

View File

@@ -3,6 +3,50 @@
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.35.5](https://github.com/publishlab/node-acme-client/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/acme-client
## [1.35.4](https://github.com/publishlab/node-acme-client/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/acme-client
## [1.35.3](https://github.com/publishlab/node-acme-client/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/acme-client
## [1.35.2](https://github.com/publishlab/node-acme-client/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/acme-client
## [1.35.1](https://github.com/publishlab/node-acme-client/compare/v1.35.0...v1.35.1) (2025-06-07)
### Performance Improvements
* 证书申请支持letencrypt profile选项 ([2eb0e54](https://github.com/publishlab/node-acme-client/commit/2eb0e54909d8ad36708e07c12fd598998159bc43))
# [1.35.0](https://github.com/publishlab/node-acme-client/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/acme-client
## [1.34.11](https://github.com/publishlab/node-acme-client/compare/v1.34.10...v1.34.11) (2025-06-05)
### Bug Fixes
* 修复中文域名使用cname方式校验无法通过的问题 ([f7d5baa](https://github.com/publishlab/node-acme-client/commit/f7d5baa6d04cb83c572b06e62f885890cfa0143a))
### Performance Improvements
* 优化cname检查当有冲突的cname记录时给出提示 ([e639a8f](https://github.com/publishlab/node-acme-client/commit/e639a8f9f12640ffcca69f1a6a0324459924afbd))
## [1.34.10](https://github.com/publishlab/node-acme-client/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/acme-client
## [1.34.9](https://github.com/publishlab/node-acme-client/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/acme-client
## [1.34.8](https://github.com/publishlab/node-acme-client/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/publishlab/node-acme-client/compare/v1.34.7...v1.34.8) (2025-05-28)
**Note:** Version bump only for package @certd/acme-client **Note:** Version bump only for package @certd/acme-client

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.8", "version": "1.35.5",
"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.8", "@certd/basic": "^1.35.5",
"@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",
@@ -27,7 +27,7 @@
"https-proxy-agent": "^7.0.5", "https-proxy-agent": "^7.0.5",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"node-forge": "^1.3.1", "node-forge": "^1.3.1",
"punycode": "^2.3.1" "punycode.js": "^2.3.1"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.14.10", "@types/node": "^20.14.10",
@@ -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": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -75,6 +75,9 @@ export default async (client, userOpts) => {
log("[auto] Placing new certificate order with ACME provider"); log("[auto] Placing new certificate order with ACME provider");
const orderPayload = { identifiers: uniqueDomains.map((d) => ({ type: "dns", value: d })) }; const orderPayload = { identifiers: uniqueDomains.map((d) => ({ type: "dns", value: d })) };
if (opts.profile && client.sslProvider === 'letsencrypt' ){
orderPayload.profile = opts.profile;
}
const order = await client.createOrder(orderPayload); const order = await client.createOrder(orderPayload);
const authorizations = await client.getAuthorizations(order); const authorizations = await client.getAuthorizations(order);
@@ -213,12 +216,16 @@ export default async (client, userOpts) => {
return promise; return promise;
} }
async function runPromisePa(tasks, waitTime = 5000) { async function runPromisePa(tasks, waitTime = 8000) {
const results = []; const results = [];
let j = 0
// eslint-disable-next-line no-await-in-loop,no-restricted-syntax // eslint-disable-next-line no-await-in-loop,no-restricted-syntax
for (const task of tasks) { for (const task of tasks) {
j++
log(`开始第${j}个任务`);
results.push(task()); results.push(task());
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
log(`wait ${waitTime}s`)
await wait(waitTime); await wait(waitTime);
} }
return Promise.all(results); return Promise.all(results);
@@ -242,6 +249,7 @@ export default async (client, userOpts) => {
log(`跳过本地验证skipChallengeVerification=true等待 60s`); log(`跳过本地验证skipChallengeVerification=true等待 60s`);
await wait(60 * 1000); await wait(60 * 1000);
} else { } else {
log("开始本地校验")
await runPromisePa(localVerifyTasks, 1000); await runPromisePa(localVerifyTasks, 1000);
log(`本地校验完成,等待${waitDnsDiffuseTime}s`) log(`本地校验完成,等待${waitDnsDiffuseTime}s`)
await wait(waitDnsDiffuseTime * 1000) await wait(waitDnsDiffuseTime * 1000)

View File

@@ -90,10 +90,12 @@ const defaultOpts = {
*/ */
class AcmeClient { class AcmeClient {
sslProvider
constructor(opts) { constructor(opts) {
if (!Buffer.isBuffer(opts.accountKey)) { if (!Buffer.isBuffer(opts.accountKey)) {
opts.accountKey = Buffer.from(opts.accountKey); opts.accountKey = Buffer.from(opts.accountKey);
} }
this.sslProvider = opts.sslProvider;
this.opts = { ...defaultOpts, ...opts }; this.opts = { ...defaultOpts, ...opts };
this.backoffOpts = { this.backoffOpts = {

View File

@@ -66,6 +66,7 @@ export interface ClientAutoOptions {
challengePriority?: string[]; challengePriority?: string[];
preferredChain?: string; preferredChain?: string;
signal?: AbortSignal; signal?: AbortSignal;
profile?:string;
} }
export class Client { export class Client {
@@ -203,6 +204,7 @@ export const agents: any;
export function setLogger(fn: (message: any, ...args: any[]) => void): void; export function setLogger(fn: (message: any, ...args: any[]) => void): void;
export function walkTxtRecord(record: any): Promise<string[]>; export function walkTxtRecord(record: any): Promise<string[]>;
export function getAuthoritativeDnsResolver(record:string): Promise<any>;
export const CancelError: typeof CancelError; export const CancelError: typeof CancelError;

View File

@@ -3,6 +3,45 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/basic
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/basic
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/basic
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/basic
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
**Note:** Version bump only for package @certd/basic
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/basic
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
**Note:** Version bump only for package @certd/basic
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Performance Improvements
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
* 支持日志写入文件 ([37edbf5](https://github.com/certd/certd/commit/37edbf5824d6aaae68ea1ef7259c6f739d418d2c))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/basic
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
**Note:** Version bump only for package @certd/basic **Note:** Version bump only for package @certd/basic

View File

@@ -1 +1 @@
23:11 17:10

View File

@@ -1,7 +1,7 @@
{ {
"name": "@certd/basic", "name": "@certd/basic",
"private": false, "private": false,
"version": "1.34.8", "version": "1.35.5",
"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": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -18,16 +18,31 @@ const OutputAppender = {
}, },
}; };
let logFilePath = "./logs/app.log";
export function resetLogConfigure() { export function resetLogConfigure() {
// @ts-ignore // @ts-ignore
log4js.configure({ log4js.configure({
appenders: { std: { type: "stdout" }, output: { type: OutputAppender } }, appenders: {
categories: { default: { appenders: ["std"], level: "info" }, pipeline: { appenders: ["std", "output"], level: "info" } }, std: { type: "stdout" },
output: { type: OutputAppender },
file: {
type: "dateFile",
filename: logFilePath,
keepFileExt: true,
compress: true,
numBackups: 3,
},
},
categories: { default: { appenders: ["std", "file"], level: "info" }, pipeline: { appenders: ["std", "file", "output"], level: "info" } },
}); });
} }
resetLogConfigure(); resetLogConfigure();
export const logger = log4js.getLogger("default"); export const logger = log4js.getLogger("default");
export function resetLogFilePath(filePath: string) {
logFilePath = filePath;
resetLogConfigure();
}
export function buildLogger(write: (text: string) => void) { export function buildLogger(write: (text: string) => void) {
const logger = log4js.getLogger("pipeline"); const logger = log4js.getLogger("pipeline");
const _secrets: string[] = []; const _secrets: string[] = [];
@@ -41,8 +56,15 @@ export function buildLogger(write: (text: string) => void) {
if (item == null) { if (item == null) {
continue; continue;
} }
//换成同长度的*号, item可能有多行 if (item.includes(text)) {
text = text.replaceAll(item, "*".repeat(item.length)); //整个包含
text = "*".repeat(text.length);
continue;
}
if (text.includes(item)) {
//换成同长度的*号, item可能有多行
text = text.replaceAll(item, "*".repeat(item.length));
}
} }
write(text); write(text);
}, },

View File

@@ -3,6 +3,50 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
### Performance Improvements
* 支持批量修改通知和定时 ([e11b3be](https://github.com/certd/certd/commit/e11b3becfd4abe6547e84d09adc38ebd6e1c4b87))
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/pipeline
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
**Note:** Version bump only for package @certd/pipeline
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/pipeline
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
**Note:** Version bump only for package @certd/pipeline
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Performance Improvements
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/pipeline
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
### Performance Improvements ### Performance Improvements

View File

@@ -1,7 +1,7 @@
{ {
"name": "@certd/pipeline", "name": "@certd/pipeline",
"private": false, "private": false,
"version": "1.34.8", "version": "1.35.5",
"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.8", "@certd/basic": "^1.35.5",
"@certd/plus-core": "^1.34.8", "@certd/plus-core": "^1.35.5",
"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": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

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

View File

@@ -1,5 +1,5 @@
// src/decorator/memoryCache.decorator.ts // src/decorator/memoryCache.decorator.ts
import { AccessContext, AccessDefine, AccessInputDefine } from "./api.js"; import { AccessContext, AccessDefine, AccessInputDefine, IAccessService } from "./api.js";
import { Decorator } from "../decorator/index.js"; import { Decorator } from "../decorator/index.js";
import * as _ from "lodash-es"; import * as _ from "lodash-es";
import { accessRegistry } from "./registry.js"; import { accessRegistry } from "./registry.js";
@@ -41,7 +41,7 @@ export function AccessInput(input?: AccessInputDefine): PropertyDecorator {
}; };
} }
export async function newAccess(type: string, input: any, ctx?: AccessContext) { export async function newAccess(type: string, input: any, accessService: IAccessService, ctx?: AccessContext) {
const register = accessRegistry.get(type); const register = accessRegistry.get(type);
if (register == null) { if (register == null) {
throw new Error(`access ${type} not found`); throw new Error(`access ${type} not found`);
@@ -58,6 +58,7 @@ export async function newAccess(type: string, input: any, ctx?: AccessContext) {
http, http,
logger, logger,
utils, utils,
accessService,
}; };
} }
access.setCtx(ctx); access.setCtx(ctx);

View File

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

View File

@@ -203,6 +203,7 @@ export class RunnableCollection {
if (runnable?.status) { if (runnable?.status) {
runnable.status.status = ResultType.none; runnable.status.status = ResultType.none;
runnable.status.result = ResultType.none; runnable.status.result = ResultType.none;
runnable.status.output = {};
runnable.status.inputHash = ""; runnable.status.inputHash = "";
// @ts-ignore // @ts-ignore
runnable.input = {}; runnable.input = {};

View File

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

View File

@@ -121,9 +121,13 @@ export abstract class BaseNotification implements INotification {
async onTestRequest() { async onTestRequest() {
return await this.doSend({ return await this.doSend({
userId: 0, userId: 0,
title: "【Certd】测试通知【*.foo.com】标题长度测试、测试、测试", title: "【标题】测试通知【*.foo.com】标题长度测试、测试、测试",
content: `测试通知,*.foo.com content: `测试通知
域名测试: *.foo.com
换行测试 换行测试
(括号测试)
<尖括号测试>
[中括号测试]
`, `,
pipeline: { pipeline: {
id: 1, id: 1,

View File

@@ -152,6 +152,16 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
this.logger = ctx.logger; this.logger = ctx.logger;
this.accessService = ctx.accessService; this.accessService = ctx.accessService;
this.http = ctx.http; this.http = ctx.http;
// 将证书加入secret
// @ts-ignore
if (this.cert && this.cert.crt && this.cert.key) {
//有证书
// @ts-ignore
const cert: any = this.cert;
this.registerSecret(cert.crt);
this.registerSecret(cert.key);
this.registerSecret(cert.one);
}
} }
async getAccess<T = any>(accessId: string | number, isCommon = false) { async getAccess<T = any>(accessId: string | number, isCommon = false) {
@@ -186,6 +196,14 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
return res as T; return res as T;
} }
registerSecret(value: string) {
// @ts-ignore
if (this.logger?.addSecret) {
// @ts-ignore
this.logger.addSecret(value);
}
}
randomFileId() { randomFileId() {
return Math.random().toString(36).substring(2, 9); return Math.random().toString(36).substring(2, 9);
} }

View File

@@ -3,6 +3,42 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/lib-huawei
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/lib-huawei
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-huawei
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-huawei
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
**Note:** Version bump only for package @certd/lib-huawei
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/lib-huawei
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
**Note:** Version bump only for package @certd/lib-huawei
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/lib-huawei
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/lib-huawei
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
**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.8", "version": "1.35.5",
"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": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -3,6 +3,42 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/lib-iframe
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/lib-iframe
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-iframe
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-iframe
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
**Note:** Version bump only for package @certd/lib-iframe
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/lib-iframe
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
**Note:** Version bump only for package @certd/lib-iframe
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/lib-iframe
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/lib-iframe
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
**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.8", "version": "1.35.5",
"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": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -3,6 +3,42 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/jdcloud
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/jdcloud
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/jdcloud
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/jdcloud
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
**Note:** Version bump only for package @certd/jdcloud
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/jdcloud
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
**Note:** Version bump only for package @certd/jdcloud
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/jdcloud
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/jdcloud
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
**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.8", "version": "1.35.5",
"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": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -3,6 +3,42 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/lib-k8s
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/lib-k8s
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-k8s
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-k8s
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
**Note:** Version bump only for package @certd/lib-k8s
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/lib-k8s
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
**Note:** Version bump only for package @certd/lib-k8s
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/lib-k8s
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/lib-k8s
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
**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.8", "version": "1.35.5",
"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.8", "@certd/basic": "^1.35.5",
"@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": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -3,6 +3,48 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/lib-server
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-server
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-server
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
**Note:** Version bump only for package @certd/lib-server
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/lib-server
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
### Performance Improvements
* 支持设置用户有效期 ([6ac3bc5](https://github.com/certd/certd/commit/6ac3bc564f407dad2cd0b0b0744e887387aa5da3))
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/lib-server
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Performance Improvements
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
**Note:** Version bump only for package @certd/lib-server **Note:** Version bump only for package @certd/lib-server

View File

@@ -1,6 +1,6 @@
{ {
"name": "@certd/lib-server", "name": "@certd/lib-server",
"version": "1.34.8", "version": "1.35.5",
"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.8", "@certd/acme-client": "^1.35.5",
"@certd/basic": "^1.34.8", "@certd/basic": "^1.35.5",
"@certd/pipeline": "^1.34.8", "@certd/pipeline": "^1.35.5",
"@certd/plus-core": "^1.34.8", "@certd/plus-core": "^1.35.5",
"@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": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -16,6 +16,7 @@ export class SysPublicSettings extends BaseSettings {
static __access__ = 'public'; static __access__ = 'public';
registerEnabled = false; registerEnabled = false;
userValidTimeEnabled?:boolean = false;
passwordLoginEnabled = true; passwordLoginEnabled = true;
usernameRegisterEnabled = true; usernameRegisterEnabled = true;
mobileRegisterEnabled = false; mobileRegisterEnabled = false;

View File

@@ -3,11 +3,12 @@ import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm'; import { Repository } from 'typeorm';
import { SysSettingsEntity } from '../entity/sys-settings.js'; import { SysSettingsEntity } from '../entity/sys-settings.js';
import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, SysSecret, SysSecretBackup } from './models.js'; import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, SysSecret, SysSecretBackup } from './models.js';
import * as _ from 'lodash-es';
import { BaseService } from '../../../basic/index.js'; import { BaseService } from '../../../basic/index.js';
import { cache, logger, setGlobalProxy } from '@certd/basic'; import { cache, logger, setGlobalProxy } from '@certd/basic';
import * as dns from 'node:dns'; import * as dns from 'node:dns';
import {mergeUtils} from "@certd/basic";
const {merge} = mergeUtils;
/** /**
* 设置 * 设置
*/ */
@@ -75,7 +76,7 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
} }
let newSetting: T = new type(); let newSetting: T = new type();
const savedSettings = await this.getSettingByKey(key); const savedSettings = await this.getSettingByKey(key);
newSetting = _.merge(newSetting, savedSettings); newSetting = merge(newSetting, savedSettings);
await this.saveSetting(newSetting); await this.saveSetting(newSetting);
cache.set(cacheKey, newSetting); cache.set(cacheKey, newSetting);
return newSetting; return newSetting;

View File

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

View File

@@ -3,6 +3,42 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
**Note:** Version bump only for package @certd/midway-flyway-js
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
**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.8", "version": "1.35.5",
"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": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -3,6 +3,54 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
**Note:** Version bump only for package @certd/plugin-cert
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/plugin-cert
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/plugin-cert
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/plugin-cert
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
### Bug Fixes
* 某些证书提供商的证书确实commonName导致无法转换证书的问题 ([ac87bc5](https://github.com/certd/certd/commit/ac87bc57e957ea4679707bfd38d6840e26319bed))
### Performance Improvements
* 证书申请支持letencrypt profile选项 ([2eb0e54](https://github.com/certd/certd/commit/2eb0e54909d8ad36708e07c12fd598998159bc43))
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
### Features
* **lego:** support for command options ([b84159f](https://github.com/certd/certd/commit/b84159f2f11531f058837c2e82d66499f3740f20))
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
### Bug Fixes
* 修复中文域名使用cname方式校验无法通过的问题 ([f7d5baa](https://github.com/certd/certd/commit/f7d5baa6d04cb83c572b06e62f885890cfa0143a))
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/plugin-cert
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Performance Improvements
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
### Bug Fixes ### Bug Fixes

View File

@@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-cert", "name": "@certd/plugin-cert",
"private": false, "private": false,
"version": "1.34.8", "version": "1.35.5",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@@ -16,16 +16,16 @@
"pub": "npm publish" "pub": "npm publish"
}, },
"dependencies": { "dependencies": {
"@certd/acme-client": "^1.34.8", "@certd/acme-client": "^1.35.5",
"@certd/basic": "^1.34.8", "@certd/basic": "^1.35.5",
"@certd/pipeline": "^1.34.8", "@certd/pipeline": "^1.35.5",
"@certd/plugin-lib": "^1.34.8", "@certd/plugin-lib": "^1.35.5",
"@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",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"psl": "^1.9.0", "psl": "^1.9.0",
"punycode": "^2.3.1", "punycode.js": "^2.3.1",
"rimraf": "^5.0.5" "rimraf": "^5.0.5"
}, },
"devDependencies": { "devDependencies": {
@@ -43,5 +43,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -29,9 +29,25 @@ export type DnsProviderContext = {
export interface IDnsProvider<T = any> { export interface IDnsProvider<T = any> {
onInstance(): Promise<void>; onInstance(): Promise<void>;
/**
* 中文转英文
* @param domain
*/
punyCodeEncode(domain: string): string;
/**
* 转中文域名
* @param domain
*/
punyCodeDecode(domain: string): string;
createRecord(options: CreateRecordOptions): Promise<T>; createRecord(options: CreateRecordOptions): Promise<T>;
removeRecord(options: RemoveRecordOptions<T>): Promise<void>; removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
setCtx(ctx: DnsProviderContext): void; setCtx(ctx: DnsProviderContext): void;
//中文域名是否需要punycode转码如果返回True则使用punycode来添加解析记录否则使用中文域名添加解析记录 //中文域名是否需要punycode转码如果返回True则使用punycode来添加解析记录否则使用中文域名添加解析记录
usePunyCode(): boolean; usePunyCode(): boolean;
} }

View File

@@ -1,7 +1,7 @@
import { CreateRecordOptions, DnsProviderContext, DnsProviderDefine, IDnsProvider, RemoveRecordOptions } from "./api.js"; import { CreateRecordOptions, DnsProviderContext, DnsProviderDefine, IDnsProvider, RemoveRecordOptions } from "./api.js";
import { dnsProviderRegistry } from "./registry.js"; import { dnsProviderRegistry } from "./registry.js";
import { HttpClient, ILogger } from "@certd/basic"; import { HttpClient, ILogger } from "@certd/basic";
import punycode from "punycode.js";
export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> { export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
ctx!: DnsProviderContext; ctx!: DnsProviderContext;
http!: HttpClient; http!: HttpClient;
@@ -13,6 +13,22 @@ export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
return false; return false;
} }
/**
* 中文转英文
* @param domain
*/
punyCodeEncode(domain: string) {
return punycode.toASCII(domain);
}
/**
* 转中文域名
* @param domain
*/
punyCodeDecode(domain: string) {
return punycode.toUnicode(domain);
}
setCtx(ctx: DnsProviderContext) { setCtx(ctx: DnsProviderContext) {
this.ctx = ctx; this.ctx = ctx;
this.logger = ctx.logger; this.logger = ctx.logger;

View File

@@ -6,7 +6,7 @@ import { Challenge } from "@certd/acme-client/types/rfc8555";
import { IContext } from "@certd/pipeline"; import { IContext } from "@certd/pipeline";
import { ILogger, utils } from "@certd/basic"; import { ILogger, utils } from "@certd/basic";
import { IDnsProvider, IDomainParser } from "../../dns-provider/index.js"; import { IDnsProvider, IDomainParser } from "../../dns-provider/index.js";
import punycode from "node:punycode"; import punycode from "punycode.js";
import { IOssClient } from "@certd/plugin-lib"; import { IOssClient } from "@certd/plugin-lib";
export type CnameVerifyPlan = { export type CnameVerifyPlan = {
type?: string; type?: string;
@@ -233,16 +233,18 @@ export class AcmeService {
let dnsProvider = providers.dnsProvider; let dnsProvider = providers.dnsProvider;
let fullRecord = `_acme-challenge.${fullDomain}`; let fullRecord = `_acme-challenge.${fullDomain}`;
const origDomain = punycode.toUnicode(domain);
const origFullDomain = punycode.toUnicode(fullDomain);
if (providers.domainsVerifyPlan) { if (providers.domainsVerifyPlan) {
//按照计划执行 //按照计划执行
const domainVerifyPlan = providers.domainsVerifyPlan[domain]; const domainVerifyPlan = providers.domainsVerifyPlan[origDomain];
if (domainVerifyPlan) { if (domainVerifyPlan) {
if (domainVerifyPlan.type === "dns") { if (domainVerifyPlan.type === "dns") {
dnsProvider = domainVerifyPlan.dnsProvider; dnsProvider = domainVerifyPlan.dnsProvider;
} else if (domainVerifyPlan.type === "cname") { } else if (domainVerifyPlan.type === "cname") {
const cnameVerifyPlan = domainVerifyPlan.cnameVerifyPlan; const cnameVerifyPlan = domainVerifyPlan.cnameVerifyPlan;
if (cnameVerifyPlan) { if (cnameVerifyPlan) {
const cname = cnameVerifyPlan[fullDomain]; const cname = cnameVerifyPlan[origFullDomain];
if (cname) { if (cname) {
dnsProvider = cname.dnsProvider; dnsProvider = cname.dnsProvider;
domain = await this.options.domainParser.parse(cname.domain); domain = await this.options.domainParser.parse(cname.domain);
@@ -325,8 +327,9 @@ export class AcmeService {
csrInfo: any; csrInfo: any;
isTest?: boolean; isTest?: boolean;
privateKeyType?: string; privateKeyType?: string;
profile?: string;
}): Promise<CertInfo> { }): Promise<CertInfo> {
const { email, isTest, csrInfo, dnsProvider, domainsVerifyPlan } = options; const { email, isTest, csrInfo, dnsProvider, domainsVerifyPlan, profile } = options;
const client: acme.Client = await this.getAcmeClient(email, isTest); const client: acme.Client = await this.getAcmeClient(email, isTest);
let domains = options.domains; let domains = options.domains;
@@ -398,6 +401,7 @@ export class AcmeService {
return await this.challengeRemoveFn(authz, challenge, keyAuthorization, recordReq, recordRes, dnsProvider, httpUploader); return await this.challengeRemoveFn(authz, challenge, keyAuthorization, recordReq, recordRes, dnsProvider, httpUploader);
}, },
signal: this.options.signal, signal: this.options.signal,
profile,
}); });
const crtString = crt.toString(); const crtString = crt.toString();

View File

@@ -8,7 +8,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
@TaskInput({ @TaskInput({
title: "邮箱", title: "邮箱",
component: { component: {
name: "a-input", name: "email-selector",
vModel: "value", vModel: "value",
}, },
rules: [{ type: "email", message: "请输入正确的邮箱" }], rules: [{ type: "email", message: "请输入正确的邮箱" }],

View File

@@ -5,6 +5,7 @@ import path from "path";
import { CertificateInfo, crypto } from "@certd/acme-client"; import { CertificateInfo, crypto } from "@certd/acme-client";
import { ILogger } from "@certd/basic"; import { ILogger } from "@certd/basic";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { uniq } from "lodash-es";
export type CertReaderHandleContext = { export type CertReaderHandleContext = {
reader: CertReader; reader: CertReader;
@@ -88,9 +89,13 @@ export class CertReader {
getAllDomains() { getAllDomains() {
const { detail } = this.getCrtDetail(); const { detail } = this.getCrtDetail();
const domains = [detail.domains.commonName]; const domains = [];
if (detail.domains?.commonName) {
domains.push(detail.domains.commonName);
}
domains.push(...detail.domains.altNames); domains.push(...detail.domains.altNames);
return domains; //去重
return uniq(domains);
} }
getAltNames() { getAltNames() {
@@ -100,12 +105,23 @@ export class CertReader {
static getMainDomain(crt: string) { static getMainDomain(crt: string) {
const { detail } = CertReader.readCertDetail(crt); const { detail } = CertReader.readCertDetail(crt);
return detail.domains.commonName; return CertReader.getMainDomainFromDetail(detail);
} }
getMainDomain() { getMainDomain() {
const { detail } = this.getCrtDetail(); const { detail } = this.getCrtDetail();
return detail.domains.commonName; return CertReader.getMainDomainFromDetail(detail);
}
static getMainDomainFromDetail(detail: CertificateInfo) {
let domain = detail?.domains?.commonName;
if (domain == null) {
domain = detail?.domains?.altNames?.[0];
}
if (domain == null) {
domain = "unknown";
}
return domain;
} }
saveToFile(type: "crt" | "key" | "pfx" | "der" | "oc" | "one" | "ic" | "jks", filepath?: string) { saveToFile(type: "crt" | "key" | "pfx" | "der" | "oc" | "one" | "ic" | "jks", filepath?: string) {
@@ -177,8 +193,7 @@ export class CertReader {
} }
buildCertFileName(suffix: string, applyTime: any, prefix = "cert") { buildCertFileName(suffix: string, applyTime: any, prefix = "cert") {
const detail = this.getCrtDetail(); let domain = this.getMainDomain();
let domain = detail.detail.domains.commonName;
domain = domain.replaceAll(".", "_").replaceAll("*", "_"); domain = domain.replaceAll(".", "_").replaceAll("*", "_");
const timeStr = dayjs(applyTime).format("YYYYMMDDHHmmss"); const timeStr = dayjs(applyTime).format("YYYYMMDDHHmmss");
return `${prefix}_${domain}_${timeStr}.${suffix}`; return `${prefix}_${domain}_${timeStr}.${suffix}`;
@@ -186,7 +201,7 @@ export class CertReader {
buildCertName() { buildCertName() {
let domain = this.getMainDomain(); let domain = this.getMainDomain();
domain = domain.replaceAll("*", "_").replaceAll("*", "_"); domain = domain.replaceAll(".", "_").replaceAll("*", "_");
return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`; return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`;
} }
} }

View File

@@ -248,6 +248,30 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
}) })
privateKeyType!: PrivateKeyType; privateKeyType!: PrivateKeyType;
@TaskInput({
title: "证书配置",
value: "classic",
component: {
name: "a-select",
vModel: "value",
options: [
{ value: "classic", label: "经典classic" },
{ value: "tlsserver", label: "TLS服务器tlsserver" },
{ value: "shortlived", label: "短暂的shortlived" },
],
},
helper: "如无特殊需求,默认即可",
required: false,
mergeScript: `
return {
show: ctx.compute(({form})=>{
return form.sslProvider === 'letsencrypt'
})
}
`,
})
certProfile!: string;
@TaskInput({ @TaskInput({
title: "使用代理", title: "使用代理",
value: false, value: false,
@@ -395,6 +419,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
csrInfo, csrInfo,
isTest: false, isTest: false,
privateKeyType: this.privateKeyType, privateKeyType: this.privateKeyType,
profile: this.certProfile,
}); });
const certInfo = this.formatCerts(cert); const certInfo = this.formatCerts(cert);

View File

@@ -80,17 +80,29 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
legoEabAccessId!: number; legoEabAccessId!: number;
@TaskInput({ @TaskInput({
title: "自定义LEGO参数", title: "自定义LEGO全局参数",
component: { component: {
name: "a-input", name: "a-input",
vModel: "value", vModel: "value",
placeholder: "--dns-timeout 30", placeholder: "--dns-timeout 30",
}, },
helper: "额外的lego命令行参数参考文档https://go-acme.github.io/lego/usage/cli/options/", helper: "额外的lego全局命令行参数参考文档https://go-acme.github.io/lego/usage/cli/options/",
maybeNeed: true, maybeNeed: true,
}) })
customArgs = ""; customArgs = "";
@TaskInput({
title: "自定义LEGO签名参数",
component: {
name: "a-input",
vModel: "value",
placeholder: "--no-bundle",
},
helper: "额外的lego签名命令行参数参考文档https://go-acme.github.io/lego/usage/cli/options/",
maybeNeed: true,
})
customCommandOptions = "";
@TaskInput({ @TaskInput({
title: "加密算法", title: "加密算法",
value: "ec256", value: "ec256",
@@ -205,7 +217,7 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
if (this.acmeServer) { if (this.acmeServer) {
serverArgs = ` --server ${this.acmeServer}`; serverArgs = ` --server ${this.acmeServer}`;
} }
const cmds = [`${legoPath} -a --email "${this.email}" --dns ${this.dnsType} ${keyType} ${domainArgs} ${serverArgs} ${eabArgs} ${savePathArgs} ${this.customArgs || ""} run`]; const cmds = [`${legoPath} -a --email "${this.email}" --dns ${this.dnsType} ${keyType} ${domainArgs} ${serverArgs} ${eabArgs} ${savePathArgs} ${this.customArgs || ""} run ${this.customCommandOptions || ""}`];
await this.ctx.utils.sp.spawn({ await this.ctx.utils.sp.spawn({
cmd: cmds, cmd: cmds,

View File

@@ -3,6 +3,56 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
### Bug Fixes
* 腾讯云授权支持设置是否国际站部署到EO插件支持国际站 ([5cd3968](https://github.com/certd/certd/commit/5cd3968929acef333cf30d3b20cf21cea6c82c5f))
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/plugin-lib
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes
* 修复阿里云新加坡clb无法部署证书的bug ([3e84e11](https://github.com/certd/certd/commit/3e84e116e863b54c6b4d7db160af372dacc5857f))
### Performance Improvements
* 优化阿里云nlb支持部署扩展证书 ([9cbdfda](https://github.com/certd/certd/commit/9cbdfda829b231733d54c66c5024d46e6fc11af3))
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
### Performance Improvements
* aliyun alb支持部署扩展证书 ([2a19b61](https://github.com/certd/certd/commit/2a19b61b7a78620c06396c2cc37cc77d738b6d12))
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/plugin-lib
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
**Note:** Version bump only for package @certd/plugin-lib
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Performance Improvements
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/plugin-lib
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
### Bug Fixes ### Bug Fixes

View File

@@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-lib", "name": "@certd/plugin-lib",
"private": false, "private": false,
"version": "1.34.8", "version": "1.35.5",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@@ -17,11 +17,12 @@
}, },
"dependencies": { "dependencies": {
"@alicloud/openapi-client": "^0.4.14", "@alicloud/openapi-client": "^0.4.14",
"@alicloud/openapi-util": "^0.3.2",
"@alicloud/pop-core": "^1.7.10", "@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.10", "@alicloud/tea-util": "^1.4.10",
"@aws-sdk/client-s3": "^3.787.0", "@aws-sdk/client-s3": "^3.787.0",
"@certd/basic": "^1.34.8", "@certd/basic": "^1.35.5",
"@certd/pipeline": "^1.34.8", "@certd/pipeline": "^1.35.5",
"@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",
@@ -52,5 +53,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "023db4e04ee3142d3857ff98224c16bbcfba8834" "gitHead": "93017c044d4533ce40a2aab525f10b82761d09d0"
} }

View File

@@ -54,7 +54,7 @@ export class AliyunClientV2 {
const $OpenApi = await import("@alicloud/openapi-client"); const $OpenApi = await import("@alicloud/openapi-client");
const $Util = await import("@alicloud/tea-util"); const $Util = await import("@alicloud/tea-util");
const OpenApiUtil = await import("@alicloud/openapi-util");
const params = new $OpenApi.Params({ const params = new $OpenApi.Params({
// 接口名称 // 接口名称
action: req.action, action: req.action,
@@ -74,6 +74,10 @@ export class AliyunClientV2 {
bodyType: "json", bodyType: "json",
}); });
if (req.data?.query) {
//@ts-ignore
req.data.query = OpenApiUtil.default.default.query(req.data.query);
}
const runtime = new $Util.RuntimeOptions({}); const runtime = new $Util.RuntimeOptions({});
const request = new $OpenApi.OpenApiRequest(req.data); const request = new $OpenApi.OpenApiRequest(req.data);
// 复制代码运行请自行打印 API 的返回值 // 复制代码运行请自行打印 API 的返回值

View File

@@ -29,7 +29,7 @@ export type AliyunSslUploadCertReq = {
cert: AliyunCertInfo; cert: AliyunCertInfo;
}; };
export type CasCertInfo = { certId: number; certName: string; certIdentifier: string }; export type CasCertInfo = { certId: number; certName: string; certIdentifier: string; notAfter: number; casRegion: string };
export class AliyunSslClient { export class AliyunSslClient {
opts: AliyunSslClientOpts; opts: AliyunSslClientOpts;
@@ -68,6 +68,8 @@ export class AliyunSslClient {
certId: certId, certId: certId,
certName: res.Name, certName: res.Name,
certIdentifier: res.CertIdentifier, certIdentifier: res.CertIdentifier,
notAfter: res.NotAfter,
casRegion: this.getCasRegionFromEndpoint(this.opts.endpoint),
}; };
} }
@@ -148,4 +150,24 @@ export class AliyunSslClient {
this.checkRet(res); this.checkRet(res);
return res; return res;
} }
async deleteCert(certId: any) {
await this.doRequest("DeleteUserCertificate", { CertId: certId }, { method: "POST" });
}
getCasRegionFromEndpoint(endpoint: string) {
if (!endpoint) {
return "cn-hangzhou";
}
/**
* {value: 'cas.aliyuncs.com', label: '中国大陆'},
* {value: 'cas.ap-southeast-1.aliyuncs.com', label: '新加坡'},
* {value: 'cas.eu-central-1.aliyuncs.com', label: '德国(法兰克福)'},
*/
const region = endpoint.replace(".aliyuncs.com", "").replace("cas.", "");
if (region === "cas") {
return "cn-hangzhou";
}
return region;
}
} }

View File

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

View File

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

View File

@@ -165,10 +165,16 @@ export class AsyncSsh2Client {
}); });
} }
/**
*
* @param script
* @param opts {withStdErr 返回{stdOut,stdErr}}
*/
async exec( async exec(
script: string, script: string,
opts: { opts: {
throwOnStdErr?: boolean; throwOnStdErr?: boolean;
withStdErr?: boolean;
env?: any; env?: any;
} = {} } = {}
): Promise<string> { ): Promise<string> {
@@ -193,6 +199,7 @@ export class AsyncSsh2Client {
return; return;
} }
let data = ""; let data = "";
let stdErr = "";
let hasErrorLog = false; let hasErrorLog = false;
stream stream
.on("close", (code: any, signal: any) => { .on("close", (code: any, signal: any) => {
@@ -205,7 +212,15 @@ export class AsyncSsh2Client {
} }
if (code === 0) { if (code === 0) {
resolve(data); if (opts.withStdErr === true) {
//@ts-ignore
resolve({
stdErr,
stdOut: data,
});
} else {
resolve(data);
}
} else { } else {
reject(new Error(data)); reject(new Error(data));
} }
@@ -221,7 +236,7 @@ export class AsyncSsh2Client {
}) })
.stderr.on("data", (ret: Buffer) => { .stderr.on("data", (ret: Buffer) => {
const err = this.convert(iconv, ret); const err = this.convert(iconv, ret);
data += err; stdErr += err;
hasErrorLog = true; hasErrorLog = true;
this.logger.error(`[${this.connConf.host}][error]: ` + err.trimEnd()); this.logger.error(`[${this.connConf.host}][error]: ` + err.trimEnd());
}); });
@@ -323,9 +338,6 @@ export class AsyncSsh2Client {
export class SshClient { export class SshClient {
logger: ILogger; logger: ILogger;
constructor(logger: ILogger) {
this.logger = logger;
}
/** /**
* *
* @param connectConf * @param connectConf
@@ -382,6 +394,9 @@ export class SshClient {
}, },
}); });
} }
constructor(logger: ILogger) {
this.logger = logger;
}
async scpUpload(options: { conn: any; localPath: string; remotePath: string; opts?: { mode?: string } }) { async scpUpload(options: { conn: any; localPath: string; remotePath: string; opts?: { mode?: string } }) {
const { conn, localPath, remotePath } = options; const { conn, localPath, remotePath } = options;

View File

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

View File

@@ -3,6 +3,78 @@
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.35.5](https://github.com/certd/certd/compare/v1.35.4...v1.35.5) (2025-06-20)
### Bug Fixes
* 修复邮箱包含.号校验失败的bug ([65dcae7](https://github.com/certd/certd/commit/65dcae79f8faa7a6cb425e10a0fdb6758b0719f3))
### Performance Improvements
* 首次打开任务日志查看页面,自动滚动到底部 ([43fee42](https://github.com/certd/certd/commit/43fee42198e8697185b427b1fa3eb79409603393))
* 支持批量修改通知和定时 ([e11b3be](https://github.com/certd/certd/commit/e11b3becfd4abe6547e84d09adc38ebd6e1c4b87))
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/ui-client
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Performance Improvements
* 子域名托管帮助链接优化为打开新窗口 ([7c0cdd1](https://github.com/certd/certd/commit/7c0cdd169e2f943e703e433677f2f437d4aa02ee))
* history增加触发类型显示 ([7f6070c](https://github.com/certd/certd/commit/7f6070c960ed7bf02add5ab36436de6573f2f1fa))
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
### Performance Improvements
* 优化流水线页面,增加下次执行时间、查看证书显示 ([c820315](https://github.com/certd/certd/commit/c8203154094fae3d17198747f49f5f41ddf29a4e))
* 站点证书监控支持定时设置,重试次数设置 ([d3c2f8e](https://github.com/certd/certd/commit/d3c2f8eb436e670772d14a54acd6b541c5aa3978))
# [1.35.0](https://github.com/certd/certd/compare/v1.34.11...v1.35.0) (2025-06-05)
**Note:** Version bump only for package @certd/ui-client
## [1.34.11](https://github.com/certd/certd/compare/v1.34.10...v1.34.11) (2025-06-05)
### Bug Fixes
* 修复中文域名使用cname方式校验无法通过的问题 ([f7d5baa](https://github.com/certd/certd/commit/f7d5baa6d04cb83c572b06e62f885890cfa0143a))
* 修复flexcdn部署证书的顶级CA名称显示 ([6467edb](https://github.com/certd/certd/commit/6467edb84324d7c80a85212675dbacedc459df83))
### Performance Improvements
* 分组选择支持清空选项 ([03e2e99](https://github.com/certd/certd/commit/03e2e9949837b34eb3ea56d14a9e8a5dabc96063))
* 优化cname检查当有冲突的cname记录时给出提示 ([e639a8f](https://github.com/certd/certd/commit/e639a8f9f12640ffcca69f1a6a0324459924afbd))
* 增加下载日志按钮 ([6ff509d](https://github.com/certd/certd/commit/6ff509d263c0182645b4692c10b5fedb192db964))
* 站点监控支持批量导入域名和ip ([2d7729d](https://github.com/certd/certd/commit/2d7729dbe98f29088f5f317db2b52cc1ede223a6))
* 支持设置用户有效期 ([6ac3bc5](https://github.com/certd/certd/commit/6ac3bc564f407dad2cd0b0b0744e887387aa5da3))
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Performance Improvements
* 优化流水线名称过长时的显示 ([6a0cc1b](https://github.com/certd/certd/commit/6a0cc1b1f3ad508f9e4093b3b682b163f12389eb))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Performance Improvements
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
* 支持github 新版本检查并发布通知 ([356703c](https://github.com/certd/certd/commit/356703c83ea18c6efb8931402e181280d7b7e696))
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28) ## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
### Bug Fixes ### Bug Fixes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-client", "name": "@certd/ui-client",
"version": "1.34.8", "version": "1.35.5",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite --open", "dev": "vite --open",
@@ -9,7 +9,7 @@
"debug": "vite --mode debug --open", "debug": "vite --mode debug --open",
"debug:pm": "vite --mode debugpm", "debug:pm": "vite --mode debugpm",
"debug:force": "vite --force --mode debug", "debug:force": "vite --force --mode debug",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=32768 vite build ", "build": "cross-env NODE_OPTIONS=--max-old-space-size=40960 vite build ",
"dev-build": "echo 1", "dev-build": "echo 1",
"test:unit": "vitest", "test:unit": "vitest",
"serve": "vite preview", "serve": "vite preview",
@@ -30,10 +30,10 @@
"@aws-sdk/client-s3": "^3.535.0", "@aws-sdk/client-s3": "^3.535.0",
"@aws-sdk/s3-request-presigner": "^3.535.0", "@aws-sdk/s3-request-presigner": "^3.535.0",
"@ctrl/tinycolor": "^4.1.0", "@ctrl/tinycolor": "^4.1.0",
"@fast-crud/fast-crud": "^1.25.8", "@fast-crud/fast-crud": "^1.25.13",
"@fast-crud/fast-extends": "^1.25.8", "@fast-crud/fast-extends": "^1.25.13",
"@fast-crud/ui-antdv4": "^1.25.8", "@fast-crud/ui-antdv4": "^1.25.13",
"@fast-crud/ui-interface": "^1.25.8", "@fast-crud/ui-interface": "^1.25.13",
"@iconify/tailwind": "^1.2.0", "@iconify/tailwind": "^1.2.0",
"@iconify/vue": "^4.1.1", "@iconify/vue": "^4.1.1",
"@manypkg/get-packages": "^2.2.2", "@manypkg/get-packages": "^2.2.2",
@@ -102,8 +102,8 @@
"zod-defaults": "^0.1.3" "zod-defaults": "^0.1.3"
}, },
"devDependencies": { "devDependencies": {
"@certd/lib-iframe": "^1.34.8", "@certd/lib-iframe": "^1.35.5",
"@certd/pipeline": "^1.34.8", "@certd/pipeline": "^1.35.5",
"@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

@@ -1,17 +1,7 @@
<template> <template>
<div class="cron-editor"> <div class="cron-editor">
<div class="flex-o"> <div class="flex-o">
<cron-light <cron-light :disabled="disabled" :readonly="readonly" :period="period" class="flex-o cron-ant" locale="zh-CN" format="quartz" :model-value="modelValue" @update:model-value="onUpdate" @error="onError" />
:disabled="disabled"
:readonly="readonly"
:period="period"
class="flex-o cron-ant"
locale="zh-CN"
format="quartz"
:model-value="modelValue"
@update:model-value="onUpdate"
@error="onError"
/>
</div> </div>
<div class="mt-5 flex"> <div class="mt-5 flex">
<a-input :disabled="true" :readonly="readonly" :value="modelValue" @change="onChange"></a-input> <a-input :disabled="true" :readonly="readonly" :value="modelValue" @change="onChange"></a-input>
@@ -26,13 +16,15 @@
import parser from "cron-parser"; import parser from "cron-parser";
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { getCronNextTimes } from "/@/components/cron-editor/utils";
defineOptions({ defineOptions({
name: "CronEditor" name: "CronEditor",
}); });
const props = defineProps<{ const props = defineProps<{
modelValue?: string; modelValue?: string;
disabled?: boolean; disabled?: boolean;
readonly?: boolean; readonly?: boolean;
allowEveryMin?: boolean;
}>(); }>();
const period = ref<string>(""); const period = ref<string>("");
@@ -58,9 +50,12 @@ const onUpdate = (value: string) => {
if (arr[0] === "*") { if (arr[0] === "*") {
arr[0] = "0"; arr[0] = "0";
} }
if (arr[1] === "*") { if (!props.allowEveryMin) {
arr[1] = "0"; if (arr[1] === "*") {
arr[1] = "0";
}
} }
value = arr.join(" "); value = arr.join(" ");
emit("update:modelValue", value); emit("update:modelValue", value);
@@ -90,10 +85,10 @@ const nextTime = computed(() => {
if (props.modelValue == null) { if (props.modelValue == null) {
return "请先设置正确的cron表达式"; return "请先设置正确的cron表达式";
} }
try { try {
const interval = parser.parseExpression(props.modelValue); const nextTimes = getCronNextTimes(props.modelValue, 2);
const next = interval.next().getTime(); return nextTimes.join("");
return dayjs(next).format("YYYY-MM-DD HH:mm:ss");
} catch (e) { } catch (e) {
console.log(e); console.log(e);
return "请先设置正确的cron表达式"; return "请先设置正确的cron表达式";

View File

@@ -0,0 +1,15 @@
import parser from "cron-parser";
import dayjs from "dayjs";
export function getCronNextTimes(cron: string, count: number = 1) {
if (cron == null) {
return [];
}
const nextTimes = [];
const interval = parser.parseExpression(cron);
for (let i = 0; i < count; i++) {
const next = interval.next().getTime();
nextTimes.push(dayjs(next).format("YYYY-MM-DD HH:mm:ss"));
}
return nextTimes;
}

View File

@@ -76,7 +76,7 @@ export default {
.text-editable { .text-editable {
flex: 1; flex: 1;
line-height: 34px; line-height: 34px;
overflow: hidden;
span.fs-iconify { span.fs-iconify {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;

View File

@@ -0,0 +1,29 @@
import { request } from "/src/api/service";
export async function EmailList() {
return await request({
url: "/mine/email/list",
method: "post",
data: {},
});
}
export async function EmailDelete(email: string) {
return await request({
url: "/mine/email/delete",
method: "post",
data: {
email: email,
},
});
}
export async function EmailAdd(email: string) {
return await request({
url: "/mine/email/add",
method: "post",
data: {
email: email,
},
});
}

View File

@@ -0,0 +1,91 @@
<template>
<a-select :options="emails">
<template #option="{ value: val }">
<div class="flex flex-row w-full">
<span class="flex-1">{{ val }}</span>
<fs-icon class="ml-5" icon="ion:close" @click="deleteItem(val)"></fs-icon>
</div>
</template>
<template #dropdownRender="{ menuNode: menu }">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0" />
<div class="w-full flex flex-row p-5">
<a-input ref="inputRef" v-model:value="newEmail" class="flex-1" placeholder="添加新邮箱" @keydown.enter="addItem" />
<a-button class="ml-5" type="primary" @click="addItem">
<template #icon>
<plus-outlined />
</template>
添加邮箱
</a-button>
</div>
</template>
</a-select>
</template>
<script lang="ts" setup>
import { defineComponent, onMounted, ref } from "vue";
import * as api from "./api";
import { Modal, notification } from "ant-design-vue";
const props = defineProps<{}>();
const VNodes = defineComponent({
props: {
vnodes: {
type: Object,
required: true,
},
},
render() {
return this.vnodes;
},
});
const newEmail = ref("");
const emails = ref([]);
onMounted(async () => {
const list = await api.EmailList();
emails.value = list.map((item: string) => {
return {
value: item,
};
});
});
async function addItem() {
const email = newEmail.value;
//验证邮箱格式
const regExp =
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/;
if (!regExp.test(email)) {
notification.error({
message: "请填写正确的邮箱地址",
});
return;
}
debugger;
if (emails.value.find(item => item.value === email)) {
notification.warning({
message: "此邮箱已存在",
});
return;
}
await api.EmailAdd(email);
emails.value.unshift({
value: email,
label: email,
});
newEmail.value = "";
}
async function deleteItem(value: string) {
Modal.confirm({
title: "删除邮箱",
content: "确定要删除此邮箱吗?",
onOk: async () => {
await api.EmailDelete(value);
emails.value = emails.value.filter(item => item.value !== value);
},
});
}
</script>

View File

@@ -13,17 +13,22 @@ import ExpiresTimeText from "./expires-time-text.vue";
import FileInput from "./file-input.vue"; import FileInput from "./file-input.vue";
import PemInput from "./pem-input.vue"; import PemInput from "./pem-input.vue";
import { defineAsyncComponent } from "vue"; import { defineAsyncComponent } from "vue";
import NotificationSelector from "../views/certd/notification/notification-selector/index.vue";
import EmailSelector from "./email-selector/index.vue";
import ValidTimeFormat from "./valid-time-format.vue";
export default { export default {
install(app: any) { install(app: any) {
app.component( app.component(
"CodeEditor", "CodeEditor",
defineAsyncComponent(() => import("./code-editor/index.vue")) defineAsyncComponent(() => import("./code-editor/index.vue"))
); );
app.component("EmailSelector", EmailSelector);
app.component("NotificationSelector", NotificationSelector);
app.component("PiContainer", PiContainer); app.component("PiContainer", PiContainer);
app.component("TextEditable", TextEditable); app.component("TextEditable", TextEditable);
app.component("FileInput", FileInput); app.component("FileInput", FileInput);
app.component("PemInput", PemInput); app.component("PemInput", PemInput);
app.component("ValidTimeFormat", ValidTimeFormat);
// app.component("CodeEditor", CodeEditor); // app.component("CodeEditor", CodeEditor);
app.component("CronLight", CronLight); app.component("CronLight", CronLight);

View File

@@ -8,6 +8,7 @@ export type CnameRecord = {
status?: string; status?: string;
hostRecord?: string; hostRecord?: string;
recordValue?: string; recordValue?: string;
error?: string;
}; };
export type DomainGroupItem = { export type DomainGroupItem = {

View File

@@ -13,6 +13,9 @@
</td> </td>
<td class="status center flex-center"> <td class="status center flex-center">
<fs-values-format v-model="cnameRecord.status" :dict="statusDict" /> <fs-values-format v-model="cnameRecord.status" :dict="statusDict" />
<a-tooltip v-if="cnameRecord.error" :title="cnameRecord.error">
<fs-icon class="ml-5 color-red" icon="ion:warning-outline"></fs-icon>
</a-tooltip>
</td> </td>
<td class="center"> <td class="center">
<template v-if="cnameRecord.status !== 'valid'"> <template v-if="cnameRecord.status !== 'valid'">

View File

@@ -21,7 +21,7 @@ import CnameRecordInfo from "/@/components/plugins/cert/domains-verify-plan-edit
import { computed } from "vue"; import { computed } from "vue";
defineOptions({ defineOptions({
name: "CnameVerifyPlan" name: "CnameVerifyPlan",
}); });
const emit = defineEmits(["update:modelValue", "change"]); const emit = defineEmits(["update:modelValue", "change"]);

View File

@@ -55,6 +55,7 @@
</div> </div>
<div v-if="item.type === 'http'" class="plan-http"> <div v-if="item.type === 'http'" class="plan-http">
<http-verify-plan v-model="item.httpVerifyPlan" @change="onPlanChanged" /> <http-verify-plan v-model="item.httpVerifyPlan" @change="onPlanChanged" />
<div class="helper">证书颁发机构将请求 https://yourdomain/.well-known/acme-challenge/xxxxxx 来验证域名所有权。</div>
</div> </div>
</div> </div>
</td> </td>

View File

@@ -0,0 +1,32 @@
<template>
<div class="valid-time-format">
<a-tag v-if="isExpired" color="red">{{ prefix || "" }}已过期</a-tag>
<a-tag v-if="isValid" color="green" :title="date">
<fs-time-humanize v-if="humanize" :model-value="modelValue" :options="{ largest: 1, units: ['y', 'd', 'h'] }" :use-format-greater="30000000000" />
<template v-else> {{ prefix || "" }}{{ date }} </template>
</a-tag>
</div>
</template>
<script setup lang="ts">
import { computed } from "vue";
import dayjs from "dayjs";
const props = defineProps<{
modelValue: number;
humanize?: boolean;
prefix?: string;
}>();
const date = computed(() => {
return dayjs(props.modelValue || 0).format("YYYY-MM-DD");
});
const isValid = computed(() => {
return props.modelValue > 0 && props.modelValue > new Date().getTime();
});
const isExpired = computed(() => {
return props.modelValue > 0 && props.modelValue < new Date().getTime();
});
</script>

View File

@@ -4,7 +4,7 @@ export async function doActive(form: any) {
return await request({ return await request({
url: "/sys/plus/active", url: "/sys/plus/active",
method: "post", method: "post",
data: form data: form,
}); });
} }
@@ -12,6 +12,6 @@ export async function getVipTrial() {
return await request({ return await request({
url: "/sys/plus/getVipTrial", url: "/sys/plus/getVipTrial",
method: "post", method: "post",
data: {} data: {},
}); });
} }

View File

@@ -233,13 +233,13 @@ function openUpgrade() {
desc: "社区免费版", desc: "社区免费版",
type: "free", type: "free",
icon: "lucide:package-open", icon: "lucide:package-open",
privilege: ["证书申请无限制", "域名数量无限制", "证书流水线数量无限制", "常用的主机、云平台、cdn等部署插件", "邮件、webhook通知方式"], privilege: ["证书申请无限制", "域名数量无限制", "证书流水线数量无限制", "常用的主机、云平台、cdn、宝塔、1Panel等部署插件", "邮件、webhook通知方式"],
}, },
plus: { plus: {
title: "专业版", title: "专业版",
desc: "开源需要您的赞助支持", desc: "开源需要您的赞助支持",
type: "plus", type: "plus",
privilege: ["可加VIP群您的需求将优先实现", "站点证书监控无限制", "更多通知方式", "插件全开放,更多强大的部署插件宝塔、群晖、1Panel等"], privilege: ["可加VIP群您的需求将优先实现", "站点证书监控无限制", "更多通知方式", "插件全开放,群辉等更多插件"],
trial: { trial: {
title: "点击获取7天试用", title: "点击获取7天试用",
click: () => { click: () => {

View File

@@ -111,14 +111,19 @@ function install(app: App, options: any = {}) {
columnSizeSaver.clear(); columnSizeSaver.clear();
}, },
}, },
buttons: {
export: {
show: false,
},
},
}, },
rowHandle: { rowHandle: {
fixed: "right", fixed: "right",
buttons: { buttons: {
view: { type: "link", text: null, icon: "ion:eye-outline" }, view: { type: "link", text: null, icon: "ion:eye-outline", tooltip: { title: "查看" } },
copy: { show: true, type: "link", text: null, icon: "ion:copy-outline" }, copy: { show: true, type: "link", text: null, icon: "ion:copy-outline", tooltip: { title: "复制" } },
edit: { type: "link", text: null, icon: "ion:create-outline" }, edit: { type: "link", text: null, icon: "ion:create-outline", tooltip: { title: "编辑" } },
remove: { type: "link", style: { color: "red" }, text: null, icon: "ion:trash-outline" }, remove: { type: "link", style: { color: "red" }, text: null, icon: "ion:trash-outline", tooltip: { title: "删除" } },
}, },
dropdown: { dropdown: {
more: { more: {
@@ -329,6 +334,22 @@ function install(app: App, options: any = {}) {
return columnProps; return columnProps;
}, },
}); });
registerMergeColumnPlugin({
name: "reset-values-format-colors",
order: 10,
handle: (columnProps: ColumnCompositionProps) => {
// 你可以在此处做你自己的处理
// 比如你可以定义一个readonly的公共属性处理该字段只读不能编辑
if (columnProps.column?.component?.name === "fs-values-format") {
// 合并column配置
if (!columnProps.column.component.autoColors) {
columnProps.column.component.autoColors = ["green", "cyan", "blue", "purple", "geekblue"];
}
}
return columnProps;
},
});
} }
export default { export default {

View File

@@ -122,7 +122,7 @@ export const certdResources = [
}, },
{ {
title: "OpenKey", title: "开放接口密钥",
name: "OpenKey", name: "OpenKey",
path: "/certd/open/openkey", path: "/certd/open/openkey",
component: "/certd/open/openkey/index.vue", component: "/certd/open/openkey/index.vue",

View File

@@ -30,6 +30,7 @@ export type PlusInfo = {
}; };
export type SysPublicSetting = { export type SysPublicSetting = {
registerEnabled?: boolean; registerEnabled?: boolean;
userValidTimeEnabled?: boolean;
usernameRegisterEnabled?: boolean; usernameRegisterEnabled?: boolean;
mobileRegisterEnabled?: boolean; mobileRegisterEnabled?: boolean;
emailRegisterEnabled?: boolean; emailRegisterEnabled?: boolean;
@@ -116,6 +117,6 @@ export async function getProductInfo(): Promise<any> {
return await request({ return await request({
url: "/basic/settings/productInfo", url: "/basic/settings/productInfo",
method: "get", method: "get",
silent: true, showErrorNotify: false,
}); });
} }

View File

@@ -27,6 +27,8 @@ export interface UserInfoRes {
avatar?: string; avatar?: string;
roleIds: number[]; roleIds: number[];
isWeak?: boolean; isWeak?: boolean;
validTime?: number;
status?: number;
} }
export interface LoginRes { export interface LoginRes {

View File

@@ -49,38 +49,38 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
pageRequest, pageRequest,
addRequest, addRequest,
editRequest, editRequest,
delRequest delRequest,
}, },
toolbar: { toolbar: {
show: false show: false,
}, },
search: { search: {
show: false show: false,
}, },
form: { form: {
wrapper: { wrapper: {
width: "1050px" width: "1050px",
} },
}, },
rowHandle: { rowHandle: {
width: 200 width: 200,
}, },
table: { table: {
scroll: { scroll: {
x: 800 x: 800,
}, },
rowSelection: { rowSelection: {
type: "radio", type: "radio",
selectedRowKeys: selectedRowKey, selectedRowKeys: selectedRowKey,
onChange: onSelectChange onChange: onSelectChange,
}, },
customRow: (record: any) => { customRow: (record: any) => {
return { return {
onClick: () => { onClick: () => {
onSelectChange([record.id]); onSelectChange([record.id]);
} // 点击行 }, // 点击行
}; };
} },
}, },
columns: { columns: {
id: { id: {
@@ -88,25 +88,25 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
key: "id", key: "id",
type: "number", type: "number",
column: { column: {
width: 50 width: 50,
}, },
form: { form: {
show: false show: false,
} },
}, },
name: { name: {
title: "名称", title: "名称",
search: { search: {
show: true show: true,
}, },
type: ["text"], type: ["text"],
form: { form: {
rules: [{ required: true, message: "请填写名称" }], rules: [{ required: true, message: "请填写名称" }],
helper: "随便填,当多个相同类型的授权时,便于区分" helper: "随便填,当多个相同类型的授权时,便于区分",
}, },
column: { column: {
width: 200 width: 200,
} },
}, },
from: { from: {
title: "级别", title: "级别",
@@ -114,29 +114,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
dict: dict({ dict: dict({
data: [ data: [
{ label: "系统", value: "sys" }, { label: "系统", value: "sys" },
{ label: "用户", value: "user" } { label: "用户", value: "user" },
] ],
}), }),
search: { search: {
show: false show: false,
}, },
form: { form: {
show: false show: false,
}, },
column: { column: {
width: 100, width: 100,
align: "center", align: "center",
component: { component: {
color: "auto" color: "auto",
}, },
order: 10 order: 10,
}, },
valueBuilder: ({ row, key, value }) => { valueBuilder: ({ row, key, value }) => {
row[key] = row.userId > 0 ? "user" : "sys"; row[key] = row.userId > 0 ? "user" : "sys";
} },
}, },
...commonColumnsDefine ...commonColumnsDefine,
} },
} },
}; };
} }

View File

@@ -2,7 +2,7 @@ import * as api from "./api";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { Ref, ref } from "vue"; import { Ref, ref } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud"; import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { useUserStore } from "/@/store/user"; import { useUserStore } from "/@/store/user";
import { useSettingStore } from "/@/store/settings"; import { useSettingStore } from "/@/store/settings";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
@@ -31,7 +31,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const settingStore = useSettingStore(); const settingStore = useSettingStore();
const selectedRowKeys: Ref<any[]> = ref([]); const selectedRowKeys: Ref<any[]> = ref([]);
context.selectedRowKeys = selectedRowKeys; context.selectedRowKeys = selectedRowKeys;
const dictRef = dict({
data: [
{ label: "待设置CNAME", value: "cname", color: "warning" },
{ label: "验证中", value: "validating", color: "blue" },
{ label: "验证成功", value: "valid", color: "green" },
{ label: "验证失败", value: "failed", color: "red" },
{ label: "验证超时", value: "timeout", color: "red" },
],
});
return { return {
crudOptions: { crudOptions: {
settings: { settings: {
@@ -174,21 +182,25 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
status: { status: {
title: "状态", title: "状态",
type: "dict-select", type: "dict-select",
dict: dict({ dict: dictRef,
data: [
{ label: "待设置CNAME", value: "cname", color: "warning" },
{ label: "验证中", value: "validating", color: "blue" },
{ label: "验证成功", value: "valid", color: "green" },
{ label: "验证失败", value: "failed", color: "red" },
{ label: "验证超时", value: "timeout", color: "red" },
],
}),
addForm: { addForm: {
show: false, show: false,
}, },
column: { column: {
width: 120, width: 120,
align: "center", align: "center",
cellRender({ value, row }) {
return (
<div class={"flex flex-center"}>
<fs-values-format modelValue={value} dict={dictRef}></fs-values-format>
{row.error && (
<a-tooltip title={row.error}>
<fs-icon class={"ml-5 color-red"} icon="ion:warning-outline"></fs-icon>
</a-tooltip>
)}
</div>
);
},
}, },
}, },
triggerValidate: { triggerValidate: {

View File

@@ -6,7 +6,7 @@ export async function GetList(query: any) {
return await request({ return await request({
url: apiPrefix + "/page", url: apiPrefix + "/page",
method: "post", method: "post",
data: query data: query,
}); });
} }
@@ -14,7 +14,7 @@ export async function AddObj(obj: any) {
return await request({ return await request({
url: apiPrefix + "/add", url: apiPrefix + "/add",
method: "post", method: "post",
data: obj data: obj,
}); });
} }
@@ -22,7 +22,7 @@ export async function UpdateObj(obj: any) {
return await request({ return await request({
url: apiPrefix + "/update", url: apiPrefix + "/update",
method: "post", method: "post",
data: obj data: obj,
}); });
} }
@@ -30,7 +30,7 @@ export async function DelObj(id: any) {
return await request({ return await request({
url: apiPrefix + "/delete", url: apiPrefix + "/delete",
method: "post", method: "post",
params: { id } params: { id },
}); });
} }
@@ -38,7 +38,7 @@ export async function GetObj(id: any) {
return await request({ return await request({
url: apiPrefix + "/info", url: apiPrefix + "/info",
method: "post", method: "post",
params: { id } params: { id },
}); });
} }
@@ -46,7 +46,7 @@ export async function GetDetail(id: any) {
return await request({ return await request({
url: apiPrefix + "/detail", url: apiPrefix + "/detail",
method: "post", method: "post",
params: { id } params: { id },
}); });
} }
@@ -54,6 +54,6 @@ export async function DeleteBatch(ids: any[]) {
return await request({ return await request({
url: apiPrefix + "/deleteByIds", url: apiPrefix + "/deleteByIds",
method: "post", method: "post",
data: { ids } data: { ids },
}); });
} }

View File

@@ -2,9 +2,10 @@ import * as api from "./api";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { computed, Ref, ref } from "vue"; import { computed, Ref, ref } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud"; import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
import { useUserStore } from "/@/store/user"; import { useUserStore } from "/@/store/user";
import { useSettingStore } from "/@/store/settings"; import { useSettingStore } from "/@/store/settings";
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet { export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const router = useRouter(); const router = useRouter();
@@ -44,46 +45,46 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
props: { props: {
multiple: true, multiple: true,
crossPage: true, crossPage: true,
selectedRowKeys selectedRowKeys,
} },
} },
} },
}, },
request: { request: {
pageRequest, pageRequest,
addRequest, addRequest,
editRequest, editRequest,
delRequest delRequest,
}, },
actionbar: { actionbar: {
buttons: { buttons: {
add: { add: {
show: false show: false,
} },
} },
}, },
search: { search: {
formItem: { formItem: {
labelCol: { labelCol: {
style: { style: {
// width: "100px" // width: "100px"
} },
}, },
wrapperCol: { wrapperCol: {
style: { style: {
width: "50%" width: "50%",
} },
} },
} },
}, },
rowHandle: { rowHandle: {
minWidth: 200, minWidth: 200,
fixed: "right", fixed: "right",
buttons: { buttons: {
edit: { edit: {
show: false show: false,
} },
} },
}, },
columns: { columns: {
id: { id: {
@@ -91,11 +92,11 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
key: "id", key: "id",
type: "number", type: "number",
column: { column: {
width: 100 width: 100,
}, },
form: { form: {
show: false show: false,
} },
}, },
userId: { userId: {
title: "用户Id", title: "用户Id",
@@ -103,69 +104,113 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
search: { search: {
show: computed(() => { show: computed(() => {
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline; return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
}) }),
}, },
form: { form: {
show: false show: false,
}, },
column: { column: {
show: computed(() => { show: computed(() => {
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline; return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
}), }),
width: 100 width: 100,
} },
}, },
pipelineId: { pipelineId: {
title: "流水线Id", title: "流水线Id",
type: "number", type: "number",
search: { search: {
show: true show: true,
}, },
form: { form: {
show: false show: false,
}, },
column: { column: {
width: 100 width: 100,
} },
}, },
pipelineTitle: { pipelineTitle: {
title: "流水线名称", title: "流水线名称",
type: "text", type: "text",
search: { search: {
show: true show: true,
}, },
column: { column: {
width: 300, width: 300,
tooltip: true,
ellipsis: true,
cellRender: ({ row, value }) => { cellRender: ({ row, value }) => {
return ( return <router-link to={{ path: "/certd/pipeline/detail", query: { id: row.pipelineId, editMode: false, historyId: row.id } }}>{value}</router-link>;
<router-link to={{ path: "/certd/pipeline/detail", query: { id: row.pipelineId, editMode: false, historyId: row.id } }}>{value}</router-link> },
); },
} },
} triggerType: {
title: "触发类型",
type: "dict-select",
search: {
show: true,
},
dict: dict({
data: [
{ value: "user", label: "手动执行" },
{ value: "timer", label: "定时执行" },
],
}),
form: {
show: false,
value: "custom",
},
column: {
sorter: true,
width: 90,
align: "center",
show: true,
component: {
color: "auto",
},
},
},
status: {
title: "状态",
type: "dict-select",
search: {
show: true,
},
dict: dict({
data: statusUtil.getOptions(),
}),
form: {
show: false,
},
column: {
sorter: true,
width: 120,
align: "center",
},
}, },
createTime: { createTime: {
title: "创建时间", title: "创建时间",
type: "datetime", type: "datetime",
form: { form: {
show: false show: false,
}, },
column: { column: {
sorter: true, sorter: true,
width: 160, width: 160,
align: "center" align: "center",
} },
}, },
updateTime: { updateTime: {
title: "更新时间", title: "更新时间",
type: "datetime", type: "datetime",
form: { form: {
show: false show: false,
}, },
column: { column: {
show: true show: true,
} },
} },
} },
} },
}; };
} }

View File

@@ -56,6 +56,14 @@ export const siteInfoApi = {
}); });
}, },
async Import(form: any) {
return await request({
url: apiPrefix + "/import",
method: "post",
data: form,
});
},
async DisabledChange(id: number, disabled: boolean) { async DisabledChange(id: number, disabled: boolean) {
return await request({ return await request({
url: apiPrefix + "/disabledChange", url: apiPrefix + "/disabledChange",

View File

@@ -8,6 +8,7 @@ import { useSettingStore } from "/@/store/settings";
import { mySuiteApi } from "/@/views/certd/suite/mine/api"; import { mySuiteApi } from "/@/views/certd/suite/mine/api";
import { mitter } from "/@/utils/util.mitt"; import { mitter } from "/@/utils/util.mitt";
import { useSiteIpMonitor } from "./ip/use"; import { useSiteIpMonitor } from "./ip/use";
import { useSiteImport } from "/@/views/certd/monitor/site/use";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet { export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n(); const { t } = useI18n();
@@ -44,6 +45,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}); });
const { openSiteIpMonitorDialog } = useSiteIpMonitor(); const { openSiteIpMonitorDialog } = useSiteIpMonitor();
const { openSiteImportDialog } = useSiteImport();
return { return {
crudOptions: { crudOptions: {
request: { request: {
@@ -97,6 +99,19 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await crudExpose.openAdd({}); await crudExpose.openAdd({});
}, },
}, },
//导入按钮
import: {
show: true,
text: "批量导入",
type: "primary",
async click() {
openSiteImportDialog({
afterSubmit() {
crudExpose.doRefresh();
},
});
},
},
}, },
}, },
rowHandle: { rowHandle: {
@@ -115,7 +130,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await api.DoCheck(row.id); await api.DoCheck(row.id);
await crudExpose.doRefresh(); await crudExpose.doRefresh();
notification.success({ notification.success({
message: "检查完成", message: "检查任务已提交,请稍后刷新查看结果",
}); });
}, },
}, },
@@ -235,7 +250,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}, },
}; };
return ( return (
<a-popover placement="left" v-slots={slots} overlayStyle={{ maxWidth: "30%" }}> <a-popover placement={"left"} v-slots={slots} overlayStyle={{ maxWidth: "30%" }}>
{row.certDomains} {row.certDomains}
</a-popover> </a-popover>
); );

View File

@@ -68,4 +68,11 @@ export const siteIpApi = {
}, },
}); });
}, },
async Import(form: any) {
return await request({
url: apiPrefix + "/import",
method: "post",
data: form,
});
},
}; };

View File

@@ -4,13 +4,11 @@ import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, Edi
import { siteIpApi } from "./api"; import { siteIpApi } from "./api";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { Modal, notification } from "ant-design-vue"; import { Modal, notification } from "ant-design-vue";
import { useSettingStore } from "/@/store/settings"; import { useSiteIpMonitor } from "/@/views/certd/monitor/site/ip/use";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet { export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
const api = siteIpApi; const api = siteIpApi;
const { crudBinding } = crudExpose;
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => { const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
if (!query.query) { if (!query.query) {
query.query = {}; query.query = {};
@@ -36,8 +34,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
return res; return res;
}; };
const settingsStore = useSettingStore();
const checkStatusDict = dict({ const checkStatusDict = dict({
data: [ data: [
{ label: "成功", value: "ok", color: "green" }, { label: "成功", value: "ok", color: "green" },
@@ -45,6 +41,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
{ label: "异常", value: "error", color: "red" }, { label: "异常", value: "error", color: "red" },
], ],
}); });
const { openSiteIpImportDialog } = useSiteIpMonitor();
return { return {
crudOptions: { crudOptions: {
request: { request: {
@@ -75,6 +72,19 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await crudExpose.openAdd({}); await crudExpose.openAdd({});
}, },
}, },
import: {
show: true,
text: "批量导入",
type: "primary",
async click() {
openSiteIpImportDialog({
siteId: context.props.siteId,
afterSubmit() {
crudExpose.doRefresh();
},
});
},
},
load: { load: {
text: "同步IP", text: "同步IP",
type: "primary", type: "primary",
@@ -127,7 +137,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await api.DoCheck(row.id); await api.DoCheck(row.id);
await crudExpose.doRefresh(); await crudExpose.doRefresh();
notification.success({ notification.success({
message: "检查任务已提交", message: "检查任务已提交,请稍后刷新查看结果",
}); });
}, },
}, },
@@ -155,6 +165,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
show: true, show: true,
}, },
type: "text", type: "text",
helper: "也支持填写CNAME域名",
form: { form: {
rules: [{ required: true, message: "请输入IP" }], rules: [{ required: true, message: "请输入IP" }],
}, },
@@ -294,6 +305,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
data: [ data: [
{ label: "同步", value: "sync", color: "green" }, { label: "同步", value: "sync", color: "green" },
{ label: "手动", value: "manual", color: "blue" }, { label: "手动", value: "manual", color: "blue" },
{ label: "导入", value: "import", color: "blue" },
], ],
}), }),
form: { form: {

View File

@@ -1,11 +1,10 @@
import { useFormWrapper } from "@fast-crud/fast-crud"; import { useFormWrapper } from "@fast-crud/fast-crud";
import { useRouter } from "vue-router";
import SiteIpCertMonitor from "./index.vue"; import SiteIpCertMonitor from "./index.vue";
import { siteIpApi } from "/@/views/certd/monitor/site/ip/api";
export function useSiteIpMonitor() { export function useSiteIpMonitor() {
const { openDialog } = useFormWrapper(); const { openDialog, openCrudFormDialog } = useFormWrapper();
const router = useRouter();
async function openSiteIpMonitorDialog(opts: { siteId: number }) { async function openSiteIpMonitorDialog(opts: { siteId: number }) {
await openDialog({ await openDialog({
@@ -34,7 +33,42 @@ export function useSiteIpMonitor() {
}); });
} }
async function openSiteIpImportDialog(opts: { afterSubmit: any; siteId: any }) {
const { afterSubmit } = opts;
await openCrudFormDialog<any>({
crudOptions: {
columns: {
text: {
type: "textarea",
title: "IP列表",
form: {
helper: "IP或者CNAME域名一行一个",
rules: [{ required: true, message: "请输入要导入的IP或域名" }],
component: {
placeholder: "192.168.1.2\ncname.foo.com",
rows: 8,
},
col: {
span: 24,
},
},
},
},
form: {
async doSubmit({ form }) {
return siteIpApi.Import({
...form,
siteId: opts.siteId,
});
},
afterSubmit,
},
},
});
}
return { return {
openSiteIpMonitorDialog, openSiteIpMonitorDialog,
openSiteIpImportDialog,
}; };
} }

View File

@@ -3,6 +3,8 @@ import { request } from "/src/api/service";
const apiPrefix = "/monitor/site/setting"; const apiPrefix = "/monitor/site/setting";
export type UserSiteMonitorSetting = { export type UserSiteMonitorSetting = {
notificationId?: number; notificationId?: number;
retryTimes?: number;
cron?: string;
}; };
export async function SiteMonitorSettingsGet() { export async function SiteMonitorSettingsGet() {

View File

@@ -11,6 +11,19 @@
</div> </div>
<div class="helper">设置通知渠道</div> <div class="helper">设置通知渠道</div>
</a-form-item> </a-form-item>
<a-form-item label="重试次数" :name="['retryTimes']">
<div class="flex">
<a-input-number v-model:value="formState.retryTimes" />
</div>
<div class="helper">监控请求重试次数</div>
</a-form-item>
<a-form-item label="监控定时设置" :name="['cron']">
<div class="flex flex-baseline">
<cron-editor v-model="formState.cron" :disabled="!settingsStore.isPlus" :allow-every-min="userStore.isAdmin" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">定时触发监控</div>
</a-form-item>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }"> <a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
<loading-button type="primary" html-type="button" :click="doSave">保存</loading-button> <loading-button type="primary" html-type="button" :click="doSave">保存</loading-button>
</a-form-item> </a-form-item>
@@ -27,8 +40,10 @@ import { notification } from "ant-design-vue";
import { merge } from "lodash-es"; import { merge } from "lodash-es";
import { useSettingStore } from "/src/store/settings"; import { useSettingStore } from "/src/store/settings";
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue"; import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
import { useUserStore } from "/@/store/user";
const settingsStore = useSettingStore(); const settingsStore = useSettingStore();
const userStore = useUserStore();
defineOptions({ defineOptions({
name: "UserSecurity", name: "UserSecurity",
}); });
@@ -56,7 +71,7 @@ const doSave = async (form: any) => {
<style lang="less"> <style lang="less">
.page-user-settings { .page-user-settings {
.user-settings-form { .user-settings-form {
width: 600px; width: 700px;
margin: 20px; margin: 20px;
} }
} }

View File

@@ -0,0 +1,41 @@
import { useFormWrapper } from "@fast-crud/fast-crud";
import { siteInfoApi } from "./api";
export function useSiteImport() {
const { openCrudFormDialog } = useFormWrapper();
async function openSiteImportDialog(opts: { afterSubmit: any }) {
const { afterSubmit } = opts;
await openCrudFormDialog<any>({
crudOptions: {
columns: {
text: {
type: "textarea",
title: "域名列表",
form: {
helper: "格式【域名:端口:名称】,一行一个,其中端口、名称可以省略\n比如\nwww.baidu.com:443:百度\nwww.taobao.com::淘宝\nwww.google.com",
rules: [{ required: true, message: "请输入要导入的域名" }],
component: {
placeholder: "www.baidu.com:443:百度\nwww.taobao.com::淘宝\nwww.google.com\n",
rows: 8,
},
col: {
span: 24,
},
},
},
},
form: {
async doSubmit({ form }) {
return siteInfoApi.Import(form);
},
afterSubmit,
},
},
});
}
return {
openSiteImportDialog,
};
}

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="notification-selector"> <div class="notification-selector">
<div class="flex-o w-100"> <div class="flex-o w-100">
<fs-dict-select class="flex-1" :value="modelValue" :dict="optionsDictRef" :disabled="disabled" :render-label="renderLabel" :slots="selectSlots" :allow-clear="true" @update:value="onChange" /> <fs-dict-select class="flex-1" :value="modelValue" :dict="optionsDictRef" :disabled="disabled" :render-label="renderLabel" :slots="selectSlots" :allow-clear="true" v-bind="select" @update:value="onChange" />
<fs-table-select <fs-table-select
ref="tableSelectRef" ref="tableSelectRef"
class="flex-0" class="flex-0"
@@ -21,6 +21,7 @@
:dialog="{ width: 960 }" :dialog="{ width: 960 }"
:destroy-on-close="false" :destroy-on-close="false"
height="400px" height="400px"
v-bind="tableSelect"
@update:model-value="onChange" @update:model-value="onChange"
@dialog-closed="doRefresh" @dialog-closed="doRefresh"
> >
@@ -39,17 +40,20 @@ import { message } from "ant-design-vue";
import { dict } from "@fast-crud/fast-crud"; import { dict } from "@fast-crud/fast-crud";
import createCrudOptions from "../crud"; import createCrudOptions from "../crud";
import { notificationProvide } from "/@/views/certd/notification/common"; import { notificationProvide } from "/@/views/certd/notification/common";
import { useUserStore } from "/@/store/user";
defineOptions({ defineOptions({
name: "NotificationSelector", name: "NotificationSelector",
}); });
const props = defineProps<{ const props = defineProps<{
modelValue?: number | string; modelValue?: number | string | number[] | string[];
type?: string; type?: string;
placeholder?: string; placeholder?: string;
size?: string; size?: string;
disabled?: boolean; disabled?: boolean;
select?: any;
tableSelect?: any;
}>(); }>();
const onChange = async (value: number) => { const onChange = async (value: number) => {
@@ -118,9 +122,12 @@ function clear() {
emitValue(null); emitValue(null);
} }
const userStore = useUserStore();
async function emitValue(value: any) { async function emitValue(value: any) {
target.value = optionsDictRef.dataMap[value]; // target.value = optionsDictRef.dataMap[value];
if (value !== 0 && pipeline?.value && target && pipeline.value.userId !== target.value.userId) { const userId = userStore.userInfo.id;
if (pipeline?.value && pipeline.value.userId !== userId) {
message.error("对不起,您不能修改他人流水线的通知"); message.error("对不起,您不能修改他人流水线的通知");
return; return;
} }
@@ -134,6 +141,7 @@ watch(
}, },
async value => { async value => {
await optionsDictRef.loadDict(); await optionsDictRef.loadDict();
//@ts-ignore
target.value = optionsDictRef.dataMap[value]; target.value = optionsDictRef.dataMap[value];
emit("selectedChange", target.value); emit("selectedChange", target.value);
}, },

View File

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

View File

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

View File

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

View File

@@ -5,17 +5,15 @@ import { useRouter } from "vue-router";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, useUi } from "@fast-crud/fast-crud"; import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, useUi } from "@fast-crud/fast-crud";
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status"; import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
import { Modal, notification } from "ant-design-vue"; import { Modal, notification } from "ant-design-vue";
import { env } from "/@/utils/util.env";
import { useUserStore } from "/@/store/user"; import { useUserStore } from "/@/store/user";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useSettingStore } from "/@/store/settings"; import { useSettingStore } from "/@/store/settings";
import { cloneDeep } from "lodash-es"; import { cloneDeep } from "lodash-es";
import { useModal } from "/@/use/use-modal";
import CertView from "./cert-view.vue";
import { eachStages } from "./utils"; import { eachStages } from "./utils";
import { setRunnableIds, useCertPipelineCreator } from "/@/views/certd/pipeline/certd-form/use"; import { setRunnableIds, useCertPipelineCreator } from "/@/views/certd/pipeline/certd-form/use";
import { useCertUpload } from "/@/views/certd/pipeline/cert-upload/use"; import { useCertUpload } from "/@/views/certd/pipeline/cert-upload/use";
import GroupSelector from "/@/views/certd/pipeline/group/group-selector.vue"; import GroupSelector from "/@/views/certd/pipeline/group/group-selector.vue";
import { useCertViewer } from "/@/views/certd/pipeline/use";
export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys } }: CreateCrudOptionsProps): CreateCrudOptionsRet { export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const router = useRouter(); const router = useRouter();
@@ -61,59 +59,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
return res; return res;
}; };
const model = useModal(); const { viewCert, downloadCert } = useCertViewer();
const viewCert = async (row: any) => {
const cert = await api.GetCert(row.id);
if (!cert) {
notification.error({ message: "请先运行一次流水线" });
return;
}
model.success({
title: "查看证书",
maskClosable: true,
okText: "关闭",
width: 800,
content: () => {
return <CertView cert={cert}></CertView>;
},
});
};
const downloadCert = async (row: any) => {
const files = await api.GetFiles(row.id);
model.success({
title: "点击链接下载",
maskClosable: true,
okText: "关闭",
content: () => {
const children = [];
for (const file of files) {
const downloadUrl = `${env.API}/pi/history/download?pipelineId=${row.id}&fileId=${file.id}`;
children.push(
<div>
<div class={"flex-o m-5"}>
<fs-icon icon={"ant-design:cloud-download-outlined"} class={"mr-5 fs-16"}></fs-icon>
<a href={downloadUrl} target={"_blank"}>
{file.filename}
</a>
</div>
</div>
);
}
if (children.length === 0) {
return <div></div>;
}
return (
<div class={"mt-3"}>
<div> {children}</div>
</div>
);
},
});
};
const userStore = useUserStore(); const userStore = useUserStore();
const settingStore = useSettingStore(); const settingStore = useSettingStore();
@@ -208,6 +154,10 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
}, },
table: { table: {
scroll: { x: 1500 }, scroll: { x: 1500 },
remove: {
confirmTitle: "确定要删除吗?",
confirmMessage: "将删除该流水线相关的所有数据,包括执行历史、证书文件、证书仓库记录等",
},
}, },
tabs: { tabs: {
name: "groupId", name: "groupId",
@@ -223,6 +173,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
play: { play: {
order: -999, order: -999,
title: "运行流水线", title: "运行流水线",
tooltip: { title: "运行流水线" },
type: "link", type: "link",
icon: "ant-design:play-circle-outlined", icon: "ant-design:play-circle-outlined",
click({ row }) { click({ row }) {
@@ -276,19 +227,21 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
viewCert: { viewCert: {
order: 3, order: 3,
title: "查看证书", title: "查看证书",
tooltip: { title: "查看证书" },
type: "link", type: "link",
icon: "ph:certificate", icon: "ph:certificate",
async click({ row }) { async click({ row }) {
await viewCert(row); await viewCert(row.id);
}, },
}, },
download: { download: {
order: 4, order: 4,
type: "link", type: "link",
title: "下载证书", title: "下载证书",
tooltip: { title: "下载证书" },
icon: "ant-design:download-outlined", icon: "ant-design:download-outlined",
async click({ row }) { async click({ row }) {
await downloadCert(row); await downloadCert(row.id);
}, },
}, },
remove: { remove: {
@@ -345,14 +298,12 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
}, },
column: { column: {
width: 350, width: 350,
// tooltip: true,
ellipsis: true,
sorter: true, sorter: true,
component: { showTitle: true,
on: { cellRender: ({ row, value }) => {
// 注意必须要on前缀 return <router-link to={{ path: "/certd/pipeline/detail", query: { id: row.id, editMode: false } }}>{value}</router-link>;
onClick({ row }) {
router.push({ path: "/certd/pipeline/detail", query: { id: row.id, editMode: "false" } });
},
},
}, },
}, },
}, },

View File

@@ -34,6 +34,8 @@ const pipelineOptions: PipelineOptions = {
stages: [], stages: [],
triggers: [], triggers: [],
...JSON.parse(detail.pipeline.content || "{}"), ...JSON.parse(detail.pipeline.content || "{}"),
type: detail.pipeline.type,
from: detail.pipeline.from,
}, },
} as PipelineDetail; } as PipelineDetail;
}, },

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="pi-group-selector flex full-w"> <div class="pi-group-selector flex full-w">
<div class="flex-1"> <div class="flex-1">
<fs-dict-select :value="modelValue" :dict="groupDictRef" @update:value="doUpdate"></fs-dict-select> <fs-dict-select :value="modelValue" :dict="groupDictRef" :allow-clear="true" @update:value="doUpdate"></fs-dict-select>
</div> </div>
<fs-table-select <fs-table-select

View File

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

View File

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

View File

@@ -23,14 +23,11 @@
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<template #footer> <template #footer>
<a-tooltip title="AI分析异常"> <fs-button v-if="settingsStore.sysPublic.aiChatEnabled !== false" key="aiChat" :tooltip="{ title: 'AI分析异常' }" type="primary" icon="ion:color-wand-outline" @click="taskModal.onAiChat">AI分析</fs-button>
<fs-button v-if="settingsStore.sysPublic.aiChatEnabled !== false" key="aiChat" type="primary" icon="ion:color-wand-outline" @click="taskModal.onAiChat">AI分析</fs-button> <fs-button key="rerun" type="primary" :tooltip="{ title: '强制重新执行此步骤' }" text="重新运行" icon="icon-park-outline:replay-music" @click="triggerRun(activeKey)"></fs-button>
</a-tooltip> <fs-button key="downloadLogs" type="primary" :tooltip="{ title: '当前任务日志下载' }" icon="ion:arrow-down-circle-outline" @click="taskModal.onDownloadLogs">下载日志</fs-button>
<a-tooltip title="强制重新执行此步骤"> <fs-button key="cancel" :tooltip="{ title: '关闭窗口' }" icon="ion:close-circle-outline" @click="taskModal.onOk">关闭</fs-button>
<fs-button key="rerun" type="primary" text="重新运行" icon="icon-park-outline:replay-music" @click="triggerRun(activeKey)"></fs-button> <!-- <fs-button key="submit" :tooltip="{ title: '关闭窗口' }" icon="ion:checkmark-circle-outline" type="primary" @click="taskModal.onOk">确定</fs-button>-->
</a-tooltip>
<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> </template>
</a-modal> </a-modal>
</template> </template>
@@ -41,6 +38,7 @@ import { RunHistory } from "../../type";
import PiStatusShow from "/@/views/certd/pipeline/pipeline/component/status-show.vue"; import PiStatusShow from "/@/views/certd/pipeline/pipeline/component/status-show.vue";
import { usePreferences } from "/@/vben/preferences"; import { usePreferences } from "/@/vben/preferences";
import { useSettingStore } from "/@/store/settings/index"; import { useSettingStore } from "/@/store/settings/index";
import { notification } from "ant-design-vue";
export default { export default {
name: "PiTaskView", name: "PiTaskView",
components: { PiStatusShow }, components: { PiStatusShow },
@@ -56,6 +54,22 @@ export default {
onAiChat() { onAiChat() {
onAiChat(); onAiChat();
}, },
onDownloadLogs() {
const logs = currentHistory.value?.logs[activeKey.value];
if (!logs || logs.length === 0) {
notification.warning({
message: "没有日志",
});
return;
}
const logText = logs.join("");
const blob = new Blob([logText], { type: "text/plain;charset=utf-8" });
const a = document.createElement("a");
a.href = URL.createObjectURL(blob);
a.download = "certd-task-log.txt";
a.click();
URL.revokeObjectURL(a.href);
},
cancelText: "关闭", cancelText: "关闭",
}); });
const { isMobile } = usePreferences(); const { isMobile } = usePreferences();
@@ -105,6 +119,31 @@ export default {
logs: [], logs: [],
}); });
} }
async function scrollBottom(node: any, force = false) {
let el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
if (!el) {
return;
}
//判断当前是否在底部
let isBottom = true;
if (el) {
isBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 5;
}
if (force) {
isBottom = true;
}
await nextTick();
el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
//如果在底部则滚动到底部
if (isBottom && el) {
el?.scrollTo({
top: el.scrollHeight,
behavior: "smooth",
});
}
}
for (let node of nodes) { for (let node of nodes) {
if (currentHistory?.value?.logs != null) { if (currentHistory?.value?.logs != null) {
node.logs = computed(() => { node.logs = computed(() => {
@@ -132,30 +171,12 @@ export default {
return node.logs.value.length; return node.logs.value.length;
}, },
async () => { async () => {
let el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`); await scrollBottom(node);
if (!el) {
return;
}
//判断当前是否在底部
let isBottom = true;
if (el) {
isBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 5;
console.log("isBottom", isBottom, el.scrollHeight, el.scrollTop, el.clientHeight);
}
await nextTick();
el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
//如果在底部则滚动到底部
if (isBottom && el) {
el?.scrollTo({
top: el.scrollHeight,
behavior: "smooth",
});
}
},
{
immediate: true,
} }
); );
nextTick(() => {
scrollBottom(node, true);
});
} }
} }
@@ -164,8 +185,6 @@ export default {
} }
detail.value = { nodes }; detail.value = { nodes };
console.log("nodes", nodes);
}; };
const taskViewClose = () => { const taskViewClose = () => {

View File

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

Some files were not shown because too many files have changed in this diff Show More