mirror of
https://github.com/certd/certd.git
synced 2026-04-03 22:20:51 +08:00
Compare commits
96 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93017c044d | ||
|
|
c223ddbb9a | ||
|
|
f00aeacb8b | ||
|
|
5b49071d6b | ||
|
|
17053a882b | ||
|
|
5e723d31a4 | ||
|
|
3283bd8b75 | ||
|
|
770d3c0015 | ||
|
|
d15dfafd5d | ||
|
|
545c13d55c | ||
|
|
e2099ac9ca | ||
|
|
c937583a50 | ||
|
|
43c7a19849 | ||
|
|
83543487e7 | ||
|
|
434b259525 | ||
|
|
add8efaba8 | ||
|
|
12ed79ca60 | ||
|
|
1e863382d3 | ||
|
|
bad3504d4a | ||
|
|
d94f207162 | ||
|
|
2c4b7781a4 | ||
|
|
4574c6ff07 | ||
|
|
7b5043e87b | ||
|
|
a06f3ac5da | ||
|
|
721346a40a | ||
|
|
f252871fb8 | ||
|
|
107196122c | ||
|
|
563c02d8da | ||
|
|
765934970a | ||
|
|
9cbdfda829 | ||
|
|
c1fbc8cd68 | ||
|
|
a92107cc47 | ||
|
|
3e84e116e8 | ||
|
|
7c0cdd169e | ||
|
|
424fd96615 | ||
|
|
ebfcea88da | ||
|
|
3c7eb2f5e2 | ||
|
|
936167972f | ||
|
|
7f6070c960 | ||
|
|
0aea9c129c | ||
|
|
d20fb7daa8 | ||
|
|
a619f8a2fe | ||
|
|
0acb858d7b | ||
|
|
e459be76fe | ||
|
|
c4c59ccc75 | ||
|
|
c820315409 | ||
|
|
2a19b61b7a | ||
|
|
e1cf64ae16 | ||
|
|
d3c2f8eb43 | ||
|
|
a00453c83a | ||
|
|
2eb0e54909 | ||
|
|
ac87bc57e9 | ||
|
|
2b8ea857f0 | ||
|
|
11c52114b2 | ||
|
|
f55f9b4dd3 | ||
|
|
cdd369ea98 | ||
|
|
f2aab9f476 | ||
|
|
2619dc3556 | ||
|
|
1bbed351ba | ||
|
|
4cfb2644c6 | ||
|
|
5b85c7ad39 | ||
|
|
ab3a3156f2 | ||
|
|
28a582025e | ||
|
|
8451a83a3a | ||
|
|
92c8dcc666 | ||
|
|
da68b02e1e | ||
|
|
2d7729dbe9 | ||
|
|
6467edb843 | ||
|
|
1f01b3a9ff | ||
|
|
8aa1f8926d | ||
|
|
ace363fa35 | ||
|
|
919f70a5fd | ||
|
|
9d6ad771a3 | ||
|
|
bafccb20c6 | ||
|
|
cef30c2af0 | ||
|
|
ca58056a75 | ||
|
|
03e2e99498 | ||
|
|
fba7afc4e9 | ||
|
|
d7dda336ec | ||
|
|
55d4395160 | ||
|
|
f7d5baa6d0 | ||
|
|
6ff509d263 | ||
|
|
57778981a7 | ||
|
|
6ac3bc564f | ||
|
|
82d08e2153 | ||
|
|
6212cd77e8 | ||
|
|
170034f943 | ||
|
|
e639a8f9f1 | ||
|
|
9d10c45dac | ||
|
|
b84159f2f1 | ||
|
|
49f26b4049 | ||
|
|
0e7e44cee2 | ||
|
|
36e769502c | ||
|
|
6702ca10a1 | ||
|
|
4b44bd5e61 | ||
|
|
8a55beda92 |
77
CHANGELOG.md
77
CHANGELOG.md
@@ -3,6 +3,83 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
|
||||
|
||||
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
|
||||
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
|
||||
* 支持雨云dns解析 ([8354348](https://github.com/certd/certd/commit/83543487e7418683bd79cfe3b9e0d792bdb977f7))
|
||||
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
|
||||
* github 版本检查支持执行脚本 ([bad3504](https://github.com/certd/certd/commit/bad3504d4a15e6989b967b66aa9da8c6981f25bf))
|
||||
|
||||
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复阿里云新加坡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
|
||||
|
||||
14
README.md
14
README.md
@@ -1,9 +1,9 @@
|
||||
# Certd
|
||||
|
||||
Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系统。
|
||||
后缀d取自linux守护进程的命名风格,意为证书守护进程。
|
||||
Certd® 是一个免费的全自动证书管理系统,让你的网站证书永不过期。
|
||||
首创流水线申请部署证书模式,已被多个项目“借鉴”,被抄也是一种成功。
|
||||
|
||||
关键字:证书自动申请、证书自动更新、证书自动续期、证书自动续签、证书管理工具
|
||||
>后缀d取自linux守护进程的命名风格,意为证书守护进程。
|
||||
|
||||
> 关于证书续期:
|
||||
>* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。
|
||||
@@ -13,6 +13,7 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
|
||||
|
||||
> 流水线数量现已调整为无限制,欢迎大家使用
|
||||
|
||||
|
||||
## 一、特性
|
||||
本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。
|
||||
|
||||
@@ -32,9 +33,6 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 二、在线体验
|
||||
|
||||
官方Demo地址,自助注册后体验
|
||||
@@ -168,7 +166,11 @@ https://afdian.com/a/greper
|
||||
1. 可以调整开源协议以使其更严格或更宽松。
|
||||
2. 可以用于商业用途。
|
||||
|
||||
感谢以下贡献者做出的贡献。
|
||||
|
||||
<a href="https://github.com/certd/certd/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=certd/certd" />
|
||||
</a>
|
||||
|
||||
## 九、 开源许可
|
||||
* 本项目遵循 GNU Affero General Public License(AGPL)开源协议。
|
||||
|
||||
@@ -1 +1 @@
|
||||
00:57
|
||||
00:39
|
||||
|
||||
@@ -3,6 +3,90 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [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
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.34.10"
|
||||
"version": "1.35.4"
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"afterpublishOnly": "npm run copylogs && time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push",
|
||||
"transform-sql": "cd ./packages/ui/certd-server/db/ && node --experimental-json-modules transform.js",
|
||||
"commitAll": "git add . && git commit -m \"build: publish\" && git push && npm run commitPro",
|
||||
"commitPro": "cd ./packages/core/ && git add . && git commit -m \"build: publish\" && git push",
|
||||
"commitPro": "cd ./packages/pro/ && git add . && git commit -m \"build: publish\" && git push",
|
||||
"copylogs": "copyfiles \"CHANGELOG.md\" ./docs/guide/changelogs/",
|
||||
"prepublishOnly1": "npm run check && lerna run build ",
|
||||
"prepublishOnly2": "npm run check && npm run before-build && lerna run build ",
|
||||
|
||||
@@ -3,6 +3,38 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/basic": "^1.35.4",
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"asn1js": "^3.0.5",
|
||||
"axios": "^1.7.2",
|
||||
@@ -27,7 +27,7 @@
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
"lodash-es": "^4.17.21",
|
||||
"node-forge": "^1.3.1",
|
||||
"punycode": "^2.3.1"
|
||||
"punycode.js": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.10",
|
||||
@@ -69,5 +69,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -75,6 +75,9 @@ export default async (client, userOpts) => {
|
||||
|
||||
log("[auto] Placing new certificate order with ACME provider");
|
||||
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 authorizations = await client.getAuthorizations(order);
|
||||
|
||||
@@ -213,12 +216,16 @@ export default async (client, userOpts) => {
|
||||
return promise;
|
||||
}
|
||||
|
||||
async function runPromisePa(tasks, waitTime = 5000) {
|
||||
async function runPromisePa(tasks, waitTime = 8000) {
|
||||
const results = [];
|
||||
let j = 0
|
||||
// eslint-disable-next-line no-await-in-loop,no-restricted-syntax
|
||||
for (const task of tasks) {
|
||||
j++
|
||||
log(`开始第${j}个任务`);
|
||||
results.push(task());
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
log(`wait ${waitTime}s`)
|
||||
await wait(waitTime);
|
||||
}
|
||||
return Promise.all(results);
|
||||
@@ -242,6 +249,7 @@ export default async (client, userOpts) => {
|
||||
log(`跳过本地验证(skipChallengeVerification=true),等待 60s`);
|
||||
await wait(60 * 1000);
|
||||
} else {
|
||||
log("开始本地校验")
|
||||
await runPromisePa(localVerifyTasks, 1000);
|
||||
log(`本地校验完成,等待${waitDnsDiffuseTime}s`)
|
||||
await wait(waitDnsDiffuseTime * 1000)
|
||||
|
||||
@@ -90,10 +90,12 @@ const defaultOpts = {
|
||||
*/
|
||||
|
||||
class AcmeClient {
|
||||
sslProvider
|
||||
constructor(opts) {
|
||||
if (!Buffer.isBuffer(opts.accountKey)) {
|
||||
opts.accountKey = Buffer.from(opts.accountKey);
|
||||
}
|
||||
this.sslProvider = opts.sslProvider;
|
||||
|
||||
this.opts = { ...defaultOpts, ...opts };
|
||||
this.backoffOpts = {
|
||||
|
||||
2
packages/core/acme-client/types/index.d.ts
vendored
2
packages/core/acme-client/types/index.d.ts
vendored
@@ -66,6 +66,7 @@ export interface ClientAutoOptions {
|
||||
challengePriority?: string[];
|
||||
preferredChain?: string;
|
||||
signal?: AbortSignal;
|
||||
profile?:string;
|
||||
}
|
||||
|
||||
export class Client {
|
||||
@@ -203,6 +204,7 @@ export const agents: any;
|
||||
export function setLogger(fn: (message: any, ...args: any[]) => void): void;
|
||||
|
||||
export function walkTxtRecord(record: any): Promise<string[]>;
|
||||
export function getAuthoritativeDnsResolver(record:string): Promise<any>;
|
||||
|
||||
export const CancelError: typeof CancelError;
|
||||
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
**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
|
||||
|
||||
@@ -1 +1 @@
|
||||
23:54
|
||||
12:19
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -45,5 +45,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,34 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
|
||||
|
||||
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
|
||||
|
||||
## [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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,8 +17,8 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/plus-core": "^1.34.10",
|
||||
"@certd/basic": "^1.35.4",
|
||||
"@certd/plus-core": "^1.35.4",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
@@ -44,5 +44,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ export type AccessContext = {
|
||||
http: HttpClient;
|
||||
logger: ILogger;
|
||||
utils: typeof utils;
|
||||
accessService: IAccessService;
|
||||
};
|
||||
|
||||
export abstract class BaseAccess implements IAccess {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// src/decorator/memoryCache.decorator.ts
|
||||
import { AccessContext, AccessDefine, AccessInputDefine } from "./api.js";
|
||||
import { AccessContext, AccessDefine, AccessInputDefine, IAccessService } from "./api.js";
|
||||
import { Decorator } from "../decorator/index.js";
|
||||
import * as _ from "lodash-es";
|
||||
import { accessRegistry } from "./registry.js";
|
||||
@@ -41,7 +41,7 @@ export function AccessInput(input?: AccessInputDefine): PropertyDecorator {
|
||||
};
|
||||
}
|
||||
|
||||
export async function newAccess(type: string, input: any, ctx?: AccessContext) {
|
||||
export async function newAccess(type: string, input: any, accessService: IAccessService, ctx?: AccessContext) {
|
||||
const register = accessRegistry.get(type);
|
||||
if (register == null) {
|
||||
throw new Error(`access ${type} not found`);
|
||||
@@ -58,6 +58,7 @@ export async function newAccess(type: string, input: any, ctx?: AccessContext) {
|
||||
http,
|
||||
logger,
|
||||
utils,
|
||||
accessService,
|
||||
};
|
||||
}
|
||||
access.setCtx(ctx);
|
||||
|
||||
@@ -121,9 +121,13 @@ export abstract class BaseNotification implements INotification {
|
||||
async onTestRequest() {
|
||||
return await this.doSend({
|
||||
userId: 0,
|
||||
title: "【Certd】测试通知【*.foo.com】,标题长度测试、测试、测试",
|
||||
content: `测试通知,*.foo.com
|
||||
title: "【标题】测试通知【*.foo.com】,标题长度测试、测试、测试",
|
||||
content: `测试通知
|
||||
域名测试: *.foo.com
|
||||
换行测试
|
||||
(括号测试)
|
||||
<尖括号测试>
|
||||
[中括号测试]
|
||||
`,
|
||||
pipeline: {
|
||||
id: 1,
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
@@ -24,5 +24,5 @@
|
||||
"prettier": "^2.8.8",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -31,5 +31,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
**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,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
@@ -61,5 +61,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/basic": "^1.35.4",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,5 +32,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,34 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
|
||||
|
||||
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
|
||||
|
||||
**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,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -27,10 +27,10 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.34.10",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/pipeline": "^1.34.10",
|
||||
"@certd/plus-core": "^1.34.10",
|
||||
"@certd/acme-client": "^1.35.4",
|
||||
"@certd/basic": "^1.35.4",
|
||||
"@certd/pipeline": "^1.35.4",
|
||||
"@certd/plus-core": "^1.35.4",
|
||||
"@midwayjs/cache": "~3.14.0",
|
||||
"@midwayjs/core": "~3.20.3",
|
||||
"@midwayjs/i18n": "~3.20.3",
|
||||
@@ -61,5 +61,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ export class SysPublicSettings extends BaseSettings {
|
||||
static __access__ = 'public';
|
||||
|
||||
registerEnabled = false;
|
||||
userValidTimeEnabled?:boolean = false;
|
||||
passwordLoginEnabled = true;
|
||||
usernameRegisterEnabled = true;
|
||||
mobileRegisterEnabled = false;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import { InjectEntityModel } from '@midwayjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { BaseService, PageReq, PermissionException, ValidateException } from '../../../index.js';
|
||||
import { AccessEntity } from '../entity/access.js';
|
||||
import { AccessDefine, accessRegistry, newAccess } from '@certd/pipeline';
|
||||
import { EncryptService } from './encrypt-service.js';
|
||||
import {Inject, Provide, Scope, ScopeEnum} from '@midwayjs/core';
|
||||
import {InjectEntityModel} from '@midwayjs/typeorm';
|
||||
import {Repository} from 'typeorm';
|
||||
import {AccessGetter, BaseService, PageReq, PermissionException, ValidateException} from '../../../index.js';
|
||||
import {AccessEntity} from '../entity/access.js';
|
||||
import {AccessDefine, accessRegistry, newAccess} from '@certd/pipeline';
|
||||
import {EncryptService} from './encrypt-service.js';
|
||||
|
||||
/**
|
||||
* 授权
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Request, {allowDowngrade: true})
|
||||
export class AccessService extends BaseService<AccessEntity> {
|
||||
@InjectEntityModel(AccessEntity)
|
||||
repository: Repository<AccessEntity>;
|
||||
@@ -95,6 +95,7 @@ export class AccessService extends BaseService<AccessEntity> {
|
||||
param.encryptSetting = JSON.stringify(encryptSetting);
|
||||
param.setting = JSON.stringify(json);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param param 数据
|
||||
@@ -140,7 +141,8 @@ export class AccessService extends BaseService<AccessEntity> {
|
||||
id: entity.id,
|
||||
...setting,
|
||||
};
|
||||
return await newAccess(entity.type, input);
|
||||
const accessGetter = new AccessGetter(userId, this.getById.bind(this));
|
||||
return await newAccess(entity.type, input,accessGetter);
|
||||
}
|
||||
|
||||
async getById(id: any, userId: number): Promise<any> {
|
||||
|
||||
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
**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,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -46,5 +46,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,40 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -16,16 +16,16 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.34.10",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/pipeline": "^1.34.10",
|
||||
"@certd/plugin-lib": "^1.34.10",
|
||||
"@certd/acme-client": "^1.35.4",
|
||||
"@certd/basic": "^1.35.4",
|
||||
"@certd/pipeline": "^1.35.4",
|
||||
"@certd/plugin-lib": "^1.35.4",
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"dayjs": "^1.11.7",
|
||||
"jszip": "^3.10.1",
|
||||
"lodash-es": "^4.17.21",
|
||||
"psl": "^1.9.0",
|
||||
"punycode": "^2.3.1",
|
||||
"punycode.js": "^2.3.1",
|
||||
"rimraf": "^5.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -43,5 +43,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -29,9 +29,25 @@ export type DnsProviderContext = {
|
||||
|
||||
export interface IDnsProvider<T = any> {
|
||||
onInstance(): Promise<void>;
|
||||
|
||||
/**
|
||||
* 中文转英文
|
||||
* @param domain
|
||||
*/
|
||||
punyCodeEncode(domain: string): string;
|
||||
|
||||
/**
|
||||
* 转中文域名
|
||||
* @param domain
|
||||
*/
|
||||
punyCodeDecode(domain: string): string;
|
||||
|
||||
createRecord(options: CreateRecordOptions): Promise<T>;
|
||||
|
||||
removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
|
||||
|
||||
setCtx(ctx: DnsProviderContext): void;
|
||||
|
||||
//中文域名是否需要punycode转码,如果返回True,则使用punycode来添加解析记录,否则使用中文域名添加解析记录
|
||||
usePunyCode(): boolean;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CreateRecordOptions, DnsProviderContext, DnsProviderDefine, IDnsProvider, RemoveRecordOptions } from "./api.js";
|
||||
import { dnsProviderRegistry } from "./registry.js";
|
||||
import { HttpClient, ILogger } from "@certd/basic";
|
||||
|
||||
import punycode from "punycode.js";
|
||||
export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
|
||||
ctx!: DnsProviderContext;
|
||||
http!: HttpClient;
|
||||
@@ -13,6 +13,22 @@ export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 中文转英文
|
||||
* @param domain
|
||||
*/
|
||||
punyCodeEncode(domain: string) {
|
||||
return punycode.toASCII(domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转中文域名
|
||||
* @param domain
|
||||
*/
|
||||
punyCodeDecode(domain: string) {
|
||||
return punycode.toUnicode(domain);
|
||||
}
|
||||
|
||||
setCtx(ctx: DnsProviderContext) {
|
||||
this.ctx = ctx;
|
||||
this.logger = ctx.logger;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Challenge } from "@certd/acme-client/types/rfc8555";
|
||||
import { IContext } from "@certd/pipeline";
|
||||
import { ILogger, utils } from "@certd/basic";
|
||||
import { IDnsProvider, IDomainParser } from "../../dns-provider/index.js";
|
||||
import punycode from "node:punycode";
|
||||
import punycode from "punycode.js";
|
||||
import { IOssClient } from "@certd/plugin-lib";
|
||||
export type CnameVerifyPlan = {
|
||||
type?: string;
|
||||
@@ -233,16 +233,18 @@ export class AcmeService {
|
||||
let dnsProvider = providers.dnsProvider;
|
||||
let fullRecord = `_acme-challenge.${fullDomain}`;
|
||||
|
||||
const origDomain = punycode.toUnicode(domain);
|
||||
const origFullDomain = punycode.toUnicode(fullDomain);
|
||||
if (providers.domainsVerifyPlan) {
|
||||
//按照计划执行
|
||||
const domainVerifyPlan = providers.domainsVerifyPlan[domain];
|
||||
const domainVerifyPlan = providers.domainsVerifyPlan[origDomain];
|
||||
if (domainVerifyPlan) {
|
||||
if (domainVerifyPlan.type === "dns") {
|
||||
dnsProvider = domainVerifyPlan.dnsProvider;
|
||||
} else if (domainVerifyPlan.type === "cname") {
|
||||
const cnameVerifyPlan = domainVerifyPlan.cnameVerifyPlan;
|
||||
if (cnameVerifyPlan) {
|
||||
const cname = cnameVerifyPlan[fullDomain];
|
||||
const cname = cnameVerifyPlan[origFullDomain];
|
||||
if (cname) {
|
||||
dnsProvider = cname.dnsProvider;
|
||||
domain = await this.options.domainParser.parse(cname.domain);
|
||||
@@ -325,8 +327,9 @@ export class AcmeService {
|
||||
csrInfo: any;
|
||||
isTest?: boolean;
|
||||
privateKeyType?: string;
|
||||
profile?: string;
|
||||
}): 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);
|
||||
|
||||
let domains = options.domains;
|
||||
@@ -398,6 +401,7 @@ export class AcmeService {
|
||||
return await this.challengeRemoveFn(authz, challenge, keyAuthorization, recordReq, recordRes, dnsProvider, httpUploader);
|
||||
},
|
||||
signal: this.options.signal,
|
||||
profile,
|
||||
});
|
||||
|
||||
const crtString = crt.toString();
|
||||
|
||||
@@ -5,6 +5,7 @@ import path from "path";
|
||||
import { CertificateInfo, crypto } from "@certd/acme-client";
|
||||
import { ILogger } from "@certd/basic";
|
||||
import dayjs from "dayjs";
|
||||
import { uniq } from "lodash-es";
|
||||
|
||||
export type CertReaderHandleContext = {
|
||||
reader: CertReader;
|
||||
@@ -88,9 +89,13 @@ export class CertReader {
|
||||
|
||||
getAllDomains() {
|
||||
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);
|
||||
return domains;
|
||||
//去重
|
||||
return uniq(domains);
|
||||
}
|
||||
|
||||
getAltNames() {
|
||||
@@ -100,12 +105,23 @@ export class CertReader {
|
||||
|
||||
static getMainDomain(crt: string) {
|
||||
const { detail } = CertReader.readCertDetail(crt);
|
||||
return detail.domains.commonName;
|
||||
return CertReader.getMainDomainFromDetail(detail);
|
||||
}
|
||||
|
||||
getMainDomain() {
|
||||
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) {
|
||||
@@ -177,8 +193,7 @@ export class CertReader {
|
||||
}
|
||||
|
||||
buildCertFileName(suffix: string, applyTime: any, prefix = "cert") {
|
||||
const detail = this.getCrtDetail();
|
||||
let domain = detail.detail.domains.commonName;
|
||||
let domain = this.getMainDomain();
|
||||
domain = domain.replaceAll(".", "_").replaceAll("*", "_");
|
||||
const timeStr = dayjs(applyTime).format("YYYYMMDDHHmmss");
|
||||
return `${prefix}_${domain}_${timeStr}.${suffix}`;
|
||||
@@ -186,7 +201,7 @@ export class CertReader {
|
||||
|
||||
buildCertName() {
|
||||
let domain = this.getMainDomain();
|
||||
domain = domain.replaceAll("*", "_").replaceAll("*", "_");
|
||||
domain = domain.replaceAll(".", "_").replaceAll("*", "_");
|
||||
return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,6 +248,30 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
})
|
||||
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({
|
||||
title: "使用代理",
|
||||
value: false,
|
||||
@@ -395,6 +419,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
csrInfo,
|
||||
isTest: false,
|
||||
privateKeyType: this.privateKeyType,
|
||||
profile: this.certProfile,
|
||||
});
|
||||
|
||||
const certInfo = this.formatCerts(cert);
|
||||
|
||||
@@ -80,17 +80,29 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
|
||||
legoEabAccessId!: number;
|
||||
|
||||
@TaskInput({
|
||||
title: "自定义LEGO参数",
|
||||
title: "自定义LEGO全局参数",
|
||||
component: {
|
||||
name: "a-input",
|
||||
vModel: "value",
|
||||
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,
|
||||
})
|
||||
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({
|
||||
title: "加密算法",
|
||||
value: "ec256",
|
||||
@@ -205,7 +217,7 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
|
||||
if (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({
|
||||
cmd: cmds,
|
||||
|
||||
@@ -3,6 +3,40 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
|
||||
|
||||
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
|
||||
|
||||
**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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -17,11 +17,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@alicloud/openapi-client": "^0.4.14",
|
||||
"@alicloud/openapi-util": "^0.3.2",
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@alicloud/tea-util": "^1.4.10",
|
||||
"@aws-sdk/client-s3": "^3.787.0",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/pipeline": "^1.34.10",
|
||||
"@certd/basic": "^1.35.4",
|
||||
"@certd/pipeline": "^1.35.4",
|
||||
"@kubernetes/client-node": "0.21.0",
|
||||
"ali-oss": "^6.22.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
@@ -52,5 +53,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
"gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export class AliyunClientV2 {
|
||||
|
||||
const $OpenApi = await import("@alicloud/openapi-client");
|
||||
const $Util = await import("@alicloud/tea-util");
|
||||
|
||||
const OpenApiUtil = await import("@alicloud/openapi-util");
|
||||
const params = new $OpenApi.Params({
|
||||
// 接口名称
|
||||
action: req.action,
|
||||
@@ -74,6 +74,10 @@ export class AliyunClientV2 {
|
||||
bodyType: "json",
|
||||
});
|
||||
|
||||
if (req.data?.query) {
|
||||
//@ts-ignore
|
||||
req.data.query = OpenApiUtil.default.default.query(req.data.query);
|
||||
}
|
||||
const runtime = new $Util.RuntimeOptions({});
|
||||
const request = new $OpenApi.OpenApiRequest(req.data);
|
||||
// 复制代码运行请自行打印 API 的返回值
|
||||
|
||||
@@ -29,7 +29,7 @@ export type AliyunSslUploadCertReq = {
|
||||
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 {
|
||||
opts: AliyunSslClientOpts;
|
||||
@@ -68,6 +68,8 @@ export class AliyunSslClient {
|
||||
certId: certId,
|
||||
certName: res.Name,
|
||||
certIdentifier: res.CertIdentifier,
|
||||
notAfter: res.NotAfter,
|
||||
casRegion: this.getCasRegionFromEndpoint(this.opts.endpoint),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -148,4 +150,24 @@ export class AliyunSslClient {
|
||||
this.checkRet(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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,9 @@ export default class S3OssClientImpl extends BaseOssClient<S3Access> {
|
||||
Prefix: dirKey, // The name of the object. For example, 'sample_upload.txt'.
|
||||
};
|
||||
const res = await this.client.send(new ListObjectsCommand({ ...params }));
|
||||
if (!res.Contents) {
|
||||
return [];
|
||||
}
|
||||
return res.Contents.map(item => {
|
||||
return {
|
||||
path: item.Key,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
|
||||
import { ossClientFactory } from "../oss/index.js";
|
||||
import S3OssClientImpl from "../oss/impls/s3.js";
|
||||
|
||||
/**
|
||||
* 这个注解将注册一个授权配置
|
||||
@@ -82,6 +84,32 @@ export class S3Access extends BaseAccess {
|
||||
required: true,
|
||||
})
|
||||
bucket!: string;
|
||||
|
||||
@AccessInput({
|
||||
title: "测试",
|
||||
component: {
|
||||
name: "api-test",
|
||||
action: "TestRequest",
|
||||
},
|
||||
helper: "点击测试接口是否正常",
|
||||
})
|
||||
testRequest = true;
|
||||
|
||||
async onTestRequest() {
|
||||
const client: S3OssClientImpl = await ossClientFactory.createOssClientByType("s3", {
|
||||
access: this,
|
||||
rootDir: "",
|
||||
ctx: {
|
||||
accessService: this.ctx.accessService,
|
||||
logger: this.ctx.logger,
|
||||
utils: this.ctx.utils,
|
||||
},
|
||||
});
|
||||
|
||||
await client.listDir("/");
|
||||
|
||||
return "ok";
|
||||
}
|
||||
}
|
||||
|
||||
new S3Access();
|
||||
|
||||
@@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
**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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -9,7 +9,7 @@
|
||||
"debug": "vite --mode debug --open",
|
||||
"debug:pm": "vite --mode debugpm",
|
||||
"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",
|
||||
"test:unit": "vitest",
|
||||
"serve": "vite preview",
|
||||
@@ -30,10 +30,10 @@
|
||||
"@aws-sdk/client-s3": "^3.535.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.535.0",
|
||||
"@ctrl/tinycolor": "^4.1.0",
|
||||
"@fast-crud/fast-crud": "^1.25.8",
|
||||
"@fast-crud/fast-extends": "^1.25.8",
|
||||
"@fast-crud/ui-antdv4": "^1.25.8",
|
||||
"@fast-crud/ui-interface": "^1.25.8",
|
||||
"@fast-crud/fast-crud": "^1.25.13",
|
||||
"@fast-crud/fast-extends": "^1.25.13",
|
||||
"@fast-crud/ui-antdv4": "^1.25.13",
|
||||
"@fast-crud/ui-interface": "^1.25.13",
|
||||
"@iconify/tailwind": "^1.2.0",
|
||||
"@iconify/vue": "^4.1.1",
|
||||
"@manypkg/get-packages": "^2.2.2",
|
||||
@@ -102,8 +102,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.34.10",
|
||||
"@certd/pipeline": "^1.34.10",
|
||||
"@certd/lib-iframe": "^1.35.4",
|
||||
"@certd/pipeline": "^1.35.4",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -1,17 +1,7 @@
|
||||
<template>
|
||||
<div class="cron-editor">
|
||||
<div class="flex-o">
|
||||
<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"
|
||||
/>
|
||||
<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" />
|
||||
</div>
|
||||
<div class="mt-5 flex">
|
||||
<a-input :disabled="true" :readonly="readonly" :value="modelValue" @change="onChange"></a-input>
|
||||
@@ -26,13 +16,15 @@
|
||||
import parser from "cron-parser";
|
||||
import { computed, ref } from "vue";
|
||||
import dayjs from "dayjs";
|
||||
import { getCronNextTimes } from "/@/components/cron-editor/utils";
|
||||
defineOptions({
|
||||
name: "CronEditor"
|
||||
name: "CronEditor",
|
||||
});
|
||||
const props = defineProps<{
|
||||
modelValue?: string;
|
||||
disabled?: boolean;
|
||||
readonly?: boolean;
|
||||
allowEveryMin?: boolean;
|
||||
}>();
|
||||
|
||||
const period = ref<string>("");
|
||||
@@ -58,9 +50,12 @@ const onUpdate = (value: string) => {
|
||||
if (arr[0] === "*") {
|
||||
arr[0] = "0";
|
||||
}
|
||||
if (arr[1] === "*") {
|
||||
arr[1] = "0";
|
||||
if (!props.allowEveryMin) {
|
||||
if (arr[1] === "*") {
|
||||
arr[1] = "0";
|
||||
}
|
||||
}
|
||||
|
||||
value = arr.join(" ");
|
||||
|
||||
emit("update:modelValue", value);
|
||||
@@ -90,10 +85,10 @@ const nextTime = computed(() => {
|
||||
if (props.modelValue == null) {
|
||||
return "请先设置正确的cron表达式";
|
||||
}
|
||||
|
||||
try {
|
||||
const interval = parser.parseExpression(props.modelValue);
|
||||
const next = interval.next().getTime();
|
||||
return dayjs(next).format("YYYY-MM-DD HH:mm:ss");
|
||||
const nextTimes = getCronNextTimes(props.modelValue, 2);
|
||||
return nextTimes.join(",");
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return "请先设置正确的cron表达式";
|
||||
|
||||
15
packages/ui/certd-client/src/components/cron-editor/utils.ts
Normal file
15
packages/ui/certd-client/src/components/cron-editor/utils.ts
Normal 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;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
.text-editable {
|
||||
flex: 1;
|
||||
line-height: 34px;
|
||||
|
||||
overflow: hidden;
|
||||
span.fs-iconify {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
|
||||
@@ -15,6 +15,7 @@ import PemInput from "./pem-input.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 {
|
||||
install(app: any) {
|
||||
app.component(
|
||||
@@ -27,6 +28,7 @@ export default {
|
||||
app.component("TextEditable", TextEditable);
|
||||
app.component("FileInput", FileInput);
|
||||
app.component("PemInput", PemInput);
|
||||
app.component("ValidTimeFormat", ValidTimeFormat);
|
||||
// app.component("CodeEditor", CodeEditor);
|
||||
|
||||
app.component("CronLight", CronLight);
|
||||
|
||||
@@ -8,6 +8,7 @@ export type CnameRecord = {
|
||||
status?: string;
|
||||
hostRecord?: string;
|
||||
recordValue?: string;
|
||||
error?: string;
|
||||
};
|
||||
|
||||
export type DomainGroupItem = {
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
</td>
|
||||
<td class="status center flex-center">
|
||||
<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 class="center">
|
||||
<template v-if="cnameRecord.status !== 'valid'">
|
||||
|
||||
@@ -21,7 +21,7 @@ import CnameRecordInfo from "/@/components/plugins/cert/domains-verify-plan-edit
|
||||
import { computed } from "vue";
|
||||
|
||||
defineOptions({
|
||||
name: "CnameVerifyPlan"
|
||||
name: "CnameVerifyPlan",
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:modelValue", "change"]);
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
</div>
|
||||
<div v-if="item.type === 'http'" class="plan-http">
|
||||
<http-verify-plan v-model="item.httpVerifyPlan" @change="onPlanChanged" />
|
||||
<div class="helper">证书颁发机构将请求 https://yourdomain/.well-known/acme-challenge/xxxxxx 来验证域名所有权。</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -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>
|
||||
@@ -233,13 +233,13 @@ function openUpgrade() {
|
||||
desc: "社区免费版",
|
||||
type: "free",
|
||||
icon: "lucide:package-open",
|
||||
privilege: ["证书申请无限制", "域名数量无限制", "证书流水线数量无限制", "常用的主机、云平台、cdn等部署插件", "邮件、webhook通知方式"],
|
||||
privilege: ["证书申请无限制", "域名数量无限制", "证书流水线数量无限制", "常用的主机、云平台、cdn、宝塔、1Panel等部署插件", "邮件、webhook通知方式"],
|
||||
},
|
||||
plus: {
|
||||
title: "专业版",
|
||||
desc: "开源需要您的赞助支持",
|
||||
type: "plus",
|
||||
privilege: ["可加VIP群,您的需求将优先实现", "站点证书监控无限制", "更多通知方式", "插件全开放,更多强大的部署插件,宝塔、群晖、1Panel等"],
|
||||
privilege: ["可加VIP群,您的需求将优先实现", "站点证书监控无限制", "更多通知方式", "插件全开放,群辉等更多插件"],
|
||||
trial: {
|
||||
title: "点击获取7天试用",
|
||||
click: () => {
|
||||
|
||||
@@ -120,10 +120,10 @@ function install(app: App, options: any = {}) {
|
||||
rowHandle: {
|
||||
fixed: "right",
|
||||
buttons: {
|
||||
view: { type: "link", text: null, icon: "ion:eye-outline" },
|
||||
copy: { show: true, type: "link", text: null, icon: "ion:copy-outline" },
|
||||
edit: { type: "link", text: null, icon: "ion:create-outline" },
|
||||
remove: { type: "link", style: { color: "red" }, text: null, icon: "ion:trash-outline" },
|
||||
view: { type: "link", text: null, icon: "ion:eye-outline", tooltip: { title: "查看" } },
|
||||
copy: { show: true, type: "link", text: null, icon: "ion:copy-outline", tooltip: { title: "复制" } },
|
||||
edit: { type: "link", text: null, icon: "ion:create-outline", tooltip: { title: "编辑" } },
|
||||
remove: { type: "link", style: { color: "red" }, text: null, icon: "ion:trash-outline", tooltip: { title: "删除" } },
|
||||
},
|
||||
dropdown: {
|
||||
more: {
|
||||
@@ -334,6 +334,22 @@ function install(app: App, options: any = {}) {
|
||||
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 {
|
||||
|
||||
@@ -122,7 +122,7 @@ export const certdResources = [
|
||||
},
|
||||
|
||||
{
|
||||
title: "OpenKey",
|
||||
title: "开放接口密钥",
|
||||
name: "OpenKey",
|
||||
path: "/certd/open/openkey",
|
||||
component: "/certd/open/openkey/index.vue",
|
||||
|
||||
@@ -30,6 +30,7 @@ export type PlusInfo = {
|
||||
};
|
||||
export type SysPublicSetting = {
|
||||
registerEnabled?: boolean;
|
||||
userValidTimeEnabled?: boolean;
|
||||
usernameRegisterEnabled?: boolean;
|
||||
mobileRegisterEnabled?: boolean;
|
||||
emailRegisterEnabled?: boolean;
|
||||
|
||||
@@ -27,6 +27,8 @@ export interface UserInfoRes {
|
||||
avatar?: string;
|
||||
roleIds: number[];
|
||||
isWeak?: boolean;
|
||||
validTime?: number;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
export interface LoginRes {
|
||||
|
||||
@@ -49,38 +49,38 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest
|
||||
delRequest,
|
||||
},
|
||||
toolbar: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
search: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
form: {
|
||||
wrapper: {
|
||||
width: "1050px"
|
||||
}
|
||||
width: "1050px",
|
||||
},
|
||||
},
|
||||
rowHandle: {
|
||||
width: 200
|
||||
width: 200,
|
||||
},
|
||||
table: {
|
||||
scroll: {
|
||||
x: 800
|
||||
x: 800,
|
||||
},
|
||||
rowSelection: {
|
||||
type: "radio",
|
||||
selectedRowKeys: selectedRowKey,
|
||||
onChange: onSelectChange
|
||||
onChange: onSelectChange,
|
||||
},
|
||||
customRow: (record: any) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
onSelectChange([record.id]);
|
||||
} // 点击行
|
||||
}, // 点击行
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
@@ -88,25 +88,25 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
key: "id",
|
||||
type: "number",
|
||||
column: {
|
||||
width: 50
|
||||
width: 50,
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
name: {
|
||||
title: "名称",
|
||||
search: {
|
||||
show: true
|
||||
show: true,
|
||||
},
|
||||
type: ["text"],
|
||||
form: {
|
||||
rules: [{ required: true, message: "请填写名称" }],
|
||||
helper: "随便填,当多个相同类型的授权时,便于区分"
|
||||
helper: "随便填,当多个相同类型的授权时,便于区分",
|
||||
},
|
||||
column: {
|
||||
width: 200
|
||||
}
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
from: {
|
||||
title: "级别",
|
||||
@@ -114,29 +114,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "系统", value: "sys" },
|
||||
{ label: "用户", value: "user" }
|
||||
]
|
||||
{ label: "用户", value: "user" },
|
||||
],
|
||||
}),
|
||||
search: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center",
|
||||
component: {
|
||||
color: "auto"
|
||||
color: "auto",
|
||||
},
|
||||
order: 10
|
||||
order: 10,
|
||||
},
|
||||
valueBuilder: ({ row, key, value }) => {
|
||||
row[key] = row.userId > 0 ? "user" : "sys";
|
||||
}
|
||||
},
|
||||
},
|
||||
...commonColumnsDefine
|
||||
}
|
||||
}
|
||||
...commonColumnsDefine,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as api from "./api";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { Ref, ref } from "vue";
|
||||
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 { useSettingStore } from "/@/store/settings";
|
||||
import { message } from "ant-design-vue";
|
||||
@@ -31,7 +31,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
const settingStore = useSettingStore();
|
||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||
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 {
|
||||
crudOptions: {
|
||||
settings: {
|
||||
@@ -174,21 +182,25 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
status: {
|
||||
title: "状态",
|
||||
type: "dict-select",
|
||||
dict: 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" },
|
||||
],
|
||||
}),
|
||||
dict: dictRef,
|
||||
addForm: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 120,
|
||||
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: {
|
||||
|
||||
@@ -6,7 +6,7 @@ export async function GetList(query: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/page",
|
||||
method: "post",
|
||||
data: query
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function AddObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/add",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export async function UpdateObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/update",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export async function DelObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/delete",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function GetObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/info",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export async function GetDetail(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/detail",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -54,6 +54,6 @@ export async function DeleteBatch(ids: any[]) {
|
||||
return await request({
|
||||
url: apiPrefix + "/deleteByIds",
|
||||
method: "post",
|
||||
data: { ids }
|
||||
data: { ids },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,9 +2,10 @@ import * as api from "./api";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { computed, Ref, ref } from "vue";
|
||||
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 { useSettingStore } from "/@/store/settings";
|
||||
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
@@ -143,6 +144,50 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
},
|
||||
},
|
||||
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: {
|
||||
title: "创建时间",
|
||||
type: "datetime",
|
||||
|
||||
@@ -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) {
|
||||
return await request({
|
||||
url: apiPrefix + "/disabledChange",
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useSettingStore } from "/@/store/settings";
|
||||
import { mySuiteApi } from "/@/views/certd/suite/mine/api";
|
||||
import { mitter } from "/@/utils/util.mitt";
|
||||
import { useSiteIpMonitor } from "./ip/use";
|
||||
import { useSiteImport } from "/@/views/certd/monitor/site/use";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const { t } = useI18n();
|
||||
@@ -44,6 +45,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
});
|
||||
|
||||
const { openSiteIpMonitorDialog } = useSiteIpMonitor();
|
||||
const { openSiteImportDialog } = useSiteImport();
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
@@ -97,6 +99,19 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
await crudExpose.openAdd({});
|
||||
},
|
||||
},
|
||||
//导入按钮
|
||||
import: {
|
||||
show: true,
|
||||
text: "批量导入",
|
||||
type: "primary",
|
||||
async click() {
|
||||
openSiteImportDialog({
|
||||
afterSubmit() {
|
||||
crudExpose.doRefresh();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
rowHandle: {
|
||||
@@ -115,7 +130,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
await api.DoCheck(row.id);
|
||||
await crudExpose.doRefresh();
|
||||
notification.success({
|
||||
message: "检查完成",
|
||||
message: "检查任务已提交,请稍后刷新查看结果",
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -235,7 +250,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
};
|
||||
return (
|
||||
<a-popover placement="left" v-slots={slots} overlayStyle={{ maxWidth: "30%" }}>
|
||||
<a-popover placement={"left"} v-slots={slots} overlayStyle={{ maxWidth: "30%" }}>
|
||||
{row.certDomains}
|
||||
</a-popover>
|
||||
);
|
||||
|
||||
@@ -68,4 +68,11 @@ export const siteIpApi = {
|
||||
},
|
||||
});
|
||||
},
|
||||
async Import(form: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/import",
|
||||
method: "post",
|
||||
data: form,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,13 +4,11 @@ import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, Edi
|
||||
import { siteIpApi } from "./api";
|
||||
import dayjs from "dayjs";
|
||||
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 {
|
||||
const { t } = useI18n();
|
||||
const api = siteIpApi;
|
||||
|
||||
const { crudBinding } = crudExpose;
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
if (!query.query) {
|
||||
query.query = {};
|
||||
@@ -36,8 +34,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
return res;
|
||||
};
|
||||
|
||||
const settingsStore = useSettingStore();
|
||||
|
||||
const checkStatusDict = dict({
|
||||
data: [
|
||||
{ label: "成功", value: "ok", color: "green" },
|
||||
@@ -45,6 +41,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
{ label: "异常", value: "error", color: "red" },
|
||||
],
|
||||
});
|
||||
const { openSiteIpImportDialog } = useSiteIpMonitor();
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
@@ -75,6 +72,19 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
await crudExpose.openAdd({});
|
||||
},
|
||||
},
|
||||
import: {
|
||||
show: true,
|
||||
text: "批量导入",
|
||||
type: "primary",
|
||||
async click() {
|
||||
openSiteIpImportDialog({
|
||||
siteId: context.props.siteId,
|
||||
afterSubmit() {
|
||||
crudExpose.doRefresh();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
load: {
|
||||
text: "同步IP",
|
||||
type: "primary",
|
||||
@@ -127,7 +137,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
await api.DoCheck(row.id);
|
||||
await crudExpose.doRefresh();
|
||||
notification.success({
|
||||
message: "检查任务已提交",
|
||||
message: "检查任务已提交,请稍后刷新查看结果",
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -295,6 +305,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
data: [
|
||||
{ label: "同步", value: "sync", color: "green" },
|
||||
{ label: "手动", value: "manual", color: "blue" },
|
||||
{ label: "导入", value: "import", color: "blue" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { useFormWrapper } from "@fast-crud/fast-crud";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import SiteIpCertMonitor from "./index.vue";
|
||||
import { siteIpApi } from "/@/views/certd/monitor/site/ip/api";
|
||||
|
||||
export function useSiteIpMonitor() {
|
||||
const { openDialog } = useFormWrapper();
|
||||
const router = useRouter();
|
||||
const { openDialog, openCrudFormDialog } = useFormWrapper();
|
||||
|
||||
async function openSiteIpMonitorDialog(opts: { siteId: number }) {
|
||||
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 {
|
||||
openSiteIpMonitorDialog,
|
||||
openSiteIpImportDialog,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ import { request } from "/src/api/service";
|
||||
const apiPrefix = "/monitor/site/setting";
|
||||
export type UserSiteMonitorSetting = {
|
||||
notificationId?: number;
|
||||
retryTimes?: number;
|
||||
cron?: string;
|
||||
};
|
||||
|
||||
export async function SiteMonitorSettingsGet() {
|
||||
|
||||
@@ -11,6 +11,19 @@
|
||||
</div>
|
||||
<div class="helper">设置通知渠道</div>
|
||||
</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 }">
|
||||
<loading-button type="primary" html-type="button" :click="doSave">保存</loading-button>
|
||||
</a-form-item>
|
||||
@@ -27,8 +40,10 @@ import { notification } from "ant-design-vue";
|
||||
import { merge } from "lodash-es";
|
||||
import { useSettingStore } from "/src/store/settings";
|
||||
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
|
||||
const settingsStore = useSettingStore();
|
||||
const userStore = useUserStore();
|
||||
defineOptions({
|
||||
name: "UserSecurity",
|
||||
});
|
||||
@@ -56,7 +71,7 @@ const doSave = async (form: any) => {
|
||||
<style lang="less">
|
||||
.page-user-settings {
|
||||
.user-settings-form {
|
||||
width: 600px;
|
||||
width: 700px;
|
||||
margin: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
@@ -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 { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
|
||||
import { Modal, notification } from "ant-design-vue";
|
||||
import { env } from "/@/utils/util.env";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import dayjs from "dayjs";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import { useModal } from "/@/use/use-modal";
|
||||
import CertView from "./cert-view.vue";
|
||||
import { eachStages } from "./utils";
|
||||
import { setRunnableIds, useCertPipelineCreator } from "/@/views/certd/pipeline/certd-form/use";
|
||||
import { useCertUpload } from "/@/views/certd/pipeline/cert-upload/use";
|
||||
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 {
|
||||
const router = useRouter();
|
||||
@@ -61,59 +59,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
|
||||
return res;
|
||||
};
|
||||
|
||||
const model = useModal();
|
||||
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 { viewCert, downloadCert } = useCertViewer();
|
||||
const userStore = useUserStore();
|
||||
const settingStore = useSettingStore();
|
||||
|
||||
@@ -208,6 +154,10 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
|
||||
},
|
||||
table: {
|
||||
scroll: { x: 1500 },
|
||||
remove: {
|
||||
confirmTitle: "确定要删除吗?",
|
||||
confirmMessage: "将删除该流水线相关的所有数据,包括执行历史、证书文件、证书仓库记录等",
|
||||
},
|
||||
},
|
||||
tabs: {
|
||||
name: "groupId",
|
||||
@@ -223,6 +173,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
|
||||
play: {
|
||||
order: -999,
|
||||
title: "运行流水线",
|
||||
tooltip: { title: "运行流水线" },
|
||||
type: "link",
|
||||
icon: "ant-design:play-circle-outlined",
|
||||
click({ row }) {
|
||||
@@ -276,19 +227,21 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
|
||||
viewCert: {
|
||||
order: 3,
|
||||
title: "查看证书",
|
||||
tooltip: { title: "查看证书" },
|
||||
type: "link",
|
||||
icon: "ph:certificate",
|
||||
async click({ row }) {
|
||||
await viewCert(row);
|
||||
await viewCert(row.id);
|
||||
},
|
||||
},
|
||||
download: {
|
||||
order: 4,
|
||||
type: "link",
|
||||
title: "下载证书",
|
||||
tooltip: { title: "下载证书" },
|
||||
icon: "ant-design:download-outlined",
|
||||
async click({ row }) {
|
||||
await downloadCert(row);
|
||||
await downloadCert(row.id);
|
||||
},
|
||||
},
|
||||
remove: {
|
||||
|
||||
@@ -34,6 +34,8 @@ const pipelineOptions: PipelineOptions = {
|
||||
stages: [],
|
||||
triggers: [],
|
||||
...JSON.parse(detail.pipeline.content || "{}"),
|
||||
type: detail.pipeline.type,
|
||||
from: detail.pipeline.from,
|
||||
},
|
||||
} as PipelineDetail;
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="pi-group-selector flex full-w">
|
||||
<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>
|
||||
|
||||
<fs-table-select
|
||||
|
||||
@@ -23,14 +23,11 @@
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
<template #footer>
|
||||
<a-tooltip title="AI分析异常">
|
||||
<fs-button v-if="settingsStore.sysPublic.aiChatEnabled !== false" key="aiChat" type="primary" icon="ion:color-wand-outline" @click="taskModal.onAiChat">AI分析</fs-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip title="强制重新执行此步骤">
|
||||
<fs-button key="rerun" type="primary" text="重新运行" icon="icon-park-outline:replay-music" @click="triggerRun(activeKey)"></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>
|
||||
<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 key="rerun" type="primary" :tooltip="{ title: '强制重新执行此步骤' }" text="重新运行" icon="icon-park-outline:replay-music" @click="triggerRun(activeKey)"></fs-button>
|
||||
<fs-button key="downloadLogs" type="primary" :tooltip="{ title: '当前任务日志下载' }" icon="ion:arrow-down-circle-outline" @click="taskModal.onDownloadLogs">下载日志</fs-button>
|
||||
<fs-button key="cancel" :tooltip="{ title: '关闭窗口' }" icon="ion:close-circle-outline" @click="taskModal.onOk">关闭</fs-button>
|
||||
<!-- <fs-button key="submit" :tooltip="{ title: '关闭窗口' }" icon="ion:checkmark-circle-outline" type="primary" @click="taskModal.onOk">确定</fs-button>-->
|
||||
</template>
|
||||
</a-modal>
|
||||
</template>
|
||||
@@ -41,6 +38,7 @@ import { RunHistory } from "../../type";
|
||||
import PiStatusShow from "/@/views/certd/pipeline/pipeline/component/status-show.vue";
|
||||
import { usePreferences } from "/@/vben/preferences";
|
||||
import { useSettingStore } from "/@/store/settings/index";
|
||||
import { notification } from "ant-design-vue";
|
||||
export default {
|
||||
name: "PiTaskView",
|
||||
components: { PiStatusShow },
|
||||
@@ -56,6 +54,22 @@ export default {
|
||||
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: "关闭",
|
||||
});
|
||||
const { isMobile } = usePreferences();
|
||||
|
||||
@@ -1,18 +1,43 @@
|
||||
<template>
|
||||
<fs-page v-if="pipeline" class="page-pipeline-edit">
|
||||
<template #header>
|
||||
<div class="title">
|
||||
<div class="title flex-1">
|
||||
<fs-button class="back" icon="ion:chevron-back-outline" @click="goBack"></fs-button>
|
||||
<text-editable v-model="pipeline.title" :hover-show="false" :disabled="!editMode"></text-editable>
|
||||
</div>
|
||||
<div class="more">
|
||||
<template v-if="editMode">
|
||||
<a-button type="primary" :loading="saveLoading" @click="save">保存</a-button>
|
||||
<a-button class="ml-5" @click="cancel">取消</a-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-button type="primary" @click="edit">编辑</a-button>
|
||||
</template>
|
||||
<div class="more flex items-center flex-1 justify-end">
|
||||
<div v-if="isCert" class="flex items-center hidden md:block">
|
||||
<a-tag class="mr-5 pointer" color="green" type="primary" text="查看证书" @click="viewCert(pipeline.id)">
|
||||
<span class="flex"><fs-icon icon="ant-design:eye-outlined"></fs-icon> 查看证书</span>
|
||||
</a-tag>
|
||||
<a-tag class="mr-5 pointer" color="green" type="primary" text="下载证书" @click="downloadCert(pipeline.id)">
|
||||
<span class="flex"> <fs-icon icon="ant-design:download-outlined"></fs-icon> 下载证书 </span>
|
||||
</a-tag>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center hidden md:block">
|
||||
<a-tag v-if="nextTriggerTimes" color="blue">
|
||||
<span class="flex">
|
||||
<fs-icon icon="ion:time-outline"></fs-icon>
|
||||
下次执行时间:{{ nextTriggerTimes }}
|
||||
</span>
|
||||
</a-tag>
|
||||
<a-tag v-else-if="nextTriggerTimes === false" color="red">
|
||||
<span class="flex">
|
||||
<fs-icon icon="ion:caret-forward-circle-outline"></fs-icon>
|
||||
未设置触发源,不会自动执行
|
||||
</span>
|
||||
</a-tag>
|
||||
</div>
|
||||
<div class="basis-40 flex justify-end mr-10">
|
||||
<template v-if="editMode">
|
||||
<fs-button type="primary" :loading="saveLoading" @click="save">保存</fs-button>
|
||||
<fs-button class="ml-5" @click="cancel">取消</fs-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<fs-button icon="ant-design:edit-outlined" type="primary" @click="edit">编辑</fs-button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -241,7 +266,7 @@
|
||||
@cancel="historyCancel()"
|
||||
></pi-history-timeline-item>
|
||||
</template>
|
||||
<a-empty v-if="histories.length === 0"> </a-empty>
|
||||
<a-empty v-if="histories.length === 0"></a-empty>
|
||||
</a-timeline>
|
||||
</a-page-header>
|
||||
</div>
|
||||
@@ -255,7 +280,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, onUnmounted, provide, Ref, ref, watch } from "vue";
|
||||
import { defineComponent, onMounted, onUnmounted, provide, Ref, ref, watch, computed } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import PiTaskForm from "./component/task-form/index.vue";
|
||||
import PiTriggerForm from "./component/trigger-form/index.vue";
|
||||
@@ -275,11 +300,23 @@ import { useUserStore } from "/@/store/user";
|
||||
import TaskShortcuts from "./component/shortcut/task-shortcuts.vue";
|
||||
import { eachSteps, findStep } from "../utils";
|
||||
import { PluginGroups } from "/@/store/plugin";
|
||||
import { getCronNextTimes } from "/@/components/cron-editor/utils";
|
||||
import { useCertViewer } from "/@/views/certd/pipeline/use";
|
||||
|
||||
export default defineComponent({
|
||||
name: "PipelineEdit",
|
||||
// eslint-disable-next-line vue/no-unused-components
|
||||
components: { FsIcon, PiHistoryTimelineItem, PiTaskForm, PiTriggerForm, PiTaskView, PiStatusShow, PiNotificationForm, VDraggable, TaskShortcuts },
|
||||
components: {
|
||||
FsIcon,
|
||||
PiHistoryTimelineItem,
|
||||
PiTaskForm,
|
||||
PiTriggerForm,
|
||||
PiTaskView,
|
||||
PiStatusShow,
|
||||
PiNotificationForm,
|
||||
VDraggable,
|
||||
TaskShortcuts,
|
||||
},
|
||||
props: {
|
||||
pipelineId: {
|
||||
type: [Number, String],
|
||||
@@ -309,7 +346,24 @@ export default defineComponent({
|
||||
|
||||
const currentHistory: Ref<any> = ref({});
|
||||
|
||||
const nextTriggerTimes = computed(() => {
|
||||
const triggers = pipeline.value.triggers;
|
||||
if (!triggers || triggers.length === 0) {
|
||||
return false;
|
||||
}
|
||||
let nextTimes: any = [];
|
||||
for (const item of triggers) {
|
||||
if (!item.props?.cron) {
|
||||
continue;
|
||||
}
|
||||
const ret = getCronNextTimes(item.props?.cron, 1);
|
||||
nextTimes.push(...ret);
|
||||
}
|
||||
return nextTimes.join(",");
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
function goBack() {
|
||||
router.back();
|
||||
}
|
||||
@@ -365,8 +419,10 @@ export default defineComponent({
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const intervalLoadHistoryRef = ref();
|
||||
const isLoadingHistory = ref(false);
|
||||
|
||||
function watchNewHistoryList() {
|
||||
intervalLoadHistoryRef.value = setInterval(async () => {
|
||||
if (isLoadingHistory.value) {
|
||||
@@ -390,6 +446,7 @@ export default defineComponent({
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
watchNewHistoryList();
|
||||
});
|
||||
@@ -420,7 +477,15 @@ export default defineComponent({
|
||||
return;
|
||||
}
|
||||
const detail: PipelineDetail = await props.options.getPipelineDetail({ pipelineId: value });
|
||||
currentPipeline.value = _.merge({ title: "新管道流程", stages: [], triggers: [], notifications: [] }, detail.pipeline);
|
||||
currentPipeline.value = _.merge(
|
||||
{
|
||||
title: "新管道流程",
|
||||
stages: [],
|
||||
triggers: [],
|
||||
notifications: [],
|
||||
},
|
||||
detail.pipeline
|
||||
);
|
||||
pipeline.value = currentPipeline.value;
|
||||
await loadHistoryList(true);
|
||||
},
|
||||
@@ -535,6 +600,7 @@ export default defineComponent({
|
||||
function isLastStage(index: number) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
stageAdd,
|
||||
isLastStage,
|
||||
@@ -654,6 +720,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
const validateErrors: Ref = ref({});
|
||||
|
||||
function addValidateError(taskId: string, error: any) {
|
||||
const errors = validateErrors.value[taskId] || [];
|
||||
validateErrors.value[taskId] = errors;
|
||||
@@ -708,6 +775,7 @@ export default defineComponent({
|
||||
function hasValidateError(taskId: string) {
|
||||
return validateErrors.value[taskId] != null;
|
||||
}
|
||||
|
||||
const save = async (offEdit = true) => {
|
||||
doValidate();
|
||||
|
||||
@@ -771,9 +839,11 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
const logsCollapse = ref(false);
|
||||
|
||||
function toggleLogsCollapse() {
|
||||
logsCollapse.value = !logsCollapse.value;
|
||||
}
|
||||
|
||||
return {
|
||||
historyView,
|
||||
historyCancel,
|
||||
@@ -838,7 +908,12 @@ export default defineComponent({
|
||||
};
|
||||
});
|
||||
|
||||
const { viewCert, downloadCert } = useCertViewer();
|
||||
const isCert = computed(() => {
|
||||
return currentPipeline.value?.type?.startsWith("cert");
|
||||
});
|
||||
return {
|
||||
isCert,
|
||||
pipeline,
|
||||
currentHistory,
|
||||
histories,
|
||||
@@ -852,6 +927,9 @@ export default defineComponent({
|
||||
...useHistory(),
|
||||
...useNotification(),
|
||||
...useScroll(),
|
||||
nextTriggerTimes,
|
||||
viewCert,
|
||||
downloadCert,
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -864,9 +942,11 @@ export default defineComponent({
|
||||
text-overflow: ellipsis;
|
||||
text-wrap: nowrap;
|
||||
display: flex;
|
||||
|
||||
.back {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.text-editable {
|
||||
width: 300px;
|
||||
}
|
||||
@@ -876,47 +956,57 @@ export default defineComponent({
|
||||
.pi-status-show {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.fs-page-content {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.layout {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
overflow-x: hidden;
|
||||
|
||||
.layout-left {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.layout-right {
|
||||
width: 350px;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.pipeline-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.pipeline {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
|
||||
.stages {
|
||||
display: flex;
|
||||
overflow: auto;
|
||||
min-width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.stage {
|
||||
width: 300px;
|
||||
border-right: 1px solid #c7c7c7;
|
||||
|
||||
.is-add {
|
||||
visibility: hidden;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
&:hover .is-add {
|
||||
visibility: visible;
|
||||
}
|
||||
@@ -925,11 +1015,13 @@ export default defineComponent({
|
||||
padding: 20px;
|
||||
color: gray;
|
||||
display: flex;
|
||||
|
||||
.stage-move-handle {
|
||||
cursor: move;
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
//.sortable-ghost {
|
||||
// .line {
|
||||
// visibility: hidden;
|
||||
@@ -943,6 +1035,7 @@ export default defineComponent({
|
||||
|
||||
&.line-left {
|
||||
left: 25px;
|
||||
|
||||
.flow-line {
|
||||
border-right: 0;
|
||||
}
|
||||
@@ -950,6 +1043,7 @@ export default defineComponent({
|
||||
|
||||
&.line-right {
|
||||
right: 25px;
|
||||
|
||||
.flow-line {
|
||||
border-left: 0;
|
||||
}
|
||||
@@ -960,6 +1054,7 @@ export default defineComponent({
|
||||
border: 1px solid #c7c7c7;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.add-stage-btn {
|
||||
display: inline-flex;
|
||||
visibility: hidden;
|
||||
@@ -969,6 +1064,7 @@ export default defineComponent({
|
||||
bottom: -12px;
|
||||
left: -12px;
|
||||
z-index: 100;
|
||||
|
||||
&:hover {
|
||||
color: #1890ff;
|
||||
}
|
||||
@@ -981,6 +1077,7 @@ export default defineComponent({
|
||||
|
||||
&.line-left {
|
||||
left: 0;
|
||||
|
||||
.flow-line {
|
||||
border-right: 0;
|
||||
border-left: 0;
|
||||
@@ -989,6 +1086,7 @@ export default defineComponent({
|
||||
|
||||
&.line-right {
|
||||
right: 0;
|
||||
|
||||
.flow-line {
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
@@ -1008,13 +1106,16 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.last-stage {
|
||||
.line {
|
||||
width: 50% !important;
|
||||
right: auto;
|
||||
|
||||
.flow-line {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.add-stage-btn {
|
||||
visibility: hidden;
|
||||
}
|
||||
@@ -1038,6 +1139,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.task {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -1050,6 +1152,7 @@ export default defineComponent({
|
||||
&.in-edit {
|
||||
margin-right: 28px;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
}
|
||||
}
|
||||
@@ -1061,12 +1164,15 @@ export default defineComponent({
|
||||
//font-size: 18px;
|
||||
cursor: pointer;
|
||||
z-index: 10;
|
||||
|
||||
&:hover {
|
||||
color: #1890ff;
|
||||
}
|
||||
|
||||
&.copy {
|
||||
right: 30px;
|
||||
}
|
||||
|
||||
&.drag {
|
||||
right: 10px;
|
||||
cursor: move;
|
||||
@@ -1078,6 +1184,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
position: relative;
|
||||
|
||||
.shortcut {
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
@@ -1092,6 +1199,7 @@ export default defineComponent({
|
||||
|
||||
.layout-right {
|
||||
position: relative;
|
||||
|
||||
&.collapsed {
|
||||
margin-right: -350px;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
return (
|
||||
<div>
|
||||
如果您不理解什么是子域托管,可以参考文档
|
||||
<a href={"https://help.aliyun.com/zh/dns/subdomain-management"}>子域管理</a>
|
||||
<a href={"https://help.aliyun.com/zh/dns/subdomain-management"} target={"_blank"}>
|
||||
子域管理
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
65
packages/ui/certd-client/src/views/certd/pipeline/use.tsx
Normal file
65
packages/ui/certd-client/src/views/certd/pipeline/use.tsx
Normal file
@@ -0,0 +1,65 @@
|
||||
import * as api from "/@/views/certd/pipeline/api";
|
||||
import { notification } from "ant-design-vue";
|
||||
import CertView from "/@/views/certd/pipeline/cert-view.vue";
|
||||
import { env } from "/@/utils/util.env";
|
||||
import { useModal } from "/@/use/use-modal";
|
||||
|
||||
export function useCertViewer() {
|
||||
const model = useModal();
|
||||
const viewCert = async (id: number) => {
|
||||
const cert = await api.GetCert(id);
|
||||
if (!cert) {
|
||||
notification.error({ message: "请先运行一次流水线" });
|
||||
return;
|
||||
}
|
||||
|
||||
model.success({
|
||||
title: "查看证书",
|
||||
maskClosable: true,
|
||||
okText: "关闭",
|
||||
width: 800,
|
||||
content: () => {
|
||||
return <CertView cert={cert}></CertView>;
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const downloadCert = async (id: any) => {
|
||||
const files = await api.GetFiles(id);
|
||||
model.success({
|
||||
title: "点击链接下载",
|
||||
maskClosable: true,
|
||||
okText: "关闭",
|
||||
content: () => {
|
||||
const children = [];
|
||||
for (const file of files) {
|
||||
const downloadUrl = `${env.API}/pi/history/download?pipelineId=${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>
|
||||
);
|
||||
},
|
||||
});
|
||||
};
|
||||
return {
|
||||
viewCert,
|
||||
downloadCert,
|
||||
};
|
||||
}
|
||||
@@ -35,6 +35,10 @@
|
||||
<a-divider type="vertical" />
|
||||
<suite-card class="m-0"></suite-card>
|
||||
</template>
|
||||
<template v-if="settingsStore.isPlus && settingsStore.sysPublic.userValidTimeEnabled === true && userInfo.validTime">
|
||||
<a-divider type="vertical" />
|
||||
<valid-time-format class="flex-o" prefix="账户有效期:" :model-value="userInfo.validTime" />
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import * as api from "./api";
|
||||
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 { Modal, notification } from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
|
||||
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
@@ -21,6 +23,10 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
const settingStore = useSettingStore();
|
||||
const userValidTimeEnabled = compute(() => {
|
||||
return settingStore.sysPublic.userValidTimeEnabled === true;
|
||||
});
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
@@ -210,6 +216,43 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||
width: 100,
|
||||
},
|
||||
},
|
||||
validTime: {
|
||||
title: "有效期",
|
||||
type: "date",
|
||||
form: {
|
||||
show: userValidTimeEnabled,
|
||||
},
|
||||
column: {
|
||||
align: "center",
|
||||
sorter: true,
|
||||
width: 100,
|
||||
show: userValidTimeEnabled,
|
||||
cellRender({ value }) {
|
||||
if (value == null || value === 0) {
|
||||
return "";
|
||||
}
|
||||
if (value < dayjs().valueOf()) {
|
||||
return <a-tag color={"red"}>已过期</a-tag>;
|
||||
}
|
||||
const date = dayjs(value).format("YYYY-MM-DD");
|
||||
return (
|
||||
<a-tag color={"green"} title={date}>
|
||||
<fs-time-humanize modelValue={value} options={{ largest: 1, units: ["y", "d", "h"] }} useFormatGreater={30000000000} />
|
||||
</a-tag>
|
||||
);
|
||||
},
|
||||
},
|
||||
valueBuilder({ value, row, key }) {
|
||||
if (value != null) {
|
||||
row[key] = dayjs(value);
|
||||
}
|
||||
},
|
||||
valueResolve({ value, row, key }) {
|
||||
if (value != null) {
|
||||
row[key] = value.valueOf();
|
||||
}
|
||||
},
|
||||
},
|
||||
remark: {
|
||||
title: "备注",
|
||||
type: "text",
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
<a-form-item label="开启自助注册" :name="['public', 'registerEnabled']">
|
||||
<a-switch v-model:checked="formState.public.registerEnabled" />
|
||||
</a-form-item>
|
||||
<a-form-item label="开启用户有效期" :name="['public', 'userValidTimeEnabled']">
|
||||
<div class="flex-o">
|
||||
<a-switch v-model:checked="formState.public.userValidTimeEnabled" :disabled="!settingsStore.isPlus" />
|
||||
<vip-button class="ml-5" mode="button"></vip-button>
|
||||
</div>
|
||||
<div class="helper">有效期内用户可正常使用,失效后流水线将被停用</div>
|
||||
</a-form-item>
|
||||
<template v-if="formState.public.registerEnabled">
|
||||
<a-form-item label="开启用户名注册" :name="['public', 'usernameRegisterEnabled']">
|
||||
<a-switch v-model:checked="formState.public.usernameRegisterEnabled" />
|
||||
@@ -154,6 +161,14 @@ async function loadSysSettings() {
|
||||
if (data?.private.sms?.type) {
|
||||
await loadTypeDefine(data.private.sms.type);
|
||||
}
|
||||
if (!settingsStore.isPlus) {
|
||||
formState.public.userValidTimeEnabled = false;
|
||||
formState.public.emailRegisterEnabled = false;
|
||||
}
|
||||
|
||||
if (!settingsStore.isComm) {
|
||||
formState.public.smsLoginEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
const saveLoading = ref(false);
|
||||
|
||||
@@ -9,6 +9,6 @@ typeorm:
|
||||
port: 3309
|
||||
username: root
|
||||
password: root
|
||||
database: certd2
|
||||
database: certd
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,76 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
|
||||
|
||||
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持雨云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))
|
||||
* 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
|
||||
|
||||
* 修复站点监控通知渠道设置无效的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))
|
||||
* 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))
|
||||
|
||||
## [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))
|
||||
* 站点监控支持批量导入域名和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
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
ALTER TABLE cd_cname_record ADD COLUMN `error` varchar(4096);
|
||||
ALTER TABLE sys_user ADD COLUMN `valid_time` bigint;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE pi_history ADD COLUMN `trigger_type` varchar(100);
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
ALTER TABLE cd_cname_record ADD COLUMN "error" varchar(4096);
|
||||
ALTER TABLE sys_user ADD COLUMN "valid_time" bigint;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE pi_history ADD COLUMN "trigger_type" varchar(100);
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
ALTER TABLE cd_cname_record ADD COLUMN "error" varchar(4096);
|
||||
ALTER TABLE sys_user ADD COLUMN "valid_time" integer;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE pi_history ADD COLUMN "trigger_type" varchar(100);
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.34.10",
|
||||
"version": "1.35.4",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -40,21 +40,22 @@
|
||||
"@alicloud/tea-util": "^1.4.10",
|
||||
"@aws-sdk/client-acm": "^3.699.0",
|
||||
"@aws-sdk/client-cloudfront": "^3.699.0",
|
||||
"@aws-sdk/client-iam": "^3.699.0",
|
||||
"@aws-sdk/client-s3": "^3.705.0",
|
||||
"@certd/acme-client": "^1.34.10",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/commercial-core": "^1.34.10",
|
||||
"@certd/jdcloud": "^1.34.10",
|
||||
"@certd/lib-huawei": "^1.34.10",
|
||||
"@certd/lib-k8s": "^1.34.10",
|
||||
"@certd/lib-server": "^1.34.10",
|
||||
"@certd/midway-flyway-js": "^1.34.10",
|
||||
"@certd/pipeline": "^1.34.10",
|
||||
"@certd/plugin-cert": "^1.34.10",
|
||||
"@certd/plugin-lib": "^1.34.10",
|
||||
"@certd/plugin-plus": "^1.34.10",
|
||||
"@certd/plus-core": "^1.34.10",
|
||||
"@corsinvest/cv4pve-api-javascript": "^8.3.0",
|
||||
"@certd/acme-client": "^1.35.4",
|
||||
"@certd/basic": "^1.35.4",
|
||||
"@certd/commercial-core": "^1.35.4",
|
||||
"@certd/cv4pve-api-javascript": "^8.4.1",
|
||||
"@certd/jdcloud": "^1.35.4",
|
||||
"@certd/lib-huawei": "^1.35.4",
|
||||
"@certd/lib-k8s": "^1.35.4",
|
||||
"@certd/lib-server": "^1.35.4",
|
||||
"@certd/midway-flyway-js": "^1.35.4",
|
||||
"@certd/pipeline": "^1.35.4",
|
||||
"@certd/plugin-cert": "^1.35.4",
|
||||
"@certd/plugin-lib": "^1.35.4",
|
||||
"@certd/plugin-plus": "^1.35.4",
|
||||
"@certd/plus-core": "^1.35.4",
|
||||
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
|
||||
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
|
||||
"@koa/cors": "^5.0.0",
|
||||
@@ -104,6 +105,7 @@
|
||||
"otplib": "^12.0.1",
|
||||
"pg": "^8.12.0",
|
||||
"psl": "^1.9.0",
|
||||
"punycode.js": "^2.3.1",
|
||||
"qiniu": "^7.12.0",
|
||||
"qrcode": "^1.5.4",
|
||||
"qs": "^6.13.1",
|
||||
|
||||
@@ -105,6 +105,17 @@ export class SiteInfoController extends CrudController<SiteInfoService> {
|
||||
await this.service.checkAllByUsers(userId);
|
||||
return this.ok();
|
||||
}
|
||||
|
||||
@Post('/import', { summary: Constants.per.authOnly })
|
||||
async doImport(@Body(ALL) body: any) {
|
||||
const userId = this.getUserId();
|
||||
await this.service.doImport({
|
||||
text:body.text,
|
||||
userId
|
||||
})
|
||||
return this.ok();
|
||||
}
|
||||
|
||||
@Post('/ipCheckChange', { summary: Constants.per.authOnly })
|
||||
async ipCheckChange(@Body(ALL) bean: any) {
|
||||
const userId = this.getUserId();
|
||||
@@ -143,4 +154,5 @@ export class SiteInfoController extends CrudController<SiteInfoService> {
|
||||
await this.service.saveSetting(userId, setting);
|
||||
return this.ok({});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -111,5 +111,16 @@ export class SiteInfoController extends CrudController<SiteIpService> {
|
||||
return this.ok();
|
||||
}
|
||||
|
||||
@Post('/import', { summary: Constants.per.authOnly })
|
||||
async doImport(@Body(ALL) body: any) {
|
||||
const userId = this.getUserId();
|
||||
await this.service.doImport({
|
||||
text:body.text,
|
||||
userId,
|
||||
siteId:body.siteId
|
||||
})
|
||||
return this.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {ALL, Body, Controller, Inject, Post, Provide} from '@midwayjs/core';
|
||||
import {AccessService, BaseController, Constants} from '@certd/lib-server';
|
||||
import {AccessGetter, AccessService, BaseController, Constants} from '@certd/lib-server';
|
||||
import {
|
||||
AccessRequestHandleReq,
|
||||
IAccessService,
|
||||
@@ -33,6 +33,7 @@ export class HandleController extends BaseController {
|
||||
|
||||
@Post('/access', { summary: Constants.per.authOnly })
|
||||
async accessRequest(@Body(ALL) body: AccessRequestHandleReq) {
|
||||
const userId = this.getUserId();
|
||||
let inputAccess = body.input.access;
|
||||
if (body.input.id > 0) {
|
||||
const oldEntity = await this.accessService.info(body.input.id);
|
||||
@@ -48,8 +49,8 @@ export class HandleController extends BaseController {
|
||||
inputAccess = this.accessService.decryptAccessEntity(param);
|
||||
}
|
||||
}
|
||||
|
||||
const access = await newAccess(body.typeName, inputAccess);
|
||||
const accessGetter = new AccessGetter(userId, this.accessService.getById.bind(this.accessService));
|
||||
const access = await newAccess(body.typeName, inputAccess,accessGetter);
|
||||
|
||||
const res = await access.onRequest(body);
|
||||
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import { PipelineService } from '../pipeline/service/pipeline-service.js';
|
||||
import { logger } from '@certd/basic';
|
||||
import { SysSettingsService } from '@certd/lib-server';
|
||||
import {SysSettingsService, SysSiteInfo} from '@certd/lib-server';
|
||||
import { SiteInfoService } from '../monitor/index.js';
|
||||
import { Cron } from '../cron/cron.js';
|
||||
import {UserSettingsService} from "../mine/service/user-settings-service.js";
|
||||
import {UserSiteMonitorSetting} from "../mine/service/models.js";
|
||||
import {getPlusInfo} from "@certd/plus-core";
|
||||
import dayjs from "dayjs";
|
||||
import {NotificationService} from "../pipeline/service/notification-service.js";
|
||||
import {UserService} from "../sys/authority/service/user-service.js";
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@@ -22,6 +28,8 @@ export class AutoCRegisterCron {
|
||||
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
@Inject()
|
||||
userSettingsService: UserSettingsService;
|
||||
|
||||
@Inject()
|
||||
siteInfoService: SiteInfoService;
|
||||
@@ -29,6 +37,13 @@ export class AutoCRegisterCron {
|
||||
@Inject()
|
||||
cron: Cron;
|
||||
|
||||
@Inject()
|
||||
notificationService: NotificationService;
|
||||
|
||||
@Inject()
|
||||
userService: UserService;
|
||||
|
||||
|
||||
@Init()
|
||||
async init() {
|
||||
logger.info('加载定时trigger开始');
|
||||
@@ -39,39 +54,87 @@ export class AutoCRegisterCron {
|
||||
// console.log('meta', meta);
|
||||
// const metas = listPropertyDataFromClass(CLASS_KEY, this.echoPlugin);
|
||||
// console.log('metas', metas);
|
||||
this.registerSiteMonitorCron();
|
||||
await this.registerSiteMonitorCron();
|
||||
|
||||
|
||||
await this.registerPlusExpireCheckCron();
|
||||
}
|
||||
|
||||
registerSiteMonitorCron() {
|
||||
const job = async () => {
|
||||
logger.info('站点证书检查开始执行');
|
||||
async registerSiteMonitorCron() {
|
||||
//先注册公共job
|
||||
await this.siteInfoService.registerSiteMonitorJob()
|
||||
|
||||
let offset = 0;
|
||||
const limit = 50;
|
||||
while (true) {
|
||||
const res = await this.siteInfoService.page({
|
||||
query: { disabled: false },
|
||||
page: { offset, limit },
|
||||
});
|
||||
const { records } = res;
|
||||
|
||||
if (records.length === 0) {
|
||||
break;
|
||||
}
|
||||
offset += records.length;
|
||||
await this.siteInfoService.checkList(records);
|
||||
//注册用户独立的检查时间
|
||||
const monitorSettingList = await this.userSettingsService.list({
|
||||
query:{
|
||||
key: UserSiteMonitorSetting.__key__,
|
||||
}
|
||||
})
|
||||
for (const item of monitorSettingList) {
|
||||
const setting = item.setting ?? JSON.parse(item.setting)
|
||||
if(!setting?.cron){
|
||||
continue
|
||||
}
|
||||
await this.siteInfoService.registerSiteMonitorJob(item.userId)
|
||||
}
|
||||
|
||||
logger.info('站点证书检查完成');
|
||||
};
|
||||
|
||||
this.cron.register({
|
||||
name: 'siteMonitor',
|
||||
cron: '0 0 0 * * *',
|
||||
job,
|
||||
});
|
||||
if (this.immediateTriggerSiteMonitor) {
|
||||
job();
|
||||
logger.info(`立即触发一次站点证书检查任务`)
|
||||
await this.siteInfoService.triggerJobOnce()
|
||||
}
|
||||
}
|
||||
|
||||
registerPlusExpireCheckCron(){
|
||||
// 添加plus即将到期检查任务
|
||||
this.cron.register({
|
||||
name: 'plus-expire-check',
|
||||
cron: `0 10 9 * * *`, // 一天只能检查一次,否则会重复发送通知
|
||||
job: async () => {
|
||||
const plusInfo = getPlusInfo()
|
||||
if (!plusInfo.originVipType || plusInfo.originVipType==="free" ) {
|
||||
return
|
||||
}
|
||||
let label ="专业版"
|
||||
if( plusInfo.originVipType === 'comm'){
|
||||
label = "商业版"
|
||||
}
|
||||
const siteInfo = await this.sysSettingsService.getSetting<SysSiteInfo>(SysSiteInfo)
|
||||
|
||||
const appTitle = siteInfo.title || "certd"
|
||||
const expiresDate = dayjs(plusInfo.expireTime).format("YYYY-MM-DD")
|
||||
// plusInfo.expireTime= dayjs("2025-06-10").valueOf()
|
||||
let expiresDays =Math.floor((plusInfo.expireTime - new Date().getTime())/ 1000 / 60 / 60 / 24)
|
||||
let title = ""
|
||||
let content =""
|
||||
if(expiresDays === 20 ||expiresDays === 10 || expiresDays === 3 || expiresDays === 1 || expiresDays === 0){
|
||||
title = `vip(${label})即将到期`
|
||||
content = `您的${appTitle} vip (${label})剩余${expiresDays}天(${expiresDate})到期,请及时续期,以免影响业务`
|
||||
}else if (expiresDays === -1 || expiresDays === -3 || expiresDays === -7) {
|
||||
title = `vip(${label})已过期`
|
||||
content = `您的${appTitle} vip (${label})已过期${Math.abs(expiresDays)}天(${expiresDate}),请尽快续期,以免影响业务`
|
||||
}
|
||||
if(title){
|
||||
logger.warn(title)
|
||||
logger.warn(content)
|
||||
const url = await this.notificationService.getBindUrl("");
|
||||
const adminUsers = await this.userService.getAdmins()
|
||||
for (const adminUser of adminUsers) {
|
||||
logger.info(`发送vip到期通知给管理员:${adminUser.username}`)
|
||||
await this.notificationService.send({
|
||||
useDefault: true,
|
||||
logger: logger,
|
||||
body:{
|
||||
title,
|
||||
content,
|
||||
errorMessage:title,
|
||||
url
|
||||
}
|
||||
},adminUser.id)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export class HttpsServer {
|
||||
opts.app.callback()
|
||||
);
|
||||
this.server = httpServer;
|
||||
const hostname = '0.0.0.0';
|
||||
const hostname = '::';
|
||||
// A function that runs in the context of the http server
|
||||
// and reports what type of server listens on which port
|
||||
function listeningReporter() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user