Compare commits
252 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b745712791 | ||
|
|
7ee753ac85 | ||
|
|
eea6b8ab5d | ||
|
|
a135f5742c | ||
|
|
04adbb45d8 | ||
|
|
62efb22f37 | ||
|
|
5e98f05036 | ||
|
|
292a7ecbe3 | ||
|
|
4cea45bd87 | ||
|
|
7f0b075529 | ||
|
|
8c7ff5e0e8 | ||
|
|
afea5a1623 | ||
|
|
c60dd7f151 | ||
|
|
92f9371156 | ||
|
|
c5714ec6d9 | ||
|
|
dd16386317 | ||
|
|
7cf1f75eb9 | ||
|
|
cf28a00ccd | ||
|
|
9e48474f11 | ||
|
|
c327c0c995 | ||
|
|
bb567da8c6 | ||
|
|
3e3373b8c7 | ||
|
|
7d45db89bf | ||
|
|
849c145926 | ||
|
|
36a773df0b | ||
|
|
b2abf1490b | ||
|
|
fd5aa63ef3 | ||
|
|
7e024cbcf7 | ||
|
|
7050ee2354 | ||
|
|
024e97d632 | ||
|
|
61479cd5fb | ||
|
|
aaa322464d | ||
|
|
02bfbd5019 | ||
|
|
282f8b4e02 | ||
|
|
3393bde820 | ||
|
|
2277c87908 | ||
|
|
2ea0c48853 | ||
|
|
28cbefde04 | ||
|
|
4e13843c78 | ||
|
|
a929f8429d | ||
|
|
40f3f06ed3 | ||
|
|
0a79c4c717 | ||
|
|
712d789992 | ||
|
|
8de8b1a32e | ||
|
|
c2f565c73a | ||
|
|
1df036a811 | ||
|
|
9910a4fc7b | ||
|
|
9933afc8b7 | ||
|
|
1d89d4b0bc | ||
|
|
a8a84d58d9 | ||
|
|
80fee524a8 | ||
|
|
4ca2ee52b7 | ||
|
|
6638be81a0 | ||
|
|
6ced0e5e43 | ||
|
|
e36518dbe5 | ||
|
|
70d8bb60e7 | ||
|
|
3c919f6b23 | ||
|
|
0cb566d2f3 | ||
|
|
e137b6baaa | ||
|
|
58faeea838 | ||
|
|
47200e9f35 | ||
|
|
5ad8cc668f | ||
|
|
e7704171f7 | ||
|
|
c43718652a | ||
|
|
461a12e909 | ||
|
|
afb682e3eb | ||
|
|
31384fbce5 | ||
|
|
c7cfd7a8a0 | ||
|
|
717e50fd5c | ||
|
|
2ffc7d19f1 | ||
|
|
d857021df5 | ||
|
|
2ee864ccaf | ||
|
|
018dfed128 | ||
|
|
90e4545210 | ||
|
|
4a4b16b010 | ||
|
|
8701303012 | ||
|
|
9788aefcc1 | ||
|
|
ed08ef1604 | ||
|
|
adce70a5e5 | ||
|
|
d5978f64e1 | ||
|
|
45215debcc | ||
|
|
919eef55a1 | ||
|
|
8c529eed46 | ||
|
|
7909c2cd46 | ||
|
|
b1ac396bf1 | ||
|
|
d5eb4a1900 | ||
|
|
b8eb27441c | ||
|
|
de1494710a | ||
|
|
e3b05ac77f | ||
|
|
32c8e9482c | ||
|
|
4d3c86dba1 | ||
|
|
28449c348e | ||
|
|
bb9cf7b93c | ||
|
|
eb861083ad | ||
|
|
b133505086 | ||
|
|
0f0cae713a | ||
|
|
56cfce86e4 | ||
|
|
e950322232 | ||
|
|
14de21ee64 | ||
|
|
22712eae96 | ||
|
|
86d1033324 | ||
|
|
b4c4dc2c2e | ||
|
|
671f0142bc | ||
|
|
ab4bdc7be6 | ||
|
|
0859e60b23 | ||
|
|
e69c2d8b0c | ||
|
|
186e058f3d | ||
|
|
ed5af59040 | ||
|
|
0da312f755 | ||
|
|
dc646d9a45 | ||
|
|
109e01bb60 | ||
|
|
657fad06fb | ||
|
|
3e014c876d | ||
|
|
d14dd51359 | ||
|
|
70f876c445 | ||
|
|
9d8d51d88d | ||
|
|
57037f20cc | ||
|
|
4f2f509819 | ||
|
|
474fd77970 | ||
|
|
d2fad719fa | ||
|
|
6a3955a1d6 | ||
|
|
dceb33006a | ||
|
|
a096a43c56 | ||
|
|
8114a33d20 | ||
|
|
9f3adddd41 | ||
|
|
05f74ab654 | ||
|
|
0317118cd9 | ||
|
|
461de8d269 | ||
|
|
b258e92620 | ||
|
|
f6148ef1fb | ||
|
|
457da594be | ||
|
|
891a43ae67 | ||
|
|
bc65c0a786 | ||
|
|
3eeb1f77aa | ||
|
|
91be6826b9 | ||
|
|
f87eee3b9f | ||
|
|
b4e17691c4 | ||
|
|
cce372aeba | ||
|
|
b5a8a9e08a | ||
|
|
35632da284 | ||
|
|
02a9b0d16c | ||
|
|
d1809e0f7d | ||
|
|
abb4a7c0f9 | ||
|
|
cd6fa8b15c | ||
|
|
ecfcada802 | ||
|
|
f8ec5ae253 | ||
|
|
832ba5c8fb | ||
|
|
6fda0d6896 | ||
|
|
a8edaf4dfa | ||
|
|
e11b7802c2 | ||
|
|
aa0c5972fb | ||
|
|
fa8e91cdcd | ||
|
|
e5d902663b | ||
|
|
042535536e | ||
|
|
6d3063437c | ||
|
|
3db4d04e4c | ||
|
|
96f9eab5cd | ||
|
|
1e641b83c1 | ||
|
|
3791d92d67 | ||
|
|
2bcab76f5a | ||
|
|
f5493c542b | ||
|
|
68eb4198f1 | ||
|
|
ef94607728 | ||
|
|
4ccadbd2be | ||
|
|
0643063b80 | ||
|
|
d6c6ab932a | ||
|
|
46004d2db8 | ||
|
|
620d1d4092 | ||
|
|
f30afac47e | ||
|
|
1779e34773 | ||
|
|
28f535f41c | ||
|
|
e921f58d2f | ||
|
|
301f6cc273 | ||
|
|
f04e497999 | ||
|
|
8db438d76b | ||
|
|
af75e607ec | ||
|
|
cd4b9527c3 | ||
|
|
ea8dc446ae | ||
|
|
ba6270990b | ||
|
|
df55f1066c | ||
|
|
b562d661db | ||
|
|
aede78a0ec | ||
|
|
7e8c3fbab7 | ||
|
|
6621601155 | ||
|
|
1fbd585a46 | ||
|
|
5a51c14de5 | ||
|
|
27a4c81c6d | ||
|
|
fdc25dc0d7 | ||
|
|
99522fb49a | ||
|
|
671d273e2f | ||
|
|
2851a33eb2 | ||
|
|
937e3fac19 | ||
|
|
47cb00857c | ||
|
|
7904e05b4a | ||
|
|
c4fe19f2e6 | ||
|
|
9db57f0517 | ||
|
|
64afebecd4 | ||
|
|
4c324960e6 | ||
|
|
164b90a22f | ||
|
|
dc735a8aa2 | ||
|
|
f516b0931f | ||
|
|
2297121eff | ||
|
|
0c2684d1cf | ||
|
|
4b4c5dba73 | ||
|
|
7b9d70e093 | ||
|
|
71a289b009 | ||
|
|
ddf98ff593 | ||
|
|
db8043ecb6 | ||
|
|
ea756cf0a4 | ||
|
|
8446a6d813 | ||
|
|
a18aaeacf7 | ||
|
|
58a43b3785 | ||
|
|
dd06f12582 | ||
|
|
d7dcc01c9f | ||
|
|
66f56740b7 | ||
|
|
5bd042d9bc | ||
|
|
02466ea0bd | ||
|
|
59f22ab17e | ||
|
|
2db9343e0f | ||
|
|
36b3a53ab2 | ||
|
|
dc8c42a820 | ||
|
|
2bd5d0bd8e | ||
|
|
c9ac5ae963 | ||
|
|
49487419d2 | ||
|
|
508fe69cf8 | ||
|
|
3e4a8f230f | ||
|
|
a62230c195 | ||
|
|
1173fb1e90 | ||
|
|
529648a30c | ||
|
|
82b6b9ccb2 | ||
|
|
71244a4eb8 | ||
|
|
32fd424295 | ||
|
|
5746042d68 | ||
|
|
e76fb235aa | ||
|
|
47e13312b1 | ||
|
|
55e05afe0e | ||
|
|
aebce2f241 | ||
|
|
aa3207fca5 | ||
|
|
ce8df34b49 | ||
|
|
8aa8c5d8ae | ||
|
|
e7628bdbdd | ||
|
|
b9dd4a35db | ||
|
|
040b2e8a53 | ||
|
|
af25254628 | ||
|
|
0c673a54cd | ||
|
|
9f1f36774d | ||
|
|
6ec697b010 | ||
|
|
f344c58f26 | ||
|
|
263b0fa455 | ||
|
|
a634c8f2d1 | ||
|
|
336faa46b2 | ||
|
|
52a167c647 |
2
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
./packages/core/lego
|
||||||
# IntelliJ project files
|
# IntelliJ project files
|
||||||
.vscode/
|
.vscode/
|
||||||
node_modules/
|
node_modules/
|
||||||
@@ -32,3 +33,4 @@ gen
|
|||||||
/pnpm-lock.yaml
|
/pnpm-lock.yaml
|
||||||
|
|
||||||
docker/image/workspace
|
docker/image/workspace
|
||||||
|
/packages/core/lego
|
||||||
|
|||||||
76
CHANGELOG.md
@@ -3,6 +3,82 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 临时修复阿里云domainlist接口返回域名列表不全的问题,后续还需要增加翻页查询 ([849c145](https://github.com/certd/certd/commit/849c145926984762bd9dbec87bd91cd047fc0855))
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复邮箱设置无效的bug ([aaa3224](https://github.com/certd/certd/commit/aaa322464d0f65e924d1850995540d396ee24d25))
|
||||||
|
|
||||||
|
**Note:** Version bump only for package root
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
* 🔱: [client] sync upgrade with 2 commits [trident-sync] ([aa3207f](https://github.com/certd/certd/commit/aa3207fca5f15f7c3da789989d99c8ae7d1c4551))
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* search支持自定义布局,search.layout、search.collapse转移到 search.container之下。如果想使用原来的search组件,请配置search.is=fs-search-v1
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复上传证书到腾讯云失败的bug ([e950322](https://github.com/certd/certd/commit/e950322232e19d1263b8552eefa5b0150fd7864e))
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package root
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 成功图标转动的问题 ([f87eee3](https://github.com/certd/certd/commit/f87eee3b9ff1ef9874e79a81fe0ed7104cb9ee8c))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* cancel task ([bc65c0a](https://github.com/certd/certd/commit/bc65c0a786360c087fe95cad93ec6a87804cc5ee))
|
||||||
|
* flush log ([891a43a](https://github.com/certd/certd/commit/891a43ae6716ff98ed06643f7da2e35199ee195c))
|
||||||
|
* flush logger ([91be682](https://github.com/certd/certd/commit/91be6826b902e0f302b1a6cbdb1d24e15914c18d))
|
||||||
|
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package root
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package root
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package root
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复access选择类型trigger ([2851a33](https://github.com/certd/certd/commit/2851a33eb2510f038fadb55da29512597a4ba512))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 权限控制 ([27a4c81](https://github.com/certd/certd/commit/27a4c81c6d70e70abb3892c3ea58d4719988808a))
|
||||||
|
* 邮件通知 ([937e3fa](https://github.com/certd/certd/commit/937e3fac19cd03b8aa91db8ba03fda7fcfbacea2))
|
||||||
|
* cert download ([5a51c14](https://github.com/certd/certd/commit/5a51c14de521cb8075a80d2ae41a16e6d5281259))
|
||||||
|
* config merge ([fdc25dc](https://github.com/certd/certd/commit/fdc25dc0d795555cffacc4572648ec158988fbbb))
|
||||||
|
* save files ([99522fb](https://github.com/certd/certd/commit/99522fb49adb42c1dfdf7bec3dd52d641158285b))
|
||||||
|
* save files ([671d273](https://github.com/certd/certd/commit/671d273e2f9136d16896536b0ca127cf372f1619))
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package root
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package root
|
**Note:** Version bump only for package root
|
||||||
|
|||||||
228
README.md
@@ -1,139 +1,125 @@
|
|||||||
# CertD
|
# CertD
|
||||||
|
|
||||||
CertD 是一个帮助你全自动申请和部署SSL证书的工具。
|
CertD 是一个免费全自动申请和部署SSL证书的工具。
|
||||||
后缀D取自linux守护进程的命名风格,意为证书守护进程。
|
后缀D取自linux守护进程的命名风格,意为证书守护进程。
|
||||||
|
|
||||||
## 特性
|
## 一、特性
|
||||||
本项目不仅支持证书申请过程自动化,还可以自动化部署证书,让你的证书永不过期。
|
本项目不仅支持证书申请过程自动化,还可以自动化部署证书,让你的证书永不过期。
|
||||||
|
|
||||||
* 全自动申请证书
|
* 全自动申请证书(支持阿里云、腾讯云、华为云注册的域名)
|
||||||
* 全自动部署证书(目前支持服务器上传部署、阿里云、腾讯云等)
|
* 全自动部署证书(目前支持服务器上传部署、部署到阿里云、腾讯云等)
|
||||||
* 可与CI/DI工具结合使用
|
* 支持通配符域名
|
||||||
|
* 支持多个域名打到一个证书上
|
||||||
|
* 邮件通知
|
||||||
|
* 证书自动更新
|
||||||
|
* 免费、免费、免费([阿里云单个通配符域名证书最便宜也要1800/年](https://yundun.console.aliyun.com/?p=cas#/certExtend/buy/cn-hangzhou))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 二、在线体验
|
||||||
|
|
||||||
|
官方Demo地址,自助注册后体验
|
||||||
|
|
||||||
|
https://certd.handsfree.work/
|
||||||
|
|
||||||
|
> 注意数据将不定期清理,生产使用请自行部署
|
||||||
|
> 包含敏感信息,务必自己本地部署进行生产使用
|
||||||
|
|
||||||
|
## 三、使用教程
|
||||||
|
本案例演示,如何配置自动申请证书,并部署到阿里云CDN,然后快要到期前自动更新证书并重新部署
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||||
|
-------> [点我查看详细使用步骤演示](./step.md) <--------
|
||||||
|
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
|
||||||
|
|
||||||
|
## 四、本地docker部署
|
||||||
|
|
||||||
|
### 1. 安装docker、docker-compose
|
||||||
|
|
||||||
|
1.1 安装docker
|
||||||
|
https://docs.docker.com/engine/install/
|
||||||
|
|
||||||
|
1.2 安装docker-compose
|
||||||
|
https://docs.docker.com/compose/install/linux/
|
||||||
|
|
||||||
|
### 2. 下载docker-compose.yaml文件
|
||||||
|
```bash
|
||||||
|
mkdir certd
|
||||||
|
cd certd
|
||||||
|
wget https://raw.githubusercontent.com/certd/certd/v2/docker/run/docker-compose.yaml
|
||||||
|
# 或者使用gitee地址
|
||||||
|
wget https://gitee.com/certd/certd/raw/v2/docker/run/docker-compose.yaml
|
||||||
|
|
||||||
|
# 根据需要修改里面的配置
|
||||||
|
# 1.修改镜像版本号
|
||||||
|
# 2.配置数据保存路径
|
||||||
|
# 3.配置certd_auth_jwt_secret
|
||||||
|
vi docker-compose.yaml
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
> 镜像版本号与release版本号同步:
|
||||||
|
https://github.com/certd/certd/releases
|
||||||
|
|
||||||
|
|
||||||
|
### 3. 运行
|
||||||
|
```bash
|
||||||
|
# 如果docker compose是插件化安装
|
||||||
|
export CERTD_VERSION=1.2.0
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
#如果docker compose是独立安装
|
||||||
|
export CERTD_VERSION=1.2.0
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
```
|
||||||
|
### 4. 访问
|
||||||
|
|
||||||
|
http://your_server_ip:7001
|
||||||
|
默认账号密码:admin/123456
|
||||||
|
记得修改密码
|
||||||
|
|
||||||
|
|
||||||
|
## 五、一些说明
|
||||||
|
|
||||||
## 免费证书申请说明
|
|
||||||
* 本项目ssl证书提供商为letencrypt
|
* 本项目ssl证书提供商为letencrypt
|
||||||
* 申请过程遵循acme协议
|
* 申请过程遵循acme协议
|
||||||
* 需要验证域名所有权,一般有两种方式(目前本项目仅支持dns-01)
|
* 需要验证域名所有权,一般有两种方式(目前本项目仅支持dns-01)
|
||||||
* http-01: 在网站根目录下放置一份txt文件
|
* http-01: 在网站根目录下放置一份txt文件
|
||||||
* dns-01: 需要给域名添加txt解析记录,泛域名只能用这种方式
|
* dns-01: 需要给域名添加txt解析记录,通配符域名只能用这种方式
|
||||||
* 证书续期:
|
* 证书续期:
|
||||||
* 实际上acme并没有续期概念。
|
* 实际上acme并没有续期概念。
|
||||||
* 我们所说的续期,其实就是按照全套流程重新申请一份新证书。
|
* 我们所说的续期,其实就是按照全套流程重新申请一份新证书。
|
||||||
* 免费证书过期时间90天,以后可能还会缩短,所以自动化部署必不可少
|
* 免费证书过期时间90天,以后可能还会缩短,所以自动化部署必不可少
|
||||||
|
* 设置每天自动运行,当证书过期前20天,会自动重新申请证书并部署
|
||||||
|
|
||||||
|
## 六、联系作者
|
||||||
|
如有疑问,欢迎加入群聊(请备注certd)
|
||||||
|
* QQ群:141236433
|
||||||
|
* 微信群:
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
加作者好友
|
||||||
|
<p align="center">
|
||||||
|
<img height="230" src="./doc/images/me.png">
|
||||||
|
</p>
|
||||||
|
|
||||||
## 快速开始
|
## 捐赠
|
||||||
本案例演示,如何配置自动申请证书,并部署到阿里云CDN,然后快要到期前自动更新证书并重新部署
|
媳妇儿说:“一天到晚搞开源,也不管管老婆孩子!😡😡😡”
|
||||||
|
拜托各位捐赠支持一下,让媳妇儿开心开心,我也能有更多时间进行开源项目,感谢🙏🙏🙏
|
||||||
|
<p align="center">
|
||||||
|
<img height="380" src="./doc/images/donate.png">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
1. 环境准备
|
## 七、我的其他项目
|
||||||
安装[nodejs](https://nodejs.org/zh-cn/)
|
* [袖手GPT](https://ai.handsfree.work/) ChatGPT,国内可用,无需FQ,每日免费额度
|
||||||
|
* [fast-crud](https://gitee.com/fast-crud/fast-crud/) 基于vue3的crud快速开发框架
|
||||||
|
* [dev-sidecar](https://github.com/docmirror/dev-sidecar/) 直连访问github工具,无需FQ,解决github无法访问的问题
|
||||||
2. 生成node项目
|
|
||||||
|
|
||||||
通过ui生成: https://certd.docmirror.cn/
|
|
||||||
|
|
||||||
开始生成证书,先填写域名,支持将多个域名打到一个证书上
|
|
||||||

|
|
||||||
|
|
||||||
配置证书详细信息
|
|
||||||

|
|
||||||
|
|
||||||
配置证书部署流程
|
|
||||||

|
|
||||||
|
|
||||||
配置好之后,点击导出按钮,导出一个node项目包
|
|
||||||
|
|
||||||
4. 运行
|
|
||||||
将导出的压缩包解压,然后执行如下命令,即可开始申请证书并部署
|
|
||||||
```
|
|
||||||
npm install
|
|
||||||
npm run certd
|
|
||||||
```
|
|
||||||
5. 执行效果
|
|
||||||
生成的证书默认会存储在 `${home}/.certd/${email}/certs/${domain}/current`目录下
|
|
||||||
```
|
|
||||||
[2021-01-08T16:15:04.681] [INFO] certd - 任务完成
|
|
||||||
[2021-01-08T16:15:04.681] [INFO] certd - ---------------------------任务结果总览--------------------------
|
|
||||||
[2021-01-08T16:15:04.682] [INFO] certd - 【更新证书】--------------------------------------- [success]
|
|
||||||
证书申请成功
|
|
||||||
[2021-01-08T16:15:04.682] [INFO] certd - 【流程1-部署到阿里云CDN】---------------------------- [success] 执行成功
|
|
||||||
[2021-01-08T16:15:04.682] [INFO] certd - └【上传到阿里云】-------------------------------- [success] 执行成功
|
|
||||||
[2021-01-08T16:15:04.682] [INFO] certd - └【部署证书到CDN】------------------------------- [success] 执行成功
|
|
||||||
```
|
|
||||||
6. 证书续期
|
|
||||||
实际上没有证书续期的概念,只有重新生成一份新的证书,然后重新部署证书
|
|
||||||
所以每天定时运行即可,当证书过期日前20天时,会重新申请新的证书,然后执行部署任务。
|
|
||||||
|
|
||||||
7. 其他说明
|
|
||||||
证书的部署任务执行后会记录执行结果,已经成功过的不会重复执行
|
|
||||||
所以当你临时需要将证书部署到其他地方时,直接追加部署任务,然后再次运行即可
|
|
||||||
|
|
||||||
## CI/DI集成与自动续期重新部署
|
|
||||||
集成前,将以上导出的node项目提交到内网git仓库,或者私有git仓库(由于包含敏感信息,不要提交到公开git仓库)
|
|
||||||
|
|
||||||
### jenkins任务
|
|
||||||
1. 创建任务
|
|
||||||
选择构建自由风格的任务
|
|
||||||
|
|
||||||
2. 配置git
|
|
||||||
配置cert-run的git地址
|
|
||||||
|
|
||||||
3. 构建触发器
|
|
||||||
配置 `H 3 * * *` ,每天凌晨3点-4点执行一次
|
|
||||||
|
|
||||||
4. 构建环境
|
|
||||||
勾选 `Provide Node & npm bin/ folder to PATH`,提供nodejs运行环境
|
|
||||||
如果没有此选项,需要jenkins安装`nodejs`插件
|
|
||||||
|
|
||||||
5. 构建
|
|
||||||
执行shell
|
|
||||||
```
|
|
||||||
npm install --production #执行过一次之后,就可以注释掉,加快执行速度
|
|
||||||
npm run post
|
|
||||||
```
|
|
||||||
6. 构建后操作
|
|
||||||
邮件通知
|
|
||||||
配置你的邮箱地址,可以在执行失败时收到邮件通知。
|
|
||||||
|
|
||||||
|
|
||||||
## API
|
|
||||||
先列个提纲,待完善
|
|
||||||
|
|
||||||
参数示例参考:https://gitee.com/certd/certd/blob/master/test/options.js
|
|
||||||
|
|
||||||
### 授权提供者
|
|
||||||
用于dns验证接口调用
|
|
||||||
#### aliyun
|
|
||||||
|
|
||||||
#### dnspod
|
|
||||||
|
|
||||||
### deploy插件
|
|
||||||
部署任务插件
|
|
||||||
#### 阿里云
|
|
||||||
##### 上传到阿里云
|
|
||||||
type = uploadCertToAliyun
|
|
||||||
##### 部署到阿里云DNS
|
|
||||||
type = deployCertToAliyunCDN
|
|
||||||
|
|
||||||
##### 部署到阿里云CLB
|
|
||||||
type = deployCertToAliyunCLB
|
|
||||||
|
|
||||||
#### 腾讯云
|
|
||||||
##### 上传到腾讯云
|
|
||||||
type = uploadCertToTencent
|
|
||||||
|
|
||||||
##### 部署到腾讯云DNS
|
|
||||||
type = deployCertToTencentDNS
|
|
||||||
|
|
||||||
##### 部署到腾讯云CLB
|
|
||||||
type = deployCertToTencentCLB
|
|
||||||
|
|
||||||
##### 部署到腾讯云TKE-ingress
|
|
||||||
type = deployCertToTencentTKEIngress
|
|
||||||
|
|
||||||
|
|
||||||
### 更多部署插件
|
|
||||||
等你来提需求
|
|
||||||
|
|||||||
103
deploy.js
@@ -1,58 +1,81 @@
|
|||||||
const http = require("axios")
|
import http from 'axios'
|
||||||
const exec = require('child_process').exec;
|
import fs from 'fs'
|
||||||
|
|
||||||
//builder
|
//读取 packages/core/pipline/package.json的版本号
|
||||||
function execute(cmd){
|
import {default as packageJson} from './packages/core/pipeline/package.json' assert {type: "json"};
|
||||||
return new Promise((resolve,reject)=>{
|
|
||||||
console.log("cmd executing: " + cmd)
|
const certdVersion = packageJson.version
|
||||||
exec(cmd, function(error, stdout, stderr) {
|
console.log("certdVersion", certdVersion)
|
||||||
if(error){
|
|
||||||
console.error(error);
|
// 同步npmmirror的包
|
||||||
console.info(stderr)
|
async function getPackages(directoryPath) {
|
||||||
reject(error)
|
return new Promise((resolve, reject) => {
|
||||||
}
|
// 读取目录下的文件和目录列表
|
||||||
else{
|
fs.readdir(directoryPath, {withFileTypes: true}, (err, files) => {
|
||||||
console.info(stdout)
|
if (err) {
|
||||||
console.log("success");
|
console.log('无法读取目录:', err);
|
||||||
resolve(true)
|
reject(err)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 过滤仅保留目录
|
||||||
|
const directories = files
|
||||||
|
.filter(file => file.isDirectory())
|
||||||
|
.map(directory => directory.name);
|
||||||
|
|
||||||
|
console.log('目录列表:', directories);
|
||||||
|
resolve(directories)
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function build(){
|
async function getAllPackages() {
|
||||||
await execute("cd ./packages/fast-admin/fs-admin-antdv/ && npm run build")
|
const base = await getPackages("./packages/core")
|
||||||
await execute("cd ./packages/fast-admin/fs-admin-element/ && npm run build")
|
const plugins = await getPackages("./packages/plugins")
|
||||||
await execute("cd ./packages/fast-admin/fs-admin-naive-ui/ && npm run build")
|
|
||||||
await execute("npm run docs:build")
|
return base.concat(plugins)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function sync() {
|
||||||
|
const packages = await getAllPackages()
|
||||||
|
for (const pkg of packages) {
|
||||||
|
await http({
|
||||||
|
url: `http://registry-direct.npmmirror.com/@certd/${pkg}/sync?sync_upstream=true`,
|
||||||
|
method: 'PUT',
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
data: {}
|
||||||
|
})
|
||||||
|
console.log(`sync success:${pkg}`)
|
||||||
|
await sleep(10000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// curl -X PUT https://registry-direct.npmmirror.com/@certd/plugin-cert/sync?sync_upstream=true
|
||||||
|
|
||||||
// trigger
|
const certdImageBuild = "http://flow-openapi.aliyun.com/pipeline/webhook/4zgFk3i4RZEMGuQzlOcI"
|
||||||
|
const webhooks = [certdImageBuild]
|
||||||
|
|
||||||
const naive = "http://flow-openapi.aliyun.com/pipeline/webhook/Zm3TJyDtyFZgV4dtJiD1"
|
async function sleep(time) {
|
||||||
const doc = "http://flow-openapi.aliyun.com/pipeline/webhook/soOYdQ5sF3kLjTPJGmIO"
|
|
||||||
const antdv = "http://flow-openapi.aliyun.com/pipeline/webhook/HiL0uVYxfUnBzIMJZVXB"
|
|
||||||
const element = "http://flow-openapi.aliyun.com/pipeline/webhook/uFTI0XJ9RgqnofX7jpRD"
|
|
||||||
|
|
||||||
const webhooks = [doc,naive,antdv,element]
|
|
||||||
|
|
||||||
async function sleep(time){
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
setTimeout(resolve,time)
|
setTimeout(resolve, time)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function trigger(){
|
async function triggerBuild() {
|
||||||
|
await sleep(60000)
|
||||||
for (const webhook of webhooks) {
|
for (const webhook of webhooks) {
|
||||||
await http({
|
await http({
|
||||||
url:webhook,
|
url: webhook,
|
||||||
method:'POST',
|
method: 'POST',
|
||||||
headers:{
|
headers: {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
data:{}
|
data: {
|
||||||
|
'CERTD_VERSION': certdVersion
|
||||||
|
}
|
||||||
})
|
})
|
||||||
console.log(`webhook success:${webhook}`)
|
console.log(`webhook success:${webhook}`)
|
||||||
await sleep(1000)
|
await sleep(1000)
|
||||||
@@ -60,11 +83,13 @@ async function trigger(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function start(){
|
async function start() {
|
||||||
// await build()
|
// await build()
|
||||||
console.log("等待60秒")
|
console.log("等待60秒")
|
||||||
await sleep(60*1000)
|
await sleep(60 * 1000)
|
||||||
await trigger()
|
await sync()
|
||||||
|
await sleep(60 * 1000)
|
||||||
|
await triggerBuild()
|
||||||
}
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
|
|||||||
BIN
doc/images/1-add.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
doc/images/10-1-log.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
doc/images/11-1-error.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
doc/images/11-2-error.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
doc/images/12-1-log-success.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
doc/images/12-2-skip-log.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
doc/images/13-1-result.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
doc/images/13-2-result.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
doc/images/13-3-download.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
doc/images/14-timer.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
doc/images/15-1-email.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
doc/images/15-2-email.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
doc/images/2-access-provider.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
doc/images/3-add-access.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
doc/images/4-add-success.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
doc/images/5-view.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
doc/images/6-1-add-task.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
doc/images/6-2-add-task.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
doc/images/6-3-add-task.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
doc/images/7-1-add-host-task.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
doc/images/7-2-add-host-task.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
doc/images/7-3-add-host-task.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
doc/images/8-1-add-host-task.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
doc/images/8-2-add-host-task.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
doc/images/8-4-add-host-task.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
doc/images/8-5-add-host-task.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
doc/images/9-start.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
doc/images/donate.png
Normal file
|
After Width: | Height: | Size: 169 KiB |
BIN
doc/images/me.png
Normal file
|
After Width: | Height: | Size: 374 KiB |
BIN
doc/step1.png
|
Before Width: | Height: | Size: 12 KiB |
BIN
doc/step2.png
|
Before Width: | Height: | Size: 44 KiB |
BIN
doc/step3.png
|
Before Width: | Height: | Size: 92 KiB |
BIN
doc/tasks.png
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,9 +1,18 @@
|
|||||||
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:16-alpine
|
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:16-alpine
|
||||||
RUN npm install -g pnpm && npm install -g cross-env
|
EXPOSE 7001
|
||||||
ADD ./workspace/certd-server/ /app/
|
ENV NODE_ENV production
|
||||||
|
ENV MIDWAY_SERVER_ENV production
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
RUN pnpm install -P
|
#RUN npm install cross-env -g --registry=https://registry.npmmirror.com
|
||||||
CMD ["npm","run","start"]
|
#RUN npm install pm2 -g --registry=https://registry.npmmirror.com
|
||||||
|
#RUN pm2 install pm2-logrotate
|
||||||
|
ADD ./workspace/certd-server/ /app/
|
||||||
|
RUN yarn install --production --registry=https://registry.npmmirror.com
|
||||||
|
#RUN yarn install --production
|
||||||
|
RUN npm run build
|
||||||
|
#CMD ["pm2-runtime", "start", "./bootstrap.js","--name", "certd","-i","1"]
|
||||||
|
CMD ["npm", "run","start"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
9
docker/image/build.sh
Normal file → Executable file
@@ -1,16 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
echo "请先输入一个版本号:"
|
echo "请先输入一个版本号:"
|
||||||
read version
|
read version
|
||||||
|
|
||||||
echo "您输入的版本号是: $version"
|
echo "您输入的版本号是: $version"
|
||||||
echo "登录aliyun镜像仓库"
|
echo "登录aliyun镜像仓库"
|
||||||
docker login --username=252959493@qq.com registry.cn-shenzhen.aliyuncs.com
|
sudo docker login --username=252959493@qq.com registry.cn-shenzhen.aliyuncs.com
|
||||||
|
|
||||||
build=$(pwd)
|
build=$(pwd)
|
||||||
cd ../../
|
cd ../../
|
||||||
root=$(pwd)
|
root=$(pwd)
|
||||||
echo "安装依赖"
|
echo "安装依赖"
|
||||||
|
#pnpm install --registry=https://registry.npmmirror.com
|
||||||
pnpm install
|
pnpm install
|
||||||
|
|
||||||
echo "client build"
|
echo "client build"
|
||||||
@@ -31,4 +32,6 @@ mkdir -p $build/workspace/certd-server
|
|||||||
\cp ./* $build/workspace/certd-server -rf
|
\cp ./* $build/workspace/certd-server -rf
|
||||||
\cp ../certd-client/dist/* $build/workspace/certd-server/public/ -rf
|
\cp ../certd-client/dist/* $build/workspace/certd-server/public/ -rf
|
||||||
|
|
||||||
|
#export TAG=$version
|
||||||
|
#sudo -E docker compose build
|
||||||
|
#sudo -E docker compose push
|
||||||
|
|||||||
@@ -11,4 +11,5 @@ services: # 要拉起的服务们
|
|||||||
- "7001:7001"
|
- "7001:7001"
|
||||||
environment:
|
environment:
|
||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
|
- node_sqlite3_binary_host_mirror=https://registry.npmmirror.com/-/binary/sqlite3
|
||||||
|
|
||||||
|
|||||||
9
docker/run/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
|
||||||
|
EXPOSE 7001
|
||||||
|
RUN npm run build
|
||||||
|
#RUN npm install pm2 -g --registry=https://registry.npmmirror.com
|
||||||
|
#CMD ["pm2-runtime", "start", "./bootstrap.js","--name", "certd","-i","1","--", "-p", "7001"]
|
||||||
|
CMD ["npm","run", "start"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
13
docker/run/build.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
# 判断$CERTD_VERSION 是否存在
|
||||||
|
if [ -n "$CERTD_VERSION" ]; then
|
||||||
|
echo "CERTD_VERSION is set = $CERTD_VERSION"
|
||||||
|
else
|
||||||
|
echo "CERTD_VERSION is not set"
|
||||||
|
echo "请先输入一个版本号(如 1.0.6):"
|
||||||
|
read CERTD_VERSION
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "您输入的版本号是: $CERTD_VERSION"
|
||||||
|
sudo -E docker compose up -d
|
||||||
@@ -1,15 +1,23 @@
|
|||||||
version: '3.3' # 指定docker-compose 版本
|
version: '3.3'
|
||||||
services: # 要拉起的服务们
|
services:
|
||||||
certd:
|
certd:
|
||||||
image: registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
|
# 镜像 # ↓↓↓↓↓ --- 1、 修改镜像版本号,或者干脆写成latest
|
||||||
|
image: registry.cn-shenzhen.aliyuncs.com/handsfree/certd:${CERTD_VERSION}
|
||||||
container_name: certd # 容器名
|
container_name: certd # 容器名
|
||||||
restart: unless-stopped # 重启
|
restart: unless-stopped # 重启
|
||||||
volumes: # 挂载目录
|
volumes:
|
||||||
|
# ↓↓↓↓↓ ------------------------------------------------------- 2、 修改数据库以及证书存储路径
|
||||||
- /data/certd:/app/data
|
- /data/certd:/app/data
|
||||||
ports: # 端口映射
|
ports: # 端口映射
|
||||||
- "7001:7001"
|
- "7001:7001"
|
||||||
environment:
|
environment: # 环境变量
|
||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
- CERTD_AUTH_JWT_KEY=changeme
|
- certd_auth_jwt_secret=changeme
|
||||||
#注意修改成你的自定义密钥 ↑↑↑↑↑
|
# ↑↑↑↑↑ ---------------------------------- 3、 修改成你的自定义密钥
|
||||||
|
# 设置环境变量即可自定义certd配置
|
||||||
|
# 服务端配置项见: packages/ui/certd-server/src/config/config.default.ts
|
||||||
|
# 服务端配置规则: certd_ + 配置项, 点号用_代替
|
||||||
|
# 如jwt密钥配置为: auth.jwt.secret,则设置环境变量 certd_auth_jwt_secret=changeme
|
||||||
|
|
||||||
|
# 客户端配置项见: packages/ui/certd-client/.env
|
||||||
|
# 按实际名称配置环境变量即可,如: VITE_APP_API=http://localhost:7001
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmClient": "pnpm",
|
"npmClient": "pnpm",
|
||||||
"version": "1.0.5"
|
"version": "1.20.2"
|
||||||
}
|
}
|
||||||
|
|||||||
15
package.json
@@ -4,21 +4,24 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lerna-lite/cli": "^2.4.0",
|
"@lerna-lite/cli": "^3.2.1",
|
||||||
"@lerna-lite/run": "^2.4.0",
|
"@lerna-lite/publish": "^3.2.1",
|
||||||
"@lerna-lite/publish": "^2.4.0"
|
"@lerna-lite/run": "^3.2.1",
|
||||||
|
"@lerna-lite/version": "^3.2.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "lerna bootstrap --hoist",
|
"start": "lerna bootstrap --hoist",
|
||||||
"i-all": "lerna link && lerna exec npm install ",
|
"i-all": "lerna link && lerna exec npm install ",
|
||||||
"publish": "npm run proxy && npm run prepublishOnly1 && lerna publish --conventional-commits && npm run afterpublishOnly",
|
"publish": "npm run proxy && npm run prepublishOnly1 && lerna publish --conventional-commits && npm run afterpublishOnly && npm run deploy1",
|
||||||
"afterpublishOnly": "",
|
"afterpublishOnly": "",
|
||||||
"proxy": "npm config set proxy=http://127.0.0.1:10809",
|
"proxy": "npm config set proxy=http://127.0.0.1:10809",
|
||||||
"prepublishOnly1": "npm run before-build && lerna run build ",
|
"prepublishOnly1": "npm run before-build && lerna run build ",
|
||||||
"before-build": "cd ./packages/core/acme-client && time /t >build.md && git add ./build.md && git commit -m \"build: prepare to build\""
|
"before-build": "cd ./packages/core/acme-client && time /t >build.md && git add ./build.md && git commit -m \"build: prepare to build\"",
|
||||||
|
"deploy1": "node deploy.js"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"axios": "^1.4.0",
|
||||||
"lodash": "^4.17.21"
|
"lodash": "^4.17.21"
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
|||||||
@@ -3,6 +3,52 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/publishlab/node-acme-client/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/publishlab/node-acme-client/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/publishlab/node-acme-client/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/publishlab/node-acme-client/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/publishlab/node-acme-client/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/publishlab/node-acme-client/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/publishlab/node-acme-client/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/publishlab/node-acme-client/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/publishlab/node-acme-client/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/publishlab/node-acme-client/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/publishlab/node-acme-client/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
## [1.0.5](https://github.com/publishlab/node-acme-client/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/publishlab/node-acme-client/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/acme-client
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
22:57
|
11:14
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"description": "Simple and unopinionated ACME client",
|
"description": "Simple and unopinionated ACME client",
|
||||||
"private": false,
|
"private": false,
|
||||||
"author": "nmorsman",
|
"author": "nmorsman",
|
||||||
"version": "1.0.5",
|
"version": "1.20.2",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"types": "types",
|
"types": "types",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -58,5 +58,5 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||||
},
|
},
|
||||||
"gitHead": "5950e1cae7cf30ebfc5128c15c7d1b0d101cbbb8"
|
"gitHead": "b258e926209fef4cc4d633b0383eb54e26c516f9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,68 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复上传证书到腾讯云失败的bug ([e950322](https://github.com/certd/certd/commit/e950322232e19d1263b8552eefa5b0150fd7864e))
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* cancel task ([bc65c0a](https://github.com/certd/certd/commit/bc65c0a786360c087fe95cad93ec6a87804cc5ee))
|
||||||
|
* flush log ([891a43a](https://github.com/certd/certd/commit/891a43ae6716ff98ed06643f7da2e35199ee195c))
|
||||||
|
* flush logger ([91be682](https://github.com/certd/certd/commit/91be6826b902e0f302b1a6cbdb1d24e15914c18d))
|
||||||
|
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复access选择类型trigger ([2851a33](https://github.com/certd/certd/commit/2851a33eb2510f038fadb55da29512597a4ba512))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 邮件通知 ([937e3fa](https://github.com/certd/certd/commit/937e3fac19cd03b8aa91db8ba03fda7fcfbacea2))
|
||||||
|
* cert download ([5a51c14](https://github.com/certd/certd/commit/5a51c14de521cb8075a80d2ae41a16e6d5281259))
|
||||||
|
* save files ([99522fb](https://github.com/certd/certd/commit/99522fb49adb42c1dfdf7bec3dd52d641158285b))
|
||||||
|
* save files ([671d273](https://github.com/certd/certd/commit/671d273e2f9136d16896536b0ca127cf372f1619))
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/pipeline
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/pipeline",
|
"name": "@certd/pipeline",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.0.5",
|
"version": "1.20.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/pipeline.mjs",
|
"module": "./dist/bundle.mjs",
|
||||||
"types": "./dist/d/index.d.ts"
|
"types": "./dist/d/index.d.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -19,10 +19,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"node-forge": "^1.3.1",
|
"node-forge": "^1.3.1",
|
||||||
|
"nodemailer": "^6.9.3",
|
||||||
"qs": "^6.11.2"
|
"qs": "^6.11.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/acme-client": "^1.0.5",
|
"@certd/acme-client": "^1.20.2",
|
||||||
"@rollup/plugin-commonjs": "^23.0.4",
|
"@rollup/plugin-commonjs": "^23.0.4",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
"@types/lodash": "^4.14.194",
|
"@types/lodash": "^4.14.194",
|
||||||
"@types/mocha": "^10.0.1",
|
"@types/mocha": "^10.0.1",
|
||||||
"@types/node-forge": "^1.3.2",
|
"@types/node-forge": "^1.3.2",
|
||||||
|
"@types/uuid": "^9.0.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
||||||
"@typescript-eslint/parser": "^5.59.7",
|
"@typescript-eslint/parser": "^5.59.7",
|
||||||
"chai": "^4.3.7",
|
"chai": "^4.3.7",
|
||||||
@@ -54,5 +56,5 @@
|
|||||||
"vite": "^4.3.8",
|
"vite": "^4.3.8",
|
||||||
"vue-tsc": "^1.6.5"
|
"vue-tsc": "^1.6.5"
|
||||||
},
|
},
|
||||||
"gitHead": "5950e1cae7cf30ebfc5128c15c7d1b0d101cbbb8"
|
"gitHead": "b258e926209fef4cc4d633b0383eb54e26c516f9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ConcurrencyStrategy, Pipeline, ResultType, Runnable, RunStrategy, Stage, Step, Task } from "../d.ts";
|
import { ConcurrencyStrategy, NotificationWhen, Pipeline, ResultType, Runnable, RunStrategy, Stage, Step, Task } from "../d.ts";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { RunHistory, RunnableCollection } from "./run-history";
|
import { RunHistory, RunnableCollection } from "./run-history";
|
||||||
import { AbstractTaskPlugin, PluginDefine, pluginRegistry } from "../plugin";
|
import { AbstractTaskPlugin, PluginDefine, pluginRegistry, TaskInstanceContext } from "../plugin";
|
||||||
import { ContextFactory, IContext } from "./context";
|
import { ContextFactory, IContext } from "./context";
|
||||||
import { IStorage } from "./storage";
|
import { IStorage } from "./storage";
|
||||||
import { logger } from "../utils/util.log";
|
import { logger } from "../utils/util.log";
|
||||||
@@ -10,31 +10,37 @@ import { request } from "../utils/util.request";
|
|||||||
import { IAccessService } from "../access";
|
import { IAccessService } from "../access";
|
||||||
import { RegistryItem } from "../registry";
|
import { RegistryItem } from "../registry";
|
||||||
import { Decorator } from "../decorator";
|
import { Decorator } from "../decorator";
|
||||||
|
import { IEmailService } from "../service";
|
||||||
|
import { FileStore } from "./file-store";
|
||||||
|
import { TimeoutPromise } from "../utils/util.promise";
|
||||||
|
|
||||||
export class Executor {
|
export type ExecutorOptions = {
|
||||||
userId: any;
|
userId: any;
|
||||||
pipeline: Pipeline;
|
pipeline: Pipeline;
|
||||||
runtime!: RunHistory;
|
storage: IStorage;
|
||||||
|
onChanged: (history: RunHistory) => Promise<void>;
|
||||||
accessService: IAccessService;
|
accessService: IAccessService;
|
||||||
|
emailService: IEmailService;
|
||||||
|
fileRootDir?: string;
|
||||||
|
};
|
||||||
|
export class Executor {
|
||||||
|
pipeline: Pipeline;
|
||||||
|
runtime!: RunHistory;
|
||||||
contextFactory: ContextFactory;
|
contextFactory: ContextFactory;
|
||||||
logger: Logger;
|
logger: Logger;
|
||||||
pipelineContext!: IContext;
|
pipelineContext!: IContext;
|
||||||
lastStatusMap!: RunnableCollection;
|
lastStatusMap!: RunnableCollection;
|
||||||
|
lastRuntime!: RunHistory;
|
||||||
|
options: ExecutorOptions;
|
||||||
|
canceled = false;
|
||||||
onChanged: (history: RunHistory) => void;
|
onChanged: (history: RunHistory) => void;
|
||||||
constructor(options: {
|
constructor(options: ExecutorOptions) {
|
||||||
userId: any;
|
this.options = options;
|
||||||
pipeline: Pipeline;
|
|
||||||
storage: IStorage;
|
|
||||||
onChanged: (history: RunHistory) => Promise<void>;
|
|
||||||
accessService: IAccessService;
|
|
||||||
}) {
|
|
||||||
this.pipeline = _.cloneDeep(options.pipeline);
|
this.pipeline = _.cloneDeep(options.pipeline);
|
||||||
this.onChanged = async (history: RunHistory) => {
|
this.onChanged = async (history: RunHistory) => {
|
||||||
await options.onChanged(history);
|
await options.onChanged(history);
|
||||||
};
|
};
|
||||||
this.accessService = options.accessService;
|
this.pipeline.userId = options.userId;
|
||||||
this.userId = options.userId;
|
|
||||||
this.pipeline.userId = this.userId;
|
|
||||||
this.contextFactory = new ContextFactory(options.storage);
|
this.contextFactory = new ContextFactory(options.storage);
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.pipelineContext = this.contextFactory.getContext("pipeline", this.pipeline.id);
|
this.pipelineContext = this.contextFactory.getContext("pipeline", this.pipeline.id);
|
||||||
@@ -42,9 +48,16 @@ export class Executor {
|
|||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
const lastRuntime = await this.pipelineContext.getObj(`lastRuntime`);
|
const lastRuntime = await this.pipelineContext.getObj(`lastRuntime`);
|
||||||
|
this.lastRuntime = lastRuntime;
|
||||||
this.lastStatusMap = new RunnableCollection(lastRuntime?.pipeline);
|
this.lastStatusMap = new RunnableCollection(lastRuntime?.pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async cancel() {
|
||||||
|
this.canceled = true;
|
||||||
|
this.runtime?.cancel(this.pipeline);
|
||||||
|
await this.onChanged(this.runtime);
|
||||||
|
}
|
||||||
|
|
||||||
async run(runtimeId: any = 0, triggerType: string) {
|
async run(runtimeId: any = 0, triggerType: string) {
|
||||||
try {
|
try {
|
||||||
await this.init();
|
await this.init();
|
||||||
@@ -52,10 +65,16 @@ export class Executor {
|
|||||||
// 读取last
|
// 读取last
|
||||||
this.runtime = new RunHistory(runtimeId, trigger, this.pipeline);
|
this.runtime = new RunHistory(runtimeId, trigger, this.pipeline);
|
||||||
this.logger.info(`pipeline.${this.pipeline.id} start`);
|
this.logger.info(`pipeline.${this.pipeline.id} start`);
|
||||||
|
await this.notification("start");
|
||||||
await this.runWithHistory(this.pipeline, "pipeline", async () => {
|
await this.runWithHistory(this.pipeline, "pipeline", async () => {
|
||||||
await this.runStages(this.pipeline);
|
await this.runStages(this.pipeline);
|
||||||
});
|
});
|
||||||
|
if (this.lastRuntime && this.lastRuntime.pipeline.status?.status === ResultType.error) {
|
||||||
|
await this.notification("turnToSuccess");
|
||||||
|
}
|
||||||
|
await this.notification("success");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
await this.notification("error", e);
|
||||||
this.logger.error("pipeline 执行失败", e);
|
this.logger.error("pipeline 执行失败", e);
|
||||||
} finally {
|
} finally {
|
||||||
await this.pipelineContext.setObj("lastRuntime", this.runtime);
|
await this.pipelineContext.setObj("lastRuntime", this.runtime);
|
||||||
@@ -88,17 +107,24 @@ export class Executor {
|
|||||||
return ResultType.skip;
|
return ResultType.skip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
const intervalFlushLogId = setInterval(async () => {
|
||||||
await run();
|
|
||||||
this.runtime.success(runnable);
|
|
||||||
await this.onChanged(this.runtime);
|
await this.onChanged(this.runtime);
|
||||||
|
}, 5000);
|
||||||
|
const timeout = runnable.timeout ?? 20 * 60 * 1000;
|
||||||
|
try {
|
||||||
|
if (this.canceled) {
|
||||||
|
throw new Error("task canceled");
|
||||||
|
}
|
||||||
|
await TimeoutPromise(run, timeout);
|
||||||
|
this.runtime.success(runnable);
|
||||||
return ResultType.success;
|
return ResultType.success;
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
this.runtime.error(runnable, e);
|
this.runtime.error(runnable, e);
|
||||||
await this.onChanged(this.runtime);
|
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
this.runtime.finally(runnable);
|
this.runtime.finally(runnable);
|
||||||
|
clearInterval(intervalFlushLogId);
|
||||||
|
await this.onChanged(this.runtime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,6 +189,8 @@ export class Executor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async runStep(step: Step) {
|
private async runStep(step: Step) {
|
||||||
|
const currentLogger = this.runtime._loggers[step.id];
|
||||||
|
|
||||||
const lastStatus = this.lastStatusMap.get(step.id);
|
const lastStatus = this.lastStatusMap.get(step.id);
|
||||||
//执行任务
|
//执行任务
|
||||||
const plugin: RegistryItem<AbstractTaskPlugin> = pluginRegistry.get(step.type);
|
const plugin: RegistryItem<AbstractTaskPlugin> = pluginRegistry.get(step.type);
|
||||||
@@ -176,32 +204,83 @@ export class Executor {
|
|||||||
if (item.component?.name === "pi-output-selector") {
|
if (item.component?.name === "pi-output-selector") {
|
||||||
const contextKey = step.input[key];
|
const contextKey = step.input[key];
|
||||||
if (contextKey != null) {
|
if (contextKey != null) {
|
||||||
step.input[key] = this.runtime.context[contextKey];
|
const value = this.runtime.context[contextKey];
|
||||||
|
if (value == null) {
|
||||||
|
currentLogger.warn(`[step init] input ${define.title} is null`);
|
||||||
|
}
|
||||||
|
step.input[key] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const context: any = {
|
const taskCtx: TaskInstanceContext = {
|
||||||
logger: this.runtime._loggers[step.id],
|
pipeline: this.pipeline,
|
||||||
accessService: this.accessService,
|
step,
|
||||||
pipelineContext: this.pipelineContext,
|
|
||||||
lastStatus,
|
lastStatus,
|
||||||
userContext: this.contextFactory.getContext("user", this.userId),
|
|
||||||
http: request,
|
http: request,
|
||||||
|
logger: currentLogger,
|
||||||
|
accessService: this.options.accessService,
|
||||||
|
emailService: this.options.emailService,
|
||||||
|
pipelineContext: this.pipelineContext,
|
||||||
|
userContext: this.contextFactory.getContext("user", this.options.userId),
|
||||||
|
fileStore: new FileStore({
|
||||||
|
scope: this.pipeline.id,
|
||||||
|
parent: this.runtime.id,
|
||||||
|
rootDir: this.options.fileRootDir,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
Decorator.inject(define.autowire, instance, context);
|
instance.setCtx(taskCtx);
|
||||||
|
|
||||||
await instance.onInstance();
|
await instance.onInstance();
|
||||||
await instance.execute();
|
await instance.execute();
|
||||||
|
|
||||||
if (instance.result.clearLastStatus) {
|
if (instance._result.clearLastStatus) {
|
||||||
this.lastStatusMap.clear();
|
this.lastStatusMap.clear();
|
||||||
}
|
}
|
||||||
//输出到output context
|
//输出到output context
|
||||||
_.forEach(define.output, (item, key) => {
|
_.forEach(define.output, (item, key) => {
|
||||||
step!.status!.output[key] = instance[key];
|
step.status!.output[key] = instance[key];
|
||||||
const stepOutputKey = `step.${step.id}.${key}`;
|
const stepOutputKey = `step.${step.id}.${key}`;
|
||||||
this.runtime.context[stepOutputKey] = instance[key];
|
this.runtime.context[stepOutputKey] = instance[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
step.status!.files = instance.getFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
async notification(when: NotificationWhen, error?: any) {
|
||||||
|
if (!this.pipeline.notifications) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let subject = "";
|
||||||
|
let content = "";
|
||||||
|
if (when === "start") {
|
||||||
|
subject = `【CertD】开始执行,${this.pipeline.title}, buildId:${this.runtime.id}`;
|
||||||
|
content = subject;
|
||||||
|
} else if (when === "success") {
|
||||||
|
subject = `【CertD】执行成功,${this.pipeline.title}, buildId:${this.runtime.id}`;
|
||||||
|
content = subject;
|
||||||
|
} else if (when === "turnToSuccess") {
|
||||||
|
subject = `【CertD】执行成功(错误转成功),${this.pipeline.title}, buildId:${this.runtime.id}`;
|
||||||
|
content = subject;
|
||||||
|
} else if (when === "error") {
|
||||||
|
subject = `【CertD】执行失败,${this.pipeline.title}, buildId:${this.runtime.id}`;
|
||||||
|
content = `<pre>${error.message}</pre>`;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const notification of this.pipeline.notifications) {
|
||||||
|
if (!notification.when.includes(when)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (notification.type === "email") {
|
||||||
|
this.options.emailService?.send({
|
||||||
|
userId: this.pipeline.userId,
|
||||||
|
subject,
|
||||||
|
content,
|
||||||
|
receivers: notification.options.receivers,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
50
packages/core/pipeline/src/core/file-store.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { fileUtils } from "../utils/util.file";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import path from "path";
|
||||||
|
import fs from "fs";
|
||||||
|
|
||||||
|
export type FileStoreOptions = {
|
||||||
|
rootDir?: string;
|
||||||
|
scope: string;
|
||||||
|
parent: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export class FileStore {
|
||||||
|
rootDir: string;
|
||||||
|
scope: string;
|
||||||
|
parent: string;
|
||||||
|
constructor(options?: FileStoreOptions) {
|
||||||
|
this.rootDir = fileUtils.getFileRootDir(options?.rootDir);
|
||||||
|
this.scope = options?.scope || "0";
|
||||||
|
this.parent = options?.parent || "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
readFile(filePath: string) {
|
||||||
|
if (!fs.existsSync(filePath)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return fs.readFileSync(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
writeFile(filename: string, file: Buffer) {
|
||||||
|
const localPath = this.buildFilePath(filename);
|
||||||
|
|
||||||
|
fs.writeFileSync(localPath, file);
|
||||||
|
return localPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
private buildFilePath(filename: string) {
|
||||||
|
const parentDir = path.join(this.rootDir, this.scope + "", this.parent + "", dayjs().format("YYYY-MM-DD"));
|
||||||
|
if (!fs.existsSync(parentDir)) {
|
||||||
|
fs.mkdirSync(parentDir, { recursive: true });
|
||||||
|
}
|
||||||
|
return path.join(parentDir, filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteByParent(scope: string, parent: string) {
|
||||||
|
const dir = path.join(this.rootDir, scope, parent);
|
||||||
|
if (fs.existsSync(dir)) {
|
||||||
|
fs.unlinkSync(dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,3 +2,4 @@ export * from "./executor";
|
|||||||
export * from "./run-history";
|
export * from "./run-history";
|
||||||
export * from "./context";
|
export * from "./context";
|
||||||
export * from "./storage";
|
export * from "./storage";
|
||||||
|
export * from "./file-store";
|
||||||
|
|||||||
@@ -92,6 +92,19 @@ export class RunHistory {
|
|||||||
this.logError(runnable, e);
|
this.logError(runnable, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cancel(runnable: Runnable) {
|
||||||
|
const now = new Date().getTime();
|
||||||
|
const status = runnable.status;
|
||||||
|
_.merge(status, {
|
||||||
|
status: ResultType.canceled,
|
||||||
|
endTime: now,
|
||||||
|
result: ResultType.canceled,
|
||||||
|
message: "用户取消",
|
||||||
|
});
|
||||||
|
|
||||||
|
this.log(runnable, "任务取消");
|
||||||
|
}
|
||||||
|
|
||||||
log(runnable: Runnable, text: string) {
|
log(runnable: Runnable, text: string) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this._loggers[runnable.id].info(`[${runnable.title}]<id:${runnable.id}> [${runnable.runnableType}]`, text);
|
this._loggers[runnable.id].info(`[${runnable.title}]<id:${runnable.id}> [${runnable.runnableType}]`, text);
|
||||||
@@ -119,25 +132,25 @@ export class RunnableCollection {
|
|||||||
this.collection = map;
|
this.collection = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
private each<T extends Runnable>(list: T[], exec: (item: Runnable) => void) {
|
static each<T extends Runnable>(list: T[], exec: (item: Runnable) => void) {
|
||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
exec(item);
|
exec(item);
|
||||||
if (item.runnableType === "pipeline") {
|
if (item.runnableType === "pipeline") {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.each<Stage>(item.stages, exec);
|
RunnableCollection.each<Stage>(item.stages, exec);
|
||||||
} else if (item.runnableType === "stage") {
|
} else if (item.runnableType === "stage") {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.each<Task>(item.tasks, exec);
|
RunnableCollection.each<Task>(item.tasks, exec);
|
||||||
} else if (item.runnableType === "task") {
|
} else if (item.runnableType === "task") {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.each<Step>(item.steps, exec);
|
RunnableCollection.each<Step>(item.steps, exec);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
private toMap(pipeline: Pipeline) {
|
public toMap(pipeline: Pipeline) {
|
||||||
const map: RunnableMap = {};
|
const map: RunnableMap = {};
|
||||||
|
|
||||||
this.each(pipeline.stages, (item) => {
|
RunnableCollection.each(pipeline.stages, (item) => {
|
||||||
map[item.id] = item;
|
map[item.id] = item;
|
||||||
});
|
});
|
||||||
return map;
|
return map;
|
||||||
@@ -151,7 +164,7 @@ export class RunnableCollection {
|
|||||||
if (!this.pipeline) {
|
if (!this.pipeline) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.each(this.pipeline.stages, (item) => {
|
RunnableCollection.each(this.pipeline.stages, (item) => {
|
||||||
item.status = undefined;
|
item.status = undefined;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import { fileUtils } from "../utils/util.file";
|
||||||
|
|
||||||
|
|
||||||
export interface IStorage {
|
export interface IStorage {
|
||||||
get(scope: string, namespace: string, version: string, key: string): Promise<string | null>;
|
get(scope: string, namespace: string, version: string, key: string): Promise<string | null>;
|
||||||
@@ -12,15 +11,7 @@ export interface IStorage {
|
|||||||
export class FileStorage implements IStorage {
|
export class FileStorage implements IStorage {
|
||||||
root: string;
|
root: string;
|
||||||
constructor(rootDir?: string) {
|
constructor(rootDir?: string) {
|
||||||
if (rootDir == null) {
|
this.root = fileUtils.getFileRootDir(rootDir);
|
||||||
const userHome = process.env.HOME || process.env.USERPROFILE;
|
|
||||||
rootDir = userHome + "/.certd/storage/";
|
|
||||||
}
|
|
||||||
this.root = rootDir;
|
|
||||||
|
|
||||||
if (!fs.existsSync(this.root)) {
|
|
||||||
fs.mkdirSync(this.root, { recursive: true });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async remove(scope: string, namespace: string, version: string, key: string): Promise<void> {
|
async remove(scope: string, namespace: string, version: string, key: string): Promise<void> {
|
||||||
|
|||||||
@@ -55,22 +55,40 @@ export type Trigger = {
|
|||||||
type: string;
|
type: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type FileItem = {
|
||||||
|
id: string;
|
||||||
|
filename: string;
|
||||||
|
path: string;
|
||||||
|
};
|
||||||
export type Runnable = {
|
export type Runnable = {
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
strategy?: RunnableStrategy;
|
strategy?: RunnableStrategy;
|
||||||
runnableType?: string; // pipeline, stage, task , step
|
runnableType?: string; // pipeline, stage, task , step
|
||||||
status?: HistoryResult;
|
status?: HistoryResult;
|
||||||
|
timeout?: number;
|
||||||
default?: {
|
default?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type EmailOptions = {
|
||||||
|
receivers: string[];
|
||||||
|
};
|
||||||
|
export type NotificationWhen = "error" | "success" | "turnToSuccess" | "start";
|
||||||
|
export type NotificationType = "email" | "url";
|
||||||
|
export type Notification = {
|
||||||
|
type: NotificationType;
|
||||||
|
when: NotificationWhen[];
|
||||||
|
options: EmailOptions;
|
||||||
|
};
|
||||||
|
|
||||||
export type Pipeline = Runnable & {
|
export type Pipeline = Runnable & {
|
||||||
version?: number;
|
version?: number;
|
||||||
userId: any;
|
userId: any;
|
||||||
stages: Stage[];
|
stages: Stage[];
|
||||||
triggers: Trigger[];
|
triggers: Trigger[];
|
||||||
|
notifications?: Notification[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Context = {
|
export type Context = {
|
||||||
@@ -88,6 +106,7 @@ export enum ResultType {
|
|||||||
start = "start",
|
start = "start",
|
||||||
success = "success",
|
success = "success",
|
||||||
error = "error",
|
error = "error",
|
||||||
|
canceled = "canceled",
|
||||||
skip = "skip",
|
skip = "skip",
|
||||||
none = "none",
|
none = "none",
|
||||||
}
|
}
|
||||||
@@ -101,6 +120,7 @@ export type HistoryResultGroup = {
|
|||||||
export type HistoryResult = {
|
export type HistoryResult = {
|
||||||
input: any;
|
input: any;
|
||||||
output: any;
|
output: any;
|
||||||
|
files?: FileItem[];
|
||||||
/**
|
/**
|
||||||
* 任务状态
|
* 任务状态
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,3 +7,4 @@ export * from "./plugin";
|
|||||||
export * from "./utils";
|
export * from "./utils";
|
||||||
export * from "./context";
|
export * from "./context";
|
||||||
export * from "./decorator";
|
export * from "./decorator";
|
||||||
|
export * from "./service";
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
import { Registrable } from "../registry";
|
import { Registrable } from "../registry";
|
||||||
import { FormItemProps } from "../d.ts";
|
import { FileItem, FormItemProps, Pipeline, Runnable, Step } from "../d.ts";
|
||||||
|
import { FileStore } from "../core/file-store";
|
||||||
|
import { Logger } from "log4js";
|
||||||
|
import { IAccessService } from "../access";
|
||||||
|
import { IEmailService } from "../service";
|
||||||
|
import { IContext } from "../core";
|
||||||
|
import { AxiosInstance } from "axios";
|
||||||
|
|
||||||
export enum ContextScope {
|
export enum ContextScope {
|
||||||
global,
|
global,
|
||||||
@@ -7,16 +13,11 @@ export enum ContextScope {
|
|||||||
runtime,
|
runtime,
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Storage = {
|
|
||||||
scope: ContextScope;
|
|
||||||
path: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TaskOutputDefine = {
|
export type TaskOutputDefine = {
|
||||||
title: string;
|
title: string;
|
||||||
value?: any;
|
value?: any;
|
||||||
storage?: Storage;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TaskInputDefine = FormItemProps;
|
export type TaskInputDefine = FormItemProps;
|
||||||
|
|
||||||
export type PluginDefine = Registrable & {
|
export type PluginDefine = Registrable & {
|
||||||
@@ -31,6 +32,12 @@ export type PluginDefine = Registrable & {
|
|||||||
autowire?: {
|
autowire?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
reference?: {
|
||||||
|
src: string;
|
||||||
|
dest: string;
|
||||||
|
type: "computed";
|
||||||
|
}[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ITaskPlugin = {
|
export type ITaskPlugin = {
|
||||||
@@ -41,15 +48,66 @@ export type ITaskPlugin = {
|
|||||||
|
|
||||||
export type TaskResult = {
|
export type TaskResult = {
|
||||||
clearLastStatus?: boolean;
|
clearLastStatus?: boolean;
|
||||||
|
files?: FileItem[];
|
||||||
};
|
};
|
||||||
|
export type TaskInstanceContext = {
|
||||||
|
pipeline: Pipeline;
|
||||||
|
step: Step;
|
||||||
|
logger: Logger;
|
||||||
|
accessService: IAccessService;
|
||||||
|
emailService: IEmailService;
|
||||||
|
pipelineContext: IContext;
|
||||||
|
userContext: IContext;
|
||||||
|
http: AxiosInstance;
|
||||||
|
fileStore: FileStore;
|
||||||
|
lastStatus?: Runnable;
|
||||||
|
};
|
||||||
|
|
||||||
export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||||
result: TaskResult = {};
|
_result: TaskResult = { clearLastStatus: false, files: [] };
|
||||||
|
ctx!: TaskInstanceContext;
|
||||||
clearLastStatus() {
|
clearLastStatus() {
|
||||||
this.result.clearLastStatus = true;
|
this._result.clearLastStatus = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFiles() {
|
||||||
|
return this._result.files;
|
||||||
|
}
|
||||||
|
|
||||||
|
setCtx(ctx: TaskInstanceContext) {
|
||||||
|
this.ctx = ctx;
|
||||||
|
}
|
||||||
|
|
||||||
|
randomFileId() {
|
||||||
|
return Math.random().toString(36).substring(2, 9);
|
||||||
|
}
|
||||||
|
linkFile(file: FileItem) {
|
||||||
|
this._result.files!.push({
|
||||||
|
...file,
|
||||||
|
id: this.randomFileId(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
saveFile(filename: string, file: Buffer) {
|
||||||
|
const filePath = this.ctx.fileStore.writeFile(filename, file);
|
||||||
|
this._result.files!.push({
|
||||||
|
id: this.randomFileId(),
|
||||||
|
filename,
|
||||||
|
path: filePath,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
get pipeline() {
|
||||||
|
return this.ctx.pipeline;
|
||||||
|
}
|
||||||
|
|
||||||
|
get step() {
|
||||||
|
return this.ctx.step;
|
||||||
|
}
|
||||||
|
|
||||||
async onInstance(): Promise<void> {
|
async onInstance(): Promise<void> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract execute(): Promise<void>;
|
abstract execute(): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import "reflect-metadata";
|
|||||||
export const PLUGIN_CLASS_KEY = "pipeline:plugin";
|
export const PLUGIN_CLASS_KEY = "pipeline:plugin";
|
||||||
|
|
||||||
export function IsTaskPlugin(define: PluginDefine): ClassDecorator {
|
export function IsTaskPlugin(define: PluginDefine): ClassDecorator {
|
||||||
console.log("IsTaskPlugin");
|
|
||||||
return (target: any) => {
|
return (target: any) => {
|
||||||
target = Decorator.target(target);
|
target = Decorator.target(target);
|
||||||
|
|
||||||
@@ -61,3 +60,11 @@ export function TaskOutput(output?: TaskOutputDefine): PropertyDecorator {
|
|||||||
Reflect.defineMetadata(PLUGIN_OUTPUT_KEY, output, target, propertyKey);
|
Reflect.defineMetadata(PLUGIN_OUTPUT_KEY, output, target, propertyKey);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const PLUGIN_DOWNLOAD_KEY = "pipeline:plugin:download";
|
||||||
|
export function TaskDownload(output?: TaskOutputDefine): PropertyDecorator {
|
||||||
|
return (target, propertyKey) => {
|
||||||
|
target = Decorator.target(target, propertyKey);
|
||||||
|
Reflect.defineMetadata(PLUGIN_DOWNLOAD_KEY, output, target, propertyKey);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
10
packages/core/pipeline/src/service/email.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export type EmailSend = {
|
||||||
|
userId: number;
|
||||||
|
subject: string;
|
||||||
|
content: string;
|
||||||
|
receivers: string[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface IEmailService {
|
||||||
|
send(email: EmailSend): Promise<void>;
|
||||||
|
}
|
||||||
1
packages/core/pipeline/src/service/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from "./email";
|
||||||
16
packages/core/pipeline/src/utils/util.file.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import fs from "fs";
|
||||||
|
function getFileRootDir(rootDir?: string) {
|
||||||
|
if (rootDir == null) {
|
||||||
|
const userHome = process.env.HOME || process.env.USERPROFILE;
|
||||||
|
rootDir = userHome + "/.certd/storage/";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(rootDir)) {
|
||||||
|
fs.mkdirSync(rootDir, { recursive: true });
|
||||||
|
}
|
||||||
|
return rootDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const fileUtils = {
|
||||||
|
getFileRootDir,
|
||||||
|
};
|
||||||
13
packages/core/pipeline/src/utils/util.promise.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
export function TimeoutPromise(callback: () => Promise<void>, ms = 30 * 1000) {
|
||||||
|
let timeout: any;
|
||||||
|
return Promise.race([
|
||||||
|
callback(),
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
reject(new Error(`Task timeout in ${ms} ms`));
|
||||||
|
}, ms);
|
||||||
|
}),
|
||||||
|
]).finally(() => {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -3,6 +3,58 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 临时修复阿里云domainlist接口返回域名列表不全的问题,后续还需要增加翻页查询 ([849c145](https://github.com/certd/certd/commit/849c145926984762bd9dbec87bd91cd047fc0855))
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* save files ([671d273](https://github.com/certd/certd/commit/671d273e2f9136d16896536b0ca127cf372f1619))
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-aliyun
|
**Note:** Version bump only for package @certd/plugin-aliyun
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-aliyun",
|
"name": "@certd/plugin-aliyun",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.0.5",
|
"version": "1.20.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/plugin-aliyun.mjs",
|
"module": "./dist/bundle.mjs",
|
||||||
"types": "./dist/es/plugin-aliyun.d.ts"
|
"types": "./dist/d/index.d.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -23,10 +23,10 @@
|
|||||||
"node-forge": "^0.10.0"
|
"node-forge": "^0.10.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/acme-client": "^1.0.5",
|
"@certd/acme-client": "^1.20.2",
|
||||||
"@certd/pipeline": "^1.0.5",
|
"@certd/pipeline": "^1.20.2",
|
||||||
"@certd/plugin-cert": "^1.0.5",
|
"@certd/plugin-cert": "^1.20.2",
|
||||||
"@certd/plugin-util": "^1.0.5",
|
"@certd/plugin-util": "^1.20.2",
|
||||||
"@midwayjs/core": "^3.0.0",
|
"@midwayjs/core": "^3.0.0",
|
||||||
"@midwayjs/decorator": "^3.0.0",
|
"@midwayjs/decorator": "^3.0.0",
|
||||||
"@rollup/plugin-commonjs": "^23.0.4",
|
"@rollup/plugin-commonjs": "^23.0.4",
|
||||||
@@ -59,5 +59,5 @@
|
|||||||
"vite": "^3.1.0",
|
"vite": "^3.1.0",
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
},
|
},
|
||||||
"gitHead": "5950e1cae7cf30ebfc5128c15c7d1b0d101cbbb8"
|
"gitHead": "b258e926209fef4cc4d633b0383eb54e26c516f9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export class AliyunDnsProvider implements IDnsProvider {
|
|||||||
async getDomainList() {
|
async getDomainList() {
|
||||||
const params = {
|
const params = {
|
||||||
RegionId: "cn-hangzhou",
|
RegionId: "cn-hangzhou",
|
||||||
|
PageSize: 100,
|
||||||
};
|
};
|
||||||
|
|
||||||
const requestOption = {
|
const requestOption = {
|
||||||
@@ -42,14 +43,16 @@ export class AliyunDnsProvider implements IDnsProvider {
|
|||||||
async matchDomain(dnsRecord: string) {
|
async matchDomain(dnsRecord: string) {
|
||||||
const list = await this.getDomainList();
|
const list = await this.getDomainList();
|
||||||
let domain = null;
|
let domain = null;
|
||||||
|
const domainList = [];
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
|
domainList.push(item.DomainName);
|
||||||
if (_.endsWith(dnsRecord, item.DomainName)) {
|
if (_.endsWith(dnsRecord, item.DomainName)) {
|
||||||
domain = item.DomainName;
|
domain = item.DomainName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!domain) {
|
if (!domain) {
|
||||||
throw new Error("can not find Domain ," + dnsRecord);
|
throw new Error(`can not find Domain :${dnsRecord} ,list: ${JSON.stringify(domainList)}`);
|
||||||
}
|
}
|
||||||
return domain;
|
return domain;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput, utils } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput, utils } from "@certd/pipeline";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { ROAClient } from "@alicloud/pop-core";
|
import { ROAClient } from "@alicloud/pop-core";
|
||||||
import { AliyunAccess } from "../../access";
|
import { AliyunAccess } from "../../access";
|
||||||
@@ -103,11 +103,13 @@ export class DeployCertToAliyunAckIngressPlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
accessId!: string;
|
accessId!: string;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
accessService!: IAccessService;
|
accessService!: IAccessService;
|
||||||
@Autowire()
|
|
||||||
logger!: ILogger;
|
logger!: ILogger;
|
||||||
|
|
||||||
|
async onInstance(): Promise<void> {
|
||||||
|
this.accessService = this.ctx.accessService;
|
||||||
|
this.logger = this.ctx.logger;
|
||||||
|
}
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
console.log("开始部署证书到阿里云cdn");
|
console.log("开始部署证书到阿里云cdn");
|
||||||
const { regionId, ingressClass, clusterId, isPrivateIpAddress, cert } = this;
|
const { regionId, ingressClass, clusterId, isPrivateIpAddress, cert } = this;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput } from "@certd/pipeline";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import Core from "@alicloud/pop-core";
|
import Core from "@alicloud/pop-core";
|
||||||
import RPCClient from "@alicloud/pop-core";
|
import RPCClient from "@alicloud/pop-core";
|
||||||
@@ -17,7 +17,7 @@ import { AliyunAccess } from "../../access";
|
|||||||
export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
|
export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: "CDN加速域名",
|
title: "CDN加速域名",
|
||||||
helper: "你在阿里云上配置的CDN加速域名,比如certd.docmirror.cn",
|
helper: "你在阿里云上配置的CDN加速域名,比如:certd.docmirror.cn",
|
||||||
required: true,
|
required: true,
|
||||||
})
|
})
|
||||||
domainName!: string;
|
domainName!: string;
|
||||||
@@ -49,13 +49,13 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
accessId!: string;
|
accessId!: string;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
accessService!: IAccessService;
|
accessService!: IAccessService;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
logger!: ILogger;
|
logger!: ILogger;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
||||||
async onInstance() {}
|
async onInstance() {
|
||||||
|
this.accessService = this.ctx.accessService;
|
||||||
|
this.logger = this.ctx.logger;
|
||||||
|
}
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
console.log("开始部署证书到阿里云cdn");
|
console.log("开始部署证书到阿里云cdn");
|
||||||
const access = (await this.accessService.getById(this.accessId)) as AliyunAccess;
|
const access = (await this.accessService.getById(this.accessId)) as AliyunAccess;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, IAccessService, IsTaskPlugin, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IAccessService, IsTaskPlugin, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline";
|
||||||
import Core from "@alicloud/pop-core";
|
import Core from "@alicloud/pop-core";
|
||||||
import { AliyunAccess } from "../../access";
|
import { AliyunAccess } from "../../access";
|
||||||
import { appendTimeSuffix, checkRet, ZoneOptions } from "../../utils";
|
import { appendTimeSuffix, checkRet, ZoneOptions } from "../../utils";
|
||||||
@@ -59,14 +59,13 @@ export class UploadCertToAliyun extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
aliyunCertId!: string;
|
aliyunCertId!: string;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
accessService!: IAccessService;
|
accessService!: IAccessService;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
logger!: Logger;
|
logger!: Logger;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
async onInstance() {
|
||||||
async onInstance() {}
|
this.accessService = this.ctx.accessService;
|
||||||
|
this.logger = this.ctx.logger;
|
||||||
|
}
|
||||||
|
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
console.log("开始部署证书到阿里云cdn");
|
console.log("开始部署证书到阿里云cdn");
|
||||||
|
|||||||
@@ -3,6 +3,56 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复上传证书到腾讯云失败的bug ([e950322](https://github.com/certd/certd/commit/e950322232e19d1263b8552eefa5b0150fd7864e))
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-all
|
**Note:** Version bump only for package @certd/plugin-all
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-all",
|
"name": "@certd/plugin-all",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.0.5",
|
"version": "1.20.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/plugin-all.mjs",
|
"module": "./dist/bundle.mjs",
|
||||||
"types": "./dist/es/plugin-all.d.ts"
|
"types": "./dist/d/index.d.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -17,12 +17,12 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/pipeline": "^1.0.5",
|
"@certd/pipeline": "^1.20.2",
|
||||||
"@certd/plugin-aliyun": "^1.0.5",
|
"@certd/plugin-aliyun": "^1.20.2",
|
||||||
"@certd/plugin-cert": "^1.0.5",
|
"@certd/plugin-cert": "^1.20.2",
|
||||||
"@certd/plugin-host": "^1.0.5",
|
"@certd/plugin-host": "^1.20.2",
|
||||||
"@certd/plugin-huawei": "^1.0.5",
|
"@certd/plugin-huawei": "^1.20.2",
|
||||||
"@certd/plugin-tencent": "^1.0.5",
|
"@certd/plugin-tencent": "^1.20.2",
|
||||||
"@rollup/plugin-commonjs": "^23.0.4",
|
"@rollup/plugin-commonjs": "^23.0.4",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
@@ -48,5 +48,5 @@
|
|||||||
"vite": "^3.1.0",
|
"vite": "^3.1.0",
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
},
|
},
|
||||||
"gitHead": "5950e1cae7cf30ebfc5128c15c7d1b0d101cbbb8"
|
"gitHead": "b258e926209fef4cc4d633b0383eb54e26c516f9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { IAccessService } from "@certd/pipeline";
|
import { EmailSend, IAccessService, IEmailService } from "@certd/pipeline";
|
||||||
import { AliyunAccess } from "@certd/plugin-aliyun";
|
import { AliyunAccess } from "@certd/plugin-aliyun";
|
||||||
import { aliyunSecret } from "../user.secret";
|
import { aliyunSecret } from "../user.secret";
|
||||||
|
|
||||||
export class AccessServiceTest implements IAccessService {
|
export class AccessServiceTest implements IAccessService {
|
||||||
async getById(id: any): Promise<any> {
|
async getById(id: any): Promise<any> {
|
||||||
return {
|
return {
|
||||||
@@ -8,3 +9,10 @@ export class AccessServiceTest implements IAccessService {
|
|||||||
} as AliyunAccess;
|
} as AliyunAccess;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class EmailServiceTest implements IEmailService {
|
||||||
|
send(email: EmailSend): Promise<void> {
|
||||||
|
console.log("send email", email);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -58,6 +58,17 @@ export const pipeline: Pipeline = {
|
|||||||
runStrategy: RunStrategy.SkipWhenSucceed,
|
runStrategy: RunStrategy.SkipWhenSucceed,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: generateId(),
|
||||||
|
title: "上传证书到腾讯云",
|
||||||
|
type: "EchoPlugin",
|
||||||
|
input: {
|
||||||
|
cert: "cert",
|
||||||
|
},
|
||||||
|
strategy: {
|
||||||
|
runStrategy: RunStrategy.SkipWhenSucceed,
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import "mocha";
|
import "mocha";
|
||||||
import { Executor, FileStorage, RunHistory } from "@certd/pipeline";
|
import { Executor, FileStorage, RunHistory } from "@certd/pipeline";
|
||||||
import { pipeline } from "./pipeline.define";
|
import { pipeline } from "./pipeline.define";
|
||||||
import { AccessServiceTest } from "./access-service-test";
|
import { AccessServiceTest, EmailServiceTest } from "./access-service-test";
|
||||||
import "../../src";
|
import "../../src";
|
||||||
import "../plugin/echo-plugin";
|
import "../plugin/echo-plugin";
|
||||||
|
|
||||||
@@ -13,7 +13,14 @@ describe("pipeline", function () {
|
|||||||
console.log("changed:");
|
console.log("changed:");
|
||||||
}
|
}
|
||||||
|
|
||||||
const executor = new Executor({ userId: "test", pipeline, onChanged, accessService: new AccessServiceTest(), storage: new FileStorage() });
|
const executor = new Executor({
|
||||||
|
userId: "test",
|
||||||
|
pipeline,
|
||||||
|
onChanged,
|
||||||
|
accessService: new AccessServiceTest(),
|
||||||
|
emailService: new EmailServiceTest(),
|
||||||
|
storage: new FileStorage(),
|
||||||
|
});
|
||||||
await executor.run(1, "user");
|
await executor.run(1, "user");
|
||||||
// expect(define.name).eq("EchoPlugin");
|
// expect(define.name).eq("EchoPlugin");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,61 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复access选择类型trigger ([2851a33](https://github.com/certd/certd/commit/2851a33eb2510f038fadb55da29512597a4ba512))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* save files ([99522fb](https://github.com/certd/certd/commit/99522fb49adb42c1dfdf7bec3dd52d641158285b))
|
||||||
|
* save files ([671d273](https://github.com/certd/certd/commit/671d273e2f9136d16896536b0ca127cf372f1619))
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-cert
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-cert",
|
"name": "@certd/plugin-cert",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.0.5",
|
"version": "1.20.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/plugin-cert.mjs",
|
"module": "./dist/bundle.mjs",
|
||||||
"types": "./dist/es/plugin-cert.d.ts"
|
"types": "./dist/d/index.d.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -17,8 +17,9 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.0.5",
|
"@certd/acme-client": "^1.20.2",
|
||||||
"@certd/pipeline": "^1.0.5",
|
"@certd/pipeline": "^1.20.2",
|
||||||
|
"jszip": "^3.10.1",
|
||||||
"node-forge": "^0.10.0"
|
"node-forge": "^0.10.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -56,5 +57,5 @@
|
|||||||
"vite": "^3.1.0",
|
"vite": "^3.1.0",
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
},
|
},
|
||||||
"gitHead": "5950e1cae7cf30ebfc5128c15c7d1b0d101cbbb8"
|
"gitHead": "b258e926209fef4cc4d633b0383eb54e26c516f9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, HttpClient, IAccessService, IContext, IsTaskPlugin, RunStrategy, Step, TaskInput, TaskOutput } from "@certd/pipeline";
|
import { AbstractTaskPlugin, Decorator, HttpClient, IAccessService, IContext, IsTaskPlugin, RunStrategy, Step, TaskInput, TaskOutput } from "@certd/pipeline";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { AcmeService, CertInfo } from "./acme";
|
import { AcmeService, CertInfo } from "./acme";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { Logger } from "log4js";
|
import { Logger } from "log4js";
|
||||||
import { Decorator } from "@certd/pipeline";
|
|
||||||
import { DnsProviderDefine, dnsProviderRegistry } from "../../dns-provider";
|
import { DnsProviderDefine, dnsProviderRegistry } from "../../dns-provider";
|
||||||
import { CertReader } from "./cert-reader";
|
import { CertReader } from "./cert-reader";
|
||||||
|
import JSZip from "jszip";
|
||||||
export { CertReader };
|
export { CertReader };
|
||||||
export type { CertInfo };
|
export type { CertInfo };
|
||||||
|
|
||||||
@@ -73,6 +72,13 @@ export class CertApplyPlugin extends AbstractTaskPlugin {
|
|||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
helper: "请选择dns解析提供商授权",
|
helper: "请选择dns解析提供商授权",
|
||||||
|
reference: [
|
||||||
|
{
|
||||||
|
src: "form.dnsProviderType",
|
||||||
|
dest: "component.type",
|
||||||
|
type: "computed",
|
||||||
|
},
|
||||||
|
],
|
||||||
})
|
})
|
||||||
dnsProviderAccess!: string;
|
dnsProviderAccess!: string;
|
||||||
|
|
||||||
@@ -102,22 +108,11 @@ export class CertApplyPlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
csrInfo: any;
|
csrInfo: any;
|
||||||
|
|
||||||
// @ts-ignore
|
acme!: AcmeService;
|
||||||
acme: AcmeService;
|
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
logger!: Logger;
|
logger!: Logger;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
userContext!: IContext;
|
userContext!: IContext;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
accessService!: IAccessService;
|
accessService!: IAccessService;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
http!: HttpClient;
|
http!: HttpClient;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
lastStatus!: Step;
|
lastStatus!: Step;
|
||||||
|
|
||||||
@TaskOutput({
|
@TaskOutput({
|
||||||
@@ -126,17 +121,23 @@ export class CertApplyPlugin extends AbstractTaskPlugin {
|
|||||||
cert?: CertInfo;
|
cert?: CertInfo;
|
||||||
|
|
||||||
async onInstance() {
|
async onInstance() {
|
||||||
|
this.accessService = this.ctx.accessService;
|
||||||
|
this.logger = this.ctx.logger;
|
||||||
|
this.userContext = this.ctx.userContext;
|
||||||
|
this.http = this.ctx.http;
|
||||||
|
this.lastStatus = this.ctx.lastStatus as Step;
|
||||||
|
|
||||||
this.acme = new AcmeService({ userContext: this.userContext, logger: this.logger });
|
this.acme = new AcmeService({ userContext: this.userContext, logger: this.logger });
|
||||||
}
|
}
|
||||||
|
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
const oldCert = await this.condition();
|
const oldCert = await this.condition();
|
||||||
if (oldCert != null) {
|
if (oldCert != null) {
|
||||||
return this.output(oldCert);
|
return await this.output(oldCert.toCertInfo());
|
||||||
}
|
}
|
||||||
const cert = await this.doCertApply();
|
const cert = await this.doCertApply();
|
||||||
if (cert != null) {
|
if (cert != null) {
|
||||||
this.output(cert.toCertInfo());
|
await this.output(cert.toCertInfo());
|
||||||
//清空后续任务的状态,让后续任务能够重新执行
|
//清空后续任务的状态,让后续任务能够重新执行
|
||||||
this.clearLastStatus();
|
this.clearLastStatus();
|
||||||
} else {
|
} else {
|
||||||
@@ -144,8 +145,17 @@ export class CertApplyPlugin extends AbstractTaskPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output(cert: CertInfo) {
|
async output(cert: CertInfo) {
|
||||||
this.cert = cert;
|
this.cert = cert;
|
||||||
|
await this.zipCert(cert);
|
||||||
|
}
|
||||||
|
|
||||||
|
async zipCert(cert: CertInfo) {
|
||||||
|
const zip = new JSZip();
|
||||||
|
zip.file("cert.crt", cert.crt);
|
||||||
|
zip.file("cert.key", cert.key);
|
||||||
|
const content = await zip.generateAsync({ type: "nodebuffer" });
|
||||||
|
this.saveFile("cert.zip", content);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,6 +3,56 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* save files ([671d273](https://github.com/certd/certd/commit/671d273e2f9136d16896536b0ca127cf372f1619))
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-host
|
**Note:** Version bump only for package @certd/plugin-host
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-host",
|
"name": "@certd/plugin-host",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.0.5",
|
"version": "1.20.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/plugin-host.mjs",
|
"module": "./dist/bundle.mjs",
|
||||||
"types": "./dist/es/plugin-host.d.ts"
|
"types": "./dist/d/index.d.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/pipeline": "^1.0.5",
|
"@certd/pipeline": "^1.20.2",
|
||||||
"@certd/plugin-cert": "^1.0.5",
|
"@certd/plugin-cert": "^1.20.2",
|
||||||
"ssh2": "^0.8.9"
|
"ssh2": "^0.8.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -57,5 +57,5 @@
|
|||||||
"vite": "^3.1.0",
|
"vite": "^3.1.0",
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
},
|
},
|
||||||
"gitHead": "5950e1cae7cf30ebfc5128c15c7d1b0d101cbbb8"
|
"gitHead": "b258e926209fef4cc4d633b0383eb54e26c516f9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ export class SshClient {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.connect({
|
this.connect({
|
||||||
connectConf,
|
connectConf,
|
||||||
|
onError(err: any) {
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
onReady: (conn: any) => {
|
onReady: (conn: any) => {
|
||||||
conn.exec(script, (err: Error, stream: any) => {
|
conn.exec(script, (err: Error, stream: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -98,6 +101,10 @@ export class SshClient {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.connect({
|
this.connect({
|
||||||
connectConf,
|
connectConf,
|
||||||
|
onError: (err: any) => {
|
||||||
|
this.logger.error(err);
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
onReady: (conn: any) => {
|
onReady: (conn: any) => {
|
||||||
conn.shell((err: Error, stream: any) => {
|
conn.shell((err: Error, stream: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -122,10 +129,13 @@ export class SshClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(options: { connectConf: any; onReady: any }) {
|
connect(options: { connectConf: any; onReady: any; onError: any }) {
|
||||||
const { connectConf, onReady } = options;
|
const { connectConf, onReady, onError } = options;
|
||||||
const conn = new ssh2.Client();
|
const conn = new ssh2.Client();
|
||||||
conn
|
conn
|
||||||
|
.on("error", (err: any) => {
|
||||||
|
onError(err);
|
||||||
|
})
|
||||||
.on("ready", () => {
|
.on("ready", () => {
|
||||||
this.logger.info("Client :: ready");
|
this.logger.info("Client :: ready");
|
||||||
onReady(conn);
|
onReady(conn);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput } from "@certd/pipeline";
|
||||||
import { SshClient } from "../../lib/ssh";
|
import { SshClient } from "../../lib/ssh";
|
||||||
|
|
||||||
@IsTaskPlugin({
|
@IsTaskPlugin({
|
||||||
@@ -32,13 +32,12 @@ export class HostShellExecutePlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
script!: string;
|
script!: string;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
accessService!: IAccessService;
|
accessService!: IAccessService;
|
||||||
@Autowire()
|
|
||||||
logger!: ILogger;
|
logger!: ILogger;
|
||||||
|
async onInstance() {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
this.accessService = this.ctx.accessService;
|
||||||
async onInstance() {}
|
this.logger = this.ctx.logger;
|
||||||
|
}
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
const { script, accessId } = this;
|
const { script, accessId } = this;
|
||||||
const connectConf = await this.accessService.getById(accessId);
|
const connectConf = await this.accessService.getById(accessId);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline";
|
||||||
import { SshClient } from "../../lib/ssh";
|
import { SshClient } from "../../lib/ssh";
|
||||||
import { CertInfo, CertReader } from "@certd/plugin-cert";
|
import { CertInfo, CertReader } from "@certd/plugin-cert";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
@@ -49,11 +49,6 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
sudo!: boolean;
|
sudo!: boolean;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
accessService!: IAccessService;
|
|
||||||
@Autowire()
|
|
||||||
logger!: ILogger;
|
|
||||||
|
|
||||||
@TaskOutput({
|
@TaskOutput({
|
||||||
title: "证书保存路径",
|
title: "证书保存路径",
|
||||||
})
|
})
|
||||||
@@ -64,7 +59,13 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
hostKeyPath!: string;
|
hostKeyPath!: string;
|
||||||
|
|
||||||
async onInstance() {}
|
accessService!: IAccessService;
|
||||||
|
logger!: ILogger;
|
||||||
|
|
||||||
|
async onInstance() {
|
||||||
|
this.accessService = this.ctx.accessService;
|
||||||
|
this.logger = this.ctx.logger;
|
||||||
|
}
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
const { crtPath, keyPath, cert, accessId, sudo } = this;
|
const { crtPath, keyPath, cert, accessId, sudo } = this;
|
||||||
const certReader = new CertReader(cert);
|
const certReader = new CertReader(cert);
|
||||||
|
|||||||
@@ -3,6 +3,54 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-huawei
|
**Note:** Version bump only for package @certd/plugin-huawei
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-huawei",
|
"name": "@certd/plugin-huawei",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.0.5",
|
"version": "1.20.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/plugin-huawei.mjs",
|
"module": "./dist/bundle.mjs",
|
||||||
"types": "./dist/es/plugin-huawei.d.ts"
|
"types": "./dist/d/index.d.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.0.5",
|
"@certd/acme-client": "^1.20.2",
|
||||||
"@certd/pipeline": "^1.0.5",
|
"@certd/pipeline": "^1.20.2",
|
||||||
"@certd/plugin-cert": "^1.0.5",
|
"@certd/plugin-cert": "^1.20.2",
|
||||||
"@certd/plugin-util": "^1.0.5",
|
"@certd/plugin-util": "^1.20.2",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"dayjs": "^1.11.6",
|
"dayjs": "^1.11.6",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
@@ -59,5 +59,5 @@
|
|||||||
"vite": "^3.1.0",
|
"vite": "^3.1.0",
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
},
|
},
|
||||||
"gitHead": "5950e1cae7cf30ebfc5128c15c7d1b0d101cbbb8"
|
"gitHead": "b258e926209fef4cc4d633b0383eb54e26c516f9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,58 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复上传证书到腾讯云失败的bug ([e950322](https://github.com/certd/certd/commit/e950322232e19d1263b8552eefa5b0150fd7864e))
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* save files ([671d273](https://github.com/certd/certd/commit/671d273e2f9136d16896536b0ca127cf372f1619))
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-tencent
|
**Note:** Version bump only for package @certd/plugin-tencent
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-tencent",
|
"name": "@certd/plugin-tencent",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.0.5",
|
"version": "1.20.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/plugin-tencent.mjs",
|
"module": "./dist/bundle.mjs",
|
||||||
"types": "./dist/es/plugin-tencent.d.ts"
|
"types": "./dist/d/index.d.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/pipeline": "^1.0.5",
|
"@certd/pipeline": "^1.20.2",
|
||||||
"@certd/plugin-cert": "^1.0.5",
|
"@certd/plugin-cert": "^1.20.2",
|
||||||
"@certd/plugin-util": "^1.0.5",
|
"@certd/plugin-util": "^1.20.2",
|
||||||
"tencentcloud-sdk-nodejs": "^4.0.44"
|
"tencentcloud-sdk-nodejs": "^4.0.44"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -58,5 +58,5 @@
|
|||||||
"vite": "^3.1.0",
|
"vite": "^3.1.0",
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
},
|
},
|
||||||
"gitHead": "5950e1cae7cf30ebfc5128c15c7d1b0d101cbbb8"
|
"gitHead": "b258e926209fef4cc4d633b0383eb54e26c516f9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,20 @@ import { IsAccess, AccessInput } from "@certd/pipeline";
|
|||||||
})
|
})
|
||||||
export class DnspodAccess {
|
export class DnspodAccess {
|
||||||
@AccessInput({
|
@AccessInput({
|
||||||
title: "token",
|
title: "端点",
|
||||||
component: {
|
component: {
|
||||||
placeholder: "开放接口token",
|
placeholder: "endpoint",
|
||||||
|
name: "a-select",
|
||||||
|
vModel: "value",
|
||||||
|
options: [
|
||||||
|
{ value: "https://dnsapi.cn", label: "中国站" },
|
||||||
|
{ value: "https://api.dnspod.com", label: "国际站" },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
rules: [{ required: true, message: "该项必填" }],
|
rules: [{ required: true, message: "该项必填" }],
|
||||||
})
|
})
|
||||||
token = "";
|
endpoint = "";
|
||||||
|
|
||||||
@AccessInput({
|
@AccessInput({
|
||||||
title: "账户id",
|
title: "账户id",
|
||||||
component: {
|
component: {
|
||||||
@@ -22,6 +29,15 @@ export class DnspodAccess {
|
|||||||
rules: [{ required: true, message: "该项必填" }],
|
rules: [{ required: true, message: "该项必填" }],
|
||||||
})
|
})
|
||||||
id = "";
|
id = "";
|
||||||
|
|
||||||
|
@AccessInput({
|
||||||
|
title: "token",
|
||||||
|
component: {
|
||||||
|
placeholder: "开放接口token",
|
||||||
|
},
|
||||||
|
rules: [{ required: true, message: "该项必填" }],
|
||||||
|
})
|
||||||
|
token = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
new DnspodAccess();
|
new DnspodAccess();
|
||||||
|
|||||||
@@ -20,9 +20,11 @@ export class DnspodDnsProvider implements IDnsProvider {
|
|||||||
|
|
||||||
loginToken: any;
|
loginToken: any;
|
||||||
|
|
||||||
|
endpoint = "";
|
||||||
async onInstance() {
|
async onInstance() {
|
||||||
const access: DnspodAccess = this.access as DnspodAccess;
|
const access: DnspodAccess = this.access as DnspodAccess;
|
||||||
this.loginToken = access.id + "," + access.token;
|
this.loginToken = access.id + "," + access.token;
|
||||||
|
this.endpoint = access.endpoint || "https://dnsapi.cn";
|
||||||
}
|
}
|
||||||
|
|
||||||
async doRequest(options: any, successCodes: string[] = []) {
|
async doRequest(options: any, successCodes: string[] = []) {
|
||||||
@@ -51,7 +53,7 @@ export class DnspodDnsProvider implements IDnsProvider {
|
|||||||
|
|
||||||
async getDomainList() {
|
async getDomainList() {
|
||||||
const ret = await this.doRequest({
|
const ret = await this.doRequest({
|
||||||
url: "https://dnsapi.cn/Domain.List",
|
url: this.access.endpoint + "/Domain.List",
|
||||||
});
|
});
|
||||||
this.logger.debug("dnspod 域名列表:", ret.domains);
|
this.logger.debug("dnspod 域名列表:", ret.domains);
|
||||||
return ret.domains;
|
return ret.domains;
|
||||||
@@ -66,7 +68,7 @@ export class DnspodDnsProvider implements IDnsProvider {
|
|||||||
|
|
||||||
const ret = await this.doRequest(
|
const ret = await this.doRequest(
|
||||||
{
|
{
|
||||||
url: "https://dnsapi.cn/Record.Create",
|
url: this.access.endpoint + "/Record.Create",
|
||||||
formData: {
|
formData: {
|
||||||
domain,
|
domain,
|
||||||
sub_domain: rr,
|
sub_domain: rr,
|
||||||
@@ -87,7 +89,7 @@ export class DnspodDnsProvider implements IDnsProvider {
|
|||||||
const domain = await this.matchDomain(fullRecord);
|
const domain = await this.matchDomain(fullRecord);
|
||||||
|
|
||||||
const ret = await this.doRequest({
|
const ret = await this.doRequest({
|
||||||
url: "https://dnsapi.cn/Record.Remove",
|
url: this.access.endpoint + "/Record.Remove",
|
||||||
formData: {
|
formData: {
|
||||||
domain,
|
domain,
|
||||||
record_id: record.id,
|
record_id: record.id,
|
||||||
@@ -101,7 +103,7 @@ export class DnspodDnsProvider implements IDnsProvider {
|
|||||||
const list = await this.getDomainList();
|
const list = await this.getDomainList();
|
||||||
let domain = null;
|
let domain = null;
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
if (_.endsWith(dnsRecord, item.name)) {
|
if (_.endsWith(dnsRecord, "." + item.name)) {
|
||||||
domain = item;
|
domain = item;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput } from "@certd/pipeline";
|
||||||
import tencentcloud from "tencentcloud-sdk-nodejs/index";
|
import tencentcloud from "tencentcloud-sdk-nodejs/index";
|
||||||
import { TencentAccess } from "../../access";
|
import { TencentAccess } from "../../access";
|
||||||
import { CertInfo } from "@certd/plugin-cert";
|
import { CertInfo } from "@certd/plugin-cert";
|
||||||
@@ -47,14 +47,25 @@ export class DeployToCdnPlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
domainName!: string;
|
domainName!: string;
|
||||||
|
|
||||||
@Autowire()
|
@TaskInput({
|
||||||
|
title: "CDN接口",
|
||||||
|
helper: "CDN接口端点",
|
||||||
|
component: {
|
||||||
|
name: "a-select",
|
||||||
|
type: "tencent",
|
||||||
|
},
|
||||||
|
required: true,
|
||||||
|
})
|
||||||
|
endpoint!: string;
|
||||||
|
|
||||||
accessService!: IAccessService;
|
accessService!: IAccessService;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
logger!: ILogger;
|
logger!: ILogger;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
async onInstance() {
|
||||||
async onInstance() {}
|
this.accessService = this.ctx.accessService;
|
||||||
|
this.logger = this.ctx.logger;
|
||||||
|
}
|
||||||
|
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
const accessProvider: TencentAccess = (await this.accessService.getById(this.accessId)) as TencentAccess;
|
const accessProvider: TencentAccess = (await this.accessService.getById(this.accessId)) as TencentAccess;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput, utils } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput, utils } from "@certd/pipeline";
|
||||||
import tencentcloud from "tencentcloud-sdk-nodejs/index";
|
import tencentcloud from "tencentcloud-sdk-nodejs/index";
|
||||||
import { TencentAccess } from "../../access";
|
import { TencentAccess } from "../../access";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
@@ -71,14 +71,13 @@ export class DeployToClbPlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
accessId!: string;
|
accessId!: string;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
accessService!: IAccessService;
|
accessService!: IAccessService;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
logger!: ILogger;
|
logger!: ILogger;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
async onInstance() {
|
||||||
async onInstance() {}
|
this.accessService = this.ctx.accessService;
|
||||||
|
this.logger = this.ctx.logger;
|
||||||
|
}
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
const accessProvider = (await this.accessService.getById(this.accessId)) as TencentAccess;
|
const accessProvider = (await this.accessService.getById(this.accessId)) as TencentAccess;
|
||||||
const client = this.getClient(accessProvider, this.region);
|
const client = this.getClient(accessProvider, this.region);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, IAccessService, IsTaskPlugin, RunStrategy, TaskInput, utils } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IAccessService, IsTaskPlugin, RunStrategy, TaskInput, utils } from "@certd/pipeline";
|
||||||
import tencentcloud from "tencentcloud-sdk-nodejs/index";
|
import tencentcloud from "tencentcloud-sdk-nodejs/index";
|
||||||
import { K8sClient } from "@certd/plugin-util";
|
import { K8sClient } from "@certd/plugin-util";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
@@ -80,17 +80,14 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
cert!: any;
|
cert!: any;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
logger!: Logger;
|
logger!: Logger;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
accessService!: IAccessService;
|
accessService!: IAccessService;
|
||||||
|
async onInstance() {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
this.accessService = this.ctx.accessService;
|
||||||
async onInstance() {}
|
this.logger = this.ctx.logger;
|
||||||
|
}
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
const accessProvider = this.accessService.getById(this.accessId);
|
const accessProvider = await this.accessService.getById(this.accessId);
|
||||||
const tkeClient = this.getTkeClient(accessProvider, this.region);
|
const tkeClient = this.getTkeClient(accessProvider, this.region);
|
||||||
const kubeConfigStr = await this.getTkeKubeConfig(tkeClient, this.clusterId);
|
const kubeConfigStr = await this.getTkeKubeConfig(tkeClient, this.clusterId);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AbstractTaskPlugin, Autowire, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline";
|
import { AbstractTaskPlugin, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline";
|
||||||
import tencentcloud from "tencentcloud-sdk-nodejs/index";
|
import tencentcloud from "tencentcloud-sdk-nodejs/index";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
@@ -42,18 +42,17 @@ export class UploadToTencentPlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
tencentCertId?: string;
|
tencentCertId?: string;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
accessService!: IAccessService;
|
accessService!: IAccessService;
|
||||||
|
|
||||||
@Autowire()
|
|
||||||
logger!: ILogger;
|
logger!: ILogger;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
async onInstance() {
|
||||||
async onInstance() {}
|
this.accessService = this.ctx.accessService;
|
||||||
|
this.logger = this.ctx.logger;
|
||||||
|
}
|
||||||
|
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
const { accessId, name, cert } = this;
|
const { accessId, name, cert } = this;
|
||||||
const accessProvider = this.accessService.getById(accessId);
|
const accessProvider = await this.accessService.getById(accessId);
|
||||||
const certName = this.appendTimeSuffix(name || cert.domain);
|
const certName = this.appendTimeSuffix(name || cert.domain);
|
||||||
const client = this.getClient(accessProvider);
|
const client = this.getClient(accessProvider);
|
||||||
|
|
||||||
@@ -97,7 +96,7 @@ export class UploadToTencentPlugin extends AbstractTaskPlugin {
|
|||||||
|
|
||||||
// async rollback({ input }) {
|
// async rollback({ input }) {
|
||||||
// const { accessId } = input;
|
// const { accessId } = input;
|
||||||
// const accessProvider = this.accessService.getById(accessId);
|
// const accessProvider = await this.accessService.getById(accessId);
|
||||||
// const client = this.getClient(accessProvider);
|
// const client = this.getClient(accessProvider);
|
||||||
//
|
//
|
||||||
// const { tencentCertId } = context;
|
// const { tencentCertId } = context;
|
||||||
|
|||||||
@@ -3,6 +3,54 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-util
|
**Note:** Version bump only for package @certd/plugin-util
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-util",
|
"name": "@certd/plugin-util",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.0.5",
|
"version": "1.20.2",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/plugin-util.mjs",
|
"module": "./dist/bundle.mjs",
|
||||||
"types": "./dist/es/plugin-util.d.ts"
|
"types": "./dist/d/index.d.ts"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -17,10 +17,11 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"kubernetes-client": "^9.0.0"
|
"kubernetes-client": "^9.0.0",
|
||||||
|
"shelljs": "^0.8.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/pipeline": "^1.0.5",
|
"@certd/pipeline": "^1.20.2",
|
||||||
"@rollup/plugin-commonjs": "^23.0.4",
|
"@rollup/plugin-commonjs": "^23.0.4",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
@@ -43,5 +44,5 @@
|
|||||||
"vite": "^3.1.0",
|
"vite": "^3.1.0",
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
},
|
},
|
||||||
"gitHead": "5950e1cae7cf30ebfc5128c15c7d1b0d101cbbb8"
|
"gitHead": "b258e926209fef4cc4d633b0383eb54e26c516f9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,13 @@ module.exports = {
|
|||||||
// 解析第三方依赖
|
// 解析第三方依赖
|
||||||
resolve(),
|
resolve(),
|
||||||
// 识别 commonjs 模式第三方依赖
|
// 识别 commonjs 模式第三方依赖
|
||||||
commonjs(),
|
commonjs({
|
||||||
|
// dynamicRequireRoot: "../../../../",
|
||||||
|
// dynamicRequireTargets: [
|
||||||
|
// // include using a glob pattern (either a string or an array of strings)
|
||||||
|
// "../../../../**/shelljs/src/*",
|
||||||
|
// ],
|
||||||
|
}),
|
||||||
Typescript({
|
Typescript({
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
rootDir: "src",
|
rootDir: "src",
|
||||||
@@ -39,5 +45,9 @@ module.exports = {
|
|||||||
"@certd/plugin-host",
|
"@certd/plugin-host",
|
||||||
"@certd/plugin-tencent",
|
"@certd/plugin-tencent",
|
||||||
"@certd/plugin-util",
|
"@certd/plugin-util",
|
||||||
|
"log4js",
|
||||||
|
"@midwayjs/core",
|
||||||
|
"@midwayjs/decorator",
|
||||||
|
"kubernetes-client",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
463
packages/ui/certd-client/.dependency-cruiser.js
Normal file
@@ -0,0 +1,463 @@
|
|||||||
|
/** @type {import('dependency-cruiser').IConfiguration} */
|
||||||
|
module.exports = {
|
||||||
|
forbidden: [
|
||||||
|
/* rules from the 'recommended' preset: */
|
||||||
|
{
|
||||||
|
name: 'no-circular',
|
||||||
|
severity: 'warn',
|
||||||
|
comment:
|
||||||
|
'This dependency is part of a circular relationship. You might want to revise ' +
|
||||||
|
'your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ',
|
||||||
|
from: {},
|
||||||
|
to: {
|
||||||
|
circular: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'no-orphans',
|
||||||
|
comment:
|
||||||
|
"This is an orphan module - it's likely not used (anymore?). Either use it or " +
|
||||||
|
"remove it. If it's logical this module is an orphan (i.e. it's a config file), " +
|
||||||
|
"add an exception for it in your dependency-cruiser configuration. By default " +
|
||||||
|
"this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration " +
|
||||||
|
"files (.d.ts), tsconfig.json and some of the babel and webpack configs.",
|
||||||
|
severity: 'warn',
|
||||||
|
from: {
|
||||||
|
orphan: true,
|
||||||
|
pathNot: [
|
||||||
|
'(^|/)\\.[^/]+\\.(js|cjs|mjs|ts|json)$', // dot files
|
||||||
|
'\\.d\\.ts$', // TypeScript declaration files
|
||||||
|
'(^|/)tsconfig\\.json$', // TypeScript config
|
||||||
|
'(^|/)(babel|webpack)\\.config\\.(js|cjs|mjs|ts|json)$' // other configs
|
||||||
|
]
|
||||||
|
},
|
||||||
|
to: {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'no-deprecated-core',
|
||||||
|
comment:
|
||||||
|
'A module depends on a node core module that has been deprecated. Find an alternative - these are ' +
|
||||||
|
"bound to exist - node doesn't deprecate lightly.",
|
||||||
|
severity: 'warn',
|
||||||
|
from: {},
|
||||||
|
to: {
|
||||||
|
dependencyTypes: [
|
||||||
|
'core'
|
||||||
|
],
|
||||||
|
path: [
|
||||||
|
'^(v8\/tools\/codemap)$',
|
||||||
|
'^(v8\/tools\/consarray)$',
|
||||||
|
'^(v8\/tools\/csvparser)$',
|
||||||
|
'^(v8\/tools\/logreader)$',
|
||||||
|
'^(v8\/tools\/profile_view)$',
|
||||||
|
'^(v8\/tools\/profile)$',
|
||||||
|
'^(v8\/tools\/SourceMap)$',
|
||||||
|
'^(v8\/tools\/splaytree)$',
|
||||||
|
'^(v8\/tools\/tickprocessor-driver)$',
|
||||||
|
'^(v8\/tools\/tickprocessor)$',
|
||||||
|
'^(node-inspect\/lib\/_inspect)$',
|
||||||
|
'^(node-inspect\/lib\/internal\/inspect_client)$',
|
||||||
|
'^(node-inspect\/lib\/internal\/inspect_repl)$',
|
||||||
|
'^(async_hooks)$',
|
||||||
|
'^(punycode)$',
|
||||||
|
'^(domain)$',
|
||||||
|
'^(constants)$',
|
||||||
|
'^(sys)$',
|
||||||
|
'^(_linklist)$',
|
||||||
|
'^(_stream_wrap)$'
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'not-to-deprecated',
|
||||||
|
comment:
|
||||||
|
'This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later ' +
|
||||||
|
'version of that module, or find an alternative. Deprecated modules are a security risk.',
|
||||||
|
severity: 'warn',
|
||||||
|
from: {},
|
||||||
|
to: {
|
||||||
|
dependencyTypes: [
|
||||||
|
'deprecated'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'no-non-package-json',
|
||||||
|
severity: 'error',
|
||||||
|
comment:
|
||||||
|
"This module depends on an npm package that isn't in the 'dependencies' section of your package.json. " +
|
||||||
|
"That's problematic as the package either (1) won't be available on live (2 - worse) will be " +
|
||||||
|
"available on live with an non-guaranteed version. Fix it by adding the package to the dependencies " +
|
||||||
|
"in your package.json.",
|
||||||
|
from: {},
|
||||||
|
to: {
|
||||||
|
dependencyTypes: [
|
||||||
|
'npm-no-pkg',
|
||||||
|
'npm-unknown'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'not-to-unresolvable',
|
||||||
|
comment:
|
||||||
|
"This module depends on a module that cannot be found ('resolved to disk'). If it's an npm " +
|
||||||
|
'module: add it to your package.json. In all other cases you likely already know what to do.',
|
||||||
|
severity: 'error',
|
||||||
|
from: {},
|
||||||
|
to: {
|
||||||
|
couldNotResolve: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'no-duplicate-dep-types',
|
||||||
|
comment:
|
||||||
|
"Likely this module depends on an external ('npm') package that occurs more than once " +
|
||||||
|
"in your package.json i.e. bot as a devDependencies and in dependencies. This will cause " +
|
||||||
|
"maintenance problems later on.",
|
||||||
|
severity: 'warn',
|
||||||
|
from: {},
|
||||||
|
to: {
|
||||||
|
moreThanOneDependencyType: true,
|
||||||
|
// as it's pretty common to have a type import be a type only import
|
||||||
|
// _and_ (e.g.) a devDependency - don't consider type-only dependency
|
||||||
|
// types for this rule
|
||||||
|
dependencyTypesNot: ["type-only"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* rules you might want to tweak for your specific situation: */
|
||||||
|
{
|
||||||
|
name: 'not-to-test',
|
||||||
|
comment:
|
||||||
|
"This module depends on code within a folder that should only contain tests. As tests don't " +
|
||||||
|
"implement functionality this is odd. Either you're writing a test outside the test folder " +
|
||||||
|
"or there's something in the test folder that isn't a test.",
|
||||||
|
severity: 'error',
|
||||||
|
from: {
|
||||||
|
pathNot: '^(tests)'
|
||||||
|
},
|
||||||
|
to: {
|
||||||
|
path: '^(tests)'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'not-to-spec',
|
||||||
|
comment:
|
||||||
|
'This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. ' +
|
||||||
|
"If there's something in a spec that's of use to other modules, it doesn't have that single " +
|
||||||
|
'responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.',
|
||||||
|
severity: 'error',
|
||||||
|
from: {},
|
||||||
|
to: {
|
||||||
|
path: '\\.(spec|test)\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\.md)$'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'not-to-dev-dep',
|
||||||
|
severity: 'error',
|
||||||
|
comment:
|
||||||
|
"This module depends on an npm package from the 'devDependencies' section of your " +
|
||||||
|
'package.json. It looks like something that ships to production, though. To prevent problems ' +
|
||||||
|
"with npm packages that aren't there on production declare it (only!) in the 'dependencies'" +
|
||||||
|
'section of your package.json. If this module is development only - add it to the ' +
|
||||||
|
'from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration',
|
||||||
|
from: {
|
||||||
|
path: '^(src)',
|
||||||
|
pathNot: '\\.(spec|test)\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\.md)$'
|
||||||
|
},
|
||||||
|
to: {
|
||||||
|
dependencyTypes: [
|
||||||
|
'npm-dev'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'optional-deps-used',
|
||||||
|
severity: 'info',
|
||||||
|
comment:
|
||||||
|
"This module depends on an npm package that is declared as an optional dependency " +
|
||||||
|
"in your package.json. As this makes sense in limited situations only, it's flagged here. " +
|
||||||
|
"If you're using an optional dependency here by design - add an exception to your" +
|
||||||
|
"dependency-cruiser configuration.",
|
||||||
|
from: {},
|
||||||
|
to: {
|
||||||
|
dependencyTypes: [
|
||||||
|
'npm-optional'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'peer-deps-used',
|
||||||
|
comment:
|
||||||
|
"This module depends on an npm package that is declared as a peer dependency " +
|
||||||
|
"in your package.json. This makes sense if your package is e.g. a plugin, but in " +
|
||||||
|
"other cases - maybe not so much. If the use of a peer dependency is intentional " +
|
||||||
|
"add an exception to your dependency-cruiser configuration.",
|
||||||
|
severity: 'warn',
|
||||||
|
from: {},
|
||||||
|
to: {
|
||||||
|
dependencyTypes: [
|
||||||
|
'npm-peer'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
options: {
|
||||||
|
|
||||||
|
/* conditions specifying which files not to follow further when encountered:
|
||||||
|
- path: a regular expression to match
|
||||||
|
- dependencyTypes: see https://github.com/sverweij/dependency-cruiser/blob/master/doc/rules-reference.md#dependencytypes-and-dependencytypesnot
|
||||||
|
for a complete list
|
||||||
|
*/
|
||||||
|
doNotFollow: {
|
||||||
|
path: 'node_modules'
|
||||||
|
},
|
||||||
|
|
||||||
|
/* conditions specifying which dependencies to exclude
|
||||||
|
- path: a regular expression to match
|
||||||
|
- dynamic: a boolean indicating whether to ignore dynamic (true) or static (false) dependencies.
|
||||||
|
leave out if you want to exclude neither (recommended!)
|
||||||
|
*/
|
||||||
|
// exclude : {
|
||||||
|
// path: '',
|
||||||
|
// dynamic: true
|
||||||
|
// },
|
||||||
|
|
||||||
|
/* pattern specifying which files to include (regular expression)
|
||||||
|
dependency-cruiser will skip everything not matching this pattern
|
||||||
|
*/
|
||||||
|
// includeOnly : '',
|
||||||
|
|
||||||
|
/* dependency-cruiser will include modules matching against the focus
|
||||||
|
regular expression in its output, as well as their neighbours (direct
|
||||||
|
dependencies and dependents)
|
||||||
|
*/
|
||||||
|
// focus : '',
|
||||||
|
|
||||||
|
/* list of module systems to cruise */
|
||||||
|
// moduleSystems: ['amd', 'cjs', 'es6', 'tsd'],
|
||||||
|
|
||||||
|
/* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/develop/'
|
||||||
|
to open it on your online repo or `vscode://file/${process.cwd()}/` to
|
||||||
|
open it in visual studio code),
|
||||||
|
*/
|
||||||
|
// prefix: '',
|
||||||
|
|
||||||
|
/* false (the default): ignore dependencies that only exist before typescript-to-javascript compilation
|
||||||
|
true: also detect dependencies that only exist before typescript-to-javascript compilation
|
||||||
|
"specify": for each dependency identify whether it only exists before compilation or also after
|
||||||
|
*/
|
||||||
|
tsPreCompilationDeps: true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
list of extensions to scan that aren't javascript or compile-to-javascript.
|
||||||
|
Empty by default. Only put extensions in here that you want to take into
|
||||||
|
account that are _not_ parsable.
|
||||||
|
*/
|
||||||
|
// extraExtensionsToScan: [".json", ".jpg", ".png", ".svg", ".webp"],
|
||||||
|
|
||||||
|
/* if true combines the package.jsons found from the module up to the base
|
||||||
|
folder the cruise is initiated from. Useful for how (some) mono-repos
|
||||||
|
manage dependencies & dependency definitions.
|
||||||
|
*/
|
||||||
|
// combinedDependencies: false,
|
||||||
|
|
||||||
|
/* if true leave symlinks untouched, otherwise use the realpath */
|
||||||
|
// preserveSymlinks: false,
|
||||||
|
|
||||||
|
/* TypeScript project file ('tsconfig.json') to use for
|
||||||
|
(1) compilation and
|
||||||
|
(2) resolution (e.g. with the paths property)
|
||||||
|
|
||||||
|
The (optional) fileName attribute specifies which file to take (relative to
|
||||||
|
dependency-cruiser's current working directory). When not provided
|
||||||
|
defaults to './tsconfig.json'.
|
||||||
|
*/
|
||||||
|
tsConfig: {
|
||||||
|
fileName: 'tsconfig.json'
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Webpack configuration to use to get resolve options from.
|
||||||
|
|
||||||
|
The (optional) fileName attribute specifies which file to take (relative
|
||||||
|
to dependency-cruiser's current working directory. When not provided defaults
|
||||||
|
to './webpack.conf.js'.
|
||||||
|
|
||||||
|
The (optional) `env` and `args` attributes contain the parameters to be passed if
|
||||||
|
your webpack config is a function and takes them (see webpack documentation
|
||||||
|
for details)
|
||||||
|
*/
|
||||||
|
// webpackConfig: {
|
||||||
|
// fileName: './webpack.config.js',
|
||||||
|
// env: {},
|
||||||
|
// args: {},
|
||||||
|
// },
|
||||||
|
|
||||||
|
/* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use
|
||||||
|
for compilation (and whatever other naughty things babel plugins do to
|
||||||
|
source code). This feature is well tested and usable, but might change
|
||||||
|
behavior a bit over time (e.g. more precise results for used module
|
||||||
|
systems) without dependency-cruiser getting a major version bump.
|
||||||
|
*/
|
||||||
|
// babelConfig: {
|
||||||
|
// fileName: './.babelrc'
|
||||||
|
// },
|
||||||
|
|
||||||
|
/* List of strings you have in use in addition to cjs/ es6 requires
|
||||||
|
& imports to declare module dependencies. Use this e.g. if you've
|
||||||
|
re-declared require, use a require-wrapper or use window.require as
|
||||||
|
a hack.
|
||||||
|
*/
|
||||||
|
// exoticRequireStrings: [],
|
||||||
|
/* options to pass on to enhanced-resolve, the package dependency-cruiser
|
||||||
|
uses to resolve module references to disk. You can set most of these
|
||||||
|
options in a webpack.conf.js - this section is here for those
|
||||||
|
projects that don't have a separate webpack config file.
|
||||||
|
|
||||||
|
Note: settings in webpack.conf.js override the ones specified here.
|
||||||
|
*/
|
||||||
|
enhancedResolveOptions: {
|
||||||
|
/* List of strings to consider as 'exports' fields in package.json. Use
|
||||||
|
['exports'] when you use packages that use such a field and your environment
|
||||||
|
supports it (e.g. node ^12.19 || >=14.7 or recent versions of webpack).
|
||||||
|
|
||||||
|
If you have an `exportsFields` attribute in your webpack config, that one
|
||||||
|
will have precedence over the one specified here.
|
||||||
|
*/
|
||||||
|
exportsFields: ["exports"],
|
||||||
|
/* List of conditions to check for in the exports field. e.g. use ['imports']
|
||||||
|
if you're only interested in exposed es6 modules, ['require'] for commonjs,
|
||||||
|
or all conditions at once `(['import', 'require', 'node', 'default']`)
|
||||||
|
if anything goes for you. Only works when the 'exportsFields' array is
|
||||||
|
non-empty.
|
||||||
|
|
||||||
|
If you have a 'conditionNames' attribute in your webpack config, that one will
|
||||||
|
have precedence over the one specified here.
|
||||||
|
*/
|
||||||
|
conditionNames: ["import", "require", "node", "default"],
|
||||||
|
/*
|
||||||
|
The extensions, by default are the same as the ones dependency-cruiser
|
||||||
|
can access (run `npx depcruise --info` to see which ones that are in
|
||||||
|
_your_ environment. If that list is larger than what you need (e.g.
|
||||||
|
it contains .js, .jsx, .ts, .tsx, .cts, .mts - but you don't use
|
||||||
|
TypeScript you can pass just the extensions you actually use (e.g.
|
||||||
|
[".js", ".jsx"]). This can speed up the most expensive step in
|
||||||
|
dependency cruising (module resolution) quite a bit.
|
||||||
|
*/
|
||||||
|
// extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
|
||||||
|
/*
|
||||||
|
If your TypeScript project makes use of types specified in 'types'
|
||||||
|
fields in package.jsons of external dependencies, specify "types"
|
||||||
|
in addition to "main" in here, so enhanced-resolve (the resolver
|
||||||
|
dependency-cruiser uses) knows to also look there. You can also do
|
||||||
|
this if you're not sure, but still use TypeScript. In a future version
|
||||||
|
of dependency-cruiser this will likely become the default.
|
||||||
|
*/
|
||||||
|
mainFields: ["main", "types"],
|
||||||
|
},
|
||||||
|
reporterOptions: {
|
||||||
|
dot: {
|
||||||
|
/* pattern of modules that can be consolidated in the detailed
|
||||||
|
graphical dependency graph. The default pattern in this configuration
|
||||||
|
collapses everything in node_modules to one folder deep so you see
|
||||||
|
the external modules, but not the innards your app depends upon.
|
||||||
|
*/
|
||||||
|
collapsePattern: 'node_modules/(@[^/]+/[^/]+|[^/]+)',
|
||||||
|
|
||||||
|
/* Options to tweak the appearance of your graph.See
|
||||||
|
https://github.com/sverweij/dependency-cruiser/blob/master/doc/options-reference.md#reporteroptions
|
||||||
|
for details and some examples. If you don't specify a theme
|
||||||
|
don't worry - dependency-cruiser will fall back to the default one.
|
||||||
|
*/
|
||||||
|
// theme: {
|
||||||
|
// graph: {
|
||||||
|
// /* use splines: "ortho" for straight lines. Be aware though
|
||||||
|
// graphviz might take a long time calculating ortho(gonal)
|
||||||
|
// routings.
|
||||||
|
// */
|
||||||
|
// splines: "true"
|
||||||
|
// },
|
||||||
|
// modules: [
|
||||||
|
// {
|
||||||
|
// criteria: { matchesFocus: true },
|
||||||
|
// attributes: {
|
||||||
|
// fillcolor: "lime",
|
||||||
|
// penwidth: 2,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// criteria: { matchesFocus: false },
|
||||||
|
// attributes: {
|
||||||
|
// fillcolor: "lightgrey",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// criteria: { matchesReaches: true },
|
||||||
|
// attributes: {
|
||||||
|
// fillcolor: "lime",
|
||||||
|
// penwidth: 2,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// criteria: { matchesReaches: false },
|
||||||
|
// attributes: {
|
||||||
|
// fillcolor: "lightgrey",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// criteria: { source: "^src/model" },
|
||||||
|
// attributes: { fillcolor: "#ccccff" }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// criteria: { source: "^src/view" },
|
||||||
|
// attributes: { fillcolor: "#ccffcc" }
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// dependencies: [
|
||||||
|
// {
|
||||||
|
// criteria: { "rules[0].severity": "error" },
|
||||||
|
// attributes: { fontcolor: "red", color: "red" }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// criteria: { "rules[0].severity": "warn" },
|
||||||
|
// attributes: { fontcolor: "orange", color: "orange" }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// criteria: { "rules[0].severity": "info" },
|
||||||
|
// attributes: { fontcolor: "blue", color: "blue" }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// criteria: { resolved: "^src/model" },
|
||||||
|
// attributes: { color: "#0000ff77" }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// criteria: { resolved: "^src/view" },
|
||||||
|
// attributes: { color: "#00770077" }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
archi: {
|
||||||
|
/* pattern of modules that can be consolidated in the high level
|
||||||
|
graphical dependency graph. If you use the high level graphical
|
||||||
|
dependency graph reporter (`archi`) you probably want to tweak
|
||||||
|
this collapsePattern to your situation.
|
||||||
|
*/
|
||||||
|
collapsePattern: '^(packages|src|lib|app|bin|test(s?)|spec(s?))/[^/]+|node_modules/(@[^/]+/[^/]+|[^/]+)',
|
||||||
|
|
||||||
|
/* Options to tweak the appearance of your graph.See
|
||||||
|
https://github.com/sverweij/dependency-cruiser/blob/master/doc/options-reference.md#reporteroptions
|
||||||
|
for details and some examples. If you don't specify a theme
|
||||||
|
for 'archi' dependency-cruiser will use the one specified in the
|
||||||
|
dot section (see above), if any, and otherwise use the default one.
|
||||||
|
*/
|
||||||
|
// theme: {
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
"text": {
|
||||||
|
"highlightFocused": true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// generated: dependency-cruiser@12.11.0 on 2023-03-24T14:11:38.647Z
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
VITE_APP_API=/api
|
VITE_APP_API=/api
|
||||||
#登录与权限关闭
|
#登录与权限关闭
|
||||||
VITE_APP_PM_ENABLED=true
|
VITE_APP_PM_ENABLED=true
|
||||||
|
VITE_APP_TITLE=Certd
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
VITE_APP_API=http://www.docmirror.cn:7001/api
|
VITE_APP_API=/api
|
||||||
#登录与权限开启
|
#登录与权限开启
|
||||||
VITE_APP_PM_ENABLED=true
|
VITE_APP_PM_ENABLED=true
|
||||||
|
|||||||
@@ -16,14 +16,11 @@ module.exports = {
|
|||||||
tsx: true
|
tsx: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
extends: [
|
extends: ["plugin:vue/vue3-recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended", "prettier"],
|
||||||
"plugin:vue/vue3-recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"plugin:prettier/recommended",
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
rules: {
|
rules: {
|
||||||
//"max-len": [0, 200, 2, { ignoreUrls: true }],
|
//"max-len": [0, 200, 2, { ignoreUrls: true }],
|
||||||
|
"@typescript-eslint/no-unused-vars": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
"@typescript-eslint/ban-ts-ignore": "off",
|
"@typescript-eslint/ban-ts-ignore": "off",
|
||||||
"@typescript-eslint/ban-ts-comment": "off",
|
"@typescript-eslint/ban-ts-comment": "off",
|
||||||
"@typescript-eslint/ban-types": "off",
|
"@typescript-eslint/ban-types": "off",
|
||||||
@@ -32,8 +29,6 @@ module.exports = {
|
|||||||
"@typescript-eslint/no-var-requires": "off",
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
"@typescript-eslint/no-empty-function": "off",
|
"@typescript-eslint/no-empty-function": "off",
|
||||||
"@typescript-eslint/no-use-before-define": "off",
|
"@typescript-eslint/no-use-before-define": "off",
|
||||||
"@typescript-eslint/ban-ts-comment": "off",
|
|
||||||
"@typescript-eslint/ban-types": "off",
|
|
||||||
"@typescript-eslint/no-non-null-assertion": "off",
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": "off"
|
"@typescript-eslint/explicit-module-boundary-types": "off"
|
||||||
// "@typescript-eslint/no-unused-vars": [
|
// "@typescript-eslint/no-unused-vars": [
|
||||||
|
|||||||
@@ -3,6 +3,72 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.20.2](https://github.com/certd/certd/compare/v1.2.1...v1.20.2) (2024-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/certd/certd/compare/v1.2.0...v1.2.1) (2023-12-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/certd/certd/compare/v1.1.6...v1.2.0) (2023-10-27)
|
||||||
|
|
||||||
|
* 🔱: [client] sync upgrade with 2 commits [trident-sync] ([aa3207f](https://github.com/certd/certd/commit/aa3207fca5f15f7c3da789989d99c8ae7d1c4551))
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* search支持自定义布局,search.layout、search.collapse转移到 search.container之下。如果想使用原来的search组件,请配置search.is=fs-search-v1
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/certd/certd/compare/v1.1.5...v1.1.6) (2023-07-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 成功图标转动的问题 ([f87eee3](https://github.com/certd/certd/commit/f87eee3b9ff1ef9874e79a81fe0ed7104cb9ee8c))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* cancel task ([bc65c0a](https://github.com/certd/certd/commit/bc65c0a786360c087fe95cad93ec6a87804cc5ee))
|
||||||
|
* flush log ([891a43a](https://github.com/certd/certd/commit/891a43ae6716ff98ed06643f7da2e35199ee195c))
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/certd/certd/compare/v1.1.1...v1.1.2) (2023-07-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/certd/certd/compare/v1.1.0...v1.1.1) (2023-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/certd/certd/compare/v1.0.6...v1.1.0) (2023-06-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复access选择类型trigger ([2851a33](https://github.com/certd/certd/commit/2851a33eb2510f038fadb55da29512597a4ba512))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 权限控制 ([27a4c81](https://github.com/certd/certd/commit/27a4c81c6d70e70abb3892c3ea58d4719988808a))
|
||||||
|
* 邮件通知 ([937e3fa](https://github.com/certd/certd/commit/937e3fac19cd03b8aa91db8ba03fda7fcfbacea2))
|
||||||
|
* cert download ([5a51c14](https://github.com/certd/certd/commit/5a51c14de521cb8075a80d2ae41a16e6d5281259))
|
||||||
|
* save files ([671d273](https://github.com/certd/certd/commit/671d273e2f9136d16896536b0ca127cf372f1619))
|
||||||
|
|
||||||
|
## [1.0.6](https://github.com/certd/certd/compare/v1.0.5...v1.0.6) (2023-05-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
## [1.0.5](https://github.com/certd/certd/compare/v1.0.4...v1.0.5) (2023-05-25)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/ui-client
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|||||||