Compare commits

...

120 Commits

Author SHA1 Message Date
xiaojunnuo ec466dc818 v1.39.11 2026-04-26 13:31:57 +08:00
xiaojunnuo 181064901d build: prepare to build 2026-04-26 13:28:28 +08:00
xiaojunnuo d1988dc982 perf: 添加全新的未登录首页和路由配置
- 新增产品介绍页,包含导航、功能展示和页脚
- 修改默认首页路由为/index
- 添加点击logo跳转首页功能
- 更新版权信息显示逻辑
2026-04-26 12:30:30 +08:00
xiaojunnuo 1f1d687317 perf: 添加Azure DNS插件支持及文档
添加Azure DNS插件实现,包括DNS记录管理和授权配置
新增Azure使用文档和配置截图
更新依赖添加@azure/arm-dns和@azure/identity包
2026-04-26 03:36:33 +08:00
xiaojunnuo edc7bfc230 perf: 支持google dns插件 2026-04-26 01:56:08 +08:00
xiaojunnuo 7b6b3aa293 chore: skill 优化 2026-04-26 00:51:05 +08:00
xiaojunnuo 2f7514a2e7 perf: 阿里云waf支持云产品接入方式应用的证书部署 2026-04-26 00:12:37 +08:00
xiaojunnuo 575415b93a perf: 模版创建流水线支持随机时间 2026-04-25 19:01:06 +08:00
xiaojunnuo c28dfa8aca chore: 1 2026-04-25 17:39:34 +08:00
xiaojunnuo 91141922ee chore: 优化插件默认设置 2026-04-25 11:43:17 +08:00
xiaojunnuo cc5154e04e perf: 为DNS解析器添加超时配置,避免查询时间过长
在util.js中为dns.Resolver添加超时配置,确保DNS查询在合理时间内完成
2026-04-25 04:45:39 +08:00
xiaojunnuo 77db5ecd12 perf: 优化权威域名服务器查询超时时长 2026-04-25 04:30:48 +08:00
xiaojunnuo 7ac789c9c7 perf: 商业版支持配置证书申请插件参数 2026-04-25 04:12:26 +08:00
xiaojunnuo 24dff05f64 fix: 修复商业版设置了公共eab,创建流水线仍然会显示需要配置eab的bug 2026-04-25 03:32:45 +08:00
xiaojunnuo 64a350364d fix: 修复流水线未编辑模式下也提示未保存的bug 2026-04-25 02:29:25 +08:00
xiaojunnuo 11b7cfe5cb perf: 支持主动修改绑定url地址 2026-04-24 00:11:55 +08:00
xiaojunnuo 71cfcad2a1 fix: 修复列表页面底部滚动条与表格之间有空白间隙的bug 2026-04-24 00:04:42 +08:00
xiaojunnuo ab4373b26e chore: 商业版放开限制,可以切换为企业模式 2026-04-23 23:30:52 +08:00
xiaojunnuo d23ddc96ac chore: 优化安装脚本 2026-04-23 01:24:49 +08:00
xiaojunnuo 147708e779 chore: 1 2026-04-23 01:17:15 +08:00
xiaojunnuo dc969dd7ed perf: 支持一键安装脚本 2026-04-23 01:03:54 +08:00
xiaojunnuo ef7d1d9327 perf: 支持hipm dns mgr 2026-04-22 23:48:12 +08:00
xiaojunnuo 2e6e9ed925 perf: 支持部署到nginx-proxy-manager 2026-04-22 23:47:02 +08:00
HINS 296dcab4c7 perf: 添加HiPMDnsmgr DNS提供商的支持 @WUHINS
* feat: add HiPM DNSMgr DNS provider plugin

- Create plugin-hipmdnsmgr for HiPM DNSMgr integration
- Support API Token authentication (Bearer token)
- Implement createRecord and removeRecord for ACME DNS-01 challenge
- Add getDomainListPage for domain selection
- Register plugin in plugins/index.ts

Features:
- RESTful API integration with DNSMgr
- Automatic domain ID resolution
- Full TypeScript type support

* refactor: reorganize plugin-hipmdnsmgr directory structure

- Move access.ts to access/hipmdnsmgr-access.ts
- Move dns-provider.ts to dns-provider/hipmdnsmgr-dns-provider.ts
- Add index.ts files for proper module exports
- Align with plugin-huawei and plugin-tencent structure

Structure:
  plugin-hipmdnsmgr/
     access/
        hipmdnsmgr-access.ts
        index.ts
     dns-provider/
        hipmdnsmgr-dns-provider.ts
        index.ts
     index.ts
