mirror of
https://github.com/certd/certd.git
synced 2026-07-27 06:47:39 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ee6cdfb391 | |||
| 58354e563c | |||
| 48f1bf0918 | |||
| 0ffe1f2cef | |||
| 8fe1adacf3 | |||
| 30245c5d8a | |||
| 67a5225bde | |||
| 58c3d7087b | |||
| c408687af7 | |||
| 33b284afc0 | |||
| 78004bdfb5 | |||
| 640950d4c8 | |||
| 998de0f9a0 | |||
| ce6e515309 | |||
| e054c8fc55 |
@@ -3,6 +3,30 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 当通知配置被删除时,使用默认通知配置进行发送 ([5398300](https://github.com/certd/certd/commit/53983002b6553a929b72e2c70a26809a9f306e89))
|
||||
* 站点检查多个ip连接超时的报错显示不出来的bug ([33b284a](https://github.com/certd/certd/commit/33b284afc0ae6391658d573e32b1ce7765e51cb2))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 部署插件支持ucloud alb ([640950d](https://github.com/certd/certd/commit/640950d4c847c72cae2986e3c2cae10d52a67fdf))
|
||||
* 多个dns 提供商支持导入域名 ([d3c0914](https://github.com/certd/certd/commit/d3c0914ac16db8ac77f9c60285bb20cfab7a3cb0))
|
||||
* 首次使用提示新手教程按钮 ([e054c8f](https://github.com/certd/certd/commit/e054c8fc55063fd96548f1c19049070524a63411))
|
||||
* 输入证书域名时,支持点击导入域名 ([40be424](https://github.com/certd/certd/commit/40be42406c6fd5de11f594fc6913178d9e7d8943))
|
||||
* 所有的dnsprovider 支持导入域名列表 ([9f21b1a](https://github.com/certd/certd/commit/9f21b1a09797d7dab253e4416c538b55fb8f4488))
|
||||
* 优化首页统计数据,饼图替换成证书数量统计 ([9fa1c2e](https://github.com/certd/certd/commit/9fa1c2eb3e55ef630333ae24284aa8b54e3414b6))
|
||||
* 优化首页图标 ([998de0f](https://github.com/certd/certd/commit/998de0f9a031339b019aa7a09e61e994664a8047))
|
||||
* 域名导入任务进度条 ([7058d5c](https://github.com/certd/certd/commit/7058d5cb935cab8c75b98493ed497a22dbe70883))
|
||||
* 站点监控,检查状态挪到前面显示 ([48f1bf0](https://github.com/certd/certd/commit/48f1bf091869b87dd17feaca5efd8680ef741582))
|
||||
* 证书仓库页面增加到期状态查询条件 ([58c3d70](https://github.com/certd/certd/commit/58c3d7087bb66358d896a741e12005f690b2bd5e))
|
||||
* 证书流水线创建域名输入框支持获取域名数据进行选择 ([1d5b1c2](https://github.com/certd/certd/commit/1d5b1c239cf350920eb2eb9fd293af74ef412853))
|
||||
* 支持导入51dns域名 ([7eb9694](https://github.com/certd/certd/commit/7eb96942214aed0dfc9c3c5a669374da67052c49))
|
||||
* ucloud支持部署到alb ([78004bd](https://github.com/certd/certd/commit/78004bdfb552a3b83298fa09d518ca282a529d90))
|
||||
* ucloud支持部署到ulb(alb、clb统一成一个) ([c408687](https://github.com/certd/certd/commit/c408687af7669afe733b5506720ca795555acdce))
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -39,7 +39,7 @@ Certd® 是一个免费的全自动证书管理系统,让你的网站证书永
|
||||
* **站点证书监控**: 定时监控网站证书的过期时间
|
||||
* **多用户管理**: 用户可以管理自己的证书流水线
|
||||
* **多语言支持**: 中英双语切换
|
||||
* **一键无忧升级**: 版本向下兼容
|
||||
* **无忧升级**: 版本向下兼容
|
||||
|
||||
|
||||

|
||||
|
||||
@@ -15,6 +15,8 @@ Certd 是一款开源、免费、全自动申请和部署更新SSL证书的工
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 1、关于证书续期
|
||||
>* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。
|
||||
>* 我们所说的续期,其实就是按照全套流程重新申请一份新证书,然后重新部署上去。
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
| 20.| **google cloud** | 谷歌云授权 |
|
||||
| 21.| **cloudflare授权** | |
|
||||
| 22.| **中国移动CND授权** | |
|
||||
| 23.| **授权插件示例** | |
|
||||
| 23.| **授权插件示例** | 这是一个示例授权插件,用于演示如何实现一个授权插件 |
|
||||
| 24.| **dns.la授权** | |
|
||||
| 25.| **多吉云** | |
|
||||
| 26.| **Dokploy授权** | |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 任务插件
|
||||
共 `116` 款任务插件
|
||||
共 `118` 款任务插件
|
||||
## 1. 证书申请
|
||||
|
||||
| 序号 | 名称 | 说明 |
|
||||
@@ -138,8 +138,10 @@
|
||||
| 序号 | 名称 | 说明 |
|
||||
|-----|-----|-----|
|
||||
| 1.| **UCloud-部署到CDN** | 将证书部署到UCloud CDN |
|
||||
| 2.| **UCloud-部署到WAF** | 将证书部署到UCloud WAF |
|
||||
| 3.| **UCloud-上传到USSL** | 将证书上传到UCloud USSL |
|
||||
| 2.| **UCloud-部署到负载均衡** | 将证书部署到UCloud负载均衡(ULB/ALB/CLB) |
|
||||
| 3.| **UCloud-部署到对象存储(US3)** | 将证书部署到UCloud对象存储(US3) |
|
||||
| 4.| **UCloud-部署到WAF** | 将证书部署到UCloud WAF |
|
||||
| 5.| **UCloud-上传到USSL** | 将证书上传到UCloud USSL |
|
||||
## 11. 百度云
|
||||
|
||||
| 序号 | 名称 | 说明 |
|
||||
|
||||
@@ -15,3 +15,4 @@
|
||||
## 2. 图文教程链接
|
||||
如果不方便登录系统,您还可以直接查看 [图文教程](https://gitee.com/certd/certd/blob/v2/step.md)
|
||||
|
||||

|
||||
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
+1
-1
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.38.2"
|
||||
"version": "1.38.3"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/publishlab/node-acme-client/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.38.2](https://github.com/publishlab/node-acme-client/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.2",
|
||||
"@certd/basic": "^1.38.3",
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"asn1js": "^3.0.5",
|
||||
"axios": "^1.9.0",
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 站点检查多个ip连接超时的报错显示不出来的bug ([33b284a](https://github.com/certd/certd/commit/33b284afc0ae6391658d573e32b1ce7765e51cb2))
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
@@ -1 +1 @@
|
||||
12:26
|
||||
00:57
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -25,26 +25,30 @@ export class HttpError extends Error {
|
||||
if (!error) {
|
||||
return;
|
||||
}
|
||||
super(error.message || error.response?.statusText);
|
||||
|
||||
const message = error?.message;
|
||||
let message = error?.message || error?.response.statusText || error?.code;
|
||||
if (message && typeof message === "string" && message.indexOf) {
|
||||
for (const key in errorMap) {
|
||||
if (message.indexOf(key) > -1) {
|
||||
this.message = `${this.message}(${errorMap[key]})`;
|
||||
message = `${message}(${errorMap[key]})`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!message) {
|
||||
message = error.message;
|
||||
}
|
||||
if (error.errors && error.errors.length > 0) {
|
||||
message += " \n" + error.errors.map((item: any) => item.message).join("\n ");
|
||||
}
|
||||
super(message);
|
||||
|
||||
this.name = error.name;
|
||||
this.code = error.code;
|
||||
|
||||
this.status = error.response?.status;
|
||||
this.statusText = error.response?.statusText || error.code;
|
||||
if (!this.message) {
|
||||
this.message = error.code;
|
||||
}
|
||||
|
||||
this.request = {
|
||||
baseURL: error.config?.baseURL,
|
||||
url: error.config?.url,
|
||||
@@ -228,10 +232,13 @@ export function createAxiosService({ logger }: { logger: ILogger }) {
|
||||
errorMessage = "请求地址不存在";
|
||||
}
|
||||
if (errorMessage) {
|
||||
error.message = errorMessage + "," + error.message;
|
||||
if (error.message) {
|
||||
errorMessage += `,${error.message}`;
|
||||
}
|
||||
error.message = errorMessage;
|
||||
}
|
||||
|
||||
logger.error(`请求出错:status:${error.response?.status || error.code},statusText:${error.response?.statusText || error.code},url:${error.config?.url},method:${error.config?.method}。`);
|
||||
logger.error(`请求出错:${errorMessage} status:${error.response?.status || error.code},statusText:${error.response?.statusText || error.code},url:${error.config?.url},method:${error.config?.method}。`);
|
||||
logger.error("返回数据:", JSON.stringify(error.response?.data));
|
||||
if (error.response?.data) {
|
||||
const message = error.response.data.message || error.response.data.msg || error.response.data.error;
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -18,8 +18,8 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.2",
|
||||
"@certd/plus-core": "^1.38.2",
|
||||
"@certd/basic": "^1.38.3",
|
||||
"@certd/plus-core": "^1.38.3",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.2",
|
||||
"@certd/basic": "^1.38.3",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 域名导入任务进度条 ([7058d5c](https://github.com/certd/certd/commit/7058d5cb935cab8c75b98493ed497a22dbe70883))
|
||||
* 证书仓库页面增加到期状态查询条件 ([58c3d70](https://github.com/certd/certd/commit/58c3d7087bb66358d896a741e12005f690b2bd5e))
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -28,11 +28,11 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.38.2",
|
||||
"@certd/basic": "^1.38.2",
|
||||
"@certd/pipeline": "^1.38.2",
|
||||
"@certd/plugin-lib": "^1.38.2",
|
||||
"@certd/plus-core": "^1.38.2",
|
||||
"@certd/acme-client": "^1.38.3",
|
||||
"@certd/basic": "^1.38.3",
|
||||
"@certd/pipeline": "^1.38.3",
|
||||
"@certd/plugin-lib": "^1.38.3",
|
||||
"@certd/plus-core": "^1.38.3",
|
||||
"@midwayjs/cache": "3.14.0",
|
||||
"@midwayjs/core": "3.20.11",
|
||||
"@midwayjs/i18n": "3.20.13",
|
||||
|
||||
@@ -53,6 +53,8 @@ export class SysPublicSettings extends BaseSettings {
|
||||
|
||||
//默认到期前更新天数
|
||||
defaultCertRenewDays?: number;
|
||||
// 即将到期天数
|
||||
defaultWillExpireDays?: number = 15;
|
||||
|
||||
// 第三方OAuth配置
|
||||
oauthEnabled?: boolean = false;
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -17,10 +17,10 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.38.2",
|
||||
"@certd/basic": "^1.38.2",
|
||||
"@certd/pipeline": "^1.38.2",
|
||||
"@certd/plugin-lib": "^1.38.2",
|
||||
"@certd/acme-client": "^1.38.3",
|
||||
"@certd/basic": "^1.38.3",
|
||||
"@certd/pipeline": "^1.38.3",
|
||||
"@certd/plugin-lib": "^1.38.3",
|
||||
"psl": "^1.9.0",
|
||||
"punycode.js": "^2.3.1"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 多个dns 提供商支持导入域名 ([d3c0914](https://github.com/certd/certd/commit/d3c0914ac16db8ac77f9c60285bb20cfab7a3cb0))
|
||||
* 首次使用提示新手教程按钮 ([e054c8f](https://github.com/certd/certd/commit/e054c8fc55063fd96548f1c19049070524a63411))
|
||||
* ucloud支持部署到alb ([78004bd](https://github.com/certd/certd/commit/78004bdfb552a3b83298fa09d518ca282a529d90))
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -22,10 +22,10 @@
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@alicloud/tea-util": "^1.4.11",
|
||||
"@aws-sdk/client-s3": "^3.964.0",
|
||||
"@certd/acme-client": "^1.38.2",
|
||||
"@certd/basic": "^1.38.2",
|
||||
"@certd/pipeline": "^1.38.2",
|
||||
"@certd/plus-core": "^1.38.2",
|
||||
"@certd/acme-client": "^1.38.3",
|
||||
"@certd/basic": "^1.38.3",
|
||||
"@certd/pipeline": "^1.38.3",
|
||||
"@certd/plus-core": "^1.38.3",
|
||||
"@kubernetes/client-node": "0.21.0",
|
||||
"ali-oss": "^6.22.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
|
||||
@@ -250,7 +250,7 @@ export class CertReader {
|
||||
return name + "_" + dayjs().format("YYYYMMDDHHmmssSSS");
|
||||
}
|
||||
|
||||
static buildCertName(cert: any) {
|
||||
static buildCertName(cert: CertInfo) {
|
||||
return new CertReader(cert).buildCertName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { HttpClient, ILogger, utils } from "@certd/basic";
|
||||
import { IAccess, IServiceGetter, Pager, PageRes, PageSearch, Registrable } from "@certd/pipeline";
|
||||
import { IAccess, IServiceGetter, PageRes, PageSearch, Registrable } from "@certd/pipeline";
|
||||
|
||||
export type DnsProviderDefine = Registrable & {
|
||||
accessType: string;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Pager, PageRes, PageSearch } from "@certd/pipeline";
|
||||
import { HttpClient, ILogger } from "@certd/basic";
|
||||
import { PageRes, PageSearch } from "@certd/pipeline";
|
||||
import punycode from "punycode.js";
|
||||
import { CreateRecordOptions, DnsProviderContext, DnsProviderDefine, DomainRecord, IDnsProvider, RemoveRecordOptions } from "./api.js";
|
||||
import { dnsProviderRegistry } from "./registry.js";
|
||||
import { HttpClient, ILogger } from "@certd/basic";
|
||||
import punycode from "punycode.js";
|
||||
export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
|
||||
ctx!: DnsProviderContext;
|
||||
http!: HttpClient;
|
||||
|
||||
@@ -3,6 +3,21 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 首次使用提示新手教程按钮 ([e054c8f](https://github.com/certd/certd/commit/e054c8fc55063fd96548f1c19049070524a63411))
|
||||
* 输入证书域名时,支持点击导入域名 ([40be424](https://github.com/certd/certd/commit/40be42406c6fd5de11f594fc6913178d9e7d8943))
|
||||
* 优化首页统计数据,饼图替换成证书数量统计 ([9fa1c2e](https://github.com/certd/certd/commit/9fa1c2eb3e55ef630333ae24284aa8b54e3414b6))
|
||||
* 优化首页图标 ([998de0f](https://github.com/certd/certd/commit/998de0f9a031339b019aa7a09e61e994664a8047))
|
||||
* 域名导入任务进度条 ([7058d5c](https://github.com/certd/certd/commit/7058d5cb935cab8c75b98493ed497a22dbe70883))
|
||||
* 站点监控,检查状态挪到前面显示 ([48f1bf0](https://github.com/certd/certd/commit/48f1bf091869b87dd17feaca5efd8680ef741582))
|
||||
* 证书仓库页面增加到期状态查询条件 ([58c3d70](https://github.com/certd/certd/commit/58c3d7087bb66358d896a741e12005f690b2bd5e))
|
||||
* 证书流水线创建域名输入框支持获取域名数据进行选择 ([1d5b1c2](https://github.com/certd/certd/commit/1d5b1c239cf350920eb2eb9fd293af74ef412853))
|
||||
* 支持导入51dns域名 ([7eb9694](https://github.com/certd/certd/commit/7eb96942214aed0dfc9c3c5a669374da67052c49))
|
||||
* ucloud支持部署到ulb(alb、clb统一成一个) ([c408687](https://github.com/certd/certd/commit/c408687af7669afe733b5506720ca795555acdce))
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -106,8 +106,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.38.2",
|
||||
"@certd/pipeline": "^1.38.2",
|
||||
"@certd/lib-iframe": "^1.38.3",
|
||||
"@certd/pipeline": "^1.38.3",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -145,12 +145,18 @@ const getOptions = async () => {
|
||||
showErrorNotify: false,
|
||||
}
|
||||
);
|
||||
const list = res?.list || res || [];
|
||||
let list = res?.list || res || [];
|
||||
if (list.length > 0) {
|
||||
message.value = "获取数据成功,请从下拉框中选择";
|
||||
} else {
|
||||
message.value = "获取数据成功,没有数据";
|
||||
}
|
||||
list = list.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
title: `${item.domain || item.value}`,
|
||||
};
|
||||
});
|
||||
optionsRef.value = list;
|
||||
pagerRef.value.total = list.length;
|
||||
if (props.pager) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import TutorialSteps from "/@/components/tutorial/tutorial-steps.vue";
|
||||
import { mitter } from "/@/utils/util.mitt";
|
||||
import { useI18n } from "/@/locales";
|
||||
|
||||
defineOptions({
|
||||
name: "TutorialModal",
|
||||
@@ -8,6 +10,7 @@ defineOptions({
|
||||
|
||||
const props = defineProps<{
|
||||
showIcon?: boolean;
|
||||
mode?: string;
|
||||
}>();
|
||||
|
||||
const openedRef = ref(false);
|
||||
@@ -15,17 +18,26 @@ function open() {
|
||||
openedRef.value = true;
|
||||
}
|
||||
const slots = defineSlots();
|
||||
|
||||
onMounted(() => {
|
||||
mitter.on("openTutorialModal", () => {
|
||||
if (props.mode === "nav") {
|
||||
open();
|
||||
}
|
||||
});
|
||||
});
|
||||
const { t } = useI18n();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="tutorial-button pointer" @click="open">
|
||||
<template v-if="!slots.default">
|
||||
<fs-icon v-if="showIcon === false" icon="ant-design:question-circle-outlined" class="mr-0.5"></fs-icon>
|
||||
<div class="hidden md:block">{{ $t("tutorial.title") }}</div>
|
||||
<div class="hidden md:block">{{ t("tutorial.title") }}</div>
|
||||
</template>
|
||||
<slot></slot>
|
||||
<a-modal v-model:open="openedRef" class="tutorial-modal" width="90%">
|
||||
<template #title>{{ $t("tutorial.title") }}</template>
|
||||
<template #title>{{ t("tutorial.title") }}</template>
|
||||
<tutorial-steps v-if="openedRef" />
|
||||
<template #footer></template>
|
||||
</a-modal>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<a-steps :current="3" class="mt-10" size="small" :items="steps" @click="goPipeline"></a-steps>
|
||||
<a-steps :current="3" class="mt-10 simple-steps" size="small" :items="steps" @click="goPipeline"></a-steps>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
<script lang="tsx" setup>
|
||||
import { useRouter } from "vue-router";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
@@ -11,14 +11,26 @@ const { t } = useI18n();
|
||||
type Step = {
|
||||
title: string;
|
||||
description?: string;
|
||||
icon?: any;
|
||||
};
|
||||
|
||||
import { ref } from "vue";
|
||||
import { mitter } from "/@/utils/util.mitt";
|
||||
|
||||
const steps = ref<Step[]>([{ title: t("certd.steps.createPipeline") }, { title: t("certd.steps.addTask") }, { title: t("certd.steps.scheduledRun") }]);
|
||||
const steps = ref<Step[]>([
|
||||
{ title: t("certd.steps.createPipeline"), icon: <fs-icon icon="tabler:circle-number-1-filled"></fs-icon> },
|
||||
{ title: t("certd.steps.addTask"), icon: <fs-icon icon="tabler:circle-number-2-filled"></fs-icon> },
|
||||
{ title: t("certd.steps.scheduledRun"), icon: <fs-icon icon="tabler:circle-number-3-filled"></fs-icon> },
|
||||
]);
|
||||
|
||||
const router = useRouter();
|
||||
function goPipeline() {
|
||||
router.push({ path: "/certd/pipeline" });
|
||||
mitter.emit("openTutorialModal");
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.simple-steps {
|
||||
.fs-icon {
|
||||
font-size: 18px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="text">
|
||||
<h3 class="title">{{ number }} {{ currentStepItem.title }}</h3>
|
||||
<div class="description mt-5">
|
||||
<div v-for="desc of currentStepItem.descriptions">{{ desc }}</div>
|
||||
<div v-for="(desc, index) of currentStepItem.descriptions" :key="index">{{ desc }}</div>
|
||||
</div>
|
||||
<div v-if="currentStepItem.body">
|
||||
<fs-render :render-func="currentStepItem.body" />
|
||||
@@ -29,9 +29,12 @@
|
||||
<script setup lang="tsx">
|
||||
import { FsRender } from "@fast-crud/fast-crud";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
const { t } = useI18n();
|
||||
import SimpleSteps from "./simple-steps.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
mode?: string;
|
||||
}>();
|
||||
const { t } = useI18n();
|
||||
type Step = {
|
||||
title: string;
|
||||
subTitle?: string;
|
||||
@@ -69,10 +72,10 @@ const steps = ref<Step[]>([
|
||||
title: t("guide.createCertPipeline.items.successTitle"),
|
||||
descriptions: [t("guide.createCertPipeline.items.successDesc")],
|
||||
},
|
||||
{
|
||||
title: t("guide.createCertPipeline.items.nextTitle"),
|
||||
descriptions: [t("guide.createCertPipeline.items.nextDesc")],
|
||||
},
|
||||
// {
|
||||
// title: t("guide.createCertPipeline.items.nextTitle"),
|
||||
// descriptions: [t("guide.createCertPipeline.items.nextDesc")],
|
||||
// },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -252,7 +255,7 @@ function previewMask() {
|
||||
flex: 1;
|
||||
padding: 20px;
|
||||
.text {
|
||||
width: 350px;
|
||||
width: 400px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
@@ -445,6 +445,11 @@ function openUpgrade() {
|
||||
<div class="vip-type-vs">
|
||||
<a-row gutter={20}>{slots}</a-row>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://certd.docmirror.cn/guide/donate/#相关问题" target="_blank">
|
||||
{t("vip.question")}
|
||||
</a>
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<div class=" w-100 flex-col md:flex-row ">
|
||||
<span>{t("vip.site_id")}:</span>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
import { ref, watch, defineOptions } from "vue";
|
||||
import { ref, watch } from "vue";
|
||||
import { routerUtils } from "/@/utils/util.router";
|
||||
import { useRoute } from "vue-router";
|
||||
import { utils } from "@fast-crud/fast-crud";
|
||||
|
||||
@@ -83,7 +83,7 @@ provide("fn:ai.open", openChat);
|
||||
</template>
|
||||
<template #header-right-0>
|
||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block">
|
||||
<tutorial-button class="flex-center header-btn" />
|
||||
<tutorial-button class="flex-center header-btn" mode="nav" />
|
||||
</div>
|
||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
|
||||
<vip-button class="flex-center header-btn" mode="nav" />
|
||||
|
||||
@@ -19,6 +19,7 @@ export default {
|
||||
legoCertPipeline: "Lego Certificate Pipeline",
|
||||
customPipeline: "Custom Pipeline",
|
||||
batchAddPipeline: "Add Pipeline Use Template",
|
||||
myPipelinesDesc: "Pipeline Mode: Apply -> Deploy -> Schedule",
|
||||
},
|
||||
order: {
|
||||
confirmTitle: "Order Confirmation",
|
||||
@@ -329,6 +330,11 @@ export default {
|
||||
certValidDays: "Certificate Valid Days",
|
||||
certValidDaysHelper: "Number of days before expiration to send a notification",
|
||||
},
|
||||
cert: {
|
||||
expired: "Expired",
|
||||
expiring: "Expiring",
|
||||
noExpired: "Not Expired",
|
||||
},
|
||||
},
|
||||
checkStatus: {
|
||||
success: "Success",
|
||||
|
||||
@@ -3,9 +3,9 @@ export default {
|
||||
title: "Create Certificate Application Pipeline",
|
||||
description: "Demonstrate how to configure a certificate application task",
|
||||
items: {
|
||||
tutorialTitle: "Tutorial Demo Content",
|
||||
tutorialDesc1: "This tutorial demonstrates how to automatically apply for a certificate and deploy it to Nginx",
|
||||
tutorialDesc2: "Only 3 steps, fully automatic application and deployment",
|
||||
tutorialTitle: "This tutorial demonstrates how to automatically apply for a certificate and deploy it to Nginx",
|
||||
tutorialDesc1: "Only 3 steps, fully automatic application and deployment",
|
||||
tutorialDesc2: "",
|
||||
createTitle: "Create Certificate Pipeline",
|
||||
createDesc: "Click to add a certificate pipeline and fill in the certificate application information",
|
||||
successTitle: "Pipeline Created Successfully",
|
||||
|
||||
@@ -100,4 +100,5 @@ export default {
|
||||
confirm: "Confirm",
|
||||
not_effective: "Not effective or duration not sync?",
|
||||
learn_more: "More privileges",
|
||||
question: "More VIP related questions",
|
||||
};
|
||||
|
||||
@@ -23,6 +23,7 @@ export default {
|
||||
legoCertPipeline: "Lego证书流水线",
|
||||
customPipeline: "自定义流水线",
|
||||
batchAddPipeline: "模版批量创建流水线",
|
||||
myPipelinesDesc: "流水线模式:申请证书->部署证书->定时运行",
|
||||
},
|
||||
order: {
|
||||
confirmTitle: "订单确认",
|
||||
@@ -336,6 +337,12 @@ export default {
|
||||
certValidDays: "证书到期前天数",
|
||||
certValidDaysHelper: "证书到期前多少天发送通知",
|
||||
},
|
||||
|
||||
cert: {
|
||||
expired: "已过期",
|
||||
expiring: "即将过期",
|
||||
noExpired: "未过期",
|
||||
},
|
||||
},
|
||||
checkStatus: {
|
||||
success: "成功",
|
||||
|
||||
@@ -3,9 +3,9 @@ export default {
|
||||
title: "创建证书申请流水线",
|
||||
description: "演示证书申请任务如何配置",
|
||||
items: {
|
||||
tutorialTitle: "教程演示内容",
|
||||
tutorialDesc1: "本教程演示如何自动申请证书并部署到Nginx上",
|
||||
tutorialDesc2: "仅需3步,全自动申请部署证书",
|
||||
tutorialTitle: "本教程演示如何自动申请证书并部署到Nginx上",
|
||||
tutorialDesc1: "仅需3步,全自动申请部署证书",
|
||||
tutorialDesc2: "",
|
||||
createTitle: "创建证书流水线",
|
||||
createDesc: "点击添加证书流水线,填写证书申请信息",
|
||||
successTitle: "流水线创建成功",
|
||||
|
||||
@@ -99,4 +99,5 @@ export default {
|
||||
confirm: "确认",
|
||||
not_effective: "VIP没有生效/时长未同步?",
|
||||
learn_more: "更多特权(加VIP群等)",
|
||||
question: "更多VIP相关问题",
|
||||
};
|
||||
|
||||
@@ -57,6 +57,8 @@ export type SysPublicSetting = {
|
||||
|
||||
// 默认到期前更新天数
|
||||
defaultCertRenewDays?: number;
|
||||
// 默认即将到期天数
|
||||
defaultWillExpireDays?: number;
|
||||
|
||||
//证书域名添加到监控
|
||||
certDomainAddToMonitorEnabled?: boolean;
|
||||
|
||||
@@ -86,6 +86,11 @@ h6 {
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.flex-evenly {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
@@ -312,7 +317,11 @@ h6 {
|
||||
}
|
||||
|
||||
.fs-16 {
|
||||
font-size: 16px;
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
.fs-28 {
|
||||
font-size: 28px !important;
|
||||
}
|
||||
|
||||
.w-50\% {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useI18n } from "/src/locales";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, useFormWrapper, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { certInfoApi } from "./api";
|
||||
import dayjs from "dayjs";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useModal } from "/@/use/use-modal";
|
||||
import { notification } from "ant-design-vue";
|
||||
import CertView from "/@/views/certd/pipeline/cert-view.vue";
|
||||
@@ -57,7 +57,14 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
});
|
||||
};
|
||||
|
||||
const { openUploadCreateDialog, openUpdateCertDialog } = useCertUpload();
|
||||
const { openUploadCreateDialog } = useCertUpload();
|
||||
|
||||
const DEFAULT_WILL_EXPIRE_DAYS = settingStore.sysPublic.defaultWillExpireDays || settingStore.sysPublic.defaultCertRenewDays || 15;
|
||||
const route = useRoute();
|
||||
const expireStatus = route?.query?.expireStatus as string;
|
||||
const searchInitForm = {
|
||||
expiresLeft: expireStatus,
|
||||
};
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
@@ -66,6 +73,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
editRequest,
|
||||
delRequest,
|
||||
},
|
||||
search: {
|
||||
initialForm: searchInitForm,
|
||||
},
|
||||
form: {
|
||||
labelCol: {
|
||||
//固定label宽度
|
||||
@@ -213,7 +223,17 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
expiresLeft: {
|
||||
title: t("certd.validDays"),
|
||||
search: {
|
||||
show: false,
|
||||
show: true,
|
||||
component: {
|
||||
name: "fs-dict-select",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.monitor.cert.expired"), value: "expired" },
|
||||
{ label: t("certd.monitor.cert.expiring"), value: "expiring" },
|
||||
{ label: t("certd.monitor.cert.noExpired"), value: "noExpired" },
|
||||
],
|
||||
}),
|
||||
},
|
||||
},
|
||||
type: "date",
|
||||
form: {
|
||||
@@ -242,9 +262,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
|
||||
// 距离失效时间剩余天数
|
||||
const leftDays = dayjs(expiresTime).diff(dayjs(), "day");
|
||||
const color = leftDays < 20 ? "red" : "#389e0d";
|
||||
const color = leftDays < DEFAULT_WILL_EXPIRE_DAYS ? "red" : "#389e0d";
|
||||
const percent = (leftDays / effectiveDays) * 100;
|
||||
const textColor = leftDays < 20 ? "red" : leftDays > 60 ? "#389e0d" : "";
|
||||
const textColor = leftDays < DEFAULT_WILL_EXPIRE_DAYS ? "red" : leftDays > 60 ? "#389e0d" : "";
|
||||
const format = () => {
|
||||
return <span style={{ color: textColor }}>{`${leftDays}${t("certd.days")}`}</span>;
|
||||
};
|
||||
|
||||
@@ -457,6 +457,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
checkStatus: {
|
||||
title: t("certd.monitor.checkStatus"),
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "dict-select",
|
||||
dict: checkStatusDict,
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center",
|
||||
sorter: true,
|
||||
cellRender({ value, row }) {
|
||||
return (
|
||||
<a-tooltip title={row.error}>
|
||||
<fs-values-format v-model={value} dict={checkStatusDict}></fs-values-format>
|
||||
</a-tooltip>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
certEffectiveTime: {
|
||||
title: t("certd.monitor.certEffectiveTime"),
|
||||
search: {
|
||||
@@ -610,29 +633,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
},
|
||||
},
|
||||
checkStatus: {
|
||||
title: t("certd.monitor.checkStatus"),
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "dict-select",
|
||||
dict: checkStatusDict,
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center",
|
||||
sorter: true,
|
||||
cellRender({ value, row }) {
|
||||
return (
|
||||
<a-tooltip title={row.error}>
|
||||
<fs-values-format v-model={value} dict={checkStatusDict}></fs-values-format>
|
||||
</a-tooltip>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// error: {
|
||||
// title: "错误信息",
|
||||
// search: {
|
||||
|
||||
@@ -167,8 +167,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
show: true,
|
||||
},
|
||||
type: "text",
|
||||
helper: t("certd.helperIpCname"),
|
||||
form: {
|
||||
helper: t("certd.helperIpCname"),
|
||||
rules: [{ required: true, message: t("certd.ruleIpRequired") }],
|
||||
},
|
||||
column: {
|
||||
|
||||
@@ -115,6 +115,15 @@ export function useCertPipelineCreator() {
|
||||
label: "name",
|
||||
});
|
||||
|
||||
const DEFAULT_RENEW_DAYS = settingStore.sysPublic.defaultCertRenewDays || settingStore.sysPublic.defaultWillExpireDays || 15;
|
||||
|
||||
merge(inputs, {
|
||||
renewDays: {
|
||||
form: {
|
||||
value: DEFAULT_RENEW_DAYS,
|
||||
},
|
||||
},
|
||||
});
|
||||
return {
|
||||
crudOptions: {
|
||||
form: {
|
||||
@@ -338,7 +347,7 @@ export function useCertPipelineCreator() {
|
||||
title: "申请证书",
|
||||
runnableType: "step",
|
||||
input: {
|
||||
renewDays: 35,
|
||||
renewDays: 15,
|
||||
...pluginInput,
|
||||
},
|
||||
strategy: {
|
||||
|
||||
@@ -66,6 +66,8 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
|
||||
const userStore = useUserStore();
|
||||
const settingStore = useSettingStore();
|
||||
|
||||
const DEFAULT_WILL_EXPIRE_DAYS = settingStore.sysPublic.defaultWillExpireDays || settingStore.sysPublic.defaultCertRenewDays || 15;
|
||||
|
||||
function onDialogOpen(opt: any) {
|
||||
const searchForm = crudExpose.getSearchValidatedFormData();
|
||||
opt.initialForm = {
|
||||
@@ -389,9 +391,9 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
|
||||
}
|
||||
// 距离失效时间剩余天数
|
||||
const leftDays = dayjs(expiresTime).diff(dayjs(), "day");
|
||||
const color = leftDays < 20 ? "red" : "#389e0d";
|
||||
const color = leftDays < DEFAULT_WILL_EXPIRE_DAYS ? "red" : "#389e0d";
|
||||
const percent = (leftDays / effectiveDays) * 100;
|
||||
const textColor = leftDays < 20 ? "red" : leftDays > 60 ? "#389e0d" : "";
|
||||
const textColor = leftDays < DEFAULT_WILL_EXPIRE_DAYS ? "red" : leftDays > 60 ? "#389e0d" : "";
|
||||
const format = () => {
|
||||
return <span style={{ color: textColor }}>{`${leftDays}${t("certd.days")}`}</span>;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<template>
|
||||
<fs-page class="page-cert">
|
||||
<template #header>
|
||||
<div class="title">{{ t("certd.myPipelines") }}</div>
|
||||
<div class="title">
|
||||
{{ t("certd.myPipelines") }}
|
||||
<div class="sub">{{ t("certd.pipelinePage.myPipelinesDesc") }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- <a-alert v-if="settingStore.sysPublic.notice" type="warning" show-icon>
|
||||
<template #message>
|
||||
|
||||
+8
-4
@@ -5,12 +5,12 @@
|
||||
</template>
|
||||
<p class="flex items-center">
|
||||
<TriggerIcon class="mr-2" :trigger-type="runnable.triggerType"></TriggerIcon>
|
||||
<fs-date-format :model-value="runnable.createTime"></fs-date-format>
|
||||
<a-tag class="ml-5" :color="status.color" :closable="status.value === 'start'" @close="cancelTask">
|
||||
<fs-date-format class="mr-1" :model-value="runnable.createTime"></fs-date-format>
|
||||
<a-tag class="ml-0 mr-1" :color="status.color" :closable="status.value === 'start'" @close="cancelTask">
|
||||
{{ status.label }}
|
||||
</a-tag>
|
||||
<a-tag v-if="isCurrent" class="pointer" color="green" :closable="true" @close="cancel">当前</a-tag>
|
||||
<a-tag v-else-if="!editMode" class="pointer" color="blue" @click="view">查看</a-tag>
|
||||
<a-tag v-if="isCurrent" class="pointer ml-0 mr-1" color="green" :closable="true" @close="cancel">当前</a-tag>
|
||||
<a-tag v-else-if="!editMode" class="pointer ml-0 mr-1" color="blue" @click="view">查看</a-tag>
|
||||
</p>
|
||||
</a-timeline-item>
|
||||
</template>
|
||||
@@ -89,5 +89,9 @@ export default defineComponent({
|
||||
.ant-tag.pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ant-timeline .ant-timeline-item-content {
|
||||
margin-inline-start: 22px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<div class="statistic-data m-20">
|
||||
<a-row :gutter="20" class="flex-wrap">
|
||||
<a-col :md="6" :xs="24">
|
||||
<statistic-card :title="t('certd.dashboard.pipelineCount')" :count="count.pipelineCount" :sub-counts="count.pipelineEnableCount">
|
||||
<statistic-card icon="fluent-color:data-line-24" :title="t('certd.dashboard.pipelineCount')" :count="count.pipelineCount" :sub-counts="count.pipelineEnableCount">
|
||||
<template v-if="count.pipelineCount === 0" #default>
|
||||
<div class="flex-center flex-1 flex-col">
|
||||
<div style="font-size: 18px; font-weight: 700">{{ t("certd.dashboard.noPipeline") }}</div>
|
||||
@@ -85,7 +85,7 @@
|
||||
</statistic-card>
|
||||
</a-col> -->
|
||||
<a-col :md="6" :xs="24">
|
||||
<statistic-card :title="t('certd.dashboard.certCount')" :count="count.certCount" :sub-counts="count.certStatusCount">
|
||||
<statistic-card icon="fluent-color:certificate-24" :title="t('certd.dashboard.certCount')" :count="count.certCount" :sub-counts="count.certStatusCount">
|
||||
<template v-if="count.certCount === 0" #default>
|
||||
<div class="flex-center flex-1 flex-col">
|
||||
<div style="font-size: 18px; font-weight: 700">{{ t("certd.dashboard.noCert") }}</div>
|
||||
@@ -97,12 +97,12 @@
|
||||
</statistic-card>
|
||||
</a-col>
|
||||
<a-col :md="6" :xs="24">
|
||||
<statistic-card :title="t('certd.dashboard.recentRun')" :footer="false">
|
||||
<statistic-card icon="fluent-color:data-trending-24" :title="t('certd.dashboard.recentRun')" :footer="false">
|
||||
<day-count v-if="count.historyCountPerDay" :data="count.historyCountPerDay" :title="t('certd.dashboard.runCount')"></day-count>
|
||||
</statistic-card>
|
||||
</a-col>
|
||||
<a-col :md="6" :xs="24">
|
||||
<statistic-card :title="t('certd.dashboard.expiringCerts')">
|
||||
<statistic-card icon="fluent-color:alert-urgent-24" :title="t('certd.dashboard.expiringCerts')">
|
||||
<expiring-list v-if="count.expiringList" :data="count.expiringList"></expiring-list>
|
||||
</statistic-card>
|
||||
</a-col>
|
||||
@@ -112,8 +112,11 @@
|
||||
<div v-if="pluginGroups" class="plugin-list">
|
||||
<a-card>
|
||||
<template #title>
|
||||
{{ t("certd.dashboard.supportedTasks") }}
|
||||
<a-tag color="green">{{ pluginGroups.groups.all.plugins.length }}</a-tag>
|
||||
<div class="flex items-center">
|
||||
<fs-icon icon="fluent-color:puzzle-piece-24" class="mr-5 fs-28" />
|
||||
<div class="mr-5">{{ t("certd.dashboard.supportedTasks") }}</div>
|
||||
<a-tag color="green">{{ pluginGroups.groups.all.plugins.length }}</a-tag>
|
||||
</div>
|
||||
</template>
|
||||
<a-row :gutter="10">
|
||||
<a-col v-for="item of pluginGroups.groups.all.plugins" :key="item.name" class="plugin-item-col" :xl="4" :md="6" :xs="24">
|
||||
@@ -138,32 +141,33 @@
|
||||
</a-row>
|
||||
</a-card>
|
||||
</div>
|
||||
<a-tour v-bind="tour" v-model:current="tour.current" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { FsIcon } from "@fast-crud/fast-crud";
|
||||
import SimpleSteps from "/@/components/tutorial/simple-steps.vue";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { computed, ComputedRef, onMounted, Ref, ref } from "vue";
|
||||
import { notification } from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
import StatisticCard from "/@/views/framework/home/dashboard/statistic-card.vue";
|
||||
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||
import DayCount from "./charts/day-count.vue";
|
||||
import PieCount from "./charts/pie-count.vue";
|
||||
import ExpiringList from "./charts/expiring-list.vue";
|
||||
import SuiteCard from "./suite-card.vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { SiteInfo } from "/@/store/settings/api.basic";
|
||||
import { UserInfoRes } from "/@/store/user/api.user";
|
||||
import { GetStatisticCount } from "/@/views/framework/home/dashboard/api";
|
||||
import { computed, ComputedRef, onMounted, Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import * as api from "./api";
|
||||
import DayCount from "./charts/day-count.vue";
|
||||
import ExpiringList from "./charts/expiring-list.vue";
|
||||
import NoticeBar from "./notice-bar.vue";
|
||||
import SuiteCard from "./suite-card.vue";
|
||||
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||
import SimpleSteps from "/@/components/tutorial/simple-steps.vue";
|
||||
import { usePluginStore } from "/@/store/plugin";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { SiteInfo } from "/@/store/settings/api.basic";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { UserInfoRes } from "/@/store/user/api.user";
|
||||
import { LocalStorage } from "/@/utils/util.storage";
|
||||
import { GetStatisticCount } from "/@/views/framework/home/dashboard/api";
|
||||
import StatisticCard from "/@/views/framework/home/dashboard/statistic-card.vue";
|
||||
import { useI18n } from "/src/locales";
|
||||
const { t } = useI18n();
|
||||
import { usePluginStore } from "/@/store/plugin";
|
||||
import { notification } from "ant-design-vue";
|
||||
import NoticeBar from "./notice-bar.vue";
|
||||
defineOptions({
|
||||
name: "DashboardUser",
|
||||
});
|
||||
@@ -263,7 +267,7 @@ function transformStatusCount() {
|
||||
const certCount = count.value.certCount;
|
||||
count.value.certStatusCount = [
|
||||
{ name: t("certd.dashboard.certExpiredCount"), value: certCount.expired, color: "red", checkIcon: "mingcute:warning-fill:#f44336" },
|
||||
{ name: t("certd.dashboard.certExpiringCount"), value: certCount.expiring, color: "yellow", checkIcon: "mingcute:alert-fill:#ff9800" },
|
||||
{ name: t("certd.dashboard.certExpiringCount"), value: certCount.expiring, color: "yellow", checkIcon: "mingcute:alert-fill:#ff9800", title: "到期不足15天" },
|
||||
{ name: t("certd.dashboard.certNoExpireCount"), value: certCount.notExpired, color: "green" },
|
||||
];
|
||||
count.value.certCount = certCount.total;
|
||||
@@ -291,6 +295,9 @@ onMounted(async () => {
|
||||
loadLatestVersion();
|
||||
loadCount();
|
||||
loadPluginGroups();
|
||||
if (count.value.pipelineCount === 0) {
|
||||
tourHandleOpen(true);
|
||||
}
|
||||
});
|
||||
|
||||
function openUpgradeUrl() {
|
||||
@@ -325,6 +332,50 @@ const noticeList = computed(() => {
|
||||
|
||||
return list;
|
||||
});
|
||||
|
||||
function useTour() {
|
||||
const tour = ref({
|
||||
open: false,
|
||||
current: 0,
|
||||
steps: [],
|
||||
onClose: () => {
|
||||
tour.value.open = false;
|
||||
LocalStorage.set("home-tour-off", true, 999999999);
|
||||
},
|
||||
onFinish: () => {
|
||||
tour.value.open = false;
|
||||
LocalStorage.set("home-tour-off", true, 999999999);
|
||||
},
|
||||
});
|
||||
|
||||
const tourHandleOpen = (val: boolean): void => {
|
||||
if (LocalStorage.get("home-tour-off")) {
|
||||
return;
|
||||
}
|
||||
initSteps();
|
||||
tour.value.open = val;
|
||||
};
|
||||
|
||||
function initSteps() {
|
||||
//@ts-ignore
|
||||
tour.value.steps = [
|
||||
{
|
||||
title: "您是第一次使用吗?",
|
||||
description: "此处可以查看新手教程哦 ↑↑↑↑",
|
||||
target: () => {
|
||||
return document.querySelector("header .tutorial-button");
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
return {
|
||||
tour,
|
||||
tourHandleOpen,
|
||||
};
|
||||
}
|
||||
|
||||
const { tour, tourHandleOpen } = useTour();
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
<a-card>
|
||||
<div class="data-item">
|
||||
<div class="header">
|
||||
<div class="title">{{ title }}</div>
|
||||
<div class="title">
|
||||
<fs-icon :icon="icon" class="statistic-icon"></fs-icon>
|
||||
{{ title }}
|
||||
</div>
|
||||
<div class="more"></div>
|
||||
</div>
|
||||
<div class="content">
|
||||
@@ -11,11 +14,11 @@
|
||||
<div v-if="count !== 0" class="value flex items-center w-full">
|
||||
<div class="total flex-center flex-1 flex-col">
|
||||
<span>{{ count }}</span>
|
||||
<span class="title">{{ title }}</span>
|
||||
<span class="sub-title">{{ title }}</span>
|
||||
</div>
|
||||
<a-divider type="vertical h-10"></a-divider>
|
||||
<div class="sub flex-1 flex-col h-[80%] flex-between pl-4">
|
||||
<div v-for="item in subCounts" :key="item.name" class="sub-item flex justify-center w-full">
|
||||
<div class="sub flex-1 flex-col h-[80%] flex-evenly pl-4">
|
||||
<div v-for="item in subCounts" :key="item.name" class="sub-item flex justify-center w-full" :title="item.title">
|
||||
<div class="flex items-center w-[60%] ellipsis overflow-hidden">
|
||||
<div class="status-indicator" :class="`bg-${item.color}`"></div>
|
||||
{{ item.name }}:
|
||||
@@ -43,6 +46,7 @@
|
||||
<script setup lang="ts">
|
||||
import { FsIcon } from "@fast-crud/fast-crud";
|
||||
const props = defineProps<{
|
||||
icon: string;
|
||||
title: string;
|
||||
count?: number;
|
||||
subCounts?: {
|
||||
@@ -50,6 +54,7 @@ const props = defineProps<{
|
||||
value: number;
|
||||
color: string;
|
||||
checkIcon?: string;
|
||||
title?: string;
|
||||
}[];
|
||||
}>();
|
||||
const slots = defineSlots();
|
||||
@@ -58,6 +63,9 @@ const slots = defineSlots();
|
||||
.statistic-card {
|
||||
margin-bottom: 10px;
|
||||
|
||||
.ant-card-body {
|
||||
padding: 15px 24px;
|
||||
}
|
||||
.icon-text {
|
||||
display: inline-flex;
|
||||
justify-content: left;
|
||||
@@ -72,13 +80,33 @@ const slots = defineSlots();
|
||||
.data-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 188px;
|
||||
height: 200px;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
//padding-bottom: 10px;
|
||||
color: #8077a4;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
color: #494949;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.statistic-icon {
|
||||
font-size: 28px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
@@ -96,13 +124,12 @@ const slots = defineSlots();
|
||||
.value {
|
||||
font-size: 50px;
|
||||
font-weight: 700;
|
||||
color: #323232;
|
||||
|
||||
.total {
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: hsl(var(--primary));
|
||||
.sub-title {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #8077a4;
|
||||
color: #626262;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,9 +164,6 @@ const slots = defineSlots();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
x-vue-echarts {
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
@@ -157,8 +181,6 @@ const slots = defineSlots();
|
||||
> * {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ import { createHtmlPlugin } from "vite-plugin-html";
|
||||
import { loadEnv } from "vite";
|
||||
import * as path from "path";
|
||||
import DefineOptions from "unplugin-vue-define-options/vite";
|
||||
import { theme } from "ant-design-vue";
|
||||
const { defaultAlgorithm, defaultSeed } = theme;
|
||||
const mapToken = defaultAlgorithm(defaultSeed);
|
||||
// import WindiCSS from "vite-plugin-windicss";
|
||||
// import { generateModifyVars } from "./build/modify-vars";
|
||||
// import { configThemePlugin } from "./build/theme-plugin";
|
||||
@@ -76,7 +79,7 @@ export default ({ command, mode }) => {
|
||||
// 修改默认主题颜色,配置less变量
|
||||
// modifyVars: generateModifyVars(),
|
||||
javascriptEnabled: true,
|
||||
// modifyVars: mapToken
|
||||
modifyVars: mapToken,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -3,6 +3,27 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 当通知配置被删除时,使用默认通知配置进行发送 ([5398300](https://github.com/certd/certd/commit/53983002b6553a929b72e2c70a26809a9f306e89))
|
||||
* 站点检查多个ip连接超时的报错显示不出来的bug ([33b284a](https://github.com/certd/certd/commit/33b284afc0ae6391658d573e32b1ce7765e51cb2))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 部署插件支持ucloud alb ([640950d](https://github.com/certd/certd/commit/640950d4c847c72cae2986e3c2cae10d52a67fdf))
|
||||
* 多个dns 提供商支持导入域名 ([d3c0914](https://github.com/certd/certd/commit/d3c0914ac16db8ac77f9c60285bb20cfab7a3cb0))
|
||||
* 输入证书域名时,支持点击导入域名 ([40be424](https://github.com/certd/certd/commit/40be42406c6fd5de11f594fc6913178d9e7d8943))
|
||||
* 所有的dnsprovider 支持导入域名列表 ([9f21b1a](https://github.com/certd/certd/commit/9f21b1a09797d7dab253e4416c538b55fb8f4488))
|
||||
* 优化首页统计数据,饼图替换成证书数量统计 ([9fa1c2e](https://github.com/certd/certd/commit/9fa1c2eb3e55ef630333ae24284aa8b54e3414b6))
|
||||
* 域名导入任务进度条 ([7058d5c](https://github.com/certd/certd/commit/7058d5cb935cab8c75b98493ed497a22dbe70883))
|
||||
* 证书仓库页面增加到期状态查询条件 ([58c3d70](https://github.com/certd/certd/commit/58c3d7087bb66358d896a741e12005f690b2bd5e))
|
||||
* 证书流水线创建域名输入框支持获取域名数据进行选择 ([1d5b1c2](https://github.com/certd/certd/commit/1d5b1c239cf350920eb2eb9fd293af74ef412853))
|
||||
* 支持导入51dns域名 ([7eb9694](https://github.com/certd/certd/commit/7eb96942214aed0dfc9c3c5a669374da67052c49))
|
||||
* ucloud支持部署到alb ([78004bd](https://github.com/certd/certd/commit/78004bdfb552a3b83298fa09d518ca282a529d90))
|
||||
* ucloud支持部署到ulb(alb、clb统一成一个) ([c408687](https://github.com/certd/certd/commit/c408687af7669afe733b5506720ca795555acdce))
|
||||
|
||||
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,19 +1,38 @@
|
||||
name: demo
|
||||
title: 授权插件示例
|
||||
icon: clarity:plugin-line
|
||||
desc: ''
|
||||
desc: 这是一个示例授权插件,用于演示如何实现一个授权插件
|
||||
input:
|
||||
apiType:
|
||||
title: 授权方式
|
||||
value: apiKey
|
||||
component:
|
||||
name: a-select
|
||||
vModel: value
|
||||
options:
|
||||
- label: API密钥(推荐)
|
||||
value: apiKey
|
||||
- label: 账号密码
|
||||
value: account
|
||||
placeholder: demoKeyId
|
||||
required: true
|
||||
demoKeyId:
|
||||
title: 密钥Id
|
||||
component:
|
||||
name: a-input
|
||||
allowClear: true
|
||||
placeholder: demoKeyId
|
||||
required: true
|
||||
demoKeySecret:
|
||||
title: 密钥串
|
||||
component:
|
||||
placeholder: demoKeySecret
|
||||
title: 密钥
|
||||
required: true
|
||||
encrypt: true
|
||||
testRequest:
|
||||
title: 测试
|
||||
component:
|
||||
name: api-test
|
||||
action: TestRequest
|
||||
helper: 点击测试接口是否正常
|
||||
pluginType: access
|
||||
type: builtIn
|
||||
scriptFilePath: /plugins/plugin-demo/access.js
|
||||
|
||||
@@ -14,17 +14,18 @@ input:
|
||||
domains:
|
||||
title: 证书域名
|
||||
component:
|
||||
name: a-select
|
||||
name: domain-selector
|
||||
vModel: value
|
||||
mode: tags
|
||||
open: false
|
||||
placeholder: foo.com / *.foo.com / *.bar.com
|
||||
placeholder: 请输入证书域名,比如:foo.com , *.foo.com , *.sub.foo.com , *.bar.com
|
||||
tokenSeparators:
|
||||
- ','
|
||||
- ' '
|
||||
- ,
|
||||
- 、
|
||||
- '|'
|
||||
search: true
|
||||
pager: true
|
||||
rules:
|
||||
- type: domains
|
||||
required: true
|
||||
@@ -424,7 +425,6 @@ input:
|
||||
helper: 兼容Windows Server各个版本
|
||||
renewDays:
|
||||
title: 更新天数
|
||||
value: 18
|
||||
component:
|
||||
name: a-input-number
|
||||
vModel: value
|
||||
|
||||
@@ -11,17 +11,18 @@ input:
|
||||
domains:
|
||||
title: 证书域名
|
||||
component:
|
||||
name: a-select
|
||||
name: domain-selector
|
||||
vModel: value
|
||||
mode: tags
|
||||
open: false
|
||||
placeholder: foo.com / *.foo.com / *.bar.com
|
||||
placeholder: 请输入证书域名,比如:foo.com , *.foo.com , *.sub.foo.com , *.bar.com
|
||||
tokenSeparators:
|
||||
- ','
|
||||
- ' '
|
||||
- ,
|
||||
- 、
|
||||
- '|'
|
||||
search: true
|
||||
pager: true
|
||||
rules:
|
||||
- type: domains
|
||||
required: true
|
||||
@@ -109,7 +110,6 @@ input:
|
||||
helper: 兼容Windows Server各个版本
|
||||
renewDays:
|
||||
title: 更新天数
|
||||
value: 18
|
||||
component:
|
||||
name: a-input-number
|
||||
vModel: value
|
||||
|
||||
@@ -14,17 +14,18 @@ input:
|
||||
domains:
|
||||
title: 证书域名
|
||||
component:
|
||||
name: a-select
|
||||
name: domain-selector
|
||||
vModel: value
|
||||
mode: tags
|
||||
open: false
|
||||
placeholder: foo.com / *.foo.com / *.bar.com
|
||||
placeholder: 请输入证书域名,比如:foo.com , *.foo.com , *.sub.foo.com , *.bar.com
|
||||
tokenSeparators:
|
||||
- ','
|
||||
- ' '
|
||||
- ,
|
||||
- 、
|
||||
- '|'
|
||||
search: true
|
||||
pager: true
|
||||
rules:
|
||||
- type: domains
|
||||
required: true
|
||||
@@ -145,7 +146,6 @@ input:
|
||||
helper: 兼容Windows Server各个版本
|
||||
renewDays:
|
||||
title: 更新天数
|
||||
value: 18
|
||||
component:
|
||||
name: a-input-number
|
||||
vModel: value
|
||||
|
||||
@@ -76,17 +76,18 @@ input:
|
||||
domains:
|
||||
title: 证书域名
|
||||
component:
|
||||
name: a-select
|
||||
name: domain-selector
|
||||
vModel: value
|
||||
mode: tags
|
||||
open: false
|
||||
placeholder: foo.com / *.foo.com / *.bar.com
|
||||
placeholder: 请输入证书域名,比如:foo.com , *.foo.com , *.sub.foo.com , *.bar.com
|
||||
tokenSeparators:
|
||||
- ','
|
||||
- ' '
|
||||
- ,
|
||||
- 、
|
||||
- '|'
|
||||
search: true
|
||||
pager: true
|
||||
rules:
|
||||
- type: domains
|
||||
required: true
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
showRunStrategy: false
|
||||
default:
|
||||
strategy:
|
||||
runStrategy: 1
|
||||
name: UCloudDeployToULB
|
||||
title: UCloud-部署到负载均衡
|
||||
desc: 将证书部署到UCloud负载均衡(ULB/ALB/CLB)
|
||||
icon: svg:icon-ucloud
|
||||
group: ucloud
|
||||
needPlus: false
|
||||
input:
|
||||
cert:
|
||||
title: 域名证书
|
||||
helper: 请选择前置任务输出的域名证书
|
||||
component:
|
||||
name: output-selector
|
||||
from:
|
||||
- ':cert:'
|
||||
order: 0
|
||||
certDomains:
|
||||
title: 当前证书域名
|
||||
component:
|
||||
name: cert-domains-getter
|
||||
mergeScript: |2-
|
||||
|
||||
return {
|
||||
component:{
|
||||
inputKey: ctx.compute(({form})=>{
|
||||
return form.cert
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
template: false
|
||||
required: false
|
||||
order: 0
|
||||
accessId:
|
||||
title: UCloud授权
|
||||
component:
|
||||
name: access-selector
|
||||
type: ucloud
|
||||
required: true
|
||||
order: 0
|
||||
region:
|
||||
title: 地域
|
||||
component:
|
||||
name: remote-select
|
||||
vModel: value
|
||||
type: plugin
|
||||
action: onGetRegionList
|
||||
search: false
|
||||
pager: false
|
||||
watches:
|
||||
- certDomains
|
||||
- accessId
|
||||
required: true
|
||||
mergeScript: |2-
|
||||
|
||||
return {
|
||||
component:{
|
||||
form: ctx.compute(({form})=>{
|
||||
return form
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
helper: 选择UCloud地域
|
||||
order: 0
|
||||
certNameList:
|
||||
title: 证书列表
|
||||
component:
|
||||
name: remote-select
|
||||
vModel: value
|
||||
mode: tags
|
||||
type: plugin
|
||||
action: onGetCertList
|
||||
search: false
|
||||
pager: false
|
||||
watches:
|
||||
- certDomains
|
||||
- accessId
|
||||
required: true
|
||||
mergeScript: |2-
|
||||
|
||||
return {
|
||||
component:{
|
||||
form: ctx.compute(({form})=>{
|
||||
return form
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
helper: |-
|
||||
选择要替换的证书名称
|
||||
如果证书不存在,可以手动输入证书名称(运行一次后将会自动创建,您可以在ULB控制台进行使用)
|
||||
请确保证书名称不要重复,如果重复,只会更新创建时间最近的那一条
|
||||
order: 0
|
||||
output: {}
|
||||
pluginType: deploy
|
||||
type: builtIn
|
||||
scriptFilePath: /plugins/plugin-ucloud/plugins/plugin-deploy-to-ulb.js
|
||||
@@ -0,0 +1,99 @@
|
||||
showRunStrategy: false
|
||||
default:
|
||||
strategy:
|
||||
runStrategy: 1
|
||||
name: UCloudDeployToUS3
|
||||
title: UCloud-部署到对象存储(US3)
|
||||
desc: 将证书部署到UCloud对象存储(US3)
|
||||
icon: svg:icon-ucloud
|
||||
group: ucloud
|
||||
needPlus: false
|
||||
input:
|
||||
cert:
|
||||
title: 域名证书
|
||||
helper: 请选择前置任务输出的域名证书
|
||||
component:
|
||||
name: output-selector
|
||||
from:
|
||||
- ':cert:'
|
||||
order: 0
|
||||
certDomains:
|
||||
title: 当前证书域名
|
||||
component:
|
||||
name: cert-domains-getter
|
||||
mergeScript: |2-
|
||||
|
||||
return {
|
||||
component:{
|
||||
inputKey: ctx.compute(({form})=>{
|
||||
return form.cert
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
template: false
|
||||
required: false
|
||||
order: 0
|
||||
accessId:
|
||||
title: UCloud授权
|
||||
component:
|
||||
name: access-selector
|
||||
type: ucloud
|
||||
required: true
|
||||
order: 0
|
||||
bucket:
|
||||
title: 存储桶
|
||||
component:
|
||||
name: remote-select
|
||||
vModel: value
|
||||
mode: tags
|
||||
type: plugin
|
||||
action: onGetBucketList
|
||||
search: false
|
||||
pager: false
|
||||
watches:
|
||||
- certDomains
|
||||
- accessId
|
||||
required: true
|
||||
mergeScript: |2-
|
||||
|
||||
return {
|
||||
component:{
|
||||
form: ctx.compute(({form})=>{
|
||||
return form
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
helper: 要更新的UCloud存储桶
|
||||
order: 0
|
||||
domainList:
|
||||
title: 域名列表
|
||||
component:
|
||||
name: remote-select
|
||||
vModel: value
|
||||
mode: tags
|
||||
type: plugin
|
||||
action: onGetDomainList
|
||||
search: false
|
||||
pager: false
|
||||
watches:
|
||||
- certDomains
|
||||
- accessId
|
||||
required: true
|
||||
mergeScript: |2-
|
||||
|
||||
return {
|
||||
component:{
|
||||
form: ctx.compute(({form})=>{
|
||||
return form
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
helper: 要更新的UCloud域名列表
|
||||
order: 0
|
||||
output: {}
|
||||
pluginType: deploy
|
||||
type: builtIn
|
||||
scriptFilePath: /plugins/plugin-ucloud/plugins/plugin-deploy-to-us3.js
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.38.2",
|
||||
"version": "1.38.3",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -48,20 +48,20 @@
|
||||
"@aws-sdk/client-iam": "^3.964.0",
|
||||
"@aws-sdk/client-route-53": "^3.964.0",
|
||||
"@aws-sdk/client-s3": "^3.964.0",
|
||||
"@certd/acme-client": "^1.38.2",
|
||||
"@certd/basic": "^1.38.2",
|
||||
"@certd/commercial-core": "^1.38.2",
|
||||
"@certd/acme-client": "^1.38.3",
|
||||
"@certd/basic": "^1.38.3",
|
||||
"@certd/commercial-core": "^1.38.3",
|
||||
"@certd/cv4pve-api-javascript": "^8.4.2",
|
||||
"@certd/jdcloud": "^1.38.2",
|
||||
"@certd/lib-huawei": "^1.38.2",
|
||||
"@certd/lib-k8s": "^1.38.2",
|
||||
"@certd/lib-server": "^1.38.2",
|
||||
"@certd/midway-flyway-js": "^1.38.2",
|
||||
"@certd/pipeline": "^1.38.2",
|
||||
"@certd/plugin-cert": "^1.38.2",
|
||||
"@certd/plugin-lib": "^1.38.2",
|
||||
"@certd/plugin-plus": "^1.38.2",
|
||||
"@certd/plus-core": "^1.38.2",
|
||||
"@certd/jdcloud": "^1.38.3",
|
||||
"@certd/lib-huawei": "^1.38.3",
|
||||
"@certd/lib-k8s": "^1.38.3",
|
||||
"@certd/lib-server": "^1.38.3",
|
||||
"@certd/midway-flyway-js": "^1.38.3",
|
||||
"@certd/pipeline": "^1.38.3",
|
||||
"@certd/plugin-cert": "^1.38.3",
|
||||
"@certd/plugin-lib": "^1.38.3",
|
||||
"@certd/plugin-plus": "^1.38.3",
|
||||
"@certd/plus-core": "^1.38.3",
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
|
||||
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { ALL, Body, Controller, Get, Inject, Post, Provide, Query } from "@midwayjs/core";
|
||||
import { CommonException, Constants, CrudController } from "@certd/lib-server";
|
||||
import { CommonException, Constants, CrudController, SysSettingsService } from "@certd/lib-server";
|
||||
import { AuthService } from "../../../modules/sys/authority/service/auth-service.js";
|
||||
import { CertInfoService } from "../../../modules/monitor/index.js";
|
||||
import { PipelineService } from "../../../modules/pipeline/service/pipeline-service.js";
|
||||
import { SelectQueryBuilder } from "typeorm";
|
||||
import { logger } from "@certd/basic";
|
||||
import fs from "fs";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -19,6 +20,9 @@ export class CertInfoController extends CrudController<CertInfoService> {
|
||||
@Inject()
|
||||
pipelineService: PipelineService;
|
||||
|
||||
@Inject()
|
||||
sysSettingService: SysSettingsService;
|
||||
|
||||
getService(): CertInfoService {
|
||||
return this.service;
|
||||
}
|
||||
@@ -29,6 +33,12 @@ export class CertInfoController extends CrudController<CertInfoService> {
|
||||
body.query.userId = this.getUserId();
|
||||
const domains = body.query?.domains;
|
||||
delete body.query.domains;
|
||||
|
||||
const expiresLeft = body.query?.expiresLeft;
|
||||
delete body.query.expiresLeft;
|
||||
|
||||
const sysSetting = await this.sysSettingService.getPublicSettings();
|
||||
const DEFAULT_WILL_EXPIRE_DAYS = sysSetting?.defaultWillExpireDays || sysSetting?.defaultCertRenewDays || 15;
|
||||
const res = await this.service.page({
|
||||
query: body.query,
|
||||
page: body.page,
|
||||
@@ -37,6 +47,16 @@ export class CertInfoController extends CrudController<CertInfoService> {
|
||||
if (domains) {
|
||||
bq.andWhere('domains like :domains', { domains: `%${domains}%` });
|
||||
}
|
||||
if (expiresLeft) {
|
||||
const willExpire = dayjs().add(DEFAULT_WILL_EXPIRE_DAYS, 'day').valueOf();
|
||||
if (expiresLeft === "expired") {
|
||||
bq.andWhere('expires_time < :now', { now: Date.now() });
|
||||
} else if (expiresLeft === "expiring") {
|
||||
bq.andWhere('expires_time <= :willExpire and expires_time > :now', { willExpire, now: Date.now() });
|
||||
} else if (expiresLeft === "noExpired") {
|
||||
bq.andWhere('expires_time > :willExpire', { willExpire });
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import { logger } from '@certd/basic';
|
||||
import { UserService } from '../sys/authority/service/user-service.js';
|
||||
import { PlusService, SysInstallInfo, SysPrivateSettings, SysSettingsService } from '@certd/lib-server';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import crypto from 'crypto';
|
||||
import {SafeService} from "../sys/settings/safe-service.js";
|
||||
import { nanoid } from 'nanoid';
|
||||
import { UserService } from '../sys/authority/service/user-service.js';
|
||||
import { SafeService } from "../sys/settings/safe-service.js";
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
|
||||
@@ -177,11 +177,18 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
||||
}
|
||||
} catch (e) {
|
||||
logger.error("check site error", e);
|
||||
let message = e.message
|
||||
if (!message){
|
||||
message = e.code
|
||||
}
|
||||
if (e.errors &&e.errors.length > 0){
|
||||
message += "\n"+e.errors.map((item:any)=>item.message).join("\n")
|
||||
}
|
||||
await this.update({
|
||||
id: site.id,
|
||||
checkStatus: "error",
|
||||
lastCheckTime: dayjs().valueOf(),
|
||||
error: e.message
|
||||
error: message
|
||||
});
|
||||
if (!notify) {
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createAxiosService, HttpClient, ILogger } from "@certd/basic";
|
||||
import { PageRes, PageSearch } from "@certd/pipeline";
|
||||
import { DomainRecord } from "@certd/plugin-lib/dist/cert/dns-provider/api.js";
|
||||
import { DomainRecord } from "@certd/plugin-lib";
|
||||
import qs from "qs";
|
||||
import { Dns51Access } from "./access.js";
|
||||
export class Dns51Client {
|
||||
|
||||
@@ -13,7 +13,7 @@ export abstract class CertApplyBaseConvertPlugin extends AbstractTaskPlugin {
|
||||
vModel: "value",
|
||||
mode: "tags",
|
||||
// open: false,
|
||||
placeholder: "请输入证书域名,比如:foo.com / *.foo.com / *.sub.foo.com / *.bar.com",
|
||||
placeholder: "请输入证书域名,比如:foo.com , *.foo.com , *.sub.foo.com , *.bar.com",
|
||||
tokenSeparators: [",", " ", ",", "、", "|"],
|
||||
search: true,
|
||||
pager:true,
|
||||
|
||||
@@ -20,7 +20,6 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
|
||||
@TaskInput({
|
||||
title: "更新天数",
|
||||
value: 18,
|
||||
component: {
|
||||
name: "a-input-number",
|
||||
vModel: "value",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AccessInput, BaseAccess, IsAccess } from '@certd/pipeline';
|
||||
import { isDev } from '../../utils/env.js';
|
||||
import { AccessInput, BaseAccess, IsAccess, Pager, PageRes, PageSearch } from '@certd/pipeline';
|
||||
import { DomainRecord } from '@certd/plugin-lib';
|
||||
|
||||
/**
|
||||
* 这个注解将注册一个授权配置
|
||||
@@ -8,42 +8,125 @@ import { isDev } from '../../utils/env.js';
|
||||
@IsAccess({
|
||||
name: 'demo',
|
||||
title: '授权插件示例',
|
||||
icon: 'clarity:plugin-line',
|
||||
desc: '',
|
||||
icon: 'clarity:plugin-line', //插件图标
|
||||
desc: '这是一个示例授权插件,用于演示如何实现一个授权插件',
|
||||
})
|
||||
export class DemoAccess extends BaseAccess {
|
||||
|
||||
/**
|
||||
* 授权属性配置
|
||||
*/
|
||||
@AccessInput({
|
||||
title: '授权方式',
|
||||
value: 'apiKey', //默认值
|
||||
component: {
|
||||
name: "a-select", //基于antdv的输入组件
|
||||
vModel: "value", // v-model绑定的属性名
|
||||
options: [ //组件参数
|
||||
{ label: "API密钥(推荐)", value: "apiKey" },
|
||||
{ label: "账号密码", value: "account" },
|
||||
],
|
||||
placeholder: 'demoKeyId',
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
apiType = '';
|
||||
|
||||
/**
|
||||
* 授权属性配置
|
||||
*/
|
||||
@AccessInput({
|
||||
title: '密钥Id',
|
||||
component: {
|
||||
name:"a-input",
|
||||
allowClear: true,
|
||||
placeholder: 'demoKeyId',
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
demoKeyId = '';
|
||||
|
||||
/**
|
||||
* 授权属性配置
|
||||
*/
|
||||
@AccessInput({
|
||||
//标题
|
||||
title: '密钥串',
|
||||
component: {
|
||||
//input组件的placeholder
|
||||
placeholder: 'demoKeySecret',
|
||||
},
|
||||
//是否必填
|
||||
required: true,
|
||||
//改属性是否需要加密
|
||||
encrypt: true,
|
||||
title: '密钥',//标题
|
||||
required: true, //text组件可以省略
|
||||
encrypt: true, //该属性是否需要加密
|
||||
})
|
||||
//属性名称
|
||||
demoKeySecret = '';
|
||||
}
|
||||
|
||||
if (isDev()) {
|
||||
//你的实现 要去掉这个if,不然生产环境将不会显示
|
||||
new DemoAccess();
|
||||
|
||||
@AccessInput({
|
||||
title: "测试",
|
||||
component: {
|
||||
name: "api-test",
|
||||
action: "TestRequest"
|
||||
},
|
||||
helper: "点击测试接口是否正常"
|
||||
})
|
||||
testRequest = true;
|
||||
|
||||
/**
|
||||
* 会通过上面的testRequest参数在ui界面上生成测试按钮,供用户测试接口调用是否正常
|
||||
*/
|
||||
async onTestRequest() {
|
||||
await this.GetDomainList({});
|
||||
return "ok"
|
||||
}
|
||||
|
||||
/**
|
||||
* 获api接口示例 取域名列表,
|
||||
*/
|
||||
async GetDomainList(req: PageSearch): Promise<PageRes<DomainRecord>> {
|
||||
//输出日志必须使用ctx.logger
|
||||
this.ctx.logger.info(`获取域名列表,req:${JSON.stringify(req)}`);
|
||||
const pager = new Pager(req);
|
||||
const resp = await this.doRequest({
|
||||
action: "ListDomains",
|
||||
data: {
|
||||
domain: req.searchKey,
|
||||
offset: pager.getOffset(),
|
||||
limit: pager.pageSize,
|
||||
}
|
||||
});
|
||||
const total = resp?.TotalCount || 0;
|
||||
let list = resp?.DomainList?.map((item) => {
|
||||
item.domain = item.Domain;
|
||||
item.id = item.DomainId;
|
||||
return item;
|
||||
})
|
||||
return {
|
||||
total,
|
||||
list
|
||||
};
|
||||
}
|
||||
|
||||
// 还可以继续编写API
|
||||
|
||||
/**
|
||||
* 通用api调用方法, 具体如何构造请求体,需参考对应应用的API文档
|
||||
*/
|
||||
async doRequest(req: { action: string, data?: any }) {
|
||||
/**
|
||||
this.ctx中包含很多有用的工具类
|
||||
type AccessContext = {
|
||||
http: HttpClient;
|
||||
logger: ILogger;
|
||||
utils: typeof utils;
|
||||
accessService: IAccessService;
|
||||
}
|
||||
*/
|
||||
const res = await this.ctx.http.request({
|
||||
url: "https://api.demo.cn/api/",
|
||||
method: "POST",
|
||||
data: {
|
||||
Action: req.action,
|
||||
Body: req.data
|
||||
}
|
||||
});
|
||||
|
||||
if (res.Code !== 0) {
|
||||
//异常处理
|
||||
throw new Error(res.Message || "请求失败");
|
||||
}
|
||||
return res.Resp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
|
||||
import { AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
|
||||
import { CertInfo, CertReader } from '@certd/plugin-cert';
|
||||
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
|
||||
import { optionsUtils } from '@certd/basic';
|
||||
@@ -171,7 +171,7 @@ export class DemoTest extends AbstractTaskPlugin {
|
||||
}
|
||||
|
||||
//此方法演示,如何让前端在添加插件时可以从后端获取选项,这里是后端返回选项的方法
|
||||
async onGetSiteList() {
|
||||
async onGetSiteList(req: PageSearch) {
|
||||
if (!this.accessId) {
|
||||
throw new Error('请选择Access授权');
|
||||
}
|
||||
@@ -179,13 +179,7 @@ export class DemoTest extends AbstractTaskPlugin {
|
||||
// @ts-ignore
|
||||
const access = await this.getAccess(this.accessId);
|
||||
|
||||
// const siteRes = await this.ctx.http.request({
|
||||
// url: '你的服务端获取选项的请求地址',
|
||||
// method: 'GET',
|
||||
// data: {
|
||||
// token:access.xxxx
|
||||
// }, //请求参数
|
||||
// });
|
||||
// const siteRes = await access.GetDomainList(req);
|
||||
//以下是模拟数据
|
||||
const siteRes = [
|
||||
{ id: 1, siteName: 'site1.com' },
|
||||
@@ -204,5 +198,3 @@ export class DemoTest extends AbstractTaskPlugin {
|
||||
return optionsUtils.buildGroupOptions(options, this.certDomains);
|
||||
}
|
||||
}
|
||||
//实例化一下,注册插件
|
||||
new DemoTest();
|
||||
|
||||
@@ -74,14 +74,14 @@ export class UCloudAccess extends BaseAccess {
|
||||
}
|
||||
|
||||
|
||||
async getClient() {
|
||||
async getClient(region?:string) {
|
||||
if (this.client) {
|
||||
return this.client;
|
||||
}
|
||||
const { Client } = await import('@ucloud-sdks/ucloud-sdk-js');
|
||||
const client = new Client({
|
||||
config: {
|
||||
region: 'cn-bj2',
|
||||
region: region || 'cn-bj2',
|
||||
projectId: this.projectId || "",
|
||||
baseUrl: "https://api.ucloud.cn"
|
||||
},
|
||||
@@ -99,7 +99,7 @@ export class UCloudAccess extends BaseAccess {
|
||||
const resp = await client.uaccount().getProjectList({
|
||||
"Action": "GetProjectList"
|
||||
});
|
||||
this.ctx.logger.info(`获取到项目列表:${JSON.stringify(resp)}`);
|
||||
// this.ctx.logger.info(`获取到项目列表:${JSON.stringify(resp)}`);
|
||||
return resp;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ export class UCloudAccess extends BaseAccess {
|
||||
const res = await client.uaccount().getRegion({
|
||||
"Action": "GetRegion"
|
||||
});
|
||||
this.ctx.logger.info(`获取到区域列表:${JSON.stringify(res)}`);
|
||||
// this.ctx.logger.info(`获取到区域列表:${JSON.stringify(res)}`);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ export class UCloudAccess extends BaseAccess {
|
||||
"PageNo": req.PageNo,
|
||||
"PageSize": req.PageSize,
|
||||
});
|
||||
this.ctx.logger.info(`获取到CDN域名列表:${JSON.stringify(resp)}`);
|
||||
// this.ctx.logger.info(`获取到CDN域名列表:${JSON.stringify(resp)}`);
|
||||
return resp;
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ export class UCloudAccess extends BaseAccess {
|
||||
const resp = await client.invoke(new Request({
|
||||
...req
|
||||
}));
|
||||
this.ctx.logger.info(`请求UCloud API:${JSON.stringify(resp)}`);
|
||||
// this.ctx.logger.info(`请求UCloud API:${JSON.stringify(resp)}`);
|
||||
const res = resp.data || {}
|
||||
if (res.RetCode !== 0) {
|
||||
throw new Error(res.Message)
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* cn-bj1 华北(北京)
|
||||
cn-bj2 华北(北京2)
|
||||
cn-wlcb 华北(乌兰察布)
|
||||
cn-wlcb2 华北(乌兰察布2)
|
||||
cn-sh2 华东(上海2)
|
||||
cn-jx 华东(嘉兴)
|
||||
cn-sh 金融云-华东(上海)
|
||||
cn-gd2 华南(广州2)
|
||||
cn-gd 华南(广州)
|
||||
cn-guiyang1 西南(贵阳)
|
||||
hk 香港
|
||||
tw-tp 台湾(台北)
|
||||
sg 新加坡
|
||||
jpn-tky 日本(东京)
|
||||
kr-seoul 韩国(首尔)
|
||||
th-bkk 泰国(曼谷)
|
||||
idn-jakarta 印度尼西亚(雅加达)
|
||||
vn-sng 越南(胡志明)
|
||||
ph-mnl 菲律宾(马尼拉)
|
||||
ind-mumbai 印度(孟买)
|
||||
pk-khi 巴基斯坦(卡拉奇)
|
||||
us-den 美国(丹佛)
|
||||
us-ca 美国(洛杉矶)
|
||||
us-ws 美国(华盛顿)
|
||||
bra-saopaulo 巴西(圣保罗)
|
||||
rus-mosc 俄罗斯(莫斯科)
|
||||
ge-fra 德国(法兰克福)
|
||||
uk-london 英国(伦敦)
|
||||
uae-dubai 阿联酋(迪拜)
|
||||
afr-nigeria 尼日利亚(拉各斯)
|
||||
uz-tas 乌兹别克斯坦(塔什干)
|
||||
kz-ala 哈萨克斯坦(阿拉木图)
|
||||
mx-qro 墨西哥(克雷塔罗)
|
||||
*/
|
||||
export const UCloudRegions = [
|
||||
{label: "华北(北京)",value: "cn-bj1" },
|
||||
{label: "华北(北京2)",value: "cn-bj2" },
|
||||
{label: "华北(乌兰察布)",value: "cn-wlcb" },
|
||||
{label: "华北(乌兰察布2)",value: "cn-wlcb2" },
|
||||
{label: "华东(上海2)",value: "cn-sh2" },
|
||||
{label: "华东(嘉兴)",value: "cn-jx" },
|
||||
{label: "金融云-华东(上海)",value: "cn-sh" },
|
||||
{label: "华南(广州2)",value: "cn-gd2" },
|
||||
{label: "华南(广州)",value: "cn-gd" },
|
||||
{label: "西南(贵阳)",value: "cn-guiyang1" },
|
||||
{label: "香港",value: "hk" },
|
||||
{label: "台湾(台北)",value: "tw-tp" },
|
||||
{label: "新加坡",value: "sg" },
|
||||
{label: "日本(东京)",value: "jpn-tky" },
|
||||
{label: "韩国(首尔)",value: "kr-seoul" },
|
||||
{label: "泰国(曼谷)",value: "th-bkk" },
|
||||
{label: "印度尼西亚(雅加达)",value: "idn-jakarta" },
|
||||
{label: "越南(胡志明)",value: "vn-sng" },
|
||||
{label: "菲律宾(马尼拉)",value: "ph-mnl" },
|
||||
{label: "印度(孟买)",value: "ind-mumbai" },
|
||||
{label: "巴基斯坦(卡拉奇)",value: "pk-khi" },
|
||||
{label: "美国(丹佛)",value: "us-den" },
|
||||
{label: "美国(洛杉矶)",value: "us-ca" },
|
||||
{label: "美国(华盛顿)",value: "us-ws" },
|
||||
{label: "巴西(圣保罗)",value: "bra-saopaulo" },
|
||||
{label: "俄罗斯(莫斯科)",value: "rus-mosc" },
|
||||
{label: "德国(法兰克福)",value: "ge-fra" },
|
||||
{label: "英国(伦敦)",value: "uk-london" },
|
||||
{label: "阿联酋(迪拜)",value: "uae-dubai" },
|
||||
{label: "尼日利亚(拉各斯)",value: "afr-nigeria" },
|
||||
{label: "乌兹别克斯坦(塔什干)",value: "uz-tas" },
|
||||
{label: "哈萨克斯坦(阿拉木图)",value: "kz-ala" },
|
||||
{label: "墨西哥(克雷塔罗)",value: "mx-qro" },
|
||||
]
|
||||
@@ -1,3 +1,5 @@
|
||||
export * from './plugin-deploy-to-cdn.js';
|
||||
export * from './plugin-upload-to-ussl.js';
|
||||
export * from './plugin-deploy-to-waf.js';
|
||||
export * from './plugin-deploy-to-ulb.js';
|
||||
export * from './plugin-deploy-to-us3.js';
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
import { AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
|
||||
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
|
||||
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
|
||||
import { UCloudAccess } from "../access.js";
|
||||
import { UCloudRegions } from "./constants.js";
|
||||
|
||||
@IsTaskPlugin({
|
||||
name: "UCloudDeployToULB",
|
||||
title: "UCloud-部署到负载均衡",
|
||||
desc: "将证书部署到UCloud负载均衡(ULB/ALB/CLB)",
|
||||
icon: "svg:icon-ucloud",
|
||||
group: pluginGroups.ucloud.key,
|
||||
needPlus: false,
|
||||
default: {
|
||||
strategy: {
|
||||
runStrategy: RunStrategy.SkipWhenSucceed
|
||||
}
|
||||
}
|
||||
})
|
||||
export class UCloudDeployToULB extends AbstractTaskPlugin {
|
||||
@TaskInput({
|
||||
title: "域名证书",
|
||||
helper: "请选择前置任务输出的域名证书",
|
||||
component: {
|
||||
name: "output-selector",
|
||||
from: [...CertApplyPluginNames]
|
||||
}
|
||||
})
|
||||
cert!: CertInfo;
|
||||
|
||||
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
|
||||
certDomains!: string[];
|
||||
|
||||
@TaskInput({
|
||||
title: "UCloud授权",
|
||||
component: {
|
||||
name: "access-selector",
|
||||
type: "ucloud"
|
||||
},
|
||||
required: true
|
||||
})
|
||||
accessId!: string;
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: "地域",
|
||||
helper: "选择UCloud地域",
|
||||
action: UCloudDeployToULB.prototype.onGetRegionList.name,
|
||||
multi: false
|
||||
})
|
||||
)
|
||||
region!: string;
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: "证书列表",
|
||||
helper: "选择要替换的证书名称\n如果证书不存在,可以手动输入证书名称(运行一次后将会自动创建,您可以在ULB控制台进行使用)\n请确保证书名称不要重复,如果重复,只会更新创建时间最近的那一条",
|
||||
action: UCloudDeployToULB.prototype.onGetCertList.name,
|
||||
})
|
||||
)
|
||||
certNameList!: string[];
|
||||
|
||||
|
||||
async onInstance() {
|
||||
}
|
||||
|
||||
async onGetRegionList(req: PageSearch = {}) {
|
||||
const access = await this.getAccess<UCloudAccess>(this.accessId);
|
||||
|
||||
const res = await access.GetRegion();
|
||||
let list = res.Regions || [];
|
||||
|
||||
if (!list || list.length === 0) {
|
||||
throw new Error("没有获取到UCloud地域列表");
|
||||
}
|
||||
|
||||
const haveSet = {}
|
||||
list = list.filter((item: any) => {
|
||||
const region = item.Region;
|
||||
if (haveSet[region]) {
|
||||
return false;
|
||||
}
|
||||
haveSet[region] = true;
|
||||
return true;
|
||||
})
|
||||
let options = list.map((item: any) => {
|
||||
const region = item.Region;
|
||||
const name = UCloudRegions.find((r) => r.value === region)?.label || item.RegionName;
|
||||
return {
|
||||
label: `${name}(${item.Region})`,
|
||||
value: item.Region
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
list: options,
|
||||
total: options.length,
|
||||
pageNo: 1,
|
||||
pageSize: options.length
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
async execute(): Promise<void> {
|
||||
const access = await this.getAccess<UCloudAccess>(this.accessId);
|
||||
const allCertList = await this.getAllCert(access);
|
||||
const certMap = {}
|
||||
allCertList.forEach((item) => {
|
||||
if (!item.name) {
|
||||
return;
|
||||
}
|
||||
certMap[item.name] = item;
|
||||
})
|
||||
|
||||
for (const certName of this.certNameList) {
|
||||
this.logger.info(`----------- 开始更新证书:${certName}`);
|
||||
const oldCert = certMap[certName];
|
||||
if (!oldCert) {
|
||||
//如果没有找到旧证书,则跳过
|
||||
this.logger.info(`没有找到ULB证书${certName},仅上传证书,不更新`);
|
||||
await this.uploadCertToULB({
|
||||
access,
|
||||
certName: `${certName}`,
|
||||
});
|
||||
this.logger.info(`----------- 上传证书${certName}完成`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const bakCertName = `${certName}_${oldCert.id}_${Date.now()}`
|
||||
let certId = await this.uploadCertToULB({
|
||||
access,
|
||||
certName:bakCertName,
|
||||
});
|
||||
this.logger.info(`----------- 上传证书${bakCertName}完成`);
|
||||
|
||||
await this.updateSSLBinding({
|
||||
access,
|
||||
oldSSL: oldCert,
|
||||
newSSLId: certId,
|
||||
certName,
|
||||
});
|
||||
this.logger.info(`----------- 证书${certName}部署完成`);
|
||||
|
||||
}
|
||||
|
||||
await this.ctx.utils.sleep(2000);
|
||||
this.logger.info(`----------- 开始清理过期证书`);
|
||||
await this.clearExpiredCert(access, allCertList);
|
||||
this.logger.info(`----------- 清理过期证书完成`);
|
||||
this.logger.info("部署完成");
|
||||
}
|
||||
|
||||
async clearExpiredCert(access: UCloudAccess, allCertList: any[]) {
|
||||
const now = Date.now()/1000;
|
||||
const expiredCertList = allCertList.filter((item) => {
|
||||
if (!item.notAfter) {
|
||||
return false;
|
||||
}
|
||||
return item.notAfter < now;
|
||||
})
|
||||
if (!expiredCertList || expiredCertList.length === 0) {
|
||||
this.logger.info(`----------- 没有过期证书需要清理`);
|
||||
return;
|
||||
}
|
||||
for (const cert of expiredCertList) {
|
||||
this.logger.info(`----------- 清理过期证书:${cert.name} ${cert.id}`);
|
||||
try {
|
||||
await access.invoke({
|
||||
"Action": "DeleteSSL",
|
||||
"Region": this.region,
|
||||
"ProjectId": access.projectId,
|
||||
"SSLId": cert.id,
|
||||
});
|
||||
this.logger.info(`----------- 清理过期证书成功:${cert.name} ${cert.id}`);
|
||||
} catch (error) {
|
||||
this.logger.error(`----------- 清理过期证书失败:${cert.name} ${cert.id}`, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
async updateSSLBinding(req: {
|
||||
access: UCloudAccess,
|
||||
oldSSL: any,
|
||||
newSSLId: string,
|
||||
certName: string,
|
||||
}) {
|
||||
const access = req.access;
|
||||
const oldSSLId = req.oldSSL.id;
|
||||
const newSSLId = req.newSSLId;
|
||||
|
||||
if (!req.oldSSL.relations || req.oldSSL.relations.length === 0) {
|
||||
this.logger.info(`----------- 证书${req.oldSSL.name} ${req.oldSSL.id} 没有绑定ULB,无需更新绑定`);
|
||||
} else {
|
||||
this.logger.info(`----------- 更新ULB证书绑定:${oldSSLId} -> ${newSSLId}`);
|
||||
await access.invoke({
|
||||
"Action": "UpdateSSLBinding",
|
||||
"Region": this.region,
|
||||
"ProjectId": access.projectId,
|
||||
"OldSSLId": oldSSLId,
|
||||
"NewSSLId": newSSLId,
|
||||
});
|
||||
this.logger.info(`----------- 更新ULB证书绑定成功: ${newSSLId}`);
|
||||
}
|
||||
|
||||
// 更新证书名称
|
||||
this.logger.info(`----------- 更新ULB证书名称:${newSSLId} -> ${req.certName}`);
|
||||
await access.invoke({
|
||||
"Action": "UpdateSSLAttribute",
|
||||
"Region": this.region,
|
||||
"ProjectId": access.projectId,
|
||||
"SSLId": newSSLId,
|
||||
"SSLName": req.certName,
|
||||
});
|
||||
this.logger.info(`----------- 更新ULB证书名称成功:${req.certName}`);
|
||||
await this.ctx.utils.sleep(5000);
|
||||
try {
|
||||
this.logger.info(`----------- 删除ULB旧证书:${oldSSLId}`);
|
||||
await access.invoke({
|
||||
"Action": "DeleteSSL",
|
||||
"Region": this.region,
|
||||
"ProjectId": access.projectId,
|
||||
"SSLId": oldSSLId,
|
||||
});
|
||||
this.logger.info(`----------- 删除ULB旧证书成功:${oldSSLId}`);
|
||||
} catch (error) {
|
||||
this.logger.error(`----------- 删除ULB旧证书失败:${oldSSLId}`, error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async uploadCertToULB(req: {
|
||||
access: UCloudAccess,
|
||||
certName: string,
|
||||
}) {
|
||||
const access = req.access;
|
||||
const certName = req.certName;
|
||||
const certContent = `${this.cert.crt}\n${this.cert.key}`
|
||||
const res = await access.invoke({
|
||||
"Action": "CreateSSL",
|
||||
"Region": this.region,
|
||||
"ProjectId": access.projectId,
|
||||
"SSLName": certName,
|
||||
"SSLContent": certContent,
|
||||
});
|
||||
|
||||
if (res.RetCode !== 0) {
|
||||
throw new Error(`创建ULB证书失败: ${res.Message || '未知错误'}`);
|
||||
}
|
||||
|
||||
return res.SSLId;
|
||||
}
|
||||
|
||||
|
||||
async getAllCert(access: UCloudAccess) {
|
||||
const certList = [] as any[];
|
||||
const pager = {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
};
|
||||
while (true) {
|
||||
const { list, total } = await this.getCertPage(access, pager);
|
||||
certList.push(...list);
|
||||
if (certList.length >= total) {
|
||||
break;
|
||||
}
|
||||
pager.pageNo++;
|
||||
}
|
||||
// this.logger.info(`----------- certList----------:\n`, certList);
|
||||
return certList;
|
||||
}
|
||||
|
||||
|
||||
async getCertPage(access: UCloudAccess, req: PageSearch = {}) {
|
||||
const pageNo = req.pageNo ?? 1;
|
||||
const pageSize = req.pageSize ?? 100;
|
||||
|
||||
const res = await access.invoke({
|
||||
"Action": "DescribeSSLV2",
|
||||
"Region": this.region,
|
||||
"ProjectId": access.projectId,
|
||||
"Offset": (pageNo - 1) * pageSize,
|
||||
"Limit": pageSize
|
||||
});
|
||||
|
||||
let list = res.DataSet || [];
|
||||
const total = res.TotalCount || list.length;
|
||||
|
||||
list = list.map((item: any) => {
|
||||
const domains = [
|
||||
...item.Domains.split(','),
|
||||
...item.DNSNames.split(',')
|
||||
]
|
||||
return {
|
||||
id: item.SSLId,
|
||||
name: item.SSLName,
|
||||
domain: domains,
|
||||
notAfter: item.NotAfter,
|
||||
notBefore: item.NotBefore,
|
||||
createTime: item.CreateTime,
|
||||
relations: item.Relations,
|
||||
};
|
||||
})
|
||||
return {
|
||||
list: list,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
|
||||
async onGetCertList(req: PageSearch = {}) {
|
||||
const access = await this.getAccess<UCloudAccess>(this.accessId);
|
||||
|
||||
const { list, total } = await this.getCertPage(access, req);
|
||||
|
||||
if (!list || list.length === 0) {
|
||||
throw new Error("没有找到ULB证书,请先在控制台创建ULB证书");
|
||||
}
|
||||
|
||||
const options = list.map((item: any) => {
|
||||
return {
|
||||
label: `${item.name}<${item.id}>`,
|
||||
value: `${item.name}`,
|
||||
domain: item.domain,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
list: options,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new UCloudDeployToULB();
|
||||
@@ -0,0 +1,200 @@
|
||||
import { AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
|
||||
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
|
||||
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
|
||||
import { UCloudAccess } from "../access.js";
|
||||
|
||||
@IsTaskPlugin({
|
||||
name: "UCloudDeployToUS3",
|
||||
title: "UCloud-部署到对象存储(US3)",
|
||||
desc: "将证书部署到UCloud对象存储(US3)",
|
||||
icon: "svg:icon-ucloud",
|
||||
group: pluginGroups.ucloud.key,
|
||||
needPlus: false,
|
||||
default: {
|
||||
strategy: {
|
||||
runStrategy: RunStrategy.SkipWhenSucceed
|
||||
}
|
||||
}
|
||||
})
|
||||
export class UCloudDeployToUS3 extends AbstractTaskPlugin {
|
||||
@TaskInput({
|
||||
title: "域名证书",
|
||||
helper: "请选择前置任务输出的域名证书",
|
||||
component: {
|
||||
name: "output-selector",
|
||||
from: [...CertApplyPluginNames]
|
||||
}
|
||||
})
|
||||
cert!: CertInfo ;
|
||||
|
||||
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
|
||||
certDomains!: string[];
|
||||
|
||||
@TaskInput({
|
||||
title: "UCloud授权",
|
||||
component: {
|
||||
name: "access-selector",
|
||||
type: "ucloud"
|
||||
},
|
||||
required: true
|
||||
})
|
||||
accessId!: string;
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: "存储桶",
|
||||
helper: "要更新的UCloud存储桶",
|
||||
action: UCloudDeployToUS3.prototype.onGetBucketList.name
|
||||
})
|
||||
)
|
||||
bucket!: string;
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: "域名列表",
|
||||
helper: "要更新的UCloud域名列表",
|
||||
action: UCloudDeployToUS3.prototype.onGetDomainList.name
|
||||
})
|
||||
)
|
||||
domainList!: string[];
|
||||
|
||||
async onInstance() {
|
||||
}
|
||||
|
||||
async execute(): Promise<void> {
|
||||
const access = await this.getAccess<UCloudAccess>(this.accessId);
|
||||
let certName = this.appendTimeSuffix("certd")
|
||||
let cert: CertInfo;
|
||||
|
||||
for (const domain of this.domainList) {
|
||||
this.logger.info(`----------- 开始更新存储桶${this.bucket}的域名${domain}证书`);
|
||||
await this.deployToUS3({
|
||||
access: access,
|
||||
bucket: this.bucket,
|
||||
domain: domain,
|
||||
cert: cert,
|
||||
certName: certName
|
||||
});
|
||||
this.logger.info(`----------- 更新存储桶${this.bucket}的域名${domain}证书成功`);
|
||||
}
|
||||
|
||||
this.logger.info("部署完成");
|
||||
}
|
||||
|
||||
async deployToUS3(req: { access: any, bucket: string, domain: string, cert: CertInfo, certName: string }) {
|
||||
const { access, bucket, domain, cert, certName } = req
|
||||
|
||||
const body: any = {
|
||||
"Action": "UpdateUFileSSLCert",
|
||||
"BucketName": bucket,
|
||||
"Domain": domain,
|
||||
"CertificateName": certName,
|
||||
"Certificate": cert.crt,
|
||||
"CertificateKey": cert.key
|
||||
}
|
||||
|
||||
this.logger.info(`----------- 更新对象存储SSL证书${bucket}:${domain},${JSON.stringify(body)}`);
|
||||
const resp = await access.invoke(body);
|
||||
this.logger.info(`----------- 部署对象存储证书${bucket}:${domain}成功,${JSON.stringify(resp)}`);
|
||||
}
|
||||
|
||||
async onGetBucketList(req: PageSearch = {}) {
|
||||
const access = await this.getAccess<UCloudAccess>(this.accessId);
|
||||
|
||||
const pageNo = req.pageNo ?? 1;
|
||||
const pageSize = req.pageSize ?? 100;
|
||||
|
||||
try {
|
||||
const resp = await access.invoke({
|
||||
"Action": "DescribeBucket",
|
||||
"ProjectId": access.projectId,
|
||||
"Offset": (pageNo - 1) * pageSize,
|
||||
"Limit": pageSize
|
||||
});
|
||||
|
||||
this.logger.info(`获取到存储桶列表:${JSON.stringify(resp)}`);
|
||||
|
||||
const buckets = resp.DataSet || [];
|
||||
const total = buckets.length;
|
||||
|
||||
if (!buckets || buckets.length === 0) {
|
||||
throw new Error("没有找到存储桶,请先在控制台创建存储桶");
|
||||
}
|
||||
|
||||
const options = buckets.map((item: any) => {
|
||||
return {
|
||||
label: `${item.BucketName}<${item.Region}>`,
|
||||
value: `${item.BucketName}`,
|
||||
bucket: item.BucketName
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
list: this.ctx.utils.options.buildGroupOptions(options, this.certDomains),
|
||||
total: total,
|
||||
pageNo: pageNo,
|
||||
pageSize: pageSize
|
||||
};
|
||||
} catch (err) {
|
||||
this.logger.error(`获取存储桶列表失败:${err}`);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
async onGetDomainList(req: PageSearch = {}) {
|
||||
const access = await this.getAccess<UCloudAccess>(this.accessId);
|
||||
|
||||
if (!this.bucket) {
|
||||
throw new Error("请先选择存储桶");
|
||||
}
|
||||
|
||||
try {
|
||||
const resp = await access.invoke({
|
||||
"Action": "DescribeBucket",
|
||||
"ProjectId": access.projectId,
|
||||
"BucketName": this.bucket
|
||||
});
|
||||
|
||||
this.logger.info(`获取到存储桶域名列表:${JSON.stringify(resp)}`);
|
||||
|
||||
const buckets = resp.DataSet || [];
|
||||
if (!buckets || buckets.length === 0) {
|
||||
throw new Error(`没有找到存储桶${this.bucket}`);
|
||||
}
|
||||
|
||||
const bucketInfo = buckets[0];
|
||||
const domainSet = bucketInfo.Domain || {};
|
||||
|
||||
const allDomains = [
|
||||
...(domainSet.Src || []),
|
||||
...(domainSet.Cdn || []),
|
||||
...(domainSet.CustomSrc || []),
|
||||
...(domainSet.CustomCdn || [])
|
||||
];
|
||||
|
||||
if (!allDomains || allDomains.length === 0) {
|
||||
throw new Error(`没有找到存储桶${this.bucket}的域名,请先在控制台为存储桶添加域名`);
|
||||
}
|
||||
|
||||
const options = allDomains.map((domain: string) => {
|
||||
return {
|
||||
label: domain,
|
||||
value: domain,
|
||||
domain: domain
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
list: this.ctx.utils.options.buildGroupOptions(options, this.certDomains),
|
||||
total: allDomains.length,
|
||||
pageNo: 1,
|
||||
pageSize: allDomains.length
|
||||
};
|
||||
} catch (err) {
|
||||
this.logger.error(`获取存储桶域名列表失败:${err}`);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new UCloudDeployToUS3();
|
||||
Reference in New Issue
Block a user