mirror of
https://github.com/certd/certd.git
synced 2026-06-10 18:57:33 +08:00
Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f3f8519e0 | |||
| 61e3f5761c | |||
| 2908569841 | |||
| 775226b49f | |||
| e3dacb5b3f | |||
| cdea411136 | |||
| fdb000ee7c | |||
| 4a0be1c29d | |||
| 892d22e225 | |||
| 4958a48b92 | |||
| 28bbea85f0 | |||
| 73b3a29cfc | |||
| 77b8024453 | |||
| 1175e1164b | |||
| 5546af518e | |||
| 99fd3083f2 | |||
| c0df8be832 | |||
| 73cab6a6ee | |||
| 7a71e45799 | |||
| fdb1d1e6dd | |||
| 6dd4d6adeb | |||
| d368f9666a | |||
| ee50458333 | |||
| 9792c616b5 | |||
| 205a7d134e | |||
| 2cbacb4338 | |||
| cdb812ef63 | |||
| ea010f8c9b | |||
| 362bbc5f32 | |||
| 2e19dda72e | |||
| 021155278e | |||
| 3db87218ee | |||
| 91d5c90eb0 | |||
| f8b71a0e61 | |||
| 3e4b7f30ac | |||
| c637985575 | |||
| 2960e2459b | |||
| 81d6289a86 | |||
| dc1507a5ea | |||
| 3d960c3869 | |||
| 5d60e6191f | |||
| 4b49f8a5a6 | |||
| 94459fe922 | |||
| e834e31510 | |||
| 4b57a0d729 | |||
| acd440106b | |||
| 5096df5cc0 | |||
| 3c2d450aa8 | |||
| b083b3cc41 | |||
| 6624769032 | |||
| 55f75c6051 | |||
| 42d9c3ef14 | |||
| c7a9363422 | |||
| 969b6e3288 | |||
| 03ce030754 | |||
| f2c1e362a0 | |||
| 6426aa57a2 | |||
| 7ceb0f6306 | |||
| b26a1944c6 | |||
| 235aec3e42 | |||
| 346fb730a3 | |||
| c87bc22a5f | |||
| 7198e24945 | |||
| 1a08bd340e | |||
| af9047bf3c | |||
| 9566fc4e03 | |||
| 41254d10b7 | |||
| ed97f41884 | |||
| 02b83ce0ad | |||
| f1d2a1033a | |||
| ba1fe54ef8 | |||
| deac92faf8 | |||
| 1c36a79162 | |||
| b6f7042adc | |||
| f721cefb4a | |||
| fc2c947afe | |||
| d0272095cc | |||
| 0a77fe0169 | |||
| 961abb0f80 | |||
| 4efe12d2d3 | |||
| 67b05e2d75 | |||
| f4bb459b5e | |||
| 83a5a21f95 | |||
| 85c633fddf | |||
| f9a310b6c3 | |||
| 1bdcfe646f |
@@ -0,0 +1,36 @@
|
|||||||
|
# 后端规则
|
||||||
|
|
||||||
|
主包:`packages/ui/certd-server`。后端使用 Node.js、ESM、TypeScript、MidwayJS 3、Koa、TypeORM,默认 better-sqlite3,同时支持 PostgreSQL 和 MySQL,并通过 `@certd/midway-flyway-js` 使用类似 Flyway 的 SQL 迁移机制。
|
||||||
|
|
||||||
|
详细入口、模块和验证命令见 `.codex/repo-map.md`。
|
||||||
|
|
||||||
|
## 默认开发配置
|
||||||
|
|
||||||
|
- HTTP 端口:`7001`
|
||||||
|
- HTTPS 端口:`7002`
|
||||||
|
- 默认 SQLite 数据库:`./data/db.sqlite`
|
||||||
|
- 默认文件根目录:`./data/files`
|
||||||
|
|
||||||
|
## 数据与迁移
|
||||||
|
|
||||||
|
- 后端使用 TypeORM 实体加 SQL 迁移。
|
||||||
|
- 重点查看 `packages/ui/certd-server/src/modules/**/entity/*.ts` 和 `packages/ui/certd-server/db/migration/*.sql`。
|
||||||
|
- 默认配置中 `synchronize: false`,涉及表结构变更时应添加或更新迁移脚本,不要依赖 TypeORM 自动同步。
|
||||||
|
|
||||||
|
## 文件上传
|
||||||
|
|
||||||
|
使用 `/basic/file/upload` 上传文件后,接口返回的是临时缓存 key。业务保存表单或设置时,后端必须调用 `FileService.saveFile(userId, key, "public" | "private")` 转成永久文件 key 后再入库/入设置;不要直接保存 `tmpfile_key_...`,否则后续回显或下载会失效。
|
||||||
|
|
||||||
|
## Service 与事务
|
||||||
|
|
||||||
|
- 后端方法参数超过 3 个时,尽量改为对象参数传入。
|
||||||
|
- 需要传入 `manager` / `EntityManager` 做事务传播的方法,必须使用对象参数,不要把 `manager` 作为位置参数藏在参数列表末尾。
|
||||||
|
- 后端 service 层只有存在事务链路传播需求时才定义 `ctx`,不要为了将来可能需要而提前给普通方法加 `ctx`。
|
||||||
|
- 事务链路方法统一采用 `method(ctx, req)` 形式,`ctx` 放第一位并承载 `manager?: EntityManager` 等横切上下文,业务参数放在 `req` 对象里,例如 `settleCommission({ manager }, { tradeId, userId, amount })`。
|
||||||
|
- 无事务链路需求的普通查询、纯函数和简单私有方法继续使用明确参数。
|
||||||
|
- service 内部需要根据事务上下文选择 Repository 时,优先使用 `BaseService.getRepo(ctx, EntityClass)`;不要在业务方法里反复写 `ctx.manager?.getRepository(Entity) || this.xxxRepository`。
|
||||||
|
- 拿到 repo 后 save/update/delete/find 都能做,不需要再包一层 `saveEntity` 之类的单一用途方法。
|
||||||
|
- service 拼接用户与项目范围查询条件时,优先使用 `BaseService.buildUserProjectQuery(userId, projectId)`;不要直接写 `{ userId, projectId }`,否则 `projectId` 为空时可能把 `null`/`undefined` 带入 TypeORM 条件,导致查询或 update 不符合预期。
|
||||||
|
- `ctx` 类型统一从 `BaseService` 导出的 `ServiceContext` 复用,不要在每个 service 里重复定义。
|
||||||
|
- 需要“有事务则复用、无事务则开启”时,使用 `BaseService.transactionWithCtx(ctx, callback)`:`ctx.manager` 存在则直接执行 callback,否则自动 `this.transaction()`。不要在业务代码里手写 `if (ctx.manager) { ... } else { await this.transaction(...) }`。
|
||||||
|
- 新增方法注意不要与 `BaseService` 基类方法签名冲突,例如 `delete(id)` vs `BaseService.delete(ids, where?)`,ts-node 下会直接 TS2416 编译报错。冲突时改用具体名称如 `deleteById`。
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# 代码风格规则
|
||||||
|
|
||||||
|
## 基本原则
|
||||||
|
|
||||||
|
- 中文 README 在部分 PowerShell 环境中可能显示乱码;`README_en.md` 可读性更好,且包含同样的高层项目说明。
|
||||||
|
- 根包管理器是 pnpm,不要引入 npm/yarn lockfile。
|
||||||
|
- 优先沿用现有模块、插件、服务模式,再考虑新增抽象。
|
||||||
|
- 注意本地数据和配置里可能包含凭据、证书材料等敏感信息。
|
||||||
|
|
||||||
|
## 注释
|
||||||
|
|
||||||
|
本仓库代码注释优先使用中文,尤其是解释业务规则、兼容逻辑、协议细节和隐藏风险时;除非文件已有明确英文注释风格或引用外部英文术语,否则不要新增英文说明性注释。
|
||||||
|
|
||||||
|
## 可读性
|
||||||
|
|
||||||
|
代码可读性优先于短写法。遇到包含业务分支的复杂三元表达式、内联对象、链式调用或条件组合时,优先拆成命名清晰的中间变量、独立分支或小函数,让读代码的人能一眼看出业务意图;不要为了少写几行把逻辑压成难读的一坨。
|
||||||
|
|
||||||
|
在对象字面量、查询条件或函数参数里不要内联调用多层 helper,例如 `{ domain, ...this.buildUserProjectQuery(userId, projectId) }`。应先用命名变量承接结果,例如 `const userProjectQuery = this.buildUserProjectQuery(userId, projectId)`,再在对象里展开 `...userProjectQuery`,让条件构造和业务字段都更容易阅读。
|
||||||
|
|
||||||
|
## DRY
|
||||||
|
|
||||||
|
遵守 DRY 原则:同一业务规则、字段转换、权限判断、Repository 选择、事务传播、金额计算等逻辑不要在多个地方复制粘贴。第二次出现时可以先保持清晰,第三次出现前应优先抽成局部 helper、service 方法或已有公共工具;抽象要服务于减少真实重复和降低修改风险,不要为了形式上的“复用”制造过度设计。
|
||||||
|
|
||||||
|
## 单一职责
|
||||||
|
|
||||||
|
遵守单一职责原则:一个方法只负责一个清晰的业务步骤或技术步骤。流程编排方法可以串联多个步骤,但具体的校验、计算、持久化、状态变更、展示数据组装应尽量拆到命名明确的小方法中;不要让一个方法同时承担查询、校验、计算、写库、格式化返回等过多职责。
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# 前端规则
|
||||||
|
|
||||||
|
主包:`packages/ui/certd-client`。前端使用 Vue 3、Vite、TypeScript、Ant Design Vue、Fast Crud、Pinia、vue-router、vue-i18n、Tailwind/Windi 相关样式工具。
|
||||||
|
|
||||||
|
详细入口、路由、状态、API、视图、locale 和验证命令见 `.codex/repo-map.md`。
|
||||||
|
|
||||||
|
## 禁跑命令
|
||||||
|
|
||||||
|
- 不要运行前端 `pnpm tsc` / `vue-tsc`:当前依赖组合中 `vue-tsc@1.8.27` 会直接抛内部错误 `Search string not found: "/supportedTSExtensions = .*(?=;)/"`,不是有效的项目类型检查结果。
|
||||||
|
- 前端暂不跑单元测试;当前 `test:unit` 只是占位脚本。
|
||||||
|
|
||||||
|
## 格式化与校验
|
||||||
|
|
||||||
|
前端 TS/Vue/locale 等文件改动后,优先只对本次改动文件运行项目现有自动格式化/修复:
|
||||||
|
|
||||||
|
- Prettier:`packages\ui\certd-client\node_modules\.bin\prettier.cmd --write <files>`
|
||||||
|
- ESLint:`packages\ui\certd-client\node_modules\.bin\eslint.cmd --fix <files>`
|
||||||
|
|
||||||
|
不要为了格式化无关文件而扩大 diff。项目保留了 `tslint` 依赖,但当前主要使用 ESLint + Prettier。
|
||||||
|
|
||||||
|
## Fast Crud 页面
|
||||||
|
|
||||||
|
- 列表管理、后台管理、记录查询、CRUD 表格类页面,默认优先使用 Fast Crud(`@fast-crud/fast-crud`、`fs-crud`、`useFs`、`createCrudOptions`)实现。
|
||||||
|
- 只有轻量只读展示、强交互自定义界面或已有页面模式明确不适合 Fast Crud 时,才手写 `a-table` / 自定义列表,并在回复中说明原因。
|
||||||
|
- 开发或重构这类页面前,先读取 `.trae/skills/fast-crud-page-dev/SKILL.md`,按仓库内 Fast Crud 页面拆分与验证方式实现。
|
||||||
|
- 页面内嵌 Fast Crud 表格时,要显式给外层容器稳定高度或 `flex: 1; min-height: 0` 的撑满链路;Fast Crud 依赖外部元素高度,不能只依赖表格默认高度。
|
||||||
|
- 后台管理列表里展示或筛选用户字段时,优先参考 `packages/ui/certd-client/src/views/sys/suite/user-suite/crud.tsx` 的 `userId` 字段模式:前端使用 `table-select` + `/sys/authority/user/getSimpleUserByIds` 字典回显和搜索;不要为了展示用户名让后端列表接口额外 `fillSimpleUser` / `userDisplay`,除非该接口本身就是用户端业务列表且已有明确模式。
|
||||||
|
|
||||||
|
## 对话框
|
||||||
|
|
||||||
|
前端对话框里只做纯确认时可以使用 `Modal.confirm`;只要对话框里有字段输入、表单校验或提交字段,统一使用 `useFormDialog` / `openFormDialog`,不要在 `Modal.confirm` 的 `content` 里手写输入框。
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# 流水线与插件规则
|
||||||
|
|
||||||
|
项目最关键的架构概念是证书流水线。核心导出、关键抽象、插件目录和共享 helper 位置见 `.codex/repo-map.md`。
|
||||||
|
|
||||||
|
插件是核心能力,不是边缘功能。新增服务商、DNS 验证、证书部署、通知方式等能力,通常应该放在插件包里,或放在 `packages/ui/certd-server/src/plugins/<plugin-name>/` 下。
|
||||||
|
|
||||||
|
## 改动归属
|
||||||
|
|
||||||
|
修改证书申请、验证、部署或通知行为时,先判断改动属于哪里:
|
||||||
|
|
||||||
|
- ACME client 代码
|
||||||
|
- pipeline 核心抽象
|
||||||
|
- 后端 module/service/entity/controller
|
||||||
|
- 某个具体插件实现
|
||||||
|
- 前端 view/form/schema
|
||||||
|
|
||||||
|
如果只是某个服务商或部署目标的问题,不要轻易修改共享 pipeline/core 行为,除非确实是可复用的公共能力。
|
||||||
|
|
||||||
|
## ACME / EAB
|
||||||
|
|
||||||
|
- 公共 EAB(尤其是 Google EAB)可能只能创建一次 ACME 账号。要跨用户复用公共 EAB,应保存并复用同一个 ACME account private key;`accountUrl` 如果存到 `userContext` 里,只能视为当前用户缓存,因为 `userContext` 跟用户 id 走。
|
||||||
|
- ACME 协议的 `newAccount` 支持 `onlyReturnExisting`。使用同一个 account private key 调用 `newAccount({ onlyReturnExisting: true })` 可以取回已创建账号的 URL,且不会再次消费 EAB。
|
||||||
|
- 修改 EAB 的 `kid` 后,应重新生成绑定该 `kid` 的 account private key;否则应阻止继续申请并提示用户刷新账号私钥。
|
||||||
|
|
||||||
|
## 插件开发技能
|
||||||
|
|
||||||
|
仓库内置了 Certd 插件开发技能,供 Trae 和 Codex 共用:
|
||||||
|
|
||||||
|
- Trae 入口:`.trae/skills`
|
||||||
|
- Codex 入口:`.codex/skills`
|
||||||
|
|
||||||
|
其中 `.codex/skills` 是指向 `.trae/skills` 的目录链接,不要复制出第二份技能内容。更新技能时只维护 `.trae/skills` 下的原始文件,Codex 会通过 `.codex/skills` 读取同一份内容。
|
||||||
|
|
||||||
|
当前技能包括:
|
||||||
|
|
||||||
|
- `access-plugin-dev`:开发 Access 授权插件
|
||||||
|
- `dns-provider-dev`:开发 DNS Provider 插件
|
||||||
|
- `fast-crud-page-dev`:开发或重构前端 Fast Crud 列表管理页面
|
||||||
|
- `task-plugin-dev`:开发 Task 部署任务插件
|
||||||
|
- `plugin-converter`:将插件转换为 YAML 配置
|
||||||
|
|
||||||
|
做插件相关任务时,先读取对应技能目录下的 `SKILL.md`,再进入具体实现。若用户在插件开发中指出更好的做法,应总结并更新对应技能。
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# 测试与验证规则
|
||||||
|
|
||||||
|
实现新功能或修复行为缺陷前,先补对应单元测试,并先运行测试确认它处于失败状态;再实现功能或修复代码,反复运行聚焦单元测试直到通过。若某项改动确实不适合先写单元测试,应在回复中说明原因和替代验证方式。
|
||||||
|
|
||||||
|
后补单元测试时,应先基于对正确行为的实际预期编写测试,而不是为了迎合现有实现改写预期;如果运行后出现红灯,且通过测试需要修改已有实现,应先向用户确认这是确实的 bug,还是原本需求/既有行为就是如此;确认后再修改原始实现,避免把测试补充变成未经确认的行为改动。
|
||||||
|
|
||||||
|
## 后端单测
|
||||||
|
|
||||||
|
- 后端纯单元测试用例放在 `src` 目录内,并尽量与被测文件相邻,例如 `src/utils/random.test.ts`。
|
||||||
|
- 对应 `test:unit` 只跑 `src/**/*.test.ts`,构建/打包配置应排除这些 `*.test.ts` 文件。
|
||||||
|
- 单元测试需要 mock ESM 静态 import 时,优先使用 `esmock`,不要为了测试把业务代码改成构造函数注入或把逻辑挪到调用方。
|
||||||
|
- 各包 `test:unit` 脚本应显式设置 `NODE_ENV=unittest`。
|
||||||
|
|
||||||
|
## 运行方式
|
||||||
|
|
||||||
|
单个 monorepo 包运行单元测试时,优先使用 `corepack pnpm --dir <包目录> test:unit`,例如:
|
||||||
|
|
||||||
|
- `corepack pnpm --dir packages\ui\certd-server test:unit`
|
||||||
|
- `corepack pnpm --dir packages\core\basic test:unit`
|
||||||
|
- `corepack pnpm --dir packages\plugins\plugin-lib test:unit`
|
||||||
|
|
||||||
|
也可以用包名过滤,例如 `corepack pnpm --filter @certd/ui-server test:unit`。
|
||||||
|
|
||||||
|
前端 `packages\ui\certd-client` 暂时不跑单元测试。前端改动优先使用 Prettier/ESLint 做改动文件验证。
|
||||||
|
|
||||||
|
优先对改动包运行聚焦测试;只有跨包影响明显时再考虑全 monorepo 构建。
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
# Certd 仓库地图
|
||||||
|
|
||||||
|
本文档由 Codex 子智能体只读探索后整理,用于后续开发时快速定位代码。进入仓库仍应先读取根目录 `AGENTS.md`,本文件只作为导航补充。
|
||||||
|
|
||||||
|
## 顶层结构
|
||||||
|
|
||||||
|
Certd 是 pnpm + lerna-lite monorepo。
|
||||||
|
|
||||||
|
- `package.json`:根脚本与 workspace 元信息
|
||||||
|
- `pnpm-workspace.yaml`:workspace 匹配规则,包含 `packages/**`、`packages/ui/**`
|
||||||
|
- `lerna.json`:lerna-lite 配置
|
||||||
|
- `docs`:VitePress 文档站
|
||||||
|
- `docker`:Docker 安装和运行相关文件
|
||||||
|
- `packages/core/acme-client`:ACME 协议客户端
|
||||||
|
- `packages/core/basic`:共享基础工具
|
||||||
|
- `packages/core/pipeline`:流水线核心抽象、插件模型、执行上下文
|
||||||
|
- `packages/libs`:共享集成库
|
||||||
|
- `packages/plugins/plugin-lib`:证书、DNS Provider、格式转换等插件共享能力
|
||||||
|
- `packages/plugins/plugin-cert`:证书插件包入口
|
||||||
|
- `packages/ui/certd-server`:后端 Midway 服务
|
||||||
|
- `packages/ui/certd-client`:前端 Vue/Vite 管理台
|
||||||
|
- `packages/pro`:商业版独立 Git 工作区,需在该目录内单独检查状态
|
||||||
|
|
||||||
|
运行时或生成产物通常包括根目录 `node_modules`、`logs`、`output`、`lerna-debug.log`、`tmp-certd-client-vite*.log`,以及后端 `packages/ui/certd-server/data`、`packages/ui/certd-server/logs`、各包 `dist`、插件 metadata/yaml 导出结果。
|
||||||
|
|
||||||
|
## 常用验证
|
||||||
|
|
||||||
|
- 根目录启动后端生产模式:`pnpm run start:server`
|
||||||
|
- 后端开发服务:`corepack pnpm --dir packages\ui\certd-server dev`
|
||||||
|
- 后端聚焦单测:`corepack pnpm --dir packages\ui\certd-server test:unit`
|
||||||
|
- 后端完整测试:`corepack pnpm --dir packages\ui\certd-server test`
|
||||||
|
- 后端构建:`corepack pnpm --dir packages\ui\certd-server build`
|
||||||
|
- 前端开发服务:`corepack pnpm --dir packages\ui\certd-client dev`
|
||||||
|
- 前端构建:`corepack pnpm --dir packages\ui\certd-client build`
|
||||||
|
- 前端改动文件格式化:`packages\ui\certd-client\node_modules\.bin\prettier.cmd --write <files>`
|
||||||
|
- 前端改动文件 ESLint 修复:`packages\ui\certd-client\node_modules\.bin\eslint.cmd --fix <files>`
|
||||||
|
|
||||||
|
不要主动运行 `pnpm install`。前端不要运行 `pnpm tsc` / `vue-tsc`,当前依赖组合中 `vue-tsc@1.8.27` 会抛无效内部错误;前端 `test:unit` 也只是占位。
|
||||||
|
|
||||||
|
## 后端地图
|
||||||
|
|
||||||
|
主包:`packages/ui/certd-server`。
|
||||||
|
|
||||||
|
- `bootstrap.js`:Midway 启动入口,使用 `@midwayjs/bootstrap`
|
||||||
|
- `src/configuration.ts`:Midway 主配置,注册组件和全局中间件
|
||||||
|
- `src/config/config.default.ts`:端口、HTTPS、静态文件、cron、TypeORM、Flyway、上传、JWT、Swagger 默认配置
|
||||||
|
- `src/config/loader.ts`:读取 `.env`、`.env.<env>.yaml`,支持 `certd_` 前缀环境变量覆盖嵌套配置
|
||||||
|
- `src/modules`:业务模块根目录,例如 `basic`、`cert`、`cname`、`cron`、`login`、`monitor`、`open`、`pipeline`、`plugin`、`suite`、`sys`
|
||||||
|
- `src/controller`:API 入口,按 `basic`、`user`、`sys`、`openapi` 分组
|
||||||
|
- `db/migration`:SQL 迁移目录,TypeORM `synchronize: false`,表结构变更应配套迁移 SQL
|
||||||
|
|
||||||
|
测试使用 Mocha + Node `assert/strict`,纯单测放在 `src/**/*.test.ts`,尽量与被测文件相邻。可参考 `src/utils/random.test.ts`、`src/controller/basic/app-controller.test.ts`、`src/modules/pipeline/service/pipeline-service.test.ts`。
|
||||||
|
|
||||||
|
## 前端地图
|
||||||
|
|
||||||
|
主包:`packages/ui/certd-client`。
|
||||||
|
|
||||||
|
- `vite.config.ts`:Vite 配置,dev 端口 `3008`,`/api`、`/certd/api` 代理到后端 `127.0.0.1:7001`
|
||||||
|
- `src/main.ts`:Vue 启动入口,注册 AntDV、Vben、router、全局组件、插件和偏好设置
|
||||||
|
- `src/App.vue`:根组件,包含 `AConfigProvider`、`FsFormProvider`、`router-view`
|
||||||
|
- `src/router/index.ts`、`src/router/resolve.ts`:路由入口,使用 `createWebHashHistory`
|
||||||
|
- `src/router/source/modules/certd.ts`:Certd 主业务路由
|
||||||
|
- `src/store`:Pinia store,主要有 `user`、`project`、`settings`、`plugin`
|
||||||
|
- `src/api/service.ts`:Axios 封装
|
||||||
|
- `src/api/tools.ts`:错误与响应工具
|
||||||
|
- `src/views/certd`:核心业务视图,例如 `pipeline`、`cert`、`monitor`、`access`、`notification`、`open`、`project`、`suite`、`wallet`
|
||||||
|
- `src/locales`:国际化入口与语言包
|
||||||
|
|
||||||
|
列表管理、后台管理、记录查询、CRUD 表格页面优先使用 Fast Crud。开发前读取 `.trae/skills/fast-crud-page-dev/SKILL.md`。常见拆分是 `api.ts`、`crud.tsx`、`index.vue`。可参考 `src/views/certd/access`、`src/views/sys/suite/user-suite/crud.tsx`、`src/views/certd/wallet/index.vue`。内嵌 `fs-crud` 时要给外层稳定高度或完整 `flex: 1; min-height: 0` 链路。
|
||||||
|
|
||||||
|
## 流水线与插件地图
|
||||||
|
|
||||||
|
核心入口:`packages/core/pipeline/src/index.ts`,导出 `core`、`dt`、`access`、`registry`、`plugin`、`context`、`decorator`、`service`、`notification`。
|
||||||
|
|
||||||
|
- `packages/core/pipeline/src/plugin`:任务插件抽象,例如 `AbstractTaskPlugin`、`IsTaskPlugin`、`TaskInput`、`pluginRegistry`
|
||||||
|
- `packages/core/pipeline/src/access`:授权插件抽象,例如 `BaseAccess`、`IsAccess`、`AccessInput`、`accessRegistry`
|
||||||
|
- `packages/core/pipeline/src/dt/pipeline.ts`:`Pipeline`、`Stage`、`Task`、`RunStrategy` 等流水线数据结构
|
||||||
|
- `packages/core/pipeline/src/core`:执行器、上下文、运行历史、文件存储等
|
||||||
|
- `packages/core/pipeline/src/service`:CNAME、事件、配置、邮件、URL 等 pipeline service 接口
|
||||||
|
- `packages/ui/certd-server/src/plugins`:后端内置服务商、DNS、部署、通知等插件
|
||||||
|
- `packages/ui/certd-server/src/plugins/plugin-cert`:证书申请核心插件
|
||||||
|
- `packages/ui/certd-server/src/plugins/plugin-lib`:后端插件 helper/access
|
||||||
|
- `packages/plugins/plugin-lib/src/cert`:`CertReader`、`CertConverter`、DNS Provider 公共能力
|
||||||
|
- `packages/plugins/plugin-lib/src/cert/dns-provider`:`AbstractDnsProvider`、`dnsProviderRegistry`、`DomainParser`
|
||||||
|
|
||||||
|
插件开发技能入口:
|
||||||
|
|
||||||
|
- `.trae/skills/dns-provider-dev/SKILL.md`:DNS Provider 插件
|
||||||
|
- `.trae/skills/task-plugin-dev/SKILL.md`:Task 部署任务插件
|
||||||
|
- `.trae/skills/access-plugin-dev/SKILL.md`:Access 授权插件
|
||||||
|
- `.trae/skills/plugin-converter/SKILL.md`:插件转 YAML 配置
|
||||||
|
|
||||||
|
改动归属判断:
|
||||||
|
|
||||||
|
- ACME 协议、EAB、账号、订单、挑战流程:优先看 `packages/core/acme-client` 或 `packages/ui/certd-server/src/plugins/plugin-cert/plugin/cert-plugin/acme.ts`
|
||||||
|
- 流水线执行、任务生命周期、输入输出、注册机制:看 `packages/core/pipeline`
|
||||||
|
- 单个云厂商 DNS 验证、证书部署、API 调用失败:改对应 `packages/ui/certd-server/src/plugins/plugin-xxx`
|
||||||
|
- 通用证书读取、DNS Provider 公共能力、格式转换:改 `packages/plugins/plugin-lib`
|
||||||
|
- 后端业务数据、接口、实体、权限、迁移:改 `packages/ui/certd-server/src/modules` 与 `src/controller`
|
||||||
|
- 表单、列表、插件配置 UI:改 `packages/ui/certd-client/src/views/certd` 及对应 `src/api`
|
||||||
|
|
||||||
|
原则:如果只是单个服务商或部署目标的问题,不动共享 pipeline/core;只有可复用的公共语义或跨插件一致行为,才考虑上移到 `packages/core/pipeline` 或 `packages/plugins/plugin-lib`。
|
||||||
|
|
||||||
|
## Git 注意事项
|
||||||
|
|
||||||
|
子智能体探索时根仓库 `git status --short` 为空。`packages/pro` 也是独立仓库且当时未显示未提交改动,但曾出现无法删除 `packages/pro/.git/index.lock` 的警告;后续操作 pro 仓库前应先检查该锁文件或占用状态。
|
||||||
@@ -1,36 +1,29 @@
|
|||||||
---
|
---
|
||||||
name: Plugin Apply
|
name: Plugin Apply
|
||||||
about: 部署插件申请支持
|
about: 部署插件申请支持
|
||||||
title: "[Plugin] "
|
title: '[Plugin] '
|
||||||
labels: feature
|
labels: feature
|
||||||
---
|
---
|
||||||
|
|
||||||
> > 感谢您支持certd,请按如下规范提交issue
|
> > 感谢您支持certd,请按如下规范提交issue
|
||||||
> 如果有条件,请尽量在[github上提交](https://github.com/certd/certd/issues)
|
> > 如果有条件,请尽量在[github上提交](https://github.com/certd/certd/issues)
|
||||||
|
|
||||||
# 新部署插件申请支持
|
# 新部署插件申请支持
|
||||||
|
|
||||||
## 1. 需求描述
|
## 1. 需求描述
|
||||||
`请在此处简要描述你的需求`
|
|
||||||
|
|
||||||
|
`请在此处简要描述你的需求`
|
||||||
|
|
||||||
## 2. 要部署证书应用的信息
|
## 2. 要部署证书应用的信息
|
||||||
|
|
||||||
1. 应用名称:
|
1. 应用名称:
|
||||||
|
|
||||||
|
|
||||||
2. 应用网址/项目地址/官方网站:
|
2. 应用网址/项目地址/官方网站:
|
||||||
|
|
||||||
|
|
||||||
3. 管理证书界面截图(或者手动部署证书方式介绍及截图):
|
3. 管理证书界面截图(或者手动部署证书方式介绍及截图):
|
||||||
|
|
||||||
|
|
||||||
4. 是否有API接口,接口地址:
|
4. 是否有API接口,接口地址:
|
||||||
|
|
||||||
|
|
||||||
5. 如果没有API接口,网页登录是否需要验证码:
|
5. 如果没有API接口,网页登录是否需要验证码:
|
||||||
|
|
||||||
|
|
||||||
6. 是否可以提供测试账号?(如果可以请留下联系方式或者加作者好友)
|
6. 是否可以提供测试账号?(如果可以请留下联系方式或者加作者好友)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,29 @@
|
|||||||
---
|
---
|
||||||
name: DNS Provider Apply
|
name: DNS Provider Apply
|
||||||
about: 域名提供商申请支持
|
about: 域名提供商申请支持
|
||||||
title: "[DNS] "
|
title: '[DNS] '
|
||||||
labels: feature
|
labels: feature
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
> 感谢您支持certd,请按如下规范提交issue
|
> 感谢您支持certd,请按如下规范提交issue
|
||||||
> 如果有条件,请尽量在[github上提交](https://github.com/certd/certd/issues)
|
> 如果有条件,请尽量在[github上提交](https://github.com/certd/certd/issues)
|
||||||
|
|
||||||
# 新域名提供商支持申请
|
# 新域名提供商支持申请
|
||||||
|
|
||||||
## 1. 基本信息
|
## 1. 基本信息
|
||||||
|
|
||||||
请填写如下内容:
|
请填写如下内容:
|
||||||
|
|
||||||
1. 域名提供商名称:
|
1. 域名提供商名称:
|
||||||
|
|
||||||
|
|
||||||
2. 管理页面地址:
|
2. 管理页面地址:
|
||||||
|
|
||||||
|
|
||||||
3. 是否有API接口,接口地址:
|
3. 是否有API接口,接口地址:
|
||||||
|
|
||||||
|
|
||||||
4. 如果没有API接口,网页登录是否有验证码:
|
4. 如果没有API接口,网页登录是否有验证码:
|
||||||
|
|
||||||
|
|
||||||
5. 是否可以提供测试账号?(如果可以请留下联系方式或者加作者好友)
|
5. 是否可以提供测试账号?(如果可以请留下联系方式或者加作者好友)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 2. 截图
|
## 2. 截图
|
||||||
|
|
||||||
`域名管理页面截图`
|
`域名管理页面截图`
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,32 @@
|
|||||||
---
|
---
|
||||||
name: Bug Report
|
name: Bug Report
|
||||||
about: 错误或问题报告
|
about: 错误或问题报告
|
||||||
title: "[BUG] "
|
title: '[BUG] '
|
||||||
labels: bug
|
labels: bug
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
> 感谢您支持certd,请按如下规范提交issue
|
> 感谢您支持certd,请按如下规范提交issue
|
||||||
> 如果有条件,请尽量在[github上提交](https://github.com/certd/certd/issues)
|
> 如果有条件,请尽量在[github上提交](https://github.com/certd/certd/issues)
|
||||||
|
|
||||||
# bug提交
|
# bug提交
|
||||||
|
|
||||||
## 1、问题描述
|
## 1、问题描述
|
||||||
|
|
||||||
`请在此处简要描述你所遇到的问题,必要时请贴出相关截图辅助理解和定位`
|
`请在此处简要描述你所遇到的问题,必要时请贴出相关截图辅助理解和定位`
|
||||||
|
|
||||||
### 2、复现步骤
|
### 2、复现步骤
|
||||||
|
|
||||||
`请描述复现问题的详细步骤`
|
`请描述复现问题的详细步骤`
|
||||||
`如果非示例页面的问题,最好能提供最小复现示例的代码、或者仓库链接`
|
`如果非示例页面的问题,最好能提供最小复现示例的代码、或者仓库链接`
|
||||||
|
|
||||||
|
|
||||||
### 3.报错截图
|
### 3.报错截图
|
||||||
|
|
||||||
`请贴出报错日志截图`
|
`请贴出报错日志截图`
|
||||||
|
|
||||||
### 4、效果截图
|
### 4、效果截图
|
||||||
|
|
||||||
`请贴出效果截图`
|
`请贴出效果截图`
|
||||||
|
|
||||||
#### 4.1. 期望效果
|
#### 4.1. 期望效果
|
||||||
|
|
||||||
#### 4.2. 实际效果
|
#### 4.2. 实际效果
|
||||||
|
|||||||
@@ -1,24 +1,25 @@
|
|||||||
---
|
---
|
||||||
name: Feature Request
|
name: Feature Request
|
||||||
about: 新需求、新特性申请支持
|
about: 新需求、新特性申请支持
|
||||||
title: "[Feature] "
|
title: '[Feature] '
|
||||||
labels: feature
|
labels: feature
|
||||||
---
|
---
|
||||||
|
|
||||||
> > 感谢您支持certd,请按如下规范提交issue
|
> > 感谢您支持certd,请按如下规范提交issue
|
||||||
> 如果有条件,请尽量在[github上提交](https://github.com/certd/certd/issues)
|
> > 如果有条件,请尽量在[github上提交](https://github.com/certd/certd/issues)
|
||||||
|
|
||||||
|
|
||||||
# 新特性申请
|
# 新特性申请
|
||||||
>注意:这里仅供如果是要申请新的部署插件,请提交插件申请
|
|
||||||
|
> 注意:这里仅供如果是要申请新的部署插件,请提交插件申请
|
||||||
|
|
||||||
## 1. 需求描述,需求背景
|
## 1. 需求描述,需求背景
|
||||||
|
|
||||||
`请在此处简要描述你所遇到的问题,必要时请贴出相关截图辅助理解`
|
`请在此处简要描述你所遇到的问题,必要时请贴出相关截图辅助理解`
|
||||||
|
|
||||||
|
|
||||||
## 2. 期望效果
|
## 2. 期望效果
|
||||||
|
|
||||||
`必要时可以截图描述你的期望效果`
|
`必要时可以截图描述你的期望效果`
|
||||||
|
|
||||||
|
|
||||||
## 3. 你的解决方案
|
## 3. 你的解决方案
|
||||||
|
|
||||||
`如果你有解决方案,请描述你的方案`
|
`如果你有解决方案,请描述你的方案`
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ['v2-dev']
|
branches: ['v2-dev']
|
||||||
paths:
|
paths:
|
||||||
- "trigger/build.trigger"
|
- 'trigger/build.trigger'
|
||||||
workflow_dispatch: # 添加手动触发
|
workflow_dispatch: # 添加手动触发
|
||||||
# schedule:
|
# schedule:
|
||||||
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
||||||
# - cron: '17 19 * * *'
|
# - cron: '17 19 * * *'
|
||||||
@@ -37,12 +37,12 @@ jobs:
|
|||||||
const pkg = JSON.parse(jsonContent)
|
const pkg = JSON.parse(jsonContent)
|
||||||
console.log("certd_version:",pkg.version);
|
console.log("certd_version:",pkg.version);
|
||||||
return pkg.version
|
return pkg.version
|
||||||
# - name: Use Node.js
|
# - name: Use Node.js
|
||||||
# uses: actions/setup-node@v4
|
# uses: actions/setup-node@v4
|
||||||
# with:
|
# with:
|
||||||
# node-version: 18
|
# node-version: 18
|
||||||
# cache: 'npm'
|
# cache: 'npm'
|
||||||
# working-directory: ./packages/ui/certd-client
|
# working-directory: ./packages/ui/certd-client
|
||||||
- run: |
|
- run: |
|
||||||
npm install -g pnpm@10.33.4
|
npm install -g pnpm@10.33.4
|
||||||
pnpm install
|
pnpm install
|
||||||
|
|||||||
@@ -3,14 +3,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ['v2-dev']
|
branches: ['v2-dev']
|
||||||
paths:
|
paths:
|
||||||
- "trigger/deploy.trigger"
|
- 'trigger/deploy.trigger'
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: [ "build-image" ]
|
workflows: ['build-image']
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
workflow_dispatch: # 添加手动触发
|
workflow_dispatch: # 添加手动触发
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# schedule:
|
# schedule:
|
||||||
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ['v2-dev']
|
branches: ['v2-dev']
|
||||||
paths:
|
paths:
|
||||||
- "trigger/publish.trigger"
|
- 'trigger/publish.trigger'
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: [ "build-image-for-release" ]
|
workflows: ['build-image-for-release']
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
workflow_dispatch: # 添加手动触发
|
workflow_dispatch: # 添加手动触发
|
||||||
# schedule:
|
# schedule:
|
||||||
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
||||||
# - cron: '17 19 * * *'
|
# - cron: '17 19 * * *'
|
||||||
@@ -62,4 +62,3 @@ jobs:
|
|||||||
pnpm install
|
pnpm install
|
||||||
npm run publish_to_atomgit
|
npm run publish_to_atomgit
|
||||||
working-directory: ./
|
working-directory: ./
|
||||||
|
|
||||||
@@ -3,12 +3,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ['v2-dev']
|
branches: ['v2-dev']
|
||||||
paths:
|
paths:
|
||||||
- "trigger/publish.trigger"
|
- 'trigger/publish.trigger'
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: [ "build-image-for-release" ]
|
workflows: ['build-image-for-release']
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
workflow_dispatch: # 添加手动触发
|
workflow_dispatch: # 添加手动触发
|
||||||
# schedule:
|
# schedule:
|
||||||
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
||||||
# - cron: '17 19 * * *'
|
# - cron: '17 19 * * *'
|
||||||
@@ -39,4 +39,3 @@ jobs:
|
|||||||
pnpm install
|
pnpm install
|
||||||
npm run publish_to_gitee
|
npm run publish_to_gitee
|
||||||
working-directory: ./
|
working-directory: ./
|
||||||
|
|
||||||
@@ -3,12 +3,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ['v2-dev']
|
branches: ['v2-dev']
|
||||||
paths:
|
paths:
|
||||||
- "trigger/publish.trigger"
|
- 'trigger/publish.trigger'
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: [ "build-image-for-release" ]
|
workflows: ['build-image-for-release']
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
workflow_dispatch: # 添加手动触发
|
workflow_dispatch: # 添加手动触发
|
||||||
# schedule:
|
# schedule:
|
||||||
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
# - # 国际时间 19:17 执行,北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
|
||||||
# - cron: '17 19 * * *'
|
# - cron: '17 19 * * *'
|
||||||
@@ -39,4 +39,3 @@ jobs:
|
|||||||
pnpm install
|
pnpm install
|
||||||
npm run publish_to_github
|
npm run publish_to_github
|
||||||
working-directory: ./
|
working-directory: ./
|
||||||
|
|
||||||
@@ -3,8 +3,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ['v2-dev']
|
branches: ['v2-dev']
|
||||||
paths:
|
paths:
|
||||||
- "trigger/release.trigger"
|
- 'trigger/release.trigger'
|
||||||
workflow_dispatch: # 添加手动触发
|
workflow_dispatch: # 添加手动触发
|
||||||
# workflow_run:
|
# workflow_run:
|
||||||
# workflows: [ "deploy-demo" ]
|
# workflows: [ "deploy-demo" ]
|
||||||
# types:
|
# types:
|
||||||
@@ -43,12 +43,12 @@ jobs:
|
|||||||
const pkg = JSON.parse(jsonContent)
|
const pkg = JSON.parse(jsonContent)
|
||||||
console.log("certd_version:",pkg.version);
|
console.log("certd_version:",pkg.version);
|
||||||
return pkg.version
|
return pkg.version
|
||||||
# - name: Use Node.js
|
# - name: Use Node.js
|
||||||
# uses: actions/setup-node@v4
|
# uses: actions/setup-node@v4
|
||||||
# with:
|
# with:
|
||||||
# node-version: 18
|
# node-version: 18
|
||||||
# cache: 'npm'
|
# cache: 'npm'
|
||||||
# working-directory: ./packages/ui/certd-client
|
# working-directory: ./packages/ui/certd-client
|
||||||
- run: |
|
- run: |
|
||||||
npm install -g pnpm@10.33.4
|
npm install -g pnpm@10.33.4
|
||||||
pnpm install
|
pnpm install
|
||||||
@@ -108,17 +108,17 @@ jobs:
|
|||||||
ghcr.io/${{ github.repository }}:armv7
|
ghcr.io/${{ github.repository }}:armv7
|
||||||
ghcr.io/${{ github.repository }}:${{steps.get_certd_version.outputs.result}}-armv7
|
ghcr.io/${{ github.repository }}:${{steps.get_certd_version.outputs.result}}-armv7
|
||||||
|
|
||||||
# - name: Build agent
|
# - name: Build agent
|
||||||
# uses: docker/build-push-action@v6
|
# uses: docker/build-push-action@v6
|
||||||
# with:
|
# with:
|
||||||
# platforms: linux/amd64,linux/arm64
|
# platforms: linux/amd64,linux/arm64
|
||||||
# push: true
|
# push: true
|
||||||
# context: ./packages/ui/agent/
|
# context: ./packages/ui/agent/
|
||||||
# tags: |
|
# tags: |
|
||||||
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:latest
|
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:latest
|
||||||
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:${{steps.get_certd_version.outputs.result}}
|
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:${{steps.get_certd_version.outputs.result}}
|
||||||
# greper/certd-agent:latest
|
# greper/certd-agent:latest
|
||||||
# greper/certd-agent:${{steps.get_certd_version.outputs.result}}
|
# greper/certd-agent:${{steps.get_certd_version.outputs.result}}
|
||||||
- name: deploy-certd-doc
|
- name: deploy-certd-doc
|
||||||
uses: tyrrrz/action-http-request@prime
|
uses: tyrrrz/action-http-request@prime
|
||||||
with:
|
with:
|
||||||
@@ -132,4 +132,3 @@ jobs:
|
|||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
retry-count: 3
|
retry-count: 3
|
||||||
retry-delay: 5000
|
retry-delay: 5000
|
||||||
|
|
||||||
@@ -12,24 +12,23 @@ jobs:
|
|||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
ref: v2-dev
|
ref: v2-dev
|
||||||
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "xiaojunnuo"
|
git config --global user.name "xiaojunnuo"
|
||||||
git config --global user.email "xiaojunnuo@qq.com"
|
git config --global user.email "xiaojunnuo@qq.com"
|
||||||
|
|
||||||
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
||||||
uses: de-vri-es/setup-git-credentials@v2
|
uses: de-vri-es/setup-git-credentials@v2
|
||||||
with: # token 格式为: username:password
|
with: # token 格式为: username:password
|
||||||
credentials: https://greper:${{secrets.ATOMGIT_TOKEN}}@atomgit.com
|
credentials: https://greper:${{secrets.ATOMGIT_TOKEN}}@atomgit.com
|
||||||
|
|
||||||
- name: push to atomgit # 4. 执行同步
|
- name: push to atomgit # 4. 执行同步
|
||||||
run: |
|
run: |
|
||||||
git remote add upstream https://atomgit.com/certd/certd
|
git remote add upstream https://atomgit.com/certd/certd
|
||||||
git push --set-upstream upstream v2-dev
|
git push --set-upstream upstream v2-dev
|
||||||
|
|
||||||
|
|||||||
@@ -12,24 +12,23 @@ jobs:
|
|||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
ref: v2
|
ref: v2
|
||||||
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "xiaojunnuo"
|
git config --global user.name "xiaojunnuo"
|
||||||
git config --global user.email "xiaojunnuo@qq.com"
|
git config --global user.email "xiaojunnuo@qq.com"
|
||||||
|
|
||||||
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
||||||
uses: de-vri-es/setup-git-credentials@v2
|
uses: de-vri-es/setup-git-credentials@v2
|
||||||
with: # token 格式为: username:password
|
with: # token 格式为: username:password
|
||||||
credentials: https://greper:${{secrets.ATOMGIT_TOKEN}}@atomgit.com
|
credentials: https://greper:${{secrets.ATOMGIT_TOKEN}}@atomgit.com
|
||||||
|
|
||||||
- name: push to atomgit # 4. 执行同步
|
- name: push to atomgit # 4. 执行同步
|
||||||
run: |
|
run: |
|
||||||
git remote add upstream https://atomgit.com/certd/certd
|
git remote add upstream https://atomgit.com/certd/certd
|
||||||
git push --set-upstream upstream v2
|
git push --set-upstream upstream v2
|
||||||
|
|
||||||
|
|||||||
@@ -12,24 +12,23 @@ jobs:
|
|||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
ref: v2-dev
|
ref: v2-dev
|
||||||
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "xiaojunnuo"
|
git config --global user.name "xiaojunnuo"
|
||||||
git config --global user.email "xiaojunnuo@qq.com"
|
git config --global user.email "xiaojunnuo@qq.com"
|
||||||
|
|
||||||
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
||||||
uses: de-vri-es/setup-git-credentials@v2
|
uses: de-vri-es/setup-git-credentials@v2
|
||||||
with: # token 格式为: username:password
|
with: # token 格式为: username:password
|
||||||
credentials: https://cnb:${{secrets.CNB_TOKEN}}@cnb.cool
|
credentials: https://cnb:${{secrets.CNB_TOKEN}}@cnb.cool
|
||||||
|
|
||||||
- name: push to cnb # 4. 执行同步
|
- name: push to cnb # 4. 执行同步
|
||||||
run: |
|
run: |
|
||||||
git remote add upstream https://cnb.cool/certd/certd.git
|
git remote add upstream https://cnb.cool/certd/certd.git
|
||||||
git push --set-upstream upstream v2-dev
|
git push --set-upstream upstream v2-dev
|
||||||
|
|
||||||
|
|||||||
@@ -12,23 +12,22 @@ jobs:
|
|||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "xiaojunnuo"
|
git config --global user.name "xiaojunnuo"
|
||||||
git config --global user.email "xiaojunnuo@qq.com"
|
git config --global user.email "xiaojunnuo@qq.com"
|
||||||
|
|
||||||
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
||||||
uses: de-vri-es/setup-git-credentials@v2
|
uses: de-vri-es/setup-git-credentials@v2
|
||||||
with: # token 格式为: username:password
|
with: # token 格式为: username:password
|
||||||
credentials: https://cnb:${{secrets.CNB_TOKEN}}@cnb.cool
|
credentials: https://cnb:${{secrets.CNB_TOKEN}}@cnb.cool
|
||||||
|
|
||||||
- name: push to cnb # 4. 执行同步
|
- name: push to cnb # 4. 执行同步
|
||||||
run: |
|
run: |
|
||||||
git remote add upstream https://cnb.cool/certd/certd.git
|
git remote add upstream https://cnb.cool/certd/certd.git
|
||||||
git push --set-upstream upstream v2
|
git push --set-upstream upstream v2
|
||||||
|
|
||||||
|
|||||||
@@ -12,24 +12,23 @@ jobs:
|
|||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
ref: v2-dev
|
ref: v2-dev
|
||||||
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "xiaojunnuo"
|
git config --global user.name "xiaojunnuo"
|
||||||
git config --global user.email "xiaojunnuo@qq.com"
|
git config --global user.email "xiaojunnuo@qq.com"
|
||||||
|
|
||||||
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
||||||
uses: de-vri-es/setup-git-credentials@v2
|
uses: de-vri-es/setup-git-credentials@v2
|
||||||
with: # token 格式为: username:password
|
with: # token 格式为: username:password
|
||||||
credentials: https://${{secrets.PUSH_TOKEN_GITEE}}@gitee.com
|
credentials: https://${{secrets.PUSH_TOKEN_GITEE}}@gitee.com
|
||||||
|
|
||||||
- name: push to gitee # 4. 执行同步
|
- name: push to gitee # 4. 执行同步
|
||||||
run: |
|
run: |
|
||||||
git remote add upstream https://gitee.com/certd/certd
|
git remote add upstream https://gitee.com/certd/certd
|
||||||
git push --set-upstream upstream v2-dev
|
git push --set-upstream upstream v2-dev
|
||||||
|
|
||||||
|
|||||||
@@ -12,23 +12,22 @@ jobs:
|
|||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "xiaojunnuo"
|
git config --global user.name "xiaojunnuo"
|
||||||
git config --global user.email "xiaojunnuo@qq.com"
|
git config --global user.email "xiaojunnuo@qq.com"
|
||||||
|
|
||||||
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
- name: Set git token # 3. 给git命令设置token,用于push到目标仓库
|
||||||
uses: de-vri-es/setup-git-credentials@v2
|
uses: de-vri-es/setup-git-credentials@v2
|
||||||
with: # token 格式为: username:password
|
with: # token 格式为: username:password
|
||||||
credentials: https://${{secrets.PUSH_TOKEN_GITEE}}@gitee.com
|
credentials: https://${{secrets.PUSH_TOKEN_GITEE}}@gitee.com
|
||||||
|
|
||||||
- name: push to gitee # 4. 执行同步
|
- name: push to gitee # 4. 执行同步
|
||||||
run: |
|
run: |
|
||||||
git remote add upstream https://gitee.com/certd/certd
|
git remote add upstream https://gitee.com/certd/certd
|
||||||
git push --set-upstream upstream v2
|
git push --set-upstream upstream v2
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -1,4 +1,4 @@
|
|||||||
./packages/core/lego
|
./packages/core/lego
|
||||||
# IntelliJ project files
|
# IntelliJ project files
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
@@ -35,3 +35,7 @@ test.js
|
|||||||
.pnpm-lock.yaml
|
.pnpm-lock.yaml
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
.studio/
|
.studio/
|
||||||
|
|
||||||
|
# Certd 推广报告,仅本地使用
|
||||||
|
/popularize/
|
||||||
|
|
||||||
|
|||||||
@@ -7,29 +7,36 @@ version: 1.0.0
|
|||||||
# Access 插件开发技能
|
# Access 插件开发技能
|
||||||
|
|
||||||
## 角色定义
|
## 角色定义
|
||||||
|
|
||||||
你是一名 Certd 插件开发专家,擅长创建和实现 Access 类型的插件,熟悉 TypeScript 编程和 Certd 插件开发规范。
|
你是一名 Certd 插件开发专家,擅长创建和实现 Access 类型的插件,熟悉 TypeScript 编程和 Certd 插件开发规范。
|
||||||
|
|
||||||
## 核心指令
|
## 核心指令
|
||||||
|
|
||||||
请严格按照以下步骤执行任务:
|
请严格按照以下步骤执行任务:
|
||||||
|
|
||||||
1. **导入必要的依赖**
|
1. **导入必要的依赖**
|
||||||
|
|
||||||
- 导入 `AccessInput`, `BaseAccess`, `IsAccess`, `Pager`, `PageRes`, `PageSearch` 等必要的类型和装饰器
|
- 导入 `AccessInput`, `BaseAccess`, `IsAccess`, `Pager`, `PageRes`, `PageSearch` 等必要的类型和装饰器
|
||||||
- 导入 `DomainRecord` 等相关类型
|
- 导入 `DomainRecord` 等相关类型
|
||||||
|
|
||||||
2. **使用 @IsAccess 注解注册插件**
|
2. **使用 @IsAccess 注解注册插件**
|
||||||
|
|
||||||
- 配置插件的唯一标识、标题、图标和描述
|
- 配置插件的唯一标识、标题、图标和描述
|
||||||
- 继承 `BaseAccess` 类
|
- 继承 `BaseAccess` 类
|
||||||
|
|
||||||
3. **定义授权属性**
|
3. **定义授权属性**
|
||||||
|
|
||||||
- 使用 `@AccessInput` 注解定义授权属性
|
- 使用 `@AccessInput` 注解定义授权属性
|
||||||
- 配置属性的标题、默认值、组件类型和验证规则
|
- 配置属性的标题、默认值、组件类型和验证规则
|
||||||
- 对于敏感信息,设置 `encrypt: true` 进行加密
|
- 对于敏感信息,设置 `encrypt: true` 进行加密
|
||||||
|
|
||||||
4. **实现测试方法**
|
4. **实现测试方法**
|
||||||
|
|
||||||
- 添加测试按钮配置
|
- 添加测试按钮配置
|
||||||
- 实现 `onTestRequest` 方法,用于测试接口调用是否正常
|
- 实现 `onTestRequest` 方法,用于测试接口调用是否正常
|
||||||
|
|
||||||
5. **实现 API 方法**
|
5. **实现 API 方法**
|
||||||
|
|
||||||
- 实现必要的 API 方法,如 `GetDomainList`
|
- 实现必要的 API 方法,如 `GetDomainList`
|
||||||
- 封装统一的 API 请求方法 `doRequest`,处理错误和日志
|
- 封装统一的 API 请求方法 `doRequest`,处理错误和日志
|
||||||
|
|
||||||
@@ -39,6 +46,7 @@ version: 1.0.0
|
|||||||
- 实现代码复用,避免重复逻辑
|
- 实现代码复用,避免重复逻辑
|
||||||
|
|
||||||
## 输出规范
|
## 输出规范
|
||||||
|
|
||||||
- 必须包含完整的插件实现代码,包括所有必要的导入语句
|
- 必须包含完整的插件实现代码,包括所有必要的导入语句
|
||||||
- 代码必须包含详细的注释说明,解释每个步骤的目的和实现细节
|
- 代码必须包含详细的注释说明,解释每个步骤的目的和实现细节
|
||||||
- 提供完整的示例代码,展示插件的使用方法,包括不同类型的授权方式
|
- 提供完整的示例代码,展示插件的使用方法,包括不同类型的授权方式
|
||||||
@@ -51,6 +59,7 @@ version: 1.0.0
|
|||||||
### 示例 1: 基本 Access 插件
|
### 示例 1: 基本 Access 插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
创建一个 Access 插件,用于存储第三方应用的授权信息并提供 API 接口。
|
创建一个 Access 插件,用于存储第三方应用的授权信息并提供 API 接口。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -70,7 +79,6 @@ import { DomainRecord } from '@certd/plugin-lib';
|
|||||||
desc: '这是一个示例授权插件,用于演示如何实现一个授权插件',
|
desc: '这是一个示例授权插件,用于演示如何实现一个授权插件',
|
||||||
})
|
})
|
||||||
export class DemoAccess extends BaseAccess {
|
export class DemoAccess extends BaseAccess {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 授权属性配置
|
* 授权属性配置
|
||||||
*/
|
*/
|
||||||
@@ -78,16 +86,17 @@ export class DemoAccess extends BaseAccess {
|
|||||||
title: '授权方式',
|
title: '授权方式',
|
||||||
value: 'apiKey', //默认值
|
value: 'apiKey', //默认值
|
||||||
component: {
|
component: {
|
||||||
name: "a-select", //基于antdv的输入组件
|
name: 'a-select', //基于antdv的输入组件
|
||||||
vModel: "value", // v-model绑定的属性名
|
vModel: 'value', // v-model绑定的属性名
|
||||||
options: [ //组件参数
|
options: [
|
||||||
|
//组件参数
|
||||||
{
|
{
|
||||||
label: "API密钥(推荐)",
|
label: 'API密钥(推荐)',
|
||||||
value: "apiKey"
|
value: 'apiKey',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "账号密码",
|
label: '账号密码',
|
||||||
value: "account"
|
value: 'account',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
placeholder: 'demoKeyId',
|
placeholder: 'demoKeyId',
|
||||||
@@ -102,7 +111,7 @@ export class DemoAccess extends BaseAccess {
|
|||||||
@AccessInput({
|
@AccessInput({
|
||||||
title: '密钥Id',
|
title: '密钥Id',
|
||||||
component: {
|
component: {
|
||||||
name:"a-input",
|
name: 'a-input',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
placeholder: 'demoKeyId',
|
placeholder: 'demoKeyId',
|
||||||
},
|
},
|
||||||
@@ -111,19 +120,19 @@ export class DemoAccess extends BaseAccess {
|
|||||||
demoKeyId = '';
|
demoKeyId = '';
|
||||||
|
|
||||||
@AccessInput({
|
@AccessInput({
|
||||||
title: '密钥',//标题
|
title: '密钥', //标题
|
||||||
required: true, //text组件可以省略
|
required: true, //text组件可以省略
|
||||||
encrypt: true, //该属性是否需要加密
|
encrypt: true, //该属性是否需要加密
|
||||||
})
|
})
|
||||||
demoKeySecret = '';
|
demoKeySecret = '';
|
||||||
|
|
||||||
@AccessInput({
|
@AccessInput({
|
||||||
title: "测试",
|
title: '测试',
|
||||||
component: {
|
component: {
|
||||||
name: "api-test",
|
name: 'api-test',
|
||||||
action: "TestRequest"
|
action: 'TestRequest',
|
||||||
},
|
},
|
||||||
helper: "点击测试接口是否正常"
|
helper: '点击测试接口是否正常',
|
||||||
})
|
})
|
||||||
testRequest = true;
|
testRequest = true;
|
||||||
|
|
||||||
@@ -132,7 +141,7 @@ export class DemoAccess extends BaseAccess {
|
|||||||
*/
|
*/
|
||||||
async onTestRequest() {
|
async onTestRequest() {
|
||||||
await this.GetDomainList({});
|
await this.GetDomainList({});
|
||||||
return "ok"
|
return 'ok';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -143,41 +152,41 @@ export class DemoAccess extends BaseAccess {
|
|||||||
this.ctx.logger.info(`获取域名列表,req:${JSON.stringify(req)}`);
|
this.ctx.logger.info(`获取域名列表,req:${JSON.stringify(req)}`);
|
||||||
const pager = new Pager(req);
|
const pager = new Pager(req);
|
||||||
const resp = await this.doRequest({
|
const resp = await this.doRequest({
|
||||||
action: "ListDomains",
|
action: 'ListDomains',
|
||||||
data: {
|
data: {
|
||||||
domain: req.searchKey,
|
domain: req.searchKey,
|
||||||
offset: pager.getOffset(),
|
offset: pager.getOffset(),
|
||||||
limit: pager.pageSize,
|
limit: pager.pageSize,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const total = resp?.TotalCount || 0;
|
const total = resp?.TotalCount || 0;
|
||||||
let list = resp?.DomainList?.map((item) => {
|
let list = resp?.DomainList?.map(item => {
|
||||||
item.domain = item.Domain;
|
item.domain = item.Domain;
|
||||||
item.id = item.DomainId;
|
item.id = item.DomainId;
|
||||||
return item;
|
return item;
|
||||||
})
|
});
|
||||||
return {
|
return {
|
||||||
total,
|
total,
|
||||||
list
|
list,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用api调用方法, 具体如何构造请求体,需参考对应应用的API文档
|
* 通用api调用方法, 具体如何构造请求体,需参考对应应用的API文档
|
||||||
*/
|
*/
|
||||||
async doRequest(req: { action: string, data?: any }) {
|
async doRequest(req: { action: string; data?: any }) {
|
||||||
const res = await this.ctx.http.request({
|
const res = await this.ctx.http.request({
|
||||||
url: "https://api.demo.cn/api/",
|
url: 'https://api.demo.cn/api/',
|
||||||
method: "POST",
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
Action: req.action,
|
Action: req.action,
|
||||||
Body: req.data
|
Body: req.data,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.Code !== 0) {
|
if (res.Code !== 0) {
|
||||||
//异常处理
|
//异常处理
|
||||||
throw new Error(res.Message || "请求失败");
|
throw new Error(res.Message || '请求失败');
|
||||||
}
|
}
|
||||||
return res.Resp;
|
return res.Resp;
|
||||||
}
|
}
|
||||||
@@ -187,6 +196,7 @@ export class DemoAccess extends BaseAccess {
|
|||||||
### 示例 2: 支持 OAuth 授权的 Access 插件
|
### 示例 2: 支持 OAuth 授权的 Access 插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
创建一个支持 OAuth 授权方式的 Access 插件。
|
创建一个支持 OAuth 授权方式的 Access 插件。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -205,21 +215,20 @@ import { DomainRecord } from '@certd/plugin-lib';
|
|||||||
desc: '这是一个支持OAuth授权的插件示例',
|
desc: '这是一个支持OAuth授权的插件示例',
|
||||||
})
|
})
|
||||||
export class OAuthDemoAccess extends BaseAccess {
|
export class OAuthDemoAccess extends BaseAccess {
|
||||||
|
|
||||||
@AccessInput({
|
@AccessInput({
|
||||||
title: '授权方式',
|
title: '授权方式',
|
||||||
value: 'oauth',
|
value: 'oauth',
|
||||||
component: {
|
component: {
|
||||||
name: "a-select",
|
name: 'a-select',
|
||||||
vModel: "value",
|
vModel: 'value',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: "OAuth授权",
|
label: 'OAuth授权',
|
||||||
value: "oauth"
|
value: 'oauth',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "API密钥",
|
label: 'API密钥',
|
||||||
value: "apiKey"
|
value: 'apiKey',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -230,7 +239,7 @@ export class OAuthDemoAccess extends BaseAccess {
|
|||||||
@AccessInput({
|
@AccessInput({
|
||||||
title: '客户端ID',
|
title: '客户端ID',
|
||||||
component: {
|
component: {
|
||||||
name:"a-input",
|
name: 'a-input',
|
||||||
placeholder: 'Client ID',
|
placeholder: 'Client ID',
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
@@ -247,7 +256,7 @@ export class OAuthDemoAccess extends BaseAccess {
|
|||||||
@AccessInput({
|
@AccessInput({
|
||||||
title: '授权回调地址',
|
title: '授权回调地址',
|
||||||
component: {
|
component: {
|
||||||
name:"a-input",
|
name: 'a-input',
|
||||||
placeholder: 'https://your-domain.com/callback',
|
placeholder: 'https://your-domain.com/callback',
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
@@ -268,12 +277,12 @@ export class OAuthDemoAccess extends BaseAccess {
|
|||||||
refreshToken = '';
|
refreshToken = '';
|
||||||
|
|
||||||
@AccessInput({
|
@AccessInput({
|
||||||
title: "测试",
|
title: '测试',
|
||||||
component: {
|
component: {
|
||||||
name: "api-test",
|
name: 'api-test',
|
||||||
action: "TestOAuth"
|
action: 'TestOAuth',
|
||||||
},
|
},
|
||||||
helper: "点击测试OAuth授权是否正常"
|
helper: '点击测试OAuth授权是否正常',
|
||||||
})
|
})
|
||||||
testOAuth = true;
|
testOAuth = true;
|
||||||
|
|
||||||
@@ -285,7 +294,7 @@ export class OAuthDemoAccess extends BaseAccess {
|
|||||||
// 测试AccessToken是否有效
|
// 测试AccessToken是否有效
|
||||||
const result = await this.doOAuthRequest('GET', '/api/user/profile');
|
const result = await this.doOAuthRequest('GET', '/api/user/profile');
|
||||||
this.ctx.logger.info('OAuth测试成功:', result);
|
this.ctx.logger.info('OAuth测试成功:', result);
|
||||||
return "OAuth授权测试成功";
|
return 'OAuth授权测试成功';
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.ctx.logger.error('OAuth测试失败:', error);
|
this.ctx.logger.error('OAuth测试失败:', error);
|
||||||
throw new Error('OAuth授权测试失败');
|
throw new Error('OAuth授权测试失败');
|
||||||
@@ -300,10 +309,10 @@ export class OAuthDemoAccess extends BaseAccess {
|
|||||||
url: `https://api.oauth-demo.com${endpoint}`,
|
url: `https://api.oauth-demo.com${endpoint}`,
|
||||||
method,
|
method,
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${this.accessToken}`,
|
Authorization: `Bearer ${this.accessToken}`,
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
data
|
data,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.status !== 200) {
|
if (res.status !== 200) {
|
||||||
@@ -327,8 +336,8 @@ export class OAuthDemoAccess extends BaseAccess {
|
|||||||
grant_type: 'refresh_token',
|
grant_type: 'refresh_token',
|
||||||
refresh_token: this.refreshToken,
|
refresh_token: this.refreshToken,
|
||||||
client_id: this.clientId,
|
client_id: this.clientId,
|
||||||
client_secret: this.clientSecret
|
client_secret: this.clientSecret,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.status === 200 && res.data.access_token) {
|
if (res.status === 200 && res.data.access_token) {
|
||||||
@@ -349,15 +358,15 @@ export class OAuthDemoAccess extends BaseAccess {
|
|||||||
const res = await this.doOAuthRequest('GET', '/api/domains', {
|
const res = await this.doOAuthRequest('GET', '/api/domains', {
|
||||||
search: req.searchKey,
|
search: req.searchKey,
|
||||||
page: req.page,
|
page: req.page,
|
||||||
pageSize: req.pageSize
|
pageSize: req.pageSize,
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
total: res.total,
|
total: res.total,
|
||||||
list: res.items.map((item: any) => ({
|
list: res.items.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
domain: item.domain
|
domain: item.domain,
|
||||||
}))
|
})),
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 尝试刷新AccessToken并重试
|
// 尝试刷新AccessToken并重试
|
||||||
@@ -366,15 +375,15 @@ export class OAuthDemoAccess extends BaseAccess {
|
|||||||
const res = await this.doOAuthRequest('GET', '/api/domains', {
|
const res = await this.doOAuthRequest('GET', '/api/domains', {
|
||||||
search: req.searchKey,
|
search: req.searchKey,
|
||||||
page: req.page,
|
page: req.page,
|
||||||
pageSize: req.pageSize
|
pageSize: req.pageSize,
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
total: res.total,
|
total: res.total,
|
||||||
list: res.items.map((item: any) => ({
|
list: res.items.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
domain: item.domain
|
domain: item.domain,
|
||||||
}))
|
})),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
@@ -397,9 +406,13 @@ export class OAuthDemoAccess extends BaseAccess {
|
|||||||
### 实现统一的 API 请求封装
|
### 实现统一的 API 请求封装
|
||||||
|
|
||||||
**好处:**
|
**好处:**
|
||||||
|
|
||||||
- **代码复用**:避免在每个 API 方法中重复编写相同的 header 设置和错误处理逻辑
|
- **代码复用**:避免在每个 API 方法中重复编写相同的 header 设置和错误处理逻辑
|
||||||
- **错误处理一致**:统一捕获和处理各种错误情况,确保错误信息格式统一
|
- **错误处理一致**:统一捕获和处理各种错误情况,确保错误信息格式统一
|
||||||
- **日志记录完善**:集中记录详细的错误信息,便于调试和问题排查
|
- **日志记录完善**:集中记录详细的错误信息,便于调试和问题排查
|
||||||
- **接口调用简化**:调用方只需关注业务逻辑,无需关心底层请求细节
|
- **接口调用简化**:调用方只需关注业务逻辑,无需关心底层请求细节
|
||||||
- **易于维护**:统一修改 API 调用方式时,只需修改一处代码
|
- **易于维护**:统一修改 API 调用方式时,只需修改一处代码
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -7,30 +7,37 @@ version: 1.0.0
|
|||||||
# DNS Provider 插件开发技能
|
# DNS Provider 插件开发技能
|
||||||
|
|
||||||
## 角色定义
|
## 角色定义
|
||||||
|
|
||||||
你是一名 Certd 插件开发专家,擅长创建和实现 DNS Provider 类型的插件,熟悉 TypeScript 编程和 Certd 插件开发规范。
|
你是一名 Certd 插件开发专家,擅长创建和实现 DNS Provider 类型的插件,熟悉 TypeScript 编程和 Certd 插件开发规范。
|
||||||
|
|
||||||
## 核心指令
|
## 核心指令
|
||||||
|
|
||||||
请严格按照以下步骤执行任务:
|
请严格按照以下步骤执行任务:
|
||||||
|
|
||||||
1. **导入必要的依赖**
|
1. **导入必要的依赖**
|
||||||
|
|
||||||
- 导入 `AbstractDnsProvider`, `CreateRecordOptions`, `IsDnsProvider`, `RemoveRecordOptions` 等必要的类型和装饰器
|
- 导入 `AbstractDnsProvider`, `CreateRecordOptions`, `IsDnsProvider`, `RemoveRecordOptions` 等必要的类型和装饰器
|
||||||
- 导入对应的 Access 插件类型
|
- 导入对应的 Access 插件类型
|
||||||
|
|
||||||
2. **定义记录数据结构**
|
2. **定义记录数据结构**
|
||||||
|
|
||||||
- 定义适合对应云平台的记录数据结构
|
- 定义适合对应云平台的记录数据结构
|
||||||
- 至少包含 id 字段,用于后续删除记录
|
- 至少包含 id 字段,用于后续删除记录
|
||||||
|
|
||||||
3. **使用 @IsDnsProvider 注解注册插件**
|
3. **使用 @IsDnsProvider 注解注册插件**
|
||||||
|
|
||||||
- 配置插件的唯一标识、标题、描述、图标
|
- 配置插件的唯一标识、标题、描述、图标
|
||||||
- 指定对应的云平台的 access 类型名称
|
- 指定对应的云平台的 access 类型名称
|
||||||
- 设置排序值(可选)
|
- 设置排序值(可选)
|
||||||
- 继承 `AbstractDnsProvider` 类
|
- 继承 `AbstractDnsProvider` 类
|
||||||
|
|
||||||
4. **实现 onInstance 方法**
|
4. **实现 onInstance 方法**
|
||||||
|
|
||||||
- 获取并保存对应的 Access 实例
|
- 获取并保存对应的 Access 实例
|
||||||
- 执行初始化操作
|
- 执行初始化操作
|
||||||
|
|
||||||
5. **实现 createRecord 方法**
|
5. **实现 createRecord 方法**
|
||||||
|
|
||||||
- 解析传入的参数(fullRecord, value, type, domain)
|
- 解析传入的参数(fullRecord, value, type, domain)
|
||||||
- 记录操作开始日志
|
- 记录操作开始日志
|
||||||
- 调用云平台 API 创建 TXT 类型的 DNS 解析记录
|
- 调用云平台 API 创建 TXT 类型的 DNS 解析记录
|
||||||
@@ -39,6 +46,7 @@ version: 1.0.0
|
|||||||
- 返回创建的记录信息,用于后续删除操作
|
- 返回创建的记录信息,用于后续删除操作
|
||||||
|
|
||||||
6. **实现 removeRecord 方法**
|
6. **实现 removeRecord 方法**
|
||||||
|
|
||||||
- 解析传入的参数和之前创建的记录信息
|
- 解析传入的参数和之前创建的记录信息
|
||||||
- 记录操作开始日志
|
- 记录操作开始日志
|
||||||
- 调用云平台 API 删除 TXT 类型的 DNS 解析记录
|
- 调用云平台 API 删除 TXT 类型的 DNS 解析记录
|
||||||
@@ -46,6 +54,7 @@ version: 1.0.0
|
|||||||
- 记录操作结果日志
|
- 记录操作结果日志
|
||||||
|
|
||||||
7. **实现 getDomainListPage 方法**
|
7. **实现 getDomainListPage 方法**
|
||||||
|
|
||||||
- 实现获取域名列表的方法
|
- 实现获取域名列表的方法
|
||||||
- 支持分页查询
|
- 支持分页查询
|
||||||
- 处理可能的错误:网络错误、API调用失败、授权失败等
|
- 处理可能的错误:网络错误、API调用失败、授权失败等
|
||||||
@@ -55,6 +64,7 @@ version: 1.0.0
|
|||||||
- 实例化插件,确保插件被注册
|
- 实例化插件,确保插件被注册
|
||||||
|
|
||||||
## 输出规范
|
## 输出规范
|
||||||
|
|
||||||
- 必须包含完整的插件实现代码
|
- 必须包含完整的插件实现代码
|
||||||
- 代码必须包含详细的注释说明
|
- 代码必须包含详细的注释说明
|
||||||
- 提供完整的示例代码,展示插件的使用方法
|
- 提供完整的示例代码,展示插件的使用方法
|
||||||
@@ -65,12 +75,13 @@ version: 1.0.0
|
|||||||
### 示例 1: 基本 DNS Provider 插件
|
### 示例 1: 基本 DNS Provider 插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
创建一个 DNS Provider 插件,用于在 ACME 申请证书时添加和删除 TXT 解析记录。
|
创建一个 DNS Provider 插件,用于在 ACME 申请证书时添加和删除 TXT 解析记录。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { Pager, PageRes, PageSearch } from "@certd/pipeline";
|
import { Pager, PageRes, PageSearch } from '@certd/pipeline';
|
||||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions, DomainRecord } from '@certd/plugin-cert';
|
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions, DomainRecord } from '@certd/plugin-cert';
|
||||||
import { DemoAccess } from './access.js';
|
import { DemoAccess } from './access.js';
|
||||||
|
|
||||||
@@ -166,11 +177,12 @@ export class DemoDnsProvider extends AbstractDnsProvider<DemoRecord> {
|
|||||||
const pager = new Pager(req);
|
const pager = new Pager(req);
|
||||||
const res = await this.http.request({
|
const res = await this.http.request({
|
||||||
// 请求接口获取域名列表
|
// 请求接口获取域名列表
|
||||||
})
|
});
|
||||||
const list = res.Domains?.map(item => ({
|
const list =
|
||||||
id: item.Id,
|
res.Domains?.map(item => ({
|
||||||
domain: item.DomainName,
|
id: item.Id,
|
||||||
})) || []
|
domain: item.DomainName,
|
||||||
|
})) || [];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
list,
|
list,
|
||||||
@@ -190,6 +202,7 @@ new DemoDnsProvider();
|
|||||||
### 示例 2: 阿里云 DNS Provider 插件
|
### 示例 2: 阿里云 DNS Provider 插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
创建一个阿里云 DNS Provider 插件,用于在 ACME 申请证书时添加和删除 TXT 解析记录。
|
创建一个阿里云 DNS Provider 插件,用于在 ACME 申请证书时添加和删除 TXT 解析记录。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -240,7 +253,7 @@ export class AliyunDnsProvider extends AbstractDnsProvider<AliyunRecord> {
|
|||||||
Type: type,
|
Type: type,
|
||||||
Value: value,
|
Value: value,
|
||||||
TTL: 600, // 10分钟
|
TTL: 600, // 10分钟
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
this.logger.info('阿里云DNS: 解析记录创建成功', { RecordId: response.RecordId });
|
this.logger.info('阿里云DNS: 解析记录创建成功', { RecordId: response.RecordId });
|
||||||
@@ -265,7 +278,7 @@ export class AliyunDnsProvider extends AbstractDnsProvider<AliyunRecord> {
|
|||||||
action: 'DeleteDomainRecord',
|
action: 'DeleteDomainRecord',
|
||||||
data: {
|
data: {
|
||||||
RecordId: record.RecordId,
|
RecordId: record.RecordId,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
this.logger.info('阿里云DNS: 解析记录删除成功', { RecordId: record.RecordId });
|
this.logger.info('阿里云DNS: 解析记录删除成功', { RecordId: record.RecordId });
|
||||||
@@ -287,7 +300,7 @@ export class AliyunDnsProvider extends AbstractDnsProvider<AliyunRecord> {
|
|||||||
PageNumber: pager.page,
|
PageNumber: pager.page,
|
||||||
PageSize: pager.pageSize,
|
PageSize: pager.pageSize,
|
||||||
KeyWord: req.searchKey,
|
KeyWord: req.searchKey,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const list = response.Domains.Domain.map((domain: any) => ({
|
const list = response.Domains.Domain.map((domain: any) => ({
|
||||||
@@ -313,6 +326,7 @@ new AliyunDnsProvider();
|
|||||||
### 示例 3: 腾讯云 DNS Provider 插件
|
### 示例 3: 腾讯云 DNS Provider 插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
创建一个腾讯云 DNS Provider 插件,用于在 ACME 申请证书时添加和删除 TXT 解析记录。
|
创建一个腾讯云 DNS Provider 插件,用于在 ACME 申请证书时添加和删除 TXT 解析记录。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -363,7 +377,7 @@ export class TencentDnsProvider extends AbstractDnsProvider<TencentRecord> {
|
|||||||
RecordType: type,
|
RecordType: type,
|
||||||
RecordValue: value,
|
RecordValue: value,
|
||||||
TTL: 600, // 10分钟
|
TTL: 600, // 10分钟
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
this.logger.info('腾讯云DNS: 解析记录创建成功', { RecordId: response.RecordId });
|
this.logger.info('腾讯云DNS: 解析记录创建成功', { RecordId: response.RecordId });
|
||||||
@@ -388,7 +402,7 @@ export class TencentDnsProvider extends AbstractDnsProvider<TencentRecord> {
|
|||||||
action: 'DeleteRecord',
|
action: 'DeleteRecord',
|
||||||
data: {
|
data: {
|
||||||
RecordId: record.RecordId,
|
RecordId: record.RecordId,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
this.logger.info('腾讯云DNS: 解析记录删除成功', { RecordId: record.RecordId });
|
this.logger.info('腾讯云DNS: 解析记录删除成功', { RecordId: record.RecordId });
|
||||||
@@ -410,7 +424,7 @@ export class TencentDnsProvider extends AbstractDnsProvider<TencentRecord> {
|
|||||||
Offset: (pager.page - 1) * pager.pageSize,
|
Offset: (pager.page - 1) * pager.pageSize,
|
||||||
Limit: pager.pageSize,
|
Limit: pager.pageSize,
|
||||||
Keyword: req.searchKey,
|
Keyword: req.searchKey,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const list = response.Domains.map((domain: any) => ({
|
const list = response.Domains.map((domain: any) => ({
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ version: 1.0.0
|
|||||||
## 实现流程
|
## 实现流程
|
||||||
|
|
||||||
1. 先在 `packages/ui/certd-client/src/views` 下找 1-2 个相近 Fast Crud 页面,沿用它们的导入、布局、命名和权限写法。
|
1. 先在 `packages/ui/certd-client/src/views` 下找 1-2 个相近 Fast Crud 页面,沿用它们的导入、布局、命名和权限写法。
|
||||||
2. 在 `index.vue` 中使用 `fs-crud ref="crudRef" v-bind="crudBinding"`,并在 `onMounted` / `onActivated` 时调用 `crudExpose.doRefresh()`。
|
2. 在 `index.vue` 中使用 `fs-crud ref="crudRef" v-bind="crudBinding"`,并在 `onMounted` 或 `onActivated` 时调用 `crudExpose.doRefresh()`;两个生命周期同时存在时只保留一个刷新入口,避免首次进入页面请求两次。
|
||||||
3. 在 `crud.tsx` 中配置 `request.pageRequest`、`columns`、`search`、`form`、`rowHandle`、`actionbar`、`toolbar` 等,接口分页参数和返回值按现有页面适配。
|
3. 在 `crud.tsx` 中配置 `request.pageRequest`、`columns`、`search`、`form`、`rowHandle`、`actionbar`、`toolbar` 等,接口分页参数和返回值按现有页面适配。
|
||||||
4. 操作按钮优先放在 Fast Crud 的 `rowHandle.buttons` 或 `actionbar.buttons` 中;审核、保存设置、批量操作等复杂交互可通过 `context` 调用 `index.vue` 中的方法。
|
4. 操作按钮优先放在 Fast Crud 的 `rowHandle.buttons` 或 `actionbar.buttons` 中;审核、保存设置、批量操作等复杂交互可通过 `context` 调用 `index.vue` 中的方法。
|
||||||
5. 金额、状态、时间、枚举等字段优先复用项目已有组件、字典和格式化工具;避免在模板里重复堆格式化逻辑。
|
5. 金额、状态、时间、枚举等字段优先复用项目已有组件、字典和格式化工具;避免在模板里重复堆格式化逻辑。
|
||||||
@@ -33,42 +33,41 @@ version: 1.0.0
|
|||||||
7. 删除、审核通过、拒绝等危险操作必须保留确认弹窗和错误提示,成功后刷新当前 CRUD 列表。
|
7. 删除、审核通过、拒绝等危险操作必须保留确认弹窗和错误提示,成功后刷新当前 CRUD 列表。
|
||||||
8. 对话框里只做纯确认时可以使用 `Modal.confirm`;只要需要字段输入、表单校验或提交字段,统一使用 `useFormDialog` / `openFormDialog`,不要在 `Modal.confirm` 的 `content` 里手写输入框。
|
8. 对话框里只做纯确认时可以使用 `Modal.confirm`;只要需要字段输入、表单校验或提交字段,统一使用 `useFormDialog` / `openFormDialog`,不要在 `Modal.confirm` 的 `content` 里手写输入框。
|
||||||
|
|
||||||
|
|
||||||
## crud 配置
|
## crud 配置
|
||||||
|
|
||||||
const crudOptions ={
|
const crudOptions ={
|
||||||
id: string, //表格唯一标识,同一个页面的多个表格的列设置和字段设置会根据id进行区分保存
|
id: string, //表格唯一标识,同一个页面的多个表格的列设置和字段设置会根据id进行区分保存
|
||||||
request:{}, //http请求
|
request:{}, //http请求
|
||||||
columns:{ //字段配置
|
columns:{ //字段配置
|
||||||
key:{ //字段key
|
key:{ //字段key
|
||||||
column:{}, //对应table-column配置
|
column:{}, //对应table-column配置
|
||||||
form:{}, //表单中该字段的公共配置,viewForm、addForm、editForm、search会集成此配置,支持对应ui的form-item配置
|
form:{}, //表单中该字段的公共配置,viewForm、addForm、editForm、search会集成此配置,支持对应ui的form-item配置
|
||||||
viewForm:{}, //查看表单中该字段的配置,支持对应ui的form-item配置
|
viewForm:{}, //查看表单中该字段的配置,支持对应ui的form-item配置
|
||||||
addForm:{}, // 添加表单中该字段的配置,支持对应ui的form-item配置
|
addForm:{}, // 添加表单中该字段的配置,支持对应ui的form-item配置
|
||||||
editForm:{}, //编辑表单中该字段的配置,支持对应ui的form-item配置
|
editForm:{}, //编辑表单中该字段的配置,支持对应ui的form-item配置
|
||||||
search:{} //对应查询表单的form-item配置
|
search:{} //对应查询表单的form-item配置
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
search:{ //查询框配置 ,对应fs-search组件
|
search:{ //查询框配置 ,对应fs-search组件
|
||||||
options:{} //查询表单配置 ,对应el-from, a-form配置
|
options:{} //查询表单配置 ,对应el-from, a-form配置
|
||||||
},
|
},
|
||||||
actionbar:{}, //动作条,添加按钮,对应fs-actionbar组件
|
actionbar:{}, //动作条,添加按钮,对应fs-actionbar组件
|
||||||
toolbar:{}, //工具条 ,对应fs-toolbar组件
|
toolbar:{}, //工具条 ,对应fs-toolbar组件
|
||||||
table:{ //表格配置,对应fs-table
|
table:{ //表格配置,对应fs-table
|
||||||
// 对应 el-table / a-table的配置
|
// 对应 el-table / a-table的配置
|
||||||
slots:{} // 对应el-table ,a-table的插槽
|
slots:{} // 对应el-table ,a-table的插槽
|
||||||
},
|
},
|
||||||
data:{}, //列表数据,无需配置,自动从pageRequest中获取
|
data:{}, //列表数据,无需配置,自动从pageRequest中获取
|
||||||
// 如果你要手动改变表格数据,可以通过crudBinding.value.data直接赋值修改表格数据
|
// 如果你要手动改变表格数据,可以通过crudBinding.value.data直接赋值修改表格数据
|
||||||
rowHandle:{}, //操作列配置,对应fs-row-handle
|
rowHandle:{}, //操作列配置,对应fs-row-handle
|
||||||
form:{ //表单的公共配置,对应el-form,a-form配置
|
form:{ //表单的公共配置,对应el-form,a-form配置
|
||||||
wrapper:{} //表单外部容器(对话框)的配置,对应el-dialog,el-drawer,a-model,a-drawer的配置
|
wrapper:{} //表单外部容器(对话框)的配置,对应el-dialog,el-drawer,a-model,a-drawer的配置
|
||||||
},
|
},
|
||||||
viewForm:{}, //查看表单的独立配置
|
viewForm:{}, //查看表单的独立配置
|
||||||
editForm:{}, //编辑表单的独立配置
|
editForm:{}, //编辑表单的独立配置
|
||||||
addForm:{}, //添加表单的独立配置
|
addForm:{}, //添加表单的独立配置
|
||||||
pagination:{}, //分页配置 ,对应el-pagination / a-pagination
|
pagination:{}, //分页配置 ,对应el-pagination / a-pagination
|
||||||
container:{}, //容器配置 ,对应fs-container
|
container:{}, //容器配置 ,对应fs-container
|
||||||
}
|
}
|
||||||
|
|
||||||
## 布局高度
|
## 布局高度
|
||||||
@@ -78,6 +77,136 @@ const crudOptions ={
|
|||||||
- 有固定操作栏、统计区、说明区时,这些区域应 `flex: none`,把剩余空间交给表格区域。
|
- 有固定操作栏、统计区、说明区时,这些区域应 `flex: none`,把剩余空间交给表格区域。
|
||||||
- 修改嵌入式 Fast Crud 页面后,要检查空数据、少量数据和多页数据时表格高度、分页器和空状态是否仍在预期区域内。
|
- 修改嵌入式 Fast Crud 页面后,要检查空数据、少量数据和多页数据时表格高度、分页器和空状态是否仍在预期区域内。
|
||||||
|
|
||||||
|
## 列表导出
|
||||||
|
|
||||||
|
- 列表需要导出时,优先使用 Fast Crud 工具栏导出能力,不要另写一套导出按钮或后端接口,除非数据必须跨权限、跨分页或异步生成文件。
|
||||||
|
- 导出当前搜索条件下的数据时,在 `toolbar.export` 中设置 `dataFrom: "search"`,并显式打开导出按钮。
|
||||||
|
- 导出列必须输出 Excel 可读的纯文本或数字;不要直接导出对象、数组、VNode、进度条组件、开关组件、时间戳毫秒值等。
|
||||||
|
- 有隐藏但业务上需要导出的字段时,把字段定义为普通列并设置 `column.show: false`,再在 `columnFilter` 中对该字段返回 `true`。例如证书域名这类只用于导出的辅助列。
|
||||||
|
- 嵌套字段可以使用 `lastVars.certDomains` 这类 key;导出格式化时用安全取值函数读取嵌套值。
|
||||||
|
- `dataFormatter` 中统一格式化特殊字段:时间字段转 `YYYY-MM-DD HH:mm:ss`,日期类有效期转业务文案或 `YYYY-MM-DD`,枚举/开关转字典 label,数组转逗号分隔字符串,对象转明确的业务摘要。
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { ColumnProps, DataFormatterContext } from "@fast-crud/fast-crud";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
function getRecordValue(row: any, key: string) {
|
||||||
|
return key.split(".").reduce((target, item) => target?.[item], row);
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatListValue(value: any) {
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return value.join(",");
|
||||||
|
}
|
||||||
|
return value ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportColumnFilter(col: ColumnProps) {
|
||||||
|
if (!col.key || ["_index", "_selection", "rowHandle"].includes(col.key)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (col.key === "lastVars.certDomains") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return col.show !== false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportDataFormatter(opts: DataFormatterContext) {
|
||||||
|
const { row, originalRow, col, exportCol } = opts;
|
||||||
|
const key = col.key;
|
||||||
|
const value = getRecordValue(originalRow, key);
|
||||||
|
|
||||||
|
if (key === "lastVars.certDomains") {
|
||||||
|
row[key] = formatListValue(value);
|
||||||
|
} else if (key.includes("Time") && value) {
|
||||||
|
row[key] = dayjs(value).format("YYYY-MM-DD HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (col.width) {
|
||||||
|
exportCol.width = col.width / 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
crudOptions: {
|
||||||
|
toolbar: {
|
||||||
|
buttons: {
|
||||||
|
export: { show: true },
|
||||||
|
},
|
||||||
|
export: {
|
||||||
|
dataFrom: "search",
|
||||||
|
columnFilter: exportColumnFilter,
|
||||||
|
dataFormatter: exportDataFormatter,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columns: {
|
||||||
|
"lastVars.certDomains": {
|
||||||
|
title: "证书域名",
|
||||||
|
type: "text",
|
||||||
|
column: {
|
||||||
|
show: false,
|
||||||
|
width: 260,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
form: { show: false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## 内置 CRUD 按钮
|
||||||
|
|
||||||
|
只要在 `request` 中配置了 `addRequest`、`editRequest`、`delRequest`,Fast Crud 会自动在 `rowHandle` 渲染新增、编辑、删除按钮并完成对应操作,**不需要手写 `openDeleteConfirm`、`openEditDialog` 等方法**。
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// crud.tsx
|
||||||
|
const addRequest = async ({ form }: AddReq) => await api.AddObj(form);
|
||||||
|
const editRequest = async ({ form, row }: EditReq) => {
|
||||||
|
form.id = row.id;
|
||||||
|
return await api.UpdateObj(form);
|
||||||
|
};
|
||||||
|
const delRequest = async ({ row }: DelReq) => await api.DelObj(row.id);
|
||||||
|
|
||||||
|
return {
|
||||||
|
crudOptions: {
|
||||||
|
request: { pageRequest, addRequest, editRequest, delRequest },
|
||||||
|
rowHandle: {
|
||||||
|
buttons: {
|
||||||
|
view: { show: false }, // 不需要查看就隐藏
|
||||||
|
edit: {}, // 自动调用 editRequest
|
||||||
|
remove: {}, // 自动调用 delRequest,自带确认弹窗和错误提示
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
- 删除按钮自带确认弹窗,不需要额外包装 `Modal.confirm`。
|
||||||
|
- 只有**自定义操作**(如禁用、审核、生成激活码)才需要在 `rowHandle.buttons` 中手写 `click` 处理方法。
|
||||||
|
- 如果不需要某列操作,直接把对应 key 去掉或设 `show: false`。
|
||||||
|
|
||||||
|
## compute 动态计算
|
||||||
|
|
||||||
|
当 `rowHandle.buttons` 的 `show`、`disabled` 等属性需要根据行数据动态决定时,**必须使用 `compute` 包裹**,不能直接传函数。
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { compute } from "@fast-crud/fast-crud";
|
||||||
|
|
||||||
|
// WRONG: 直接传函数
|
||||||
|
show: ({ row }) => row.status === "unused"
|
||||||
|
|
||||||
|
// CORRECT: 用 compute 包裹
|
||||||
|
show: compute(({ row }) => row.status === "unused")
|
||||||
|
```
|
||||||
|
|
||||||
|
`compute` 基于 Vue 的 `computed`,但额外支持上下文参数。适用位置:
|
||||||
|
- `rowHandle.buttons` 的 `show`、`disabled` 等属性
|
||||||
|
- `columns.key.column` 的 `show`、`cellRender` 等
|
||||||
|
- `columns.key.form` / `search` 的表单字段属性
|
||||||
|
|
||||||
|
参考文档:http://fast-crud.docmirror.cn/guide/advance/compute.html
|
||||||
|
|
||||||
## 代码习惯
|
## 代码习惯
|
||||||
|
|
||||||
- 页面命名、API 命名、权限标识和路由结构要贴近同目录已有页面。
|
- 页面命名、API 命名、权限标识和路由结构要贴近同目录已有页面。
|
||||||
|
|||||||
@@ -7,15 +7,19 @@ version: 1.0.0
|
|||||||
# 插件转换工具技能
|
# 插件转换工具技能
|
||||||
|
|
||||||
## 角色定义
|
## 角色定义
|
||||||
|
|
||||||
你是一名 Certd 插件开发专家,擅长使用插件转换工具将 Certd 插件转换为 YAML 配置文件,熟悉命令行工具的使用和 Certd 插件开发规范。
|
你是一名 Certd 插件开发专家,擅长使用插件转换工具将 Certd 插件转换为 YAML 配置文件,熟悉命令行工具的使用和 Certd 插件开发规范。
|
||||||
|
|
||||||
## 核心指令
|
## 核心指令
|
||||||
|
|
||||||
请严格按照以下步骤执行任务:
|
请严格按照以下步骤执行任务:
|
||||||
|
|
||||||
1. **定位工具位置**
|
1. **定位工具位置**
|
||||||
|
|
||||||
- 工具位于 `trae/skills/convert-plugin-to-yaml.js`
|
- 工具位于 `trae/skills/convert-plugin-to-yaml.js`
|
||||||
|
|
||||||
2. **了解功能特性**
|
2. **了解功能特性**
|
||||||
|
|
||||||
- 单个插件转换:支持指定单个插件文件进行转换
|
- 单个插件转换:支持指定单个插件文件进行转换
|
||||||
- 批量插件转换:支持指定目录批量转换多个插件
|
- 批量插件转换:支持指定目录批量转换多个插件
|
||||||
- 自动类型识别:自动识别插件类型(Access、Task、DNS Provider、Notification、Addon)
|
- 自动类型识别:自动识别插件类型(Access、Task、DNS Provider、Notification、Addon)
|
||||||
@@ -27,6 +31,7 @@ version: 1.0.0
|
|||||||
- 可复用函数:导出了可复用的函数,便于其他模块调用
|
- 可复用函数:导出了可复用的函数,便于其他模块调用
|
||||||
|
|
||||||
3. **使用工具**
|
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 <目录路径>`
|
- 批量转换:`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 <插件文件路径> --output <输出目录>`
|
||||||
@@ -39,6 +44,7 @@ version: 1.0.0
|
|||||||
- 自定义输出目录:`node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js --output ./configs`
|
- 自定义输出目录:`node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js --output ./configs`
|
||||||
|
|
||||||
4. **理解转换过程**
|
4. **理解转换过程**
|
||||||
|
|
||||||
- 加载插件模块:使用 `import()` 动态加载指定的插件文件
|
- 加载插件模块:使用 `import()` 动态加载指定的插件文件
|
||||||
- 分析插件定义:检查模块导出的对象,寻找带有 `define` 属性的插件
|
- 分析插件定义:检查模块导出的对象,寻找带有 `define` 属性的插件
|
||||||
- 识别插件类型:根据插件的继承关系或属性识别插件类型
|
- 识别插件类型:根据插件的继承关系或属性识别插件类型
|
||||||
@@ -46,10 +52,12 @@ version: 1.0.0
|
|||||||
- 保存配置文件:将生成的配置保存到 `./metadata` 目录
|
- 保存配置文件:将生成的配置保存到 `./metadata` 目录
|
||||||
|
|
||||||
5. **了解输出说明**
|
5. **了解输出说明**
|
||||||
|
|
||||||
- 命令行输出:插件加载状态、插件导出的对象列表、插件类型识别结果、生成的 YAML 配置内容、配置文件保存路径
|
- 命令行输出:插件加载状态、插件导出的对象列表、插件类型识别结果、生成的 YAML 配置内容、配置文件保存路径
|
||||||
- 配置文件命名规则:`<插件类型>[_<子类型>]_<插件名称>.yaml`
|
- 配置文件命名规则:`<插件类型>[_<子类型>]_<插件名称>.yaml`
|
||||||
|
|
||||||
6. **理解插件类型识别逻辑**
|
6. **理解插件类型识别逻辑**
|
||||||
|
|
||||||
- DNS Provider:如果插件定义中包含 `accessType` 属性
|
- DNS Provider:如果插件定义中包含 `accessType` 属性
|
||||||
- Task:如果插件继承自 `AbstractTaskPlugin`
|
- Task:如果插件继承自 `AbstractTaskPlugin`
|
||||||
- Notification:如果插件继承自 `BaseNotification`
|
- Notification:如果插件继承自 `BaseNotification`
|
||||||
@@ -64,6 +72,7 @@ version: 1.0.0
|
|||||||
- 错误处理:如果插件加载失败或识别失败,工具会输出错误信息但不会终止执行
|
- 错误处理:如果插件加载失败或识别失败,工具会输出错误信息但不会终止执行
|
||||||
|
|
||||||
## 输出规范
|
## 输出规范
|
||||||
|
|
||||||
- 必须包含工具的使用方法和示例
|
- 必须包含工具的使用方法和示例
|
||||||
- 必须包含转换过程的详细说明
|
- 必须包含转换过程的详细说明
|
||||||
- 必须包含输出说明和配置文件命名规则
|
- 必须包含输出说明和配置文件命名规则
|
||||||
@@ -75,6 +84,7 @@ version: 1.0.0
|
|||||||
### 示例 1: 转换单个 Access 插件
|
### 示例 1: 转换单个 Access 插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
将 Access 插件转换为 YAML 配置文件。
|
将 Access 插件转换为 YAML 配置文件。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -85,6 +95,7 @@ node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### 输出
|
#### 输出
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js
|
$ 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
|
开始转换插件: packages/ui/certd-server/src/plugins/plugin-demo/access.js
|
||||||
@@ -109,6 +120,7 @@ YAML 配置已保存到: ./metadata/access_demo.yaml
|
|||||||
### 示例 2: 批量转换插件
|
### 示例 2: 批量转换插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
批量转换目录中的所有插件为 YAML 配置文件。
|
批量转换目录中的所有插件为 YAML 配置文件。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -119,6 +131,7 @@ node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### 输出
|
#### 输出
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ 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/
|
||||||
开始转换目录: packages/ui/certd-server/src/plugins/
|
开始转换目录: packages/ui/certd-server/src/plugins/
|
||||||
@@ -189,6 +202,7 @@ YAML 配置已保存到: ./metadata/dns-provider_demo.yaml
|
|||||||
### 示例 3: 自定义输出目录
|
### 示例 3: 自定义输出目录
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
将插件转换为 YAML 配置文件,并保存到自定义目录。
|
将插件转换为 YAML 配置文件,并保存到自定义目录。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -199,6 +213,7 @@ node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### 输出
|
#### 输出
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ node trae/skills/convert-plugin-to-yaml.js packages/ui/certd-server/src/plugins/plugin-demo/access.js --output ./configs
|
$ 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
|
开始转换插件: packages/ui/certd-server/src/plugins/plugin-demo/access.js
|
||||||
@@ -225,14 +240,17 @@ YAML 配置已保存到: ./configs/access_demo.yaml
|
|||||||
### 常见问题
|
### 常见问题
|
||||||
|
|
||||||
1. **模块加载失败**
|
1. **模块加载失败**
|
||||||
|
|
||||||
- 原因:插件文件依赖未安装或路径错误
|
- 原因:插件文件依赖未安装或路径错误
|
||||||
- 解决:确保已安装所有依赖,检查文件路径是否正确
|
- 解决:确保已安装所有依赖,检查文件路径是否正确
|
||||||
|
|
||||||
2. **插件类型识别失败**
|
2. **插件类型识别失败**
|
||||||
|
|
||||||
- 原因:插件未正确继承基类或缺少必要的属性
|
- 原因:插件未正确继承基类或缺少必要的属性
|
||||||
- 解决:检查插件代码,确保正确继承对应的基类
|
- 解决:检查插件代码,确保正确继承对应的基类
|
||||||
|
|
||||||
3. **YAML 配置生成失败**
|
3. **YAML 配置生成失败**
|
||||||
|
|
||||||
- 原因:插件定义格式不正确
|
- 原因:插件定义格式不正确
|
||||||
- 解决:检查插件的 `define` 属性格式是否正确
|
- 解决:检查插件的 `define` 属性格式是否正确
|
||||||
|
|
||||||
@@ -262,9 +280,9 @@ YAML 配置已保存到: ./configs/access_demo.yaml
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
export {
|
export {
|
||||||
convertSinglePlugin, // 转换单个插件
|
convertSinglePlugin, // 转换单个插件
|
||||||
loadSingleModule, // 加载单个模块
|
loadSingleModule, // 加载单个模块
|
||||||
isPrototypeOf // 检查原型关系
|
isPrototypeOf, // 检查原型关系
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ node .trae/skills/plugin-converter/resources/convert-plugin-to-yaml.js packages/
|
|||||||
```
|
```
|
||||||
|
|
||||||
例如:
|
例如:
|
||||||
|
|
||||||
- `access_demo.yaml`(Access 插件)
|
- `access_demo.yaml`(Access 插件)
|
||||||
- `deploy_DemoTest.yaml`(Task 插件)
|
- `deploy_DemoTest.yaml`(Task 插件)
|
||||||
- `dnsProvider_demo.yaml`(DNS Provider 插件)
|
- `dnsProvider_demo.yaml`(DNS Provider 插件)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
// 转换单个插件为 YAML 配置的技能脚本
|
// 转换单个插件为 YAML 配置的技能脚本
|
||||||
|
|
||||||
import path from "path";
|
import path from 'path';
|
||||||
import fs from "fs";
|
import fs from 'fs';
|
||||||
import { pathToFileURL } from "node:url";
|
import { pathToFileURL } from 'node:url';
|
||||||
import * as yaml from "js-yaml";
|
import * as yaml from 'js-yaml';
|
||||||
import { AbstractTaskPlugin, BaseAccess, BaseNotification} from "@certd/pipeline";
|
import { AbstractTaskPlugin, BaseAccess, BaseNotification } from '@certd/pipeline';
|
||||||
import { BaseAddon} from "@certd/lib-server";
|
import { BaseAddon } from '@certd/lib-server';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查对象是否是指定类的原型
|
* 检查对象是否是指定类的原型
|
||||||
@@ -38,18 +38,18 @@ async function convertSinglePlugin(pluginPath) {
|
|||||||
// 加载插件模块
|
// 加载插件模块
|
||||||
const module = await loadSingleModule(pluginPath);
|
const module = await loadSingleModule(pluginPath);
|
||||||
if (!module) {
|
if (!module) {
|
||||||
console.error("加载插件失败,退出");
|
console.error('加载插件失败,退出');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理模块中的所有导出
|
// 处理模块中的所有导出
|
||||||
const entry = Object.entries(module);
|
const entry = Object.entries(module);
|
||||||
if (entry.length === 0) {
|
if (entry.length === 0) {
|
||||||
console.error("插件模块没有导出任何内容");
|
console.error('插件模块没有导出任何内容');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`插件模块导出了 ${entry.length} 个对象: ${entry.map(([name]) => name).join(", ")}`);
|
console.log(`插件模块导出了 ${entry.length} 个对象: ${entry.map(([name]) => name).join(', ')}`);
|
||||||
|
|
||||||
// 处理每个导出的对象
|
// 处理每个导出的对象
|
||||||
for (const [name, value] of entry) {
|
for (const [name, value] of entry) {
|
||||||
@@ -63,33 +63,33 @@ async function convertSinglePlugin(pluginPath) {
|
|||||||
|
|
||||||
// 构建插件定义
|
// 构建插件定义
|
||||||
const pluginDefine = {
|
const pluginDefine = {
|
||||||
...value.define
|
...value.define,
|
||||||
};
|
};
|
||||||
|
|
||||||
let subType = "";
|
let subType = '';
|
||||||
|
|
||||||
// 确定插件类型
|
// 确定插件类型
|
||||||
if (pluginDefine.accessType) {
|
if (pluginDefine.accessType) {
|
||||||
pluginDefine.pluginType = "dnsProvider";
|
pluginDefine.pluginType = 'dnsProvider';
|
||||||
} else if (isPrototypeOf(value, AbstractTaskPlugin)) {
|
} else if (isPrototypeOf(value, AbstractTaskPlugin)) {
|
||||||
pluginDefine.pluginType = "deploy";
|
pluginDefine.pluginType = 'deploy';
|
||||||
} else if (isPrototypeOf(value, BaseNotification)) {
|
} else if (isPrototypeOf(value, BaseNotification)) {
|
||||||
pluginDefine.pluginType = "notification";
|
pluginDefine.pluginType = 'notification';
|
||||||
} else if (isPrototypeOf(value, BaseAccess)) {
|
} else if (isPrototypeOf(value, BaseAccess)) {
|
||||||
pluginDefine.pluginType = "access";
|
pluginDefine.pluginType = 'access';
|
||||||
} else if (isPrototypeOf(value, BaseAddon)) {
|
} else if (isPrototypeOf(value, BaseAddon)) {
|
||||||
pluginDefine.pluginType = "addon";
|
pluginDefine.pluginType = 'addon';
|
||||||
subType = "_" + (pluginDefine.addonType || "");
|
subType = '_' + (pluginDefine.addonType || '');
|
||||||
} else {
|
} else {
|
||||||
console.log(`[warning] 未知的插件类型:${pluginDefine.name}`);
|
console.log(`[warning] 未知的插件类型:${pluginDefine.name}`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginDefine.type = "builtIn";
|
pluginDefine.type = 'builtIn';
|
||||||
|
|
||||||
// 计算脚本文件路径
|
// 计算脚本文件路径
|
||||||
const relativePath = path.relative(process.cwd(), pluginPath);
|
const relativePath = path.relative(process.cwd(), pluginPath);
|
||||||
const scriptFilePath = relativePath.replace(/\\/g, "/").replace(/\.js$/, ".js");
|
const scriptFilePath = relativePath.replace(/\\/g, '/').replace(/\.js$/, '.js');
|
||||||
pluginDefine.scriptFilePath = scriptFilePath;
|
pluginDefine.scriptFilePath = scriptFilePath;
|
||||||
|
|
||||||
console.log(`插件类型: ${pluginDefine.pluginType}`);
|
console.log(`插件类型: ${pluginDefine.pluginType}`);
|
||||||
@@ -97,11 +97,11 @@ async function convertSinglePlugin(pluginPath) {
|
|||||||
|
|
||||||
// 生成 YAML 配置
|
// 生成 YAML 配置
|
||||||
const yamlContent = yaml.dump(pluginDefine);
|
const yamlContent = yaml.dump(pluginDefine);
|
||||||
console.log("\n生成的 YAML 配置:");
|
console.log('\n生成的 YAML 配置:');
|
||||||
console.log(yamlContent);
|
console.log(yamlContent);
|
||||||
|
|
||||||
// 可选:保存到文件
|
// 可选:保存到文件
|
||||||
const outputDir = "./metadata";
|
const outputDir = './metadata';
|
||||||
if (!fs.existsSync(outputDir)) {
|
if (!fs.existsSync(outputDir)) {
|
||||||
fs.mkdirSync(outputDir, { recursive: true });
|
fs.mkdirSync(outputDir, { recursive: true });
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ async function convertSinglePlugin(pluginPath) {
|
|||||||
return pluginDefine;
|
return pluginDefine;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.error("未找到有效的插件定义");
|
console.error('未找到有效的插件定义');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -125,8 +125,8 @@ async function main() {
|
|||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
|
|
||||||
if (args.length === 0) {
|
if (args.length === 0) {
|
||||||
console.error("请指定插件文件路径");
|
console.error('请指定插件文件路径');
|
||||||
console.log("用法: node convert-plugin-to-yaml.js <插件文件路径>");
|
console.log('用法: node convert-plugin-to-yaml.js <插件文件路径>');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,9 +139,9 @@ async function main() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await convertSinglePlugin(pluginPath);
|
await convertSinglePlugin(pluginPath);
|
||||||
console.log("\n插件转换完成!");
|
console.log('\n插件转换完成!');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("转换过程中出错:", error);
|
console.error('转换过程中出错:', error);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -152,9 +152,4 @@ if (import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 导出函数,以便其他模块使用
|
// 导出函数,以便其他模块使用
|
||||||
export {
|
export { convertSinglePlugin, loadSingleModule, isPrototypeOf };
|
||||||
convertSinglePlugin,
|
|
||||||
loadSingleModule,
|
|
||||||
isPrototypeOf
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,15 @@ version: 1.0.0
|
|||||||
# Task 插件开发技能
|
# Task 插件开发技能
|
||||||
|
|
||||||
## 角色定义
|
## 角色定义
|
||||||
|
|
||||||
你是一名 Certd 插件开发专家,擅长创建和实现 Task 类型的插件,熟悉 TypeScript 编程和 Certd 插件开发规范。
|
你是一名 Certd 插件开发专家,擅长创建和实现 Task 类型的插件,熟悉 TypeScript 编程和 Certd 插件开发规范。
|
||||||
|
|
||||||
## 核心指令
|
## 核心指令
|
||||||
|
|
||||||
请严格按照以下步骤执行任务:
|
请严格按照以下步骤执行任务:
|
||||||
|
|
||||||
1. **导入必要的依赖**
|
1. **导入必要的依赖**
|
||||||
|
|
||||||
- 导入 `AbstractTaskPlugin`, `IsTaskPlugin`, `PageSearch`, `pluginGroups`, `RunStrategy`, `TaskInput` 等必要的类型和装饰器
|
- 导入 `AbstractTaskPlugin`, `IsTaskPlugin`, `PageSearch`, `pluginGroups`, `RunStrategy`, `TaskInput` 等必要的类型和装饰器
|
||||||
- 导入 `CertInfo`, `CertReader` 等证书相关类型
|
- 导入 `CertInfo`, `CertReader` 等证书相关类型
|
||||||
- 导入 `createCertDomainGetterInputDefine`, `createRemoteSelectInputDefine` 等工具函数
|
- 导入 `createCertDomainGetterInputDefine`, `createRemoteSelectInputDefine` 等工具函数
|
||||||
@@ -20,22 +23,26 @@ version: 1.0.0
|
|||||||
- 导入 `CertApplyPluginNames` 等常量
|
- 导入 `CertApplyPluginNames` 等常量
|
||||||
|
|
||||||
2. **使用 @IsTaskPlugin 注解注册插件**
|
2. **使用 @IsTaskPlugin 注解注册插件**
|
||||||
|
|
||||||
- 配置插件的唯一标识、标题、图标
|
- 配置插件的唯一标识、标题、图标
|
||||||
- 设置插件分组
|
- 设置插件分组
|
||||||
- 配置默认策略(如 `SkipWhenSucceed`)
|
- 配置默认策略(如 `SkipWhenSucceed`)
|
||||||
- 确保类名与插件名称一致
|
- 确保类名与插件名称一致
|
||||||
|
|
||||||
3. **定义任务输入参数**
|
3. **定义任务输入参数**
|
||||||
|
|
||||||
- 使用 `@TaskInput` 注解定义各种输入参数
|
- 使用 `@TaskInput` 注解定义各种输入参数
|
||||||
- 必须包含证书选择参数,用于获取前置任务输出的域名证书
|
- 必须包含证书选择参数,用于获取前置任务输出的域名证书
|
||||||
- 可以添加授权选择框、文本输入、选择框等参数
|
- 可以添加授权选择框、文本输入、选择框等参数
|
||||||
- 使用 `createCertDomainGetterInputDefine` 获取证书域名列表
|
- 使用 `createCertDomainGetterInputDefine` 获取证书域名列表
|
||||||
|
|
||||||
4. **实现动态显隐配置**
|
4. **实现动态显隐配置**
|
||||||
|
|
||||||
- 使用 `mergeScript` 实现根据其他输入值动态控制输入项的显隐状态
|
- 使用 `mergeScript` 实现根据其他输入值动态控制输入项的显隐状态
|
||||||
- 利用 `ctx.compute` 函数访问表单中的其他字段值
|
- 利用 `ctx.compute` 函数访问表单中的其他字段值
|
||||||
|
|
||||||
5. **实现插件方法**
|
5. **实现插件方法**
|
||||||
|
|
||||||
- **onInstance 方法**:插件实例化时执行的初始化操作
|
- **onInstance 方法**:插件实例化时执行的初始化操作
|
||||||
- **execute 方法**:插件的核心执行逻辑
|
- **execute 方法**:插件的核心执行逻辑
|
||||||
- 获取授权信息
|
- 获取授权信息
|
||||||
@@ -55,6 +62,7 @@ version: 1.0.0
|
|||||||
- 授权获取:使用 `this.getAccess(accessId)` 获取授权信息
|
- 授权获取:使用 `this.getAccess(accessId)` 获取授权信息
|
||||||
|
|
||||||
## 输出规范
|
## 输出规范
|
||||||
|
|
||||||
- 必须包含完整的插件实现代码
|
- 必须包含完整的插件实现代码
|
||||||
- 代码必须包含详细的注释说明
|
- 代码必须包含详细的注释说明
|
||||||
- 提供完整的示例代码,展示插件的使用方法
|
- 提供完整的示例代码,展示插件的使用方法
|
||||||
@@ -65,6 +73,7 @@ version: 1.0.0
|
|||||||
### 示例 1: 基本 Task 插件
|
### 示例 1: 基本 Task 插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
创建一个 Task 插件,用于将证书部署到对应的应用上。
|
创建一个 Task 插件,用于将证书部署到对应的应用上。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -74,7 +83,7 @@ import { AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy
|
|||||||
import { CertInfo, CertReader } from '@certd/plugin-cert';
|
import { CertInfo, CertReader } from '@certd/plugin-cert';
|
||||||
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
|
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
|
||||||
import { optionsUtils } from '@certd/basic';
|
import { optionsUtils } from '@certd/basic';
|
||||||
import { CertApplyPluginNames} from '@certd/plugin-cert';
|
import { CertApplyPluginNames } from '@certd/plugin-cert';
|
||||||
|
|
||||||
@IsTaskPlugin({
|
@IsTaskPlugin({
|
||||||
//命名规范,插件类型+功能,大写字母开头,驼峰命名
|
//命名规范,插件类型+功能,大写字母开头,驼峰命名
|
||||||
@@ -281,6 +290,7 @@ export class DemoTest extends AbstractTaskPlugin {
|
|||||||
### 示例 2: Nginx 部署 Task 插件
|
### 示例 2: Nginx 部署 Task 插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
创建一个 Task 插件,用于将证书部署到 Nginx 服务器上。
|
创建一个 Task 插件,用于将证书部署到 Nginx 服务器上。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -459,6 +469,7 @@ new NginxDeploy();
|
|||||||
### 示例 3: 阿里云 OSS 部署 Task 插件
|
### 示例 3: 阿里云 OSS 部署 Task 插件
|
||||||
|
|
||||||
#### 用户输入
|
#### 用户输入
|
||||||
|
|
||||||
创建一个 Task 插件,用于将证书部署到阿里云 OSS 上。
|
创建一个 Task 插件,用于将证书部署到阿里云 OSS 上。
|
||||||
|
|
||||||
#### 你的回答
|
#### 你的回答
|
||||||
@@ -628,6 +639,7 @@ new AliyunOSSDeploy();
|
|||||||
## 部署逻辑注意事项
|
## 部署逻辑注意事项
|
||||||
|
|
||||||
1. **部署接口逻辑**:
|
1. **部署接口逻辑**:
|
||||||
|
|
||||||
- 研究应用的部署接口逻辑,一般有两种:
|
- 研究应用的部署接口逻辑,一般有两种:
|
||||||
a. 用户选择网站ID,给网站部署新证书
|
a. 用户选择网站ID,给网站部署新证书
|
||||||
b. 用户选择证书ID,只需要更新证书即可
|
b. 用户选择证书ID,只需要更新证书即可
|
||||||
@@ -635,6 +647,7 @@ new AliyunOSSDeploy();
|
|||||||
- 确保出错后重新运行能够回归到正常状态
|
- 确保出错后重新运行能够回归到正常状态
|
||||||
|
|
||||||
2. **前置证书选择**:
|
2. **前置证书选择**:
|
||||||
|
|
||||||
- 前置证书可以是原始的 `certInfo` 类型,也可能是上传到平台之后返回的证书id
|
- 前置证书可以是原始的 `certInfo` 类型,也可能是上传到平台之后返回的证书id
|
||||||
- 根据接口要求选择合适的证书类型:
|
- 根据接口要求选择合适的证书类型:
|
||||||
a. 如果接口需要上传后的证书id,那么部署时要先将证书上传,再部署
|
a. 如果接口需要上传后的证书id,那么部署时要先将证书上传,再部署
|
||||||
@@ -643,4 +656,7 @@ new AliyunOSSDeploy();
|
|||||||
|
|
||||||
3. **证书清理**:
|
3. **证书清理**:
|
||||||
- 如果是先上传再部署的,那么在部署完成后,可能需要考虑清理证书
|
- 如果是先上传再部署的,那么在部署完成后,可能需要考虑清理证书
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -9,7 +9,7 @@ import { AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy
|
|||||||
import { CertInfo, CertReader } from '@certd/plugin-cert';
|
import { CertInfo, CertReader } from '@certd/plugin-cert';
|
||||||
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
|
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
|
||||||
import { optionsUtils } from '@certd/basic';
|
import { optionsUtils } from '@certd/basic';
|
||||||
import { CertApplyPluginNames} from '@certd/plugin-cert';
|
import { CertApplyPluginNames } from '@certd/plugin-cert';
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. 使用 @IsTaskPlugin 注解注册插件
|
### 2. 使用 @IsTaskPlugin 注解注册插件
|
||||||
|
|||||||
Vendored
+97
-101
@@ -1,103 +1,99 @@
|
|||||||
{
|
{
|
||||||
// 使用 IntelliSense 了解相关属性。
|
// 使用 IntelliSense 了解相关属性。
|
||||||
// 悬停以查看现有属性的描述。
|
// 悬停以查看现有属性的描述。
|
||||||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
{
|
||||||
{
|
"name": "client",
|
||||||
"name": "client",
|
"type": "node",
|
||||||
"type": "node",
|
"request": "launch",
|
||||||
"request": "launch",
|
"cwd": "${workspaceFolder}/packages/ui/certd-client",
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-client",
|
"runtimeExecutable": "pnpm",
|
||||||
"runtimeExecutable": "pnpm",
|
"runtimeArgs": ["dev"],
|
||||||
"runtimeArgs": ["dev"],
|
"console": "integratedTerminal",
|
||||||
"console": "integratedTerminal",
|
"internalConsoleOptions": "neverOpen"
|
||||||
"internalConsoleOptions": "neverOpen"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "server",
|
||||||
"name": "server",
|
"type": "node",
|
||||||
"type": "node",
|
"request": "launch",
|
||||||
"request": "launch",
|
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
"runtimeExecutable": "pnpm",
|
||||||
"runtimeExecutable": "pnpm",
|
"runtimeArgs": ["dev"],
|
||||||
"runtimeArgs": ["dev"],
|
"console": "integratedTerminal",
|
||||||
"console": "integratedTerminal",
|
"internalConsoleOptions": "neverOpen"
|
||||||
"internalConsoleOptions": "neverOpen"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "server-mysql",
|
||||||
"name": "server-mysql",
|
"type": "node",
|
||||||
"type": "node",
|
"request": "launch",
|
||||||
"request": "launch",
|
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
"runtimeExecutable": "pnpm",
|
||||||
"runtimeExecutable": "pnpm",
|
"runtimeArgs": ["dev-mysql"],
|
||||||
"runtimeArgs": ["dev-mysql"],
|
"console": "integratedTerminal",
|
||||||
"console": "integratedTerminal",
|
"internalConsoleOptions": "neverOpen"
|
||||||
"internalConsoleOptions": "neverOpen"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "server-pg",
|
||||||
"name": "server-pg",
|
"type": "node",
|
||||||
"type": "node",
|
"request": "launch",
|
||||||
"request": "launch",
|
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
"runtimeExecutable": "pnpm",
|
||||||
"runtimeExecutable": "pnpm",
|
"runtimeArgs": ["dev-pg"],
|
||||||
"runtimeArgs": ["dev-pg"],
|
"console": "integratedTerminal",
|
||||||
"console": "integratedTerminal",
|
"internalConsoleOptions": "neverOpen"
|
||||||
"internalConsoleOptions": "neverOpen"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "server-pgpl",
|
||||||
"name": "server-pgpl",
|
"type": "node",
|
||||||
"type": "node",
|
"request": "launch",
|
||||||
"request": "launch",
|
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
"runtimeExecutable": "pnpm",
|
||||||
"runtimeExecutable": "pnpm",
|
"runtimeArgs": ["dev-pgpl"],
|
||||||
"runtimeArgs": ["dev-pgpl"],
|
"console": "integratedTerminal",
|
||||||
"console": "integratedTerminal",
|
"internalConsoleOptions": "neverOpen"
|
||||||
"internalConsoleOptions": "neverOpen"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "server-common",
|
||||||
"name": "server-common",
|
"type": "node",
|
||||||
"type": "node",
|
"request": "launch",
|
||||||
"request": "launch",
|
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
"runtimeExecutable": "pnpm",
|
||||||
"runtimeExecutable": "pnpm",
|
"runtimeArgs": ["dev-commpro"],
|
||||||
"runtimeArgs": ["dev-commpro"],
|
"console": "integratedTerminal",
|
||||||
"console": "integratedTerminal",
|
"internalConsoleOptions": "neverOpen"
|
||||||
"internalConsoleOptions": "neverOpen"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "server-new",
|
||||||
"name": "server-new",
|
"type": "node",
|
||||||
"type": "node",
|
"request": "launch",
|
||||||
"request": "launch",
|
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
"runtimeExecutable": "pnpm",
|
||||||
"runtimeExecutable": "pnpm",
|
"runtimeArgs": ["dev-new"],
|
||||||
"runtimeArgs": ["dev-new"],
|
"console": "integratedTerminal",
|
||||||
"console": "integratedTerminal",
|
"internalConsoleOptions": "neverOpen"
|
||||||
"internalConsoleOptions": "neverOpen"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "server-local-plus",
|
||||||
"name": "server-local-plus",
|
"type": "node",
|
||||||
"type": "node",
|
"request": "launch",
|
||||||
"request": "launch",
|
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-server",
|
"runtimeExecutable": "npm",
|
||||||
"runtimeExecutable": "npm",
|
"runtimeArgs": ["run", "dev-localplus"],
|
||||||
"runtimeArgs": ["run", "dev-localplus"],
|
"console": "integratedTerminal",
|
||||||
"console": "integratedTerminal",
|
"internalConsoleOptions": "neverOpen",
|
||||||
"internalConsoleOptions": "neverOpen",
|
"env": {
|
||||||
"env": {
|
"plus_use_prod": "false",
|
||||||
"plus_use_prod": "false",
|
"PLUS_SERVER_BASE_URL": "http://127.0.0.1:11007"
|
||||||
"PLUS_SERVER_BASE_URL": "http://127.0.0.1:11007"
|
}
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
],
|
"compounds": [
|
||||||
"compounds": [
|
{
|
||||||
{
|
"name": "all",
|
||||||
"name": "all",
|
"configurations": ["server", "client"],
|
||||||
"configurations": [
|
"stopAll": false
|
||||||
"server",
|
}
|
||||||
"client",
|
]
|
||||||
],
|
|
||||||
"stopAll": false
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
Vendored
+21
-23
@@ -1,25 +1,23 @@
|
|||||||
{
|
{
|
||||||
"eslint.debug": false,
|
"eslint.debug": false,
|
||||||
"eslint.format.enable": true,
|
"eslint.format.enable": true,
|
||||||
"typescript.tsc.autoDetect": "watch",
|
"typescript.tsc.autoDetect": "watch",
|
||||||
"git.scanRepositories": [
|
"git.scanRepositories": ["./packages/pro"],
|
||||||
"./packages/pro"
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||||
],
|
"[typescript]": {
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||||
"[typescript]": {
|
},
|
||||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
"editor.tabSize": 2,
|
||||||
},
|
"explorer.autoReveal": false,
|
||||||
"editor.tabSize": 2,
|
"[javascript]": {
|
||||||
"explorer.autoReveal": false,
|
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||||
"[javascript]": {
|
},
|
||||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
"[less]": {
|
||||||
},
|
"editor.defaultFormatter": "vscode.css-language-features"
|
||||||
"[less]": {
|
},
|
||||||
"editor.defaultFormatter": "vscode.css-language-features"
|
"scm.repositories.visible": 9,
|
||||||
},
|
"scm.repositories.explorer": false,
|
||||||
"scm.repositories.visible": 9,
|
"scm.repositories.selectionMode": "multiple",
|
||||||
"scm.repositories.explorer": false,
|
"scm.repositories.sortOrder": "discovery time",
|
||||||
"scm.repositories.selectionMode": "multiple",
|
"git.ignoreLimitWarning": true
|
||||||
"scm.repositories.sortOrder": "discovery time",
|
|
||||||
"git.ignoreLimitWarning": true
|
|
||||||
}
|
}
|
||||||
Vendored
+50
-50
@@ -1,52 +1,52 @@
|
|||||||
{
|
{
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"label": "启动Client",
|
"label": "启动Client",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm",
|
"command": "npm",
|
||||||
"args": ["run", "dev"],
|
"args": ["run", "dev"],
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-client"
|
"cwd": "${workspaceFolder}/packages/ui/certd-client"
|
||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"kind": "build",
|
"kind": "build",
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
},
|
},
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
"reveal": "always",
|
"reveal": "always",
|
||||||
"focus": false,
|
"focus": false,
|
||||||
"panel": "shared"
|
"panel": "shared"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "启动Server",
|
"label": "启动Server",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm",
|
"command": "npm",
|
||||||
"args": ["run", "dev"],
|
"args": ["run", "dev"],
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}/packages/ui/certd-server"
|
"cwd": "${workspaceFolder}/packages/ui/certd-server"
|
||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"kind": "build",
|
"kind": "build",
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
},
|
},
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
"reveal": "always",
|
"reveal": "always",
|
||||||
"focus": false,
|
"focus": false,
|
||||||
"panel": "shared"
|
"panel": "shared"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "同时启动Client和Server",
|
"label": "同时启动Client和Server",
|
||||||
"dependsOn": ["启动Client", "启动Server"],
|
"dependsOn": ["启动Client", "启动Server"],
|
||||||
"group": {
|
"group": {
|
||||||
"kind": "build",
|
"kind": "build",
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
},
|
},
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,223 +1,71 @@
|
|||||||
# Certd 开发 Agent 上下文
|
# Certd 开发 Agent 上下文
|
||||||
|
|
||||||
这个文件是给在本仓库工作的开发 agent 看的常驻项目说明。后续会话进入仓库后,应先读取它,再按任务需要查看具体代码,避免每次都重新全量扫描项目。
|
这个文件是给在本仓库工作的开发 agent 看的常驻项目说明。进入仓库后先读本文,再按任务读取对应导航或规则文件,避免每次重新全量扫描项目。
|
||||||
|
|
||||||
## 项目用途
|
仓库代码导航、目录地图、常用入口和参考文件见 `.codex/repo-map.md`。更细的开发规则拆在 `.codex/agent-rules/` 下;本文只保留最高优先级的规则、架构边界和工作方式。
|
||||||
|
|
||||||
Certd 是一个支持私有化部署的 SSL/TLS 证书自动化管理平台。它提供 Web 管理台和后端服务,用于证书申请、续期、部署、监控、通知和开放 API 集成。
|
## 项目定位
|
||||||
|
|
||||||
它不只是一个简单的 ACME 客户端。项目的核心产品模型是“证书流水线”:
|
Certd 是支持私有化部署的 SSL/TLS 证书自动化管理平台,提供 Web 管理台和后端服务,用于证书申请、续期、部署、监控、通知和开放 API 集成。
|
||||||
|
|
||||||
|
核心产品模型是“证书流水线”:
|
||||||
|
|
||||||
- 通过 ACME 申请证书
|
- 通过 ACME 申请证书
|
||||||
- 支持 DNS-01、HTTP-01、CNAME 代理以及各类服务商集成来完成域名验证
|
- 使用 DNS-01、HTTP-01、CNAME 代理或服务商集成完成域名验证
|
||||||
- 支持将证书转换或导出为 pem、pfx、der、jks、p7b 等格式
|
- 将证书转换或导出为 pem、pfx、der、jks、p7b 等格式
|
||||||
- 支持把证书部署到主机、Nginx、Kubernetes、CDN、云厂商、面板等目标
|
- 部署证书到主机、Nginx、Kubernetes、CDN、云厂商、面板等目标
|
||||||
- 支持通知用户,并监控站点证书过期时间
|
- 通知用户,并监控站点证书过期时间
|
||||||
|
|
||||||
由于系统会保存证书、云厂商凭据、SSH 信息、API Key 等敏感数据,产品定位上强烈建议私有化/本地部署。
|
系统会保存证书、云厂商凭据、SSH 信息、API Key 等敏感数据,始终按私有化/本地部署产品处理,避免泄露本地数据和配置。
|
||||||
|
|
||||||
## 仓库结构
|
## 必读索引
|
||||||
|
|
||||||
这是一个 pnpm + lerna 的 monorepo。
|
- `.codex/repo-map.md`:仓库结构、后端/前端入口、流水线与插件地图、验证命令
|
||||||
|
- `.codex/agent-rules/backend.md`:后端、数据库迁移、文件上传、service/事务约定
|
||||||
|
- `.codex/agent-rules/frontend.md`:前端、Fast Crud、弹窗表单、格式化和禁跑命令
|
||||||
|
- `.codex/agent-rules/plugins.md`:流水线、插件归属、ACME/EAB、插件开发技能
|
||||||
|
- `.codex/agent-rules/testing.md`:测试优先策略、单测位置、ESM mock、聚焦验证
|
||||||
|
- `.codex/agent-rules/coding-style.md`:注释、可读性、DRY、单一职责等通用代码风格
|
||||||
|
|
||||||
- `package.json`:根脚本和 workspace 元信息
|
## 仓库边界
|
||||||
- `pnpm-workspace.yaml`:workspace 包匹配规则
|
|
||||||
- `lerna.json`:lerna-lite 配置
|
|
||||||
- `docs/`:VitePress 文档站
|
|
||||||
- `docker/`:Docker 安装和运行相关文件
|
|
||||||
- `packages/core/acme-client/`:ACME 协议客户端,风格接近 node-acme-client
|
|
||||||
- `packages/core/basic/`:共享基础工具和基础设施
|
|
||||||
- `packages/core/pipeline/`:流水线核心、注册表、装饰器、插件模型、上下文、服务、通知等
|
|
||||||
- `packages/libs/`:共享集成与辅助库,例如 server、Huawei、JDCloud、Kubernetes、iframe
|
|
||||||
- `packages/plugins/plugin-lib/`:通用插件辅助能力和证书相关共享代码
|
|
||||||
- `packages/plugins/plugin-cert/`:证书流水线插件包
|
|
||||||
- `packages/pro/`:商业版/专业版相关包
|
|
||||||
- `packages/ui/certd-server/`:后端服务
|
|
||||||
- `packages/ui/certd-client/`:前端 Web 管理台
|
|
||||||
|
|
||||||
## 后端
|
这是一个 pnpm + lerna 的 monorepo。核心定位:
|
||||||
|
|
||||||
主要后端包:`packages/ui/certd-server`。
|
- `packages/ui/certd-server`:后端服务
|
||||||
|
- `packages/ui/certd-client`:前端 Web 管理台
|
||||||
|
- `packages/core/pipeline`:流水线核心
|
||||||
|
- `packages/core/acme-client`:ACME 协议客户端
|
||||||
|
- `packages/plugins/plugin-lib`:通用插件辅助能力和证书相关共享代码
|
||||||
|
|
||||||
技术栈:
|
`packages/pro/` 是独立 Git 工作区,使用 `packages/pro/.git` 管理。根仓库的 `git status` / `git diff` 默认看不到这里的实际改动;修改商业版代码后,要在 `packages/pro` 目录内单独执行 `git status` / `git diff` 检查。
|
||||||
|
|
||||||
- Node.js、ESM、TypeScript
|
## 硬性规则
|
||||||
- MidwayJS 3
|
|
||||||
- Koa
|
|
||||||
- TypeORM
|
|
||||||
- 默认使用 better-sqlite3,同时支持 PostgreSQL 和 MySQL
|
|
||||||
- 通过 `@certd/midway-flyway-js` 使用类似 Flyway 的 SQL 迁移机制
|
|
||||||
|
|
||||||
重要位置:
|
|
||||||
|
|
||||||
- `packages/ui/certd-server/src/config/config.default.ts`:默认服务、静态文件、数据库、定时任务、认证、上传、Swagger 配置
|
|
||||||
- `packages/ui/certd-server/src/config/`:环境与配置加载逻辑
|
|
||||||
- `packages/ui/certd-server/src/configuration.ts`:Midway 应用配置、中间件注册、组件导入
|
|
||||||
- `packages/ui/certd-server/src/modules/`:业务模块,例如 pipeline、cert、cron、monitor、login、open API、sys、plugin、cname、notification
|
|
||||||
- `packages/ui/certd-server/src/controller/`:按 API 领域划分的控制器
|
|
||||||
- `packages/ui/certd-server/src/plugins/`:后端内置的具体服务商、部署、通知等插件
|
|
||||||
- `packages/ui/certd-server/db/migration/`:数据库迁移 SQL
|
|
||||||
- `packages/ui/certd-server/data/`:本地运行数据,例如 SQLite 数据库和生成文件
|
|
||||||
- `packages/ui/certd-server/logs/`:运行日志
|
|
||||||
|
|
||||||
已观察到的默认开发配置:
|
|
||||||
|
|
||||||
- HTTP 端口:`7001`
|
|
||||||
- HTTPS 端口:`7002`
|
|
||||||
- 默认 SQLite 数据库:`./data/db.sqlite`
|
|
||||||
- 默认文件根目录:`./data/files`
|
|
||||||
|
|
||||||
常用脚本:
|
|
||||||
|
|
||||||
- 根目录 `pnpm run start:server`:以生产模式启动后端包
|
|
||||||
- 后端 `pnpm run dev`:启动 Midway watch/dev 服务
|
|
||||||
- 后端 `pnpm run test`:运行后端 mocha 测试
|
|
||||||
- 后端 `pnpm run build`:构建后端并导出插件元数据
|
|
||||||
|
|
||||||
## 前端
|
|
||||||
|
|
||||||
主要前端包:`packages/ui/certd-client`。
|
|
||||||
|
|
||||||
技术栈:
|
|
||||||
|
|
||||||
- Vue 3
|
|
||||||
- Vite
|
|
||||||
- TypeScript
|
|
||||||
- Ant Design Vue
|
|
||||||
- Fast Crud
|
|
||||||
- Pinia
|
|
||||||
- vue-router
|
|
||||||
- vue-i18n
|
|
||||||
- Tailwind/Windi 相关样式工具
|
|
||||||
|
|
||||||
重要位置:
|
|
||||||
|
|
||||||
- `packages/ui/certd-client/src/main.ts`:前端启动入口
|
|
||||||
- `packages/ui/certd-client/src/App.vue`:根组件
|
|
||||||
- `packages/ui/certd-client/src/api/`:API 调用封装
|
|
||||||
- `packages/ui/certd-client/src/router/`:路由
|
|
||||||
- `packages/ui/certd-client/src/store/`:Pinia store
|
|
||||||
- `packages/ui/certd-client/src/views/certd/`:核心产品页面,例如流水线、证书、授权、监控、通知、开放 API、项目、支付、插件
|
|
||||||
- `packages/ui/certd-client/src/components/`:共享 UI 组件
|
|
||||||
- `packages/ui/certd-client/src/locales/`:国际化
|
|
||||||
|
|
||||||
常用脚本:
|
|
||||||
|
|
||||||
- 前端 `pnpm dev`:启动 Vite 开发服务
|
|
||||||
- 前端 `pnpm build`:生产构建
|
|
||||||
- 不要运行前端 `pnpm tsc` / `vue-tsc`:当前依赖组合中 `vue-tsc@1.8.27` 会直接抛内部错误 `Search string not found: "/supportedTSExtensions = .*(?=;)/"`,不是有效的项目类型检查结果。
|
|
||||||
- 前端暂不跑单元测试;当前 `test:unit` 只是占位脚本
|
|
||||||
|
|
||||||
## 流水线与插件模型
|
|
||||||
|
|
||||||
项目最关键的架构概念是证书流水线。
|
|
||||||
|
|
||||||
可以从 `packages/core/pipeline/src/index.ts` 入手,它导出:
|
|
||||||
|
|
||||||
- `core`
|
|
||||||
- `dt`
|
|
||||||
- `access`
|
|
||||||
- `registry`
|
|
||||||
- `plugin`
|
|
||||||
- `context`
|
|
||||||
- `decorator`
|
|
||||||
- `service`
|
|
||||||
- `notification`
|
|
||||||
|
|
||||||
插件是核心能力,不是边缘功能。新增服务商、DNS 验证、证书部署、通知方式等能力,通常应该放在插件包里,或放在 `packages/ui/certd-server/src/plugins/<plugin-name>/` 下。
|
|
||||||
|
|
||||||
后端已看到的插件类型包括:
|
|
||||||
|
|
||||||
- DNS 和注册商服务商:Aliyun、Tencent、Cloudflare、Huawei、JDCloud、AWS、Azure、Google、GoDaddy、Namesilo、Xinnet、West、UCloud、Qiniu、Upyun、Volcengine 等
|
|
||||||
- 部署目标:host、Kubernetes、Nginx Proxy Manager、APISIX、Proxmox、QNAP、Dokploy、GoEdge、各类 CDN、各类面板
|
|
||||||
- 系统/产品插件:notification、captcha、oauth、admin、plus/pro、demo/template
|
|
||||||
|
|
||||||
当修改证书申请、验证、部署或通知行为时,先判断改动属于哪里:
|
|
||||||
|
|
||||||
- ACME client 代码
|
|
||||||
- pipeline 核心抽象
|
|
||||||
- 后端 module/service/entity/controller
|
|
||||||
- 某个具体插件实现
|
|
||||||
- 前端 view/form/schema
|
|
||||||
|
|
||||||
如果只是某个服务商或部署目标的问题,不要轻易修改共享 pipeline/core 行为,除非确实是可复用的公共能力。
|
|
||||||
|
|
||||||
### ACME / EAB 注意事项
|
|
||||||
|
|
||||||
- 公共 EAB(尤其是 Google EAB)可能只能创建一次 ACME 账号。要跨用户复用公共 EAB,应保存并复用同一个 ACME account private key;`accountUrl` 如果存到 `userContext` 里,只能视为当前用户缓存,因为 `userContext` 跟用户 id 走。
|
|
||||||
- ACME 协议的 `newAccount` 支持 `onlyReturnExisting`。使用同一个 account private key 调用 `newAccount({ onlyReturnExisting: true })` 可以取回已创建账号的 URL,且不会再次消费 EAB。
|
|
||||||
- 修改 EAB 的 `kid` 后,应重新生成绑定该 `kid` 的 account private key;否则应阻止继续申请并提示用户刷新账号私钥。
|
|
||||||
|
|
||||||
## 数据与迁移
|
|
||||||
|
|
||||||
后端使用 TypeORM 实体加 SQL 迁移。
|
|
||||||
|
|
||||||
重点查看:
|
|
||||||
|
|
||||||
- `packages/ui/certd-server/src/modules/**/entity/*.ts`
|
|
||||||
- `packages/ui/certd-server/db/migration/*.sql`
|
|
||||||
|
|
||||||
默认配置中 `synchronize: false`,所以涉及表结构变更时,通常应该添加或更新迁移脚本,而不是依赖 TypeORM 自动同步。
|
|
||||||
|
|
||||||
## 开发注意事项
|
|
||||||
|
|
||||||
- 中文 README 在部分 PowerShell 环境中可能显示乱码;`README_en.md` 可读性更好,且包含同样的高层项目说明。
|
|
||||||
- 初次整理时观察到当前分支为 `v2-dev`。
|
|
||||||
- 根包管理器是 pnpm,不要引入 npm/yarn lockfile。
|
- 根包管理器是 pnpm,不要引入 npm/yarn lockfile。
|
||||||
- 优先沿用现有模块、插件、服务模式,再考虑新增抽象。
|
- 不要主动运行 `pnpm install`;用户会事先准备好 `node_modules`。如果 `pnpm install` 或测试因缺少依赖、TTY、网络问题失败,停止尝试并告知用户环境问题。
|
||||||
- `packages/ui/certd-server/data/`、`logs/`、生成的 metadata/dist 等通常视为运行时或构建产物,除非任务明确要求处理它们。
|
- 前端不要运行 `pnpm tsc` / `vue-tsc`;当前依赖组合中 `vue-tsc@1.8.27` 会抛无效内部错误。前端 `test:unit` 只是占位脚本。
|
||||||
- 注意本地数据和配置里可能包含凭据、证书材料等敏感信息。
|
- 不要把 `packages/ui/certd-server/data/`、`logs/`、生成的 metadata/dist 等运行时或构建产物纳入改动,除非任务明确要求。
|
||||||
- 本仓库代码注释优先使用中文,尤其是解释业务规则、兼容逻辑、协议细节和隐藏风险时;除非文件已有明确英文注释风格或引用外部英文术语,否则不要新增英文说明性注释。
|
- 做数据库结构变更时,添加或更新迁移脚本,不要依赖 TypeORM 自动同步。
|
||||||
|
- 做插件相关任务时,先读取对应 `.trae/skills/<skill>/SKILL.md`,再进入具体实现。
|
||||||
|
- 后端 service 拼接可选 `projectId` 查询条件时,不要直接写 `{ userId, projectId }`;应使用 `BaseService.buildUserProjectQuery(userId, projectId)`,只有 `projectId != null` 时才加入查询条件。
|
||||||
|
|
||||||
## 插件开发技能
|
## 工作方式
|
||||||
|
|
||||||
仓库内置了 Certd 插件开发技能,供 Trae 和 Codex 共用:
|
- 先读本文;需要代码导航、目录入口、参考文件或验证命令时读 `.codex/repo-map.md`。
|
||||||
|
- 任务涉及后端、前端、插件、测试或代码风格时,先读取 `.codex/agent-rules/` 下对应规则文件,再查看具体代码。
|
||||||
- Trae 入口:`.trae/skills`
|
- 在 PowerShell 中读取中文、Markdown、locale、文档类文件时,显式使用 `Get-Content -Encoding utf8`;如果仍乱码,再执行 `[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()` 后重试。
|
||||||
- Codex 入口:`.codex/skills`
|
|
||||||
|
|
||||||
其中 `.codex/skills` 是指向 `.trae/skills` 的目录链接,不要复制出第二份技能内容。更新技能时只维护 `.trae/skills` 下的原始文件,Codex 会通过 `.codex/skills` 读取同一份内容。
|
|
||||||
|
|
||||||
当前技能包括:
|
|
||||||
|
|
||||||
- `access-plugin-dev`:开发 Access 授权插件
|
|
||||||
- `dns-provider-dev`:开发 DNS Provider 插件
|
|
||||||
- `task-plugin-dev`:开发 Task 部署任务插件
|
|
||||||
- `plugin-converter`:将插件转换为 YAML 配置
|
|
||||||
|
|
||||||
做插件相关任务时,先读取对应技能目录下的 `SKILL.md`,再进入具体实现。若用户在插件开发中指出更好的做法,应总结并更新对应技能。
|
|
||||||
|
|
||||||
## 快速定向命令
|
|
||||||
|
|
||||||
进入项目后,优先使用这些有目标的读取命令,而不是立刻全仓库扫描:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
Get-Content -Encoding utf8 package.json
|
|
||||||
Get-Content -Encoding utf8 pnpm-workspace.yaml
|
|
||||||
Get-Content -Encoding utf8 lerna.json
|
|
||||||
Get-Content -Encoding utf8 README_en.md -TotalCount 180
|
|
||||||
Get-Content -Encoding utf8 packages\ui\certd-server\package.json
|
|
||||||
Get-Content -Encoding utf8 packages\ui\certd-client\package.json
|
|
||||||
Get-ChildItem packages\ui\certd-server\src\modules
|
|
||||||
Get-ChildItem packages\ui\certd-server\src\plugins
|
|
||||||
Get-ChildItem packages\ui\certd-client\src\views\certd
|
|
||||||
```
|
|
||||||
|
|
||||||
## 本仓库 Agent 工作方式
|
|
||||||
|
|
||||||
- 先读本文件,再按用户任务查看相关 package/module。
|
|
||||||
- 在 PowerShell 中读取中文、Markdown、locale、文档类文件时,显式使用 `Get-Content -Encoding utf8`;如果仍然显示乱码,再先执行 `[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()` 后重试。
|
|
||||||
- 做后端任务时,先定位 `packages/ui/certd-server/src/modules` 下的模块,以及相关 entity/service/controller。
|
- 做后端任务时,先定位 `packages/ui/certd-server/src/modules` 下的模块,以及相关 entity/service/controller。
|
||||||
- 做前端任务时,先定位 `packages/ui/certd-client/src/views/certd` 下的页面,再找对应 `src/api`。
|
- 做前端任务时,先定位 `packages/ui/certd-client/src/views/certd` 下的页面,再找对应 `src/api`。
|
||||||
- 做服务商、DNS、部署、通知相关任务时,先看 `packages/ui/certd-server/src/plugins`,再看 `packages/plugins/plugin-lib` 里的共享辅助能力。
|
- 做服务商、DNS、部署、通知相关任务时,先看 `packages/ui/certd-server/src/plugins`,再看 `packages/plugins/plugin-lib` 里的共享辅助能力。
|
||||||
- 做数据库结构变更时,添加或更新迁移脚本,不要依赖 TypeORM 自动同步。
|
- 优先沿用现有模块、插件、服务模式,再考虑新增抽象;避免为了形式上的“复用”制造过度设计。
|
||||||
- 实现新功能或修复行为缺陷前,先补对应单元测试,并先运行测试确认它处于失败状态;再实现功能或修复代码,反复运行聚焦单元测试直到通过。若某项改动确实不适合先写单元测试,应在回复中说明原因和替代验证方式。
|
- 实现新功能或修复行为缺陷前,优先补对应单元测试并确认红灯,再实现代码并跑聚焦验证。确实不适合先写测试时,在回复中说明原因和替代验证方式。
|
||||||
- 后补单元测试时,应先基于对正确行为的实际预期编写测试,而不是为了迎合现有实现改写预期;如果运行后出现红灯,且通过测试需要修改已有实现,应先向用户确认这是确实的 bug,还是原本需求/既有行为就是如此;确认后再修改原始实现,避免把测试补充变成未经确认的行为改动。
|
- 后补单元测试时,先按正确行为写预期;如果红灯需要修改既有实现,先向用户确认这是 bug 还是既有需求,避免未经确认改变行为。
|
||||||
- 后端纯单元测试用例放在 `src` 目录内,并尽量与被测文件相邻,例如 `src/utils/random.test.ts`;对应 `test:unit` 只跑 `src/**/*.test.ts`,构建/打包配置应排除这些 `*.test.ts` 文件。
|
- 优先对改动包运行聚焦测试或格式化/ESLint;只有跨包影响明显时再考虑更大范围构建。
|
||||||
- 单元测试需要 mock ESM 静态 import 时,优先使用 `esmock`,不要为了测试把业务代码改成构造函数注入或把逻辑挪到调用方;各包 `test:unit` 脚本应显式设置 `NODE_ENV=unittest`。
|
|
||||||
- 单个 monorepo 包运行单元测试时,优先使用 `corepack pnpm --dir <包目录> test:unit`,例如 `corepack pnpm --dir packages\ui\certd-server test:unit`、`corepack pnpm --dir packages\core\basic test:unit`、`corepack pnpm --dir packages\plugins\plugin-lib test:unit`;也可以用包名过滤,例如 `corepack pnpm --filter @certd/ui-server test:unit`。前端 `packages\ui\certd-client` 暂时不跑单元测试。
|
|
||||||
- 前端 TS/Vue/locale 等文件改动后,优先只对本次改动文件运行项目现有自动格式化/修复;Windows/PowerShell 下 Prettier 已验证可用命令为 `packages\ui\certd-client\node_modules\.bin\prettier.cmd --write <files>`,ESLint 可用命令为 `packages\ui\certd-client\node_modules\.bin\eslint.cmd --fix <files>`;不要运行 `vue-tsc` / `pnpm tsc`;不要为了格式化无关文件而扩大 diff。项目保留了 `tslint` 依赖,但当前主要使用 ESLint + Prettier。
|
|
||||||
- 优先对改动包运行聚焦的测试;后端可按包运行单元测试,前端优先使用 Prettier/ESLint 做改动文件验证。只有跨包影响明显时再考虑全 monorepo 构建。
|
|
||||||
|
|
||||||
- 不要主动运行 `pnpm install` 安装依赖:用户会事先准备好 `node_modules`。如果 `pnpm install` 或 `test:unit` 因缺少依赖、TTY 或网络问题失败,立即停止尝试,告知用户解决环境问题。
|
## 架构边界
|
||||||
|
|
||||||
|
插件是核心能力,不是边缘功能。新增服务商、DNS 验证、证书部署、通知方式等能力,通常应该放在插件包里,或放在 `packages/ui/certd-server/src/plugins/<plugin-name>/` 下。
|
||||||
|
|
||||||
|
修改证书申请、验证、部署或通知行为时,先判断改动属于 ACME client、pipeline 核心抽象、后端 module/service/entity/controller、具体插件实现,还是前端 view/form/schema。
|
||||||
|
|
||||||
|
如果只是某个服务商或部署目标的问题,不要轻易修改共享 pipeline/core 行为,除非确实是可复用的公共能力。
|
||||||
|
|||||||
@@ -3,6 +3,49 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 流水线、监控站点支持导出 ([99fd308](https://github.com/certd/certd/commit/99fd3083f259cdb96fd656f04858dd708d1251c7))
|
||||||
|
* 优化列表页面请求两次的问题 ([5546af5](https://github.com/certd/certd/commit/5546af518e92c765513787ccaf8e856be789bcf9))
|
||||||
|
* 优化邀请注册流程 ([7a71e45](https://github.com/certd/certd/commit/7a71e45799d782d0691606fb42b4236f1d3009b0))
|
||||||
|
* **settings:** 新增NO_PROXY代理排除配置 ([c0df8be](https://github.com/certd/certd/commit/c0df8be83237e323c2c9a5bd02507430a86a00cc))
|
||||||
|
* **volcengine-vke:** 火山VKE集群证书支持两种类型的证书保密字典 ([77b8024](https://github.com/certd/certd/commit/77b802445322d576d54d194f7c505da49e0e824c))
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([41254d1](https://github.com/certd/certd/commit/41254d10b748a2d3e6ba43c7e11411650c748d1b))
|
||||||
|
* **monitor:** 修复开放接口自动创建证书流水线重复触发和等待时间不足的问题 ([91d5c90](https://github.com/certd/certd/commit/91d5c90eb0eaf65c81dddbd2d4d4b404cb8b4d07))
|
||||||
|
* **pipeline:** 修复批量随机修改定时没有生效的bug ([2e19dda](https://github.com/certd/certd/commit/2e19dda72e70b525a7c269e18e963a5ee602f59f))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 商业版支持邀请返佣功能 ([f9a310b](https://github.com/certd/certd/commit/f9a310b6c3bbf30f221482a0c59e9c30080bdfc8))
|
||||||
|
* 商业版支持邀请推广功能 ([f1d2a10](https://github.com/certd/certd/commit/f1d2a1033a0f8d3dbd91fc9793e07bd0b858b539))
|
||||||
|
* 新增管理员针对用户流水线和证书监控管理功能 ([0211552](https://github.com/certd/certd/commit/021155278e7375f8487b0531ed1b5ad52512f007))
|
||||||
|
* 新增套餐激活码功能,通过CDK兑换套餐 ([81d6289](https://github.com/certd/certd/commit/81d6289a8631b073b49f24dee4b14bb1c8f31071))
|
||||||
|
* 新增推广等级激励功能 ([5096df5](https://github.com/certd/certd/commit/5096df5cc0d8f0ad8aa327b8e2a900ba23714bd8))
|
||||||
|
* 新增证书申请参数模版管理,开放接口支持使用证书参数模版和指定证书申请参数 ([f8b71a0](https://github.com/certd/certd/commit/f8b71a0e612fad527cf49136335e0b46f0f379cd))
|
||||||
|
* 支持dns-persist-01持久化验证方式申请证书,优化Acme账号的存储方式 ([67b05e2](https://github.com/certd/certd/commit/67b05e2d75e96b9f855e1ca0b3d0d8d03b92d8e6))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 插件全局配置支持下拉选项自定义映射功能 ([c637985](https://github.com/certd/certd/commit/c637985575b09196b04cce37ac14fbe68c029bde))
|
||||||
|
* 商业版提现增加收款二维码上传 ([83a5a21](https://github.com/certd/certd/commit/83a5a21f956e50942541f1532f3a8dcaa5821d34))
|
||||||
|
* **aliyun-apig:** 优化阿里云API网关部署插件的查询及翻页 ([3e4b7f3](https://github.com/certd/certd/commit/3e4b7f30ac6f3c976c8274bdf256c69b8a2c46db))
|
||||||
|
* **trade:** 优化商品购买页面的规格展示和折扣计算,支持订单取消 ([6624769](https://github.com/certd/certd/commit/66247690326ce2789900fc9110c08b3502cea655))
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 安装glibc,增加Alpine镜像下 dns解析结果的兼容性 ([1a08bd3](https://github.com/certd/certd/commit/1a08bd340e1e7d3f9acf5d40f7bba7998459b8fb))
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([af9047b](https://github.com/certd/certd/commit/af9047bf3c54ce71b11727ccc6220288ed1f57be))
|
||||||
|
* 修复查询阿里云cdn Dcdn 域名太多无法选择的bug ([346fb73](https://github.com/certd/certd/commit/346fb730a37e035576f5d9ea5c0d74c052b34aeb))
|
||||||
|
|
||||||
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -5,42 +5,40 @@
|
|||||||
Certd® 是一个免费的全自动证书管理系统,让你的网站证书永不过期。
|
Certd® 是一个免费的全自动证书管理系统,让你的网站证书永不过期。
|
||||||
后缀d取自linux守护进程的命名风格,意为证书守护进程
|
后缀d取自linux守护进程的命名风格,意为证书守护进程
|
||||||
|
|
||||||
|
> 首创流水线申请部署证书模式,已被多个项目“借鉴”,被抄也是一种成功。
|
||||||
>首创流水线申请部署证书模式,已被多个项目“借鉴”,被抄也是一种成功。
|
|
||||||
|
|
||||||
> 关于证书续期:
|
> 关于证书续期:
|
||||||
>* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。
|
>
|
||||||
>* 我们所说的续期,其实就是按照全套流程重新申请一份新证书,然后重新部署上去。
|
> - 实际上没有办法不改变证书文件本身情况下直接续期或者续签。
|
||||||
>* 免费证书过期时间90天,以后可能还会缩短,所以自动化部署必不可少
|
> - 我们所说的续期,其实就是按照全套流程重新申请一份新证书,然后重新部署上去。
|
||||||
|
> - 免费证书过期时间90天,以后可能还会缩短,所以自动化部署必不可少
|
||||||
|
|
||||||
> 流水线数量现已调整为无限制,欢迎大家使用
|
> 流水线数量现已调整为无限制,欢迎大家使用
|
||||||
|
|
||||||
|
| 官方开源地址: | |
|
||||||
|官方开源地址: | |
|
| ------------------------------------------ | ---------------------------------------------------------------- |
|
||||||
| ---- | ---- |
|
| [Github](https://github.com/certd/certd) |  |
|
||||||
| [Github](https://github.com/certd/certd)|  |
|
| [Gitee](https://gitee.com/certd/certd) |  |
|
||||||
| [Gitee](https://gitee.com/certd/certd) |  |
|
| [AtomGit](https://atomgit.com/certd/certd) |  |
|
||||||
| [AtomGit](https://atomgit.com/certd/certd) | |
|
|
||||||
|
|
||||||
|
|
||||||
## 一、特性
|
## 一、特性
|
||||||
|
|
||||||
本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。
|
本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。
|
||||||
|
|
||||||
* **全自动申请证书**: 支持所有注册商注册的域名,支持DNS-01、HTTP-01、CNAME代理等多种域名验证方式
|
- **全自动申请证书**: 支持所有注册商注册的域名,支持DNS-01、HTTP-01、CNAME代理等多种域名验证方式
|
||||||
* **全自动部署更新证书**: 目前支持部署到主机、阿里云、腾讯云等110+部署插件
|
- **全自动部署更新证书**: 目前支持部署到主机、阿里云、腾讯云等110+部署插件
|
||||||
* **多种证书格式**: 支持pem、pfx、der、jks、p7b
|
- **多种证书格式**: 支持pem、pfx、der、jks、p7b
|
||||||
* **免费通配符域名/泛域名证书**: 支持多个域名打到一个证书上
|
- **免费通配符域名/泛域名证书**: 支持多个域名打到一个证书上
|
||||||
* **多种通知方式**: 邮件通知、webhook通知、企微、钉钉、飞书、anpush等多种通知方式
|
- **多种通知方式**: 邮件通知、webhook通知、企微、钉钉、飞书、anpush等多种通知方式
|
||||||
* **私有化部署**: 数据保存本地,安装简单快捷,镜像由Github Actions构建,过程公开透明
|
- **私有化部署**: 数据保存本地,安装简单快捷,镜像由Github Actions构建,过程公开透明
|
||||||
* **多重安全保障**: 授权加密,站点隐藏,2FA,密码防爆破等多重安全保障
|
- **多重安全保障**: 授权加密,站点隐藏,2FA,密码防爆破等多重安全保障
|
||||||
* **多数据库支持**:支持SQLite、PostgreSQL、MySQL、MariaDB
|
- **多数据库支持**:支持SQLite、PostgreSQL、MySQL、MariaDB
|
||||||
* **开放接口支持**: 提供RESTful API接口,方便集成到其他系统
|
- **开放接口支持**: 提供RESTful API接口,方便集成到其他系统
|
||||||
* **站点证书监控**: 定时监控网站证书的过期时间
|
- **站点证书监控**: 定时监控网站证书的过期时间
|
||||||
* **多用户管理**: 用户可以管理自己的证书流水线
|
- **多用户管理**: 用户可以管理自己的证书流水线
|
||||||
* **项目管理**: 企业级项目管理模式
|
- **项目管理**: 企业级项目管理模式
|
||||||
* **多语言支持**: 中英双语切换
|
- **多语言支持**: 中英双语切换
|
||||||
* **无忧升级**: 版本向下兼容
|
- **无忧升级**: 版本向下兼容
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -60,11 +58,13 @@ https://certd.handfree.work/
|
|||||||
仅需3步,让你的证书永不过期
|
仅需3步,让你的证书永不过期
|
||||||
|
|
||||||
### 1. 创建证书流水线
|
### 1. 创建证书流水线
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> 添加成功后,就可以直接运行流水线申请证书了
|
> 添加成功后,就可以直接运行流水线申请证书了
|
||||||
|
|
||||||
### 2. 添加部署任务
|
### 2. 添加部署任务
|
||||||
|
|
||||||
当然我们一般需要把证书部署到应用上,certd支持海量的部署插件,您可以根据自身实际情况进行选择,比如部署到Nginx、阿里云、腾讯云、K8S、CDN、宝塔、1Panel等等
|
当然我们一般需要把证书部署到应用上,certd支持海量的部署插件,您可以根据自身实际情况进行选择,比如部署到Nginx、阿里云、腾讯云、K8S、CDN、宝塔、1Panel等等
|
||||||
|
|
||||||
此处演示部署证书到主机的nginx上
|
此处演示部署证书到主机的nginx上
|
||||||
@@ -74,17 +74,15 @@ https://certd.handfree.work/
|
|||||||

|

|
||||||
|
|
||||||
### 3. 定时运行
|
### 3. 定时运行
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||||
-------> [点我查看详细使用步骤演示](./step.md) <--------
|
-------> [点我查看详细使用步骤演示](./step.md) <--------
|
||||||
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
|
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
|
||||||
|
|
||||||
更多教程请访问官方文档 [certd.docmirror.cn](https://certd.docmirror.cn/guide/)
|
更多教程请访问官方文档 [certd.docmirror.cn](https://certd.docmirror.cn/guide/)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 四、私有化部署
|
## 四、私有化部署
|
||||||
|
|
||||||
由于证书、授权信息等属于高度敏感数据,请务必私有化部署,保障数据安全
|
由于证书、授权信息等属于高度敏感数据,请务必私有化部署,保障数据安全
|
||||||
@@ -95,85 +93,88 @@ https://certd.handfree.work/
|
|||||||
2. 【推荐】[宝塔面板方式部署 ](https://certd.docmirror.cn/guide/install/docker/)
|
2. 【推荐】[宝塔面板方式部署 ](https://certd.docmirror.cn/guide/install/docker/)
|
||||||
3. 【推荐】[1Panel面板方式部署](https://certd.docmirror.cn/guide/install/1panel/)
|
3. 【推荐】[1Panel面板方式部署](https://certd.docmirror.cn/guide/install/1panel/)
|
||||||
4. 【推荐】[雨云一键部署](https://app.rainyun.com/apps/rca/store/6646/?ref=NzExMDQ2) : 首充翻倍,每月仅需2.2元
|
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)
|
[<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/docker/)(自动安装 Docker,Certd):
|
5. 【推荐】[一键安装脚本](https://certd.docmirror.cn/guide/install/docker/)(自动安装 Docker,Certd):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -fsSL https://gitee.com/certd/certd/raw/v2/docker/run/install.sh | bash
|
curl -fsSL https://gitee.com/certd/certd/raw/v2/docker/run/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
6. 【不推荐】[源码方式部署 ](https://certd.docmirror.cn/guide/install/source/)
|
6. 【不推荐】[源码方式部署 ](https://certd.docmirror.cn/guide/install/source/)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### Docker镜像说明:
|
#### Docker镜像说明:
|
||||||
* 国内镜像地址:
|
|
||||||
* `registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest`
|
|
||||||
* `registry.cn-shenzhen.aliyuncs.com/handsfree/certd:armv7`、`[version]-armv7`
|
|
||||||
* DockerHub地址:
|
|
||||||
* `https://hub.docker.com/r/greper/certd`
|
|
||||||
* `greper/certd:latest`
|
|
||||||
* `greper/certd:armv7`、`greper/certd:[version]-armv7`
|
|
||||||
* GitHub Packages地址:
|
|
||||||
* `ghcr.io/certd/certd:latest`
|
|
||||||
* `ghcr.io/certd/certd:armv7`、`ghcr.io/certd/certd:[version]-armv7`
|
|
||||||
|
|
||||||
* 镜像构建通过`Actions`自动执行,过程公开透明,请放心使用
|
- 国内镜像地址:
|
||||||
* [点我查看镜像构建日志](https://github.com/certd/certd/actions/workflows/build-image.yml)
|
- `registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest`
|
||||||
|
- `registry.cn-shenzhen.aliyuncs.com/handsfree/certd:armv7`、`[version]-armv7`
|
||||||
|
- DockerHub地址:
|
||||||
|
- `https://hub.docker.com/r/greper/certd`
|
||||||
|
- `greper/certd:latest`
|
||||||
|
- `greper/certd:armv7`、`greper/certd:[version]-armv7`
|
||||||
|
- GitHub Packages地址:
|
||||||
|
|
||||||
|
- `ghcr.io/certd/certd:latest`
|
||||||
|
- `ghcr.io/certd/certd:armv7`、`ghcr.io/certd/certd:[version]-armv7`
|
||||||
|
|
||||||
|
- 镜像构建通过`Actions`自动执行,过程公开透明,请放心使用
|
||||||
|
- [点我查看镜像构建日志](https://github.com/certd/certd/actions/workflows/build-image.yml)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> 注意:
|
> 注意:
|
||||||
> * 本应用存储的证书、授权信息等属于高度敏感数据,请做好安全防护
|
>
|
||||||
> * 请务必使用HTTPS协议访问本应用,避免被中间人攻击
|
> - 本应用存储的证书、授权信息等属于高度敏感数据,请做好安全防护
|
||||||
> * 请务必使用web应用防火墙防护本应用,防止XSS、SQL注入等攻击
|
> - 请务必使用HTTPS协议访问本应用,避免被中间人攻击
|
||||||
> * 请务必做好服务器本身的安全防护,防止数据库泄露
|
> - 请务必使用web应用防火墙防护本应用,防止XSS、SQL注入等攻击
|
||||||
> * 请务必做好数据备份,避免数据丢失
|
> - 请务必做好服务器本身的安全防护,防止数据库泄露
|
||||||
> * [更多安全生产建议点我](https://certd.docmirror.cn/guide/feature/safe/)
|
> - 请务必做好数据备份,避免数据丢失
|
||||||
|
> - [更多安全生产建议点我](https://certd.docmirror.cn/guide/feature/safe/)
|
||||||
|
|
||||||
## 五、生态
|
## 五、生态
|
||||||
|
|
||||||
### 1. 客户端工具 SSL-Assistant
|
### 1. 客户端工具 SSL-Assistant
|
||||||
|
|
||||||
`SSL Assistant` 是一个运行于主机上的证书部署管理助手客户端。
|
`SSL Assistant` 是一个运行于主机上的证书部署管理助手客户端。
|
||||||
支持自动扫描主机`Nginx`配置,然后从`Certd`拉取证书并部署。
|
支持自动扫描主机`Nginx`配置,然后从`Certd`拉取证书并部署。
|
||||||
在不想暴露ssh主机密码情况下,该工具非常好用。
|
在不想暴露ssh主机密码情况下,该工具非常好用。
|
||||||
|
|
||||||
开源地址: https://github.com/Youngxj/SSL-Assistant
|
开源地址: https://github.com/Youngxj/SSL-Assistant
|
||||||
|
|
||||||
|
|
||||||
## 六、更多帮助
|
## 六、更多帮助
|
||||||
|
|
||||||
请访问官方文档:[https://certd.docmirror.cn/](https://certd.docmirror.cn/guide/)
|
请访问官方文档:[https://certd.docmirror.cn/](https://certd.docmirror.cn/guide/)
|
||||||
|
|
||||||
* 升级方法:[升级方法](https://certd.docmirror.cn/guide/install/upgrade/)
|
- 升级方法:[升级方法](https://certd.docmirror.cn/guide/install/upgrade/)
|
||||||
* 常见问题:[忘记密码](https://certd.docmirror.cn/guide/use/forgotpasswd/)
|
- 常见问题:[忘记密码](https://certd.docmirror.cn/guide/use/forgotpasswd/)
|
||||||
* 多数据库:[多数据库配置](https://certd.docmirror.cn/guide/install/database/)
|
- 多数据库:[多数据库配置](https://certd.docmirror.cn/guide/install/database/)
|
||||||
* 站点安全:[站点安全特性](https://certd.docmirror.cn/guide/feature/safe/)
|
- 站点安全:[站点安全特性](https://certd.docmirror.cn/guide/feature/safe/)
|
||||||
* 更新日志:[CHANGELOG](./CHANGELOG.md)
|
- 更新日志:[CHANGELOG](./CHANGELOG.md)
|
||||||
|
|
||||||
|
|
||||||
## 七、联系作者
|
## 七、联系作者
|
||||||
|
|
||||||
如有疑问,欢迎加入群聊(请备注certd)
|
如有疑问,欢迎加入群聊(请备注certd)
|
||||||
|
|
||||||
| 加群 | 微信群 | QQ群 |
|
| 加群 | 微信群 | QQ群 |
|
||||||
|---------|-------|-------|
|
| ------ | ----------------------------------------------------------- | ----------------------------------------------------------- |
|
||||||
| 二维码 | <img height="230" src="./docs/guide/contact/images/wx.png"> | <img height="230" src="./docs/guide/contact/images/qq.png"> |
|
| 二维码 | <img height="230" src="./docs/guide/contact/images/wx.png"> | <img height="230" src="./docs/guide/contact/images/qq.png"> |
|
||||||
|
|
||||||
也可以加作者好友
|
也可以加作者好友
|
||||||
|
|
||||||
| 加作者好友 | 微信 QQ |
|
| 加作者好友 | 微信 QQ |
|
||||||
|---------|-------------------------------------------------------------|
|
| ---------- | ----------------------------------------------------------- |
|
||||||
| 二维码 | <img height="230" src="./docs/guide/contact/images/me.png"> |
|
| 二维码 | <img height="230" src="./docs/guide/contact/images/me.png"> |
|
||||||
|
|
||||||
|
|
||||||
## 八、赞助捐赠
|
## 八、赞助捐赠
|
||||||
|
|
||||||
开源为什么要做专业版收费?
|
开源为什么要做专业版收费?
|
||||||
|
|
||||||
1. 纯靠为爱发电不可持续(比如:我的[dev-sidecar项目](https://github.com/docmirror/dev-sidecar)即便是拥有20K+star,也差点凉凉,幸亏有另外大佬接手用爱发电)
|
1. 纯靠为爱发电不可持续(比如:我的[dev-sidecar项目](https://github.com/docmirror/dev-sidecar)即便是拥有20K+star,也差点凉凉,幸亏有另外大佬接手用爱发电)
|
||||||
2. 没有赞助的项目,作者会比较任性,不会用心倾听用户的心声,不顾用户体验(比如:下意识拒绝需求、频繁破坏性变更升级、全盘推倒重来之类的)
|
2. 没有赞助的项目,作者会比较任性,不会用心倾听用户的心声,不顾用户体验(比如:下意识拒绝需求、频繁破坏性变更升级、全盘推倒重来之类的)
|
||||||
3. 没有赞助的项目,交流群的戾气有时候比较重,容易起冲突
|
3. 没有赞助的项目,交流群的戾气有时候比较重,容易起冲突
|
||||||
|
|
||||||
赞助权益:
|
赞助权益:
|
||||||
|
|
||||||
1. 可加入专属VIP群,可以获得作者一对一技术支持,必要时可以远程协助
|
1. 可加入专属VIP群,可以获得作者一对一技术支持,必要时可以远程协助
|
||||||
2. 您的需求我们将优先实现,并且可能将作为专业版功能提供
|
2. 您的需求我们将优先实现,并且可能将作为专业版功能提供
|
||||||
3. 获得专业版功能
|
3. 获得专业版功能
|
||||||
@@ -182,21 +183,21 @@ https://certd.handfree.work/
|
|||||||
|
|
||||||
专业版、商业版特权对比
|
专业版、商业版特权对比
|
||||||
|
|
||||||
| 功能 | 免费版 | 专业版 | 商业版 |
|
| 功能 | 免费版 | 专业版 | 商业版 |
|
||||||
|---------|---------------------------------------|--------------------------------|---------------------------------|
|
| ---------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------ | --------------------------------------------------- |
|
||||||
| 证书申请 | 无限制 | 无限制 | 无限制 |
|
| 证书申请 | 无限制 | 无限制 | 无限制 |
|
||||||
| 证书域名数量 | 无限制 | 无限制 | 无限制 |
|
| 证书域名数量 | 无限制 | 无限制 | 无限制 |
|
||||||
| 证书流水线条数 | 无限制 | 无限制 | 无限制 |
|
| 证书流水线条数 | 无限制 | 无限制 | 无限制 |
|
||||||
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖、威联通、proxmox等 | 同专业版 |
|
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖、威联通、proxmox等 | 同专业版 |
|
||||||
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、钉钉、飞书、anpush、server酱等 | 同专业版 |
|
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、钉钉、飞书、anpush、server酱等 | 同专业版 |
|
||||||
| 站点监控 | 限制1条 | 无限制 | 无限制 |
|
| 站点监控 | 限制1条 | 无限制 | 无限制 |
|
||||||
| 批量操作 | 无 | 流水线模版,流水线复制,批量运行,批量设置通知、定时等 | 同专业版 |
|
| 批量操作 | 无 | 流水线模版,流水线复制,批量运行,批量设置通知、定时等 | 同专业版 |
|
||||||
| VIP群 | 无 | 可加,一对一技术支持,必要时可申请远程协助 | 商业版技术支持 |
|
| VIP群 | 无 | 可加,一对一技术支持,必要时可申请远程协助 | 商业版技术支持 |
|
||||||
| 站点个性化 | 无 | 无 | 可自定义站点名称、Logo等,移除Certd元素,首页警告等 |
|
| 站点个性化 | 无 | 无 | 可自定义站点名称、Logo等,移除Certd元素,首页警告等 |
|
||||||
| 套餐功能 | 无 | 无 | 支持配置套餐供用户购买 |
|
| 套餐功能 | 无 | 无 | 支持配置套餐供用户购买 |
|
||||||
| 数据统计 | 无 | 无 | 支持站点各类统计数据 |
|
| 数据统计 | 无 | 无 | 支持站点各类统计数据 |
|
||||||
| 插件管理 | 无 | 无 | 支持公共EAB设置,插件选项配置 |
|
| 插件管理 | 无 | 无 | 支持公共EAB设置,插件选项配置 |
|
||||||
| 是否可商用 | 不允许 | 不允许 | 可对外运营 |
|
| 是否可商用 | 不允许 | 不允许 | 可对外运营 |
|
||||||
|
|
||||||
## 九、贡献代码
|
## 九、贡献代码
|
||||||
|
|
||||||
@@ -212,16 +213,16 @@ https://certd.handfree.work/
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
## 十、 开源许可
|
## 十、 开源许可
|
||||||
* 本项目遵循 GNU Affero General Public License(AGPL)开源协议。
|
|
||||||
* 允许个人和公司内部自由使用、复制、修改和分发本项目,未获得商业授权情况下禁止任何形式的商业用途
|
|
||||||
* 未获得商业授权情况下,禁止任何对logo、版权信息及授权许可相关代码的修改。
|
|
||||||
* 如需商业授权,请联系作者。
|
|
||||||
|
|
||||||
|
- 本项目遵循 GNU Affero General Public License(AGPL)开源协议。
|
||||||
|
- 允许个人和公司内部自由使用、复制、修改和分发本项目,未获得商业授权情况下禁止任何形式的商业用途
|
||||||
|
- 未获得商业授权情况下,禁止任何对logo、版权信息及授权许可相关代码的修改。
|
||||||
|
- 如需商业授权,请联系作者。
|
||||||
|
|
||||||
## 十一、我的其他项目(求Star)
|
## 十一、我的其他项目(求Star)
|
||||||
|
|
||||||
| 项目名称 | stars | 项目描述 |
|
| 项目名称 | stars | 项目描述 |
|
||||||
| --------- |--------- |----------- |
|
| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
|
||||||
| [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快速开发框架 |
|
| [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无法访问的问题 |
|
| [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服务,使其后台运行 |
|
| [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服务,使其后台运行 |
|
||||||
|
|||||||
+87
-70
@@ -7,40 +7,40 @@ Certd® is a free, fully automated certificate management system that ensures yo
|
|||||||
> We pioneered the pipeline-based certificate application and deployment model, which has been "referenced" by multiple projects. Being copied is also a form of success.
|
> We pioneered the pipeline-based certificate application and deployment model, which has been "referenced" by multiple projects. Being copied is also a form of success.
|
||||||
|
|
||||||
> Regarding certificate renewal:
|
> Regarding certificate renewal:
|
||||||
>* In fact, it's impossible to renew or reissue a certificate without modifying the certificate file itself.
|
>
|
||||||
>* What we refer to as renewal is essentially applying for a new certificate following the full process and redeploying it.
|
> - In fact, it's impossible to renew or reissue a certificate without modifying the certificate file itself.
|
||||||
>* Free certificates expire in 90 days, which may be shortened in the future. Therefore, automated deployment is essential.
|
> - What we refer to as renewal is essentially applying for a new certificate following the full process and redeploying it.
|
||||||
|
> - Free certificates expire in 90 days, which may be shortened in the future. Therefore, automated deployment is essential.
|
||||||
|
|
||||||
> The number of pipelines is now unlimited. Welcome to use it.
|
> The number of pipelines is now unlimited. Welcome to use it.
|
||||||
|
|
||||||
|
|
||||||
Official Open Source Address:
|
Official Open Source Address:
|
||||||
|
|
||||||
[Github](https://github.com/certd/certd) 
|
[Github](https://github.com/certd/certd) 
|
||||||
[Gitee](https://gitee.com/certd/certd) 
|
[Gitee](https://gitee.com/certd/certd) 
|
||||||
[AtomGit](https://atomgit.com/certd/certd) 
|
[AtomGit](https://atomgit.com/certd/certd) 
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 1. Features
|
## 1. Features
|
||||||
|
|
||||||
This project not only supports automated certificate application but also automated certificate deployment and updates, ensuring your certificates never expire.
|
This project not only supports automated certificate application but also automated certificate deployment and updates, ensuring your certificates never expire.
|
||||||
|
|
||||||
* Fully automated certificate application (supports domains registered with all registrars and multiple domain verification methods such as DNS-01, HTTP-01, and CNAME proxy).
|
- Fully automated certificate application (supports domains registered with all registrars and multiple domain verification methods such as DNS-01, HTTP-01, and CNAME proxy).
|
||||||
* Fully automated certificate deployment and updates (currently supports deployment to over 70 plugins, including hosts, Alibaba Cloud, Tencent Cloud, etc.).
|
- Fully automated certificate deployment and updates (currently supports deployment to over 70 plugins, including hosts, Alibaba Cloud, Tencent Cloud, etc.).
|
||||||
* Supports wildcard domains/pan-domains, allows multiple domains in a single certificate, and supports various certificate formats such as pem, pfx, der, and jks.
|
- Supports wildcard domains/pan-domains, allows multiple domains in a single certificate, and supports various certificate formats such as pem, pfx, der, and jks.
|
||||||
* Multiple notification methods, including email, webhook, WeChat Work, DingTalk, Lark, and anpush.
|
- Multiple notification methods, including email, webhook, WeChat Work, DingTalk, Lark, and anpush.
|
||||||
* On-premises deployment, local data storage, simple and quick installation. Images are built by Github Actions, with a transparent process.
|
- On-premises deployment, local data storage, simple and quick installation. Images are built by Github Actions, with a transparent process.
|
||||||
* Multiple security measures, including authorization encryption, site hiding, 2FA, and password brute-force protection.
|
- Multiple security measures, including authorization encryption, site hiding, 2FA, and password brute-force protection.
|
||||||
* Supports multiple databases such as SQLite, PostgreSQL, MySQL, and MariaDB.
|
- Supports multiple databases such as SQLite, PostgreSQL, MySQL, and MariaDB.
|
||||||
* Open API support.
|
- Open API support.
|
||||||
* Site certificate monitoring.
|
- Site certificate monitoring.
|
||||||
* Multi-user management.
|
- Multi-user management.
|
||||||
* Multi-language support (Chinese and English switching).
|
- Multi-language support (Chinese and English switching).
|
||||||
* Downward compatibility across all versions, with one-click worry-free upgrades.
|
- Downward compatibility across all versions, with one-click worry-free upgrades.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 2. Online Experience
|
## 2. Online Experience
|
||||||
|
|
||||||
Visit the official demo site and register to experience it.
|
Visit the official demo site and register to experience it.
|
||||||
|
|
||||||
https://certd.handfree.work/
|
https://certd.handfree.work/
|
||||||
@@ -51,14 +51,17 @@ https://certd.handfree.work/
|
|||||||

|

|
||||||
|
|
||||||
## 3. Usage Tutorial
|
## 3. Usage Tutorial
|
||||||
|
|
||||||
Just 3 steps to ensure your certificates never expire.
|
Just 3 steps to ensure your certificates never expire.
|
||||||
|
|
||||||
### 1. Create a Certificate Pipeline
|
### 1. Create a Certificate Pipeline
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> After successful addition, you can directly run the pipeline to apply for a certificate.
|
> After successful addition, you can directly run the pipeline to apply for a certificate.
|
||||||
|
|
||||||
### 2. Add a Deployment Task
|
### 2. Add a Deployment Task
|
||||||
|
|
||||||
Normally, we need to deploy certificates to applications. Certd supports a wide range of deployment plugins. You can choose based on your needs, such as deploying to Nginx, Alibaba Cloud, Tencent Cloud, K8S, CDN, Baota, 1Panel, etc.
|
Normally, we need to deploy certificates to applications. Certd supports a wide range of deployment plugins. You can choose based on your needs, such as deploying to Nginx, Alibaba Cloud, Tencent Cloud, K8S, CDN, Baota, 1Panel, etc.
|
||||||
|
|
||||||
Here's a demonstration of deploying certificates to a host's Nginx:
|
Here's a demonstration of deploying certificates to a host's Nginx:
|
||||||
@@ -68,6 +71,7 @@ If the current deployment plugins don't meet your needs, you can also download t
|
|||||||

|

|
||||||
|
|
||||||
### 3. Run Scheduled Tasks
|
### 3. Run Scheduled Tasks
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||||
@@ -77,6 +81,7 @@ If the current deployment plugins don't meet your needs, you can also download t
|
|||||||
For more tutorials, please visit the official documentation [certd.docmirror.cn](https://certd.docmirror.cn/guide/).
|
For more tutorials, please visit the official documentation [certd.docmirror.cn](https://certd.docmirror.cn/guide/).
|
||||||
|
|
||||||
## 4. On-Premises Deployment
|
## 4. On-Premises Deployment
|
||||||
|
|
||||||
Since certificates, authorization information, and other data are highly sensitive, please make sure to deploy them on-premises to ensure data security.
|
Since certificates, authorization information, and other data are highly sensitive, please make sure to deploy them on-premises to ensure data security.
|
||||||
|
|
||||||
You can choose one of the following deployment methods based on your needs:
|
You can choose one of the following deployment methods based on your needs:
|
||||||
@@ -85,87 +90,98 @@ You can choose one of the following deployment methods based on your needs:
|
|||||||
2. 【Recommended】[BT Panel Deployment](https://certd.docmirror.cn/guide/install/docker/)
|
2. 【Recommended】[BT Panel Deployment](https://certd.docmirror.cn/guide/install/docker/)
|
||||||
3. 【Recommended】[1Panel Deployment](https://certd.docmirror.cn/guide/install/1panel/)
|
3. 【Recommended】[1Panel Deployment](https://certd.docmirror.cn/guide/install/1panel/)
|
||||||
4. 【Recommended】[Rainyun One-Click Deployment](https://app.rainyun.com/apps/rca/store/6646/?ref=NzExMDQ2_): Double your first recharge, only $2.2 per month.
|
4. 【Recommended】[Rainyun One-Click Deployment](https://app.rainyun.com/apps/rca/store/6646/?ref=NzExMDQ2_): Double your first recharge, only $2.2 per month.
|
||||||
[<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_)
|
[<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. 【Not Recommended】[Source Code Deployment](https://certd.docmirror.cn/guide/install/source/)
|
5. 【Not Recommended】[Source Code Deployment](https://certd.docmirror.cn/guide/install/source/)
|
||||||
|
|
||||||
#### Docker Image Information:
|
#### Docker Image Information:
|
||||||
* Domestic Image Addresses:
|
|
||||||
* `registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest`
|
|
||||||
* `registry.cn-shenzhen.aliyuncs.com/handsfree/certd:armv7`, `[version]-armv7`
|
|
||||||
* DockerHub Addresses:
|
|
||||||
* `https://hub.docker.com/r/greper/certd`
|
|
||||||
* `greper/certd:latest`
|
|
||||||
* `greper/certd:armv7`, `greper/certd:[version]-armv7`
|
|
||||||
* GitHub Packages Addresses:
|
|
||||||
* `ghcr.io/certd/certd:latest`
|
|
||||||
* `ghcr.io/certd/certd:armv7`, `ghcr.io/certd/certd:[version]-armv7`
|
|
||||||
|
|
||||||
* Images are built automatically by `Actions`, with a transparent process. Please use them with confidence.
|
- Domestic Image Addresses:
|
||||||
* [Click here to view image build logs](https://github.com/certd/certd/actions/workflows/build-image.yml)
|
- `registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest`
|
||||||
|
- `registry.cn-shenzhen.aliyuncs.com/handsfree/certd:armv7`, `[version]-armv7`
|
||||||
|
- DockerHub Addresses:
|
||||||
|
- `https://hub.docker.com/r/greper/certd`
|
||||||
|
- `greper/certd:latest`
|
||||||
|
- `greper/certd:armv7`, `greper/certd:[version]-armv7`
|
||||||
|
- GitHub Packages Addresses:
|
||||||
|
|
||||||
|
- `ghcr.io/certd/certd:latest`
|
||||||
|
- `ghcr.io/certd/certd:armv7`, `ghcr.io/certd/certd:[version]-armv7`
|
||||||
|
|
||||||
|
- Images are built automatically by `Actions`, with a transparent process. Please use them with confidence.
|
||||||
|
- [Click here to view image build logs](https://github.com/certd/certd/actions/workflows/build-image.yml)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> Note:
|
> Note:
|
||||||
> * The certificates, authorization information, and other data stored in this application are highly sensitive. Please take appropriate security measures.
|
>
|
||||||
> * Make sure to use the HTTPS protocol to access this application to avoid man-in-the-middle attacks.
|
> - The certificates, authorization information, and other data stored in this application are highly sensitive. Please take appropriate security measures.
|
||||||
> * Make sure to use a web application firewall to protect this application from attacks such as XSS and SQL injection.
|
> - Make sure to use the HTTPS protocol to access this application to avoid man-in-the-middle attacks.
|
||||||
> * Make sure to secure the server itself to prevent database leakage.
|
> - Make sure to use a web application firewall to protect this application from attacks such as XSS and SQL injection.
|
||||||
> * Make sure to back up your data to avoid data loss.
|
> - Make sure to secure the server itself to prevent database leakage.
|
||||||
> * [Click here for more production safety suggestions](https://certd.docmirror.cn/guide/feature/safe/)
|
> - Make sure to back up your data to avoid data loss.
|
||||||
|
> - [Click here for more production safety suggestions](https://certd.docmirror.cn/guide/feature/safe/)
|
||||||
|
|
||||||
## 5. Ecosystem
|
## 5. Ecosystem
|
||||||
|
|
||||||
### 1. Client Tool: SSL-Assistant
|
### 1. Client Tool: SSL-Assistant
|
||||||
|
|
||||||
`SSL Assistant` is a certificate deployment and management assistant client that runs on hosts. It supports automatic scanning of the host's `Nginx` configuration and pulling certificates from `Certd` for deployment. This tool is very useful when you don't want to expose your SSH host password.
|
`SSL Assistant` is a certificate deployment and management assistant client that runs on hosts. It supports automatic scanning of the host's `Nginx` configuration and pulling certificates from `Certd` for deployment. This tool is very useful when you don't want to expose your SSH host password.
|
||||||
|
|
||||||
Open-source Address: https://github.com/Youngxj/SSL-Assistant
|
Open-source Address: https://github.com/Youngxj/SSL-Assistant
|
||||||
|
|
||||||
## 6. More Help
|
## 6. More Help
|
||||||
|
|
||||||
Please visit the official documentation: [https://certd.docmirror.cn/](https://certd.docmirror.cn/guide/).
|
Please visit the official documentation: [https://certd.docmirror.cn/](https://certd.docmirror.cn/guide/).
|
||||||
|
|
||||||
* Upgrade Method: [Upgrade Guide](https://certd.docmirror.cn/guide/install/upgrade/)
|
- Upgrade Method: [Upgrade Guide](https://certd.docmirror.cn/guide/install/upgrade/)
|
||||||
* Common Issues: [Forgot Password](https://certd.docmirror.cn/guide/use/forgotpasswd/)
|
- Common Issues: [Forgot Password](https://certd.docmirror.cn/guide/use/forgotpasswd/)
|
||||||
* Multi-Database: [Multi-Database Configuration](https://certd.docmirror.cn/guide/install/database/)
|
- Multi-Database: [Multi-Database Configuration](https://certd.docmirror.cn/guide/install/database/)
|
||||||
* Site Security: [Site Security Features](https://certd.docmirror.cn/guide/feature/safe/)
|
- Site Security: [Site Security Features](https://certd.docmirror.cn/guide/feature/safe/)
|
||||||
* Changelog: [CHANGELOG](./CHANGELOG.md)
|
- Changelog: [CHANGELOG](./CHANGELOG.md)
|
||||||
|
|
||||||
## 7. Contact the Author
|
## 7. Contact the Author
|
||||||
|
|
||||||
If you have any questions, feel free to join the group chat (please mention 'certd' in your message).
|
If you have any questions, feel free to join the group chat (please mention 'certd' in your message).
|
||||||
|
|
||||||
| Join Group | WeChat Group | QQ Group |
|
| Join Group | WeChat Group | QQ Group |
|
||||||
|---------|-------|-------|
|
| ---------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
|
||||||
| QR Code | <img height="230" src="./docs/guide/contact/images/wx.png"> | <img height="230" src="./docs/guide/contact/images/qq.png"> |
|
| QR Code | <img height="230" src="./docs/guide/contact/images/wx.png"> | <img height="230" src="./docs/guide/contact/images/qq.png"> |
|
||||||
|
|
||||||
You can also add the author as a friend.
|
You can also add the author as a friend.
|
||||||
|
|
||||||
| Add Author as Friend | WeChat QQ |
|
| Add Author as Friend | WeChat QQ |
|
||||||
|---------|-------|-------|
|
| -------------------- | ----------------------------------------------------------- |
|
||||||
| QR Code | <img height="230" src="./docs/guide/contact/images/me.png"> |
|
| QR Code | <img height="230" src="./docs/guide/contact/images/me.png"> |
|
||||||
|
|
||||||
## 8. Donation
|
## 8. Donation
|
||||||
************************
|
|
||||||
[](https://github.com/sponsors/greper)
|
---
|
||||||
************************
|
|
||||||
|
[](https://github.com/sponsors/greper)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
Support open-source projects and contribute with love. I've joined Afdian.
|
Support open-source projects and contribute with love. I've joined Afdian.
|
||||||
https://afdian.com/a/greper
|
https://afdian.com/a/greper
|
||||||
|
|
||||||
Benefits of Contribution:
|
Benefits of Contribution:
|
||||||
|
|
||||||
1. Join the exclusive contributor group and get one-on-one technical support from the author.
|
1. Join the exclusive contributor group and get one-on-one technical support from the author.
|
||||||
2. Your requests will be prioritized and implemented as professional edition features.
|
2. Your requests will be prioritized and implemented as professional edition features.
|
||||||
3. Receive a one-year professional edition activation code.
|
3. Receive a one-year professional edition activation code.
|
||||||
|
|
||||||
Comparison of Professional Edition Privileges:
|
Comparison of Professional Edition Privileges:
|
||||||
|
|
||||||
| Feature | Free Edition | Professional Edition |
|
| Feature | Free Edition | Professional Edition |
|
||||||
|---------|---------------------------------------|--------------------------------|
|
| ------------------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
|
||||||
| Free Certificate Application | Unlimited for free | Unlimited for free |
|
| Free Certificate Application | Unlimited for free | Unlimited for free |
|
||||||
| Number of Domains | Unlimited | Unlimited |
|
| Number of Domains | Unlimited | Unlimited |
|
||||||
| Number of Certificate Pipelines | Unlimited | Unlimited |
|
| Number of Certificate Pipelines | Unlimited | Unlimited |
|
||||||
| Site Certificate Monitoring | Limited to 1 | Unlimited |
|
| Site Certificate Monitoring | Limited to 1 | Unlimited |
|
||||||
| Automatic Deployment Plugins | Most plugins such as Alibaba Cloud CDN, Tencent Cloud, QiNiu CDN, Host Deployment, Baota, 1Panel | Synology |
|
| Automatic Deployment Plugins | Most plugins such as Alibaba Cloud CDN, Tencent Cloud, QiNiu CDN, Host Deployment, Baota, 1Panel | Synology |
|
||||||
| Notifications | Email, Custom Webhook | Email without configuration, WeChat Work, DingTalk, Lark, anpush, ServerChan, etc. |
|
| Notifications | Email, Custom Webhook | Email without configuration, WeChat Work, DingTalk, Lark, anpush, ServerChan, etc. |
|
||||||
|
|
||||||
************************
|
---
|
||||||
|
|
||||||
## 9. Contribute Code
|
## 9. Contribute Code
|
||||||
|
|
||||||
@@ -181,14 +197,15 @@ Thank you to the following contributors.
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
## 10. Open-Source License
|
## 10. Open-Source License
|
||||||
* This project follows the GNU Affero General Public License (AGPL).
|
|
||||||
* Individuals and companies are allowed to use, copy, modify, and distribute this project freely for internal use. Any form of commercial use is prohibited without obtaining commercial authorization.
|
- This project follows the GNU Affero General Public License (AGPL).
|
||||||
* Without commercial authorization, any modification of the logo, copyright information, and license-related code is prohibited.
|
- Individuals and companies are allowed to use, copy, modify, and distribute this project freely for internal use. Any form of commercial use is prohibited without obtaining commercial authorization.
|
||||||
* For commercial authorization, please contact the author.
|
- Without commercial authorization, any modification of the logo, copyright information, and license-related code is prohibited.
|
||||||
|
- For commercial authorization, please contact the author.
|
||||||
|
|
||||||
## 11. My Other Projects (Please Star)
|
## 11. My Other Projects (Please Star)
|
||||||
|
|
||||||
| Project Name | Stars | Project Description |
|
| Project Name | Stars | Project Description |
|
||||||
|----------------|---------------|--------------|
|
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
||||||
| [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"/> | A fast CRUD development framework based on Vue3. |
|
| [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"/> | A fast CRUD development framework based on Vue3. |
|
||||||
| [dev-sidecar](https://github.com/docmirror/dev-sidecar/) | <img alt="GitHub stars" src="https://img.shields.io/github/stars/docmirror/dev-sidecar?logo=github"/> | A tool to access GitHub directly without a VPN, solving the problem of inaccessible GitHub. |
|
| [dev-sidecar](https://github.com/docmirror/dev-sidecar/) | <img alt="GitHub stars" src="https://img.shields.io/github/stars/docmirror/dev-sidecar?logo=github"/> | A tool to access GitHub directly without a VPN, solving the problem of inaccessible GitHub. |
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ export default defineConfig({
|
|||||||
{text: "支付宝配置", link: "/guide/use/comm/payments/alipay.md"},
|
{text: "支付宝配置", link: "/guide/use/comm/payments/alipay.md"},
|
||||||
{text: "微信支付配置", link: "/guide/use/comm/payments/wxpay.md"},
|
{text: "微信支付配置", link: "/guide/use/comm/payments/wxpay.md"},
|
||||||
{text: "彩虹易支付配置", link: "/guide/use/comm/payments/yizhifu.md"},
|
{text: "彩虹易支付配置", link: "/guide/use/comm/payments/yizhifu.md"},
|
||||||
|
{text: "插件选项映射", link: "/guide/use/comm/plugin/"},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,60 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 流水线、监控站点支持导出 ([99fd308](https://github.com/certd/certd/commit/99fd3083f259cdb96fd656f04858dd708d1251c7))
|
||||||
|
* 优化列表页面请求两次的问题 ([5546af5](https://github.com/certd/certd/commit/5546af518e92c765513787ccaf8e856be789bcf9))
|
||||||
|
* 优化邀请注册流程 ([7a71e45](https://github.com/certd/certd/commit/7a71e45799d782d0691606fb42b4236f1d3009b0))
|
||||||
|
* **settings:** 新增NO_PROXY代理排除配置 ([c0df8be](https://github.com/certd/certd/commit/c0df8be83237e323c2c9a5bd02507430a86a00cc))
|
||||||
|
* **volcengine-vke:** 火山VKE集群证书支持两种类型的证书保密字典 ([77b8024](https://github.com/certd/certd/commit/77b802445322d576d54d194f7c505da49e0e824c))
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([41254d1](https://github.com/certd/certd/commit/41254d10b748a2d3e6ba43c7e11411650c748d1b))
|
||||||
|
* **monitor:** 修复开放接口自动创建证书流水线重复触发和等待时间不足的问题 ([91d5c90](https://github.com/certd/certd/commit/91d5c90eb0eaf65c81dddbd2d4d4b404cb8b4d07))
|
||||||
|
* **pipeline:** 修复批量随机修改定时没有生效的bug ([2e19dda](https://github.com/certd/certd/commit/2e19dda72e70b525a7c269e18e963a5ee602f59f))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 商业版支持邀请返佣功能 ([f9a310b](https://github.com/certd/certd/commit/f9a310b6c3bbf30f221482a0c59e9c30080bdfc8))
|
||||||
|
* 商业版支持邀请推广功能 ([f1d2a10](https://github.com/certd/certd/commit/f1d2a1033a0f8d3dbd91fc9793e07bd0b858b539))
|
||||||
|
* 新增管理员针对用户流水线和证书监控管理功能 ([0211552](https://github.com/certd/certd/commit/021155278e7375f8487b0531ed1b5ad52512f007))
|
||||||
|
* 新增套餐激活码功能,通过CDK兑换套餐 ([81d6289](https://github.com/certd/certd/commit/81d6289a8631b073b49f24dee4b14bb1c8f31071))
|
||||||
|
* 新增推广等级激励功能 ([5096df5](https://github.com/certd/certd/commit/5096df5cc0d8f0ad8aa327b8e2a900ba23714bd8))
|
||||||
|
* 新增证书申请参数模版管理,开放接口支持使用证书参数模版和指定证书申请参数 ([f8b71a0](https://github.com/certd/certd/commit/f8b71a0e612fad527cf49136335e0b46f0f379cd))
|
||||||
|
* 支持dns-persist-01持久化验证方式申请证书,优化Acme账号的存储方式 ([67b05e2](https://github.com/certd/certd/commit/67b05e2d75e96b9f855e1ca0b3d0d8d03b92d8e6))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 插件全局配置支持下拉选项自定义映射功能 ([c637985](https://github.com/certd/certd/commit/c637985575b09196b04cce37ac14fbe68c029bde))
|
||||||
|
* 商业版提现增加收款二维码上传 ([83a5a21](https://github.com/certd/certd/commit/83a5a21f956e50942541f1532f3a8dcaa5821d34))
|
||||||
|
* **aliyun-apig:** 优化阿里云API网关部署插件的查询及翻页 ([3e4b7f3](https://github.com/certd/certd/commit/3e4b7f30ac6f3c976c8274bdf256c69b8a2c46db))
|
||||||
|
* **trade:** 优化商品购买页面的规格展示和折扣计算,支持订单取消 ([6624769](https://github.com/certd/certd/commit/66247690326ce2789900fc9110c08b3502cea655))
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 安装glibc,增加Alpine镜像下 dns解析结果的兼容性 ([1a08bd3](https://github.com/certd/certd/commit/1a08bd340e1e7d3f9acf5d40f7bba7998459b8fb))
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([af9047b](https://github.com/certd/certd/commit/af9047bf3c54ce71b11727ccc6220288ed1f57be))
|
||||||
|
* 修复查询阿里云cdn Dcdn 域名太多无法选择的bug ([346fb73](https://github.com/certd/certd/commit/346fb730a37e035576f5d9ea5c0d74c052b34aeb))
|
||||||
|
|
||||||
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **pipeline-service:** 修复流水线运行时超过套餐部署次数仍然能够正常运行的bug ([5e59651](https://github.com/certd/certd/commit/5e59651d45bc91919629e35995ff1b3cff6b87ea))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 商业版套餐只支持设置为可叠加 ([5e72f75](https://github.com/certd/certd/commit/5e72f75395fb632a30e80c07d35d8ba40ef631fa))
|
||||||
|
* 新增阿里云直播证书部署插件 ([8edb6f8](https://github.com/certd/certd/commit/8edb6f8727bd148f106801bef25567880fd35e9e))
|
||||||
|
|
||||||
## [1.40.3](https://github.com/certd/certd/compare/v1.40.2...v1.40.3) (2026-05-21)
|
## [1.40.3](https://github.com/certd/certd/compare/v1.40.2...v1.40.3) (2026-05-21)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -39,13 +39,21 @@ pnpm install
|
|||||||
pnpm init
|
pnpm init
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### lib包编译:
|
||||||
|
将packages下面依赖的包都编译一遍,并监听改动。
|
||||||
|
```shell
|
||||||
|
pnpm dev
|
||||||
|
```
|
||||||
|
|
||||||
### 启动 server:
|
### 启动 server:
|
||||||
|
启动server
|
||||||
```shell
|
```shell
|
||||||
cd packages/ui/certd-server
|
cd packages/ui/certd-server
|
||||||
pnpm dev
|
pnpm dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### 启动 client:
|
### 启动 client:
|
||||||
|
启动前端
|
||||||
```shell
|
```shell
|
||||||
cd packages/ui/certd-client
|
cd packages/ui/certd-client
|
||||||
pnpm dev
|
pnpm dev
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
| 证书域名数量 | 无限制 | 无限制 | 无限制 |
|
| 证书域名数量 | 无限制 | 无限制 | 无限制 |
|
||||||
| 证书流水线条数 | 无限制 | 无限制 | 无限制 |
|
| 证书流水线条数 | 无限制 | 无限制 | 无限制 |
|
||||||
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖、威联通、proxmox等 | 同专业版 |
|
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖、威联通、proxmox等 | 同专业版 |
|
||||||
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、钉钉、飞书、anpush、server酱等 | 同专业版 |
|
| 通知 | 邮件通知、自定义webhook | 企微、钉钉、飞书、anpush、server酱等 | 同专业版 |
|
||||||
| 站点监控 | 限制1条 | 无限制 | 无限制 |
|
| 站点监控 | 限制1条 | 无限制 | 无限制 |
|
||||||
| 批量操作 | 无 | 流水线模版,流水线复制,批量运行,批量设置通知、定时等 | 同专业版 |
|
| 批量操作 | 无 | 流水线模版,流水线复制,批量运行,批量设置通知、定时等 | 同专业版 |
|
||||||
| VIP群 | 无 | 可加,一对一技术支持,必要时可申请远程协助 | 商业版技术支持 |
|
| VIP群 | 无 | 可加,一对一技术支持,必要时可申请远程协助 | 商业版技术支持 |
|
||||||
|
|||||||
@@ -31,7 +31,11 @@ header中传入x-certd-token即可调用开放接口
|
|||||||
支持证书id和域名两种方式获取证书。
|
支持证书id和域名两种方式获取证书。
|
||||||
|
|
||||||
### 创建新的证书申请
|
### 创建新的证书申请
|
||||||
参数autoApply=true,将在没有证书时自动触发申请证书,检查逻辑如下:
|
参数`autoApply=true`将在没有证书时自动触发申请证书。申请参数支持另外传入:
|
||||||
|
- `autoApplyTemplateId`:使用指定 ID 的证书申请参数模版;不传时不使用模版
|
||||||
|
- `autoApplyParams`:自定义证书申请参数,会与系统默认参数、模版参数合并,并覆盖同名字段
|
||||||
|
|
||||||
|
检查逻辑如下:
|
||||||
1. 如果证书仓库里面有,且没有过期,就直接返回证书
|
1. 如果证书仓库里面有,且没有过期,就直接返回证书
|
||||||
2. 如果没有或者已过期,就会去找流水线,有就触发流水线执行
|
2. 如果没有或者已过期,就会去找流水线,有就触发流水线执行
|
||||||
3. 如果没有流水线,就创建一个流水线,触发运行(`注意:需要提前在域名管理中配置好域名校验方式,否则会申请失败`)
|
3. 如果没有流水线,就创建一个流水线,触发运行(`注意:需要提前在域名管理中配置好域名校验方式,否则会申请失败`)
|
||||||
|
|||||||
@@ -23,62 +23,63 @@
|
|||||||
| 19.| **微软云Azure授权** | |
|
| 19.| **微软云Azure授权** | |
|
||||||
| 20.| **BIND9 DNS 授权** | 通过 SSH 连接到 BIND9 服务器,使用 nsupdate 命令管理 DNS 记录 |
|
| 20.| **BIND9 DNS 授权** | 通过 SSH 连接到 BIND9 服务器,使用 nsupdate 命令管理 DNS 记录 |
|
||||||
| 21.| **CacheFly** | CacheFly |
|
| 21.| **CacheFly** | CacheFly |
|
||||||
| 22.| **EAB授权** | ZeroSSL证书申请需要EAB授权 |
|
| 22.| **ACME账号** | 用于复用ACME账号私钥和账号地址,证书申请时不再临时创建账号 |
|
||||||
| 23.| **google cloud** | 谷歌云授权 |
|
| 23.| **EAB授权** | ZeroSSL证书申请需要EAB授权 |
|
||||||
| 24.| **cloudflare授权** | |
|
| 24.| **google cloud** | 谷歌云授权 |
|
||||||
| 25.| **中国移动CND授权** | |
|
| 25.| **cloudflare授权** | |
|
||||||
| 26.| **授权插件示例** | 这是一个示例授权插件,用于演示如何实现一个授权插件 |
|
| 26.| **中国移动CND授权** | |
|
||||||
| 27.| **dns.la授权** | |
|
| 27.| **授权插件示例** | 这是一个示例授权插件,用于演示如何实现一个授权插件 |
|
||||||
| 28.| **彩虹DNS** | 彩虹DNS管理系统授权 |
|
| 28.| **dns.la授权** | |
|
||||||
| 29.| **多吉云** | |
|
| 29.| **彩虹DNS** | 彩虹DNS管理系统授权 |
|
||||||
| 30.| **Dokploy授权** | |
|
| 30.| **多吉云** | |
|
||||||
| 31.| **farcdn授权** | |
|
| 31.| **Dokploy授权** | |
|
||||||
| 32.| **FlexCDN授权** | |
|
| 32.| **farcdn授权** | |
|
||||||
| 33.| **Gcore** | Gcore |
|
| 33.| **FlexCDN授权** | |
|
||||||
| 34.| **Github授权** | |
|
| 34.| **Gcore** | Gcore |
|
||||||
| 35.| **godaddy授权** | |
|
| 35.| **Github授权** | |
|
||||||
| 36.| **HiPM DNSMgr** | HiPM DNSMgr API Token 授权 |
|
| 36.| **godaddy授权** | |
|
||||||
| 37.| **金山云授权** | |
|
| 37.| **HiPM DNSMgr** | HiPM DNSMgr API Token 授权 |
|
||||||
| 38.| **FTP授权** | |
|
| 38.| **金山云授权** | |
|
||||||
| 39.| **七牛OSS授权** | |
|
| 39.| **FTP授权** | |
|
||||||
| 40.| **腾讯云COS授权** | 腾讯云对象存储授权,包含地域和存储桶 |
|
| 40.| **七牛OSS授权** | |
|
||||||
| 41.| **s3/minio授权** | S3/minio oss授权 |
|
| 41.| **腾讯云COS授权** | 腾讯云对象存储授权,包含地域和存储桶 |
|
||||||
| 42.| **namesilo授权** | |
|
| 42.| **s3/minio授权** | S3/minio oss授权 |
|
||||||
| 43.| **Next Terminal 授权** | 用于访问 Next Terminal API 的授权配置 |
|
| 43.| **namesilo授权** | |
|
||||||
| 44.| **Nginx Proxy Manager 授权** | 用于登录 Nginx Proxy Manager,并为代理主机证书部署提供授权。 |
|
| 44.| **Next Terminal 授权** | 用于访问 Next Terminal API 的授权配置 |
|
||||||
| 45.| **1panel授权** | 账号和密码 |
|
| 45.| **Nginx Proxy Manager 授权** | 用于登录 Nginx Proxy Manager,并为代理主机证书部署提供授权。 |
|
||||||
| 46.| **支付宝** | |
|
| 46.| **1panel授权** | 账号和密码 |
|
||||||
| 47.| **白山云授权** | |
|
| 47.| **支付宝** | |
|
||||||
| 48.| **宝塔云WAF授权** | 用于连接和管理宝塔云WAF服务的授权配置 |
|
| 48.| **白山云授权** | |
|
||||||
| 49.| **cdnfly授权** | |
|
| 49.| **宝塔云WAF授权** | 用于连接和管理宝塔云WAF服务的授权配置 |
|
||||||
| 50.| **k8s授权** | |
|
| 50.| **cdnfly授权** | |
|
||||||
| 51.| **括彩云cdn授权** | 括彩云CDN,每月免费30G,[注册即领](https://kuocaicdn.com/register?code=8mn536rrzfbf8) |
|
| 51.| **k8s授权** | |
|
||||||
| 52.| **LeCDN授权** | |
|
| 52.| **括彩云cdn授权** | 括彩云CDN,每月免费30G,[注册即领](https://kuocaicdn.com/register?code=8mn536rrzfbf8) |
|
||||||
| 53.| **lucky** | |
|
| 53.| **LeCDN授权** | |
|
||||||
| 54.| **猫云授权** | |
|
| 54.| **lucky** | |
|
||||||
| 55.| **plesk授权** | |
|
| 55.| **猫云授权** | |
|
||||||
| 56.| **长亭雷池授权** | |
|
| 56.| **plesk授权** | |
|
||||||
| 57.| **群晖登录授权** | |
|
| 57.| **长亭雷池授权** | |
|
||||||
| 58.| **uniCloud** | unicloud授权 |
|
| 58.| **群晖登录授权** | |
|
||||||
| 59.| **微信支付** | |
|
| 59.| **uniCloud** | unicloud授权 |
|
||||||
| 60.| **易盾rcdn授权** | 易盾CDN,每月免费30G,[注册即领](https://rhcdn.yiduncdn.com/register?code=8mn536rrzfbf8) |
|
| 60.| **微信支付** | |
|
||||||
| 61.| **易发云短信** | sms.yfyidc.cn/ |
|
| 61.| **易盾rcdn授权** | 易盾CDN,每月免费30G,[注册即领](https://rhcdn.yiduncdn.com/register?code=8mn536rrzfbf8) |
|
||||||
| 62.| **易盾DCDN授权** | https://user.yiduncdn.com |
|
| 62.| **易发云短信** | sms.yfyidc.cn/ |
|
||||||
| 63.| **易支付** | |
|
| 63.| **易盾DCDN授权** | https://user.yiduncdn.com |
|
||||||
| 64.| **proxmox** | |
|
| 64.| **易支付** | |
|
||||||
| 65.| **Spaceship.com 授权** | Spaceship.com API 授权插件 |
|
| 65.| **proxmox** | |
|
||||||
| 66.| **Technitium DNS Server** | Technitium DNS Server 自建DNS服务器授权 |
|
| 66.| **Spaceship.com 授权** | Spaceship.com API 授权插件 |
|
||||||
| 67.| **UCloud授权** | 优刻得授权 |
|
| 67.| **Technitium DNS Server** | Technitium DNS Server 自建DNS服务器授权 |
|
||||||
| 68.| **又拍云** | |
|
| 68.| **UCloud授权** | 优刻得授权 |
|
||||||
| 69.| **网宿授权** | |
|
| 69.| **又拍云** | |
|
||||||
| 70.| **西部数码授权** | |
|
| 70.| **网宿授权** | |
|
||||||
| 71.| **我爱云授权** | 我爱云CDN |
|
| 71.| **西部数码授权** | |
|
||||||
| 72.| **新网授权(代理方式)** | |
|
| 72.| **我爱云授权** | 我爱云CDN |
|
||||||
| 73.| **新网授权** | |
|
| 73.| **新网授权(代理方式)** | |
|
||||||
| 74.| **新网互联授权** | 仅支持代理账号,ip需要加入白名单 |
|
| 74.| **新网授权** | |
|
||||||
| 75.| **Zenlayer授权** | Zenlayer授权 |
|
| 75.| **新网互联授权** | 仅支持代理账号,ip需要加入白名单 |
|
||||||
| 76.| **GoEdge授权** | |
|
| 76.| **Zenlayer授权** | Zenlayer授权 |
|
||||||
| 77.| **雨云授权** | https://app.rainyun.com/ |
|
| 77.| **GoEdge授权** | |
|
||||||
|
| 78.| **雨云授权** | https://app.rainyun.com/ |
|
||||||
|
|
||||||
<style module>
|
<style module>
|
||||||
table th:first-of-type {
|
table th:first-of-type {
|
||||||
|
|||||||
@@ -7,3 +7,4 @@
|
|||||||
* [支付宝支付配置](./payments/alipay.md)
|
* [支付宝支付配置](./payments/alipay.md)
|
||||||
* [微信支付配置](./payments/wxpay.md)
|
* [微信支付配置](./payments/wxpay.md)
|
||||||
* [彩虹易支付配置](./payments/yizhifu.md)
|
* [彩虹易支付配置](./payments/yizhifu.md)
|
||||||
|
* [插件选项映射](./plugin/)
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 133 KiB |
@@ -0,0 +1,37 @@
|
|||||||
|
# 插件选项映射
|
||||||
|
|
||||||
|
商业版可以通过插件配置,自定义插件中下拉选择框的选项显示内容。
|
||||||
|
|
||||||
|
## 适用场景
|
||||||
|
|
||||||
|
插件中部分下拉选择框的选项可能带有"免费"、"测试"等字眼,商业版运营场景下需要隐藏或改写这些文字。
|
||||||
|
|
||||||
|
## 配置方式
|
||||||
|
|
||||||
|
1. 进入"系统管理" → "插件管理"
|
||||||
|
2. 找到需要配置的插件(如 CertApply 证书申请),点击"配置"按钮
|
||||||
|
3. 在"插件参数自定义"对话框中,找到带有下拉选项的参数(如"证书颁发机构")
|
||||||
|
4. 该参数的配置行会多出一项"选项映射",点击"自定义"
|
||||||
|
|
||||||
|
### 填写映射关系
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
系统会列出该下拉框的所有**选项值**和**原始显示内容**:
|
||||||
|
|
||||||
|
| 选项值 | 原始显示 | 自定义显示 |
|
||||||
|
|---|---|---|
|
||||||
|
| letsencrypt | Let's Encrypt(免费,新手推荐,支持IP证书) | [输入框] |
|
||||||
|
| google | Google(免费) | [输入框] |
|
||||||
|
|
||||||
|
- "自定义显示"一列为输入框,默认 placeholder 显示原始内容
|
||||||
|
- 只需填写**需要改写**的选项,留空的选项将保持原始显示
|
||||||
|
- 例如:将 Let's Encrypt(免费,新手推荐,支持IP证书) 改写为 Let's Encrypt
|
||||||
|
|
||||||
|
### 保存生效
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
填写完成后保存配置,用户在创建证书流水线时看到的选项文字即会变更为自定义内容。
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 92 KiB |
@@ -8,7 +8,7 @@
|
|||||||

|

|
||||||

|

|
||||||
3. 填写域名、端口和密码
|
3. 填写域名、端口和密码
|
||||||

|

|
||||||
|
|
||||||
## QQ邮箱配置
|
## QQ邮箱配置
|
||||||
1. smtp配置
|
1. smtp配置
|
||||||
@@ -20,4 +20,6 @@ smtp端口: 465
|
|||||||
```
|
```
|
||||||
|
|
||||||
2. 获取授权码
|
2. 获取授权码
|
||||||
|
登录qq邮箱,点击账号与安全
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
+1
-1
@@ -9,5 +9,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmClient": "pnpm",
|
"npmClient": "pnpm",
|
||||||
"version": "1.40.4"
|
"version": "1.41.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,26 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/publishlab/node-acme-client/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/publishlab/node-acme-client/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([41254d1](https://github.com/publishlab/node-acme-client/commit/41254d10b748a2d3e6ba43c7e11411650c748d1b))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 支持dns-persist-01持久化验证方式申请证书,优化Acme账号的存储方式 ([67b05e2](https://github.com/publishlab/node-acme-client/commit/67b05e2d75e96b9f855e1ca0b3d0d8d03b92d8e6))
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/publishlab/node-acme-client/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([af9047b](https://github.com/publishlab/node-acme-client/commit/af9047bf3c54ce71b11727ccc6220288ed1f57be))
|
||||||
|
|
||||||
## [1.40.4](https://github.com/publishlab/node-acme-client/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/publishlab/node-acme-client/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/acme-client
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"description": "Simple and unopinionated ACME client",
|
"description": "Simple and unopinionated ACME client",
|
||||||
"private": false,
|
"private": false,
|
||||||
"author": "nmorsman",
|
"author": "nmorsman",
|
||||||
"version": "1.40.4",
|
"version": "1.41.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"types"
|
"types"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/basic": "^1.40.4",
|
"@certd/basic": "^1.41.1",
|
||||||
"@peculiar/x509": "^1.11.0",
|
"@peculiar/x509": "^1.11.0",
|
||||||
"asn1js": "^3.0.5",
|
"asn1js": "^3.0.5",
|
||||||
"axios": "^1.9.0",
|
"axios": "^1.9.0",
|
||||||
@@ -76,5 +76,5 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||||
},
|
},
|
||||||
"gitHead": "01c91ba294f88bd07fddf9358c4301bbb4027916"
|
"gitHead": "cdea411136fdf56352699a6e278a403e0f53a94f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -467,6 +467,10 @@ class AcmeClient {
|
|||||||
return createHash('sha256').update(result).digest('base64url');
|
return createHash('sha256').update(result).digest('base64url');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (challenge.type === 'dns-persist-01') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/* https://datatracker.ietf.org/doc/html/rfc8737 */
|
/* https://datatracker.ietf.org/doc/html/rfc8737 */
|
||||||
if (challenge.type === 'tls-alpn-01') {
|
if (challenge.type === 'tls-alpn-01') {
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -97,7 +97,11 @@ export interface DnsChallenge extends ChallengeAbstract {
|
|||||||
token: string;
|
token: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Challenge = HttpChallenge | DnsChallenge;
|
export interface DnsPersistChallenge extends ChallengeAbstract {
|
||||||
|
type: "dns-persist-01";
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Challenge = HttpChallenge | DnsChallenge | DnsPersistChallenge;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Certificate
|
* Certificate
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ export function createChallengeFn(opts = {}) {
|
|||||||
|
|
||||||
|
|
||||||
if (txtRecords.length === 0) {
|
if (txtRecords.length === 0) {
|
||||||
throw new Error(`没有找到TXT解析记录(${recordName})`);
|
throw new Error(`没有找到TXT解析记录(${recordName}),请稍后重试`);
|
||||||
}
|
}
|
||||||
return txtRecords;
|
return txtRecords;
|
||||||
}
|
}
|
||||||
@@ -203,6 +203,24 @@ export function createChallengeFn(opts = {}) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function verifyDnsPersistChallenge(authz, challenge, keyAuthorization, prefix = '_validation-persist.') {
|
||||||
|
const recordName = `${prefix}${authz.identifier.value.replace(/^\*\./, '')}`;
|
||||||
|
log(`本地校验DNS持久验证TXT记录: ${recordName}`);
|
||||||
|
let recordValues = await walkTxtRecord(recordName, 0, walkFromAuthoritative);
|
||||||
|
recordValues = [...new Set(recordValues)];
|
||||||
|
const expected = challenge.expectedRecordValue;
|
||||||
|
if (!expected) {
|
||||||
|
log(`未提供dns-persist-01本地校验期望值,跳过精确匹配,仅确认TXT记录存在`);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
log(`DNS查询成功, 找到 ${recordValues.length} 条TXT记录:${recordValues}`);
|
||||||
|
if (!recordValues.length || !recordValues.includes(expected)) {
|
||||||
|
throw new Error(`没有找到需要的DNS持久验证TXT记录: ${recordName},请稍后重试,期望:${expected},结果:${recordValues}`);
|
||||||
|
}
|
||||||
|
log(`DNS持久验证记录匹配成功(${challenge.type}/${recordName}):${expected}`);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify ACME TLS ALPN challenge
|
* Verify ACME TLS ALPN challenge
|
||||||
*
|
*
|
||||||
@@ -234,6 +252,7 @@ export function createChallengeFn(opts = {}) {
|
|||||||
challenges: {
|
challenges: {
|
||||||
'http-01': verifyHttpChallenge,
|
'http-01': verifyHttpChallenge,
|
||||||
'dns-01': verifyDnsChallenge,
|
'dns-01': verifyDnsChallenge,
|
||||||
|
'dns-persist-01': verifyDnsPersistChallenge,
|
||||||
'tls-alpn-01': verifyTlsAlpnChallenge,
|
'tls-alpn-01': verifyTlsAlpnChallenge,
|
||||||
},
|
},
|
||||||
walkTxtRecord,
|
walkTxtRecord,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"inlineSourceMap": false
|
"inlineSourceMap": false,
|
||||||
|
"declarationMap": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@ export interface ClientExternalAccountBindingOptions {
|
|||||||
|
|
||||||
export interface ClientAutoOptions {
|
export interface ClientAutoOptions {
|
||||||
csr: CsrBuffer | CsrString;
|
csr: CsrBuffer | CsrString;
|
||||||
challengeCreateFn: (authz: Authorization, keyAuthorization: (challenge:rfc8555.Challenge)=>Promise<string>) => Promise<{recordReq?:any,recordRes?:any,dnsProvider?:any,challenge: rfc8555.Challenge,keyAuthorization:string}>;
|
challengeCreateFn: (authz: Authorization, keyAuthorization: (challenge:rfc8555.Challenge)=>Promise<string>) => Promise<{recordReq?:any,recordRes?:any,dnsProvider?:any,challenge: rfc8555.Challenge,keyAuthorization:string,httpUploader?:any}>;
|
||||||
challengeRemoveFn: (authz: Authorization, challenge: rfc8555.Challenge, keyAuthorization: string,recordReq:any, recordRes:any,dnsProvider:any,httpUploader:any) => Promise<any>;
|
challengeRemoveFn: (authz: Authorization, challenge: rfc8555.Challenge, keyAuthorization: string,recordReq:any, recordRes:any,dnsProvider:any,httpUploader:any) => Promise<any>;
|
||||||
email?: string;
|
email?: string;
|
||||||
termsOfServiceAgreed?: boolean;
|
termsOfServiceAgreed?: boolean;
|
||||||
|
|||||||
+5
-1
@@ -97,7 +97,11 @@ export interface DnsChallenge extends ChallengeAbstract {
|
|||||||
token: string;
|
token: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Challenge = HttpChallenge | DnsChallenge;
|
export interface DnsPersistChallenge extends ChallengeAbstract {
|
||||||
|
type: 'dns-persist-01';
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Challenge = HttpChallenge | DnsChallenge | DnsPersistChallenge;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Certificate
|
* Certificate
|
||||||
|
|||||||
@@ -3,6 +3,20 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **settings:** 新增NO_PROXY代理排除配置 ([c0df8be](https://github.com/certd/certd/commit/c0df8be83237e323c2c9a5bd02507430a86a00cc))
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/basic
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/basic
|
||||||
|
|
||||||
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/basic
|
**Note:** Version bump only for package @certd/basic
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
00:18
|
02:33
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/basic",
|
"name": "@certd/basic",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.40.4",
|
"version": "1.41.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
@@ -52,5 +52,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "01c91ba294f88bd07fddf9358c4301bbb4027916"
|
"gitHead": "cdea411136fdf56352699a6e278a403e0f53a94f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import { createAxiosService, HttpClient, setGlobalHeaders } from "./util.request.js";
|
import { createAgent, createAxiosService, getGlobalAgents, HttpClient, isNoProxyMatched, setGlobalHeaders, setGlobalProxy } from "./util.request.js";
|
||||||
import { ILogger } from "./util.log.js";
|
import { ILogger } from "./util.log.js";
|
||||||
|
|
||||||
const testLogger = {
|
const testLogger = {
|
||||||
|
debug() {},
|
||||||
info() {},
|
info() {},
|
||||||
error() {},
|
error() {},
|
||||||
} as unknown as ILogger;
|
} as unknown as ILogger;
|
||||||
@@ -10,6 +11,9 @@ const testLogger = {
|
|||||||
describe("util.request", () => {
|
describe("util.request", () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
setGlobalHeaders({});
|
setGlobalHeaders({});
|
||||||
|
setGlobalProxy({});
|
||||||
|
delete process.env.NO_PROXY;
|
||||||
|
delete process.env.no_proxy;
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should merge global headers without overriding request headers", async () => {
|
it("should merge global headers without overriding request headers", async () => {
|
||||||
@@ -50,4 +54,122 @@ describe("util.request", () => {
|
|||||||
request: "request",
|
request: "request",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should set no_proxy environment variables", () => {
|
||||||
|
setGlobalProxy({
|
||||||
|
httpProxy: "http://127.0.0.1:1080",
|
||||||
|
httpsProxy: "http://127.0.0.1:1080",
|
||||||
|
noProxy: "localhost,*.internal.example.com",
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(process.env.NO_PROXY).to.equal("localhost,*.internal.example.com");
|
||||||
|
expect(process.env.no_proxy).to.equal("localhost,*.internal.example.com");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should normalize multiline no_proxy environment variables", () => {
|
||||||
|
setGlobalProxy({
|
||||||
|
noProxy: "localhost\n127.0.0.1, 192.168.*\n*.internal.example.com",
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(process.env.NO_PROXY).to.equal("localhost,127.0.0.1,192.168.*,*.internal.example.com");
|
||||||
|
expect(process.env.no_proxy).to.equal("localhost,127.0.0.1,192.168.*,*.internal.example.com");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not change environment variables when creating agents", () => {
|
||||||
|
process.env.HTTP_PROXY = "http://old-http-proxy";
|
||||||
|
process.env.HTTPS_PROXY = "http://old-https-proxy";
|
||||||
|
process.env.NO_PROXY = "old.local";
|
||||||
|
|
||||||
|
createAgent({
|
||||||
|
httpProxy: "http://127.0.0.1:1080",
|
||||||
|
httpsProxy: "http://127.0.0.1:1081",
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(process.env.HTTP_PROXY).to.equal("http://old-http-proxy");
|
||||||
|
expect(process.env.HTTPS_PROXY).to.equal("http://old-https-proxy");
|
||||||
|
expect(process.env.NO_PROXY).to.equal("old.local");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should bypass global proxy when request host matches no_proxy", async () => {
|
||||||
|
setGlobalProxy({
|
||||||
|
httpProxy: "http://127.0.0.1:1080",
|
||||||
|
httpsProxy: "http://127.0.0.1:1080",
|
||||||
|
noProxy: "localhost,.internal.example.com",
|
||||||
|
});
|
||||||
|
|
||||||
|
const globalAgents = getGlobalAgents();
|
||||||
|
const http = createAxiosService({ logger: testLogger }) as HttpClient;
|
||||||
|
const res = await http.request({
|
||||||
|
url: "https://api.internal.example.com",
|
||||||
|
method: "get",
|
||||||
|
logReq: false,
|
||||||
|
logRes: false,
|
||||||
|
adapter: async config => {
|
||||||
|
return {
|
||||||
|
config,
|
||||||
|
data: {
|
||||||
|
usesGlobalHttpAgent: config.httpAgent === globalAgents.httpAgent,
|
||||||
|
usesGlobalHttpsAgent: config.httpsAgent === globalAgents.httpsAgent,
|
||||||
|
},
|
||||||
|
headers: {},
|
||||||
|
status: 200,
|
||||||
|
statusText: "OK",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(res).to.deep.equal({
|
||||||
|
usesGlobalHttpAgent: false,
|
||||||
|
usesGlobalHttpsAgent: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should bypass custom request proxy when request host matches no_proxy", async () => {
|
||||||
|
setGlobalProxy({
|
||||||
|
noProxy: ".internal.example.com",
|
||||||
|
});
|
||||||
|
|
||||||
|
const http = createAxiosService({ logger: testLogger }) as HttpClient;
|
||||||
|
const res = await http.request({
|
||||||
|
url: "https://api.internal.example.com",
|
||||||
|
method: "get",
|
||||||
|
httpProxy: "http://127.0.0.1:1080",
|
||||||
|
logReq: false,
|
||||||
|
logRes: false,
|
||||||
|
adapter: async config => {
|
||||||
|
return {
|
||||||
|
config,
|
||||||
|
data: {
|
||||||
|
httpAgent: config.httpAgent?.constructor?.name,
|
||||||
|
httpsAgent: config.httpsAgent?.constructor?.name,
|
||||||
|
},
|
||||||
|
headers: {},
|
||||||
|
status: 200,
|
||||||
|
statusText: "OK",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(res).to.deep.equal({
|
||||||
|
httpAgent: "Agent",
|
||||||
|
httpsAgent: "Agent",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should match no_proxy rules", () => {
|
||||||
|
expect(isNoProxyMatched("*", { hostname: "api.example.com", port: "" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched("api.example.com", { hostname: "api.example.com", port: "" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched("example.com", { hostname: "api.example.com", port: "" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched(".example.com", { hostname: "api.example.com", port: "" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched("*.example.com", { hostname: "api.example.com", port: "" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched("127.0.0.1", { hostname: "127.0.0.1", port: "" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched("192.168.*", { hostname: "192.168.1.10", port: "" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched("192.168.*", { hostname: "192.169.1.10", port: "" })).to.equal(false);
|
||||||
|
expect(isNoProxyMatched("[::1]", { hostname: "::1", port: "" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched("[::1]:8443", { hostname: "::1", port: "8443" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched("api.example.com:8443", { hostname: "api.example.com", port: "8443" })).to.equal(true);
|
||||||
|
expect(isNoProxyMatched("api.example.com:8443", { hostname: "api.example.com", port: "443" })).to.equal(false);
|
||||||
|
expect(isNoProxyMatched("127.0.0.1", { hostname: "127.0.0.2", port: "" })).to.equal(false);
|
||||||
|
expect(isNoProxyMatched(".example.com", { hostname: "example.org", port: "" })).to.equal(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -82,11 +82,24 @@ export class HttpError extends Error {
|
|||||||
export const HttpCommonError = HttpError;
|
export const HttpCommonError = HttpError;
|
||||||
|
|
||||||
let defaultAgents = createAgent();
|
let defaultAgents = createAgent();
|
||||||
|
const directAgents = createAgent();
|
||||||
|
let defaultProxyOptions: GlobalProxyOptions = {};
|
||||||
let defaultHeaders: Record<string, string> = {};
|
let defaultHeaders: Record<string, string> = {};
|
||||||
|
|
||||||
export function setGlobalProxy(opts: { httpProxy?: string; httpsProxy?: string }) {
|
export type GlobalProxyOptions = {
|
||||||
|
httpProxy?: string;
|
||||||
|
httpsProxy?: string;
|
||||||
|
noProxy?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function setGlobalProxy(opts: GlobalProxyOptions) {
|
||||||
logger.info("setGlobalProxy:", opts);
|
logger.info("setGlobalProxy:", opts);
|
||||||
defaultAgents = createAgent(opts);
|
defaultProxyOptions = { ...opts };
|
||||||
|
defaultAgents = createAgent({
|
||||||
|
httpProxy: opts.httpProxy,
|
||||||
|
httpsProxy: opts.httpsProxy,
|
||||||
|
});
|
||||||
|
setProxyEnvironment(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getGlobalAgents() {
|
export function getGlobalAgents() {
|
||||||
@@ -137,21 +150,25 @@ export function createAxiosService({ logger }: { logger: ILogger }) {
|
|||||||
if (config.timeout == null) {
|
if (config.timeout == null) {
|
||||||
config.timeout = 15000;
|
config.timeout = 15000;
|
||||||
}
|
}
|
||||||
let agents = defaultAgents;
|
const bypassProxy = shouldBypassProxy(config, defaultProxyOptions.noProxy);
|
||||||
if (config.skipSslVerify || config.httpProxy) {
|
const useCustomProxy = !!config.httpProxy && !bypassProxy;
|
||||||
let rejectUnauthorized = true;
|
let agents = bypassProxy ? directAgents : defaultAgents;
|
||||||
|
if (bypassProxy) {
|
||||||
|
logger.info("命中no_proxy配置,跳过代理:", config.url);
|
||||||
|
}
|
||||||
|
if (config.skipSslVerify || useCustomProxy) {
|
||||||
|
const agentOptions: any = {};
|
||||||
if (config.skipSslVerify) {
|
if (config.skipSslVerify) {
|
||||||
logger.info("忽略接口请求的SSL校验");
|
logger.info("忽略接口请求的SSL校验");
|
||||||
rejectUnauthorized = false;
|
agentOptions.rejectUnauthorized = false;
|
||||||
}
|
}
|
||||||
const proxy: any = {};
|
if (useCustomProxy) {
|
||||||
if (config.httpProxy) {
|
|
||||||
logger.info("使用自定义http代理:", config.httpProxy);
|
logger.info("使用自定义http代理:", config.httpProxy);
|
||||||
proxy.httpProxy = config.httpProxy;
|
agentOptions.httpProxy = config.httpProxy;
|
||||||
proxy.httpsProxy = config.httpProxy;
|
agentOptions.httpsProxy = config.httpProxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
agents = createAgent({ rejectUnauthorized, ...proxy } as any);
|
agents = createAgent(agentOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete config.skipSslVerify;
|
delete config.skipSslVerify;
|
||||||
@@ -354,7 +371,7 @@ export type CreateAgentOptions = {
|
|||||||
httpsProxy?: string;
|
httpsProxy?: string;
|
||||||
} & nodeHttp.AgentOptions;
|
} & nodeHttp.AgentOptions;
|
||||||
export function createAgent(opts: CreateAgentOptions = {}) {
|
export function createAgent(opts: CreateAgentOptions = {}) {
|
||||||
opts = merge(
|
const { httpProxy, httpsProxy, ...agentOptions } = merge(
|
||||||
{
|
{
|
||||||
autoSelectFamily: true,
|
autoSelectFamily: true,
|
||||||
autoSelectFamilyAttemptTimeout: 1000,
|
autoSelectFamilyAttemptTimeout: 1000,
|
||||||
@@ -364,29 +381,19 @@ export function createAgent(opts: CreateAgentOptions = {}) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let httpAgent, httpsAgent;
|
let httpAgent, httpsAgent;
|
||||||
const httpProxy = opts.httpProxy;
|
|
||||||
if (httpProxy) {
|
if (httpProxy) {
|
||||||
process.env.HTTP_PROXY = httpProxy;
|
|
||||||
process.env.http_proxy = httpProxy;
|
|
||||||
logger.info("use httpProxy:", httpProxy);
|
logger.info("use httpProxy:", httpProxy);
|
||||||
httpAgent = new HttpProxyAgent(httpProxy, opts as any);
|
httpAgent = new HttpProxyAgent(httpProxy, agentOptions as any);
|
||||||
merge(httpAgent.options, opts);
|
merge(httpAgent.options, agentOptions);
|
||||||
} else {
|
} else {
|
||||||
process.env.HTTP_PROXY = "";
|
httpAgent = new nodeHttp.Agent(agentOptions);
|
||||||
process.env.http_proxy = "";
|
|
||||||
httpAgent = new nodeHttp.Agent(opts);
|
|
||||||
}
|
}
|
||||||
const httpsProxy = opts.httpsProxy;
|
|
||||||
if (httpsProxy) {
|
if (httpsProxy) {
|
||||||
process.env.HTTPS_PROXY = httpsProxy;
|
|
||||||
process.env.https_proxy = httpsProxy;
|
|
||||||
logger.info("use httpsProxy:", httpsProxy);
|
logger.info("use httpsProxy:", httpsProxy);
|
||||||
httpsAgent = new HttpsProxyAgent(httpsProxy, opts as any);
|
httpsAgent = new HttpsProxyAgent(httpsProxy, agentOptions as any);
|
||||||
merge(httpsAgent.options, opts);
|
merge(httpsAgent.options, agentOptions);
|
||||||
} else {
|
} else {
|
||||||
process.env.HTTPS_PROXY = "";
|
httpsAgent = new https.Agent(agentOptions);
|
||||||
process.env.https_proxy = "";
|
|
||||||
httpsAgent = new https.Agent(opts);
|
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
httpAgent,
|
httpAgent,
|
||||||
@@ -394,6 +401,145 @@ export function createAgent(opts: CreateAgentOptions = {}) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setProxyEnvironment(opts: GlobalProxyOptions = {}) {
|
||||||
|
setEnvValue("HTTP_PROXY", opts.httpProxy);
|
||||||
|
setEnvValue("http_proxy", opts.httpProxy);
|
||||||
|
setEnvValue("HTTPS_PROXY", opts.httpsProxy);
|
||||||
|
setEnvValue("https_proxy", opts.httpsProxy);
|
||||||
|
const noProxy = normalizeNoProxyText(opts.noProxy);
|
||||||
|
setEnvValue("NO_PROXY", noProxy);
|
||||||
|
setEnvValue("no_proxy", noProxy);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setEnvValue(key: string, value?: string) {
|
||||||
|
process.env[key] = value || "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function shouldBypassProxy(config: AxiosRequestConfig, noProxy?: string) {
|
||||||
|
if (!noProxy) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const target = getRequestTarget(config);
|
||||||
|
if (!target) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return splitNoProxyRules(noProxy).some(item => isNoProxyMatched(item, target));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRequestTarget(config: AxiosRequestConfig) {
|
||||||
|
try {
|
||||||
|
const baseURL = config.baseURL || undefined;
|
||||||
|
const url = new URL(config.url || "", baseURL);
|
||||||
|
return {
|
||||||
|
hostname: normalizeHost(url.hostname),
|
||||||
|
port: url.port,
|
||||||
|
};
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isNoProxyMatched(rule: string, target: { hostname: string; port: string }) {
|
||||||
|
if (rule === "*") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const normalizedRule = normalizeNoProxyRule(rule);
|
||||||
|
if (!normalizedRule.host) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (normalizedRule.port && normalizedRule.port !== target.port) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const host = normalizeHost(target.hostname);
|
||||||
|
if (normalizedRule.host.includes("*")) {
|
||||||
|
return wildcardHostMatched(normalizedRule.host, host);
|
||||||
|
}
|
||||||
|
if (normalizedRule.host.startsWith("*.")) {
|
||||||
|
const suffix = normalizedRule.host.substring(1);
|
||||||
|
return host.endsWith(suffix);
|
||||||
|
}
|
||||||
|
if (normalizedRule.host.startsWith(".")) {
|
||||||
|
return host === normalizedRule.host.substring(1) || host.endsWith(normalizedRule.host);
|
||||||
|
}
|
||||||
|
return host === normalizedRule.host || host.endsWith(`.${normalizedRule.host}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeNoProxyRule(rule: string) {
|
||||||
|
let value = rule.trim().toLowerCase();
|
||||||
|
if (value.includes("://")) {
|
||||||
|
try {
|
||||||
|
const url = new URL(value);
|
||||||
|
return {
|
||||||
|
host: normalizeHost(url.hostname),
|
||||||
|
port: url.port,
|
||||||
|
};
|
||||||
|
} catch (e) {
|
||||||
|
return {
|
||||||
|
host: "",
|
||||||
|
port: "",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let port = "";
|
||||||
|
if (value.startsWith("[")) {
|
||||||
|
const closeIndex = value.indexOf("]");
|
||||||
|
const host = value.substring(1, closeIndex);
|
||||||
|
const rest = value.substring(closeIndex + 1);
|
||||||
|
if (rest.startsWith(":")) {
|
||||||
|
port = rest.substring(1);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
host: normalizeHost(host),
|
||||||
|
port,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const colonCount = (value.match(/:/g) || []).length;
|
||||||
|
const portIndex = value.lastIndexOf(":");
|
||||||
|
if (colonCount === 1 && portIndex > -1) {
|
||||||
|
port = value.substring(portIndex + 1);
|
||||||
|
value = value.substring(0, portIndex);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
host: normalizeHost(value),
|
||||||
|
port,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeHost(host: string) {
|
||||||
|
let value = host.trim().toLowerCase();
|
||||||
|
if (value.startsWith("[") && value.endsWith("]")) {
|
||||||
|
value = value.substring(1, value.length - 1);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function wildcardHostMatched(rule: string, host: string) {
|
||||||
|
const pattern = rule.split("*").map(escapeRegExp).join(".*");
|
||||||
|
return new RegExp(`^${pattern}$`).test(host);
|
||||||
|
}
|
||||||
|
|
||||||
|
function escapeRegExp(value: string) {
|
||||||
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeNoProxyText(noProxy?: string) {
|
||||||
|
return splitNoProxyRules(noProxy).join(",");
|
||||||
|
}
|
||||||
|
|
||||||
|
function splitNoProxyRules(noProxy?: string) {
|
||||||
|
if (!noProxy) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return noProxy
|
||||||
|
.split(/[,\s]+/)
|
||||||
|
.map(item => item.trim())
|
||||||
|
.filter(Boolean);
|
||||||
|
}
|
||||||
|
|
||||||
export async function download(req: { http: HttpClient; config: HttpRequestConfig; savePath: string; logger: ILogger }) {
|
export async function download(req: { http: HttpClient; config: HttpRequestConfig; savePath: string; logger: ILogger }) {
|
||||||
const { http, config, savePath, logger } = req;
|
const { http, config, savePath, logger } = req;
|
||||||
return safePromise((resolve, reject) => {
|
return safePromise((resolve, reject) => {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"inlineSourceMap": false
|
"inlineSourceMap": false,
|
||||||
|
"declarationMap": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,26 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([41254d1](https://github.com/certd/certd/commit/41254d10b748a2d3e6ba43c7e11411650c748d1b))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 支持dns-persist-01持久化验证方式申请证书,优化Acme账号的存储方式 ([67b05e2](https://github.com/certd/certd/commit/67b05e2d75e96b9f855e1ca0b3d0d8d03b92d8e6))
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([af9047b](https://github.com/certd/certd/commit/af9047bf3c54ce71b11727ccc6220288ed1f57be))
|
||||||
|
|
||||||
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/pipeline
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/pipeline",
|
"name": "@certd/pipeline",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.40.4",
|
"version": "1.41.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
"compile": "tsc --skipLibCheck --watch"
|
"compile": "tsc --skipLibCheck --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/basic": "^1.40.4",
|
"@certd/basic": "^1.41.1",
|
||||||
"@certd/plus-core": "^1.40.4",
|
"@certd/plus-core": "^1.41.1",
|
||||||
"dayjs": "^1.11.7",
|
"dayjs": "^1.11.7",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"reflect-metadata": "^0.1.13"
|
"reflect-metadata": "^0.1.13"
|
||||||
@@ -49,5 +49,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "01c91ba294f88bd07fddf9358c4301bbb4027916"
|
"gitHead": "cdea411136fdf56352699a6e278a403e0f53a94f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export type AccessInputDefine = FormItemProps & {
|
|||||||
};
|
};
|
||||||
export type AccessDefine = Registrable & {
|
export type AccessDefine = Registrable & {
|
||||||
icon?: string;
|
icon?: string;
|
||||||
|
subtype?: string;
|
||||||
input?: {
|
input?: {
|
||||||
[key: string]: AccessInputDefine;
|
[key: string]: AccessInputDefine;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"inlineSourceMap": false
|
"inlineSourceMap": false,
|
||||||
|
"declarationMap": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|
||||||
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-huawei
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-huawei",
|
"name": "@certd/lib-huawei",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.40.4",
|
"version": "1.41.1",
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/bundle.js",
|
"module": "./dist/bundle.js",
|
||||||
"types": "./dist/d/index.d.ts",
|
"types": "./dist/d/index.d.ts",
|
||||||
@@ -27,5 +27,5 @@
|
|||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"tslib": "^2.8.1"
|
"tslib": "^2.8.1"
|
||||||
},
|
},
|
||||||
"gitHead": "01c91ba294f88bd07fddf9358c4301bbb4027916"
|
"gitHead": "cdea411136fdf56352699a6e278a403e0f53a94f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"inlineSourceMap": false
|
"inlineSourceMap": false,
|
||||||
|
"declarationMap": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-iframe
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-iframe
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-iframe
|
||||||
|
|
||||||
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-iframe
|
**Note:** Version bump only for package @certd/lib-iframe
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-iframe",
|
"name": "@certd/lib-iframe",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.40.4",
|
"version": "1.41.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
@@ -34,5 +34,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "01c91ba294f88bd07fddf9358c4301bbb4027916"
|
"gitHead": "cdea411136fdf56352699a6e278a403e0f53a94f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"inlineSourceMap": false
|
"inlineSourceMap": false,
|
||||||
|
"declarationMap": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/jdcloud
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/jdcloud
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/jdcloud
|
||||||
|
|
||||||
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/jdcloud
|
**Note:** Version bump only for package @certd/jdcloud
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/jdcloud",
|
"name": "@certd/jdcloud",
|
||||||
"version": "1.40.4",
|
"version": "1.41.1",
|
||||||
"description": "jdcloud openApi sdk",
|
"description": "jdcloud openApi sdk",
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/bundle.js",
|
"module": "./dist/bundle.js",
|
||||||
@@ -59,5 +59,5 @@
|
|||||||
"fetch"
|
"fetch"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"gitHead": "01c91ba294f88bd07fddf9358c4301bbb4027916"
|
"gitHead": "cdea411136fdf56352699a6e278a403e0f53a94f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"inlineSourceMap": false
|
"inlineSourceMap": false,
|
||||||
|
"declarationMap": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-k8s
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-k8s",
|
"name": "@certd/lib-k8s",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.40.4",
|
"version": "1.41.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
"compile": "tsc --skipLibCheck --watch"
|
"compile": "tsc --skipLibCheck --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/basic": "^1.40.4",
|
"@certd/basic": "^1.41.1",
|
||||||
"@kubernetes/client-node": "0.21.0"
|
"@kubernetes/client-node": "0.21.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -36,5 +36,5 @@
|
|||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "01c91ba294f88bd07fddf9358c4301bbb4027916"
|
"gitHead": "cdea411136fdf56352699a6e278a403e0f53a94f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"inlineSourceMap": false
|
"inlineSourceMap": false,
|
||||||
|
"declarationMap": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,30 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **settings:** 新增NO_PROXY代理排除配置 ([c0df8be](https://github.com/certd/certd/commit/c0df8be83237e323c2c9a5bd02507430a86a00cc))
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([41254d1](https://github.com/certd/certd/commit/41254d10b748a2d3e6ba43c7e11411650c748d1b))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 新增套餐激活码功能,通过CDK兑换套餐 ([81d6289](https://github.com/certd/certd/commit/81d6289a8631b073b49f24dee4b14bb1c8f31071))
|
||||||
|
* 新增推广等级激励功能 ([5096df5](https://github.com/certd/certd/commit/5096df5cc0d8f0ad8aa327b8e2a900ba23714bd8))
|
||||||
|
* 支持dns-persist-01持久化验证方式申请证书,优化Acme账号的存储方式 ([67b05e2](https://github.com/certd/certd/commit/67b05e2d75e96b9f855e1ca0b3d0d8d03b92d8e6))
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云证书订单orderid 选择出错的问题 ([af9047b](https://github.com/certd/certd/commit/af9047bf3c54ce71b11727ccc6220288ed1f57be))
|
||||||
|
|
||||||
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-server",
|
"name": "@certd/lib-server",
|
||||||
"version": "1.40.4",
|
"version": "1.41.1",
|
||||||
"description": "midway with flyway, sql upgrade way ",
|
"description": "midway with flyway, sql upgrade way ",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -29,11 +29,11 @@
|
|||||||
],
|
],
|
||||||
"license": "AGPL",
|
"license": "AGPL",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.40.4",
|
"@certd/acme-client": "^1.41.1",
|
||||||
"@certd/basic": "^1.40.4",
|
"@certd/basic": "^1.41.1",
|
||||||
"@certd/pipeline": "^1.40.4",
|
"@certd/pipeline": "^1.41.1",
|
||||||
"@certd/plugin-lib": "^1.40.4",
|
"@certd/plugin-lib": "^1.41.1",
|
||||||
"@certd/plus-core": "^1.40.4",
|
"@certd/plus-core": "^1.41.1",
|
||||||
"@midwayjs/cache": "3.14.0",
|
"@midwayjs/cache": "3.14.0",
|
||||||
"@midwayjs/core": "3.20.11",
|
"@midwayjs/core": "3.20.11",
|
||||||
"@midwayjs/i18n": "3.20.13",
|
"@midwayjs/i18n": "3.20.13",
|
||||||
@@ -69,5 +69,5 @@
|
|||||||
"typeorm": "^0.3.11",
|
"typeorm": "^0.3.11",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "01c91ba294f88bd07fddf9358c4301bbb4027916"
|
"gitHead": "cdea411136fdf56352699a6e278a403e0f53a94f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export abstract class BaseController {
|
|||||||
|
|
||||||
async getProjectId(permission:string) {
|
async getProjectId(permission:string) {
|
||||||
if (!isEnterprise()) {
|
if (!isEnterprise()) {
|
||||||
return null
|
return undefined
|
||||||
}
|
}
|
||||||
let projectIdStr = this.ctx.headers["project-id"] as string;
|
let projectIdStr = this.ctx.headers["project-id"] as string;
|
||||||
if (!projectIdStr){
|
if (!projectIdStr){
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { PermissionException, ValidateException } from './exception/index.js';
|
import { PermissionException, ValidateException } from './exception/index.js';
|
||||||
import { FindOneOptions, In, Repository, SelectQueryBuilder } from 'typeorm';
|
import { EntityTarget, FindOneOptions, In, Repository, SelectQueryBuilder } from 'typeorm';
|
||||||
import { Inject } from '@midwayjs/core';
|
import { Inject } from '@midwayjs/core';
|
||||||
import { TypeORMDataSourceManager } from '@midwayjs/typeorm';
|
import { TypeORMDataSourceManager } from '@midwayjs/typeorm';
|
||||||
import { EntityManager } from 'typeorm/entity-manager/EntityManager.js';
|
import { EntityManager } from 'typeorm/entity-manager/EntityManager.js';
|
||||||
@@ -20,6 +20,10 @@ export type ListReq<T = any> = {
|
|||||||
select?: any;
|
select?: any;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type ServiceContext = {
|
||||||
|
manager?: EntityManager;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务基类
|
* 服务基类
|
||||||
*/
|
*/
|
||||||
@@ -34,6 +38,34 @@ export abstract class BaseService<T> {
|
|||||||
return await dataSource.transaction(callback as any);
|
return await dataSource.transaction(callback as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果 ctx 有 manager 则复用已有事务,否则开启新事务
|
||||||
|
*/
|
||||||
|
protected async transactionWithCtx<T>(ctx: ServiceContext, callback: (manager: EntityManager) => Promise<T>): Promise<T> {
|
||||||
|
if (ctx.manager) {
|
||||||
|
return await callback(ctx.manager);
|
||||||
|
}
|
||||||
|
return (await this.transaction(callback)) as T;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected getRepo<E>(ctx: ServiceContext, entity: EntityTarget<E>): Repository<E> {
|
||||||
|
if (ctx.manager) {
|
||||||
|
return ctx.manager.getRepository(entity);
|
||||||
|
}
|
||||||
|
const dataSource = this.dataSourceManager.getDataSource('default');
|
||||||
|
return dataSource.getRepository(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected buildUserProjectQuery(userId: number, projectId?: number) {
|
||||||
|
const query: { userId: number; projectId?: number; [key: string]: any } = {
|
||||||
|
userId,
|
||||||
|
};
|
||||||
|
if (projectId != null) {
|
||||||
|
query.projectId = projectId;
|
||||||
|
}
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得单个ID
|
* 获得单个ID
|
||||||
* @param id ID
|
* @param id ID
|
||||||
@@ -250,12 +282,12 @@ export abstract class BaseService<T> {
|
|||||||
async batchDelete(ids: number[], userId: number,projectId?:number) {
|
async batchDelete(ids: number[], userId: number,projectId?:number) {
|
||||||
ids = this.filterIds(ids);
|
ids = this.filterIds(ids);
|
||||||
if(userId!=null){
|
if(userId!=null){
|
||||||
|
const userProjectQuery = this.buildUserProjectQuery(userId, projectId);
|
||||||
const list = await this.getRepository().find({
|
const list = await this.getRepository().find({
|
||||||
where: {
|
where: {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
id: In(ids),
|
id: In(ids),
|
||||||
userId,
|
...userProjectQuery,
|
||||||
projectId,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ export const Constants = {
|
|||||||
guest: '_guest_',
|
guest: '_guest_',
|
||||||
//无需登录
|
//无需登录
|
||||||
anonymous: '_guest_',
|
anonymous: '_guest_',
|
||||||
|
//无需登录,有 token 时解析当前用户
|
||||||
|
guestOptionalAuth: '_guestOptionalAuth_',
|
||||||
//仅需要登录
|
//仅需要登录
|
||||||
authOnly: '_authOnly_',
|
authOnly: '_authOnly_',
|
||||||
//仅需要登录
|
//仅需要登录
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
/// <reference types="node" />
|
||||||
|
|
||||||
|
import assert from "node:assert/strict";
|
||||||
|
import fs from "node:fs";
|
||||||
|
import os from "node:os";
|
||||||
|
import path from "node:path";
|
||||||
|
import { FileService } from "./file-service.js";
|
||||||
|
|
||||||
|
function createUploadFile(key: string) {
|
||||||
|
const uploadRootDir = "./data/upload";
|
||||||
|
const filePath = path.join(uploadRootDir, key);
|
||||||
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
||||||
|
fs.writeFileSync(filePath, "test");
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
describe("FileService.getFile", () => {
|
||||||
|
let cwd: string;
|
||||||
|
let oldCwd: string;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
oldCwd = process.cwd();
|
||||||
|
cwd = fs.mkdtempSync(path.join(os.tmpdir(), "certd-file-service-"));
|
||||||
|
process.chdir(cwd);
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
process.chdir(oldCwd);
|
||||||
|
fs.rmSync(cwd, { recursive: true, force: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
it("allows admin to read another user's private file", () => {
|
||||||
|
const service = new FileService();
|
||||||
|
const userIdMd5 = Buffer.from(Buffer.from("2").toString("base64")).toString("hex");
|
||||||
|
const key = `/private/${userIdMd5}/2026_05_25/qr.png`;
|
||||||
|
const expectedPath = createUploadFile(key);
|
||||||
|
|
||||||
|
const filePath = service.getFile(key, 1, true);
|
||||||
|
|
||||||
|
assert.equal(filePath, expectedPath);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -56,7 +56,7 @@ export class FileService {
|
|||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFile(key: string, userId?: number) {
|
getFile(key: string, userId?: number, allowAnyPrivateUser = false) {
|
||||||
if (!key) {
|
if (!key) {
|
||||||
throw new ParamException('参数错误');
|
throw new ParamException('参数错误');
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ export class FileService {
|
|||||||
const keyArr = key.split('/');
|
const keyArr = key.split('/');
|
||||||
const permission = keyArr[1];
|
const permission = keyArr[1];
|
||||||
const userIdMd5 = keyArr[2];
|
const userIdMd5 = keyArr[2];
|
||||||
if (permission !== 'public') {
|
if (permission !== 'public' && !allowAnyPrivateUser) {
|
||||||
//非公开文件需要验证用户
|
//非公开文件需要验证用户
|
||||||
const userIdStr = Buffer.from(Buffer.from(userIdMd5, 'hex').toString('base64')).toString();
|
const userIdStr = Buffer.from(Buffer.from(userIdMd5, 'hex').toString('base64')).toString();
|
||||||
const userIdInt: number = parseInt(userIdStr, 10);
|
const userIdInt: number = parseInt(userIdStr, 10);
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export class SysPrivateSettings extends BaseSettings {
|
|||||||
|
|
||||||
httpsProxy? = '';
|
httpsProxy? = '';
|
||||||
httpProxy? = '';
|
httpProxy? = '';
|
||||||
|
noProxy? = '';
|
||||||
commonHeaders?: string = '';
|
commonHeaders?: string = '';
|
||||||
|
|
||||||
reverseProxies?: Record<string, string> = {};
|
reverseProxies?: Record<string, string> = {};
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
|||||||
const opts = {
|
const opts = {
|
||||||
httpProxy: privateSetting.httpProxy,
|
httpProxy: privateSetting.httpProxy,
|
||||||
httpsProxy: privateSetting.httpsProxy,
|
httpsProxy: privateSetting.httpsProxy,
|
||||||
|
noProxy: privateSetting.noProxy,
|
||||||
};
|
};
|
||||||
setGlobalProxy(opts);
|
setGlobalProxy(opts);
|
||||||
setGlobalHeaders(this.parseKeyValueText(privateSetting.commonHeaders));
|
setGlobalHeaders(this.parseKeyValueText(privateSetting.commonHeaders));
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ export class AccessEntity {
|
|||||||
@Column({ comment: '类型', length: 100 })
|
@Column({ comment: '类型', length: 100 })
|
||||||
type: string;
|
type: string;
|
||||||
|
|
||||||
|
@Column({ name: 'subtype', comment: '子类型', length: 100, nullable: true })
|
||||||
|
subtype: string;
|
||||||
|
|
||||||
@Column({ name: 'setting', comment: '设置', length: 10240, nullable: true })
|
@Column({ name: 'setting', comment: '设置', length: 10240, nullable: true })
|
||||||
setting: string;
|
setting: string;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { IAccessService } from '@certd/pipeline';
|
import { IAccessService } from "@certd/pipeline";
|
||||||
|
|
||||||
export class AccessGetter implements IAccessService {
|
export class AccessGetter implements IAccessService {
|
||||||
userId: number;
|
userId: number;
|
||||||
@@ -15,6 +15,6 @@ export class AccessGetter implements IAccessService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getCommonById<T = any>(id: any) {
|
async getCommonById<T = any>(id: any) {
|
||||||
return await this.getter<T>(id, 0,null);
|
return await this.getter<T>(id, 0, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
import assert from "assert";
|
import assert from "assert";
|
||||||
|
import esmock from "esmock";
|
||||||
import { AccessService } from "./access-service.js";
|
import { AccessService } from "./access-service.js";
|
||||||
|
|
||||||
describe("AccessService", () => {
|
describe("AccessService", () => {
|
||||||
it("does not write id into access setting when updating selected fields", async () => {
|
it("does not write id into access setting when updating selected fields", async () => {
|
||||||
let updateParam: any;
|
let updateParam: any;
|
||||||
const service = new AccessService();
|
const service = new AccessService();
|
||||||
service.info = async () => ({
|
service.info = async () =>
|
||||||
id: 12,
|
({
|
||||||
type: "eab",
|
id: 12,
|
||||||
} as any);
|
type: "eab",
|
||||||
|
}) as any;
|
||||||
service.decryptAccessEntity = () => ({
|
service.decryptAccessEntity = () => ({
|
||||||
kid: "kid-1",
|
kid: "kid-1",
|
||||||
});
|
});
|
||||||
@@ -27,4 +29,82 @@ describe("AccessService", () => {
|
|||||||
accountKey: "account-key",
|
accountKey: "account-key",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("writes subtype from access define field", async () => {
|
||||||
|
const { AccessService: MockedAccessService } = await esmock("./access-service.js", {
|
||||||
|
"@certd/pipeline": {
|
||||||
|
accessRegistry: {
|
||||||
|
getDefine(type: string) {
|
||||||
|
assert.equal(type, "acmeAccount");
|
||||||
|
return {
|
||||||
|
name: "acmeAccount",
|
||||||
|
subtype: "caType",
|
||||||
|
input: {
|
||||||
|
caType: {},
|
||||||
|
account: {
|
||||||
|
encrypt: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const service = new MockedAccessService();
|
||||||
|
service.encryptService = {
|
||||||
|
encrypt(value: string) {
|
||||||
|
return `encrypted:${value}`;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const param: any = {
|
||||||
|
type: "acmeAccount",
|
||||||
|
setting: JSON.stringify({
|
||||||
|
caType: "letsencrypt",
|
||||||
|
account: JSON.stringify({
|
||||||
|
accountKey: "key",
|
||||||
|
accountUri: "https://example.com/acct/1",
|
||||||
|
caType: "letsencrypt",
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
|
service.encryptSetting(param);
|
||||||
|
|
||||||
|
assert.equal(param.subtype, "letsencrypt");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("allows acme account access to be saved before account generation", async () => {
|
||||||
|
const { AccessService: MockedAccessService } = await esmock("./access-service.js", {
|
||||||
|
"@certd/pipeline": {
|
||||||
|
accessRegistry: {
|
||||||
|
getDefine() {
|
||||||
|
return {
|
||||||
|
name: "acmeAccount",
|
||||||
|
subtype: "caType",
|
||||||
|
input: {
|
||||||
|
caType: {},
|
||||||
|
account: {
|
||||||
|
encrypt: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const service = new MockedAccessService();
|
||||||
|
const param: any = {
|
||||||
|
type: "acmeAccount",
|
||||||
|
setting: JSON.stringify({
|
||||||
|
caType: "letsencrypt",
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
|
service.encryptSetting(param);
|
||||||
|
|
||||||
|
assert.equal(param.subtype, "letsencrypt");
|
||||||
|
assert.deepEqual(JSON.parse(param.setting), {
|
||||||
|
caType: "letsencrypt",
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import {Inject, Provide, Scope, ScopeEnum} from '@midwayjs/core';
|
import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||||
import {InjectEntityModel} from '@midwayjs/typeorm';
|
import { InjectEntityModel } from "@midwayjs/typeorm";
|
||||||
import { In, Repository } from "typeorm";
|
import { In, Repository } from "typeorm";
|
||||||
import {AccessGetter, BaseService, PageReq, PermissionException, ValidateException} from '../../../index.js';
|
import { AccessGetter, BaseService, PageReq, PermissionException, ValidateException } from "../../../index.js";
|
||||||
import {AccessEntity} from '../entity/access.js';
|
import { AccessEntity } from "../entity/access.js";
|
||||||
import {AccessDefine, accessRegistry, newAccess} from '@certd/pipeline';
|
import { AccessDefine, accessRegistry, newAccess } from "@certd/pipeline";
|
||||||
import {EncryptService} from './encrypt-service.js';
|
import { EncryptService } from "./encrypt-service.js";
|
||||||
import { logger, utils } from '@certd/basic';
|
import { logger, utils } from "@certd/basic";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 授权
|
* 授权
|
||||||
*/
|
*/
|
||||||
@Provide()
|
@Provide()
|
||||||
@Scope(ScopeEnum.Request, {allowDowngrade: true})
|
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||||
export class AccessService extends BaseService<AccessEntity> {
|
export class AccessService extends BaseService<AccessEntity> {
|
||||||
@InjectEntityModel(AccessEntity)
|
@InjectEntityModel(AccessEntity)
|
||||||
repository: Repository<AccessEntity>;
|
repository: Repository<AccessEntity>;
|
||||||
@@ -36,16 +36,16 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
|
|
||||||
async add(param) {
|
async add(param) {
|
||||||
let oldEntity = null;
|
let oldEntity = null;
|
||||||
if (param._copyFrom){
|
if (param._copyFrom) {
|
||||||
oldEntity = await this.info(param._copyFrom);
|
oldEntity = await this.info(param._copyFrom);
|
||||||
if (oldEntity == null) {
|
if (oldEntity == null) {
|
||||||
throw new ValidateException('该授权配置不存在,请确认是否已被删除');
|
throw new ValidateException("该授权配置不存在,请确认是否已被删除");
|
||||||
}
|
}
|
||||||
if (oldEntity.userId !== param.userId) {
|
if (oldEntity.userId !== param.userId) {
|
||||||
throw new ValidateException('您无权查看该授权配置');
|
throw new ValidateException("您无权查看该授权配置");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete param._copyFrom
|
delete param._copyFrom;
|
||||||
this.encryptSetting(param, oldEntity);
|
this.encryptSetting(param, oldEntity);
|
||||||
param.keyId = "ac_" + utils.id.simpleNanoId();
|
param.keyId = "ac_" + utils.id.simpleNanoId();
|
||||||
return await super.add(param);
|
return await super.add(param);
|
||||||
@@ -62,17 +62,20 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const json = JSON.parse(setting);
|
const json = JSON.parse(setting);
|
||||||
|
if (accessDefine.subtype) {
|
||||||
|
param.subtype = json[accessDefine.subtype] || null;
|
||||||
|
}
|
||||||
let oldSetting = {};
|
let oldSetting = {};
|
||||||
let encryptSetting = {};
|
let encryptSetting = {};
|
||||||
const firstEncrypt = !oldSettingEntity || !oldSettingEntity.encryptSetting || oldSettingEntity.encryptSetting === '{}';
|
const firstEncrypt = !oldSettingEntity || !oldSettingEntity.encryptSetting || oldSettingEntity.encryptSetting === "{}";
|
||||||
if (oldSettingEntity) {
|
if (oldSettingEntity) {
|
||||||
oldSetting = JSON.parse(oldSettingEntity.setting || '{}');
|
oldSetting = JSON.parse(oldSettingEntity.setting || "{}");
|
||||||
encryptSetting = JSON.parse(oldSettingEntity.encryptSetting || '{}');
|
encryptSetting = JSON.parse(oldSettingEntity.encryptSetting || "{}");
|
||||||
}
|
}
|
||||||
for (const key in json) {
|
for (const key in json) {
|
||||||
//加密
|
//加密
|
||||||
let value = json[key];
|
let value = json[key];
|
||||||
if (value && typeof value === 'string') {
|
if (value && typeof value === "string") {
|
||||||
//去除前后空格
|
//去除前后空格
|
||||||
value = value.trim();
|
value = value.trim();
|
||||||
json[key] = value;
|
json[key] = value;
|
||||||
@@ -81,7 +84,7 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
if (!accessInputDefine) {
|
if (!accessInputDefine) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!accessInputDefine.encrypt || !value || typeof value !== 'string') {
|
if (!accessInputDefine.encrypt || !value || typeof value !== "string") {
|
||||||
//定义无需加密、value为空、不是字符串 这些不需要加密
|
//定义无需加密、value为空、不是字符串 这些不需要加密
|
||||||
encryptSetting[key] = {
|
encryptSetting[key] = {
|
||||||
value: value,
|
value: value,
|
||||||
@@ -96,7 +99,7 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
const subIndex = Math.min(2, length);
|
const subIndex = Math.min(2, length);
|
||||||
let starLength = length - subIndex * 2;
|
let starLength = length - subIndex * 2;
|
||||||
starLength = Math.max(2, starLength);
|
starLength = Math.max(2, starLength);
|
||||||
const starString = '*'.repeat(starLength);
|
const starString = "*".repeat(starLength);
|
||||||
json[key] = value.substring(0, subIndex) + starString + value.substring(value.length - subIndex);
|
json[key] = value.substring(0, subIndex) + starString + value.substring(value.length - subIndex);
|
||||||
encryptSetting[key] = {
|
encryptSetting[key] = {
|
||||||
value: this.encryptService.encrypt(value),
|
value: this.encryptService.encrypt(value),
|
||||||
@@ -116,21 +119,21 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
async update(param) {
|
async update(param) {
|
||||||
const oldEntity = await this.info(param.id);
|
const oldEntity = await this.info(param.id);
|
||||||
if (oldEntity == null) {
|
if (oldEntity == null) {
|
||||||
throw new ValidateException('该授权配置不存在,请确认是否已被删除');
|
throw new ValidateException("该授权配置不存在,请确认是否已被删除");
|
||||||
}
|
}
|
||||||
this.encryptSetting(param, oldEntity);
|
this.encryptSetting(param, oldEntity);
|
||||||
delete param.keyId
|
delete param.keyId;
|
||||||
return await super.update(param);
|
return await super.update(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateAccess(access: any) {
|
async updateAccess(access: any) {
|
||||||
const oldEntity = await this.info(access.id);
|
const oldEntity = await this.info(access.id);
|
||||||
if (oldEntity == null) {
|
if (oldEntity == null) {
|
||||||
throw new ValidateException('该授权配置不存在,请确认是否已被删除');
|
throw new ValidateException("该授权配置不存在,请确认是否已被删除");
|
||||||
}
|
}
|
||||||
const setting = this.decryptAccessEntity(oldEntity);
|
const setting = this.decryptAccessEntity(oldEntity);
|
||||||
for (const key of Object.keys(access)) {
|
for (const key of Object.keys(access)) {
|
||||||
if (key === 'id') {
|
if (key === "id") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
setting[key] = access[key];
|
setting[key] = access[key];
|
||||||
@@ -145,11 +148,13 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
async getSimpleInfo(id: number) {
|
async getSimpleInfo(id: number) {
|
||||||
const entity = await this.info(id);
|
const entity = await this.info(id);
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
throw new ValidateException('该授权配置不存在,请确认是否已被删除');
|
throw new ValidateException("该授权配置不存在,请确认是否已被删除");
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
id: entity.id,
|
id: entity.id,
|
||||||
name: entity.name,
|
name: entity.name,
|
||||||
|
type: entity.type,
|
||||||
|
subtype: entity.subtype,
|
||||||
userId: entity.userId,
|
userId: entity.userId,
|
||||||
projectId: entity.projectId,
|
projectId: entity.projectId,
|
||||||
};
|
};
|
||||||
@@ -162,14 +167,14 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
}
|
}
|
||||||
if (checkUserId) {
|
if (checkUserId) {
|
||||||
if (userId == null) {
|
if (userId == null) {
|
||||||
throw new ValidateException('userId不能为空');
|
throw new ValidateException("userId不能为空");
|
||||||
}
|
}
|
||||||
if (userId !== entity.userId) {
|
if (userId !== entity.userId) {
|
||||||
throw new PermissionException('您对该Access授权无访问权限');
|
throw new PermissionException("您对该Access授权无访问权限");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (projectId != null && projectId !== entity.projectId) {
|
if (projectId != null && projectId !== entity.projectId) {
|
||||||
throw new PermissionException('您对该Access授权无访问权限');
|
throw new PermissionException("您对该Access授权无访问权限");
|
||||||
}
|
}
|
||||||
|
|
||||||
// const access = accessRegistry.get(entity.type);
|
// const access = accessRegistry.get(entity.type);
|
||||||
@@ -178,8 +183,8 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
id: entity.id,
|
id: entity.id,
|
||||||
...setting,
|
...setting,
|
||||||
};
|
};
|
||||||
const accessGetter = new AccessGetter(userId,projectId, this.getById.bind(this));
|
const accessGetter = new AccessGetter(userId, projectId, this.getById.bind(this));
|
||||||
return await newAccess(entity.type, input,accessGetter);
|
return await newAccess(entity.type, input, accessGetter);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getById(id: any, userId: number, projectId?: number): Promise<any> {
|
async getById(id: any, userId: number, projectId?: number): Promise<any> {
|
||||||
@@ -188,7 +193,7 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
|
|
||||||
decryptAccessEntity(entity: AccessEntity): any {
|
decryptAccessEntity(entity: AccessEntity): any {
|
||||||
let setting = {};
|
let setting = {};
|
||||||
if (entity.encryptSetting && entity.encryptSetting !== '{}') {
|
if (entity.encryptSetting && entity.encryptSetting !== "{}") {
|
||||||
setting = JSON.parse(entity.encryptSetting);
|
setting = JSON.parse(entity.encryptSetting);
|
||||||
for (const key in setting) {
|
for (const key in setting) {
|
||||||
//解密
|
//解密
|
||||||
@@ -213,29 +218,28 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
return accessRegistry.getDefine(type);
|
return accessRegistry.getDefine(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async getSimpleByIds(ids: number[], userId: any, projectId?: number) {
|
async getSimpleByIds(ids: number[], userId: any, projectId?: number) {
|
||||||
if (ids.length === 0) {
|
if (ids.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
if (userId==null) {
|
if (userId == null) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
const userProjectQuery = this.buildUserProjectQuery(userId, projectId);
|
||||||
return await this.repository.find({
|
return await this.repository.find({
|
||||||
where: {
|
where: {
|
||||||
id: In(ids),
|
id: In(ids),
|
||||||
userId,
|
...userProjectQuery,
|
||||||
projectId,
|
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
name: true,
|
name: true,
|
||||||
type: true,
|
type: true,
|
||||||
userId:true,
|
subtype: true,
|
||||||
projectId:true,
|
userId: true,
|
||||||
|
projectId: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -243,7 +247,7 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
* @param accessId
|
* @param accessId
|
||||||
* @param projectId
|
* @param projectId
|
||||||
*/
|
*/
|
||||||
async copyTo(accessId: number,projectId?: number) {
|
async copyTo(accessId: number, projectId?: number) {
|
||||||
const access = await this.info(accessId);
|
const access = await this.info(accessId);
|
||||||
if (access == null) {
|
if (access == null) {
|
||||||
throw new Error(`该授权配置不存在,请确认是否已被删除:id=${accessId}`);
|
throw new Error(`该授权配置不存在,请确认是否已被删除:id=${accessId}`);
|
||||||
@@ -263,10 +267,10 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
}
|
}
|
||||||
const newAccess = {
|
const newAccess = {
|
||||||
...access,
|
...access,
|
||||||
userId:-1,
|
userId: -1,
|
||||||
id: undefined,
|
id: undefined,
|
||||||
projectId,
|
projectId,
|
||||||
}
|
};
|
||||||
await this.repository.save(newAccess);
|
await this.repository.save(newAccess);
|
||||||
return newAccess.id;
|
return newAccess.id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,11 +96,11 @@ export class AddonService extends BaseService<AddonEntity> {
|
|||||||
if (userId==null) {
|
if (userId==null) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
const userProjectQuery = this.buildUserProjectQuery(userId, projectId);
|
||||||
return await this.repository.find({
|
return await this.repository.find({
|
||||||
where: {
|
where: {
|
||||||
id: In(ids),
|
id: In(ids),
|
||||||
userId,
|
...userProjectQuery,
|
||||||
projectId
|
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
@@ -117,11 +117,11 @@ export class AddonService extends BaseService<AddonEntity> {
|
|||||||
|
|
||||||
|
|
||||||
async getDefault(userId: number, addonType: string,projectId?:number): Promise<any> {
|
async getDefault(userId: number, addonType: string,projectId?:number): Promise<any> {
|
||||||
|
const userProjectQuery = this.buildUserProjectQuery(userId, projectId);
|
||||||
const res = await this.repository.findOne({
|
const res = await this.repository.findOne({
|
||||||
where: {
|
where: {
|
||||||
userId,
|
|
||||||
addonType,
|
addonType,
|
||||||
projectId
|
...userProjectQuery,
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
isDefault: "DESC"
|
isDefault: "DESC"
|
||||||
@@ -154,27 +154,17 @@ export class AddonService extends BaseService<AddonEntity> {
|
|||||||
if (userId==null) {
|
if (userId==null) {
|
||||||
throw new ValidateException("userId不能为空");
|
throw new ValidateException("userId不能为空");
|
||||||
}
|
}
|
||||||
await this.repository.update(
|
const userProjectQuery = this.buildUserProjectQuery(userId, projectId);
|
||||||
{
|
const query = {
|
||||||
userId,
|
addonType,
|
||||||
addonType,
|
...userProjectQuery,
|
||||||
projectId
|
};
|
||||||
},
|
await this.repository.update(query, {
|
||||||
{
|
isDefault: false
|
||||||
isDefault: false
|
});
|
||||||
}
|
await this.repository.update({ ...query, id }, {
|
||||||
);
|
isDefault: true
|
||||||
await this.repository.update(
|
});
|
||||||
{
|
|
||||||
id,
|
|
||||||
userId,
|
|
||||||
addonType,
|
|
||||||
projectId
|
|
||||||
},
|
|
||||||
{
|
|
||||||
isDefault: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getOrCreateDefault(opts: { addonType: string, type: string, inputs: any, userId: any,projectId?:number }) {
|
async getOrCreateDefault(opts: { addonType: string, type: string, inputs: any, userId: any,projectId?:number }) {
|
||||||
@@ -202,12 +192,12 @@ export class AddonService extends BaseService<AddonEntity> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getOneByType(req:{addonType:string,type:string,userId:number,projectId?:number}) {
|
async getOneByType(req:{addonType:string,type:string,userId:number,projectId?:number}) {
|
||||||
|
const userProjectQuery = this.buildUserProjectQuery(req.userId, req.projectId);
|
||||||
return await this.repository.findOne({
|
return await this.repository.findOne({
|
||||||
where: {
|
where: {
|
||||||
addonType: req.addonType,
|
addonType: req.addonType,
|
||||||
type: req.type,
|
type: req.type,
|
||||||
userId: req.userId,
|
...userProjectQuery,
|
||||||
projectId: req.projectId
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"inlineSourceMap": false
|
"inlineSourceMap": false,
|
||||||
|
"declarationMap": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.41.1](https://github.com/certd/certd/compare/v1.41.0...v1.41.1) (2026-06-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|
||||||
|
# [1.41.0](https://github.com/certd/certd/compare/v1.40.5...v1.41.0) (2026-06-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|
||||||
|
## [1.40.5](https://github.com/certd/certd/compare/v1.40.4...v1.40.5) (2026-05-26)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|
||||||
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
## [1.40.4](https://github.com/certd/certd/compare/v1.40.3...v1.40.4) (2026-05-24)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/midway-flyway-js",
|
"name": "@certd/midway-flyway-js",
|
||||||
"version": "1.40.4",
|
"version": "1.41.1",
|
||||||
"description": "midway with flyway, sql upgrade way ",
|
"description": "midway with flyway, sql upgrade way ",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -49,5 +49,5 @@
|
|||||||
"typeorm": "^0.3.11",
|
"typeorm": "^0.3.11",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "01c91ba294f88bd07fddf9358c4301bbb4027916"
|
"gitHead": "cdea411136fdf56352699a6e278a403e0f53a94f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"inlineSourceMap": false
|
"inlineSourceMap": false,
|
||||||
|
"declarationMap": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user