2026-04-22 00:10:13 +08:00
xiaojunnuo f9e1c46c45 chore: 1 2026-04-19 12:26:05 +08:00
xiaojunnuo 94fd5bd7ec chore: 1 2026-04-19 12:25:28 +08:00
xiaojunnuo eb6ca96e85 Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev 2026-04-19 12:24:06 +08:00
xiaojunnuo a2bbc7e272 fix: 修复站点监控某些情况下获取不到证书的bug 2026-04-19 12:23:41 +08:00
xiaojunnuo f075a991f0 chore: 1 2026-04-17 19:34:01 +08:00
xiaojunnuo edeb817c39 perf(technitium): 添加Technitium DNS Server插件支持
- 新增Technitium DNS Server插件,包含DNS提供商和授权配置
- 实现DNS记录创建、删除和域名列表获取功能
- 添加默认DNS传播等待时间配置
- 优化用户取消操作时的错误处理
- 为图标选择组件添加过滤功能
- 更新DNS提供商开发文档
2026-04-17 19:22:10 +08:00
xiaojunnuo 23b4658672 perf: apisix支持v2 2026-04-17 17:04:29 +08:00
ahe 5f95ee987f fix 站点IP监控提示权限不足 (#714) 2026-04-17 16:46:44 +08:00
xiaojunnuo cc73f156a7 chore: 1 2026-04-17 00:56:21 +08:00
xiaojunnuo ee72d10718 build: release 2026-04-12 00:29:18 +08:00
xiaojunnuo 831871d37f build: publish 2026-04-11 23:48:07 +08:00
xiaojunnuo 6072550ec1 build: trigger build image 2026-04-11 23:47:55 +08:00
xiaojunnuo 112a565bf7 v1.39.10 2026-04-11 23:46:27 +08:00
xiaojunnuo 59e5c76286 build: prepare to build 2026-04-11 23:43:16 +08:00
xiaojunnuo 21620ac6bd perf: 流水线修改编辑之后,增加未保存提示 2026-04-11 23:41:20 +08:00
xiaojunnuo d05129ec67 perf: 部署到1panel面板支持mux模式 2026-04-11 23:20:19 +08:00
xiaojunnuo 0998de4ae6 chore: 首页时间动态刷新 2026-04-11 23:10:51 +08:00
xiaojunnuo 2bdf1832da perf: 增加域名管理 子域名检查提醒 2026-04-11 22:43:42 +08:00
xiaojunnuo a846c4b66e chore: 1 2026-04-11 22:21:02 +08:00
xiaojunnuo ee535895a3 perf: 修复检查全部某些情况下无效的bug,优化公共触发站点证书检查定时逻辑 2026-04-11 21:50:44 +08:00
xiaojunnuo 1e549dfd43 fix: 修复流水线任务编辑页面复制粘贴按钮在夜间模式显示问题 2026-04-11 21:07:23 +08:00
xiaojunnuo 6ee718a252 perf: 站点监控域名气泡增加端口显示 2026-04-11 21:02:31 +08:00
xiaojunnuo 557e98c33f fix: 修复用户管理添加用户无法上传头像的bug 2026-04-11 20:56:51 +08:00
xiaojunnuo 7a9eec88e8 perf: 1panel支持先上传证书再选择证书 2026-04-10 00:08:10 +08:00
xiaojunnuo a7a4f66633 chore: 资源迁移到项目提示优化 2026-04-09 18:55:05 +08:00
xiaojunnuo a88d0a6ae1 fix: 修复创建流水线无法选择通知的bug 2026-04-09 18:43:57 +08:00
xiaojunnuo db87bc770e chore: 1 2026-04-09 18:20:36 +08:00
xiaojunnuo 7b6b71cd4b chore: 1 2026-04-08 10:36:02 +08:00
xiaojunnuo df98463325 fix: 修复自定义插件删除后没有反注册的bug 2026-04-07 23:36:05 +08:00
xiaojunnuo f7492db8bd docs: admin mode docs 2026-04-07 23:07:12 +08:00
xiaojunnuo 70b46d4a8f fix: 修复spaceship创建record报错的bug
https://github.com/certd/certd/issues/705
2026-04-07 22:29:30 +08:00
xiaojunnuo 411486e1e7 build: release 2026-04-06 01:53:40 +08:00
xiaojunnuo 6f81305232 build: publish 2026-04-06 01:26:21 +08:00
xiaojunnuo 79bc22d8ce build: trigger build image 2026-04-06 01:26:09 +08:00
xiaojunnuo 1c634a702a v1.39.9 2026-04-06 01:24:46 +08:00
xiaojunnuo 909a9e4050 build: prepare to build 2026-04-06 01:21:18 +08:00
xiaojunnuo b5cc794061 perf(monitor): 支持查看监控执行记录
- 新增监控任务执行记录页面及相关API
- 添加数据库表结构及多数据库支持
- 完善国际化翻译
- 实现批量删除功能
- 优化站点监控服务逻辑
2026-04-06 01:17:02 +08:00
xiaojunnuo 73b8e85976 fix: 修复cn域名获取不到到期时间的问题 2026-04-06 00:33:08 +08:00
xiaojunnuo 282b5d6893 Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev 2026-04-05 23:49:30 +08:00
xiaojunnuo c6628e7311 perf: 支持域名到期时间监控通知 2026-04-05 23:49:25 +08:00
xiaojunnuo 6b109d172f perf: 腾讯云CLB大区增加台北 2026-04-03 11:02:39 +08:00
xiaojunnuo 6b29972399 chore: 修复可选链操作符和DNS管理插件问题
修复多处可选链操作符访问问题,避免潜在的空指针异常
优化DNS管理插件,移除重复的id字段并修正域名匹配逻辑
添加getDomainListPage方法以支持分页查询域名列表
2026-04-03 00:32:00 +08:00
xiaojunnuo 0fcd3c09fd Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev 2026-04-03 00:14:14 +08:00
xiaojunnuo af503442b8 perf(plugin-dnsmgr): 添加彩虹DNS插件支持
实现彩虹DNS管理系统的插件集成,包括DNS记录创建、查询和删除功能
2026-04-03 00:14:08 +08:00
xiaojunnuo c875971b71 perf: 优化腾讯云CLB插件支持选择证书id 2026-04-02 23:27:10 +08:00
xiaojunnuo d1a65922d7 fix: 修复某些情况下报无法修改通知的问题 2026-04-02 16:28:14 +08:00
xiaojunnuo 6ef34f95d5 Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev 2026-04-02 14:51:54 +08:00
xiaojunnuo 8b79022179 chore: 1 2026-04-02 09:05:13 +08:00
xiaojunnuo 21aec77e5c perf(spaceship): 新增Spaceship DNS插件和授权模块
添加Spaceship DNS提供商插件和授权模块,支持域名解析管理
更新相关文档和技能说明,优化错误处理和日志记录
移除调试日志,更新README项目列表
2026-04-02 00:10:28 +08:00
xiaojunnuo 74c5259af8 build: release 2026-04-01 00:29:52 +08:00
xiaojunnuo a3e7d4414d build: publish 2026-03-31 23:59:12 +08:00
xiaojunnuo 986d32eb81 build: trigger build image 2026-03-31 23:59:00 +08:00
xiaojunnuo de0ae14544 v1.39.8 2026-03-31 23:57:25 +08:00
xiaojunnuo 6b52276fb6 build: prepare to build 2026-03-31 23:54:34 +08:00
xiaojunnuo a19ea7489c perf: 支持部署证书到百度CCE 2026-03-31 23:52:12 +08:00
xiaojunnuo 14229c2f00 chore: delete agents 2026-03-31 22:27:42 +08:00
xiaojunnuo 6eb20a1f2e fix: 修复上传头像退出登录的bug 2026-03-31 15:42:02 +08:00
xiaojunnuo 8debac2edf chore: 优化阿里云cdn 2026-03-29 02:40:26 +08:00
xiaojunnuo a68301e4dc perf: 阿里云CDN部署支持根据证书域名自动匹配部署 2026-03-29 02:25:45 +08:00
xiaojunnuo c6a988bc92 perf: dcdn自动匹配部署,支持新增域名感知 2026-03-29 01:57:33 +08:00
xiaojunnuo fe02ce7b64 fix: 修复某些情况下报没有匹配到任何校验方式的bug 2026-03-29 00:13:44 +08:00
xiaojunnuo df012dec90 perf: 阿里云dcdn支持根据证书域名匹配模式 2026-03-28 11:17:50 +08:00
xiaojunnuo 5969425a6f docs: 1 2026-03-26 22:30:37 +08:00
xiaojunnuo b17b1e6463 build: release 2026-03-26 01:28:56 +08:00
xiaojunnuo c99e61c402 build: publish 2026-03-26 01:08:03 +08:00
xiaojunnuo f4aaec8b3c build: trigger build image 2026-03-26 01:07:51 +08:00
xiaojunnuo adc3e6118b v1.39.7 2026-03-26 01:06:27 +08:00
xiaojunnuo d933493c31 build: prepare to build 2026-03-26 01:02:42 +08:00
xiaojunnuo f91d591b03 perf: 支持部署证书到火山引擎vod 2026-03-26 01:01:52 +08:00
xiaojunnuo af6deb99cd perf: 支持部署到火山云tos自定义域名证书
https://github.com/certd/certd/issues/693
2026-03-26 00:05:30 +08:00
xiaojunnuo c5d285f755 Merge branch 'v2-dev' of https://github.com/certd/certd into v2-dev 2026-03-25 12:48:56 +08:00
xiaojunnuo b1eb706925 fix: 修复cname校验报该授权无权限的bug 2026-03-25 12:48:47 +08:00
xiaojunnuo 5a01634ca3 build: release 2026-03-23 00:23:32 +08:00
xiaojunnuo 487676ce13 build: publish 2026-03-23 00:07:52 +08:00
xiaojunnuo 0280ca7b1a build: trigger build image 2026-03-23 00:07:40 +08:00
xiaojunnuo b0ccab41e1 v1.39.6 2026-03-23 00:06:18 +08:00
xiaojunnuo ccda3a3325 build: prepare to build 2026-03-23 00:03:15 +08:00
xiaojunnuo 4b7eeaa6e0 perf: 新增阿里云证书清理插件 2026-03-23 00:02:46 +08:00
xiaojunnuo 2951f0030d build: prepare to build 2026-03-22 23:33:45 +08:00
xiaojunnuo acc2df29de perf: 支持复制粘贴任务步骤 2026-03-22 23:31:24 +08:00
xiaojunnuo 431afd618f perf: 企业模式下面增加个人数据迁移的引导 2026-03-22 00:49:54 +08:00
xiaojunnuo 6d5e5bd692 chore: 优化access edit 请求参数,删除多余的参数 2026-03-21 23:59:11 +08:00
xiaojunnuo ffd2e8149e perf: 火山引擎部署alb证书插件支持部署扩展证书以及删除已过期扩展证书 2026-03-21 23:51:30 +08:00
xiaojunnuo 2ab92dc13e chore: cnb_sync 2026-03-20 18:14:31 +08:00
xiaojunnuo 7f6a8bc87e perf: 优化远程数据选择框,选择数据时不刷新闪烁 2026-03-20 18:04:13 +08:00
xiaojunnuo b1ff163a28 fix: 修复模版id不正确导致修改到错误的模版流水线bug 2026-03-20 17:48:47 +08:00
xiaojunnuo 440d55ccb8 chore: sync push 2026-03-20 13:53:12 +08:00
xiaojunnuo 285532d431 fix: remote-select默认pageSize设置为50,阿里云WAF不支持pageSize100 2026-03-20 13:44:49 +08:00
xiaojunnuo f2c47459f8 Merge branch 'v2' of https://github.com/certd/certd into v2 2026-03-20 12:09:01 +08:00
xiaojunnuo 49703f08e5 fix: 修复批量执行按钮无效的bug 2026-03-20 12:08:55 +08:00
xiaojunnuo 1d0aa9573b Merge branch 'v2' of https://github.com/certd/certd into v2 2026-03-19 01:12:34 +08:00
xiaojunnuo b2014cf88b build: release 2026-03-19 01:11:46 +08:00
xiaojunnuo a0e0078bad build: prepare to build 2026-03-19 01:09:00 +08:00
xiaojunnuo 5ebca21c32 build: publish 2026-03-19 00:52:27 +08:00
xiaojunnuo 970aea90c9 build: trigger build image 2026-03-19 00:52:15 +08:00
xiaojunnuo 3332d2288f chore: 支持推送到cnb 2026-03-18 16:16:22 +08:00
271 changed files with 19761 additions and 1866 deletions
@@ -17,6 +17,7 @@ jobs:
with:
fetch-depth: 0
lfs: true
ref: v2-dev
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
run: |
git config --global user.name "xiaojunnuo"
+1
View File
@@ -17,6 +17,7 @@ jobs:
with:
fetch-depth: 0
lfs: true
ref: v2
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
run: |
git config --global user.name "xiaojunnuo"
+35
View File
@@ -0,0 +1,35 @@
name: sync-to-cnb-dev
on:
push:
branches: ['v2-dev']
# schedule:
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
# - cron: '17 19 * * *'
permissions:
contents: read
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
ref: v2-dev
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
run: |
git config --global user.name "xiaojunnuo"
git config --global user.email "xiaojunnuo@qq.com"
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
uses: de-vri-es/setup-git-credentials@v2
with: # token 格式为: username:password
credentials: https://cnb:${{secrets.CNB_TOKEN}}@cnb.cool
- name: push to cnb # 4. 执行同步
run: |
git remote add upstream https://cnb.cool/certd/certd.git
git push --set-upstream upstream v2-dev
+34
View File
@@ -0,0 +1,34 @@
name: sync-to-cnb
on:
push:
branches: ['v2']
# schedule:
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
# - cron: '17 19 * * *'
permissions:
contents: read
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
run: |
git config --global user.name "xiaojunnuo"
git config --global user.email "xiaojunnuo@qq.com"
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
uses: de-vri-es/setup-git-credentials@v2
with: # token 格式为: username:password
credentials: https://cnb:${{secrets.CNB_TOKEN}}@cnb.cool
- name: push to cnb # 4. 执行同步
run: |
git remote add upstream https://cnb.cool/certd/certd.git
git push --set-upstream upstream v2
+1
View File
@@ -17,6 +17,7 @@ jobs:
with:
fetch-depth: 0
lfs: true
ref: v2-dev
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
run: |
git config --global user.name "xiaojunnuo"
+265 -175
View File
@@ -1,177 +1,59 @@
---
name: access-plugin-dev
description: 用于开发 Certd 系统中的 Access 插件,存储用户第三方应用授权数据并对接实现第三方 API 接口。当用户需要创建授权插件、实现第三方API接口、添加新的授权方式或修改现有 Access 插件时触发。
version: 1.0.0
---
# Access 插件开发技能
## 什么是 Access 插件
## 角色定义
你是一名 Certd 插件开发专家,擅长创建和实现 Access 类型的插件,熟悉 TypeScript 编程和 Certd 插件开发规范。
Access 插件是 Certd 系统中用于存储用户第三方应用授权数据的插件,例如用户名密码、accessSecret 或 accessToken 等。同时,它还负责对接实现第三方的 API 接口,供其他插件调用使用。
## 核心指令
请严格按照以下步骤执行任务:
## 开发步骤
1. **导入必要的依赖**
- 导入 `AccessInput`, `BaseAccess`, `IsAccess`, `Pager`, `PageRes`, `PageSearch` 等必要的类型和装饰器
- 导入 `DomainRecord` 等相关类型
### 1. 导入必要的依赖
2. **使用 @IsAccess 注解注册插件**
- 配置插件的唯一标识、标题、图标和描述
- 继承 `BaseAccess`
```typescript
import { AccessInput, BaseAccess, IsAccess, Pager, PageRes, PageSearch } from '@certd/pipeline';
import { DomainRecord } from '@certd/plugin-lib';
```
3. **定义授权属性**
- 使用 `@AccessInput` 注解定义授权属性
- 配置属性的标题、默认值、组件类型和验证规则
- 对于敏感信息,设置 `encrypt: true` 进行加密
### 2. 使用 @IsAccess 注解注册插件
4. **实现测试方法**
- 添加测试按钮配置
- 实现 `onTestRequest` 方法,用于测试接口调用是否正常
```typescript
@IsAccess({
name: 'demo', // 插件唯一标识
title: '授权插件示例', // 插件标题
icon: 'clarity:plugin-line', // 插件图标
desc: '这是一个示例授权插件,用于演示如何实现一个授权插件', // 插件描述
})
export class DemoAccess extends BaseAccess {
// 插件实现...
}
```
5. **实现 API 方法**
- 实现必要的 API 方法,如 `GetDomainList`
- 封装统一的 API 请求方法 `doRequest`,处理错误和日志
### 3. 定义授权属性
6. **遵循开发最佳实践**
- 使用 `this.ctx.logger` 输出日志
- 统一处理错误,抛出明确的错误信息
- 实现代码复用,避免重复逻辑
使用 `@AccessInput` 注解定义授权属性:
## 输出规范
- 必须包含完整的插件实现代码,包括所有必要的导入语句
- 代码必须包含详细的注释说明,解释每个步骤的目的和实现细节
- 提供完整的示例代码,展示插件的使用方法,包括不同类型的授权方式
- 代码块必须使用正确的语法高亮,确保代码可读性
- 包含开发技巧和注意事项,帮助开发者避免常见错误
- 输出内容必须结构清晰,使用适当的标题和列表格式
```typescript
@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 = '';
### 示例 1: 基本 Access 插件
@AccessInput({
title: '密钥',//标题
required: true, //text组件可以省略
encrypt: true, //该属性是否需要加密
})
demoKeySecret = '';
#### 用户输入
创建一个 Access 插件,用于存储第三方应用的授权信息并提供 API 接口。
@AccessInput({
title: '另外一个授权Id',//标题
component: {
name:"access-selector", //access选择组件
vModel:"modelValue",
type: "ssh", // access类型,让用户固定选择这种类型的access
},
required: true, //text组件可以省略
})
otherAccessId;
```
### 4. 实现测试方法
```typescript
@AccessInput({
title: "测试",
component: {
name: "api-test",
action: "TestRequest"
},
helper: "点击测试接口是否正常"
})
testRequest = true;
/**
* 会通过上面的testRequest参数在ui界面上生成测试按钮,供用户测试接口调用是否正常
*/
async onTestRequest() {
await this.GetDomainList({});
return "ok"
}
```
### 5. 实现 API 方法
```typescript
/**
* 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文档
*/
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. **插件命名**:插件名称应简洁明了,反映其功能。
2. **属性加密**:对于敏感信息(如密钥),应设置 `encrypt: true`
3. **日志输出**:必须使用 `this.ctx.logger` 输出日志,而不是 `console`
4. **错误处理**:API 调用失败时应抛出明确的错误信息。
5. **测试方法**:实现 `onTestRequest` 方法,以便用户可以测试授权是否正常。
## 完整示例
#### 你的回答
```typescript
import { AccessInput, BaseAccess, IsAccess, Pager, PageRes, PageSearch } from '@certd/pipeline';
@@ -189,7 +71,7 @@ import { DomainRecord } from '@certd/plugin-lib';
})
export class DemoAccess extends BaseAccess {
/**
/**
* 授权属性配置
*/
@AccessInput({
@@ -235,7 +117,6 @@ export class DemoAccess extends BaseAccess {
})
demoKeySecret = '';
@AccessInput({
title: "测试",
component: {
@@ -255,7 +136,7 @@ export class DemoAccess extends BaseAccess {
}
/**
* api接口示例 取域名列表
* api接口示例 取域名列表
*/
async GetDomainList(req: PageSearch): Promise<PageRes<DomainRecord>> {
//输出日志必须使用ctx.logger
@@ -281,21 +162,10 @@ export class DemoAccess extends BaseAccess {
};
}
// 还可以继续编写API
/**
* 通用api调用方法, 具体如何构造请求体,需参考对应应用的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",
@@ -312,4 +182,224 @@ export class DemoAccess extends BaseAccess {
return res.Resp;
}
}
```
### 示例 2: 支持 OAuth 授权的 Access 插件
#### 用户输入
创建一个支持 OAuth 授权方式的 Access 插件。
#### 你的回答
```typescript
import { AccessInput, BaseAccess, IsAccess, Pager, PageRes, PageSearch } from '@certd/pipeline';
import { DomainRecord } from '@certd/plugin-lib';
/**
* OAuth 授权插件示例
*/
@IsAccess({
name: 'oauth-demo',
title: 'OAuth授权插件示例',
icon: 'clarity:plugin-line',
desc: '这是一个支持OAuth授权的插件示例',
})
export class OAuthDemoAccess extends BaseAccess {
@AccessInput({
title: '授权方式',
value: 'oauth',
component: {
name: "a-select",
vModel: "value",
options: [
{
label: "OAuth授权",
value: "oauth"
},
{
label: "API密钥",
value: "apiKey"
},
],
},
required: true,
})
authType = '';
@AccessInput({
title: '客户端ID',
component: {
name:"a-input",
placeholder: 'Client ID',
},
required: true,
})
clientId = '';
@AccessInput({
title: '客户端密钥',
required: true,
encrypt: true,
})
clientSecret = '';
@AccessInput({
title: '授权回调地址',
component: {
name:"a-input",
placeholder: 'https://your-domain.com/callback',
},
required: true,
})
redirectUri = '';
@AccessInput({
title: 'AccessToken',
required: true,
encrypt: true,
})
accessToken = '';
@AccessInput({
title: 'RefreshToken',
encrypt: true,
})
refreshToken = '';
@AccessInput({
title: "测试",
component: {
name: "api-test",
action: "TestOAuth"
},
helper: "点击测试OAuth授权是否正常"
})
testOAuth = true;
/**
* 测试OAuth授权
*/
async onTestOAuth() {
try {
// 测试AccessToken是否有效
const result = await this.doOAuthRequest('GET', '/api/user/profile');
this.ctx.logger.info('OAuth测试成功:', result);
return "OAuth授权测试成功";
} catch (error) {
this.ctx.logger.error('OAuth测试失败:', error);
throw new Error('OAuth授权测试失败');
}
}
/**
* OAuth API请求方法
*/
async doOAuthRequest(method: string, endpoint: string, data?: any) {
const res = await this.ctx.http.request({
url: `https://api.oauth-demo.com${endpoint}`,
method,
headers: {
'Authorization': `Bearer ${this.accessToken}`,
'Content-Type': 'application/json'
},
data
});
if (res.status !== 200) {
throw new Error(`API请求失败: ${res.status} ${res.statusText}`);
}
return res.data;
}
/**
* 刷新AccessToken
*/
async refreshAccessToken() {
if (!this.refreshToken) {
throw new Error('没有提供RefreshToken');
}
const res = await this.ctx.http.request({
url: 'https://api.oauth-demo.com/oauth/token',
method: 'POST',
data: {
grant_type: 'refresh_token',
refresh_token: this.refreshToken,
client_id: this.clientId,
client_secret: this.clientSecret
}
});
if (res.status === 200 && res.data.access_token) {
this.accessToken = res.data.access_token;
if (res.data.refresh_token) {
this.refreshToken = res.data.refresh_token;
}
return true;
}
throw new Error('刷新AccessToken失败');
}
/**
* 获取域名列表
*/
async GetDomainList(req: PageSearch): Promise<PageRes<DomainRecord>> {
try {
const res = await this.doOAuthRequest('GET', '/api/domains', {
search: req.searchKey,
page: req.page,
pageSize: req.pageSize
});
return {
total: res.total,
list: res.items.map((item: any) => ({
id: item.id,
domain: item.domain
}))
};
} catch (error) {
// 尝试刷新AccessToken并重试
if (error.message.includes('401')) {
await this.refreshAccessToken();
const res = await this.doOAuthRequest('GET', '/api/domains', {
search: req.searchKey,
page: req.page,
pageSize: req.pageSize
});
return {
total: res.total,
list: res.items.map((item: any) => ({
id: item.id,
domain: item.domain
}))
};
}
throw error;
}
}
}
```
## 注意事项
1. **插件命名**:插件名称应简洁明了,反映其功能。
2. **属性加密**:对于敏感信息(如密钥),应设置 `encrypt: true`
3. **日志输出**:必须使用 `this.ctx.logger` 输出日志,而不是 `console`,参数文本化,不要传对象,否则会输出`[object Object]}`
4. **错误处理**:API 调用失败时应抛出明确的错误信息。
5. **测试方法**:实现 `onTestRequest` 方法,以便用户可以测试授权是否正常。
6. **统一接口调用**:封装统一的 API 请求方法,避免重复编写错误处理逻辑。
## 开发技巧
### 实现统一的 API 请求封装
**好处:**
- **代码复用**:避免在每个 API 方法中重复编写相同的 header 设置和错误处理逻辑
- **错误处理一致**:统一捕获和处理各种错误情况,确保错误信息格式统一
- **日志记录完善**:集中记录详细的错误信息,便于调试和问题排查
- **接口调用简化**:调用方只需关注业务逻辑,无需关心底层请求细节
- **易于维护**:统一修改 API 调用方式时,只需修改一处代码
```
+13
View File
@@ -0,0 +1,13 @@
你是一名资深nodejs工程师,擅长开发Certd开源系统的任务插件。
certd是一款全自动证书申请部署管理工具,基于流水线的方式,通过里面申请证书插件申请证书,然后将证书传递给下一个部署任务插件,不同的部署任务插件将证书部署到用户的各个应用系统当中。
certd插件分成以下几种类型:
Access:存储用户的第三放应用的授权数据,比如用户名密码,accessSecret 或 accessToken等。同时它里面的方法还负责对接第三方的api接口
Task 部署任务插件,它继承AbstractTaskPlugin类,被流水线调用execute方法,将证书部署到对应的应用上
DnsProvider: DNS提供商插件,它用于在ACME申请证书时给域名添加txt解析记录。
注意事项:
1、使用技能:在开始工作前,请阅读并加载.trae/skills下面的技能,根据skills进行相应的插件开发
2、迭代技能:当开发过程用户提醒你更好的做法时,你需要总结经验,更新相应的skills,让skills越来越完善,能够在以后得新插件开发中具备指导意义。
3、一般调用的api接口文档会比较复杂,你不知道接口是什么时,请务必询问用户,让用户提供API接口文档
4、完成开发后无需测试,通知用户自己去测试
+378 -148
View File
@@ -1,139 +1,82 @@
---
name: dns-provider-dev
description: 用于开发 Certd 系统中的 DNS Provider 插件,在 ACME 申请证书时给域名添加 TXT 解析记录以验证域名所有权。当用户需要创建DNS提供商插件、实现DNS解析、ACME证书验证或修改现有 DNS Provider 插件时触发。
version: 1.0.0
---
# DNS Provider 插件开发技能
## 什么是 DNS Provider 插件
## 角色定义
你是一名 Certd 插件开发专家,擅长创建和实现 DNS Provider 类型的插件,熟悉 TypeScript 编程和 Certd 插件开发规范。
DNS Provider 插件是 Certd 系统中的 DNS 提供商插件,它用于在 ACME 申请证书时给域名添加 TXT 解析记录,以验证域名所有权。
## 核心指令
请严格按照以下步骤执行任务:
## 开发步骤
1. **导入必要的依赖**
- 导入 `AbstractDnsProvider`, `CreateRecordOptions`, `IsDnsProvider`, `RemoveRecordOptions` 等必要的类型和装饰器
- 导入对应的 Access 插件类型
### 1. 导入必要的依赖
2. **定义记录数据结构**
- 定义适合对应云平台的记录数据结构
- 至少包含 id 字段,用于后续删除记录
3. **使用 @IsDnsProvider 注解注册插件**
- 配置插件的唯一标识、标题、描述、图标
- 指定对应的云平台的 access 类型名称
- 设置排序值(可选)
- 继承 `AbstractDnsProvider`
4. **实现 onInstance 方法**
- 获取并保存对应的 Access 实例
- 执行初始化操作
5. **实现 createRecord 方法**
- 解析传入的参数(fullRecord, value, type, domain
- 记录操作开始日志
- 调用云平台 API 创建 TXT 类型的 DNS 解析记录
- 处理可能的错误:网络错误、API调用失败、授权失败等
- 记录操作结果日志
- 返回创建的记录信息,用于后续删除操作
6. **实现 removeRecord 方法**
- 解析传入的参数和之前创建的记录信息
- 记录操作开始日志
- 调用云平台 API 删除 TXT 类型的 DNS 解析记录
- 处理可能的错误:网络错误、API调用失败、记录不存在等
- 记录操作结果日志
7. **实现 getDomainListPage 方法**
- 实现获取域名列表的方法
- 支持分页查询
- 处理可能的错误:网络错误、API调用失败、授权失败等
- 返回标准化的域名列表格式
8. **实例化插件**
- 实例化插件,确保插件被注册
## 输出规范
- 必须包含完整的插件实现代码
- 代码必须包含详细的注释说明
- 提供完整的示例代码,展示插件的使用方法
- 包含开发注意事项
## 示例
### 示例 1: 基本 DNS Provider 插件
#### 用户输入
创建一个 DNS Provider 插件,用于在 ACME 申请证书时添加和删除 TXT 解析记录。
#### 你的回答
```typescript
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
import { Pager, PageRes, PageSearch } from "@certd/pipeline";
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions, DomainRecord } from '@certd/plugin-cert';
import { DemoAccess } from './access.js';
import { isDev } from '../../utils/env.js';
```
### 2. 定义记录数据结构
```typescript
type DemoRecord = {
// 这里定义 Record 记录的数据结构,跟对应云平台接口返回值一样即可,一般是拿到 id 就行,用于删除 txt 解析记录,清理申请痕迹
// id:string
};
```
### 3. 使用 @IsDnsProvider 注解注册插件
```typescript
// 这里通过 IsDnsProvider 注册一个 dnsProvider
@IsDnsProvider({
name: 'demo', // 插件唯一标识
title: 'Dns提供商Demo', // 插件标题
desc: 'dns provider示例', // 插件描述
icon: 'clarity:plugin-line', // 插件图标
// 这里是对应的云平台的 access 类型名称
accessType: 'demo',
order: 99, // 排序
})
export class DemoDnsProvider extends AbstractDnsProvider<DemoRecord> {
access!: DemoAccess;
async onInstance() {
this.access = this.ctx.access as DemoAccess;
// 也可以通过 ctx 成员变量传递 context
this.logger.debug('access', this.access);
// 初始化的操作
// ...
}
// 插件实现...
}
```
### 4. 实现 createRecord 方法
```typescript
/**
* 创建 dns 解析记录,用于验证域名所有权
*/
async createRecord(options: CreateRecordOptions): Promise<any> {
/**
* options 参数说明
* fullRecord: '_acme-challenge.example.com',
* value: 一串 uuid
* type: 'TXT',
* domain: 'example.com'
*/
const { fullRecord, value, type, domain } = options;
this.logger.info('添加域名解析:', fullRecord, value, type, domain);
// 调用创建 dns 解析记录的对应的云端接口,创建 txt 类型的 dns 解析记录
// 请根据实际接口情况调用,例如:
// const createDnsRecordUrl = "xxx"
// const record = this.http.post(createDnsRecordUrl,{
// // 授权参数
// // 创建 dns 解析记录的参数
// })
// // 返回本次创建的 dns 解析记录,这个记录会在删除的时候用到
// return record
}
```
### 5. 实现 removeRecord 方法
```typescript
/**
* 删除 dns 解析记录,清理申请痕迹
* @param options
*/
async removeRecord(options: RemoveRecordOptions<DemoRecord>): Promise<void> {
const { fullRecord, value, domain } = options.recordReq;
const record = options.recordRes;
this.logger.info('删除域名解析:', domain, fullRecord, value, record);
// 这里调用删除 txt dns 解析记录接口
// 请根据实际接口情况调用,例如:
// const deleteDnsRecordUrl = "xxx"
// const res = this.http.delete(deleteDnsRecordUrl,{
// // 授权参数
// // 删除 dns 解析记录的参数
// })
this.logger.info('删除域名解析成功:', fullRecord, value);
}
```
### 6. 实例化插件
```typescript
// 实例化这个 provider,将其自动注册到系统中
if (isDev()) {
// 你的实现 要去掉这个 if,不然生产环境将不会显示
new DemoDnsProvider();
}
```
## 注意事项
1. **插件命名**:插件名称应简洁明了,反映其功能。
2. **accessType**:必须指定对应的云平台的 access 类型名称。
3. **记录结构**:定义适合对应云平台的记录数据结构,至少包含 id 字段用于删除记录。
4. **日志输出**:使用 `this.logger` 输出日志,而不是 `console`
5. **错误处理**:API 调用失败时应抛出明确的错误信息。
6. **实例化**:生产环境中应移除 `if (isDev())` 条件,确保插件在生产环境中也能被注册。
## 完整示例
```typescript
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
import { DemoAccess } from './access.js';
import { isDev } from '../../utils/env.js';
type DemoRecord = {
// 这里定义 Record 记录的数据结构,跟对应云平台接口返回值一样即可,一般是拿到 id 就行,用于删除 txt 解析记录,清理申请痕迹
// id:string
// 这里定义 Record 记录的数据结构,跟对应云平台接口返回值一样即可
id: string;
};
// 这里通过 IsDnsProvider 注册一个 dnsProvider
@@ -171,15 +114,23 @@ export class DemoDnsProvider extends AbstractDnsProvider<DemoRecord> {
const { fullRecord, value, type, domain } = options;
this.logger.info('添加域名解析:', fullRecord, value, type, domain);
// 调用创建 dns 解析记录的对应的云端接口,创建 txt 类型的 dns 解析记录
// 请根据实际接口情况调用,例如:
// const createDnsRecordUrl = "xxx"
// const record = this.http.post(createDnsRecordUrl,{
// // 授权参数
// // 创建 dns 解析记录的参数
// })
// // 返回本次创建的 dns 解析记录,这个记录会在删除的时候用到
// return record
try {
// 调用创建 dns 解析记录的对应的云端接口,创建 txt 类型的 dns 解析记录
// 请根据实际接口情况调用,例如:
// const createDnsRecordUrl = "xxx"
// const record = this.http.post(createDnsRecordUrl,{
// // 授权参数
// // 创建 dns 解析记录的参数
// })
// // 返回本次创建的 dns 解析记录,这个记录会在删除的时候用到
// return record
// 模拟返回
return { id: 'demo-record-id' };
} catch (error) {
this.logger.error('创建DNS记录失败:', error);
throw new Error(`创建DNS记录失败: ${error.message}`);
}
}
/**
@@ -190,23 +141,302 @@ export class DemoDnsProvider extends AbstractDnsProvider<DemoRecord> {
const { fullRecord, value, domain } = options.recordReq;
const record = options.recordRes;
this.logger.info('删除域名解析:', domain, fullRecord, value, record);
// 这里调用删除 txt dns 解析记录接口
// 请根据实际接口情况调用,例如:
try {
// 这里调用删除 txt dns 解析记录接口
// 请根据实际接口情况调用,例如:
// const deleteDnsRecordUrl = "xxx"
// const res = this.http.delete(deleteDnsRecordUrl,{
// // 授权参数
// // 删除 dns 解析记录的参数
// })
this.logger.info('删除域名解析成功:', fullRecord, value);
} catch (error) {
this.logger.error('删除DNS记录失败:', error);
// 即使删除失败也不抛出异常,避免影响整个证书申请流程
}
}
// const deleteDnsRecordUrl = "xxx"
// const res = this.http.delete(deleteDnsRecordUrl,{
// // 授权参数
// // 删除 dns 解析记录的参数
// })
/**
* 实现获取域名列表
*/
async getDomainListPage(req: PageSearch): Promise<PageRes<DomainRecord>> {
try {
const pager = new Pager(req);
const res = await this.http.request({
// 请求接口获取域名列表
})
const list = res.Domains?.map(item => ({
id: item.Id,
domain: item.DomainName,
})) || []
this.logger.info('删除域名解析成功:', fullRecord, value);
return {
list,
total: res.Total,
};
} catch (error) {
this.logger.error('获取域名列表失败:', error);
return { list: [], total: 0 };
}
}
}
// 实例化这个 provider,将其自动注册到系统中
if (isDev()) {
// 你的实现 要去掉这个 if,不然生产环境将不会显示
new DemoDnsProvider();
new DemoDnsProvider();
```
### 示例 2: 阿里云 DNS Provider 插件
#### 用户输入
创建一个阿里云 DNS Provider 插件,用于在 ACME 申请证书时添加和删除 TXT 解析记录。
#### 你的回答
```typescript
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions, PageSearch, PageRes, DomainRecord } from '@certd/plugin-cert';
import { AliyunAccess } from './aliyun-access.js';
import { Pager } from '@certd/pipeline';
type AliyunRecord = {
RecordId: string;
};
// 阿里云 DNS Provider 插件
@IsDnsProvider({
name: 'aliyun',
title: '阿里云DNS',
desc: '阿里云DNS提供商插件',
icon: 'clarity:plugin-line',
accessType: 'aliyun',
order: 10,
})
export class AliyunDnsProvider extends AbstractDnsProvider<AliyunRecord> {
access!: AliyunAccess;
async onInstance() {
this.access = this.ctx.access as AliyunAccess;
this.logger.debug('阿里云Access实例初始化成功');
}
/**
* 创建 DNS 解析记录
*/
async createRecord(options: CreateRecordOptions): Promise<AliyunRecord> {
const { fullRecord, value, type, domain } = options;
this.logger.info('阿里云DNS: 添加解析记录', { fullRecord, value, type, domain });
try {
// 提取主机记录
const hostRecord = fullRecord.replace(`.${domain}`, '');
// 调用阿里云 API 创建解析记录
const response = await this.access.doRequest({
action: 'AddDomainRecord',
data: {
DomainName: domain,
RR: hostRecord,
Type: type,
Value: value,
TTL: 600, // 10分钟
}
});
this.logger.info('阿里云DNS: 解析记录创建成功', { RecordId: response.RecordId });
return { RecordId: response.RecordId };
} catch (error) {
this.logger.error('阿里云DNS: 创建解析记录失败', error);
throw new Error(`阿里云DNS创建解析记录失败: ${error.message}`);
}
}
/**
* 删除 DNS 解析记录
*/
async removeRecord(options: RemoveRecordOptions<AliyunRecord>): Promise<void> {
const { fullRecord, value, domain } = options.recordReq;
const record = options.recordRes;
this.logger.info('阿里云DNS: 删除解析记录', { fullRecord, value, domain, RecordId: record.RecordId });
try {
// 调用阿里云 API 删除解析记录
await this.access.doRequest({
action: 'DeleteDomainRecord',
data: {
RecordId: record.RecordId,
}
});
this.logger.info('阿里云DNS: 解析记录删除成功', { RecordId: record.RecordId });
} catch (error) {
this.logger.error('阿里云DNS: 删除解析记录失败', error);
// 即使删除失败也不抛出异常,避免影响整个证书申请流程
}
}
/**
* 获取域名列表
*/
async getDomainListPage(req: PageSearch): Promise<PageRes<DomainRecord>> {
try {
const pager = new Pager(req);
const response = await this.access.doRequest({
action: 'DescribeDomains',
data: {
PageNumber: pager.page,
PageSize: pager.pageSize,
KeyWord: req.searchKey,
}
});
const list = response.Domains.Domain.map((domain: any) => ({
id: domain.DomainId,
domain: domain.DomainName,
}));
return {
list,
total: response.TotalCount,
};
} catch (error) {
this.logger.error('阿里云DNS: 获取域名列表失败', error);
return { list: [], total: 0 };
}
}
}
```
// 实例化插件
new AliyunDnsProvider();
```
### 示例 3: 腾讯云 DNS Provider 插件
#### 用户输入
创建一个腾讯云 DNS Provider 插件,用于在 ACME 申请证书时添加和删除 TXT 解析记录。
#### 你的回答
```typescript
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions, PageSearch, PageRes, DomainRecord } from '@certd/plugin-cert';
import { TencentAccess } from './tencent-access.js';
import { Pager } from '@certd/pipeline';
type TencentRecord = {
RecordId: string;
};
// 腾讯云 DNS Provider 插件
@IsDnsProvider({
name: 'tencent',
title: '腾讯云DNS',
desc: '腾讯云DNS提供商插件',
icon: 'clarity:plugin-line',
accessType: 'tencent',
order: 20,
})
export class TencentDnsProvider extends AbstractDnsProvider<TencentRecord> {
access!: TencentAccess;
async onInstance() {
this.access = this.ctx.access as TencentAccess;
this.logger.debug('腾讯云Access实例初始化成功');
}
/**
* 创建 DNS 解析记录
*/
async createRecord(options: CreateRecordOptions): Promise<TencentRecord> {
const { fullRecord, value, type, domain } = options;
this.logger.info('腾讯云DNS: 添加解析记录', { fullRecord, value, type, domain });
try {
// 提取主机记录
const hostRecord = fullRecord.replace(`.${domain}`, '');
// 调用腾讯云 API 创建解析记录
const response = await this.access.doRequest({
action: 'CreateRecord',
data: {
Domain: domain,
SubDomain: hostRecord,
RecordType: type,
RecordValue: value,
TTL: 600, // 10分钟
}
});
this.logger.info('腾讯云DNS: 解析记录创建成功', { RecordId: response.RecordId });
return { RecordId: response.RecordId };
} catch (error) {
this.logger.error('腾讯云DNS: 创建解析记录失败', error);
throw new Error(`腾讯云DNS创建解析记录失败: ${error.message}`);
}
}
/**
* 删除 DNS 解析记录
*/
async removeRecord(options: RemoveRecordOptions<TencentRecord>): Promise<void> {
const { fullRecord, value, domain } = options.recordReq;
const record = options.recordRes;
this.logger.info('腾讯云DNS: 删除解析记录', { fullRecord, value, domain, RecordId: record.RecordId });
try {
// 调用腾讯云 API 删除解析记录
await this.access.doRequest({
action: 'DeleteRecord',
data: {
RecordId: record.RecordId,
}
});
this.logger.info('腾讯云DNS: 解析记录删除成功', { RecordId: record.RecordId });
} catch (error) {
this.logger.error('腾讯云DNS: 删除解析记录失败', error);
// 即使删除失败也不抛出异常,避免影响整个证书申请流程
}
}
/**
* 获取域名列表
*/
async getDomainListPage(req: PageSearch): Promise<PageRes<DomainRecord>> {
try {
const pager = new Pager(req);
const response = await this.access.doRequest({
action: 'DescribeDomains',
data: {
Offset: (pager.page - 1) * pager.pageSize,
Limit: pager.pageSize,
Keyword: req.searchKey,
}
});
const list = response.Domains.map((domain: any) => ({
id: domain.DomainId,
domain: domain.DomainName,
}));
return {
list,
total: response.TotalCount,
};
} catch (error) {
this.logger.error('腾讯云DNS: 获取域名列表失败', error);
return { list: [], total: 0 };
}
}
}
// 实例化插件
new TencentDnsProvider();
```
## 注意事项
1. **插件命名**:插件名称应简洁明了,反映其功能。
2. **accessType**:必须指定对应的云平台的 access 类型名称。
3. **记录结构**:定义适合对应云平台的记录数据结构,至少包含 id 字段用于删除记录。
4. **日志输出**:使用 `this.logger` 输出日志,而不是 `console`,参数文本化,不要传对象,否则会输出`[object Object]}`
5. **错误处理**:API 调用失败时应抛出明确的错误信息。
+192 -117
View File
@@ -1,126 +1,90 @@
---
name: plugin-converter
description: 用于将 Certd 插件转换为 YAML 配置文件的命令行工具,支持分析单个插件文件、识别插件类型并生成对应的 YAML 配置。当用户需要生成插件配置、转换插件格式、批量处理插件或修改现有插件配置时触发。
version: 1.0.0
---
# 插件转换工具技能
## 什么是插件转换工具
## 角色定义
你是一名 Certd 插件开发专家,擅长使用插件转换工具将 Certd 插件转换为 YAML 配置文件,熟悉命令行工具的使用和 Certd 插件开发规范。
插件转换工具是一个用于将 Certd 插件转换为 YAML 配置文件的命令行工具。它可以分析单个插件文件,识别插件类型,并生成对应的 YAML 配置,可以让插件分发和在线注册。
## 核心指令
请严格按照以下步骤执行任务:
## 工具位置
1. **定位工具位置**
- 工具位于 `trae/skills/convert-plugin-to-yaml.js`
`trae/skills/convert-plugin-to-yaml.js`
2. **了解功能特性**
- 单个插件转换:支持指定单个插件文件进行转换
- 批量插件转换:支持指定目录批量转换多个插件
- 自动类型识别:自动识别插件类型(Access、Task、DNS Provider、Notification、Addon
- 详细日志输出:提供详细的转换过程日志
- YAML 配置生成:生成标准的 YAML 配置文件
- 配置文件保存:自动将生成的配置保存到 `./metadata` 目录
- 自定义输出目录:支持指定自定义输出目录
- 格式化输出:支持格式化 YAML 输出
- 可复用函数:导出了可复用的函数,便于其他模块调用
## 功能特性
3. **使用工具**
- 基本用法:`node trae/skills/convert-plugin-to-yaml.js <插件文件路径>`
- 批量转换:`node trae/skills/convert-plugin-to-yaml.js <目录路径>`
- 自定义输出目录:`node trae/skills/convert-plugin-to-yaml.js <插件文件路径> --output <输出目录>`
- 格式化输出:`node trae/skills/convert-plugin-to-yaml.js <插件文件路径> --format`
- 示例:
- 转换 Access 插件:`node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js`
- 转换 Task 插件:`node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.js`
- 转换 DNS Provider 插件:`node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/dns-provider.js`
- 批量转换插件:`node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/`
- 自定义输出目录:`node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js --output ./configs`
- **单个插件转换**:支持指定单个插件文件进行转换,而不是扫描整个目录
- **自动类型识别**:自动识别插件类型(Access、Task、DNS Provider、Notification、Addon
- **详细日志输出**:提供详细的转换过程日志,便于调试
- **YAML 配置生成**:生成标准的 YAML 配置文件
- **配置文件保存**:自动将生成的配置保存到 `./metadata` 目录
- **可复用函数**:导出了可复用的函数,便于其他模块调用
4. **理解转换过程**
- 加载插件模块:使用 `import()` 动态加载指定的插件文件
- 分析插件定义:检查模块导出的对象,寻找带有 `define` 属性的插件
- 识别插件类型:根据插件的继承关系或属性识别插件类型
- 生成 YAML 配置:基于插件定义生成标准的 YAML 配置
- 保存配置文件:将生成的配置保存到 `./metadata` 目录
## 使用方法
5. **了解输出说明**
- 命令行输出:插件加载状态、插件导出的对象列表、插件类型识别结果、生成的 YAML 配置内容、配置文件保存路径
- 配置文件命名规则:`<插件类型>[_<子类型>]_<插件名称>.yaml`
### 基本用法
6. **理解插件类型识别逻辑**
- DNS Provider:如果插件定义中包含 `accessType` 属性
- Task:如果插件继承自 `AbstractTaskPlugin`
- Notification:如果插件继承自 `BaseNotification`
- Access:如果插件继承自 `BaseAccess`
- Addon:如果插件继承自 `BaseAddon`
```bash
node trae/skills/convert-plugin-to-yaml.js <插件文件路径>
```
7. **遵循注意事项**
- 文件路径:插件文件路径可以是相对路径或绝对路径
- 文件格式:仅支持 `.js` 文件,不支持 `.ts` 文件(需要先编译)
- 依赖安装:执行前确保已安装所有必要的依赖
- 配置目录:如果 `./metadata` 目录不存在,工具会自动创建
- 错误处理:如果插件加载失败或识别失败,工具会输出错误信息但不会终止执行
### 示例
## 输出规范
- 必须包含工具的使用方法和示例
- 必须包含转换过程的详细说明
- 必须包含输出说明和配置文件命名规则
- 必须包含插件类型识别逻辑
- 必须包含注意事项和故障排除建议
## 示例
### 示例 1: 转换单个 Access 插件
#### 用户输入
将 Access 插件转换为 YAML 配置文件。
#### 你的回答
```bash
# 转换 Access 插件
node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js
# 转换 Task 插件
node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.js
# 转换 DNS Provider 插件
node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/dns-provider.js
```
## 转换过程
1. **加载插件模块**:使用 `import()` 动态加载指定的插件文件
2. **分析插件定义**:检查模块导出的对象,寻找带有 `define` 属性的插件
3. **识别插件类型**:根据插件的继承关系或属性识别插件类型
4. **生成 YAML 配置**:基于插件定义生成标准的 YAML 配置
5. **保存配置文件**:将生成的配置保存到 `./metadata` 目录
## 输出说明
### 命令行输出
执行转换命令后,工具会输出以下信息:
- 插件加载状态
- 插件导出的对象列表
- 插件类型识别结果
- 生成的 YAML 配置内容
- 配置文件保存路径
### 配置文件命名规则
生成的配置文件命名规则为:
```
<插件类型>[_<子类型>]_<插件名称>.yaml
```
例如:
- `access_demo.yaml`Access 插件)
- `deploy_DemoTest.yaml`Task 插件)
- `dnsProvider_demo.yaml`DNS Provider 插件)
## 插件类型识别逻辑
工具通过以下逻辑识别插件类型:
1. **DNS Provider**:如果插件定义中包含 `accessType` 属性
2. **Task**:如果插件继承自 `AbstractTaskPlugin`
3. **Notification**:如果插件继承自 `BaseNotification`
4. **Access**:如果插件继承自 `BaseAccess`
5. **Addon**:如果插件继承自 `BaseAddon`
## 注意事项
1. **文件路径**:插件文件路径可以是相对路径或绝对路径
2. **文件格式**:仅支持 `.js` 文件,不支持 `.ts` 文件(需要先编译)
3. **依赖安装**:执行前确保已安装所有必要的依赖
4. **配置目录**:如果 `./metadata` 目录不存在,工具会自动创建
5. **错误处理**:如果插件加载失败或识别失败,工具会输出错误信息但不会终止执行
## 代码结构
### 主要函数
1. **isPrototypeOf(value, cls)**:检查对象是否是指定类的原型
2. **loadSingleModule(filePath)**:加载单个插件模块
3. **convertSinglePlugin(pluginPath)**:分析单个插件并生成 YAML 配置
4. **main()**:主函数,处理命令行参数并执行转换
### 导出函数
工具导出了以下函数,便于其他模块调用:
```javascript
export {
convertSinglePlugin, // 转换单个插件
loadSingleModule, // 加载单个模块
isPrototypeOf // 检查原型关系
};
```
## 应用场景
1. **插件开发**:在开发新插件时,快速生成配置文件
2. **插件调试**:查看插件的内部定义和配置
3. **插件管理**:批量转换现有插件为标准配置格式
4. **自动化构建**:集成到构建流程中,自动生成插件配置
## 示例输出
### 转换 Access 插件示例
#### 输出
```bash
$ node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js
开始转换插件: packages/ui/certd-server/src/plugins/plugin-demo/access.js
@@ -142,30 +106,117 @@ YAML 配置已保存到: ./metadata/access_demo.yaml
插件转换完成!
```
### 转换 Task 插件示例
### 示例 2: 批量转换插件
#### 用户输入
批量转换目录中的所有插件为 YAML 配置文件。
#### 你的回答
```bash
$ node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.js
# 批量转换插件
node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/
```
#### 输出
```bash
$ node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/
开始转换目录: packages/ui/certd-server/src/plugins/
正在处理文件: packages/ui/certd-server/src/plugins/plugin-demo/access.js
开始转换插件: packages/ui/certd-server/src/plugins/plugin-demo/access.js
插件模块导出了 1 个对象: DemoAccess
处理插件: DemoAccess
插件类型: access
脚本路径: packages/ui/certd-server/src/plugins/plugin-demo/access.js
生成的 YAML 配置:
name: demo
title: 授权插件示例
desc: 这是一个示例授权插件,用于演示如何实现一个授权插件
icon: clarity:plugin-line
pluginType: access
type: builtIn
scriptFilePath: packages/ui/certd-server/src/plugins/plugin-demo/access.js
YAML 配置已保存到: ./metadata/access_demo.yaml
插件转换完成!
正在处理文件: packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.js
开始转换插件: packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.js
插件模块导出了 1 个对象: DemoTest
处理插件: DemoTest
插件类型: deploy
插件类型: task
脚本路径: packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.js
生成的 YAML 配置:
name: DemoTest
title: Demo-测试插件
desc: ""
desc: 这是一个示例任务插件,用于演示如何实现一个任务插件
icon: clarity:plugin-line
pluginType: task
group: other
default:
strategy:
runStrategy: SkipWhenSucceed
pluginType: deploy
type: builtIn
scriptFilePath: packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.js
YAML 配置已保存到: ./metadata/deploy_DemoTest.yaml
YAML 配置已保存到: ./metadata/task_DemoTest.yaml
插件转换完成!
正在处理文件: packages/ui/certd-server/src/plugins/plugin-demo/dns-provider.js
开始转换插件: packages/ui/certd-server/src/plugins/plugin-demo/dns-provider.js
插件模块导出了 1 个对象: DemoDnsProvider
处理插件: DemoDnsProvider
插件类型: dns-provider
脚本路径: packages/ui/certd-server/src/plugins/plugin-demo/dns-provider.js
生成的 YAML 配置:
name: demo
title: Dns提供商Demo
desc: dns provider示例
icon: clarity:plugin-line
pluginType: dns-provider
accessType: demo
order: 99
type: builtIn
scriptFilePath: packages/ui/certd-server/src/plugins/plugin-demo/dns-provider.js
YAML 配置已保存到: ./metadata/dns-provider_demo.yaml
插件转换完成!
批量转换完成,共处理 3 个插件文件
```
### 示例 3: 自定义输出目录
#### 用户输入
将插件转换为 YAML 配置文件,并保存到自定义目录。
#### 你的回答
```bash
# 自定义输出目录
node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js --output ./configs
```
#### 输出
```bash
$ node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js --output ./configs
开始转换插件: packages/ui/certd-server/src/plugins/plugin-demo/access.js
插件模块导出了 1 个对象: DemoAccess
处理插件: DemoAccess
插件类型: access
脚本路径: packages/ui/certd-server/src/plugins/plugin-demo/access.js
生成的 YAML 配置:
name: demo
title: 授权插件示例
desc: 这是一个示例授权插件,用于演示如何实现一个授权插件
icon: clarity:plugin-line
pluginType: access
type: builtIn
scriptFilePath: packages/ui/certd-server/src/plugins/plugin-demo/access.js
YAML 配置已保存到: ./configs/access_demo.yaml
插件转换完成!
```
@@ -196,6 +247,30 @@ YAML 配置已保存到: ./metadata/deploy_DemoTest.yaml
- **尝试简化插件**:如果转换失败,尝试创建一个最小化的插件示例进行测试
- **检查依赖版本**:确保使用的依赖版本与 Certd 兼容
## 总结
## 代码结构
插件转换工具是一个方便实用的工具,它可以帮助开发者快速生成插件的 YAML 配置文件,简化插件的注册和管理过程。通过命令行参数指定单个插件文件,工具会自动完成类型识别、配置生成和保存等操作,大大提高了插件开发和管理的效率。
### 主要函数
1. **isPrototypeOf(value, cls)**:检查对象是否是指定类的原型
2. **loadSingleModule(filePath)**:加载单个插件模块
3. **convertSinglePlugin(pluginPath)**:分析单个插件并生成 YAML 配置
4. **main()**:主函数,处理命令行参数并执行转换
### 导出函数
工具导出了以下函数,便于其他模块调用:
```javascript
export {
convertSinglePlugin, // 转换单个插件
loadSingleModule, // 加载单个模块
isPrototypeOf // 检查原型关系
};
```
## 应用场景
1. **插件开发**:在开发新插件时,快速生成配置文件
2. **插件调试**:查看插件的内部定义和配置
3. **插件管理**:批量转换现有插件为标准配置格式
4. **自动化构建**:集成到构建流程中,自动生成插件配置
+440 -183
View File
@@ -1,12 +1,73 @@
---
name: task-plugin-dev
description: 用于开发 Certd 系统中的 Task 插件,继承自 AbstractTaskPlugin 类,被流水线调用 execute 方法将证书部署到对应的应用上。当用户需要创建任务插件、部署证书、自动化任务或修改现有 Task 插件时触发。
version: 1.0.0
---
# Task 插件开发技能
## 什么是 Task 插件
## 角色定义
你是一名 Certd 插件开发专家,擅长创建和实现 Task 类型的插件,熟悉 TypeScript 编程和 Certd 插件开发规范。
Task 插件是 Certd 系统中的部署任务插件,它继承自 `AbstractTaskPlugin` 类,被流水线调用 `execute` 方法,将证书部署到对应的应用上。
## 核心指令
请严格按照以下步骤执行任务:
## 开发步骤
1. **导入必要的依赖**
- 导入 `AbstractTaskPlugin`, `IsTaskPlugin`, `PageSearch`, `pluginGroups`, `RunStrategy`, `TaskInput` 等必要的类型和装饰器
- 导入 `CertInfo`, `CertReader` 等证书相关类型
- 导入 `createCertDomainGetterInputDefine`, `createRemoteSelectInputDefine` 等工具函数
- 导入 `optionsUtils` 等辅助工具
- 导入 `CertApplyPluginNames` 等常量
### 1. 导入必要的依赖
2. **使用 @IsTaskPlugin 注解注册插件**
- 配置插件的唯一标识、标题、图标
- 设置插件分组
- 配置默认策略(如 `SkipWhenSucceed`
- 确保类名与插件名称一致
3. **定义任务输入参数**
- 使用 `@TaskInput` 注解定义各种输入参数
- 必须包含证书选择参数,用于获取前置任务输出的域名证书
- 可以添加授权选择框、文本输入、选择框等参数
- 使用 `createCertDomainGetterInputDefine` 获取证书域名列表
4. **实现动态显隐配置**
- 使用 `mergeScript` 实现根据其他输入值动态控制输入项的显隐状态
- 利用 `ctx.compute` 函数访问表单中的其他字段值
5. **实现插件方法**
- **onInstance 方法**:插件实例化时执行的初始化操作
- **execute 方法**:插件的核心执行逻辑
- 获取授权信息
- 读取证书信息
- 执行具体的部署逻辑
- 处理错误并记录日志
- 实现幂等性:确保重复执行不会导致问题
- 实现超时处理:设置合理的超时时间
- 实现回滚机制:在部署失败时能够回滚到之前的状态
- **后端获取选项方法**:用于前端从后端获取选项的方法
6. **遵循开发最佳实践**
- 插件命名:遵循命名规范,大写字母开头,驼峰命名
- 类名规范:类名应与插件名称一致
- 日志输出:使用 `this.logger` 输出日志
- 错误处理:捕获并记录执行过程中的错误
- 授权获取:使用 `this.getAccess(accessId)` 获取授权信息
## 输出规范
- 必须包含完整的插件实现代码
- 代码必须包含详细的注释说明
- 提供完整的示例代码,展示插件的使用方法
- 包含开发注意事项和最佳实践
## 示例
### 示例 1: 基本 Task 插件
#### 用户输入
创建一个 Task 插件,用于将证书部署到对应的应用上。
#### 你的回答
```typescript
import { AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
@@ -14,185 +75,9 @@ import { CertInfo, CertReader } from '@certd/plugin-cert';
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
import { optionsUtils } from '@certd/basic';
import { CertApplyPluginNames} from '@certd/plugin-cert';
```
### 2. 使用 @IsTaskPlugin 注解注册插件
```typescript
@IsTaskPlugin({
// 命名规范,插件类型+功能,大写字母开头,驼峰命名
name: 'DemoTest',
title: 'Demo-测试插件', // 插件标题
icon: 'clarity:plugin-line', // 插件图标
// 插件分组
group: pluginGroups.other.key,
default: {
// 默认值配置照抄即可
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,
},
},
})
// 类名规范,跟上面插件名称(name)一致
export class DemoTest extends AbstractTaskPlugin {
// 插件实现...
}
```
### 3. 定义任务输入参数
使用 `@TaskInput` 注解定义任务输入参数:
```typescript
// 测试参数
@TaskInput({
title: '属性示例',
value: '默认值',
component: {
// 前端组件配置,具体配置见组件文档 https://www.antdv.com/components/input-cn
name: 'a-input',
vModel: 'value', // 双向绑定组件的 props 名称
},
helper: '帮助说明,[链接](https://certd.docmirror.cn)',
required: false, // 是否必填
})
text!: string;
// 证书选择,此项必须要有
@TaskInput({
title: '域名证书',
helper: '请选择前置任务输出的域名证书',
component: {
name: 'output-selector',
from: [...CertApplyPluginNames],
},
// required: true, // 必填
})
cert!: CertInfo;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
// 前端可以展示,当前申请的证书域名列表
certDomains!: string[];
// 授权选择框
@TaskInput({
title: 'demo授权',
helper: 'demoAccess授权',
component: {
name: 'access-selector',
vModel:"modelValue",
type: "demo", // access类型,让用户固定选择这种类型的access
},
// rules: [{ required: true, message: '此项必填' }],
// required: true, // 必填
})
accessId!: string;
```
### 4. 实现插件方法
#### 4.1 插件实例化时执行的方法
```typescript
// 插件实例化时执行的方法
async onInstance() {}
```
#### 4.2 插件执行方法
```typescript
// 插件执行方法
async execute(): Promise<void> {
const { select, text, cert, accessId } = this;
try {
const access = await this.getAccess(accessId);
this.logger.debug('access', access);
} catch (e) {
this.logger.error('获取授权失败', e);
}
try {
const certReader = new CertReader(cert);
this.logger.debug('certReader', certReader);
} catch (e) {
this.logger.error('读取crt失败', e);
}
this.logger.info('DemoTestPlugin execute');
this.logger.info('text:', text);
this.logger.info('select:', select);
this.logger.info('switch:', this.switch);
this.logger.info('授权id:', accessId);
// 具体的部署逻辑
// ...
}
```
#### 4.3 后端获取选项方法
```typescript
@TaskInput(
createRemoteSelectInputDefine({
title: '从后端获取选项',
helper: '选择时可以从后端获取选项',
action: DemoTest.prototype.onGetSiteList.name,
// 当以下参数变化时,触发获取选项
watches: ['certDomains', 'accessId'],
required: true,
})
)
siteName!: string | string[];
// 从后端获取选项的方法
async onGetSiteList(req: PageSearch) {
if (!this.accessId) {
throw new Error('请选择Access授权');
}
// @ts-ignore
const access = await this.getAccess(this.accessId);
// const siteRes = await access.GetDomainList(req);
// 以下是模拟数据
const siteRes = [
{ id: 1, siteName: 'site1.com' },
{ id: 2, siteName: 'site2.com' },
{ id: 3, siteName: 'site2.com' },
];
// 转换为前端所需要的格式
const options = siteRes.map((item: any) => {
return {
value: item.siteName,
label: item.siteName,
domain: item.siteName,
};
});
// 将站点域名名称根据证书域名进行匹配分组,分成匹配的和不匹配的两组选项,返回给前端,供用户选择
return optionsUtils.buildGroupOptions(options, this.certDomains);
}
```
## 注意事项
1. **插件命名**:插件名称应遵循命名规范,大写字母开头,驼峰命名。
2. **类名规范**:类名应与插件名称(name)一致。
3. **证书选择**:必须包含证书选择参数,用于获取前置任务输出的域名证书。
4. **日志输出**:使用 `this.logger` 输出日志,而不是 `console`
5. **错误处理**:执行过程中的错误应被捕获并记录。
6. **授权获取**:使用 `this.getAccess(accessId)` 获取授权信息。
## 完整示例
```typescript
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';
import { CertApplyPluginNames} from '@certd/plugin-cert';
@IsTaskPlugin({
//命名规范,插件类型+功能(就是目录plugin-demo中的demo),大写字母开头,驼峰命名
//命名规范,插件类型+功能,大写字母开头,驼峰命名
name: 'DemoTest',
title: 'Demo-测试插件',
icon: 'clarity:plugin-line',
@@ -241,7 +126,7 @@ export class DemoTest extends AbstractTaskPlugin {
title: '动态显隐',
helper: '我会根据选择框的值进行显隐',
show: true, //动态计算的值会覆盖它
//动态计算脚本, mergeScript返回的对象会合并当前配置,此处演示 show的值会被动态计算结果覆盖,show的值根据用户选择的select的值决定
//动态计算脚本, mergeScript返回的对象会合并当前配置
mergeScript: `
return {
show: ctx.compute(({form})=>{
@@ -279,6 +164,7 @@ export class DemoTest extends AbstractTaskPlugin {
},
})
switch!: boolean;
//证书选择,此项必须要有
@TaskInput({
title: '域名证书',
@@ -347,6 +233,7 @@ export class DemoTest extends AbstractTaskPlugin {
this.logger.info('switch:', this.switch);
this.logger.info('授权id:', accessId);
// 具体的部署逻辑
// const res = await this.http.request({
// url: 'https://api.demo.com',
// method: 'GET',
@@ -383,7 +270,377 @@ export class DemoTest extends AbstractTaskPlugin {
};
});
//将站点域名名称根据证书域名进行匹配分组,分成匹配的和不匹配的两组选项,返回给前端,供用户选择
return optionsUtils.buildGroupOptions(options, this.certDomains);
return {
list: optionsUtils.buildGroupOptions(options, this.certDomains),
total: siteRes.length,
};
}
}
```
### 示例 2: Nginx 部署 Task 插件
#### 用户输入
创建一个 Task 插件,用于将证书部署到 Nginx 服务器上。
#### 你的回答
```typescript
import { AbstractTaskPlugin, CertInfo, IsTaskPlugin, TaskInput, pluginGroups, RunStrategy } from '@certd/pipeline';
import { CertReader } from '@certd/plugin-lib';
/**
* Nginx 证书部署插件
*/
@IsTaskPlugin({
name: 'NginxDeploy',
title: 'Nginx 部署',
desc: '将证书部署到 Nginx 服务器上',
icon: 'clarity:server-line',
group: pluginGroups.deploy.key,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,
},
},
})
export class NginxDeploy extends AbstractTaskPlugin {
/**
* 服务器授权
*/
@TaskInput({
title: '服务器授权',
component: {
name: 'access-selector',
vModel: 'accessId',
accessTypes: ['ssh'],
placeholder: '请选择服务器授权',
},
required: true,
})
accessId = '';
/**
* 域名证书
*/
@TaskInput({
title: '域名证书',
component: {
name: 'output-selector',
from: ['CertApply', 'CertApplyCloudflare'],
field: 'cert',
},
required: true,
})
cert!: CertInfo;
/**
* 证书路径
*/
@TaskInput({
title: '证书路径',
value: '/etc/nginx/ssl',
component: {
name: 'a-input',
placeholder: '请输入证书存储路径',
},
required: true,
})
certPath = '';
/**
* Nginx 配置文件路径
*/
@TaskInput({
title: 'Nginx 配置文件',
value: '/etc/nginx/conf.d',
component: {
name: 'a-input',
placeholder: '请输入 Nginx 配置文件路径',
},
required: true,
})
nginxConfPath = '';
/**
* 服务名称
*/
@TaskInput({
title: '服务名称',
component: {
name: 'a-input',
placeholder: '请输入服务名称(用于生成配置文件)',
},
required: true,
})
serviceName = '';
/**
* 执行部署
*/
async execute(): Promise<void> {
this.logger.info('开始部署证书到 Nginx');
try {
// 1. 获取服务器授权
const sshAccess = await this.getAccess(this.accessId);
this.logger.info('获取服务器授权成功');
// 2. 读取证书信息
const certReader = new CertReader(this.cert);
const cert = certReader.getCert();
const key = certReader.getKey();
const fullchain = certReader.getFullChain();
this.logger.info('读取证书信息成功');
// 3. 准备部署路径
const certFile = `${this.certPath}/${this.serviceName}.pem`;
const keyFile = `${this.certPath}/${this.serviceName}.key`;
const confFile = `${this.nginxConfPath}/${this.serviceName}.conf`;
// 4. 创建证书目录
await sshAccess.exec(`mkdir -p ${this.certPath}`);
this.logger.info('创建证书目录成功');
// 5. 上传证书文件
await sshAccess.uploadContent(cert, certFile);
await sshAccess.uploadContent(key, keyFile);
await sshAccess.uploadContent(fullchain, `${this.certPath}/${this.serviceName}-fullchain.pem`);
this.logger.info('上传证书文件成功');
// 6. 生成 Nginx 配置
const nginxConf = `server {
listen 443 ssl;
server_name ${this.cert.domains.join(' ')};
ssl_certificate ${certFile};
ssl_certificate_key ${keyFile};
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://localhost:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
`;
// 7. 上传 Nginx 配置
await sshAccess.uploadContent(nginxConf, confFile);
this.logger.info('上传 Nginx 配置成功');
// 8. 测试 Nginx 配置
const testResult = await sshAccess.exec('nginx -t');
if (testResult.includes('test is successful')) {
this.logger.info('Nginx 配置测试成功');
} else {
throw new Error(`Nginx 配置测试失败: ${testResult}`);
}
// 9. 重启 Nginx 服务
await sshAccess.exec('systemctl reload nginx');
this.logger.info('重启 Nginx 服务成功');
this.logger.info('证书部署到 Nginx 成功');
} catch (error) {
this.logger.error('部署失败:', error);
throw new Error(`部署到 Nginx 失败: ${error.message}`);
}
}
}
// 实例化插件
new NginxDeploy();
```
### 示例 3: 阿里云 OSS 部署 Task 插件
#### 用户输入
创建一个 Task 插件,用于将证书部署到阿里云 OSS 上。
#### 你的回答
```typescript
import { AbstractTaskPlugin, CertInfo, IsTaskPlugin, TaskInput, pluginGroups, RunStrategy } from '@certd/pipeline';
import { CertReader } from '@certd/plugin-lib';
/**
* 阿里云 OSS 证书部署插件
*/
@IsTaskPlugin({
name: 'AliyunOSSDeploy',
title: '阿里云 OSS 部署',
desc: '将证书部署到阿里云 OSS 存储上',
icon: 'clarity:cloud-line',
group: pluginGroups.deploy.key,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,
},
},
})
export class AliyunOSSDeploy extends AbstractTaskPlugin {
/**
* 阿里云授权
*/
@TaskInput({
title: '阿里云授权',
component: {
name: 'access-selector',
vModel: 'accessId',
accessTypes: ['aliyun'],
placeholder: '请选择阿里云授权',
},
required: true,
})
accessId = '';
/**
* 域名证书
*/
@TaskInput({
title: '域名证书',
component: {
name: 'output-selector',
from: ['CertApply', 'CertApplyCloudflare'],
field: 'cert',
},
required: true,
})
cert!: CertInfo;
/**
* OSS 存储桶
*/
@TaskInput({
title: 'OSS 存储桶',
component: {
name: 'a-input',
placeholder: '请输入 OSS 存储桶名称',
},
required: true,
})
bucketName = '';
/**
* 存储路径
*/
@TaskInput({
title: '存储路径',
value: 'ssl/',
component: {
name: 'a-input',
placeholder: '请输入证书存储路径',
},
})
storagePath = '';
/**
* 执行部署
*/
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云 OSS');
try {
// 1. 获取阿里云授权
const aliyunAccess = await this.getAccess(this.accessId);
this.logger.info('获取阿里云授权成功');
// 2. 读取证书信息
const certReader = new CertReader(this.cert);
const cert = certReader.getCert();
const key = certReader.getKey();
const fullchain = certReader.getFullChain();
this.logger.info('读取证书信息成功');
// 3. 准备存储路径
const basePath = this.storagePath.endsWith('/') ? this.storagePath : `${this.storagePath}/`;
const certFileName = `${basePath}${this.cert.domains[0]}.pem`;
const keyFileName = `${basePath}${this.cert.domains[0]}.key`;
const fullchainFileName = `${basePath}${this.cert.domains[0]}-fullchain.pem`;
// 4. 上传证书到 OSS
await aliyunAccess.uploadToOSS({
bucket: this.bucketName,
key: certFileName,
content: cert,
});
this.logger.info('上传证书文件成功');
await aliyunAccess.uploadToOSS({
bucket: this.bucketName,
key: keyFileName,
content: key,
});
this.logger.info('上传私钥文件成功');
await aliyunAccess.uploadToOSS({
bucket: this.bucketName,
key: fullchainFileName,
content: fullchain,
});
this.logger.info('上传完整证书链成功');
// 5. 设置文件访问权限(可选)
await aliyunAccess.setOSSObjectAcl({
bucket: this.bucketName,
key: certFileName,
acl: 'private',
});
await aliyunAccess.setOSSObjectAcl({
bucket: this.bucketName,
key: keyFileName,
acl: 'private',
});
await aliyunAccess.setOSSObjectAcl({
bucket: this.bucketName,
key: fullchainFileName,
acl: 'private',
});
this.logger.info('设置文件访问权限成功');
this.logger.info('证书部署到阿里云 OSS 成功');
} catch (error) {
this.logger.error('部署失败:', error);
throw new Error(`部署到阿里云 OSS 失败: ${error.message}`);
}
}
}
// 实例化插件
new AliyunOSSDeploy();
```
## 注意事项
1. **插件命名**:插件名称应遵循命名规范,大写字母开头,驼峰命名。
2. **类名规范**:类名应与插件名称(name)一致。
3. **证书选择**:必须包含证书选择参数,用于获取前置任务输出的域名证书。
4. **日志输出**:使用 `this.logger` 输出日志,而不是 `console`,参数文本化,不要传对象,否则会输出`[object Object]}`
5. **错误处理**:执行过程中的错误应被捕获并记录。
6. **授权获取**:使用 `this.getAccess(accessId)` 获取授权信息。
## 部署逻辑注意事项
1. **部署接口逻辑**
- 研究应用的部署接口逻辑,一般有两种:
a. 用户选择网站ID,给网站部署新证书
b. 用户选择证书ID,只需要更新证书即可
- 保证多次执行都能针对同一个对象部署证书
- 确保出错后重新运行能够回归到正常状态
2. **前置证书选择**
- 前置证书可以是原始的 `certInfo` 类型,也可能是上传到平台之后返回的证书id
- 根据接口要求选择合适的证书类型:
a. 如果接口需要上传后的证书id,那么部署时要先将证书上传,再部署
b. 如果接口需要原始的 `certInfo` 类型,那么直接使用 `certInfo` 部署证书
c. 当两者都支持时,判断用户选择的证书类型,再考虑优先上传再部署
3. **证书清理**
- 如果是先上传再部署的,那么在部署完成后,可能需要考虑清理证书
```
+102
View File
@@ -3,6 +3,108 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
### Bug Fixes
* 修复列表页面底部滚动条与表格之间有空白间隙的bug ([71cfcad](https://github.com/certd/certd/commit/71cfcad2a15aac0badd85a10c4012a1e713654d1))
* 修复流水线未编辑模式下也提示未保存的bug ([64a3503](https://github.com/certd/certd/commit/64a350364d820725b5e69d22ac2416809092f97d))
* 修复商业版设置了公共eab,创建流水线仍然会显示需要配置eab的bug ([24dff05](https://github.com/certd/certd/commit/24dff05f6427dadec1e40350214c0167e1d6a73d))
* 修复站点监控某些情况下获取不到证书的bug ([a2bbc7e](https://github.com/certd/certd/commit/a2bbc7e27298821d75a36abac6ec05d86dcf51f4))
### Performance Improvements
* 支持google dns插件 ([edc7bfc](https://github.com/certd/certd/commit/edc7bfc23043c2c6ef5f3564392f8aac6661c4bf))
* 阿里云waf支持云产品接入方式应用的证书部署 ([2f7514a](https://github.com/certd/certd/commit/2f7514a2e7d89a34f833401a983149e667da911b))
* 模版创建流水线支持随机时间 ([575415b](https://github.com/certd/certd/commit/575415b93a3e10e1c6e5644f71ddc711ea6f8adc))
* 商业版支持配置证书申请插件参数 ([7ac789c](https://github.com/certd/certd/commit/7ac789c9c7e91cdf08dfdae1bb49186552e370e3))
* 添加全新的未登录首页和路由配置 ([d1988dc](https://github.com/certd/certd/commit/d1988dc982440472ecf61847ccad76e4c96a80fb))
* 添加Azure DNS插件支持及文档 ([1f1d687](https://github.com/certd/certd/commit/1f1d6873172d71fadaa5a0005e1d6f3f528096fc))
* 添加HiPMDnsmgr DNS提供商的支持 @WUHINS ([296dcab](https://github.com/certd/certd/commit/296dcab4c7c26cb3f9da1ff748cc6a6b7d83edda))
* 为DNS解析器添加超时配置,避免查询时间过长 ([cc5154e](https://github.com/certd/certd/commit/cc5154e04e87f648111119b4eeb4e3cb4dd6cc41))
* 优化权威域名服务器查询超时时长 ([77db5ec](https://github.com/certd/certd/commit/77db5ecd12c51293e4de178e43ca0067bc70b46d))
* 支持部署到nginx-proxy-manager ([2e6e9ed](https://github.com/certd/certd/commit/2e6e9ed9255bcf178edb0eb00d93a7f13c214430))
* 支持一键安装脚本 ([dc969dd](https://github.com/certd/certd/commit/dc969dd7edb6934a29d6657afefe6f8af056741c))
* 支持主动修改绑定url地址 ([11b7cfe](https://github.com/certd/certd/commit/11b7cfe5cb7e88e6ebd68d53acb4e5b556550ca9))
* apisix支持v2 ([23b4658](https://github.com/certd/certd/commit/23b465867244b199bab9b61863a5ca43644834a9))
* **technitium:** 添加Technitium DNS Server插件支持 ([edeb817](https://github.com/certd/certd/commit/edeb817c39597e4fa73a17ff4ca3f712f0320fec))
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
### Bug Fixes
* 修复创建流水线无法选择通知的bug ([a88d0a6](https://github.com/certd/certd/commit/a88d0a6ae15cb6170d0b36e21daf89f0dbd5f681))
* 修复流水线任务编辑页面复制粘贴按钮在夜间模式显示问题 ([1e549df](https://github.com/certd/certd/commit/1e549dfd431ed74e2bcdfce63e5f640c51603af3))
* 修复用户管理添加用户无法上传头像的bug ([557e98c](https://github.com/certd/certd/commit/557e98c33f5462167d8f6289f70dad68bb114a97))
* 修复自定义插件删除后没有反注册的bug ([df98463](https://github.com/certd/certd/commit/df9846332596d2afaba53e66d2897aa1c598f9c4))
* 修复spaceship创建record报错的bug ([70b46d4](https://github.com/certd/certd/commit/70b46d4a8f89cf8eded21ebb237e8c8ce6c40d30))
### Performance Improvements
* 1panel支持先上传证书再选择证书 ([7a9eec8](https://github.com/certd/certd/commit/7a9eec88e8eddf40dba055c072b5b2b0f67c1407))
* 部署到1panel面板支持mux模式 ([d05129e](https://github.com/certd/certd/commit/d05129ec67893b0b639003a4bca6878d128f56ad))
* 流水线修改编辑之后,增加未保存提示 ([21620ac](https://github.com/certd/certd/commit/21620ac6bdeb57e43509156a77037fc07c44282a))
* 修复检查全部某些情况下无效的bug,优化公共触发站点证书检查定时逻辑 ([ee53589](https://github.com/certd/certd/commit/ee535895a3166c6f9046963e28fa8f22f018b574))
* 增加域名管理 子域名检查提醒 ([2bdf183](https://github.com/certd/certd/commit/2bdf1832da73a3728f3ac415837bc26e70531cd6))
* 站点监控域名气泡增加端口显示 ([6ee718a](https://github.com/certd/certd/commit/6ee718a25265a9db2115343af9a1a01958f34b81))
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
### Bug Fixes
* 修复cn域名获取不到到期时间的问题 ([73b8e85](https://github.com/certd/certd/commit/73b8e859766097b5251fc4e5051593d686669eb2))
* 修复某些情况下报无法修改通知的问题 ([d1a6592](https://github.com/certd/certd/commit/d1a65922d7e152d6edcf6c53b70079f16b54a0d3))
### Performance Improvements
* 腾讯云CLB大区增加台北 ([6b109d1](https://github.com/certd/certd/commit/6b109d172f0c7b6ce6ec164dc196d646a65f529f))
* 优化腾讯云CLB插件支持选择证书id ([c875971](https://github.com/certd/certd/commit/c875971b71dc6d392e56f0a7605281c40d9bb405))
* 支持域名到期时间监控通知 ([c6628e7](https://github.com/certd/certd/commit/c6628e7311d6c43c2a784581fb25ec37b29c168d))
* **monitor:** 支持查看监控执行记录 ([b5cc794](https://github.com/certd/certd/commit/b5cc794061c11b7200b669473c25c4bbfc944b61))
* **plugin-dnsmgr:** 添加彩虹DNS插件支持 ([af50344](https://github.com/certd/certd/commit/af503442b8298c5b89d11cf2ea351d62e66a609e))
* **spaceship:** 新增Spaceship DNS插件和授权模块 ([21aec77](https://github.com/certd/certd/commit/21aec77e5c3307b5973d4185baba33edcb28926f))
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
### Bug Fixes
* 修复某些情况下报没有匹配到任何校验方式的bug ([fe02ce7](https://github.com/certd/certd/commit/fe02ce7b64cf23c4dc4c30daccd5330059a35e9a))
* 修复上传头像退出登录的bug ([6eb20a1](https://github.com/certd/certd/commit/6eb20a1f2e31d984d9135edbf39c97cdd15621f9))
### Performance Improvements
* 阿里云CDN部署支持根据证书域名自动匹配部署 ([a68301e](https://github.com/certd/certd/commit/a68301e4dcea8b7391ad751aa57555d566297ad9))
* 阿里云dcdn支持根据证书域名匹配模式 ([df012de](https://github.com/certd/certd/commit/df012dec90590ecba85a69ed6355cfa8382c1da3))
* 支持部署证书到百度CCE ([a19ea74](https://github.com/certd/certd/commit/a19ea7489c01cdbf795fb51f804bd6d00389f604))
* dcdn自动匹配部署,支持新增域名感知 ([c6a988b](https://github.com/certd/certd/commit/c6a988bc925886bd7163c1270f2b7a10a57b1c5b))
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
### Bug Fixes
* 修复cname校验报该授权无权限的bug ([b1eb706](https://github.com/certd/certd/commit/b1eb7069258d6ff2b128091911fa448eaffc5f33))
### Performance Improvements
* 支持部署到火山云tos自定义域名证书 ([af6deb9](https://github.com/certd/certd/commit/af6deb99cd24a69a189b1fdd1df51c8f7816dcda))
* 支持部署证书到火山引擎vod ([f91d591](https://github.com/certd/certd/commit/f91d591b03c50166d9fa352ba11c62d963869aa5))
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
### Bug Fixes
* 修复模版id不正确导致修改到错误的模版流水线bug ([b1ff163](https://github.com/certd/certd/commit/b1ff163a2828b205297408d5aed21cf1eff335e8))
* 修复批量执行按钮无效的bug ([49703f0](https://github.com/certd/certd/commit/49703f08e55b303851086d9f36aca562d7999be6))
* remote-select默认pageSize设置为50,阿里云WAF不支持pageSize100 ([285532d](https://github.com/certd/certd/commit/285532d4318b90d0d7f8154f070274c0a0ec0269))
### Performance Improvements
* 火山引擎部署alb证书插件支持部署扩展证书以及删除已过期扩展证书 ([ffd2e81](https://github.com/certd/certd/commit/ffd2e8149e3a06bf3eec456ff85dbed793af9e90))
* 企业模式下面增加个人数据迁移的引导 ([431afd6](https://github.com/certd/certd/commit/431afd618f547cecf9a29433f46d4367619e2ecf))
* 新增阿里云证书清理插件 ([4b7eeaa](https://github.com/certd/certd/commit/4b7eeaa6e0a14d2e461c7c473a920a0966b1fe8e))
* 优化远程数据选择框,选择数据时不刷新闪烁 ([7f6a8bc](https://github.com/certd/certd/commit/7f6a8bc87e364685defe7f039264b2de064806c5))
* 支持复制粘贴任务步骤 ([acc2df2](https://github.com/certd/certd/commit/acc2df29def017fb8165f931b41ef95414966afc))
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
### Bug Fixes
+10 -1
View File
@@ -95,7 +95,15 @@ https://certd.handfree.work/
3. 【推荐】[1Panel面板方式部署](https://certd.docmirror.cn/guide/install/1panel/)
4. 【推荐】[雨云一键部署](https://app.rainyun.com/apps/rca/store/6646/?ref=NzExMDQ2) : 首充翻倍,每月仅需2.2元
[<img src="https://rainyun-apps.cn-nb1.rains3.com/materials/deploy-on-rainyun-cn.svg">](https://app.rainyun.com/apps/rca/store/6646/?ref=NzExMDQ2)
5. 【不推荐】[源码方式部署 ](https://certd.docmirror.cn/guide/install/source/)
5. 【推荐】[一键安装脚本](https://certd.docmirror.cn/guide/install/docker/)(自动安装 DockerCertd):
```bash
curl -fsSL https://gitee.com/certd/certd/raw/v2/docker/run/install.sh | bash
```
6. 【不推荐】[源码方式部署 ](https://certd.docmirror.cn/guide/install/source/)
#### Docker镜像说明:
* 国内镜像地址:
@@ -211,3 +219,4 @@ https://certd.handfree.work/
| --------- |--------- |----------- |
| [fast-crud](https://gitee.com/fast-crud/fast-crud/) | <img alt="GitHub stars" src="https://img.shields.io/github/stars/fast-crud/fast-crud?logo=github"/> | 基于vue3的crud快速开发框架 |
| [dev-sidecar](https://github.com/docmirror/dev-sidecar/) | <img alt="GitHub stars" src="https://img.shields.io/github/stars/docmirror/dev-sidecar?logo=github"/> | 直连访问github工具,无需FQ,解决github无法访问的问题 |
| [winsvc-manager](https://github.com/greper/winsvc-manager/) | <img alt="GitHub stars" src="https://img.shields.io/github/stars/greper/winsvc-manager?logo=github"/> | 可视化包装应用成为一个Windows服务,使其后台运行 |
+340
View File
@@ -0,0 +1,340 @@
#!/bin/bash
set -e
CERTD_VERSION="${CERTD_VERSION:-latest}"
INSTALL_DIR="${INSTALL_DIR:-/opt/certd}"
COMPOSE_FILE_URL="https://gitee.com/certd/certd/raw/v2/docker/run/docker-compose.yaml"
COMPOSE_FILE="$INSTALL_DIR/docker-compose.yaml"
DOCKER_MIRROR="https://mirrors.aliyun.com"
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
log_info() {
echo -e "${GREEN}[INFO]${NC} $1"
}
log_warn() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
log_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
check_command() {
command -v "$1" >/dev/null 2>&1
}
get_local_ip() {
LOCAL_IP=$(ip route get 1.1.1.1 2>/dev/null | grep -oP 'src \K[^ ]+' | head -1)
if [ -z "$LOCAL_IP" ]; then
LOCAL_IP=$(hostname -I 2>/dev/null | awk '{print $1}')
fi
if [ -z "$LOCAL_IP" ]; then
LOCAL_IP="127.0.0.1"
fi
echo "$LOCAL_IP"
}
get_public_ip() {
PUBLIC_IP=$(curl -s --max-time 5 https://api.ipify.org 2>/dev/null)
if [ -z "$PUBLIC_IP" ]; then
PUBLIC_IP=$(curl -s --max-time 5 https://checkip.amazonaws.com 2>/dev/null)
fi
if [ -z "$PUBLIC_IP" ]; then
PUBLIC_IP=""
fi
echo "$PUBLIC_IP"
}
show_access_urls() {
LOCAL_IP=$(get_local_ip)
PUBLIC_IP=$(get_public_ip)
echo ""
echo "=========================================="
log_info "安装完成!"
echo "=========================================="
echo ""
echo "访问地址:"
if [ -n "$PUBLIC_IP" ]; then
echo -e " ${GREEN}外网访问:${NC} http://$PUBLIC_IP:7001"
fi
echo -e " ${GREEN}局域网:${NC} http://$LOCAL_IP:7001"
echo ""
echo "配置文件: $COMPOSE_FILE"
echo ""
echo "常用命令:"
echo " cd $INSTALL_DIR"
echo " docker compose logs -f # 查看日志"
echo " docker compose restart # 重启服务"
echo " docker compose down # 停止服务"
echo ""
}
detect_os() {
if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$ID
VER=$VERSION_ID
elif [ -f /etc/centos-release ]; then
OS="centos"
elif [ -f /etc/redhat-release ]; then
OS="rhel"
else
OS="unknown"
fi
}
check_docker() {
if check_command docker; then
DOCKER_VERSION=$(docker --version 2>/dev/null | awk '{print $3}' | tr -d ',')
log_info "Docker 已安装: $DOCKER_VERSION"
return 0
else
log_warn "Docker 未安装"
return 1
fi
}
check_docker_compose() {
if check_command docker-compose; then
COMPOSE_VERSION=$(docker-compose --version 2>/dev/null | awk '{print $3}' | tr -d ',')
log_info "Docker Compose 已安装: $COMPOSE_VERSION"
return 0
elif docker compose version >/dev/null 2>&1; then
log_info "Docker Compose (插件版) 已安装"
return 0
else
log_warn "Docker Compose 未安装"
return 1
fi
}
install_docker_ubuntu() {
log_info "正在安装 Docker (Ubuntu/Debian)..."
apt-get update
apt-get install -y ca-certificates curl gnupg lsb-release
mkdir -p /etc/apt/keyrings
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/${OS}/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg 2>/dev/null || \
curl -fsSL https://download.docker.com/linux/${OS}/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/${OS} $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl enable docker
systemctl start docker
log_info "Docker 安装完成"
}
install_docker_centos() {
log_info "正在安装 Docker (CentOS/RHEL)..."
yum install -y yum-utils
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl enable docker
systemctl start docker
log_info "Docker 安装完成"
}
install_dockerrocky() {
log_info "正在安装 Docker (Rocky Linux/AlmaLinux)..."
dnf install -y yum-utils
dnf config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl enable docker
systemctl start docker
log_info "Docker 安装完成"
}
install_docker_debian() {
log_info "正在安装 Docker (Debian)..."
apt-get update
apt-get install -y ca-certificates curl gnupg2
mkdir -p /etc/apt/keyrings
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg | gpg --armor -o /etc/apt/keyrings/docker.gpg 2>/dev/null || \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --armor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl enable docker
systemctl start docker
log_info "Docker 安装完成"
}
install_docker() {
detect_os
log_info "检测到操作系统: $OS"
case $OS in
ubuntu)
install_docker_ubuntu
;;
debian)
install_docker_debian
;;
centos)
install_docker_centos
;;
rhel|rocky|almalinux)
install_dockerrocky
;;
*)
log_error "不支持的操作系统: $OS"
log_info "请手动安装 Docker"
exit 1
;;
esac
}
install_docker_compose_standalone() {
log_info "正在安装 Docker Compose (独立版本)..."
COMPOSE_URLS=(
"https://get.daocloud.io/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)"
"https://mirror.sjtu.edu.cn/github/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)"
"https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)"
)
for url in "${COMPOSE_URLS[@]}"; do
log_info "尝试从: $url"
if curl -L "$url" -o /usr/local/bin/docker-compose 2>/dev/null; then
chmod +x /usr/local/bin/docker-compose
log_info "Docker Compose 安装完成"
return 0
fi
log_warn "下载失败,尝试下一个源..."
done
log_error "Docker Compose 安装失败"
return 1
}
install_docker_compose() {
if check_command docker && docker compose version >/dev/null 2>&1; then
log_info "Docker Compose 插件已可用"
return 0
fi
if check_command docker-compose; then
log_info "Docker Compose 独立版本已安装"
return 0
fi
install_docker_compose_standalone
}
download_compose_file() {
log_info "正在下载 docker-compose.yaml..."
mkdir -p "$INSTALL_DIR"
if curl -fsSL "$COMPOSE_FILE_URL" -o "$COMPOSE_FILE.tmp"; then
mv "$COMPOSE_FILE.tmp" "$COMPOSE_FILE"
log_info "docker-compose.yaml 已下载到 $COMPOSE_FILE"
if [ "$CERTD_VERSION" != "latest" ]; then
sed -i "s|certd:latest|certd:$CERTD_VERSION|g" "$COMPOSE_FILE"
log_info "已修改镜像版本为: $CERTD_VERSION"
fi
else
log_error "下载失败,请检查网络连接"
exit 1
fi
}
start_certd() {
log_info "正在启动 Certd 容器..."
cd "$INSTALL_DIR"
if docker compose -f "$COMPOSE_FILE" up -d 2>/dev/null; then
log_info "Certd 启动成功!"
elif docker-compose -f "$COMPOSE_FILE" up -d; then
log_info "Certd 启动成功!"
fi
sleep 2
docker ps --filter "name=certd" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
}
show_usage() {
echo "用法: $0 [选项]"
echo ""
echo "选项:"
echo " -v, --version VERSION 指定 Certd 版本 (默认: latest)"
echo " -p, --path PATH 指定安装路径 (默认: /opt/certd)"
echo " -h, --help 显示帮助信息"
echo ""
echo "示例:"
echo " $0 # 使用默认配置安装"
echo " $0 -v 1.29.0 # 安装指定版本"
echo " $0 -p /data/certd # 安装到指定目录"
}
main() {
echo "=========================================="
echo " Certd 一键安装脚本"
echo "=========================================="
echo ""
while [[ $# -gt 0 ]]; do
case $1 in
-v|--version)
CERTD_VERSION="$2"
shift 2
;;
-p|--path)
INSTALL_DIR="$2"
COMPOSE_FILE="$INSTALL_DIR/docker-compose.yaml"
shift 2
;;
-h|--help)
show_usage
exit 0
;;
*)
log_error "未知选项: $1"
show_usage
exit 1
;;
esac
done
log_info "Certd 版本: $CERTD_VERSION"
log_info "安装路径: $INSTALL_DIR"
echo ""
DOCKER_INSTALLED=true
COMPOSE_INSTALLED=true
if ! check_docker; then
echo ""
log_info "正在安装 Docker..."
install_docker
fi
if ! check_docker_compose; then
echo ""
log_info "正在安装 Docker Compose..."
install_docker_compose
fi
download_compose_file
start_certd
show_access_urls
}
main "$@"
+2
View File
@@ -114,6 +114,7 @@ export default defineConfig({
{text: "连接windows主机", link: "/guide/use/host/windows.md"},
{text: "Google EAB获取", link: "/guide/use/google/"},
{text: "阿里云相关", link: "/guide/use/aliyun/"},
{text: "Azure相关", link: "/guide/use/azure/dns.md"},
{text: "数据备份", link: "/guide/use/backup/"},
{text: "Certd本身的证书更新", link: "/guide/use/https/index.md"},
{text: "js脚本插件使用", link: "/guide/use/custom-script/index.md"},
@@ -124,6 +125,7 @@ export default defineConfig({
{text: "子域名托管", link: "/guide/use/cert/subdomain.md"},
{text: "流水线有效期", link: "/guide/use/pipeline/valid.md"},
{text: "IP证书申请", link: "/guide/use/cert/ip.md"},
{text: "企业模式", link: "/guide/use/mode/enterprise.md"},
{text: "插件开发", link: "/guide/use/dev/plugin.md"},
]
},
+88
View File
@@ -3,6 +3,94 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
### Bug Fixes
* 修复创建流水线无法选择通知的bug ([a88d0a6](https://github.com/certd/certd/commit/a88d0a6ae15cb6170d0b36e21daf89f0dbd5f681))
* 修复流水线任务编辑页面复制粘贴按钮在夜间模式显示问题 ([1e549df](https://github.com/certd/certd/commit/1e549dfd431ed74e2bcdfce63e5f640c51603af3))
* 修复用户管理添加用户无法上传头像的bug ([557e98c](https://github.com/certd/certd/commit/557e98c33f5462167d8f6289f70dad68bb114a97))
* 修复自定义插件删除后没有反注册的bug ([df98463](https://github.com/certd/certd/commit/df9846332596d2afaba53e66d2897aa1c598f9c4))
* 修复spaceship创建record报错的bug ([70b46d4](https://github.com/certd/certd/commit/70b46d4a8f89cf8eded21ebb237e8c8ce6c40d30))
### Performance Improvements
* 1panel支持先上传证书再选择证书 ([7a9eec8](https://github.com/certd/certd/commit/7a9eec88e8eddf40dba055c072b5b2b0f67c1407))
* 部署到1panel面板支持mux模式 ([d05129e](https://github.com/certd/certd/commit/d05129ec67893b0b639003a4bca6878d128f56ad))
* 流水线修改编辑之后,增加未保存提示 ([21620ac](https://github.com/certd/certd/commit/21620ac6bdeb57e43509156a77037fc07c44282a))
* 修复检查全部某些情况下无效的bug,优化公共触发站点证书检查定时逻辑 ([ee53589](https://github.com/certd/certd/commit/ee535895a3166c6f9046963e28fa8f22f018b574))
* 增加域名管理 子域名检查提醒 ([2bdf183](https://github.com/certd/certd/commit/2bdf1832da73a3728f3ac415837bc26e70531cd6))
* 站点监控域名气泡增加端口显示 ([6ee718a](https://github.com/certd/certd/commit/6ee718a25265a9db2115343af9a1a01958f34b81))
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
### Bug Fixes
* 修复cn域名获取不到到期时间的问题 ([73b8e85](https://github.com/certd/certd/commit/73b8e859766097b5251fc4e5051593d686669eb2))
* 修复某些情况下报无法修改通知的问题 ([d1a6592](https://github.com/certd/certd/commit/d1a65922d7e152d6edcf6c53b70079f16b54a0d3))
### Performance Improvements
* 腾讯云CLB大区增加台北 ([6b109d1](https://github.com/certd/certd/commit/6b109d172f0c7b6ce6ec164dc196d646a65f529f))
* 优化腾讯云CLB插件支持选择证书id ([c875971](https://github.com/certd/certd/commit/c875971b71dc6d392e56f0a7605281c40d9bb405))
* 支持域名到期时间监控通知 ([c6628e7](https://github.com/certd/certd/commit/c6628e7311d6c43c2a784581fb25ec37b29c168d))
* **monitor:** 支持查看监控执行记录 ([b5cc794](https://github.com/certd/certd/commit/b5cc794061c11b7200b669473c25c4bbfc944b61))
* **plugin-dnsmgr:** 添加彩虹DNS插件支持 ([af50344](https://github.com/certd/certd/commit/af503442b8298c5b89d11cf2ea351d62e66a609e))
* **spaceship:** 新增Spaceship DNS插件和授权模块 ([21aec77](https://github.com/certd/certd/commit/21aec77e5c3307b5973d4185baba33edcb28926f))
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
### Bug Fixes
* 修复某些情况下报没有匹配到任何校验方式的bug ([fe02ce7](https://github.com/certd/certd/commit/fe02ce7b64cf23c4dc4c30daccd5330059a35e9a))
* 修复上传头像退出登录的bug ([6eb20a1](https://github.com/certd/certd/commit/6eb20a1f2e31d984d9135edbf39c97cdd15621f9))
### Performance Improvements
* 阿里云CDN部署支持根据证书域名自动匹配部署 ([a68301e](https://github.com/certd/certd/commit/a68301e4dcea8b7391ad751aa57555d566297ad9))
* 阿里云dcdn支持根据证书域名匹配模式 ([df012de](https://github.com/certd/certd/commit/df012dec90590ecba85a69ed6355cfa8382c1da3))
* 支持部署证书到百度CCE ([a19ea74](https://github.com/certd/certd/commit/a19ea7489c01cdbf795fb51f804bd6d00389f604))
* dcdn自动匹配部署,支持新增域名感知 ([c6a988b](https://github.com/certd/certd/commit/c6a988bc925886bd7163c1270f2b7a10a57b1c5b))
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
### Bug Fixes
* 修复cname校验报该授权无权限的bug ([b1eb706](https://github.com/certd/certd/commit/b1eb7069258d6ff2b128091911fa448eaffc5f33))
### Performance Improvements
* 支持部署到火山云tos自定义域名证书 ([af6deb9](https://github.com/certd/certd/commit/af6deb99cd24a69a189b1fdd1df51c8f7816dcda))
* 支持部署证书到火山引擎vod ([f91d591](https://github.com/certd/certd/commit/f91d591b03c50166d9fa352ba11c62d963869aa5))
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
### Bug Fixes
* 修复模版id不正确导致修改到错误的模版流水线bug ([b1ff163](https://github.com/certd/certd/commit/b1ff163a2828b205297408d5aed21cf1eff335e8))
* 修复批量执行按钮无效的bug ([49703f0](https://github.com/certd/certd/commit/49703f08e55b303851086d9f36aca562d7999be6))
* remote-select默认pageSize设置为50,阿里云WAF不支持pageSize100 ([285532d](https://github.com/certd/certd/commit/285532d4318b90d0d7f8154f070274c0a0ec0269))
### Performance Improvements
* 火山引擎部署alb证书插件支持部署扩展证书以及删除已过期扩展证书 ([ffd2e81](https://github.com/certd/certd/commit/ffd2e8149e3a06bf3eec456ff85dbed793af9e90))
* 企业模式下面增加个人数据迁移的引导 ([431afd6](https://github.com/certd/certd/commit/431afd618f547cecf9a29433f46d4367619e2ecf))
* 新增阿里云证书清理插件 ([4b7eeaa](https://github.com/certd/certd/commit/4b7eeaa6e0a14d2e461c7c473a920a0966b1fe8e))
* 优化远程数据选择框,选择数据时不刷新闪烁 ([7f6a8bc](https://github.com/certd/certd/commit/7f6a8bc87e364685defe7f039264b2de064806c5))
* 支持复制粘贴任务步骤 ([acc2df2](https://github.com/certd/certd/commit/acc2df29def017fb8165f931b41ef95414966afc))
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
### Bug Fixes
* 修复修改分组报错的bug ([224db7d](https://github.com/certd/certd/commit/224db7da57dbdddf25bcac7faa0a29eb228c5a33))
### Performance Improvements
* 移除passkey的counter递增校验 ([68b669d](https://github.com/certd/certd/commit/68b669d3ff3e13b931939093320ce7237bb02b1b))
* passkey 支持Bitwarden ([29f44c6](https://github.com/certd/certd/commit/29f44c67c808bed9ff1c9d4884d39a1a62d043a7))
* passkey登录放到下方其他登录位置 ([1413e1a](https://github.com/certd/certd/commit/1413e1aff4aabcfd471716338c210fbcfd76c8f9))
## [1.39.4](https://github.com/certd/certd/compare/v1.39.3...v1.39.4) (2026-03-17)
### Bug Fixes
+22 -5
View File
@@ -2,7 +2,23 @@
## 一、安装
### 1. 环境准备
### 一键脚本安装(推荐)
如果您的服务器未安装 Docker,该脚本会自动为您安装 Docker 和 Docker Compose,并启动 Certd 容器。
```bash
curl -fsSL https://gitee.com/certd/certd/raw/v2/docker/run/install.sh | bash
```
> 支持 Ubuntu、Debian、CentOS、Rocky Linux、AlmaLinux 等主流发行版。
> docker-compose文件目录:`/opt/certd` ,升级时需要先进入此目录
> 运行时数据默认保存路径:`/data/certd` ,可使用参数指定:`-p /data/certd`
### 手动安装
#### 1. 环境准备
1.1 准备一台云服务器
@@ -19,9 +35,9 @@ https://docs.docker.com/engine/install/
```bash
# 随便创建一个目录
mkdir certd
mkdir /opt/certd
# 进入目录
cd certd
cd /opt/certd
# 下载docker-compose.yaml文件,或者手动下载放到certd目录下
wget https://gitee.com/certd/certd/raw/v2/docker/run/docker-compose.yaml
@@ -54,12 +70,12 @@ https://your_server_ip:7002
记得修改密码
## 二、升级
## 二、升级Certd
::: warning
如果您是第一次升级certd版本,切记切记先备份一下数据
```
# docker-compose.yaml配置
# 查看/opt/certd/docker-compose.yaml配置
- /data/certd:/app/data # 请务必确保 /app/data 这个路径没有改动,固定写死
```
:::
@@ -71,6 +87,7 @@ https://your_server_ip:7002
### 如果使用`latest`版本
```shell
cd /opt/certd
#重新拉取镜像
docker pull registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
# 重新启动容器
+59 -53
View File
@@ -20,59 +20,65 @@
| 16.| **APISIX授权** | |
| 17.| **亚马逊云aws授权** | |
| 18.| **亚马逊云科技(国区)授权** | |
| 19.| **BIND9 DNS 授权** | 通过 SSH 连接到 BIND9 服务器,使用 nsupdate 命令管理 DNS 记录 |
| 20.| **CacheFly** | CacheFly |
| 21.| **EAB授权** | ZeroSSL证书申请需要EAB授权 |
| 22.| **google cloud** | 谷歌云授权 |
| 23.| **cloudflare授权** | |
| 24.| **中国移动CND授权** | |
| 25.| **授权插件示例** | 这是一个示例授权插件,用于演示如何实现一个授权插件 |
| 26.| **dns.la授权** | |
| 27.| **多吉云** | |
| 28.| **Dokploy授权** | |
| 29.| **farcdn授权** | |
| 30.| **FlexCDN授权** | |
| 31.| **Gcore** | Gcore |
| 32.| **Github授权** | |
| 33.| **godaddy授权** | |
| 34.| **金山云授权** | |
| 35.| **FTP授权** | |
| 36.| **七牛OSS授权** | |
| 37.| **腾讯云COS授权** | 腾讯云对象存储授权,包含地域和存储桶 |
| 38.| **s3/minio授权** | S3/minio oss授权 |
| 39.| **namesilo授权** | |
| 40.| **Next Terminal 授权** | 用于访问 Next Terminal API 的授权配置 |
| 41.| **1panel授权** | 账号和密码 |
| 42.| **支付宝** | |
| 43.| **白山云授权** | |
| 44.| **宝塔云WAF授权** | 用于连接和管理宝塔云WAF服务的授权配置 |
| 45.| **cdnfly授权** | |
| 46.| **k8s授权** | |
| 47.| **括彩云cdn授权** | 括彩云CDN,每月免费30G[注册即领](https://kuocaicdn.com/register?code=8mn536rrzfbf8) |
| 48.| **LeCDN授权** | |
| 49.| **lucky** | |
| 50.| **猫云授权** | |
| 51.| **plesk授权** | |
| 52.| **长亭雷池授权** | |
| 53.| **群晖登录授权** | |
| 54.| **uniCloud** | unicloud授权 |
| 55.| **微信支付** | |
| 56.| **易盾rcdn授权** | 易盾CDN,每月免费30G[注册即领](https://rhcdn.yiduncdn.com/register?code=8mn536rrzfbf8) |
| 57.| **易发云短信** | sms.yfyidc.cn/ |
| 58.| **易盾DCDN授权** | https://user.yiduncdn.com |
| 59.| **支付** | |
| 60.| **proxmox** | |
| 61.| **UCloud授权** | 优刻得授权 |
| 62.| **又拍云** | |
| 63.| **网宿授权** | |
| 64.| **西部数码授权** | |
| 65.| **我爱云授权** | 我爱云CDN |
| 66.| **新网授权(代理方式)** | |
| 67.| **新网授权** | |
| 68.| **新网互联授权** | 仅支持代理账号,ip需要加入白名单 |
| 69.| **Zenlayer授权** | Zenlayer授权 |
| 70.| **GoEdge授权** | |
| 71.| **云授权** | https://app.rainyun.com/ |
| 19.| **微软云Azure授权** | |
| 20.| **BIND9 DNS 授权** | 通过 SSH 连接到 BIND9 服务器,使用 nsupdate 命令管理 DNS 记录 |
| 21.| **CacheFly** | CacheFly |
| 22.| **EAB授权** | ZeroSSL证书申请需要EAB授权 |
| 23.| **google cloud** | 谷歌云授权 |
| 24.| **cloudflare授权** | |
| 25.| **中国移动CND授权** | |
| 26.| **授权插件示例** | 这是一个示例授权插件,用于演示如何实现一个授权插件 |
| 27.| **dns.la授权** | |
| 28.| **彩虹DNS** | 彩虹DNS管理系统授权 |
| 29.| **多吉云** | |
| 30.| **Dokploy授权** | |
| 31.| **farcdn授权** | |
| 32.| **FlexCDN授权** | |
| 33.| **Gcore** | Gcore |
| 34.| **Github授权** | |
| 35.| **godaddy授权** | |
| 36.| **HiPM DNSMgr** | HiPM DNSMgr API Token 授权 |
| 37.| **金山云授权** | |
| 38.| **FTP授权** | |
| 39.| **七牛OSS授权** | |
| 40.| **腾讯云COS授权** | 腾讯云对象存储授权,包含地域和存储桶 |
| 41.| **s3/minio授权** | S3/minio oss授权 |
| 42.| **namesilo授权** | |
| 43.| **Next Terminal 授权** | 用于访问 Next Terminal API 的授权配置 |
| 44.| **Nginx Proxy Manager 授权** | 用于登录 Nginx Proxy Manager,并为代理主机证书部署提供授权。 |
| 45.| **1panel授权** | 账号和密码 |
| 46.| **支付宝** | |
| 47.| **白山云授权** | |
| 48.| **宝塔云WAF授权** | 用于连接和管理宝塔云WAF服务的授权配置 |
| 49.| **cdnfly授权** | |
| 50.| **k8s授权** | |
| 51.| **括彩云cdn授权** | 括彩云CDN,每月免费30G[注册即领](https://kuocaicdn.com/register?code=8mn536rrzfbf8) |
| 52.| **LeCDN授权** | |
| 53.| **lucky** | |
| 54.| **猫云授权** | |
| 55.| **plesk授权** | |
| 56.| **长亭雷池授权** | |
| 57.| **群晖登录授权** | |
| 58.| **uniCloud** | unicloud授权 |
| 59.| **微信支付** | |
| 60.| **易盾rcdn授权** | 易盾CDN,每月免费30G[注册即领](https://rhcdn.yiduncdn.com/register?code=8mn536rrzfbf8) |
| 61.| **易发云短信** | sms.yfyidc.cn/ |
| 62.| **易盾DCDN授权** | https://user.yiduncdn.com |
| 63.| **易支付** | |
| 64.| **proxmox** | |
| 65.| **Spaceship.com 授权** | Spaceship.com API 授权插件 |
| 66.| **Technitium DNS Server** | Technitium DNS Server 自建DNS服务器授权 |
| 67.| **UCloud授权** | 优刻得授权 |
| 68.| **又拍云** | |
| 69.| **网宿授权** | |
| 70.| **西部数码授权** | |
| 71.| **我爱云授权** | 我爱云CDN |
| 72.| **新网授权(代理方式)** | |
| 73.| **新网授权** | |
| 74.| **新网互联授权** | 仅支持代理账号,ip需要加入白名单 |
| 75.| **Zenlayer授权** | Zenlayer授权 |
| 76.| **GoEdge授权** | |
| 77.| **雨云授权** | https://app.rainyun.com/ |
<style module>
table th:first-of-type {
+45 -40
View File
@@ -1,5 +1,5 @@
# 任务插件
`125` 款任务插件
`131` 款任务插件
## 1. 证书申请
| 序号 | 名称 | 说明 |
@@ -58,45 +58,48 @@
| 3.| **Dokploy-部署server证书** | 自动更新Dokploy server证书 |
| 4.| **飞牛NAS-部署证书** | |
| 5.| **NextTerminal-更新证书** | 更新 Next Terminal 证书 |
| 6.| **1Panel-部署面板证书** | 更新1Panel的面板证书 |
| 7.| **1Panel-更新站点证书** | 更新1Panel的站点证书 |
| 8.| **宝塔-删除过期证书** | 删除证书夹中过期证书 |
| 9.| **宝塔-WAF证书部署** | 部署宝塔云WAF/aaWAF |
| 10.| **宝塔-面板证书部署** | 部署宝塔面板本身的ssl证书 |
| 11.| **宝塔win-网站证书部署** | 部署到Windows版宝塔管理的站点的ssl证书 |
| 12.| **宝塔-网站证书部署** | 部署宝塔管理的站点的ssl证书,目前支持宝塔网站站点、docker站点等。本插件也支持aaPanel。 |
| 13.| **K8S-Apply自定义yaml** | apply自定义yaml到k8s |
| 14.| **K8S-Ingress 证书部署** | 部署证书到k8s的Ingress |
| 15.| **K8S-部署证书到Secret** | 部署证书到k8s的secret |
| 16.| **lucky-更新Lucky证书** | |
| 17.| **Plesk-部署Plesk网站证书** | |
| 18.| **Plesk-更新证书** | 不会创建新证书记录,直接更新旧的证书 |
| 19.| **雷池-更新证书(支持控制台和防护应用)** | 更新长亭雷池WAF的证书,支持更新控制台和防护应用的证书 |
| 20.| **群晖-部署证书到群晖面板** | Synology,支持6.x以上版本 |
| 21.| **群晖-刷新OTP登录有效期** | 群晖登录状态可能30天失效,需要在失效之前登录一次,刷新有效期,您可以将其放在“部署到群晖面板”任务之后 |
| 22.| **uniCloud-部署到服务空间** | 部署到服务空间 |
| 23.| **Proxmox-上传证书到Proxmox** | |
| 24.| **威联通-部署证书到威联通** | 部署证书到qnap |
| 6.| **Nginx Proxy Manager-部署到主机** | 上传自定义证书到 Nginx Proxy Manager,并绑定到所选主机。 |
| 7.| **1Panel-部署面板证书** | 更新1Panel的面板证书 |
| 8.| **1Panel-更新站点证书** | 更新1Panel的站点证书 |
| 9.| **宝塔-删除过期证书** | 删除证书夹中过期证书 |
| 10.| **宝塔-WAF证书部署** | 部署宝塔云WAF/aaWAF |
| 11.| **宝塔-面板证书部署** | 部署宝塔面板本身的ssl证书 |
| 12.| **宝塔win-网站证书部署** | 部署到Windows版宝塔管理的站点的ssl证书 |
| 13.| **宝塔-网站证书部署** | 部署宝塔管理的站点的ssl证书,目前支持宝塔网站站点、docker站点等。本插件也支持aaPanel。 |
| 14.| **K8S-Apply自定义yaml** | apply自定义yaml到k8s |
| 15.| **K8S-Ingress 证书部署** | 部署证书到k8s的Ingress |
| 16.| **K8S-部署证书到Secret** | 部署证书到k8s的secret |
| 17.| **lucky-更新Lucky证书** | |
| 18.| **Plesk-部署Plesk网站证书** | |
| 19.| **Plesk-更新证书** | 不会创建新证书记录,直接更新旧的证书 |
| 20.| **雷池-更新证书(支持控制台和防护应用)** | 更新长亭雷池WAF的证书,支持更新控制台和防护应用的证书。 |
| 21.| **群晖-部署证书到群晖面板** | Synology,支持6.x以上版本 |
| 22.| **群晖-刷新OTP登录有效期** | 群晖登录状态可能30天失效,需要在失效之前登录一次,刷新有效期,您可以将其放在“部署到群晖面板”任务之后 |
| 23.| **uniCloud-部署到服务空间** | 部署到服务空间 |
| 24.| **Proxmox-上传证书到Proxmox** | |
| 25.| **威联通-部署证书到威联通** | 部署证书到qnap |
## 5. 阿里云
| 序号 | 名称 | 说明 |
|-----|-----|-----|
| 1.| **阿里云-部署到Ack** | 部署到阿里云Ack集群Ingress等通过Secret管理证书的应用 |
| 2.| **阿里云-部署至ALB(应用负载均衡)** | ALB,更新监听器的默认证书 |
| 3.| **阿里云-部署至任意云资源** | 【不建议使用】需要消耗阿里云自动部署次数,支持SLB、LIVE、webHosting、VOD、CR、DCDN、DDoS、CDN、ALB、APIGateway、FC、GA、MSE、NLB、OSS、SAE、WAF等云产品 |
| 4.| **阿里云-部署至云原生API网关/AI网关** | 自动部署域名证书至云原生API网关、AI网关 |
| 5.| **阿里云-部署证书至API网关** | 自动部署域名证书至阿里云API网关APIGateway |
| 6.| **阿里云-部署证书至CDN** | 自动部署域名证书至阿里云CDN |
| 7.| **阿里云-部署证书至DCDN** | 依赖证书申请前置任务,自动部署域名证书至阿里云DCDN |
| 8.| **阿里云-部署至ESA** | 部署证书到阿里云ESA(边缘安全加速),自动删除过期证书 |
| 9.| **阿里云-部署至阿里云FC(3.0)** | 部署证书到阿里云函数计算(FC3.0 |
| 10.| **阿里云-部署至GA** | 部署证书到阿里云GA(全球加速),支持更新默认证书和扩展证书 |
| 11.| **阿里云-部署至NLB(网络负载均衡)** | NLB,网络负载均衡,更新监听器的默认证书 |
| 12.| **阿里云-部署证书至OSS** | 部署域名证书至阿里云OSS自定义域名,不是上传到阿里云oss |
| 13.| **阿里云-部署至CLB(传统负载均衡)** | 部署证书到阿里云CLB(传统负载均衡) |
| 14.| **阿里云-部署至VOD** | 部署证书到阿里云视频点播(vod |
| 15.| **阿里云-部署至阿里云WAF** | 部署证书到阿里云WAF |
| 16.| **阿里云-上传证书到CAS** | 上传证书到阿里云证书管理服务(CAS),如果不想在阿里云上同一份证书上传多次,可以把此任务作为前置任务,其他阿里云任务证书那一项选择此任务的输出 |
| 1.| **阿里云-删除即将过期证书** | 仅删除未使用的证书 |
| 2.| **阿里云-部署到Ack** | 部署到阿里云Ack集群Ingress等通过Secret管理证书的应用 |
| 3.| **阿里云-部署至ALB(应用负载均衡)** | ALB,更新监听器的默认证书 |
| 4.| **阿里云-部署至任意云资源** | 【不建议使用】需要消耗阿里云自动部署次数,支持SLB、LIVE、webHosting、VOD、CR、DCDN、DDoS、CDN、ALB、APIGateway、FC、GA、MSE、NLB、OSS、SAE、WAF等云产品 |
| 5.| **阿里云-部署至云原生API网关/AI网关** | 自动部署域名证书至云原生API网关、AI网关 |
| 6.| **阿里云-部署证书至API网关** | 自动部署域名证书至阿里云API网关(APIGateway |
| 7.| **阿里云-部署证书至CDN** | 自动部署域名证书至阿里云CDN |
| 8.| **阿里云-部署证书至DCDN** | 依赖证书申请前置任务,自动部署域名证书至阿里云DCDN |
| 9.| **阿里云-部署至ESA** | 部署证书到阿里云ESA(边缘安全加速),自动删除过期证书 |
| 10.| **阿里云-部署至阿里云FC(3.0)** | 部署证书到阿里云函数计算(FC3.0 |
| 11.| **阿里云-部署至GA** | 部署证书到阿里云GA(全球加速),支持更新默认证书和扩展证书 |
| 12.| **阿里云-部署至NLB(网络负载均衡)** | NLB,网络负载均衡,更新监听器的默认证书 |
| 13.| **阿里云-部署证书至OSS** | 部署域名证书至阿里云OSS自定义域名,不是上传到阿里云oss |
| 14.| **阿里云-部署至CLB(传统负载均衡)** | 部署证书到阿里云CLB(传统负载均衡) |
| 15.| **阿里云-部署至VOD** | 部署证书到阿里云视频点播(vod |
| 16.| **阿里云-部署至阿里云WAF(云产品接入)** | 部署证书到阿里云WAF(云产品接入),CNAME方式接入的请选择另外一个waf插件 |
| 17.| **阿里云-部署至阿里云WAF(cname接入)** | 部署证书到阿里云WAF(cname接入),云资源的请选择另外一个waf插件 |
| 18.| **阿里云-上传证书到CAS** | 上传证书到阿里云证书管理服务(CAS),如果不想在阿里云上同一份证书上传多次,可以把此任务作为前置任务,其他阿里云任务证书那一项选择此任务的输出 |
## 6. 华为云
| 序号 | 名称 | 说明 |
@@ -130,8 +133,9 @@
| 3.| **火山引擎-部署证书至CLB** | 部署至火山引擎负载均衡 |
| 4.| **火山引擎-部署证书至DCDN** | 部署至火山引擎全站加速 |
| 5.| **火山引擎-部署证书至Live** | 部署至火山引擎视频直播 |
| 6.| **火山引擎-部署证书至VOD** | 部署至火山引擎视频点播(暂不可用) |
| 7.| **火山引擎-上传证书至证书中心** | 上传证书至火山引擎证书中心 |
| 6.| **火山引擎-部署证书至TOS自定义域名** | 仅限TOS自定义域名,加速域名请选择火山引擎的CDN插件 |
| 7.| **火山引擎-部署证书至VOD** | 部署至火山引擎视频点播 |
| 8.| **火山引擎-上传证书至证书中心** | 上传证书至火山引擎证书中心 |
## 9. 京东云
| 序号 | 名称 | 说明 |
@@ -153,8 +157,9 @@
| 序号 | 名称 | 说明 |
|-----|-----|-----|
| 1.| **百度云-部署证书到负载均衡** | 部署到百度云负载均衡,包括BLB、APPBLB |
| 2.| **百度云-部署证书到CDN** | 部署到百度云CDN |
| 3.| **百度云-上传到证书托管** | 上传证书到百度云证书托管中心 |
| 2.| **百度云-部署到CCE** | 部署到百度云CCE集群Ingress等通过Secret管理证书的应用 |
| 3.| **百度云-部署证书到CDN** | 部署到百度云CDN |
| 4.| **百度云-上传到证书托管** | 上传证书到百度云证书托管中心 |
## 12. 七牛云
| 序号 | 名称 | 说明 |
+23 -17
View File
@@ -5,23 +5,29 @@
| 1.| **阿里ESA** | 阿里ESA DNS解析 |
| 2.| **阿里云** | 阿里云DNS解析提供商 |
| 3.| **AWS Route53** | AWS Route53 DNS解析提供商 |
| 4.| **火山引擎** | 火山引擎DNS解析提供商 |
| 5.| **京东云** | 京东云DNS解析提供商 |
| 6.| **新网(代理方式)** | 新网域名解析(代理方式) |
| 7.| **新网** | 新网域名解析 |
| 8.| **BIND9 DNS** | 通过 SSH 连接到 BIND9 服务器,使用 nsupdate 命令管理 DNS 记录 |
| 9.| **cloudflare** | cloudflare dns provider |
| 10.| **dns.la** | dns.la |
| 11.| **godaddy** | GoDaddy |
| 12.| **华为云** | 华为云DNS解析提供商 |
| 13.| **namesilo** | namesilo dns provider |
| 14.| **** | 云DNS解析提供商 |
| 15.| **腾讯云** | 腾讯云域名DNS解析提供者 |
| 16.| **腾讯云EO DNS** | 腾讯云EO DNS解析提供 |
| 17.| **西部数码** | west dns provider |
| 18.| **Dns提供商Demo** | dns provider示例 |
| 19.| **51dns** | 51DNS |
| 20.| **新网互联** | 新网互联 |
| 4.| **Azure DNS** | Azure DNS 解析提供商 |
| 5.| **火山引擎** | 火山引擎DNS解析提供商 |
| 6.| **京东云** | 京东云DNS解析提供商 |
| 7.| **新网(代理方式)** | 新网域名解析(代理方式) |
| 8.| **新网** | 新网域名解析 |
| 9.| **BIND9 DNS** | 通过 SSH 连接到 BIND9 服务器,使用 nsupdate 命令管理 DNS 记录 |
| 10.| **cloudflare** | cloudflare dns provider |
| 11.| **dns.la** | dns.la |
| 12.| **godaddy** | GoDaddy |
| 13.| **HiPM DNSMgr** | HiPM DNSMgr DNS 解析提供商 |
| 14.| **华为** | 华为云DNS解析提供商 |
| 15.| **namesilo** | namesilo dns provider |
| 16.| **雨云** | 雨云DNS解析提供 |
| 17.| **Technitium DNS Server** | Technitium DNS Server 自建DNS服务器 |
| 18.| **腾讯云** | 腾讯云域名DNS解析提供者 |
| 19.| **腾讯云EO DNS** | 腾讯云EO DNS解析提供者 |
| 20.| **西部数码** | west dns provider |
| 21.| **Google Cloud DNS** | Google Cloud DNS提供商 |
| 22.| **Dns提供商Demo** | dns provider示例 |
| 23.| **彩虹DNS** | 彩虹DNS管理系统 |
| 24.| **Spaceship** | Spaceship 域名解析 |
| 25.| **51dns** | 51DNS |
| 26.| **新网互联** | 新网互联 |
<style module>
table th:first-of-type {
+28
View File
@@ -0,0 +1,28 @@
# Azure 配置
## Access授权配置
1. 登录 Azure 并创建一个资源组 【可选,如果已经有了可以不用创建】
2. 创建一个应用程序
Microsoft Entra ID - 》 应用注册 - 》 新注册
![](./images/access-1.png)
![](./images/access-2.png)
3. 配置授权
![](./images/access-3.png)
4. 点击测试
## Azure DNS 配置
1. 创建一个 DNS 区域(就是一个域名)
![](./images/dns-1.png)
![](./images/dns-2.png)
2. 为这个域名和上面创建的授权应用分配角色
![](./images/dns-3.png)
![](./images/dns-4.png)
![](./images/dns-5.png)
3. 然后就可以给dns区域去申请证书了
Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

+8 -6
View File
@@ -26,16 +26,20 @@ Created an external account key
[b64MacKey: xxxxxxxxxxxxxxxx
keyId: xxxxxxxxxxxxx]
```
![](./images/google-eab.png)
3. 到Certd中,创建一条EAB授权记录,填写keyId(=kid) 和 b64MacKey 信息
注意:keyId没有`]`结尾,不要把`]`也复制了
注意:EAB授权使用过一次之后,会绑定邮箱,后续再次使用时,要使用相同的邮箱
注意:EAB授权使用过一次之后,会绑定邮箱,后续再次使用时,要使用相同的邮箱,所以邮箱切记不要修改
否则会报错 `Unknown external account binding (EAB) key. This may be due to the EAB key expiring which occurs 7 days after creation`
### 2.2 通过服务账号获取EAB
4. 创建证书流水线,选择证书提供商为google,选择EAB授权,运行流水线申请证书
此方式可以自动EAB,需要配置代理
### 2.2 通过google服务账号接口获取授权
此方式可以自动获取EAB,需要服务端配置代理
1. 创建服务账号
https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts/create?walkthrough_id=iam--create-service-account&hl=zh-cn#step_index=1
@@ -48,9 +52,7 @@ https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts/crea
7. 点击`添加密钥`->`创建新密钥`->`JSON`,下载密钥文件
8. 将json文件内容粘贴到 certd中 Google服务授权输入框中
9. 创建证书流水线,选择证书提供商为google, 选择服务账号授权,运行流水线申请证书
## 3、 创建证书流水线
选择证书提供商为google, 选择EAB授权 或 服务账号授权
## 4、 其他就跟正常申请证书一样了
+40
View File
@@ -0,0 +1,40 @@
# 企业模式(项目管理)
## 模式简介
Certd支持两种管理模式,`SaaS模式(默认)``企业模式`
![](../../../../packages/ui/certd-client/public/static/images/ent/admin_mode.png)
## SaaS模式
* 默认的模式,每个用户管理自己的流水线和授权资源,每个用户独立使用。
* Certd系统作为SaaS提供证书自动申请部署服务,您的客户注册即可使用,无需自己部署
## 企业模式
* 通过项目合作管理流水线证书和授权资源,所有用户视为企业内部员工。
* 当你想在企业内部使用,企业内部有多个项目,各个项目成员共同管理项目资源和证书时可以启用此模式
* 需要在"系统设置->管理模式"中开启`企业模式`
![](./images/admin_mode.jpg)
::: warning
* 建议在开始使用时固定一个合适的模式,之后就不要随意切换了。
* 商业版不能使用企业模式,因为商业版提供功能价值在于SaaS服务,与企业模式冲突
:::
### 数据迁移
模式之间数据不互通,您可以通过个人数据迁移功能将数据转到项目之下
#### 个人数据迁移到项目
注意:此操作不可逆,请谨慎操作
![](./images/transfer.jpg)
#### 流水线数据转到其他项目
项目之间流水线数据可以转移,依赖的授权数据会同步复制一份
![](./images/move.png)
Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

+1 -1
View File
@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.39.5"
"version": "1.39.11"
}
+28
View File
@@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.39.11](https://github.com/publishlab/node-acme-client/compare/v1.39.10...v1.39.11) (2026-04-26)
### Performance Improvements
* 为DNS解析器添加超时配置,避免查询时间过长 ([cc5154e](https://github.com/publishlab/node-acme-client/commit/cc5154e04e87f648111119b4eeb4e3cb4dd6cc41))
* 优化权威域名服务器查询超时时长 ([77db5ec](https://github.com/publishlab/node-acme-client/commit/77db5ecd12c51293e4de178e43ca0067bc70b46d))
* **technitium:** 添加Technitium DNS Server插件支持 ([edeb817](https://github.com/publishlab/node-acme-client/commit/edeb817c39597e4fa73a17ff4ca3f712f0320fec))
## [1.39.10](https://github.com/publishlab/node-acme-client/compare/v1.39.9...v1.39.10) (2026-04-11)
**Note:** Version bump only for package @certd/acme-client
## [1.39.9](https://github.com/publishlab/node-acme-client/compare/v1.39.8...v1.39.9) (2026-04-05)
**Note:** Version bump only for package @certd/acme-client
## [1.39.8](https://github.com/publishlab/node-acme-client/compare/v1.39.7...v1.39.8) (2026-03-31)
**Note:** Version bump only for package @certd/acme-client
## [1.39.7](https://github.com/publishlab/node-acme-client/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/acme-client
## [1.39.6](https://github.com/publishlab/node-acme-client/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/acme-client
## [1.39.5](https://github.com/publishlab/node-acme-client/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/acme-client
+3 -3
View File
@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client",
"private": false,
"author": "nmorsman",
"version": "1.39.5",
"version": "1.39.11",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.39.5",
"@certd/basic": "^1.39.11",
"@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5",
"axios": "^1.9.0",
@@ -70,5 +70,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
+2 -1
View File
@@ -21,7 +21,8 @@ const defaultOpts = {
},
challengeRemoveFn: async () => {
throw new Error("Missing challengeRemoveFn()");
}
},
waitDnsDiffuseTime: 30,
};
/**
+3 -2
View File
@@ -577,7 +577,7 @@ class AcmeClient {
const verifyFn = async (abort) => {
if (this.opts.signal && this.opts.signal.aborted) {
abort();
abort(true);
throw new CancelError('用户取消');
}
@@ -588,7 +588,8 @@ class AcmeClient {
if (invalidStates.includes(resp.data.status)) {
abort();
throw new Error(util.formatResponseError(resp));
this.log(`[${d}] : 检查状态 = ${resp.data.status} ${JSON.stringify(resp.data)}`);
throw new Error("校验失败:" + util.formatResponseError(resp));
}
else if (pendingStates.includes(resp.data.status)) {
throw new Error(`[${d}] Operation is pending or processing(当前仍然在等待状态)`);
+6 -3
View File
@@ -50,15 +50,18 @@ class Backoff {
async function retryPromise(fn, attempts, backoff, logger = log) {
let aborted = false;
let abortedFromUser = false;
try {
const setAbort = () => { aborted = true; }
const setAbort = (fromUser = false) => { aborted = true; abortedFromUser = fromUser; }
const data = await fn(setAbort);
return data;
}
catch (e) {
if (aborted){
logger(`用户取消重试`);
if (abortedFromUser){
logger(`用户取消重试`);
}
throw e;
}
if ( ((backoff.attempts + 1) >= attempts)) {
@@ -249,7 +252,7 @@ async function resolveDomainBySoaRecord(recordName, logger = log) {
async function getAuthoritativeDnsResolver(recordName, logger = log) {
logger(`获取域名${recordName}的权威NS服务器: `);
const resolver = new dns.Resolver();
const resolver = new dns.Resolver({ timeout: 10000,maxTimeout: 60000 });
try {
/* Resolve root domain by SOA */
-1
View File
@@ -92,7 +92,6 @@ async function walkDnsChallengeRecord(recordName, resolver = dns,deep = 0) {
try {
log(`检查域名 ${recordName} 的TXT记录`);
const txtRecords = await resolver.resolveTxt(recordName);
if (txtRecords && txtRecords.length) {
log(`找到 ${txtRecords.length} 条 TXT记录( ${recordName}`);
log(`TXT records: ${JSON.stringify(txtRecords)}`);
+1
View File
@@ -68,6 +68,7 @@ export interface ClientAutoOptions {
preferredChain?: string;
signal?: AbortSignal;
profile?:string;
waitDnsDiffuseTime?: number;
}
export class Client {
+28
View File
@@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
**Note:** Version bump only for package @certd/basic
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
### Performance Improvements
* 流水线修改编辑之后,增加未保存提示 ([21620ac](https://github.com/certd/certd/commit/21620ac6bdeb57e43509156a77037fc07c44282a))
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
### Performance Improvements
* **spaceship:** 新增Spaceship DNS插件和授权模块 ([21aec77](https://github.com/certd/certd/commit/21aec77e5c3307b5973d4185baba33edcb28926f))
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
**Note:** Version bump only for package @certd/basic
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/basic
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/basic
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/basic
+1 -1
View File
@@ -1 +1 @@
00:48
13:28
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.39.5",
"version": "1.39.11",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -47,5 +47,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
@@ -126,7 +126,7 @@ export function createAxiosService({ logger }: { logger: ILogger }) {
if (config.skipSslVerify || config.httpProxy) {
let rejectUnauthorized = true;
if (config.skipSslVerify) {
logger.info("跳过SSL验");
logger.info("忽略接口请求的SSL验");
rejectUnauthorized = false;
}
const proxy: any = {};
@@ -271,7 +271,7 @@ export function createAxiosService({ logger }: { logger: ILogger }) {
}
const originalRequest = error.config || {};
logger.info(`config`, originalRequest);
// logger.info(`config`, originalRequest);
const retry = originalRequest.retry || {};
if (retry.status && retry.status.includes(status)) {
if (retry.max > 0 && retry.count < retry.max) {
+32
View File
@@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
### Performance Improvements
* 支持一键安装脚本 ([dc969dd](https://github.com/certd/certd/commit/dc969dd7edb6934a29d6657afefe6f8af056741c))
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
**Note:** Version bump only for package @certd/pipeline
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
### Performance Improvements
* 支持域名到期时间监控通知 ([c6628e7](https://github.com/certd/certd/commit/c6628e7311d6c43c2a784581fb25ec37b29c168d))
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
### Performance Improvements
* 阿里云CDN部署支持根据证书域名自动匹配部署 ([a68301e](https://github.com/certd/certd/commit/a68301e4dcea8b7391ad751aa57555d566297ad9))
* 阿里云dcdn支持根据证书域名匹配模式 ([df012de](https://github.com/certd/certd/commit/df012dec90590ecba85a69ed6355cfa8382c1da3))
* dcdn自动匹配部署,支持新增域名感知 ([c6a988b](https://github.com/certd/certd/commit/c6a988bc925886bd7163c1270f2b7a10a57b1c5b))
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/pipeline
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/pipeline
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/pipeline
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.39.5",
"version": "1.39.11",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -18,8 +18,8 @@
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"@certd/basic": "^1.39.5",
"@certd/plus-core": "^1.39.5",
"@certd/basic": "^1.39.11",
"@certd/plus-core": "^1.39.11",
"dayjs": "^1.11.7",
"lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13"
@@ -45,5 +45,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
+4
View File
@@ -65,4 +65,8 @@ export abstract class BaseAccess implements IAccess {
}
throw new Error(`action ${req.action} not found`);
}
normalizeEndpoint(endpoint: string) {
return endpoint.replace(/\/$/, "");
}
}
+1 -1
View File
@@ -334,7 +334,7 @@ export class Executor {
//参数没有变化
inputChanged = false;
}
if (step.strategy?.runStrategy === RunStrategy.SkipWhenSucceed) {
if (step.strategy?.runStrategy === RunStrategy.SkipWhenSucceed && define.runStrategy !== RunStrategy.AlwaysRun) {
if (lastResult != null && lastResult === ResultType.success && !inputChanged) {
step.status!.output = lastNode?.status?.output;
step.status!.files = lastNode?.status?.files;
@@ -7,6 +7,7 @@ import { IEmailService } from "../service/index.js";
export type NotificationBody = {
userId?: number;
projectId?: number;
title: string;
content: string;
pipeline?: Pipeline;
@@ -20,6 +21,7 @@ export type NotificationBody = {
pipelineResult?: string;
pipelineTitle?: string;
errors?: string;
[key: string]: any; // 其他templateData
};
export type NotificationRequestHandleReqInput<T = any> = {
+114 -10
View File
@@ -1,16 +1,16 @@
import { Registrable } from "../registry/index.js";
import { FileItem, FormItemProps, Pipeline, Runnable, Step } from "../dt/index.js";
import { FileStore } from "../core/file-store.js";
import { accessRegistry, IAccessService } from "../access/index.js";
import { ICnameProxyService, IEmailService, IServiceGetter, IUrlService } from "../service/index.js";
import { CancelError, IContext, RunHistory, RunnableCollection } from "../core/index.js";
import { HttpRequestConfig, ILogger, logger, utils } from "@certd/basic";
import { HttpClient } from "@certd/basic";
import { domainUtils, HttpClient, HttpRequestConfig, ILogger, logger, utils } from "@certd/basic";
import dayjs from "dayjs";
import { IPluginConfigService } from "../service/config.js";
import { upperFirst } from "lodash-es";
import { cloneDeep, upperFirst } from "lodash-es";
import { accessRegistry, IAccessService } from "../access/index.js";
import { PageSearch } from "../context/index.js";
import { FileStore } from "../core/file-store.js";
import { CancelError, IContext, RunHistory, RunnableCollection } from "../core/index.js";
import { FileItem, FormItemProps, Pipeline, Runnable, Step } from "../dt/index.js";
import { INotificationService } from "../notification/index.js";
import { Registrable } from "../registry/index.js";
import { IPluginConfigService } from "../service/config.js";
import { TaskEmitter } from "../service/emit.js";
import { ICnameProxyService, IEmailService, IServiceGetter, IUrlService } from "../service/index.js";
export type PluginRequestHandleReq<T = any> = {
typeName: string;
@@ -64,6 +64,7 @@ export type PluginDefine = Registrable & {
onlyAdmin?: boolean;
needPlus?: boolean;
showRunStrategy?: boolean;
runStrategy?: any;
pluginType?: string; //类型
type?: string; //来源
};
@@ -81,6 +82,12 @@ export type TaskResult = {
pipelineVars: Record<string, any>;
pipelinePrivateVars?: Record<string, any>;
};
export type CertTargetItem = {
value: string;
label: string;
domain: string | string[];
};
export type TaskInstanceContext = {
//流水线定义
pipeline: Pipeline;
@@ -315,6 +322,103 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
getLastOutput(key: string) {
return this.getLastStatus().status?.output?.[key];
}
isDomainMatched(domainList: string | string[], certDomains: string[]): boolean {
const matched = domainUtils.match(domainList, certDomains);
return matched;
}
isNotChanged() {
const lastResult = this.ctx?.lastStatus?.status?.status;
return !this.ctx.inputChanged && lastResult === "success";
}
async getAutoMatchedTargets(req: {
targetName: string;
certDomains: string[];
pageSize: number;
getDeployTargetList: (req: PageSearch) => Promise<{ list: CertTargetItem[]; total: number }>;
}): Promise<CertTargetItem[]> {
const matchedDomains: CertTargetItem[] = [];
let pageNo = 1;
const { certDomains } = req;
const pageSize = req.pageSize || 100;
while (true) {
const result = await req.getDeployTargetList({
pageNo,
pageSize,
});
const pageData = result.list;
this.logger.info(`获取到 ${pageData.length}${req.targetName}`);
if (!pageData || pageData.length === 0) {
break;
}
for (const item of pageData) {
const domainName = item.domain;
if (this.isDomainMatched(domainName, certDomains)) {
matchedDomains.push(item);
}
}
const totalCount = result.total || 0;
if (pageNo * pageSize >= totalCount || matchedDomains.length == 0) {
break;
}
pageNo++;
}
return matchedDomains;
}
async autoMatchedDeploy(req: {
targetName: string;
getCertDomains: () => Promise<string[]>;
uploadCert: () => Promise<any>;
deployOne: (req: { target: CertTargetItem; cert: any }) => Promise<void>;
getDeployTargetList: (req: PageSearch) => Promise<{ list: CertTargetItem[]; total: number }>;
}): Promise<{ result: string; deployedList: string[] }> {
this.logger.info("证书匹配模式部署");
const certDomains = await req.getCertDomains();
const certTargetList = await this.getAutoMatchedTargets({
targetName: req.targetName,
pageSize: 200,
certDomains,
getDeployTargetList: req.getDeployTargetList,
});
if (certTargetList.length === 0) {
this.logger.warn(`未找到匹配的${req.targetName}`);
return { result: "skip", deployedList: [] };
}
this.logger.info(`找到 ${certTargetList.length} 个匹配的${req.targetName}`);
//开始部署,检查是否已经部署过
const deployedList = cloneDeep(this.getLastStatus()?.status?.output?.deployedList || []);
const unDeployedTargets = certTargetList.filter(item => !deployedList.includes(item.value));
const count = unDeployedTargets.length;
const deployedCount = certTargetList.length - count;
if (deployedCount > 0) {
this.logger.info(`跳过 ${deployedCount} 个已部署过的${req.targetName}`);
}
this.logger.info(`需要部署 ${count}${req.targetName}`);
if (count === 0) {
return { result: "skip", deployedList };
}
this.logger.info(`开始部署`);
const aliCrtId = await req.uploadCert();
for (const target of unDeployedTargets) {
await req.deployOne({
cert: aliCrtId,
target,
});
deployedList.push(target.value);
}
this.logger.info(`本次成功部署 ${count}${req.targetName}`);
return { result: "success", deployedList };
}
}
export type OutputVO = {
+24
View File
@@ -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.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
**Note:** Version bump only for package @certd/lib-huawei
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
**Note:** Version bump only for package @certd/lib-huawei
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
**Note:** Version bump only for package @certd/lib-huawei
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
**Note:** Version bump only for package @certd/lib-huawei
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/lib-huawei
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/lib-huawei
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/lib-huawei
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.39.5",
"version": "1.39.11",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts",
@@ -24,5 +24,5 @@
"prettier": "^2.8.8",
"tslib": "^2.8.1"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
+24
View File
@@ -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.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
**Note:** Version bump only for package @certd/lib-iframe
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
**Note:** Version bump only for package @certd/lib-iframe
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
**Note:** Version bump only for package @certd/lib-iframe
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
**Note:** Version bump only for package @certd/lib-iframe
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/lib-iframe
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/lib-iframe
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/lib-iframe
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.39.5",
"version": "1.39.11",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
+24
View File
@@ -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.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
**Note:** Version bump only for package @certd/jdcloud
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
**Note:** Version bump only for package @certd/jdcloud
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
**Note:** Version bump only for package @certd/jdcloud
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
**Note:** Version bump only for package @certd/jdcloud
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/jdcloud
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/jdcloud
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/jdcloud
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/jdcloud",
"version": "1.39.5",
"version": "1.39.11",
"description": "jdcloud openApi sdk",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
@@ -56,5 +56,5 @@
"fetch"
]
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
+26
View File
@@ -3,6 +3,32 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
**Note:** Version bump only for package @certd/lib-k8s
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
**Note:** Version bump only for package @certd/lib-k8s
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
**Note:** Version bump only for package @certd/lib-k8s
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
### Performance Improvements
* 支持部署证书到百度CCE ([a19ea74](https://github.com/certd/certd/commit/a19ea7489c01cdbf795fb51f804bd6d00389f604))
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/lib-k8s
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/lib-k8s
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/lib-k8s
+5 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.39.5",
"version": "1.39.11",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -14,10 +14,11 @@
"build3": "rollup -c",
"build2": "vue-tsc --noEmit && vite build",
"preview": "vite preview",
"pub": "npm publish"
"pub": "npm publish",
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"@certd/basic": "^1.39.5",
"@certd/basic": "^1.39.11",
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
@@ -32,5 +33,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
+19 -3
View File
@@ -59,9 +59,9 @@ export class K8sClient {
const yml = loadYaml<KubernetesObject>(manifest);
const client = this.getKubeClient();
try {
this.logger.info("apply yaml:", yml);
await client.create(yml);
} catch (e) {
this.logger.error("apply error", e.response?.body);
if (e.response?.body?.reason === "AlreadyExists") {
//patch
this.logger.info("patch existing resource: ", yml.metadata?.name);
@@ -70,13 +70,26 @@ export class K8sClient {
yml.metadata = {};
}
yml.metadata.resourceVersion = existing.body.metadata.resourceVersion;
await client.patch(yml);
return;
const res = await client.patch(yml);
return res?.body;
}
throw e;
}
}
async applyPatch(manifest: string) {
const yml = loadYaml<KubernetesObject>(manifest);
const client = this.getKubeClient();
this.logger.info("patch yaml:", yml);
const existing = await client.read(yml as any);
if (!yml.metadata) {
yml.metadata = {};
}
yml.metadata.resourceVersion = existing.body.metadata.resourceVersion;
const res = await client.patch(yml);
return res?.body;
}
/**
*
* @param localRecords { [domain]:{ip:'xxx.xx.xxx'} }
@@ -112,6 +125,7 @@ export class K8sClient {
*/
async createSecret(opts: { namespace: string; body: V1Secret }) {
const namespace = opts.namespace || "default";
this.logger.info("create secret:", opts.body.metadata);
const created = await this.client.createNamespacedSecret(namespace, opts.body);
this.logger.info("new secrets:", opts.body.metadata);
return created.body;
@@ -152,6 +166,8 @@ export class K8sClient {
this.logger.info(`secret ${secretName} 已创建`);
return res;
}
throw new Error(`secret ${secretName} 不存在`);
}
throw e;
}
+30
View File
@@ -3,6 +3,36 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
### Bug Fixes
* 修复列表页面底部滚动条与表格之间有空白间隙的bug ([71cfcad](https://github.com/certd/certd/commit/71cfcad2a15aac0badd85a10c4012a1e713654d1))
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
### Bug Fixes
* 修复自定义插件删除后没有反注册的bug ([df98463](https://github.com/certd/certd/commit/df9846332596d2afaba53e66d2897aa1c598f9c4))
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
**Note:** Version bump only for package @certd/lib-server
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
**Note:** Version bump only for package @certd/lib-server
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
### Bug Fixes
* 修复cname校验报该授权无权限的bug ([b1eb706](https://github.com/certd/certd/commit/b1eb7069258d6ff2b128091911fa448eaffc5f33))
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/lib-server
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/lib-server
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.39.5",
"version": "1.39.11",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -28,11 +28,11 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.39.5",
"@certd/basic": "^1.39.5",
"@certd/pipeline": "^1.39.5",
"@certd/plugin-lib": "^1.39.5",
"@certd/plus-core": "^1.39.5",
"@certd/acme-client": "^1.39.11",
"@certd/basic": "^1.39.11",
"@certd/pipeline": "^1.39.11",
"@certd/plugin-lib": "^1.39.11",
"@certd/plus-core": "^1.39.11",
"@midwayjs/cache": "3.14.0",
"@midwayjs/core": "3.20.11",
"@midwayjs/i18n": "3.20.13",
@@ -64,5 +64,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
@@ -76,10 +76,12 @@ export abstract class BaseService<T> {
* @param where
*/
async delete(ids: string | any[], where?: any) {
const idArr = this.resolveIdArr(ids);
let idArr = this.resolveIdArr(ids);
idArr = this.filterIds(idArr);
if (idArr.length === 0) {
return;
}
await this.getRepository().delete({
id: In(idArr),
...where,
@@ -94,7 +96,9 @@ export abstract class BaseService<T> {
}
if (typeof ids === 'string') {
return ids.split(',');
} else {
} else if(!Array.isArray(ids)){
return [ids];
}else {
return ids;
}
}
@@ -217,6 +221,7 @@ export abstract class BaseService<T> {
if (!Array.isArray(ids)) {
ids = [ids];
}
ids = this.filterIds(ids);
const res = await this.getRepository().find({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
@@ -234,7 +239,16 @@ export abstract class BaseService<T> {
throw new PermissionException('权限不足');
}
filterIds(ids: any[]) {
if (!ids) {
throw new ValidateException('ids不能为空');
}
return ids.filter((item) => {
return item!=null && item != ""
});
}
async batchDelete(ids: number[], userId: number,projectId?:number) {
ids = this.filterIds(ids);
if(userId!=null){
const list = await this.getRepository().find({
where: {
@@ -6,10 +6,10 @@ import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, Sy
import { getAllSslProviderDomains, setSslProviderReverseProxies } from '@certd/acme-client';
import { cache, logger, mergeUtils, setGlobalProxy } from '@certd/basic';
import { isPlus } from '@certd/plus-core';
import * as dns from 'node:dns';
import { BaseService, setAdminMode } from '../../../basic/index.js';
import { executorQueue } from '../../basic/service/executor-queue.js';
import { isComm, isPlus } from '@certd/plus-core';
const { merge } = mergeUtils;
let lastSaveEnvVars = {};
@@ -119,11 +119,11 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
}
async savePublicSettings(bean: SysPublicSettings) {
if (isComm()) {
if (bean.adminMode === 'enterprise') {
throw new Error("商业版不支持使用企业管理模式")
}
}
// if (isComm()) {
// if (bean.adminMode === 'enterprise') {
// throw new Error("商业版不支持使用企业管理模式")
// }
// }
await this.saveSetting(bean);
//让设置生效
@@ -3,8 +3,8 @@ import { IAccessService } from '@certd/pipeline';
export class AccessGetter implements IAccessService {
userId: number;
projectId?: number;
getter: <T>(id: any, userId?: number, projectId?: number) => Promise<T>;
constructor(userId: number, projectId: number, getter: (id: any, userId: number, projectId?: number) => Promise<any>) {
getter: <T>(id: any, userId?: number, projectId?: number, ignorePermission?: boolean) => Promise<T>;
constructor(userId: number, projectId: number, getter: (id: any, userId: number, projectId?: number, ignorePermission?: boolean) => Promise<any>) {
this.userId = userId;
this.projectId = projectId;
this.getter = getter;
@@ -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.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/midway-flyway-js
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.39.5",
"version": "1.39.11",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
+24
View File
@@ -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.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
**Note:** Version bump only for package @certd/plugin-cert
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
**Note:** Version bump only for package @certd/plugin-cert
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
**Note:** Version bump only for package @certd/plugin-cert
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
**Note:** Version bump only for package @certd/plugin-cert
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/plugin-cert
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/plugin-cert
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/plugin-cert
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.39.5",
"version": "1.39.11",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -17,10 +17,10 @@
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"@certd/acme-client": "^1.39.5",
"@certd/basic": "^1.39.5",
"@certd/pipeline": "^1.39.5",
"@certd/plugin-lib": "^1.39.5",
"@certd/acme-client": "^1.39.11",
"@certd/basic": "^1.39.11",
"@certd/pipeline": "^1.39.11",
"@certd/plugin-lib": "^1.39.11",
"psl": "^1.9.0",
"punycode.js": "^2.3.1"
},
@@ -38,5 +38,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
+30
View File
@@ -3,6 +3,36 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
### Performance Improvements
* 支持部署到nginx-proxy-manager ([2e6e9ed](https://github.com/certd/certd/commit/2e6e9ed9255bcf178edb0eb00d93a7f13c214430))
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
### Performance Improvements
* 1panel支持先上传证书再选择证书 ([7a9eec8](https://github.com/certd/certd/commit/7a9eec88e8eddf40dba055c072b5b2b0f67c1407))
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
**Note:** Version bump only for package @certd/plugin-lib
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
### Performance Improvements
* dcdn自动匹配部署,支持新增域名感知 ([c6a988b](https://github.com/certd/certd/commit/c6a988bc925886bd7163c1270f2b7a10a57b1c5b))
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/plugin-lib
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
**Note:** Version bump only for package @certd/plugin-lib
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
**Note:** Version bump only for package @certd/plugin-lib
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.39.5",
"version": "1.39.11",
"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.39.5",
"@certd/basic": "^1.39.5",
"@certd/pipeline": "^1.39.5",
"@certd/plus-core": "^1.39.5",
"@certd/acme-client": "^1.39.11",
"@certd/basic": "^1.39.11",
"@certd/pipeline": "^1.39.11",
"@certd/plus-core": "^1.39.11",
"@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5",
@@ -57,5 +57,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "aacee4a94c2e2481be8a307fb5a6a5d04a09dda7"
"gitHead": "112a565bf74c50e16c27a2c0a716588f84f39789"
}
@@ -7,6 +7,9 @@ import { ILogger } from "@certd/basic";
import dayjs from "dayjs";
import { uniq } from "lodash-es";
export interface ICertInfoGetter {
getByPipelineId: (pipelineId: number) => Promise<CertInfo>;
}
export type CertInfo = {
crt: string; //fullchain证书
key: string; //私钥
@@ -43,6 +46,12 @@ const formats = {
jks: ["jks"],
p7b: ["p7b", "key"],
};
export type SimpleCertDetail = {
notBefore: Date;
notAfter: Date;
domains: string[];
};
export class CertReader {
cert: CertInfo;
@@ -116,8 +125,22 @@ export class CertReader {
return CertReader.readCertDetail(crt);
}
getSimpleDetail() {
const { detail } = this.getCrtDetail();
return {
notBefore: detail.notBefore,
notAfter: detail.notAfter,
domains: this.getAllDomains(),
};
}
static readCertDetail(crt: string) {
const detail = crypto.readCertificateInfo(crt.toString());
let detail: CertificateInfo;
try {
detail = crypto.readCertificateInfo(crt.toString());
} catch (e) {
throw new Error("证书解析失败:" + e.message + "(请确定证书格式,是否与私钥搞反?)");
}
const effective = detail.notBefore;
const expires = detail.notAfter;
const fingerprints = CertReader.getFingerprintX509(crt);
@@ -1,2 +1,2 @@
export const CertApplyPluginNames = [":cert:"];
export const EVENT_CERT_APPLY_SUCCESS = "CertApply.success";
export const EVENT_CERT_APPLY_SUCCESS = "CertApply.success";
@@ -1,4 +1,4 @@
export * from "./convert.js";
export * from "./cert-reader.js";
export * from "./consts.js";
export * from "./dns-provider/index.js";
export * from "./dns-provider/index.js";
@@ -44,6 +44,10 @@ export function createRemoteSelectInputDefine(opts?: {
component?: any;
value?: any;
pageSize?: number;
uploadCert?: {
title?: string;
columns?: Record<string, any>;
};
}) {
const title = opts?.title || "请选择";
const certDomainsInputKey = opts?.certDomainsInputKey || "certDomains";
@@ -74,6 +78,7 @@ export function createRemoteSelectInputDefine(opts?: {
multi,
pageSize: opts?.pageSize,
watches: [certDomainsInputKey, accessIdInputKey, ...watches],
uploadCert: opts?.uploadCert,
...opts.component,
},
value: opts.value,
+73
View File
@@ -3,6 +3,79 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.39.11](https://github.com/certd/certd/compare/v1.39.10...v1.39.11) (2026-04-26)
### Bug Fixes
* 修复列表页面底部滚动条与表格之间有空白间隙的bug ([71cfcad](https://github.com/certd/certd/commit/71cfcad2a15aac0badd85a10c4012a1e713654d1))
* 修复流水线未编辑模式下也提示未保存的bug ([64a3503](https://github.com/certd/certd/commit/64a350364d820725b5e69d22ac2416809092f97d))
* 修复商业版设置了公共eab,创建流水线仍然会显示需要配置eab的bug ([24dff05](https://github.com/certd/certd/commit/24dff05f6427dadec1e40350214c0167e1d6a73d))
### Performance Improvements
* 模版创建流水线支持随机时间 ([575415b](https://github.com/certd/certd/commit/575415b93a3e10e1c6e5644f71ddc711ea6f8adc))
* 商业版支持配置证书申请插件参数 ([7ac789c](https://github.com/certd/certd/commit/7ac789c9c7e91cdf08dfdae1bb49186552e370e3))
* 添加全新的未登录首页和路由配置 ([d1988dc](https://github.com/certd/certd/commit/d1988dc982440472ecf61847ccad76e4c96a80fb))
* 优化权威域名服务器查询超时时长 ([77db5ec](https://github.com/certd/certd/commit/77db5ecd12c51293e4de178e43ca0067bc70b46d))
* 支持主动修改绑定url地址 ([11b7cfe](https://github.com/certd/certd/commit/11b7cfe5cb7e88e6ebd68d53acb4e5b556550ca9))
* **technitium:** 添加Technitium DNS Server插件支持 ([edeb817](https://github.com/certd/certd/commit/edeb817c39597e4fa73a17ff4ca3f712f0320fec))
## [1.39.10](https://github.com/certd/certd/compare/v1.39.9...v1.39.10) (2026-04-11)
### Bug Fixes
* 修复创建流水线无法选择通知的bug ([a88d0a6](https://github.com/certd/certd/commit/a88d0a6ae15cb6170d0b36e21daf89f0dbd5f681))
* 修复流水线任务编辑页面复制粘贴按钮在夜间模式显示问题 ([1e549df](https://github.com/certd/certd/commit/1e549dfd431ed74e2bcdfce63e5f640c51603af3))
* 修复用户管理添加用户无法上传头像的bug ([557e98c](https://github.com/certd/certd/commit/557e98c33f5462167d8f6289f70dad68bb114a97))
* 修复自定义插件删除后没有反注册的bug ([df98463](https://github.com/certd/certd/commit/df9846332596d2afaba53e66d2897aa1c598f9c4))
### Performance Improvements
* 1panel支持先上传证书再选择证书 ([7a9eec8](https://github.com/certd/certd/commit/7a9eec88e8eddf40dba055c072b5b2b0f67c1407))
* 流水线修改编辑之后,增加未保存提示 ([21620ac](https://github.com/certd/certd/commit/21620ac6bdeb57e43509156a77037fc07c44282a))
* 修复检查全部某些情况下无效的bug,优化公共触发站点证书检查定时逻辑 ([ee53589](https://github.com/certd/certd/commit/ee535895a3166c6f9046963e28fa8f22f018b574))
* 增加域名管理 子域名检查提醒 ([2bdf183](https://github.com/certd/certd/commit/2bdf1832da73a3728f3ac415837bc26e70531cd6))
* 站点监控域名气泡增加端口显示 ([6ee718a](https://github.com/certd/certd/commit/6ee718a25265a9db2115343af9a1a01958f34b81))
## [1.39.9](https://github.com/certd/certd/compare/v1.39.8...v1.39.9) (2026-04-05)
### Bug Fixes
* 修复某些情况下报无法修改通知的问题 ([d1a6592](https://github.com/certd/certd/commit/d1a65922d7e152d6edcf6c53b70079f16b54a0d3))
### Performance Improvements
* 支持域名到期时间监控通知 ([c6628e7](https://github.com/certd/certd/commit/c6628e7311d6c43c2a784581fb25ec37b29c168d))
* **monitor:** 支持查看监控执行记录 ([b5cc794](https://github.com/certd/certd/commit/b5cc794061c11b7200b669473c25c4bbfc944b61))
## [1.39.8](https://github.com/certd/certd/compare/v1.39.7...v1.39.8) (2026-03-31)
### Bug Fixes
* 修复上传头像退出登录的bug ([6eb20a1](https://github.com/certd/certd/commit/6eb20a1f2e31d984d9135edbf39c97cdd15621f9))
### Performance Improvements
* 阿里云dcdn支持根据证书域名匹配模式 ([df012de](https://github.com/certd/certd/commit/df012dec90590ecba85a69ed6355cfa8382c1da3))
* dcdn自动匹配部署,支持新增域名感知 ([c6a988b](https://github.com/certd/certd/commit/c6a988bc925886bd7163c1270f2b7a10a57b1c5b))
## [1.39.7](https://github.com/certd/certd/compare/v1.39.6...v1.39.7) (2026-03-25)
**Note:** Version bump only for package @certd/ui-client
## [1.39.6](https://github.com/certd/certd/compare/v1.39.5...v1.39.6) (2026-03-22)
### Bug Fixes
* 修复模版id不正确导致修改到错误的模版流水线bug ([b1ff163](https://github.com/certd/certd/commit/b1ff163a2828b205297408d5aed21cf1eff335e8))
* remote-select默认pageSize设置为50,阿里云WAF不支持pageSize100 ([285532d](https://github.com/certd/certd/commit/285532d4318b90d0d7f8154f070274c0a0ec0269))
### Performance Improvements
* 企业模式下面增加个人数据迁移的引导 ([431afd6](https://github.com/certd/certd/commit/431afd618f547cecf9a29433f46d4367619e2ecf))
* 优化远程数据选择框,选择数据时不刷新闪烁 ([7f6a8bc](https://github.com/certd/certd/commit/7f6a8bc87e364685defe7f039264b2de064806c5))
* 支持复制粘贴任务步骤 ([acc2df2](https://github.com/certd/certd/commit/acc2df29def017fb8165f931b41ef95414966afc))
## [1.39.5](https://github.com/certd/certd/compare/v1.39.4...v1.39.5) (2026-03-18)
### Bug Fixes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.39.5",
"version": "1.39.11",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -106,8 +106,8 @@
"zod-defaults": "^0.1.3"
},
"devDependencies": {
"@certd/lib-iframe": "^1.39.5",
"@certd/pipeline": "^1.39.5",
"@certd/lib-iframe": "^1.39.11",
"@certd/pipeline": "^1.39.11",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

@@ -13,13 +13,11 @@
</template>
<script lang="ts" setup>
import parser from "cron-parser";
import { computed, ref } from "vue";
import dayjs from "dayjs";
import { useI18n } from "vue-i18n";
import { getCronNextTimes } from "/@/components/cron-editor/utils";
const { t } = useI18n();
import { getCronNextTimes } from "/@/components/cron-editor/utils";
defineOptions({
name: "CronEditor",
});
@@ -1,5 +1,5 @@
<template>
<a-select :value="value" @update:value="onChange">
<a-select :value="value" :filter-option="true" @update:value="onChange">
<a-select-option v-for="item of options" :key="item.value" :value="item.value" :label="item.label">
<span class="flex-o">
<fs-icon :icon="item.icon" class="fs-16 color-blue mr-5" />
@@ -1,5 +1,5 @@
<template>
<icon-select class="dns-provider-selector" :value="modelValue" :options="options" @update:value="atChange"> </icon-select>
<icon-select class="dns-provider-selector" :value="modelValue" :options="options" :filter-option="true" @update:value="atChange"> </icon-select>
</template>
<script lang="ts">
@@ -2,7 +2,7 @@
<div class="domains-verify-plan-editor" :class="{ fullscreen }">
<div class="fullscreen-modal" @click="fullscreenExit"></div>
<div class="plan-wrapper">
<div class="plan-box">
<div class="plan-box bg-white dark:bg-neutral-700">
<div class="fullscreen-button pointer flex-center" @click="fullscreen = !fullscreen">
<span v-if="!fullscreen" style="font-size: 10px" class="flex-center">
这里可以放大
@@ -273,7 +273,7 @@ watch(
left: 0;
width: 100%;
height: 100%;
background-color: rgba(74, 74, 74, 0.78);
// background-color: rgba(74, 74, 74, 0.78);
z-index: 1000;
margin: auto;
display: flex;
@@ -287,7 +287,6 @@ watch(
.plan-box {
position: relative;
margin: auto;
background-color: #fff;
}
}
@@ -315,7 +314,7 @@ watch(
height: 100%;
//table-layout: fixed;
th {
background-color: #f5f5f5;
// background-color: #f5f5f5;
border-top: 1px solid #e8e8e8;
border-left: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
@@ -33,7 +33,7 @@ export default {
async function onCreate() {
await pluginStore.init();
options.value = pluginStore.group.getPreStepOutputOptions({
pipeline: pipeline.value,
pipeline: pipeline?.value,
currentStageIndex: currentStageIndex.value,
currentTaskIndex: currentTaskIndex.value,
currentStepIndex: currentStepIndex.value,
@@ -25,8 +25,9 @@
</div>
</template>
</a-select>
<div class="ml-5">
<div class="ml-5 flex flex-row no-wrap">
<fs-button :loading="loading" title="刷新选项" icon="ion:refresh-outline" @click="refreshOptions"></fs-button>
<UploadCert v-if="uploadCert" class="ml-5" v-bind="uploadCert" @submit="refreshOptions"></UploadCert>
</div>
</div>
<div class="helper" :class="{ error: hasError }">
@@ -39,6 +40,8 @@ import { ComponentPropsType, doRequest } from "/@/components/plugins/lib";
import { defineComponent, inject, ref, useAttrs, watch, Ref } from "vue";
import { PluginDefine } from "@certd/pipeline";
import { getInputFromForm } from "./utils";
import UploadCert from "./upload-cert.vue";
import { UploadCertProps } from "./types";
defineOptions({
name: "RemoteSelect",
@@ -65,9 +68,10 @@ const props = defineProps<
pager?: boolean;
multi?: boolean;
pageSize?: number;
uploadCert?: UploadCertProps;
} & ComponentPropsType
>();
debugger;
const emit = defineEmits<{
"update:value": any;
}>();
@@ -104,7 +108,7 @@ const loading = ref(false);
const pagerRef: Ref = ref({
pageNo: 1,
total: 0,
pageSize: props.pageSize || 100,
pageSize: props.pageSize || 50,
});
const getOptions = async () => {
if (loading.value) {
@@ -182,7 +186,7 @@ const getOptions = async () => {
pagerRef.value.pageNo = res.pageNo ?? 1;
}
if (res.pageSize != null) {
pagerRef.value.pageSize = res.pageSize ?? 100;
pagerRef.value.pageSize = res.pageSize ?? pageSize;
}
if (res.total != null) {
pagerRef.value.total = res.total ?? list.length;
@@ -237,7 +241,7 @@ watch(
let changed = oldForm == null || optionsRef.value.length == 0;
if (props.watches && props.watches.length > 0) {
for (const key of props.watches) {
if (oldForm && form[key] != oldForm[key]) {
if (oldForm && JSON.stringify(form[key]) != JSON.stringify(oldForm[key])) {
changed = true;
break;
}
@@ -0,0 +1,5 @@
export interface UploadCertProps {
title?: string;
columns?: Record<string, any>;
button?: any;
}
@@ -0,0 +1,101 @@
<template>
<div class="upload-cert">
<fs-button v-model:loading="loading" type="primary" text="上传" v-bind="props.button" @click="openUploadCertDialog"></fs-button>
</div>
</template>
<script lang="ts" setup>
import { message } from "ant-design-vue";
import { useFormDialog } from "../../../use/use-dialog";
import { computed, inject, ref } from "vue";
import { doRequest } from "../lib";
import { getInputFromForm } from "./utils";
import { UploadCertProps } from "./types";
import { merge } from "lodash-es";
const props = defineProps<UploadCertProps>();
const loading = ref(false);
const emit = defineEmits(["submit"]);
const { openFormDialog } = useFormDialog();
const pipeline = inject("pipeline", null);
const getCurrentPluginDefine: any = inject("getCurrentPluginDefine", () => {
return {};
});
const getScope: any = inject("get:scope", () => {
return {};
});
const getPluginType: any = inject("get:plugin:type", () => {
return "plugin";
});
const title = computed(() => props.title || "上传证书");
function openUploadCertDialog() {
const columns = merge(
{
certName: {
title: "证书名称",
form: {
component: {
name: "a-input",
vModel: "value",
},
helper: "上传后证书显示名称",
},
},
},
props.columns
);
openFormDialog({
title: title.value,
columns: {
certName: {
title: "证书名称",
form: {
component: {
name: "a-input",
vModel: "value",
},
},
},
...props.columns,
},
onSubmit: async (form: any) => {
const pluginType = getPluginType();
const scope = getScope();
const { input, record } = getInputFromForm(scope.form, pluginType);
loading.value = true;
try {
const res = await doRequest(
{
type: pluginType,
typeName: scope.form.type,
action: "onUploadCert",
input,
record,
data: {
pipelineId: pipeline?.value?.id,
...form,
},
},
{
// onError(err: any) {
// message.error(err.message);
// },
showErrorNotify: true,
}
);
message.success("上传成功");
emit("submit");
} finally {
loading.value = false;
}
},
});
}
</script>
<style lang="less">
.upload-cert {
display: flex;
align-items: center;
}
</style>
@@ -4,7 +4,7 @@
<div class="step-item overflow-hidden">
<div class="text">
<h3 class="title">{{ number }} {{ currentStepItem.title }}</h3>
<h3 class="title font-bold">{{ number }} {{ currentStepItem.title }}</h3>
<div class="description mt-5">
<div v-for="(desc, index) of currentStepItem.descriptions" :key="index">{{ desc }}</div>
</div>
@@ -247,6 +247,7 @@ function previewMask() {
<style lang="less">
.tutorial-steps {
display: flex;
.step-item {
display: flex !important;
flex-direction: row;
@@ -251,7 +251,7 @@ function openUpgrade() {
class: "vip-modal",
maskClosable: true,
okText: t("vip.close"),
width: 1100,
width: 1180,
content: () => {
return <VipModalContent placeholder={placeholder} isPlus={isPlus} productInfo={productInfo} goBuyPlusPage={goBuyPlusPage} goBuyCommPage={goBuyCommPage} openStarModal={openStarModal} modalRef={modalRef} />;
},
@@ -65,6 +65,11 @@
</div>
<div class="get-show">
<template v-if="item.type === 'plus'">
<span v-if="todayOrderCount.showVipTotal" class="mr-5">
已有
<span class="color-red"> {{ todayOrderCount.vipTotal }}</span>
位伙伴支持
</span>
<a-tooltip :title="t('vip.afdian_support_vip')">
<a-button size="small" type="primary" @click="goBuyPlusPage">
{{ t("vip.get_after_support") }}
@@ -204,13 +209,13 @@ const vipTypeDefine: any = {
desc: t("vip.community_free_version"),
type: "free",
icon: "lucide:package-open",
privilege: [t("vip.unlimited_certificate_application"), t("vip.unlimited_domain_count"), t("vip.unlimited_certificate_pipelines"), t("vip.common_deployment_plugins"), t("vip.email_webhook_notifications")],
privilege: t("vip.free_privilege").split("\n"),
},
plus: {
title: t("vip.professional_edition"),
desc: t("vip.open_source_support"),
type: "plus",
privilege: [t("vip.vip_group_priority"), t("vip.unlimited_site_certificate_monitoring"), t("vip.more_notification_methods"), t("vip.plugins_fully_open")],
privilege: t("vip.plus_privilege").split("\n"),
trial: {
title: t("vip.click_to_get_7_day_trial"),
click: () => {
@@ -227,7 +232,7 @@ const vipTypeDefine: any = {
desc: t("vip.commercial_license"),
type: "comm",
icon: "vaadin:handshake",
privilege: [t("vip.all_pro_privileges"), t("vip.allow_commercial_use_modify_logo_title"), t("vip.data_statistics"), t("vip.plugin_management"), t("vip.unlimited_multi_users"), t("vip.support_user_payment")],
privilege: t("vip.comm_privilege").split("\n"),
priceText: props.productInfo.comm.priceText || `¥${props.productInfo.comm.price}/${t("vip.years")}`,
discountText: props.productInfo.comm.discountText || `¥${props.productInfo.comm.price3}/3${t("vip.years")}`,
tooltip: props.productInfo.comm.tooltip,
@@ -260,12 +265,16 @@ const todayOrderCount = computed(() => {
const lastStage = countInfo?.stages?.[countInfo?.stages?.length - 1] || {};
lastStage.orderCount = orderCount;
const vipTotal = countInfo?.vipTotal || 0;
const showVipTotal = countInfo?.showVipTotal || false;
const userTotal = countInfo?.userTotal || 0;
const stages: any = [];
stages.push({
title: countInfo.title,
vipTotal: countInfo?.vipTotal || 0,
orderCount: orderCount,
bg: lastStage.bg,
showVipTotal: showVipTotal,
});
if (lastStage.orderCount > 0) {
stages.push(lastStage);
@@ -273,6 +282,9 @@ const todayOrderCount = computed(() => {
return {
enabled: enabled,
stages: stages,
showVipTotal: showVipTotal,
vipTotal: vipTotal,
userTotal: userTotal,
};
});
@@ -2,7 +2,7 @@
<div id="userLayout" :class="['user-layout-wrapper']">
<div class="login-container flex justify-start dark:background-[#141414]">
<div class="user-layout-content flex-col justify-start">
<div class="top flex flex-col items-center justify-start">
<div class="top flex flex-col items-center justify-start pointer" @click="goHome">
<div class="header flex flex-row items-center">
<img :src="siteInfo.loginLogo" class="logo" alt="logo" />
<span class="title"></span>
@@ -15,10 +15,13 @@
</div>
<div class="footer">
<div class="copyright">
<span v-if="!settingStore.isComm">
<span>
<span>Copyright</span>
<span>&copy;</span>
<span>{{ envRef.COPYRIGHT_YEAR }}</span>
</span>
<span v-if="!settingStore.isComm">
<a-divider type="vertical" />
<span>
<a :href="envRef.COPYRIGHT_URL" target="_blank">{{ envRef.COPYRIGHT_NAME }}</a>
</span>
@@ -47,6 +50,7 @@ import { env } from "/@/utils/util.env";
import { computed, ref, Ref } from "vue";
import { useSettingStore } from "/@/store/settings";
import { SiteInfo, SysPublicSetting } from "/@/store/settings/api.basic";
import { useRouter } from "vue-router";
const envRef = ref(env);
const settingStore = useSettingStore();
@@ -56,6 +60,10 @@ const siteInfo: Ref<SiteInfo> = computed(() => {
const sysPublic: Ref<SysPublicSetting> = computed(() => {
return settingStore.sysPublic;
});
const router = useRouter();
function goHome() {
router.replace("/");
}
</script>
<style lang="less">
@@ -221,6 +221,7 @@ export default {
projectJoin: "Join Project",
currentProject: "Current Project",
projectMemberManager: "Project Member",
domainMonitorSetting: "Domain Monitor Settings",
},
certificateRepo: {
title: "Certificate Repository",
@@ -795,6 +796,8 @@ export default {
reverseProxyEmpty: "No reverse proxy list configured",
environmentVars: "Environment Variables",
environmentVarsHelper: "configure the runtime environment variables, one per line, format: KEY=VALUE",
bindUrl: "Bind URL",
},
},
modal: {
@@ -64,10 +64,41 @@ export default {
dnsServerHelper: "Use a custom domain name resolution server, such as: 1.1.1.1 , support multiple",
certValidDays: "Certificate Valid Days",
certValidDaysHelper: "Number of days before expiration to send a notification",
domain: {
monitorSettings: "Domain Monitor Settings",
enabled: "Enable Domain Monitor",
enabledHelper: "Enable to monitor all domain registration expiration time",
notificationChannel: "Notification Channel",
setNotificationChannel: "Set the notification channel",
willExpireDays: "Will Expire Days",
willExpireDaysHelper: "Number of days before expiration to send a notification",
monitorCronSetting: "Monitoring Schedule",
cronTrigger: "Scheduled trigger for monitoring",
},
},
cert: {
expired: "Expired",
expiring: "Expiring",
noExpired: "Not Expired",
},
history: {
title: "Monitoring Execution Records",
description: "Monitoring execution records",
resultTitle: "Status",
contentTitle: "Content",
titleTitle: "Title",
jobTypeTitle: "Job Type",
startAtTitle: "Start Time",
endAtTitle: "End Time",
jobResultTitle: "Result",
jobResult: {
done: "Done",
start: "Start",
},
jobType: {
domainExpirationCheck: "Domain Expiration Check",
siteCertMonitor: "Site Certificate Monitor",
},
},
};
@@ -53,6 +53,7 @@ export default {
unlimited_certificate_pipelines: "Unlimited certificate pipelines",
common_deployment_plugins: "Common host, cloud platform, CDN, Baota, 1Panel deployment plugins",
email_webhook_notifications: "Email, webhook notification methods",
free_privilege: "Unlimited certificate applications\nUnlimited domain count\nUnlimited certificate pipelines\nCommon host, cloud platform, CDN, Baota, 1Panel deployment plugins\nEmail, webhook notification methods",
professional_edition: "Professional Edition",
open_source_support: "Open source requires your sponsorship support",
@@ -60,10 +61,11 @@ export default {
unlimited_site_certificate_monitoring: "Unlimited site certificate monitoring",
more_notification_methods: "More notification methods",
plugins_fully_open: "All plugins open, including Synology and more",
plus_privilege: "Access to VIP group, your requests will have priority\nUnlimited site certificate monitoring\nMore notification methods\nAll plugins open, including Synology and more",
click_to_get_7_day_trial: "Click to get 7-day trial",
years: "years",
afdian_support_vip: "Obtain the permanent professional version coupon",
get_after_support: "Get after sponsoring",
get_after_support: "sponsoring",
business_edition: "Business Edition",
commercial_license: "Commercial license, allowed for external operation",
@@ -73,6 +75,7 @@ export default {
plugin_management: "Plugin management",
unlimited_multi_users: "Unlimited multi-users",
support_user_payment: "Supports user payments",
comm_privilege: "All professional edition privileges\nAllows commercial use, can modify logo and title\nData statistics\nPlugin management\nUnlimited multi-users\nSupports user payments",
contact_author_for_trial: "Buy It Now",
activate: "Activate",
get_pro_code_after_support: "Go to sponsoring",
@@ -226,6 +226,8 @@ export default {
projectJoin: "加入项目",
currentProject: "当前项目",
projectMemberManager: "项目成员管理",
domainMonitorSetting: "域名监控设置",
jobHistory: "监控执行记录",
},
certificateRepo: {
title: "证书仓库",
@@ -589,11 +591,11 @@ export default {
userValidityPeriodHelper: "有效期内用户可正常使用,失效后用户的流水线将被停用",
enableUsernameRegistration: "开启用户名注册",
enableEmailRegistration: "开启邮箱注册",
proFeature: "专业版功能",
proFeature: "Certd专业版功能",
emailServerSetup: "设置邮箱服务器",
enableSmsLoginRegister: "开启手机号登录、注册",
defaultLoginType: "默认登录方式",
commFeature: "商业版功能",
commFeature: "Certd商业版功能",
smsProvider: "短信提供商",
aliyunSms: "阿里云短信",
tencentSms: "腾讯云短信",
@@ -804,6 +806,7 @@ export default {
reverseProxyEmpty: "未配置反向代理",
environmentVars: "环境变量",
environmentVarsHelper: "配置运行时环境变量,每行一个,格式:KEY=VALUE",
bindUrl: "绑定URL",
},
},
modal: {
@@ -812,7 +815,7 @@ export default {
},
domain: {
domainManager: "域名管理",
domainDescription: "管理域名的校验方式,用于申请证书时自动选择验证方式",
domainDescription: "流水线校验方式选择“自动选择”时此处配置才有用,支持自动导入;注意:这里只需要管理主域名即可,子域名不要填写(子域名托管和免费二级子域名除外)",
domain: "域名",
challengeType: "校验类型",
dnsProviderType: "DNS提供商类型",
@@ -33,7 +33,7 @@ export default {
activateCertDesc2: "让证书生效",
taskSuccessTitle: "部署任务添加成功",
taskSuccessDesc: "现在可以运行",
pluginsTitle: "本系统提供茫茫多的部署插件",
pluginsTitle: "本系统提供海量的部署插件",
pluginsDesc: "您可以根据自身需求将证书部署到各种应用和平台",
},
},
@@ -68,10 +68,40 @@ export default {
dnsServerHelper: "使用自定义的域名解析服务器,如:1.1.1.1 , 支持多个",
certValidDays: "证书到期前天数",
certValidDaysHelper: "证书到期前多少天发送通知",
domain: {
monitorSettings: "域名监控设置",
enabled: "启用域名监控",
enabledHelper: "启用后,监控“域名管理”中域名的过期时间,到期前通知提醒",
notificationChannel: "通知渠道",
setNotificationChannel: "设置通知渠道",
willExpireDays: "到期前天数",
willExpireDaysHelper: "域名有效期到期前多少天发送通知",
monitorCronSetting: "监控定时设置",
cronTrigger: "定时触发监控",
},
},
cert: {
expired: "已过期",
expiring: "即将过期",
noExpired: "未过期",
},
history: {
title: "监控执行记录",
description: "站点证书、域名等监控任务的执行记录",
resultTitle: "状态",
contentTitle: "内容",
titleTitle: "标题",
jobTypeTitle: "任务类型",
startAtTitle: "开始时间",
endAtTitle: "结束时间",
jobResultTitle: "任务结果",
jobResult: {
done: "完成",
start: "开始",
},
jobType: {
domainExpirationCheck: "域名到期检查",
siteCertMonitor: "站点证书监控",
},
},
};
@@ -53,6 +53,7 @@ export default {
unlimited_certificate_pipelines: "证书流水线数量无限制",
common_deployment_plugins: "常用的主机、云平台、cdn、宝塔、1Panel等部署插件",
email_webhook_notifications: "邮件、webhook通知方式",
free_privilege: "证书申请无限制\n域名数量无限制\n证书流水线数量无限制\n常用的主机、云平台、cdn、宝塔、1Panel等部署插件\n邮件、webhook通知方式",
professional_edition: "专业版",
open_source_support: "开源需要您的赞助支持,个人和企业内部使用",
@@ -60,6 +61,7 @@ export default {
unlimited_site_certificate_monitoring: "站点证书监控无限制",
more_notification_methods: "更多通知方式",
plugins_fully_open: "插件全开放,群晖等更多插件",
plus_privilege: "可加VIP群,您的需求将优先实现\n站点证书监控无限制\n更多通知方式\n插件全开放,群晖等更多插件\n企业模式,项目管理\n域名到期监控\n第三方登录,PassKey登录",
click_to_get_7_day_trial: "点击获取7天试用",
years: "年",
afdian_support_vip: "新用户开通永久专业版立享50优惠券",
@@ -73,6 +75,7 @@ export default {
plugin_management: "插件管理",
unlimited_multi_users: "多用户无限制",
support_user_payment: "支持用户支付(购买套餐,按流水线条数、域名数量、部署次数计费)",
comm_privilege: "拥有专业版所有特权\n允许商用,可修改logo、标题\n数据统计\n插件管理\n多用户无限制\n支持用户支付(购买套餐,按流水线条数、域名数量、部署次数计费)",
activate: "激活",
get_pro_code_after_support: "前往获取",
business_contact_author: "",
@@ -88,13 +91,13 @@ export default {
activation_code_one_use: "激活码使用过一次之后,不可再次使用,如果要更换站点,请",
bind_account: "绑定账号",
transfer_vip: '然后"转移VIP"即可',
needVipTip: "此为专业版功能,请先开通专业版",
needVipTip: "此为Certd专业版功能,请先开通Certd专业版",
manual_activation: "激活码手动激活",
close: "关闭",
have_activation_code: "已经有激活码了?",
buy: "立即购买",
already_plus: "已经是专业版了,是否升级为商业版?注意:专业版时长将被覆盖",
already_comm: "已经是商业版了,不能降级为专业版",
already_plus: "已经是Certd专业版了,是否升级为商业版?注意:Certd专业版时长将被覆盖",
already_comm: "已经是Certd商业版了,不能降级为专业版",
already_perpetual_plus: "您已经是永久专业版了,无法继续升级",
confirm: "确认",
not_effective: "VIP没有生效/时长未同步?",
@@ -241,6 +241,28 @@ export const certdResources = [
isMenu: true,
},
},
{
title: "certd.sysResources.domainMonitorSetting",
name: "DomainMonitorSetting",
path: "/certd/cert/domain/setting",
component: "/certd/cert/domain/setting/index.vue",
meta: {
icon: "ion:stopwatch-outline",
auth: true,
isMenu: true,
},
},
{
title: "certd.sysResources.jobHistory",
name: "JobHistory",
path: "/certd/monitor/history",
component: "/certd/monitor/history/index.vue",
meta: {
icon: "ion:barcode-outline",
auth: true,
isMenu: true,
},
},
{
title: "certd.userSecurity",
name: "UserSecurity",
@@ -2,6 +2,15 @@ import LayoutOutside from "/src/layout/layout-outside.vue";
import Error404 from "/src/views/framework/error/404.vue";
const errorPage = [{ path: "/:pathMatch(.*)*", name: "not-found", component: Error404 }];
export const outsideResource = [
{
meta: {
title: "首页",
isMenu: false,
},
name: "landing",
path: "/",
component: "/framework/landing/index.vue",
},
{
title: "outside",
name: "outside",

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