mirror of
https://github.com/certd/certd.git
synced 2026-05-15 04:27:31 +08:00
Compare commits
62 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c6dc169ac | |||
| 3e5366c74e | |||
| b49ddbfef9 | |||
| b92fd73f53 | |||
| 41b8f51a6a | |||
| aad9045de5 | |||
| fdd5848df4 | |||
| 118c15d046 | |||
| bae4f8e320 | |||
| e0189a566e | |||
| 1cd8d73cdb | |||
| d6e9e5987b | |||
| 8c5aa37745 | |||
| a18a871ac3 | |||
| 90cbff9cf9 | |||
| bae5a04dcc | |||
| 7146570392 | |||
| ae88f85d8e | |||
| a362860137 | |||
| c966896522 | |||
| 5f88da1985 | |||
| 043b80a298 | |||
| ed0da28896 | |||
| 61a0d69d58 | |||
| 3833a9216e | |||
| e59566b5e2 | |||
| e4be0ce464 | |||
| 022dbf0cab | |||
| 1e6b559b89 | |||
| 74bae2005d | |||
| 1731a35d94 | |||
| 9f7d766cb3 | |||
| 6c0d0b00c9 | |||
| a82a38421d | |||
| c4b01da384 | |||
| 3e1473dba5 | |||
| d383706554 | |||
| e0eb0e21f6 | |||
| 7266af1749 | |||
| f93bc09438 | |||
| fe3bb7c1b4 | |||
| 923676c7d5 | |||
| 4755216505 | |||
| 37d03c10f9 | |||
| 490b724808 | |||
| d8f132919d | |||
| b8a64a6b5b | |||
| 25ad1e6f86 | |||
| 6b6f1604e9 | |||
| 63be1c1cbd | |||
| b75c625ddc | |||
| 7083e7aff7 | |||
| 9d2937dd4b | |||
| a7e281e278 | |||
| 72b6597817 | |||
| 91a1b97550 | |||
| 9951ab678f | |||
| 930aa355e8 | |||
| e0143fa540 | |||
| 7c1d92ff4b | |||
| 0a0f1e90e1 | |||
| 80092823db |
@@ -106,7 +106,7 @@ Certd 是一个支持私有化部署的 SSL/TLS 证书自动化管理平台。
|
|||||||
- 前端 `pnpm dev`:启动 Vite 开发服务
|
- 前端 `pnpm dev`:启动 Vite 开发服务
|
||||||
- 前端 `pnpm build`:生产构建
|
- 前端 `pnpm build`:生产构建
|
||||||
- 前端 `pnpm tsc`:类型检查
|
- 前端 `pnpm tsc`:类型检查
|
||||||
- 前端 `pnpm test:unit`:Vitest 单元测试
|
- 前端暂不跑单元测试;当前 `test:unit` 只是占位脚本
|
||||||
|
|
||||||
## 流水线与插件模型
|
## 流水线与插件模型
|
||||||
|
|
||||||
@@ -142,6 +142,12 @@ Certd 是一个支持私有化部署的 SSL/TLS 证书自动化管理平台。
|
|||||||
|
|
||||||
如果只是某个服务商或部署目标的问题,不要轻易修改共享 pipeline/core 行为,除非确实是可复用的公共能力。
|
如果只是某个服务商或部署目标的问题,不要轻易修改共享 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 迁移。
|
后端使用 TypeORM 实体加 SQL 迁移。
|
||||||
@@ -161,6 +167,7 @@ Certd 是一个支持私有化部署的 SSL/TLS 证书自动化管理平台。
|
|||||||
- 优先沿用现有模块、插件、服务模式,再考虑新增抽象。
|
- 优先沿用现有模块、插件、服务模式,再考虑新增抽象。
|
||||||
- `packages/ui/certd-server/data/`、`logs/`、生成的 metadata/dist 等通常视为运行时或构建产物,除非任务明确要求处理它们。
|
- `packages/ui/certd-server/data/`、`logs/`、生成的 metadata/dist 等通常视为运行时或构建产物,除非任务明确要求处理它们。
|
||||||
- 注意本地数据和配置里可能包含凭据、证书材料等敏感信息。
|
- 注意本地数据和配置里可能包含凭据、证书材料等敏感信息。
|
||||||
|
- 本仓库代码注释优先使用中文,尤其是解释业务规则、兼容逻辑、协议细节和隐藏风险时;除非文件已有明确英文注释风格或引用外部英文术语,否则不要新增英文说明性注释。
|
||||||
|
|
||||||
## 插件开发技能
|
## 插件开发技能
|
||||||
|
|
||||||
@@ -185,12 +192,12 @@ Certd 是一个支持私有化部署的 SSL/TLS 证书自动化管理平台。
|
|||||||
进入项目后,优先使用这些有目标的读取命令,而不是立刻全仓库扫描:
|
进入项目后,优先使用这些有目标的读取命令,而不是立刻全仓库扫描:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Get-Content package.json
|
Get-Content -Encoding utf8 package.json
|
||||||
Get-Content pnpm-workspace.yaml
|
Get-Content -Encoding utf8 pnpm-workspace.yaml
|
||||||
Get-Content lerna.json
|
Get-Content -Encoding utf8 lerna.json
|
||||||
Get-Content README_en.md -TotalCount 180
|
Get-Content -Encoding utf8 README_en.md -TotalCount 180
|
||||||
Get-Content packages\ui\certd-server\package.json
|
Get-Content -Encoding utf8 packages\ui\certd-server\package.json
|
||||||
Get-Content packages\ui\certd-client\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\modules
|
||||||
Get-ChildItem packages\ui\certd-server\src\plugins
|
Get-ChildItem packages\ui\certd-server\src\plugins
|
||||||
Get-ChildItem packages\ui\certd-client\src\views\certd
|
Get-ChildItem packages\ui\certd-client\src\views\certd
|
||||||
@@ -199,9 +206,15 @@ Get-ChildItem packages\ui\certd-client\src\views\certd
|
|||||||
## 本仓库 Agent 工作方式
|
## 本仓库 Agent 工作方式
|
||||||
|
|
||||||
- 先读本文件,再按用户任务查看相关 package/module。
|
- 先读本文件,再按用户任务查看相关 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 自动同步。
|
- 做数据库结构变更时,添加或更新迁移脚本,不要依赖 TypeORM 自动同步。
|
||||||
- 前端 TS/Vue/locale 等文件改动后,优先只对本次改动文件运行项目现有自动格式化/修复,例如 `corepack pnpm --dir packages\ui\certd-client exec prettier --write <files>` 和 `corepack pnpm --dir packages\ui\certd-client exec eslint --fix <files>`;不要为了格式化无关文件而扩大 diff。项目保留了 `tslint` 依赖,但当前主要使用 ESLint + Prettier。
|
- 实现新功能或修复行为缺陷前,先补对应单元测试,并先运行测试确认它处于失败状态;再实现功能或修复代码,反复运行聚焦单元测试直到通过。若某项改动确实不适合先写单元测试,应在回复中说明原因和替代验证方式。
|
||||||
|
- 后补单元测试时,应先基于对正确行为的实际预期编写测试,而不是为了迎合现有实现改写预期;如果运行后出现红灯,且通过测试需要修改已有实现,应先向用户确认这是确实的 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` 暂时不跑单元测试。
|
||||||
|
- 前端 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>`;不要为了格式化无关文件而扩大 diff。项目保留了 `tslint` 依赖,但当前主要使用 ESLint + Prettier。
|
||||||
- 优先对改动包运行聚焦的测试或类型检查;只有跨包影响明显时再考虑全 monorepo 构建。
|
- 优先对改动包运行聚焦的测试或类型检查;只有跨包影响明显时再考虑全 monorepo 构建。
|
||||||
|
|||||||
@@ -3,6 +3,50 @@
|
|||||||
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.39.16](https://github.com/certd/certd/compare/v1.39.15...v1.39.16) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package root
|
||||||
|
|
||||||
|
## [1.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复第三方登录彩虹登录不上的bug ([bae4f8e](https://github.com/certd/certd/commit/bae4f8e3209d9f9869ecbd7c01655383bac2fe21))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化申请时报错日志增加对应域名打印 ([d6e9e59](https://github.com/certd/certd/commit/d6e9e5987bd52ea12ee18745615486eadd4c87ff))
|
||||||
|
* icon选择器增加一套logo集 ([fdd5848](https://github.com/certd/certd/commit/fdd5848df4055a6ee07dc5eabaaf6b718672882d))
|
||||||
|
* **monitor/site:** 新增站点监控页面禁用启用、检查状态两个筛选条件 ([118c15d](https://github.com/certd/certd/commit/118c15d04633a6ef06f2d9e7a7849d20f596e02c))
|
||||||
|
* **network:** 新增全局公共http请求 headers设置 ([aad9045](https://github.com/certd/certd/commit/aad9045de55e76cb2ad09cac74a7bd60a4b47124))
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云订阅流水线创建对话框无法获取阿里订单列表的bug ([a362860](https://github.com/certd/certd/commit/a362860137bfb7072893c844fe775edc46070ee1))
|
||||||
|
* 修复启动时报密钥备份不存在的问题 ([c966896](https://github.com/certd/certd/commit/c9668965226af6b54e0e576931dcba8b3d188ef3))
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **aliyun-access:** 添加阿里云密钥校验失败的错误处理 ([b75c625](https://github.com/certd/certd/commit/b75c625ddcc0b3110699d8e6175681ef157b25df))
|
||||||
|
* cnameProvider域名支持设置子域名托管 ([7266af1](https://github.com/certd/certd/commit/7266af17491a98338022cfb18cfedfb93ca6ef8f))
|
||||||
|
* **plugin-aliyun:** 过滤非CAS证书并优化日志信息 ([c4b01da](https://github.com/certd/certd/commit/c4b01da384bc40a241a673ea8bc01ca733c04d83))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **设置:** 添加首页启用开关配置 ([25ad1e6](https://github.com/certd/certd/commit/25ad1e6f861e43288cc8bd90d4903628e6faec29))
|
||||||
|
* 新增agents.md ([aa176b0](https://github.com/certd/certd/commit/aa176b081a92837d2d6809d16546a8dfc2e5dd36))
|
||||||
|
* **用户资料:** 新增手机号邮箱绑定功能 ([e0eb0e2](https://github.com/certd/certd/commit/e0eb0e21f6dae24b639c944f9aba2c90496ab1c0))
|
||||||
|
* 域名注册过期时间获取再次优化 ([91a1b97](https://github.com/certd/certd/commit/91a1b9755066bf280e194dabf7c3a9f936e2643f))
|
||||||
|
* **证书流水线:** 添加批量更新证书申请参数功能 ([63be1c1](https://github.com/certd/certd/commit/63be1c1cbd9b09a3b48f26130c296b1cedcca1ac))
|
||||||
|
* 支持火山云vke ([bb46cb0](https://github.com/certd/certd/commit/bb46cb08f71f6ae921543f7e4a6c5f4e0190556e))
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
* **domain:** 添加域名过期时间同步进度显示功能 ([9d2937d](https://github.com/certd/certd/commit/9d2937dd4b14ffab73e9b096edd2aa8539811182))
|
||||||
|
* **plugin-volcengine:** 支持火山引擎VKE部署插件 ([b8a64a6](https://github.com/certd/certd/commit/b8a64a6b5bf3691a47177de42bc49b798e795feb))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -179,19 +179,23 @@ https://certd.handfree.work/
|
|||||||
|
|
||||||
[50元专业版优惠券限时领取](https://app.handfree.work/subject/#/app/certd/product)
|
[50元专业版优惠券限时领取](https://app.handfree.work/subject/#/app/certd/product)
|
||||||
|
|
||||||
专业版特权对比
|
专业版、商业版特权对比
|
||||||
|
|
||||||
| 功能 | 免费版 | 专业版 |
|
|
||||||
|---------|---------------------------------------|--------------------------------|
|
|
||||||
| 免费证书申请 | 免费无限制 | 免费无限制 |
|
|
||||||
| 证书域名数量 | 无限制 | 无限制 |
|
|
||||||
| 证书流水线条数 | 无限制 | 无限制 |
|
|
||||||
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖、威联通、proxmox等 |
|
|
||||||
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、钉钉、飞书、anpush、server酱等 |
|
|
||||||
| 站点监控 | 限制1条 | 无限制 |
|
|
||||||
| 批量操作 | 无 | 流水线模版,流水线复制,批量运行,批量设置通知、定时等 |
|
|
||||||
| VIP群 | 无 | 可加,一对一技术支持,必要时可申请远程协助 |
|
|
||||||
|
|
||||||
|
| 功能 | 免费版 | 专业版 | 商业版 |
|
||||||
|
|---------|---------------------------------------|--------------------------------|---------------------------------|
|
||||||
|
| 证书申请 | 无限制 | 无限制 | 无限制 |
|
||||||
|
| 证书域名数量 | 无限制 | 无限制 | 无限制 |
|
||||||
|
| 证书流水线条数 | 无限制 | 无限制 | 无限制 |
|
||||||
|
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖、威联通、proxmox等 | 同专业版 |
|
||||||
|
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、钉钉、飞书、anpush、server酱等 | 同专业版 |
|
||||||
|
| 站点监控 | 限制1条 | 无限制 | 无限制 |
|
||||||
|
| 批量操作 | 无 | 流水线模版,流水线复制,批量运行,批量设置通知、定时等 | 同专业版 |
|
||||||
|
| VIP群 | 无 | 可加,一对一技术支持,必要时可申请远程协助 | 商业版技术支持 |
|
||||||
|
| 站点个性化 | 无 | 无 | 可自定义站点名称、Logo等,移除Certd元素,首页警告等 |
|
||||||
|
| 套餐功能 | 无 | 无 | 支持配置套餐供用户购买 |
|
||||||
|
| 数据统计 | 无 | 无 | 支持站点各类统计数据 |
|
||||||
|
| 插件管理 | 无 | 无 | 支持公共EAB设置,插件选项配置 |
|
||||||
|
| 是否可商用 | 不允许 | 不允许 | 可对外运营 |
|
||||||
|
|
||||||
## 九、贡献代码
|
## 九、贡献代码
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,33 @@
|
|||||||
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.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云订阅流水线创建对话框无法获取阿里订单列表的bug ([a362860](https://github.com/certd/certd/commit/a362860137bfb7072893c844fe775edc46070ee1))
|
||||||
|
* 修复启动时报密钥备份不存在的问题 ([c966896](https://github.com/certd/certd/commit/c9668965226af6b54e0e576931dcba8b3d188ef3))
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **aliyun-access:** 添加阿里云密钥校验失败的错误处理 ([b75c625](https://github.com/certd/certd/commit/b75c625ddcc0b3110699d8e6175681ef157b25df))
|
||||||
|
* cnameProvider域名支持设置子域名托管 ([7266af1](https://github.com/certd/certd/commit/7266af17491a98338022cfb18cfedfb93ca6ef8f))
|
||||||
|
* **plugin-aliyun:** 过滤非CAS证书并优化日志信息 ([c4b01da](https://github.com/certd/certd/commit/c4b01da384bc40a241a673ea8bc01ca733c04d83))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **设置:** 添加首页启用开关配置 ([25ad1e6](https://github.com/certd/certd/commit/25ad1e6f861e43288cc8bd90d4903628e6faec29))
|
||||||
|
* 新增agents.md ([aa176b0](https://github.com/certd/certd/commit/aa176b081a92837d2d6809d16546a8dfc2e5dd36))
|
||||||
|
* **用户资料:** 新增手机号邮箱绑定功能 ([e0eb0e2](https://github.com/certd/certd/commit/e0eb0e21f6dae24b639c944f9aba2c90496ab1c0))
|
||||||
|
* 域名注册过期时间获取再次优化 ([91a1b97](https://github.com/certd/certd/commit/91a1b9755066bf280e194dabf7c3a9f936e2643f))
|
||||||
|
* **证书流水线:** 添加批量更新证书申请参数功能 ([63be1c1](https://github.com/certd/certd/commit/63be1c1cbd9b09a3b48f26130c296b1cedcca1ac))
|
||||||
|
* 支持火山云vke ([bb46cb0](https://github.com/certd/certd/commit/bb46cb08f71f6ae921543f7e4a6c5f4e0190556e))
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
* **domain:** 添加域名过期时间同步进度显示功能 ([9d2937d](https://github.com/certd/certd/commit/9d2937dd4b14ffab73e9b096edd2aa8539811182))
|
||||||
|
* **plugin-volcengine:** 支持火山引擎VKE部署插件 ([b8a64a6](https://github.com/certd/certd/commit/b8a64a6b5bf3691a47177de42bc49b798e795feb))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
+16
-10
@@ -16,16 +16,22 @@
|
|||||||
****------------------****
|
****------------------****
|
||||||
## 专业版特权对比
|
## 专业版特权对比
|
||||||
|
|
||||||
| 功能 | 免费版 | 专业版 |
|
| 功能 | 免费版 | 专业版 | 商业版 |
|
||||||
|---------|---------------------------------------|--------------------------------|
|
|---------|---------------------------------------|--------------------------------|---------------------------------|
|
||||||
| 证书申请 | 无限制 | 无限制 |
|
| 证书申请 | 无限制 | 无限制 | 无限制 |
|
||||||
| 证书域名数量 | 无限制 | 无限制 |
|
| 证书域名数量 | 无限制 | 无限制 | 无限制 |
|
||||||
| 证书流水线条数 | 无限制 | 无限制 |
|
| 证书流水线条数 | 无限制 | 无限制 | 无限制 |
|
||||||
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖、威联通、proxmox等 |
|
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖、威联通、proxmox等 | 同专业版 |
|
||||||
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、钉钉、飞书、anpush、server酱等 |
|
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、钉钉、飞书、anpush、server酱等 | 同专业版 |
|
||||||
| 站点监控 | 限制1条 | 无限制 |
|
| 站点监控 | 限制1条 | 无限制 | 无限制 |
|
||||||
| 批量操作 | 无 | 流水线模版,流水线复制,批量运行,批量设置通知、定时等 |
|
| 批量操作 | 无 | 流水线模版,流水线复制,批量运行,批量设置通知、定时等 | 同专业版 |
|
||||||
| VIP群 | 无 | 可加,一对一技术支持,必要时可申请远程协助 |
|
| VIP群 | 无 | 可加,一对一技术支持,必要时可申请远程协助 | 商业版技术支持 |
|
||||||
|
| 站点个性化 | 无 | 无 | 可自定义站点名称、Logo等,移除Certd元素,首页警告等 |
|
||||||
|
| 套餐功能 | 无 | 无 | 支持配置套餐供用户购买 |
|
||||||
|
| 数据统计 | 无 | 无 | 支持站点各类统计数据 |
|
||||||
|
| 插件管理 | 无 | 无 | 支持公共EAB设置,插件选项配置 |
|
||||||
|
| 是否可商用 | 不允许 | 不允许 | 可对外运营 |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 专业版激活方式
|
## 专业版激活方式
|
||||||
|
|||||||
@@ -134,8 +134,9 @@
|
|||||||
| 4.| **火山引擎-部署证书至DCDN** | 部署至火山引擎全站加速 |
|
| 4.| **火山引擎-部署证书至DCDN** | 部署至火山引擎全站加速 |
|
||||||
| 5.| **火山引擎-部署证书至Live** | 部署至火山引擎视频直播 |
|
| 5.| **火山引擎-部署证书至Live** | 部署至火山引擎视频直播 |
|
||||||
| 6.| **火山引擎-部署证书至TOS自定义域名** | 仅限TOS自定义域名,加速域名请选择火山引擎的CDN插件 |
|
| 6.| **火山引擎-部署证书至TOS自定义域名** | 仅限TOS自定义域名,加速域名请选择火山引擎的CDN插件 |
|
||||||
| 7.| **火山引擎-部署证书至VOD** | 部署至火山引擎视频点播 |
|
| 7.| **火山引擎-替换VKE证书** | 替换火山引擎VKE集群中的TLS Secret证书 |
|
||||||
| 8.| **火山引擎-上传证书至证书中心** | 上传证书至火山引擎证书中心 |
|
| 8.| **火山引擎-部署证书至VOD** | 部署至火山引擎视频点播 |
|
||||||
|
| 9.| **火山引擎-上传证书至证书中心** | 上传证书至火山引擎证书中心 |
|
||||||
## 9. 京东云
|
## 9. 京东云
|
||||||
|
|
||||||
| 序号 | 名称 | 说明 |
|
| 序号 | 名称 | 说明 |
|
||||||
|
|||||||
+1
-1
@@ -9,5 +9,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmClient": "pnpm",
|
"npmClient": "pnpm",
|
||||||
"version": "1.39.12"
|
"version": "1.39.16"
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -9,6 +9,7 @@
|
|||||||
"@lerna-lite/run": "^3.9.3",
|
"@lerna-lite/run": "^3.9.3",
|
||||||
"@lerna-lite/version": "^3.9.3",
|
"@lerna-lite/version": "^3.9.3",
|
||||||
"axios": "^1.9.0",
|
"axios": "^1.9.0",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"medium-zoom": "^1.1.0",
|
"medium-zoom": "^1.1.0",
|
||||||
"vitepress": "^2.0.0-alpha.4",
|
"vitepress": "^2.0.0-alpha.4",
|
||||||
"vitepress-plugin-lightbox": "^1.0.2"
|
"vitepress-plugin-lightbox": "^1.0.2"
|
||||||
@@ -25,8 +26,8 @@
|
|||||||
"commitAll": "git add . && git commit -m \"build: publish\" && git push && pnpm run commitPro",
|
"commitAll": "git add . && git commit -m \"build: publish\" && git push && pnpm run commitPro",
|
||||||
"commitPro": "cd ./packages/pro/ && git add . && git commit -m \"build: publish\" && git push",
|
"commitPro": "cd ./packages/pro/ && git add . && git commit -m \"build: publish\" && git push",
|
||||||
"copylogs": "copyfiles \"CHANGELOG.md\" ./docs/guide/changelogs/",
|
"copylogs": "copyfiles \"CHANGELOG.md\" ./docs/guide/changelogs/",
|
||||||
"prepublishOnly1": "pnpm run check && lerna run build ",
|
"prepublishOnly1": "pnpm run test:unit && pnpm run check && lerna run build ",
|
||||||
"prepublishOnly2": "pnpm run check && pnpm run before-build && lerna run build && pnpm run plugin-doc-gen",
|
"prepublishOnly2": "pnpm run test:unit && pnpm run check && pnpm run before-build && lerna run build && pnpm run plugin-doc-gen",
|
||||||
"before-build": "pnpm run transform-sql && cd ./packages/core/basic && time /t >build.md && git add ./build.md && git commit -m \"build: prepare to build\"",
|
"before-build": "pnpm run transform-sql && cd ./packages/core/basic && time /t >build.md && git add ./build.md && git commit -m \"build: prepare to build\"",
|
||||||
"deploy1": "node --experimental-json-modules ./scripts/deploy.js ",
|
"deploy1": "node --experimental-json-modules ./scripts/deploy.js ",
|
||||||
"check": "node --experimental-json-modules ./scripts/publish-check.js",
|
"check": "node --experimental-json-modules ./scripts/publish-check.js",
|
||||||
@@ -35,6 +36,7 @@
|
|||||||
"docs:dev": "vitepress dev docs",
|
"docs:dev": "vitepress dev docs",
|
||||||
"docs:build": "pnpm run copylogs && vitepress build docs",
|
"docs:build": "pnpm run copylogs && vitepress build docs",
|
||||||
"docs:preview": "vitepress preview docs",
|
"docs:preview": "vitepress preview docs",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest pnpm -r --workspace-concurrency=1 run test:unit",
|
||||||
"pub": "echo 1",
|
"pub": "echo 1",
|
||||||
"dev": "pnpm run -r --parallel compile ",
|
"dev": "pnpm run -r --parallel compile ",
|
||||||
"pub_all":"pnpm run -r --parallel pub ",
|
"pub_all":"pnpm run -r --parallel pub ",
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
{
|
{
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2022,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"ignorePatterns": [
|
||||||
|
"dist",
|
||||||
|
"node_modules"
|
||||||
|
],
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended",
|
||||||
"prettier"
|
"prettier"
|
||||||
@@ -7,9 +16,12 @@
|
|||||||
"eslint-plugin-import"
|
"eslint-plugin-import"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
|
"node": true,
|
||||||
|
"es2022": true,
|
||||||
"mocha": true
|
"mocha": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"prettier/prettier": "off",
|
||||||
"@typescript-eslint/no-var-requires": "off",
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
"@typescript-eslint/ban-ts-comment": "off",
|
"@typescript-eslint/ban-ts-comment": "off",
|
||||||
"@typescript-eslint/ban-ts-ignore": "off",
|
"@typescript-eslint/ban-ts-ignore": "off",
|
||||||
|
|||||||
@@ -4,3 +4,8 @@ node_modules/
|
|||||||
npm-debug.log
|
npm-debug.log
|
||||||
package-lock.json
|
package-lock.json
|
||||||
/.idea/
|
/.idea/
|
||||||
|
/dist/
|
||||||
|
/dist-test/
|
||||||
|
/logs/
|
||||||
|
/tsconfig.tsbuildinfo
|
||||||
|
/tsconfig.test.tsbuildinfo
|
||||||
|
|||||||
@@ -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.39.16](https://github.com/publishlab/node-acme-client/compare/v1.39.15...v1.39.16) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.39.15](https://github.com/publishlab/node-acme-client/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 优化申请时报错日志增加对应域名打印 ([d6e9e59](https://github.com/publishlab/node-acme-client/commit/d6e9e5987bd52ea12ee18745615486eadd4c87ff))
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/publishlab/node-acme-client/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/publishlab/node-acme-client/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/publishlab/node-acme-client/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/publishlab/node-acme-client/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/publishlab/node-acme-client/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -3,22 +3,22 @@
|
|||||||
"description": "Simple and unopinionated ACME client",
|
"description": "Simple and unopinionated ACME client",
|
||||||
"private": false,
|
"private": false,
|
||||||
"author": "nmorsman",
|
"author": "nmorsman",
|
||||||
"version": "1.39.12",
|
"version": "1.39.16",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"module": "scr/index.js",
|
"module": "./dist/index.js",
|
||||||
"main": "src/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "types/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"homepage": "https://github.com/publishlab/node-acme-client",
|
"homepage": "https://github.com/publishlab/node-acme-client",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 18"
|
"node": ">= 18"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"src",
|
"dist",
|
||||||
"types"
|
"types"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/basic": "^1.39.12",
|
"@certd/basic": "^1.39.16",
|
||||||
"@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",
|
||||||
@@ -35,10 +35,12 @@
|
|||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
"chai": "^4.4.1",
|
"chai": "^4.4.1",
|
||||||
"chai-as-promised": "^7.1.2",
|
"chai-as-promised": "^7.1.2",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-import": "^2.29.1",
|
"eslint-plugin-import": "^2.29.1",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"jsdoc-to-markdown": "^8.0.1",
|
"jsdoc-to-markdown": "^8.0.1",
|
||||||
"mocha": "^10.6.0",
|
"mocha": "^10.6.0",
|
||||||
"nock": "^13.5.4",
|
"nock": "^13.5.4",
|
||||||
@@ -47,13 +49,17 @@
|
|||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-docs": "jsdoc2md src/client.js > docs/client.md && jsdoc2md src/crypto/index.js > docs/crypto.md && jsdoc2md src/crypto/forge.js > docs/forge.md",
|
"before-build": "node -e \"const fs=require('fs');fs.rmSync('dist',{recursive:true,force:true});fs.rmSync('tsconfig.tsbuildinfo',{force:true});\"",
|
||||||
"lint": "eslint .",
|
"build": "npm run before-build && tsc --skipLibCheck",
|
||||||
"lint-types": "tsd",
|
"build-docs": "jsdoc2md dist/client.js > docs/client.md && jsdoc2md dist/crypto/index.js > docs/crypto.md && jsdoc2md dist/crypto/forge.js > docs/forge.md",
|
||||||
"prepublishOnly": "npm run build-docs",
|
"lint": "eslint \"src/**/*.ts\" \"types/**/*.ts\"",
|
||||||
|
"lint-types": "tsd --files \"types/index.test-d.ts\"",
|
||||||
|
"prepublishOnly": "npm run build && npm run build-docs",
|
||||||
"test": "mocha -t 60000 \"test/setup.js\" \"test/**/*.spec.js\"",
|
"test": "mocha -t 60000 \"test/setup.js\" \"test/**/*.spec.js\"",
|
||||||
|
"before-test:unit": "node -e \"const fs=require('fs');fs.rmSync('dist-test',{recursive:true,force:true});fs.rmSync('tsconfig.test.tsbuildinfo',{force:true});\"",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest npm run before-test:unit && cross-env NODE_ENV=unittest tsc -p tsconfig.test.json --skipLibCheck && cross-env NODE_ENV=unittest mocha -t 60000 \"dist-test/**/*.test.js\"",
|
||||||
"pub": "npm publish",
|
"pub": "npm publish",
|
||||||
"compile": "echo '1'"
|
"compile": "tsc --skipLibCheck --watch"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -70,5 +76,5 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* ACME API client
|
* ACME API client
|
||||||
*/
|
*/
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* ACME auto helper
|
* ACME auto helper
|
||||||
*/
|
*/
|
||||||
@@ -166,6 +167,7 @@ export default async (client, userOpts) => {
|
|||||||
await client.completeChallenge(challenge);
|
await client.completeChallenge(challenge);
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
await deactivateAuth(e);
|
await deactivateAuth(e);
|
||||||
|
e.message = `[${d}] ${e.message || "completeChallenge error"}`;
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
challengeCompleted = true;
|
challengeCompleted = true;
|
||||||
@@ -177,6 +179,7 @@ export default async (client, userOpts) => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(`[auto] [${d}] challengeCreateFn threw error: ${e.message || e}`);
|
log(`[auto] [${d}] challengeCreateFn threw error: ${e.message || e}`);
|
||||||
await deactivateAuth(e);
|
await deactivateAuth(e);
|
||||||
|
e.message = `[${d}] ${e.message || "challengeCreateFn error"}`;
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* Axios instance
|
* Axios instance
|
||||||
*/
|
*/
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* ACME client
|
* ACME client
|
||||||
*
|
*
|
||||||
@@ -570,7 +571,7 @@ class AcmeClient {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
async waitForValidStatus(item,d) {
|
async waitForValidStatus(item, d?) {
|
||||||
if (!item.url) {
|
if (!item.url) {
|
||||||
throw new Error(`[${d}] Unable to verify status of item, URL not found`);
|
throw new Error(`[${d}] Unable to verify status of item, URL not found`);
|
||||||
}
|
}
|
||||||
+5
-4
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* Legacy node-forge crypto interface
|
* Legacy node-forge crypto interface
|
||||||
*
|
*
|
||||||
@@ -112,7 +113,7 @@ function parseDomains(obj) {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export async function createPrivateKey(size = 2048) {
|
export async function createPrivateKey(size = 2048): Promise<Buffer> {
|
||||||
const keyPair = await generateKeyPair({ bits: size });
|
const keyPair = await generateKeyPair({ bits: size });
|
||||||
const pemKey = forge.pki.privateKeyToPem(keyPair.privateKey);
|
const pemKey = forge.pki.privateKeyToPem(keyPair.privateKey);
|
||||||
return Buffer.from(pemKey);
|
return Buffer.from(pemKey);
|
||||||
@@ -131,7 +132,7 @@ export async function createPrivateKey(size = 2048) {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const createPublicKey = async (key) => {
|
export const createPublicKey = async (key): Promise<Buffer> => {
|
||||||
const privateKey = forge.pki.privateKeyFromPem(key);
|
const privateKey = forge.pki.privateKeyFromPem(key);
|
||||||
const publicKey = forge.pki.rsa.setPublicKey(privateKey.n, privateKey.e);
|
const publicKey = forge.pki.rsa.setPublicKey(privateKey.n, privateKey.e);
|
||||||
const pemKey = forge.pki.publicKeyToPem(publicKey);
|
const pemKey = forge.pki.publicKeyToPem(publicKey);
|
||||||
@@ -174,7 +175,7 @@ export const splitPemChain = (str) => forge.pem.decode(str).map(forge.pem.encode
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const getModulus = async (input) => {
|
export const getModulus = async (input): Promise<Buffer> => {
|
||||||
if (!Buffer.isBuffer(input)) {
|
if (!Buffer.isBuffer(input)) {
|
||||||
input = Buffer.from(input);
|
input = Buffer.from(input);
|
||||||
}
|
}
|
||||||
@@ -197,7 +198,7 @@ export const getModulus = async (input) => {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const getPublicExponent = async (input) => {
|
export const getPublicExponent = async (input): Promise<Buffer> => {
|
||||||
if (!Buffer.isBuffer(input)) {
|
if (!Buffer.isBuffer(input)) {
|
||||||
input = Buffer.from(input);
|
input = Buffer.from(input);
|
||||||
}
|
}
|
||||||
+4
-3
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* Native Node.js crypto interface
|
* Native Node.js crypto interface
|
||||||
*
|
*
|
||||||
@@ -67,7 +68,7 @@ function getKeyInfo(keyPem) {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export async function createPrivateRsaKey(modulusLength = 2048, encodingType = 'pkcs8') {
|
export async function createPrivateRsaKey(modulusLength = 2048, encodingType = 'pkcs8'): Promise<Buffer> {
|
||||||
const pair = await generateKeyPair('rsa', {
|
const pair = await generateKeyPair('rsa', {
|
||||||
modulusLength,
|
modulusLength,
|
||||||
privateKeyEncoding: {
|
privateKeyEncoding: {
|
||||||
@@ -105,7 +106,7 @@ export const createPrivateKey = createPrivateRsaKey;
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const createPrivateEcdsaKey = async (namedCurve = 'P-256', encodingType = 'pkcs8') => {
|
export const createPrivateEcdsaKey = async (namedCurve = 'P-256', encodingType = 'pkcs8'): Promise<Buffer> => {
|
||||||
const pair = await generateKeyPair('ec', {
|
const pair = await generateKeyPair('ec', {
|
||||||
namedCurve,
|
namedCurve,
|
||||||
privateKeyEncoding: {
|
privateKeyEncoding: {
|
||||||
@@ -129,7 +130,7 @@ export const createPrivateEcdsaKey = async (namedCurve = 'P-256', encodingType =
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const getPublicKey = (keyPem) => {
|
export const getPublicKey = (keyPem): Buffer => {
|
||||||
const info = getKeyInfo(keyPem);
|
const info = getKeyInfo(keyPem);
|
||||||
|
|
||||||
const publicKey = info.publicKey.export({
|
const publicKey = info.publicKey.export({
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
export class CancelError extends Error {
|
export class CancelError extends Error {
|
||||||
constructor(message) {
|
constructor(message) {
|
||||||
super(message);
|
super(message);
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* ACME HTTP client
|
* ACME HTTP client
|
||||||
*/
|
*/
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import { directory, getAllSslProviderDomains, getDirectoryUrl } from "./index.js";
|
||||||
|
|
||||||
|
declare const describe: any;
|
||||||
|
declare const it: any;
|
||||||
|
|
||||||
|
describe("directory helpers", () => {
|
||||||
|
it("selects the provider specific directory endpoint", () => {
|
||||||
|
assert.equal(getDirectoryUrl({ sslProvider: "sslcom", pkType: "ec" }), directory.sslcom.ec);
|
||||||
|
assert.equal(getDirectoryUrl({ sslProvider: "letsencrypt", pkType: "rsa" }), directory.letsencrypt.production);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("includes configured provider domains", () => {
|
||||||
|
const domains = getAllSslProviderDomains();
|
||||||
|
|
||||||
|
assert.ok(domains.includes("acme.litessl.com"));
|
||||||
|
assert.ok(domains.includes("acme.ssl.com"));
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* acme-client
|
* acme-client
|
||||||
*/
|
*/
|
||||||
import AcmeClinet from './client.js'
|
export { default as Client } from './client.js'
|
||||||
export const Client = AcmeClinet
|
export type * from './types.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Directory URLs
|
* Directory URLs
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* ACME logger
|
* ACME logger
|
||||||
*/
|
*/
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
/**
|
||||||
|
* Account
|
||||||
|
*
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-7.1.2
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-7.3
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-7.3.2
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface Account {
|
||||||
|
status: "valid" | "deactivated" | "revoked";
|
||||||
|
orders: string;
|
||||||
|
contact?: string[];
|
||||||
|
termsOfServiceAgreed?: boolean;
|
||||||
|
externalAccountBinding?: object;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AccountCreateRequest {
|
||||||
|
contact?: string[];
|
||||||
|
termsOfServiceAgreed?: boolean;
|
||||||
|
onlyReturnExisting?: boolean;
|
||||||
|
externalAccountBinding?: object;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AccountUpdateRequest {
|
||||||
|
status?: string;
|
||||||
|
contact?: string[];
|
||||||
|
termsOfServiceAgreed?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Order
|
||||||
|
*
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-7.1.3
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-7.4
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface Order {
|
||||||
|
status: "pending" | "ready" | "processing" | "valid" | "invalid";
|
||||||
|
identifiers: Identifier[];
|
||||||
|
authorizations: string[];
|
||||||
|
finalize: string;
|
||||||
|
expires?: string;
|
||||||
|
notBefore?: string;
|
||||||
|
notAfter?: string;
|
||||||
|
error?: object;
|
||||||
|
certificate?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OrderCreateRequest {
|
||||||
|
identifiers: Identifier[];
|
||||||
|
notBefore?: string;
|
||||||
|
notAfter?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authorization
|
||||||
|
*
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-7.1.4
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface Authorization {
|
||||||
|
identifier: Identifier;
|
||||||
|
status: "pending" | "valid" | "invalid" | "deactivated" | "expired" | "revoked";
|
||||||
|
challenges: Challenge[];
|
||||||
|
expires?: string;
|
||||||
|
wildcard?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Identifier {
|
||||||
|
type: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Challenge
|
||||||
|
*
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-8
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-8.3
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-8.4
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface ChallengeAbstract {
|
||||||
|
type: string;
|
||||||
|
url: string;
|
||||||
|
status: "pending" | "processing" | "valid" | "invalid";
|
||||||
|
validated?: string;
|
||||||
|
error?: object;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HttpChallenge extends ChallengeAbstract {
|
||||||
|
type: "http-01";
|
||||||
|
token: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DnsChallenge extends ChallengeAbstract {
|
||||||
|
type: "dns-01";
|
||||||
|
token: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Challenge = HttpChallenge | DnsChallenge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Certificate
|
||||||
|
*
|
||||||
|
* https://datatracker.ietf.org/doc/html/rfc8555#section-7.6
|
||||||
|
*/
|
||||||
|
|
||||||
|
export enum CertificateRevocationReason {
|
||||||
|
Unspecified = 0,
|
||||||
|
KeyCompromise = 1,
|
||||||
|
CACompromise = 2,
|
||||||
|
AffiliationChanged = 3,
|
||||||
|
Superseded = 4,
|
||||||
|
CessationOfOperation = 5,
|
||||||
|
CertificateHold = 6,
|
||||||
|
RemoveFromCRL = 8,
|
||||||
|
PrivilegeWithdrawn = 9,
|
||||||
|
AACompromise = 10,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CertificateRevocationRequest {
|
||||||
|
reason?: CertificateRevocationReason;
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
import type * as rfc8555 from "./rfc8555.js";
|
||||||
|
import type { Challenge } from "./rfc8555.js";
|
||||||
|
|
||||||
|
export type * from "./rfc8555.js";
|
||||||
|
|
||||||
|
export type PrivateKeyBuffer = Buffer;
|
||||||
|
export type PublicKeyBuffer = Buffer;
|
||||||
|
export type CertificateBuffer = Buffer;
|
||||||
|
export type CsrBuffer = Buffer;
|
||||||
|
|
||||||
|
export type PrivateKeyString = string;
|
||||||
|
export type PublicKeyString = string;
|
||||||
|
export type CertificateString = string;
|
||||||
|
export type CsrString = string;
|
||||||
|
|
||||||
|
export interface Order extends rfc8555.Order {
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Authorization extends rfc8555.Authorization {
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UrlMapping = {
|
||||||
|
enabled: boolean;
|
||||||
|
mappings: Record<string, string>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface ClientExternalAccountBindingOptions {
|
||||||
|
kid: string;
|
||||||
|
hmacKey: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ClientOptions {
|
||||||
|
sslProvider: string;
|
||||||
|
directoryUrl: string;
|
||||||
|
accountKey: PrivateKeyBuffer | PrivateKeyString;
|
||||||
|
accountUrl?: string;
|
||||||
|
externalAccountBinding?: ClientExternalAccountBindingOptions;
|
||||||
|
backoffAttempts?: number;
|
||||||
|
backoffMin?: number;
|
||||||
|
backoffMax?: number;
|
||||||
|
urlMapping?: UrlMapping;
|
||||||
|
signal?: AbortSignal;
|
||||||
|
logger?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ClientAutoOptions {
|
||||||
|
csr: CsrBuffer | CsrString;
|
||||||
|
challengeCreateFn: (
|
||||||
|
authz: Authorization,
|
||||||
|
keyAuthorization: (challenge: Challenge) => Promise<string>
|
||||||
|
) => Promise<{ recordReq?: any; recordRes?: any; dnsProvider?: any; challenge: Challenge; keyAuthorization: string }>;
|
||||||
|
challengeRemoveFn: (authz: Authorization, challenge: Challenge, keyAuthorization: string, recordReq: any, recordRes: any, dnsProvider: any, httpUploader: any) => Promise<any>;
|
||||||
|
email?: string;
|
||||||
|
termsOfServiceAgreed?: boolean;
|
||||||
|
skipChallengeVerification?: boolean;
|
||||||
|
challengePriority?: string[];
|
||||||
|
preferredChain?: string;
|
||||||
|
signal?: AbortSignal;
|
||||||
|
profile?: string;
|
||||||
|
waitDnsDiffuseTime?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CertificateDomains {
|
||||||
|
commonName: string;
|
||||||
|
altNames: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CertificateIssuer {
|
||||||
|
commonName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CertificateInfo {
|
||||||
|
issuer: CertificateIssuer;
|
||||||
|
domains: CertificateDomains;
|
||||||
|
notAfter: Date;
|
||||||
|
notBefore: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CsrOptions {
|
||||||
|
keySize?: number;
|
||||||
|
commonName?: string;
|
||||||
|
altNames?: string[];
|
||||||
|
country?: string;
|
||||||
|
state?: string;
|
||||||
|
locality?: string;
|
||||||
|
organization?: string;
|
||||||
|
organizationUnit?: string;
|
||||||
|
emailAddress?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RsaPublicJwk {
|
||||||
|
e: string;
|
||||||
|
kty: string;
|
||||||
|
n: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EcdsaPublicJwk {
|
||||||
|
crv: string;
|
||||||
|
kty: string;
|
||||||
|
x: string;
|
||||||
|
y: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CryptoInterface {
|
||||||
|
createPrivateKey(keySize?: number, encodingType?: string): Promise<PrivateKeyBuffer>;
|
||||||
|
createPrivateRsaKey(keySize?: number, encodingType?: string): Promise<PrivateKeyBuffer>;
|
||||||
|
createPrivateEcdsaKey(namedCurve?: "P-256" | "P-384" | "P-521", encodingType?: string): Promise<PrivateKeyBuffer>;
|
||||||
|
getPublicKey(keyPem: PrivateKeyBuffer | PrivateKeyString | PublicKeyBuffer | PublicKeyString): PublicKeyBuffer;
|
||||||
|
getJwk(keyPem: PrivateKeyBuffer | PrivateKeyString | PublicKeyBuffer | PublicKeyString): RsaPublicJwk | EcdsaPublicJwk;
|
||||||
|
splitPemChain(chainPem: CertificateBuffer | CertificateString): string[];
|
||||||
|
getPemBodyAsB64u(pem: CertificateBuffer | CertificateString): string;
|
||||||
|
readCsrDomains(csrPem: CsrBuffer | CsrString): CertificateDomains;
|
||||||
|
readCertificateInfo(certPem: CertificateBuffer | CertificateString): CertificateInfo;
|
||||||
|
createCsr(data: CsrOptions, keyPem?: PrivateKeyBuffer | PrivateKeyString, encodingType?: string): Promise<[PrivateKeyBuffer, CsrBuffer]>;
|
||||||
|
createAlpnCertificate(authz: Authorization, keyAuthorization: string, keyPem?: PrivateKeyBuffer | PrivateKeyString): Promise<[PrivateKeyBuffer, CertificateBuffer]>;
|
||||||
|
isAlpnCertificateAuthorizationValid(certPem: CertificateBuffer | CertificateString, keyAuthorization: string): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CryptoLegacyInterface {
|
||||||
|
createPrivateKey(size?: number): Promise<PrivateKeyBuffer>;
|
||||||
|
createPublicKey(key: PrivateKeyBuffer | PrivateKeyString): Promise<PublicKeyBuffer>;
|
||||||
|
getPemBody(str: string): string;
|
||||||
|
splitPemChain(str: string): string[];
|
||||||
|
getModulus(input: PrivateKeyBuffer | PrivateKeyString | PublicKeyBuffer | PublicKeyString | CertificateBuffer | CertificateString | CsrBuffer | CsrString): Promise<Buffer>;
|
||||||
|
getPublicExponent(input: PrivateKeyBuffer | PrivateKeyString | PublicKeyBuffer | PublicKeyString | CertificateBuffer | CertificateString | CsrBuffer | CsrString): Promise<Buffer>;
|
||||||
|
readCsrDomains(csr: CsrBuffer | CsrString): Promise<CertificateDomains>;
|
||||||
|
readCertificateInfo(cert: CertificateBuffer | CertificateString): Promise<CertificateInfo>;
|
||||||
|
createCsr(data: CsrOptions, key?: PrivateKeyBuffer | PrivateKeyString): Promise<[PrivateKeyBuffer, CsrBuffer]>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import { formatResponseError, parseRetryAfterHeader, retry } from "./util.js";
|
||||||
|
|
||||||
|
declare const describe: any;
|
||||||
|
declare const it: any;
|
||||||
|
|
||||||
|
describe("util helpers", () => {
|
||||||
|
it("parses retry-after values", () => {
|
||||||
|
assert.equal(parseRetryAfterHeader("120"), 120);
|
||||||
|
assert.equal(parseRetryAfterHeader("invalid"), 0);
|
||||||
|
assert.equal(parseRetryAfterHeader("Wed, 21 Oct 2015 07:28:00 GMT"), 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("formats response errors without newlines", () => {
|
||||||
|
const error = formatResponseError({
|
||||||
|
data: {
|
||||||
|
error: {
|
||||||
|
detail: "line 1\nline 2",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.equal(error, "line 1line 2");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("retries until success", async () => {
|
||||||
|
const delays: number[] = [];
|
||||||
|
const originalSetTimeout = globalThis.setTimeout;
|
||||||
|
let attempts = 0;
|
||||||
|
|
||||||
|
(globalThis as any).setTimeout = (fn: (...args: any[]) => void, delay?: number) => {
|
||||||
|
delays.push(Number(delay));
|
||||||
|
return originalSetTimeout(fn, 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await retry(
|
||||||
|
async () => {
|
||||||
|
attempts += 1;
|
||||||
|
|
||||||
|
if (attempts < 3) {
|
||||||
|
throw new Error(`boom-${attempts}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "ok";
|
||||||
|
},
|
||||||
|
{ attempts: 3, min: 10, max: 20 },
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.equal(result, "ok");
|
||||||
|
assert.equal(attempts, 3);
|
||||||
|
assert.deepEqual(delays, [10, 20]);
|
||||||
|
} finally {
|
||||||
|
(globalThis as any).setTimeout = originalSetTimeout;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* Utility methods
|
* Utility methods
|
||||||
*/
|
*/
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/**
|
/**
|
||||||
* ACME challenge verification
|
* ACME challenge verification
|
||||||
*/
|
*/
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
export async function wait(ms) {
|
export async function wait(ms) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
setTimeout(resolve, ms);
|
setTimeout(resolve, ms);
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"compileOnSave": true,
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"inlineSourceMap": false,
|
||||||
|
"sourceMap": false,
|
||||||
|
"noImplicitThis": false,
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
"stripInternal": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"pretty": true,
|
||||||
|
"declaration": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"outDir": "dist",
|
||||||
|
"rootDir": "src",
|
||||||
|
"composite": false,
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"strict": false,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": false,
|
||||||
|
"lib": ["ESNext", "DOM"]
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.json"],
|
||||||
|
"exclude": ["dist", "node_modules", "src/**/*.test.ts", "test"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "dist-test",
|
||||||
|
"declaration": false,
|
||||||
|
"declarationMap": false,
|
||||||
|
"emitDeclarationOnly": false
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts"],
|
||||||
|
"exclude": ["dist", "dist-test", "node_modules", "test"]
|
||||||
|
}
|
||||||
+14
-5
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
import { AxiosInstance } from 'axios';
|
import { AxiosInstance } from 'axios';
|
||||||
import * as rfc8555 from './rfc8555';
|
import * as rfc8555 from './rfc8555';
|
||||||
import {CancelError} from '../src/error.js'
|
|
||||||
export * from '../src/error.js'
|
|
||||||
|
|
||||||
export type PrivateKeyBuffer = Buffer;
|
export type PrivateKeyBuffer = Buffer;
|
||||||
export type PublicKeyBuffer = Buffer;
|
export type PublicKeyBuffer = Buffer;
|
||||||
@@ -115,6 +113,15 @@ export const directory: {
|
|||||||
zerossl: {
|
zerossl: {
|
||||||
staging: string,
|
staging: string,
|
||||||
production: string
|
production: string
|
||||||
|
},
|
||||||
|
sslcom: {
|
||||||
|
staging: string,
|
||||||
|
production: string,
|
||||||
|
ec: string
|
||||||
|
},
|
||||||
|
litessl: {
|
||||||
|
staging: string,
|
||||||
|
production: string
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -211,14 +218,16 @@ export const agents: any;
|
|||||||
* Logger
|
* Logger
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export class CancelError extends Error {
|
||||||
|
constructor(message?: string);
|
||||||
|
}
|
||||||
|
|
||||||
export function setLogger(fn: (message: any, ...args: any[]) => void): void;
|
export function setLogger(fn: (message: any, ...args: any[]) => void): void;
|
||||||
|
|
||||||
export function createChallengeFn(opts?: {logger?:any}): any;
|
export function createChallengeFn(opts?: {logger?:any}): any;
|
||||||
// export function walkTxtRecord(record: any): Promise<string[]>;
|
// export function walkTxtRecord(record: any): Promise<string[]>;
|
||||||
export function getAuthoritativeDnsResolver(record:string): Promise<any>;
|
export function getAuthoritativeDnsResolver(record:string): Promise<any>;
|
||||||
|
|
||||||
export const CancelError: typeof CancelError;
|
|
||||||
|
|
||||||
export function resolveDomainBySoaRecord(domain: string): Promise<string>;
|
export function resolveDomainBySoaRecord(domain: string): Promise<string>;
|
||||||
|
|
||||||
export function setWalkFromAuthoritative(value = true): void;
|
export function setWalkFromAuthoritative(value?: boolean): void;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* acme-client type definition tests
|
* acme-client type definition tests
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as acme from 'acme-client';
|
import * as acme from '..';
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
/* Client */
|
/* Client */
|
||||||
@@ -10,6 +10,7 @@ import * as acme from 'acme-client';
|
|||||||
|
|
||||||
const client = new acme.Client({
|
const client = new acme.Client({
|
||||||
accountKey,
|
accountKey,
|
||||||
|
sslProvider: 'letsencrypt',
|
||||||
directoryUrl: acme.directory.letsencrypt.staging
|
directoryUrl: acme.directory.letsencrypt.staging
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -52,7 +53,10 @@ import * as acme from 'acme-client';
|
|||||||
/* Auto */
|
/* Auto */
|
||||||
await client.auto({
|
await client.auto({
|
||||||
csr: certCsr,
|
csr: certCsr,
|
||||||
challengeCreateFn: async (authz, challenge, keyAuthorization) => {},
|
challengeCreateFn: async (authz, keyAuthorization) => ({
|
||||||
|
challenge: authz.challenges[0],
|
||||||
|
keyAuthorization: await keyAuthorization(authz.challenges[0])
|
||||||
|
}),
|
||||||
challengeRemoveFn: async (authz, challenge, keyAuthorization) => {}
|
challengeRemoveFn: async (authz, challenge, keyAuthorization) => {}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -63,7 +67,10 @@ import * as acme from 'acme-client';
|
|||||||
skipChallengeVerification: false,
|
skipChallengeVerification: false,
|
||||||
challengePriority: ['http-01', 'dns-01'],
|
challengePriority: ['http-01', 'dns-01'],
|
||||||
preferredChain: 'DST Root CA X3',
|
preferredChain: 'DST Root CA X3',
|
||||||
challengeCreateFn: async (authz, challenge, keyAuthorization) => {},
|
challengeCreateFn: async (authz, keyAuthorization) => ({
|
||||||
|
challenge: authz.challenges[0],
|
||||||
|
keyAuthorization: await keyAuthorization(authz.challenges[0])
|
||||||
|
}),
|
||||||
challengeRemoveFn: async (authz, challenge, keyAuthorization) => {}
|
challengeRemoveFn: async (authz, challenge, keyAuthorization) => {}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -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.39.16](https://github.com/certd/certd/compare/v1.39.15...v1.39.16) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/basic
|
||||||
|
|
||||||
|
## [1.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **network:** 新增全局公共http请求 headers设置 ([aad9045](https://github.com/certd/certd/commit/aad9045de55e76cb2ad09cac74a7bd60a4b47124))
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/basic
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
23:06
|
14:13
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/basic",
|
"name": "@certd/basic",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.39.12",
|
"version": "1.39.16",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
"dev-build": "npm run build",
|
"dev-build": "npm run build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"test": "mocha --loader=ts-node/esm",
|
"test": "mocha --loader=ts-node/esm",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest mocha --node-option no-warnings --node-option loader=ts-node/esm \"src/**/*.test.ts\"",
|
||||||
"pub": "npm publish",
|
"pub": "npm publish",
|
||||||
"compile": "tsc --skipLibCheck --watch"
|
"compile": "tsc --skipLibCheck --watch"
|
||||||
},
|
},
|
||||||
@@ -39,13 +40,17 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
"chai": "4.3.10",
|
"chai": "4.3.10",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.41.0",
|
"eslint": "^8.41.0",
|
||||||
"eslint-config-prettier": "^8.8.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
|
"mocha": "^10.2.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { amountUtils } from "./util.amount.js";
|
||||||
|
|
||||||
|
describe("amountUtils", () => {
|
||||||
|
describe("toCent", () => {
|
||||||
|
it("converts yuan values to cents", () => {
|
||||||
|
expect(amountUtils.toCent(1)).to.equal(100);
|
||||||
|
expect(amountUtils.toCent(12.34)).to.equal(1234);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rounds to the nearest cent", () => {
|
||||||
|
expect(amountUtils.toCent(1.235)).to.equal(124);
|
||||||
|
expect(amountUtils.toCent(1.234)).to.equal(123);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("toYuan", () => {
|
||||||
|
it("converts cent values to yuan", () => {
|
||||||
|
expect(amountUtils.toYuan(100)).to.equal(1);
|
||||||
|
expect(amountUtils.toYuan(1234)).to.equal(12.34);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rounds yuan values to two decimal places", () => {
|
||||||
|
expect(amountUtils.toYuan(1235)).to.equal(12.35);
|
||||||
|
expect(amountUtils.toYuan(1)).to.equal(0.01);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { domainUtils } from "./util.domain.js";
|
||||||
|
|
||||||
|
describe("domainUtils", () => {
|
||||||
|
describe("match", () => {
|
||||||
|
it("matches exact domains", () => {
|
||||||
|
expect(domainUtils.match("example.com", ["example.com"])).to.equal(true);
|
||||||
|
expect(domainUtils.match("api.example.com", ["example.com"])).to.equal(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("matches wildcard domains by suffix", () => {
|
||||||
|
expect(domainUtils.match("api.example.com", ["*.example.com"])).to.equal(true);
|
||||||
|
expect(domainUtils.match("deep.api.example.com", ["*.example.com"])).to.equal(false);
|
||||||
|
expect(domainUtils.match("example.com", ["*.example.com"])).to.equal(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("requires every target domain to match", () => {
|
||||||
|
expect(domainUtils.match(["api.example.com", "admin.example.com"], ["*.example.com"])).to.equal(true);
|
||||||
|
expect(domainUtils.match(["api.example.com", "other.com"], ["*.example.com"])).to.equal(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("isIp", () => {
|
||||||
|
it("detects valid IPv4 addresses", () => {
|
||||||
|
expect(domainUtils.isIpv4("127.0.0.1")).to.equal(true);
|
||||||
|
expect(domainUtils.isIpv4("255.255.255.255")).to.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rejects invalid IPv4 addresses", () => {
|
||||||
|
expect(domainUtils.isIpv4("999.1.1.1")).to.equal(false);
|
||||||
|
expect(domainUtils.isIpv4("1.2.3")).to.equal(false);
|
||||||
|
expect(domainUtils.isIpv4("example.com")).to.equal(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("detects IPv6 addresses", () => {
|
||||||
|
expect(domainUtils.isIpv6("2001:db8::1")).to.equal(true);
|
||||||
|
expect(domainUtils.isIp("2001:db8::1")).to.equal(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -51,7 +51,10 @@ function isIpv4(d: string) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const isIPv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;
|
const isIPv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;
|
||||||
return isIPv4Regex.test(d);
|
if (!isIPv4Regex.test(d)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return d.split(".").every(item => Number(item) <= 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isIpv6(d: string) {
|
function isIpv6(d: string) {
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { isDev } from "./util.env.js";
|
||||||
|
|
||||||
|
describe("isDev", () => {
|
||||||
|
const originalNodeEnv = process.env.NODE_ENV;
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
if (originalNodeEnv == null) {
|
||||||
|
delete process.env.NODE_ENV;
|
||||||
|
} else {
|
||||||
|
process.env.NODE_ENV = originalNodeEnv;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it("treats missing NODE_ENV as development", () => {
|
||||||
|
delete process.env.NODE_ENV;
|
||||||
|
|
||||||
|
expect(isDev()).to.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("detects development-like NODE_ENV values", () => {
|
||||||
|
process.env.NODE_ENV = "development";
|
||||||
|
expect(isDev()).to.equal(true);
|
||||||
|
|
||||||
|
process.env.NODE_ENV = "local";
|
||||||
|
expect(isDev()).to.equal(true);
|
||||||
|
|
||||||
|
process.env.NODE_ENV = "dev-test";
|
||||||
|
expect(isDev()).to.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rejects production-like NODE_ENV values", () => {
|
||||||
|
process.env.NODE_ENV = "production";
|
||||||
|
expect(isDev()).to.equal(false);
|
||||||
|
|
||||||
|
process.env.NODE_ENV = "test";
|
||||||
|
expect(isDev()).to.equal(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { hashUtils } from "./util.hash.js";
|
||||||
|
|
||||||
|
describe("hashUtils", () => {
|
||||||
|
describe("digest helpers", () => {
|
||||||
|
it("generates md5 and sha256 hex digests by default", () => {
|
||||||
|
expect(hashUtils.md5("certd")).to.equal("3f3d9f715fcc63d54a4a224e0939a233");
|
||||||
|
expect(hashUtils.sha256("certd")).to.equal("26a6366060d2a6477185c05075155769cb438c6c71f61f509535b8516594ad92");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("supports alternate digest encodings", () => {
|
||||||
|
expect(hashUtils.md5("certd", "base64")).to.equal("Pz2fcV/MY9VKSiJOCTmiMw==");
|
||||||
|
expect(hashUtils.sha256("certd", "base64")).to.equal("JqY2YGDSpkdxhcBQdRVXactDjGxx9h9QlTW4UWWUrZI=");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("hmac helpers", () => {
|
||||||
|
it("signs data with a provided key", () => {
|
||||||
|
expect(hashUtils.hmacSha256WithKey("secret", "certd")).to.equal("kh/kUD/Ji8FHfpt4vYUHZx+1BZvKSyyklZIiuS+Rzlg=");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("uses an empty payload when only the key is provided", () => {
|
||||||
|
expect(hashUtils.hmacSha256("secret")).to.equal("+eZuF5tnR65UEI+C+K3os8Jddv0wr95sOVgixTAZYWk=");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("encoding helpers", () => {
|
||||||
|
it("round trips base64 values", () => {
|
||||||
|
const encoded = hashUtils.base64("证书-certd");
|
||||||
|
|
||||||
|
expect(encoded).to.equal("6K+B5LmmLWNlcnRk");
|
||||||
|
expect(hashUtils.base64Decode(encoded)).to.equal("证书-certd");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("converts strings and numbers to hex", () => {
|
||||||
|
expect(hashUtils.toHex("certd")).to.equal("6365727464");
|
||||||
|
expect(hashUtils.hexToStr("6365727464")).to.equal("certd");
|
||||||
|
expect(hashUtils.toHex(255)).to.equal("ff");
|
||||||
|
expect(hashUtils.hexToNumber("ff")).to.equal(255);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { randomNumber, simpleNanoId } from "./util.id.js";
|
||||||
|
|
||||||
|
describe("id utils", () => {
|
||||||
|
it("generates a four digit random number string", () => {
|
||||||
|
expect(randomNumber()).to.match(/^\d{4}$/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("generates a twelve character simple nano id", () => {
|
||||||
|
const id = simpleNanoId();
|
||||||
|
|
||||||
|
expect(id).to.have.length(12);
|
||||||
|
expect(id).to.match(/^[0-9a-zA-Z]+$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { mergeUtils, UnMergeable } from "./util.merge.js";
|
||||||
|
|
||||||
|
describe("mergeUtils", () => {
|
||||||
|
describe("merge", () => {
|
||||||
|
it("deep merges plain objects", () => {
|
||||||
|
const target = { acme: { email: "admin@example.com" }, deploy: { retries: 1 } };
|
||||||
|
|
||||||
|
const result = mergeUtils.merge(target, { acme: { dnsProvider: "cloudflare" } });
|
||||||
|
|
||||||
|
expect(result).to.equal(target);
|
||||||
|
expect(result).to.deep.equal({
|
||||||
|
acme: { email: "admin@example.com", dnsProvider: "cloudflare" },
|
||||||
|
deploy: { retries: 1 },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("replaces arrays instead of merging them by index", () => {
|
||||||
|
const result = mergeUtils.merge({ domains: ["old.example.com", "legacy.example.com"] }, { domains: ["new.example.com"] });
|
||||||
|
|
||||||
|
expect(result).to.deep.equal({ domains: ["new.example.com"] });
|
||||||
|
});
|
||||||
|
|
||||||
|
it("allows null to clear nested values", () => {
|
||||||
|
const result = mergeUtils.merge({ cert: { name: "certd" } }, { cert: null });
|
||||||
|
|
||||||
|
expect(result).to.deep.equal({ cert: null });
|
||||||
|
});
|
||||||
|
|
||||||
|
it("keeps undefined sources from overwriting existing nested values", () => {
|
||||||
|
const result = mergeUtils.merge({ cert: { name: "certd" } }, { cert: undefined });
|
||||||
|
|
||||||
|
expect(result).to.deep.equal({ cert: { name: "certd" } });
|
||||||
|
});
|
||||||
|
|
||||||
|
it("returns an UnMergeable source directly when it is merged at the top level", () => {
|
||||||
|
const source = new UnMergeable();
|
||||||
|
|
||||||
|
const result = mergeUtils.merge({ enabled: true }, source);
|
||||||
|
|
||||||
|
expect(result).to.equal(source);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("replaces nested values marked as UnMergeable", () => {
|
||||||
|
const source = new UnMergeable();
|
||||||
|
|
||||||
|
const result = mergeUtils.merge({ plugin: { enabled: true } }, { plugin: source });
|
||||||
|
|
||||||
|
expect(result.plugin).to.equal(source);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("cloneDeep", () => {
|
||||||
|
it("deep clones plain values", () => {
|
||||||
|
const source = { acme: { email: "admin@example.com" }, domains: ["example.com"] };
|
||||||
|
|
||||||
|
const result = mergeUtils.cloneDeep(source);
|
||||||
|
|
||||||
|
expect(result).to.deep.equal(source);
|
||||||
|
expect(result).not.to.equal(source);
|
||||||
|
expect(result.acme).not.to.equal(source.acme);
|
||||||
|
expect(result.domains).not.to.equal(source.domains);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("preserves references marked as not cloneable", () => {
|
||||||
|
const uncloneable = new UnMergeable();
|
||||||
|
const source = { plugin: uncloneable };
|
||||||
|
|
||||||
|
const result = mergeUtils.cloneDeep(source);
|
||||||
|
|
||||||
|
expect(result).not.to.equal(source);
|
||||||
|
expect(result.plugin).to.equal(uncloneable);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { optionsUtils } from "./util.options.js";
|
||||||
|
|
||||||
|
describe("optionsUtils", () => {
|
||||||
|
describe("groupByDomain", () => {
|
||||||
|
it("splits options by domain match", () => {
|
||||||
|
const matchedOption = { value: "matched", domain: "api.example.com" };
|
||||||
|
const wildcardMatchedOption = { value: "wildcard", domain: "admin.example.com" };
|
||||||
|
const unmatchedOption = { value: "unmatched", domain: "other.com" };
|
||||||
|
|
||||||
|
const result = optionsUtils.groupByDomain([matchedOption, wildcardMatchedOption, unmatchedOption], ["api.example.com", "*.example.com"]);
|
||||||
|
|
||||||
|
expect(result.matched).to.deep.equal([matchedOption, wildcardMatchedOption]);
|
||||||
|
expect(result.notMatched).to.deep.equal([unmatchedOption]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("treats options without matching domains as not matched", () => {
|
||||||
|
const optionWithoutDomain = { value: "empty" };
|
||||||
|
|
||||||
|
const result = optionsUtils.groupByDomain([optionWithoutDomain], ["example.com"]);
|
||||||
|
|
||||||
|
expect(result.matched).to.deep.equal([]);
|
||||||
|
expect(result.notMatched).to.deep.equal([optionWithoutDomain]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("buildGroupOptions", () => {
|
||||||
|
it("builds disabled group labels around matched and unmatched options", () => {
|
||||||
|
const matchedOption = { value: "matched", domain: "api.example.com" };
|
||||||
|
const unmatchedOption = { value: "unmatched", domain: "other.com" };
|
||||||
|
|
||||||
|
const result = optionsUtils.buildGroupOptions([matchedOption, unmatchedOption], ["api.example.com"]);
|
||||||
|
|
||||||
|
expect(result).to.deep.equal([{ value: "matched", disabled: true, label: "----已匹配----" }, matchedOption, { value: "unmatched", disabled: true, label: "----未匹配----" }, unmatchedOption]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { logger } from "./util.log.js";
|
||||||
|
import { promises } from "./util.promise.js";
|
||||||
|
|
||||||
|
describe("promises", () => {
|
||||||
|
describe("TimeoutPromise", () => {
|
||||||
|
it("resolves when the callback finishes before the timeout", async () => {
|
||||||
|
let completed = false;
|
||||||
|
|
||||||
|
await promises.TimeoutPromise(async () => {
|
||||||
|
completed = true;
|
||||||
|
}, 50);
|
||||||
|
|
||||||
|
expect(completed).to.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rejects when the callback exceeds the timeout", async () => {
|
||||||
|
try {
|
||||||
|
await promises.TimeoutPromise(() => new Promise<void>(resolve => setTimeout(resolve, 30)), 5);
|
||||||
|
expect.fail("expected TimeoutPromise to reject");
|
||||||
|
} catch (e: any) {
|
||||||
|
expect(e.message).to.equal("Task timeout in 5 ms");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("safePromise", () => {
|
||||||
|
it("resolves values provided by the callback", async () => {
|
||||||
|
const result = await promises.safePromise<string>(resolve => {
|
||||||
|
resolve("ok");
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(result).to.equal("ok");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rejects synchronous errors thrown by the callback", async () => {
|
||||||
|
const oldLevel = logger.level;
|
||||||
|
logger.level = "fatal";
|
||||||
|
try {
|
||||||
|
await promises.safePromise(() => {
|
||||||
|
throw new Error("boom");
|
||||||
|
});
|
||||||
|
expect.fail("expected safePromise to reject");
|
||||||
|
} catch (e: any) {
|
||||||
|
expect(e.message).to.equal("boom");
|
||||||
|
} finally {
|
||||||
|
logger.level = oldLevel;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("promisify", () => {
|
||||||
|
it("resolves callback data", async () => {
|
||||||
|
const readValue = promises.promisify((prefix: string, callback: (err: Error | null, data?: string) => void) => {
|
||||||
|
callback(null, `${prefix}-value`);
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(await readValue("certd")).to.equal("certd-value");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rejects callback errors", async () => {
|
||||||
|
const failing = promises.promisify((callback: (err: Error) => void) => {
|
||||||
|
callback(new Error("callback failed"));
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
await failing();
|
||||||
|
expect.fail("expected promisified function to reject");
|
||||||
|
} catch (e: any) {
|
||||||
|
expect(e.message).to.equal("callback failed");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rejects synchronous errors", async () => {
|
||||||
|
const failing = promises.promisify(() => {
|
||||||
|
throw new Error("sync failed");
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
await failing();
|
||||||
|
expect.fail("expected promisified function to reject");
|
||||||
|
} catch (e: any) {
|
||||||
|
expect(e.message).to.equal("sync failed");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import { expect } from "chai";
|
||||||
|
import { createAxiosService, HttpClient, setGlobalHeaders } from "./util.request.js";
|
||||||
|
import { ILogger } from "./util.log.js";
|
||||||
|
|
||||||
|
const testLogger = {
|
||||||
|
info() {},
|
||||||
|
error() {},
|
||||||
|
} as unknown as ILogger;
|
||||||
|
|
||||||
|
describe("util.request", () => {
|
||||||
|
afterEach(() => {
|
||||||
|
setGlobalHeaders({});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should merge global headers without overriding request headers", async () => {
|
||||||
|
setGlobalHeaders({
|
||||||
|
"X-Common": "common",
|
||||||
|
"X-Override": "global",
|
||||||
|
});
|
||||||
|
|
||||||
|
const http = createAxiosService({ logger: testLogger }) as HttpClient;
|
||||||
|
const res = await http.request({
|
||||||
|
url: "http://example.com",
|
||||||
|
method: "get",
|
||||||
|
logReq: false,
|
||||||
|
logRes: false,
|
||||||
|
headers: {
|
||||||
|
"X-Override": "request",
|
||||||
|
"X-Request": "request",
|
||||||
|
},
|
||||||
|
adapter: async config => {
|
||||||
|
const headers = config.headers;
|
||||||
|
return {
|
||||||
|
config,
|
||||||
|
data: {
|
||||||
|
common: headers.get("X-Common"),
|
||||||
|
override: headers.get("X-Override"),
|
||||||
|
request: headers.get("X-Request"),
|
||||||
|
},
|
||||||
|
headers: {},
|
||||||
|
status: 200,
|
||||||
|
statusText: "OK",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(res).to.deep.equal({
|
||||||
|
common: "common",
|
||||||
|
override: "request",
|
||||||
|
request: "request",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -26,7 +26,7 @@ export class HttpError extends Error {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let message = error?.message || error?.response.statusText || error?.code;
|
let message = error?.message || error?.response?.statusText || error?.code;
|
||||||
if (message && typeof message === "string" && message.indexOf) {
|
if (message && typeof message === "string" && message.indexOf) {
|
||||||
for (const key in errorMap) {
|
for (const key in errorMap) {
|
||||||
if (message.indexOf(key) > -1) {
|
if (message.indexOf(key) > -1) {
|
||||||
@@ -82,6 +82,7 @@ export class HttpError extends Error {
|
|||||||
export const HttpCommonError = HttpError;
|
export const HttpCommonError = HttpError;
|
||||||
|
|
||||||
let defaultAgents = createAgent();
|
let defaultAgents = createAgent();
|
||||||
|
let defaultHeaders: Record<string, string> = {};
|
||||||
|
|
||||||
export function setGlobalProxy(opts: { httpProxy?: string; httpsProxy?: string }) {
|
export function setGlobalProxy(opts: { httpProxy?: string; httpsProxy?: string }) {
|
||||||
logger.info("setGlobalProxy:", opts);
|
logger.info("setGlobalProxy:", opts);
|
||||||
@@ -92,6 +93,15 @@ export function getGlobalAgents() {
|
|||||||
return defaultAgents;
|
return defaultAgents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setGlobalHeaders(headers: Record<string, string> = {}) {
|
||||||
|
logger.info("setGlobalHeaders:", Object.keys(headers));
|
||||||
|
defaultHeaders = { ...headers };
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getGlobalHeaders() {
|
||||||
|
return defaultHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 创建请求实例
|
* @description 创建请求实例
|
||||||
*/
|
*/
|
||||||
@@ -148,6 +158,12 @@ export function createAxiosService({ logger }: { logger: ILogger }) {
|
|||||||
config.httpsAgent = agents.httpsAgent;
|
config.httpsAgent = agents.httpsAgent;
|
||||||
config.httpAgent = agents.httpAgent;
|
config.httpAgent = agents.httpAgent;
|
||||||
|
|
||||||
|
if (Object.keys(defaultHeaders).length > 0) {
|
||||||
|
const headers = AxiosHeaders.from(defaultHeaders);
|
||||||
|
headers.set(config.headers || {});
|
||||||
|
config.headers = headers;
|
||||||
|
}
|
||||||
|
|
||||||
// const agent = new https.Agent({
|
// const agent = new https.Agent({
|
||||||
// rejectUnauthorized: false // 允许自签名证书
|
// rejectUnauthorized: false // 允许自签名证书
|
||||||
// });
|
// });
|
||||||
@@ -267,7 +283,7 @@ export function createAxiosService({ logger }: { logger: ILogger }) {
|
|||||||
logger.error(`请求出错:${errorMessage} status:${status},statusText:${error.response?.statusText || error.code},url:${error.config?.url},method:${error.config?.method}。`);
|
logger.error(`请求出错:${errorMessage} status:${status},statusText:${error.response?.statusText || error.code},url:${error.config?.url},method:${error.config?.method}。`);
|
||||||
logger.error("返回数据:", JSON.stringify(error.response?.data));
|
logger.error("返回数据:", JSON.stringify(error.response?.data));
|
||||||
if (error.response?.data) {
|
if (error.response?.data) {
|
||||||
const message = error.response.data.message || error.response.data.msg || error.response.data.error;
|
const message = error.response?.data?.message || error.response?.data?.msg || error.response?.data?.error;
|
||||||
if (typeof message === "string") {
|
if (typeof message === "string") {
|
||||||
error.message = message;
|
error.message = message;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { stringUtils } from "./util.string.js";
|
||||||
|
|
||||||
|
describe("stringUtils", () => {
|
||||||
|
describe("maxLength", () => {
|
||||||
|
it("returns an empty string for empty input", () => {
|
||||||
|
expect(stringUtils.maxLength()).to.equal("");
|
||||||
|
expect(stringUtils.maxLength("")).to.equal("");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("returns the original string when it is within the limit", () => {
|
||||||
|
expect(stringUtils.maxLength("certd", 5)).to.equal("certd");
|
||||||
|
expect(stringUtils.maxLength("certd", 6)).to.equal("certd");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("truncates strings longer than the limit and appends ellipsis", () => {
|
||||||
|
expect(stringUtils.maxLength("certificate", 4)).to.equal("cert...");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("appendTimeSuffix", () => {
|
||||||
|
it("returns an empty string for empty input", () => {
|
||||||
|
expect(stringUtils.appendTimeSuffix()).to.equal("");
|
||||||
|
expect(stringUtils.appendTimeSuffix("")).to.equal("");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("appends a millisecond timestamp suffix", () => {
|
||||||
|
const result = stringUtils.appendTimeSuffix("certd");
|
||||||
|
|
||||||
|
expect(result).to.match(/^certd-\d{17}$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"inlineSourceMap":false,
|
"inlineSourceMap": false,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"noImplicitThis": true,
|
"noImplicitThis": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
@@ -22,21 +22,11 @@
|
|||||||
"composite": false,
|
"composite": false,
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"typeRoots": [ "./typings", "./node_modules/@types"],
|
"typeRoots": ["./typings", "./node_modules/@types"],
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": false,
|
"isolatedModules": false,
|
||||||
"lib": ["ESNext", "DOM"],
|
"lib": ["ESNext", "DOM"]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src/**/*.ts", "src/**/*.json"],
|
||||||
"src/**/*.ts",
|
"exclude": ["*.js", "*.ts", "*.spec.ts", "dist", "node_modules", "src/**/*.test.ts", "test"]
|
||||||
"src/**/*.json"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"*.js",
|
|
||||||
"*.ts",
|
|
||||||
"*.spec.ts",
|
|
||||||
"dist",
|
|
||||||
"node_modules",
|
|
||||||
"test"
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,28 @@
|
|||||||
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.39.16](https://github.com/certd/certd/compare/v1.39.15...v1.39.16) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
## [1.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/pipeline
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* cnameProvider域名支持设置子域名托管 ([7266af1](https://github.com/certd/certd/commit/7266af17491a98338022cfb18cfedfb93ca6ef8f))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/pipeline",
|
"name": "@certd/pipeline",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.39.12",
|
"version": "1.39.16",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
@@ -14,12 +14,13 @@
|
|||||||
"build3": "rollup -c",
|
"build3": "rollup -c",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"test": "mocha --loader=ts-node/esm",
|
"test": "mocha --loader=ts-node/esm",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest mocha --no-config --node-option no-warnings --node-option loader=ts-node/esm \"src/**/*.test.ts\"",
|
||||||
"pub": "npm publish",
|
"pub": "npm publish",
|
||||||
"compile": "tsc --skipLibCheck --watch"
|
"compile": "tsc --skipLibCheck --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/basic": "^1.39.12",
|
"@certd/basic": "^1.39.16",
|
||||||
"@certd/plus-core": "^1.39.12",
|
"@certd/plus-core": "^1.39.16",
|
||||||
"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"
|
||||||
@@ -36,14 +37,17 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
"chai": "4.3.10",
|
"chai": "4.3.10",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.41.0",
|
"eslint": "^8.41.0",
|
||||||
"eslint-config-prettier": "^8.8.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { PluginGroup, pluginGroups } from "./group.js";
|
||||||
|
|
||||||
|
describe("PluginGroup", () => {
|
||||||
|
it("initializes a group with defaults", () => {
|
||||||
|
const group = new PluginGroup("custom", "Custom");
|
||||||
|
|
||||||
|
expect(group.key).to.equal("custom");
|
||||||
|
expect(group.title).to.equal("Custom");
|
||||||
|
expect(group.order).to.equal(0);
|
||||||
|
expect(group.icon).to.equal("");
|
||||||
|
expect(group.plugins).to.deep.equal([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("exposes built-in groups with stable keys", () => {
|
||||||
|
expect(pluginGroups.cert.key).to.equal("cert");
|
||||||
|
expect(pluginGroups.host.key).to.equal("host");
|
||||||
|
expect(pluginGroups.other.order).to.equal(10);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -3,6 +3,7 @@ import { IAccess } from "../access/index.js";
|
|||||||
export type CnameProvider = {
|
export type CnameProvider = {
|
||||||
id: any;
|
id: any;
|
||||||
domain: string;
|
domain: string;
|
||||||
|
subdomain?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
dnsProviderType?: string;
|
dnsProviderType?: string;
|
||||||
access?: IAccess;
|
access?: IAccess;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"inlineSourceMap":false,
|
"inlineSourceMap": false,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"noImplicitThis": true,
|
"noImplicitThis": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
@@ -22,22 +22,11 @@
|
|||||||
"composite": false,
|
"composite": false,
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
// "sourceMap": true,
|
// "sourceMap": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": false,
|
"isolatedModules": false,
|
||||||
"lib": ["ESNext", "DOM"],
|
"lib": ["ESNext", "DOM"]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.json"],
|
||||||
"src/**/*.ts",
|
"exclude": ["*.js", "*.ts", "*.spec.ts", "dist", "node_modules", "src/**/*.test.ts", "test"]
|
||||||
"src/**/*.d.ts",
|
|
||||||
"src/**/*.json"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"*.js",
|
|
||||||
"*.ts",
|
|
||||||
"*.spec.ts",
|
|
||||||
"dist",
|
|
||||||
"node_modules",
|
|
||||||
"test"
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
**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.39.12",
|
"version": "1.39.15",
|
||||||
"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",
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
"build": "npm run before-build && rollup -c ",
|
"build": "npm run before-build && rollup -c ",
|
||||||
"dev-build": "npm run build",
|
"dev-build": "npm run build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest echo no unit tests",
|
||||||
"pub": "npm publish"
|
"pub": "npm publish"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -21,8 +22,10 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"tslib": "^2.8.1"
|
"tslib": "^2.8.1"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-iframe
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-iframe
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
**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.39.12",
|
"version": "1.39.15",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
"build3": "rollup -c",
|
"build3": "rollup -c",
|
||||||
"build2": "vue-tsc --noEmit && vite build",
|
"build2": "vue-tsc --noEmit && vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest echo no unit tests",
|
||||||
"pub": "npm publish"
|
"pub": "npm publish"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -23,13 +24,15 @@
|
|||||||
"@types/chai": "^4.3.3",
|
"@types/chai": "^4.3.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.24.0",
|
"eslint": "^8.24.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/jdcloud
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/jdcloud
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
**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.39.12",
|
"version": "1.39.15",
|
||||||
"description": "jdcloud openApi sdk",
|
"description": "jdcloud openApi sdk",
|
||||||
"main": "./dist/bundle.js",
|
"main": "./dist/bundle.js",
|
||||||
"module": "./dist/bundle.js",
|
"module": "./dist/bundle.js",
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c ",
|
"build": "rollup -c ",
|
||||||
"dev-build": "npm run build",
|
"dev-build": "npm run build",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest echo no unit tests",
|
||||||
"pub": "npm publish"
|
"pub": "npm publish"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
@@ -29,7 +30,8 @@
|
|||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
"chai": "^4.1.2",
|
"chai": "^4.1.2",
|
||||||
"config": "^1.30.0",
|
"config": "^1.30.0",
|
||||||
"cross-env": "^5.1.4",
|
"cross-env": "^7.0.3",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"js-yaml": "^3.11.0",
|
"js-yaml": "^3.11.0",
|
||||||
"mocha": "^5.0.0",
|
"mocha": "^5.0.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
@@ -56,5 +58,5 @@
|
|||||||
"fetch"
|
"fetch"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,24 @@
|
|||||||
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.39.16](https://github.com/certd/certd/compare/v1.39.15...v1.39.16) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
|
## [1.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
**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.39.12",
|
"version": "1.39.16",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
@@ -14,24 +14,27 @@
|
|||||||
"build3": "rollup -c",
|
"build3": "rollup -c",
|
||||||
"build2": "vue-tsc --noEmit && vite build",
|
"build2": "vue-tsc --noEmit && vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest echo no unit tests",
|
||||||
"pub": "npm publish",
|
"pub": "npm publish",
|
||||||
"compile": "tsc --skipLibCheck --watch"
|
"compile": "tsc --skipLibCheck --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/basic": "^1.39.12",
|
"@certd/basic": "^1.39.16",
|
||||||
"@kubernetes/client-node": "0.21.0"
|
"@kubernetes/client-node": "0.21.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chai": "^4.3.3",
|
"@types/chai": "^4.3.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.24.0",
|
"eslint": "^8.24.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,29 @@
|
|||||||
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.39.16](https://github.com/certd/certd/compare/v1.39.15...v1.39.16) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-server
|
||||||
|
|
||||||
|
## [1.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **network:** 新增全局公共http请求 headers设置 ([aad9045](https://github.com/certd/certd/commit/aad9045de55e76cb2ad09cac74a7bd60a4b47124))
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复启动时报密钥备份不存在的问题 ([c966896](https://github.com/certd/certd/commit/c9668965226af6b54e0e576931dcba8b3d188ef3))
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **设置:** 添加首页启用开关配置 ([25ad1e6](https://github.com/certd/certd/commit/25ad1e6f861e43288cc8bd90d4903628e6faec29))
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-server",
|
"name": "@certd/lib-server",
|
||||||
"version": "1.39.12",
|
"version": "1.39.16",
|
||||||
"description": "midway with flyway, sql upgrade way ",
|
"description": "midway with flyway, sql upgrade way ",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
"build": "npm run before-build && tsc --skipLibCheck",
|
"build": "npm run before-build && tsc --skipLibCheck",
|
||||||
"dev-build": "npm run build",
|
"dev-build": "npm run build",
|
||||||
"test": "midway-bin test --ts -V",
|
"test": "midway-bin test --ts -V",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest mocha --no-config --node-option no-warnings --node-option loader=ts-node/esm \"src/**/*.test.ts\"",
|
||||||
"test1": "midway-bin test --ts -V -f test/blank.test.ts -t 'hash-check'",
|
"test1": "midway-bin test --ts -V -f test/blank.test.ts -t 'hash-check'",
|
||||||
"cov": "midway-bin cov --ts",
|
"cov": "midway-bin cov --ts",
|
||||||
"lint": "mwts check",
|
"lint": "mwts check",
|
||||||
@@ -28,11 +29,11 @@
|
|||||||
],
|
],
|
||||||
"license": "AGPL",
|
"license": "AGPL",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.39.12",
|
"@certd/acme-client": "^1.39.16",
|
||||||
"@certd/basic": "^1.39.12",
|
"@certd/basic": "^1.39.16",
|
||||||
"@certd/pipeline": "^1.39.12",
|
"@certd/pipeline": "^1.39.16",
|
||||||
"@certd/plugin-lib": "^1.39.12",
|
"@certd/plugin-lib": "^1.39.16",
|
||||||
"@certd/plus-core": "^1.39.12",
|
"@certd/plus-core": "^1.39.16",
|
||||||
"@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",
|
||||||
@@ -43,7 +44,6 @@
|
|||||||
"@midwayjs/upload": "3.20.13",
|
"@midwayjs/upload": "3.20.13",
|
||||||
"@midwayjs/validate": "3.20.13",
|
"@midwayjs/validate": "3.20.13",
|
||||||
"better-sqlite3": "^11.1.2",
|
"better-sqlite3": "^11.1.2",
|
||||||
"cross-env": "^7.0.3",
|
|
||||||
"dayjs": "^1.11.7",
|
"dayjs": "^1.11.7",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"mwts": "^1.3.0",
|
"mwts": "^1.3.0",
|
||||||
@@ -52,17 +52,22 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chai": "^4.3.3",
|
"@types/chai": "^4.3.3",
|
||||||
|
"@types/mocha": "^10.0.1",
|
||||||
"@types/node": "^18",
|
"@types/node": "^18",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.24.0",
|
"eslint": "^8.24.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
|
"mocha": "^10.2.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typeorm": "^0.3.11",
|
"typeorm": "^0.3.11",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
/// <reference types="node" />
|
||||||
|
|
||||||
|
import assert from "node:assert/strict";
|
||||||
|
|
||||||
|
import { Constants } from "./constants.js";
|
||||||
|
import { ParamException } from "./exception/param-exception.js";
|
||||||
|
import { Result } from "./result.js";
|
||||||
|
|
||||||
|
describe("lib-server basic helpers", () => {
|
||||||
|
it("builds success and error results", () => {
|
||||||
|
const success = Result.success("ok", { id: 1 });
|
||||||
|
assert.ok(success instanceof Result);
|
||||||
|
assert.equal(success.code, 0);
|
||||||
|
assert.equal(success.message, "ok");
|
||||||
|
assert.deepEqual(success.data, { id: 1 });
|
||||||
|
|
||||||
|
const error = Result.error(400, "bad request");
|
||||||
|
assert.ok(error instanceof Result);
|
||||||
|
assert.equal(error.code, 400);
|
||||||
|
assert.equal(error.message, "bad request");
|
||||||
|
assert.equal(error.data, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("uses default param exception metadata", () => {
|
||||||
|
const error = new ParamException(undefined);
|
||||||
|
|
||||||
|
assert.equal(error.name, "ParamException");
|
||||||
|
assert.equal(error.code, Constants.res.param.code);
|
||||||
|
assert.equal(error.message, Constants.res.param.message);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -32,6 +32,7 @@ export class SysPublicSettings extends BaseSettings {
|
|||||||
customFooter?: string;
|
customFooter?: string;
|
||||||
robots?: boolean = true;
|
robots?: boolean = true;
|
||||||
aiChatEnabled = true;
|
aiChatEnabled = true;
|
||||||
|
homePageEnabled = true;
|
||||||
|
|
||||||
|
|
||||||
//验证码是否开启
|
//验证码是否开启
|
||||||
@@ -79,6 +80,7 @@ export class SysPrivateSettings extends BaseSettings {
|
|||||||
|
|
||||||
httpsProxy? = '';
|
httpsProxy? = '';
|
||||||
httpProxy? = '';
|
httpProxy? = '';
|
||||||
|
commonHeaders?: string = '';
|
||||||
|
|
||||||
reverseProxies?: Record<string, string> = {};
|
reverseProxies?: Record<string, string> = {};
|
||||||
|
|
||||||
@@ -271,4 +273,3 @@ export class SysSafeSetting extends BaseSettings {
|
|||||||
autoHiddenTimes: 5,
|
autoHiddenTimes: 5,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { SysSettingsEntity } from '../entity/sys-settings.js';
|
|||||||
import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, SysSecret, SysSecretBackup } from './models.js';
|
import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, SysSecret, SysSecretBackup } from './models.js';
|
||||||
|
|
||||||
import { getAllSslProviderDomains, setSslProviderReverseProxies, setWalkFromAuthoritative } from '@certd/acme-client';
|
import { getAllSslProviderDomains, setSslProviderReverseProxies, setWalkFromAuthoritative } from '@certd/acme-client';
|
||||||
import { cache, logger, mergeUtils, setGlobalProxy } from '@certd/basic';
|
import { cache, logger, mergeUtils, setGlobalHeaders, setGlobalProxy } from '@certd/basic';
|
||||||
import { isPlus } from '@certd/plus-core';
|
import { isPlus } from '@certd/plus-core';
|
||||||
import * as dns from 'node:dns';
|
import * as dns from 'node:dns';
|
||||||
import { BaseService, setAdminMode } from '../../../basic/index.js';
|
import { BaseService, setAdminMode } from '../../../basic/index.js';
|
||||||
@@ -167,6 +167,7 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
|||||||
httpsProxy: privateSetting.httpsProxy,
|
httpsProxy: privateSetting.httpsProxy,
|
||||||
};
|
};
|
||||||
setGlobalProxy(opts);
|
setGlobalProxy(opts);
|
||||||
|
setGlobalHeaders(this.parseKeyValueText(privateSetting.commonHeaders));
|
||||||
|
|
||||||
if (privateSetting.dnsResultOrder) {
|
if (privateSetting.dnsResultOrder) {
|
||||||
dns.setDefaultResultOrder(privateSetting.dnsResultOrder as any);
|
dns.setDefaultResultOrder(privateSetting.dnsResultOrder as any);
|
||||||
@@ -185,12 +186,12 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setEnvironmentVars(vars: string) {
|
parseKeyValueText(text: string) {
|
||||||
const envVars = {}
|
const values = {};
|
||||||
if (typeof vars !== 'string') {
|
if (typeof text !== 'string') {
|
||||||
vars = ""
|
text = "";
|
||||||
}
|
}
|
||||||
vars.split('\n').forEach(line => {
|
text.split('\n').forEach(line => {
|
||||||
line = line.trim();
|
line = line.trim();
|
||||||
if (!line || line.startsWith('#')) {
|
if (!line || line.startsWith('#')) {
|
||||||
return
|
return
|
||||||
@@ -204,11 +205,18 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const [key, value] = line.split('=');
|
const eqIndex = line.indexOf('=');
|
||||||
|
const key = line.substring(0, eqIndex).trim();
|
||||||
|
const value = line.substring(eqIndex + 1).trim();
|
||||||
if (key && value) {
|
if (key && value) {
|
||||||
envVars[key.trim()] = value.trim();
|
values[key] = value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
setEnvironmentVars(vars: string) {
|
||||||
|
const envVars = this.parseKeyValueText(vars);
|
||||||
//先删除旧环境变量
|
//先删除旧环境变量
|
||||||
if (lastSaveEnvVars) {
|
if (lastSaveEnvVars) {
|
||||||
for (const key in lastSaveEnvVars) {
|
for (const key in lastSaveEnvVars) {
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import assert from "assert";
|
||||||
|
import { AccessService } from "./access-service.js";
|
||||||
|
|
||||||
|
describe("AccessService", () => {
|
||||||
|
it("does not write id into access setting when updating selected fields", async () => {
|
||||||
|
let updateParam: any;
|
||||||
|
const service = new AccessService();
|
||||||
|
service.info = async () => ({
|
||||||
|
id: 12,
|
||||||
|
type: "eab",
|
||||||
|
} as any);
|
||||||
|
service.decryptAccessEntity = () => ({
|
||||||
|
kid: "kid-1",
|
||||||
|
});
|
||||||
|
service.update = async (param: any) => {
|
||||||
|
updateParam = param;
|
||||||
|
return param;
|
||||||
|
};
|
||||||
|
|
||||||
|
await service.updateAccess({
|
||||||
|
id: 12,
|
||||||
|
accountKey: "account-key",
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.deepEqual(JSON.parse(updateParam.setting), {
|
||||||
|
kid: "kid-1",
|
||||||
|
accountKey: "account-key",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -123,6 +123,25 @@ export class AccessService extends BaseService<AccessEntity> {
|
|||||||
return await super.update(param);
|
return await super.update(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updateAccess(access: any) {
|
||||||
|
const oldEntity = await this.info(access.id);
|
||||||
|
if (oldEntity == null) {
|
||||||
|
throw new ValidateException('该授权配置不存在,请确认是否已被删除');
|
||||||
|
}
|
||||||
|
const setting = this.decryptAccessEntity(oldEntity);
|
||||||
|
for (const key of Object.keys(access)) {
|
||||||
|
if (key === 'id') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
setting[key] = access[key];
|
||||||
|
}
|
||||||
|
return await this.update({
|
||||||
|
id: access.id,
|
||||||
|
type: oldEntity.type,
|
||||||
|
setting: JSON.stringify(setting),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Init, Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||||
import { Encryptor, SysSecret, SysSettingsService } from '../../../system/index.js';
|
import { Encryptor, SysSecret, SysSettingsService } from '../../../system/index.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,8 +12,7 @@ export class EncryptService {
|
|||||||
@Inject()
|
@Inject()
|
||||||
sysSettingService: SysSettingsService;
|
sysSettingService: SysSettingsService;
|
||||||
|
|
||||||
@Init()
|
async doInit() {
|
||||||
async init() {
|
|
||||||
const secret: SysSecret = await this.sysSettingService.getSecret();
|
const secret: SysSecret = await this.sysSettingService.getSecret();
|
||||||
this.encryptor = new Encryptor(secret.encryptSecret);
|
this.encryptor = new Encryptor(secret.encryptSecret);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"inlineSourceMap":false,
|
"inlineSourceMap": false,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"noImplicitThis": true,
|
"noImplicitThis": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
@@ -17,25 +17,15 @@
|
|||||||
"pretty": true,
|
"pretty": true,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"typeRoots": [ "./typings", "./node_modules/@types"],
|
"typeRoots": ["./typings", "./node_modules/@types"],
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"composite": false,
|
"composite": false,
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"strict": false,
|
"strict": false,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"lib": ["ESNext", "DOM"],
|
"lib": ["ESNext", "DOM"]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.json"],
|
||||||
"src/**/*.ts",
|
"exclude": ["*.js", "*.ts", "dist", "node_modules", "src/**/*.test.ts", "test"]
|
||||||
"src/**/*.d.ts",
|
|
||||||
"src/**/*.json"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"*.js",
|
|
||||||
"*.ts",
|
|
||||||
"dist",
|
|
||||||
"node_modules",
|
|
||||||
"test"
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
**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.39.12",
|
"version": "1.39.15",
|
||||||
"description": "midway with flyway, sql upgrade way ",
|
"description": "midway with flyway, sql upgrade way ",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
"dev-build": "npm run build",
|
"dev-build": "npm run build",
|
||||||
"test": "midway-bin test --ts -V",
|
"test": "midway-bin test --ts -V",
|
||||||
"test1": "midway-bin test --ts -V -f test/blank.test.ts -t 'hash-check'",
|
"test1": "midway-bin test --ts -V -f test/blank.test.ts -t 'hash-check'",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest echo no unit tests",
|
||||||
"cov": "midway-bin cov --ts",
|
"cov": "midway-bin cov --ts",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"pub": "npm publish"
|
"pub": "npm publish"
|
||||||
@@ -35,16 +36,18 @@
|
|||||||
"@types/node": "^18",
|
"@types/node": "^18",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.24.0",
|
"eslint": "^8.24.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typeorm": "^0.3.11",
|
"typeorm": "^0.3.11",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,24 @@
|
|||||||
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.39.16](https://github.com/certd/certd/compare/v1.39.15...v1.39.16) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-cert
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-cert",
|
"name": "@certd/plugin-cert",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.39.12",
|
"version": "1.39.16",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -13,14 +13,15 @@
|
|||||||
"build3": "rollup -c",
|
"build3": "rollup -c",
|
||||||
"build2": "vue-tsc --noEmit && vite build",
|
"build2": "vue-tsc --noEmit && vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest echo no unit tests",
|
||||||
"pub": "npm publish",
|
"pub": "npm publish",
|
||||||
"compile": "tsc --skipLibCheck --watch"
|
"compile": "tsc --skipLibCheck --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.39.12",
|
"@certd/acme-client": "^1.39.16",
|
||||||
"@certd/basic": "^1.39.12",
|
"@certd/basic": "^1.39.16",
|
||||||
"@certd/pipeline": "^1.39.12",
|
"@certd/pipeline": "^1.39.16",
|
||||||
"@certd/plugin-lib": "^1.39.12",
|
"@certd/plugin-lib": "^1.39.16",
|
||||||
"psl": "^1.9.0",
|
"psl": "^1.9.0",
|
||||||
"punycode.js": "^2.3.1"
|
"punycode.js": "^2.3.1"
|
||||||
},
|
},
|
||||||
@@ -30,13 +31,15 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
"chai": "^4.3.6",
|
"chai": "^4.3.6",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.24.0",
|
"eslint": "^8.24.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"mocha": "^10.1.0",
|
"mocha": "^10.1.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,24 @@
|
|||||||
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.39.16](https://github.com/certd/certd/compare/v1.39.15...v1.39.16) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-lib
|
||||||
|
|
||||||
|
## [1.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-lib
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-lib
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/plugin-lib
|
**Note:** Version bump only for package @certd/plugin-lib
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-lib",
|
"name": "@certd/plugin-lib",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.39.12",
|
"version": "1.39.16",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
"build3": "rollup -c",
|
"build3": "rollup -c",
|
||||||
"build2": "vue-tsc --noEmit && vite build",
|
"build2": "vue-tsc --noEmit && vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
"test:unit": "cross-env NODE_ENV=unittest mocha --no-config --node-option no-warnings --node-option loader=ts-node/esm \"src/**/*.test.ts\"",
|
||||||
"pub": "npm publish",
|
"pub": "npm publish",
|
||||||
"compile": "tsc --skipLibCheck --watch"
|
"compile": "tsc --skipLibCheck --watch"
|
||||||
},
|
},
|
||||||
@@ -22,10 +23,10 @@
|
|||||||
"@alicloud/pop-core": "^1.7.10",
|
"@alicloud/pop-core": "^1.7.10",
|
||||||
"@alicloud/tea-util": "^1.4.11",
|
"@alicloud/tea-util": "^1.4.11",
|
||||||
"@aws-sdk/client-s3": "^3.964.0",
|
"@aws-sdk/client-s3": "^3.964.0",
|
||||||
"@certd/acme-client": "^1.39.12",
|
"@certd/acme-client": "^1.39.16",
|
||||||
"@certd/basic": "^1.39.12",
|
"@certd/basic": "^1.39.16",
|
||||||
"@certd/pipeline": "^1.39.12",
|
"@certd/pipeline": "^1.39.16",
|
||||||
"@certd/plus-core": "^1.39.12",
|
"@certd/plus-core": "^1.39.16",
|
||||||
"@kubernetes/client-node": "0.21.0",
|
"@kubernetes/client-node": "0.21.0",
|
||||||
"ali-oss": "^6.22.0",
|
"ali-oss": "^6.22.0",
|
||||||
"basic-ftp": "^5.0.5",
|
"basic-ftp": "^5.0.5",
|
||||||
@@ -49,13 +50,16 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||||
"@typescript-eslint/parser": "^8.26.1",
|
"@typescript-eslint/parser": "^8.26.1",
|
||||||
"chai": "^4.3.6",
|
"chai": "^4.3.6",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.24.0",
|
"eslint": "^8.24.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"mocha": "^10.1.0",
|
"mocha": "^10.1.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
},
|
},
|
||||||
"gitHead": "898bc9b9f2f75df11ea0803b144862ba98b7511a"
|
"gitHead": "bae5a04dcc0a679c290a9805c3ac4a6020eb6ec0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
/// <reference types="mocha" />
|
||||||
|
|
||||||
|
import { expect } from "chai";
|
||||||
|
|
||||||
|
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "./util.js";
|
||||||
|
|
||||||
|
describe("plugin-lib common util", () => {
|
||||||
|
it("builds cert domain getter input define with defaults", () => {
|
||||||
|
const define = createCertDomainGetterInputDefine();
|
||||||
|
|
||||||
|
expect(define.title).to.equal("当前证书域名");
|
||||||
|
expect(define.component.name).to.equal("cert-domains-getter");
|
||||||
|
expect(define.required).to.equal(true);
|
||||||
|
expect(define.template).to.equal(false);
|
||||||
|
expect(define.mergeScript).to.contain("form.cert");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("allows overriding cert input key and props", () => {
|
||||||
|
const define = createCertDomainGetterInputDefine({
|
||||||
|
certInputKey: "customCert",
|
||||||
|
props: {
|
||||||
|
title: "自定义域名",
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(define.title).to.equal("自定义域名");
|
||||||
|
expect(define.required).to.equal(false);
|
||||||
|
expect(define.mergeScript).to.contain("form.customCert");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("builds remote select input define with expected component options", () => {
|
||||||
|
const define = createRemoteSelectInputDefine({
|
||||||
|
title: "选择资源",
|
||||||
|
action: "ListResource",
|
||||||
|
typeName: "resource",
|
||||||
|
multi: false,
|
||||||
|
search: true,
|
||||||
|
watches: ["region"],
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(define.title).to.equal("选择资源");
|
||||||
|
expect(define.required).to.equal(true);
|
||||||
|
expect(define.component).to.include({
|
||||||
|
name: "remote-select",
|
||||||
|
vModel: "value",
|
||||||
|
action: "ListResource",
|
||||||
|
typeName: "resource",
|
||||||
|
mode: "default",
|
||||||
|
multi: false,
|
||||||
|
search: true,
|
||||||
|
});
|
||||||
|
expect(define.component.watches).to.deep.equal(["certDomains", "accessId", "region"]);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"inlineSourceMap":false,
|
"inlineSourceMap": false,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"noImplicitThis": true,
|
"noImplicitThis": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
@@ -16,27 +16,17 @@
|
|||||||
"pretty": true,
|
"pretty": true,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"typeRoots": [ "./typings", "./node_modules/@types"],
|
"typeRoots": ["./typings", "./node_modules/@types"],
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"composite": false,
|
"composite": false,
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"strict": false,
|
"strict": false,
|
||||||
// "sourceMap": true,
|
// "sourceMap": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": false,
|
"isolatedModules": false,
|
||||||
"lib": ["ESNext", "DOM"],
|
"lib": ["ESNext", "DOM"]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.json"],
|
||||||
"src/**/*.ts",
|
"exclude": ["*.js", "*.ts", "dist", "node_modules", "src/**/*.test.ts", "test"]
|
||||||
"src/**/*.d.ts",
|
|
||||||
"src/**/*.json"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"*.js",
|
|
||||||
"*.ts",
|
|
||||||
"dist",
|
|
||||||
"node_modules",
|
|
||||||
"test"
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-5
@@ -1,4 +1,4 @@
|
|||||||
FROM node:22-alpine AS builder
|
FROM node:22-alpine3.21 AS builder
|
||||||
|
|
||||||
# RUN apk add build-base
|
# RUN apk add build-base
|
||||||
# RUN wget -O - https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 | tar -xj && \
|
# RUN wget -O - https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 | tar -xj && \
|
||||||
@@ -10,17 +10,22 @@ FROM node:22-alpine AS builder
|
|||||||
|
|
||||||
WORKDIR /workspace/
|
WORKDIR /workspace/
|
||||||
COPY . /workspace/
|
COPY . /workspace/
|
||||||
# armv7 目前只能用node18, pnpm9不支持node18,所以pnpm只能用8.15.7版本
|
# pnpm v11打包会报错([ERR_PNPM_IGNORED_BUILDS] Ignored build scripts),暂时固定10.33.4版本。
|
||||||
# https://github.com/nodejs/docker-node/issues/1946
|
# https://pnpm.io/zh/migration
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm@10.33.4
|
||||||
|
|
||||||
#RUN cd /workspace/certd-client && pnpm install && npm run build
|
#RUN cd /workspace/certd-client && pnpm install && npm run build
|
||||||
RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf
|
RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf
|
||||||
RUN cd /workspace/certd-server && pnpm install && npm run build-on-docker
|
RUN cd /workspace/certd-server && pnpm install && npm run build-on-docker
|
||||||
|
|
||||||
|
# RUN cd /workspace/certd-server && \
|
||||||
|
# pnpm install --ignore-scripts && \
|
||||||
|
# yes | pnpm approve-builds && \
|
||||||
|
# pnpm rebuild && \
|
||||||
|
# npm run build-on-docker
|
||||||
|
|
||||||
|
|
||||||
FROM node:22-alpine
|
FROM node:22-alpine3.21
|
||||||
EXPOSE 7001
|
EXPOSE 7001
|
||||||
EXPOSE 7002
|
EXPOSE 7002
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,39 @@
|
|||||||
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.39.16](https://github.com/certd/certd/compare/v1.39.15...v1.39.16) (2026-05-13)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
|
## [1.39.15](https://github.com/certd/certd/compare/v1.39.14...v1.39.15) (2026-05-13)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* icon选择器增加一套logo集 ([fdd5848](https://github.com/certd/certd/commit/fdd5848df4055a6ee07dc5eabaaf6b718672882d))
|
||||||
|
* **monitor/site:** 新增站点监控页面禁用启用、检查状态两个筛选条件 ([118c15d](https://github.com/certd/certd/commit/118c15d04633a6ef06f2d9e7a7849d20f596e02c))
|
||||||
|
* **network:** 新增全局公共http请求 headers设置 ([aad9045](https://github.com/certd/certd/commit/aad9045de55e76cb2ad09cac74a7bd60a4b47124))
|
||||||
|
|
||||||
|
## [1.39.14](https://github.com/certd/certd/compare/v1.39.13...v1.39.14) (2026-05-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复阿里云订阅流水线创建对话框无法获取阿里订单列表的bug ([a362860](https://github.com/certd/certd/commit/a362860137bfb7072893c844fe775edc46070ee1))
|
||||||
|
|
||||||
|
## [1.39.13](https://github.com/certd/certd/compare/v1.39.12...v1.39.13) (2026-05-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* cnameProvider域名支持设置子域名托管 ([7266af1](https://github.com/certd/certd/commit/7266af17491a98338022cfb18cfedfb93ca6ef8f))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **设置:** 添加首页启用开关配置 ([25ad1e6](https://github.com/certd/certd/commit/25ad1e6f861e43288cc8bd90d4903628e6faec29))
|
||||||
|
* **用户资料:** 新增手机号邮箱绑定功能 ([e0eb0e2](https://github.com/certd/certd/commit/e0eb0e21f6dae24b639c944f9aba2c90496ab1c0))
|
||||||
|
* 域名注册过期时间获取再次优化 ([91a1b97](https://github.com/certd/certd/commit/91a1b9755066bf280e194dabf7c3a9f936e2643f))
|
||||||
|
* **证书流水线:** 添加批量更新证书申请参数功能 ([63be1c1](https://github.com/certd/certd/commit/63be1c1cbd9b09a3b48f26130c296b1cedcca1ac))
|
||||||
|
* 重构自动加载模块并优化EAB授权处理 ([4755216](https://github.com/certd/certd/commit/4755216505ad18555a50da9d8008c2207c48df86))
|
||||||
|
* **domain:** 添加域名过期时间同步进度显示功能 ([9d2937d](https://github.com/certd/certd/commit/9d2937dd4b14ffab73e9b096edd2aa8539811182))
|
||||||
|
|
||||||
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
## [1.39.12](https://github.com/certd/certd/compare/v1.39.11...v1.39.12) (2026-04-29)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/ui-client",
|
"name": "@certd/ui-client",
|
||||||
"version": "1.39.12",
|
"version": "1.39.16",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --open",
|
"dev": "vite --open",
|
||||||
@@ -12,7 +12,8 @@
|
|||||||
"debug:force": "vite --force --mode debug",
|
"debug:force": "vite --force --mode debug",
|
||||||
"build": "cross-env NODE_OPTIONS=--max-old-space-size=40960 vite build ",
|
"build": "cross-env NODE_OPTIONS=--max-old-space-size=40960 vite build ",
|
||||||
"dev-build": "echo 1",
|
"dev-build": "echo 1",
|
||||||
"test:unit": "vitest",
|
"test:unit": "cross-env NODE_ENV=unittest echo no unit tests",
|
||||||
|
"test:vue": "vitest run",
|
||||||
"serve": "vite preview",
|
"serve": "vite preview",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"pretty-quick": "pretty-quick",
|
"pretty-quick": "pretty-quick",
|
||||||
@@ -33,11 +34,11 @@
|
|||||||
"@aws-sdk/s3-request-presigner": "^3.964.0",
|
"@aws-sdk/s3-request-presigner": "^3.964.0",
|
||||||
"@certd/vue-js-cron-light": "^4.0.14",
|
"@certd/vue-js-cron-light": "^4.0.14",
|
||||||
"@ctrl/tinycolor": "^4.1.0",
|
"@ctrl/tinycolor": "^4.1.0",
|
||||||
"@fast-crud/editor-code": "^1.27.8",
|
"@fast-crud/editor-code": "^1.28.1",
|
||||||
"@fast-crud/fast-crud": "^1.27.8",
|
"@fast-crud/fast-crud": "^1.28.1",
|
||||||
"@fast-crud/fast-extends": "^1.27.8",
|
"@fast-crud/fast-extends": "^1.28.1",
|
||||||
"@fast-crud/ui-antdv4": "^1.27.8",
|
"@fast-crud/ui-antdv4": "^1.28.1",
|
||||||
"@fast-crud/ui-interface": "^1.27.8",
|
"@fast-crud/ui-interface": "^1.28.1",
|
||||||
"@iconify/tailwind": "^1.2.0",
|
"@iconify/tailwind": "^1.2.0",
|
||||||
"@iconify/vue": "^4.1.1",
|
"@iconify/vue": "^4.1.1",
|
||||||
"@manypkg/get-packages": "^2.2.2",
|
"@manypkg/get-packages": "^2.2.2",
|
||||||
@@ -61,7 +62,6 @@
|
|||||||
"cos-js-sdk-v5": "^1.7.0",
|
"cos-js-sdk-v5": "^1.7.0",
|
||||||
"cron-parser": "^4.9.0",
|
"cron-parser": "^4.9.0",
|
||||||
"cropperjs": "^1.6.1",
|
"cropperjs": "^1.6.1",
|
||||||
"cross-env": "^7.0.3",
|
|
||||||
"cssnano": "^7.0.6",
|
"cssnano": "^7.0.6",
|
||||||
"dayjs": "^1.11.7",
|
"dayjs": "^1.11.7",
|
||||||
"defu": "^6.1.4",
|
"defu": "^6.1.4",
|
||||||
@@ -106,8 +106,8 @@
|
|||||||
"zod-defaults": "^0.1.3"
|
"zod-defaults": "^0.1.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/lib-iframe": "^1.39.12",
|
"@certd/lib-iframe": "^1.39.15",
|
||||||
"@certd/pipeline": "^1.39.12",
|
"@certd/pipeline": "^1.39.16",
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||||
"@types/chai": "^4.3.12",
|
"@types/chai": "^4.3.12",
|
||||||
@@ -126,6 +126,7 @@
|
|||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "^10.4.21",
|
||||||
"caller-path": "^4.0.0",
|
"caller-path": "^4.0.0",
|
||||||
"chai": "^5.1.0",
|
"chai": "^5.1.0",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"dependency-cruiser": "^16.2.3",
|
"dependency-cruiser": "^16.2.3",
|
||||||
"dot": "^1.1.3",
|
"dot": "^1.1.3",
|
||||||
"eslint": "8.57.0",
|
"eslint": "8.57.0",
|
||||||
@@ -135,6 +136,7 @@
|
|||||||
"eslint-plugin-prettier": "^5.1.3",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"eslint-plugin-promise": "^6.1.1",
|
"eslint-plugin-promise": "^6.1.1",
|
||||||
"eslint-plugin-vue": "^9.23.0",
|
"eslint-plugin-vue": "^9.23.0",
|
||||||
|
"esmock": "^2.7.5",
|
||||||
"less": "^4.2.0",
|
"less": "^4.2.0",
|
||||||
"less-loader": "^12.2.0",
|
"less-loader": "^12.2.0",
|
||||||
"postcss": "^8.4.35",
|
"postcss": "^8.4.35",
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
<template>
|
||||||
|
<div class="refresh-input">
|
||||||
|
<div class="refresh-input-line">
|
||||||
|
<a-input class="refresh-input-control" :value="value" :placeholder="placeholder" allow-clear @update:value="emit('update:value', $event)"></a-input>
|
||||||
|
<fs-button :loading="loading" type="primary" :text="buttonText" :icon="icon" @click="doRefresh"></fs-button>
|
||||||
|
</div>
|
||||||
|
<div class="helper" :class="{ error: hasError }">
|
||||||
|
{{ message }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ComponentPropsType, doRequest } from "/@/components/plugins/lib";
|
||||||
|
import { computed, inject, ref } from "vue";
|
||||||
|
import { Form } from "ant-design-vue";
|
||||||
|
import { getInputFromForm } from "./utils";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "RefreshInput",
|
||||||
|
});
|
||||||
|
|
||||||
|
type RefreshInputProps = ComponentPropsType & {
|
||||||
|
buttonText?: string;
|
||||||
|
icon?: string;
|
||||||
|
placeholder?: string;
|
||||||
|
successMessage?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const fromType: any = inject("getFromType");
|
||||||
|
const getScope: any = inject("get:scope");
|
||||||
|
const getPluginType: any = inject("get:plugin:type", () => {
|
||||||
|
return "access";
|
||||||
|
});
|
||||||
|
const formItemContext = Form.useInjectFormItemContext();
|
||||||
|
const props = defineProps<RefreshInputProps>();
|
||||||
|
const emit = defineEmits<{
|
||||||
|
"update:value": [value: string];
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const loading = ref(false);
|
||||||
|
const message = ref("");
|
||||||
|
const hasError = ref(false);
|
||||||
|
|
||||||
|
const action = computed(() => props.action);
|
||||||
|
const buttonText = computed(() => props.buttonText || "刷新");
|
||||||
|
const icon = computed(() => props.icon || "ion:refresh-outline");
|
||||||
|
const placeholder = computed(() => props.placeholder || "");
|
||||||
|
const successMessage = computed(() => props.successMessage || "刷新成功,请保存配置");
|
||||||
|
|
||||||
|
const doRefresh = async () => {
|
||||||
|
if (loading.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!action.value) {
|
||||||
|
hasError.value = true;
|
||||||
|
message.value = "缺少刷新动作配置";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
formItemContext.onFieldChange();
|
||||||
|
|
||||||
|
const { form } = getScope();
|
||||||
|
const pluginType = getPluginType();
|
||||||
|
const { input, record } = getInputFromForm(form, pluginType);
|
||||||
|
|
||||||
|
loading.value = true;
|
||||||
|
message.value = "";
|
||||||
|
hasError.value = false;
|
||||||
|
try {
|
||||||
|
const res = await doRequest(
|
||||||
|
{
|
||||||
|
type: pluginType,
|
||||||
|
typeName: form.type,
|
||||||
|
action: action.value,
|
||||||
|
input,
|
||||||
|
record,
|
||||||
|
fromType,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
onError(err: any) {
|
||||||
|
hasError.value = true;
|
||||||
|
message.value = err.message;
|
||||||
|
},
|
||||||
|
showErrorNotify: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
emit("update:value", res);
|
||||||
|
message.value = successMessage.value;
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.refresh-input-line {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.refresh-input-control {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -74,7 +74,6 @@ const props = defineProps<
|
|||||||
uploadCert?: UploadCertProps;
|
uploadCert?: UploadCertProps;
|
||||||
} & ComponentPropsType
|
} & ComponentPropsType
|
||||||
>();
|
>();
|
||||||
debugger;
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
"update:value": any;
|
"update:value": any;
|
||||||
}>();
|
}>();
|
||||||
@@ -141,8 +140,7 @@ const getOptions = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
message.value = "获取中...";
|
||||||
message.value = "";
|
|
||||||
hasError.value = false;
|
hasError.value = false;
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const pageNo = pagerRef.value.pageNo;
|
const pageNo = pagerRef.value.pageNo;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import AccessSelector from "/@/views/certd/access/access-selector/index.vue";
|
|||||||
import InputPassword from "./common/input-password.vue";
|
import InputPassword from "./common/input-password.vue";
|
||||||
import CertInfoUpdater from "/@/views/certd/pipeline/cert-upload/index.vue";
|
import CertInfoUpdater from "/@/views/certd/pipeline/cert-upload/index.vue";
|
||||||
import ApiTest from "./common/api-test.vue";
|
import ApiTest from "./common/api-test.vue";
|
||||||
|
import RefreshInput from "./common/refresh-input.vue";
|
||||||
import ParamsShow from "./common/params-show.vue";
|
import ParamsShow from "./common/params-show.vue";
|
||||||
export * from "./cert/index.js";
|
export * from "./cert/index.js";
|
||||||
export default {
|
export default {
|
||||||
@@ -23,6 +24,7 @@ export default {
|
|||||||
app.component("CertInfoUpdater", CertInfoUpdater);
|
app.component("CertInfoUpdater", CertInfoUpdater);
|
||||||
|
|
||||||
app.component("ApiTest", ApiTest);
|
app.component("ApiTest", ApiTest);
|
||||||
|
app.component("RefreshInput", RefreshInput);
|
||||||
|
|
||||||
app.component("SynologyDeviceIdGetter", SynologyIdDeviceGetter);
|
app.component("SynologyDeviceIdGetter", SynologyIdDeviceGetter);
|
||||||
app.component("RemoteAutoComplete", RemoteAutoComplete);
|
app.component("RemoteAutoComplete", RemoteAutoComplete);
|
||||||
|
|||||||
@@ -1,24 +1,18 @@
|
|||||||
import { dict } from "@fast-crud/fast-crud";
|
import { dict } from "@fast-crud/fast-crud";
|
||||||
import { $t } from "/@/locales";
|
import { $t } from "/@/locales";
|
||||||
|
|
||||||
export const Dicts = {
|
function createChallengeTypeDict() {
|
||||||
sslProviderDict: dict({
|
return dict({
|
||||||
data: [
|
|
||||||
{ value: "letsencrypt", label: "Let's Encrypt" },
|
|
||||||
{ value: "zerossl", label: "ZeroSSL" },
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
challengeTypeDict: dict({
|
|
||||||
data: [
|
data: [
|
||||||
{ value: "dns", label: $t("certd.verifyPlan.dnsChallenge"), color: "green" },
|
{ value: "dns", label: $t("certd.verifyPlan.dnsChallenge"), color: "green" },
|
||||||
{ value: "cname", label: $t("certd.verifyPlan.cnameProxyChallenge"), color: "blue" },
|
{ value: "cname", label: $t("certd.verifyPlan.cnameProxyChallenge"), color: "blue" },
|
||||||
{ value: "http", label: $t("certd.verifyPlan.httpChallenge"), color: "yellow" },
|
{ value: "http", label: $t("certd.verifyPlan.httpChallenge"), color: "yellow" },
|
||||||
],
|
],
|
||||||
}),
|
});
|
||||||
dnsProviderTypeDict: dict({
|
}
|
||||||
url: "pi/dnsProvider/dnsProviderTypeDict",
|
|
||||||
}),
|
function createUploaderTypeDict() {
|
||||||
uploaderTypeDict: dict({
|
return dict({
|
||||||
data: [
|
data: [
|
||||||
{ label: "SFTP", value: "sftp" },
|
{ label: "SFTP", value: "sftp" },
|
||||||
{ label: "SCP", value: "scp" },
|
{ label: "SCP", value: "scp" },
|
||||||
@@ -29,11 +23,35 @@ export const Dicts = {
|
|||||||
{ label: "S3/Minio", value: "s3" },
|
{ label: "S3/Minio", value: "s3" },
|
||||||
{ label: $t("certd.verifyPlan.uploader.sshDeprecated"), value: "ssh", disabled: true },
|
{ label: $t("certd.verifyPlan.uploader.sshDeprecated"), value: "ssh", disabled: true },
|
||||||
],
|
],
|
||||||
}),
|
});
|
||||||
domainFromTypeDict: dict({
|
}
|
||||||
|
|
||||||
|
function createDomainFromTypeDict() {
|
||||||
|
return dict({
|
||||||
data: [
|
data: [
|
||||||
{ value: "manual", label: $t("certd.verifyPlan.domainFrom.manual") },
|
{ value: "manual", label: $t("certd.verifyPlan.domainFrom.manual") },
|
||||||
{ value: "auto", label: $t("certd.verifyPlan.domainFrom.auto") },
|
{ value: "auto", label: $t("certd.verifyPlan.domainFrom.auto") },
|
||||||
],
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Dicts = {
|
||||||
|
sslProviderDict: dict({
|
||||||
|
data: [
|
||||||
|
{ value: "letsencrypt", label: "Let's Encrypt" },
|
||||||
|
{ value: "zerossl", label: "ZeroSSL" },
|
||||||
|
],
|
||||||
}),
|
}),
|
||||||
|
get challengeTypeDict() {
|
||||||
|
return createChallengeTypeDict();
|
||||||
|
},
|
||||||
|
dnsProviderTypeDict: dict({
|
||||||
|
url: "pi/dnsProvider/dnsProviderTypeDict",
|
||||||
|
}),
|
||||||
|
get uploaderTypeDict() {
|
||||||
|
return createUploaderTypeDict();
|
||||||
|
},
|
||||||
|
get domainFromTypeDict() {
|
||||||
|
return createDomainFromTypeDict();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export default {
|
|||||||
importFromProvider: "Import from Domain Provider",
|
importFromProvider: "Import from Domain Provider",
|
||||||
syncExpirationDate: "Sync Domain Expiration Time",
|
syncExpirationDate: "Sync Domain Expiration Time",
|
||||||
syncTaskSubmitted: "Sync task submitted",
|
syncTaskSubmitted: "Sync task submitted",
|
||||||
|
syncExpirationProgress: "Sync Domain Expiration Progress",
|
||||||
expirationMonitorSetting: "Domain Expiration Monitor Settings",
|
expirationMonitorSetting: "Domain Expiration Monitor Settings",
|
||||||
subdomainDnsHelper: "Note: In DNS validation mode, subdomains do not need to be maintained here, otherwise certificate application may be affected (except delegated subdomains or free second-level domains).",
|
subdomainDnsHelper: "Note: In DNS validation mode, subdomains do not need to be maintained here, otherwise certificate application may be affected (except delegated subdomains or free second-level domains).",
|
||||||
path: "Path",
|
path: "Path",
|
||||||
@@ -28,6 +29,9 @@ export default {
|
|||||||
progress: "Progress",
|
progress: "Progress",
|
||||||
operation: "Operation",
|
operation: "Operation",
|
||||||
total: "Total",
|
total: "Total",
|
||||||
|
current: "Current",
|
||||||
|
running: "Running",
|
||||||
|
done: "Done",
|
||||||
skipped: "Skipped",
|
skipped: "Skipped",
|
||||||
failed: "Failed",
|
failed: "Failed",
|
||||||
notExecuted: "Not executed",
|
notExecuted: "Not executed",
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
export default {
|
export default {
|
||||||
cnameTitle: "CNAME Service Configuration",
|
cnameTitle: "CNAME Service Configuration",
|
||||||
cnameDescription:
|
cnameDescription:
|
||||||
"The domain name configured here serves as a proxy for verifying other domains. When other domains apply for certificates, they map to this domain via CNAME for ownership verification. The advantage is that any domain can apply for a certificate this way without providing an AccessSecret.",
|
"The domain name configured here serves as a proxy for verifying other domains. When other domains apply for certificates, they map to this domain via CNAME for ownership verification. The advantage is that any domain can apply for a certificate this way without providing an AccessSecret.",
|
||||||
cnameLinkText: "CNAME principle and usage instructions",
|
cnameLinkText: "CNAME principle and usage instructions",
|
||||||
cnameDomain: "CNAME Domain",
|
cnameDomain: "CNAME Domain",
|
||||||
cnameDomainPlaceholder: "cname.handsfree.work",
|
cnameDomainPlaceholder: "cname.handsfree.work",
|
||||||
cnameDomainHelper:
|
cnameDomainHelper:
|
||||||
"Requires a domain registered with a DNS provider on the right (or you can transfer other domain DNS servers here).\nOnce the CNAME domain is set, it cannot be changed. It is recommended to use a first-level subdomain.",
|
"Requires a domain registered with a DNS provider on the right (or you can transfer other domain DNS servers here).\nOnce the CNAME domain is set, it cannot be changed. It is recommended to use a first-level subdomain.",
|
||||||
cnameDomainPattern: "Domain name cannot contain *",
|
cnameDomainPattern: "Domain name cannot contain *",
|
||||||
|
cnameProviderSubdomain: "Delegated Subdomain",
|
||||||
|
cnameProviderSubdomainPlaceholder: "sub.example.com",
|
||||||
|
cnameProviderSubdomainHelper: "Fill this when the CNAME domain is hosted under a delegated subdomain, for example CNAME domain cname.sub.example.com and DNS zone sub.example.com.",
|
||||||
dnsProvider: "DNS Provider",
|
dnsProvider: "DNS Provider",
|
||||||
dnsProviderAuthorization: "DNS Provider Authorization",
|
dnsProviderAuthorization: "DNS Provider Authorization",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default {
|
|||||||
|
|
||||||
showRunStrategy: "Show RunStrategy",
|
showRunStrategy: "Show RunStrategy",
|
||||||
showRunStrategyHelper: "Allow modify the run strategy of the task",
|
showRunStrategyHelper: "Allow modify the run strategy of the task",
|
||||||
|
homePageEnabled: "Enable Home Page",
|
||||||
|
|
||||||
captchaEnabled: "Enable Login Captcha",
|
captchaEnabled: "Enable Login Captcha",
|
||||||
captchaHelper: "Whether to enable captcha verification for login",
|
captchaHelper: "Whether to enable captcha verification for login",
|
||||||
@@ -90,6 +91,8 @@ export default {
|
|||||||
reverseProxyEmpty: "No reverse proxy list configured",
|
reverseProxyEmpty: "No reverse proxy list configured",
|
||||||
environmentVars: "Environment Variables",
|
environmentVars: "Environment Variables",
|
||||||
environmentVarsHelper: "configure the runtime environment variables, one per line, format: KEY=VALUE",
|
environmentVarsHelper: "configure the runtime environment variables, one per line, format: KEY=VALUE",
|
||||||
|
commonHeaders: "Common Headers",
|
||||||
|
commonHeadersHelper: "Common headers automatically added to server-side HTTP requests, one per line, format: KEY=VALUE. Existing request headers with the same name are not overwritten.",
|
||||||
|
|
||||||
bindUrl: "Bind URL",
|
bindUrl: "Bind URL",
|
||||||
bindUrlHelper: "Bind URL, used as your site URL in notifications",
|
bindUrlHelper: "Bind URL, used as your site URL in notifications",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export default {
|
|||||||
importFromProvider: "从域名提供商导入",
|
importFromProvider: "从域名提供商导入",
|
||||||
syncExpirationDate: "同步域名过期时间",
|
syncExpirationDate: "同步域名过期时间",
|
||||||
syncTaskSubmitted: "同步任务已提交",
|
syncTaskSubmitted: "同步任务已提交",
|
||||||
|
syncExpirationProgress: "同步域名过期时间进度",
|
||||||
expirationMonitorSetting: "域名过期监控设置",
|
expirationMonitorSetting: "域名过期监控设置",
|
||||||
subdomainDnsHelper: "注意:DNS校验方式下,子域名不需要在此处维护,否则会影响证书申请(子域名托管或免费二级域名除外)",
|
subdomainDnsHelper: "注意:DNS校验方式下,子域名不需要在此处维护,否则会影响证书申请(子域名托管或免费二级域名除外)",
|
||||||
path: "路径",
|
path: "路径",
|
||||||
@@ -28,6 +29,9 @@ export default {
|
|||||||
progress: "进度",
|
progress: "进度",
|
||||||
operation: "操作",
|
operation: "操作",
|
||||||
total: "总数",
|
total: "总数",
|
||||||
|
current: "当前",
|
||||||
|
running: "运行中",
|
||||||
|
done: "已完成",
|
||||||
skipped: "跳过",
|
skipped: "跳过",
|
||||||
failed: "失败",
|
failed: "失败",
|
||||||
notExecuted: "未执行",
|
notExecuted: "未执行",
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ export default {
|
|||||||
cnameDomainPlaceholder: "cname.handsfree.work",
|
cnameDomainPlaceholder: "cname.handsfree.work",
|
||||||
cnameDomainHelper: "需要一个右边DNS提供商注册的域名(也可以将其他域名的dns服务器转移到这几家来)。\nCNAME域名一旦确定不可修改,建议使用一级子域名",
|
cnameDomainHelper: "需要一个右边DNS提供商注册的域名(也可以将其他域名的dns服务器转移到这几家来)。\nCNAME域名一旦确定不可修改,建议使用一级子域名",
|
||||||
cnameDomainPattern: "域名不能使用星号",
|
cnameDomainPattern: "域名不能使用星号",
|
||||||
|
cnameProviderSubdomain: "托管子域名",
|
||||||
|
cnameProviderSubdomainPlaceholder: "sub.example.com",
|
||||||
|
cnameProviderSubdomainHelper: "当CNAME域名本身托管在子域名下时填写,例如 CNAME域名为 cname.sub.example.com,实际DNS托管域为 sub.example.com",
|
||||||
dnsProvider: "DNS提供商",
|
dnsProvider: "DNS提供商",
|
||||||
dnsProviderAuthorization: "DNS提供商授权",
|
dnsProviderAuthorization: "DNS提供商授权",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export default {
|
|||||||
|
|
||||||
showRunStrategy: "显示运行策略选择",
|
showRunStrategy: "显示运行策略选择",
|
||||||
showRunStrategyHelper: "任务设置中是否允许选择运行策略",
|
showRunStrategyHelper: "任务设置中是否允许选择运行策略",
|
||||||
|
homePageEnabled: "启用首页",
|
||||||
|
|
||||||
captchaEnabled: "启用登录验证码",
|
captchaEnabled: "启用登录验证码",
|
||||||
captchaHelper: "登录时是否启用验证码",
|
captchaHelper: "登录时是否启用验证码",
|
||||||
@@ -88,6 +89,8 @@ export default {
|
|||||||
reverseProxyEmpty: "未配置反向代理",
|
reverseProxyEmpty: "未配置反向代理",
|
||||||
environmentVars: "环境变量",
|
environmentVars: "环境变量",
|
||||||
environmentVarsHelper: "配置运行时环境变量,每行一个,格式:KEY=VALUE",
|
environmentVarsHelper: "配置运行时环境变量,每行一个,格式:KEY=VALUE",
|
||||||
|
commonHeaders: "公共请求头",
|
||||||
|
commonHeadersHelper: "服务端发起 HTTP 请求时自动附加的公共请求头,每行一个,格式:KEY=VALUE;请求中已设置同名 Header 时不会覆盖\n注意: 不要将token等敏感内容放在此处,仅限个人和公司内部使用,商业版不要设置",
|
||||||
bindUrl: "绑定URL",
|
bindUrl: "绑定URL",
|
||||||
bindUrlHelper: "绑定URL,在各类通知中显示你的站点URL",
|
bindUrlHelper: "绑定URL,在各类通知中显示你的站点URL",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -47,6 +47,13 @@ export function setupCommonGuard(router: Router) {
|
|||||||
const settingStore = useSettingStore();
|
const settingStore = useSettingStore();
|
||||||
await settingStore.initOnce();
|
await settingStore.initOnce();
|
||||||
|
|
||||||
|
if (to.path === "/" && settingStore.sysPublic?.homePageEnabled === false) {
|
||||||
|
return {
|
||||||
|
path: DEFAULT_HOME_PATH,
|
||||||
|
replace: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
to.meta.loaded = loadedPaths.has(to.path);
|
to.meta.loaded = loadedPaths.has(to.path);
|
||||||
|
|
||||||
// 页面加载进度条
|
// 页面加载进度条
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export type SysPublicSetting = {
|
|||||||
customFooter?: string;
|
customFooter?: string;
|
||||||
robots?: boolean;
|
robots?: boolean;
|
||||||
aiChatEnabled?: boolean;
|
aiChatEnabled?: boolean;
|
||||||
|
homePageEnabled?: boolean;
|
||||||
|
|
||||||
showRunStrategy?: boolean;
|
showRunStrategy?: boolean;
|
||||||
|
|
||||||
@@ -98,6 +99,7 @@ export type SuiteSetting = {
|
|||||||
export type SysPrivateSetting = {
|
export type SysPrivateSetting = {
|
||||||
httpProxy?: string;
|
httpProxy?: string;
|
||||||
httpsProxy?: string;
|
httpsProxy?: string;
|
||||||
|
commonHeaders?: string;
|
||||||
reverseProxies?: any;
|
reverseProxies?: any;
|
||||||
dnsResultOrder?: string;
|
dnsResultOrder?: string;
|
||||||
commonCnameEnabled?: boolean;
|
commonCnameEnabled?: boolean;
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export const useSettingStore = defineStore({
|
|||||||
registerEnabled: false,
|
registerEnabled: false,
|
||||||
managerOtherUserPipeline: false,
|
managerOtherUserPipeline: false,
|
||||||
icpNo: env.ICP_NO || "",
|
icpNo: env.ICP_NO || "",
|
||||||
|
homePageEnabled: true,
|
||||||
},
|
},
|
||||||
installInfo: {
|
installInfo: {
|
||||||
siteId: "",
|
siteId: "",
|
||||||
|
|||||||
@@ -11,7 +11,17 @@ export type MergeScriptContext = {
|
|||||||
export function useReference(formItem: any) {
|
export function useReference(formItem: any) {
|
||||||
if (formItem.mergeScript) {
|
if (formItem.mergeScript) {
|
||||||
const ctx = {
|
const ctx = {
|
||||||
compute,
|
compute: (opts: any) => {
|
||||||
|
const func = (context: any) => {
|
||||||
|
let form = context.form || {};
|
||||||
|
form = form.input || form.body || form.access || form;
|
||||||
|
return opts({
|
||||||
|
...context,
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
return compute(func);
|
||||||
|
},
|
||||||
asyncCompute,
|
asyncCompute,
|
||||||
computed,
|
computed,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Modal, notification } from "ant-design-vue";
|
|||||||
import { Ref, ref } from "vue";
|
import { Ref, ref } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import { useDomainImportManage } from "./use";
|
import { useDomainImportManage, useSyncExpirationProcess } from "./use";
|
||||||
import { Dicts } from "/@/components/plugins/lib/dicts";
|
import { Dicts } from "/@/components/plugins/lib/dicts";
|
||||||
import { useSettingStore } from "/@/store/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { useUserStore } from "/@/store/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
@@ -52,6 +52,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
|||||||
});
|
});
|
||||||
|
|
||||||
const openDomainImportManageDialog = useDomainImportManage();
|
const openDomainImportManageDialog = useDomainImportManage();
|
||||||
|
const openSyncExpirationProcessDialog = useSyncExpirationProcess({ crudExpose });
|
||||||
|
|
||||||
const subdomainConfirmed = ref(false);
|
const subdomainConfirmed = ref(false);
|
||||||
return {
|
return {
|
||||||
@@ -140,13 +141,11 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
|||||||
icon: "ion:refresh-outline",
|
icon: "ion:refresh-outline",
|
||||||
text: t("certd.domain.syncExpirationDate"),
|
text: t("certd.domain.syncExpirationDate"),
|
||||||
click: async () => {
|
click: async () => {
|
||||||
await api.SyncExpirationStart();
|
try {
|
||||||
notification.success({
|
await api.SyncExpirationStart();
|
||||||
message: t("certd.domain.syncTaskSubmitted"),
|
} finally {
|
||||||
});
|
await openSyncExpirationProcessDialog();
|
||||||
setTimeout(() => {
|
}
|
||||||
crudExpose.doRefresh();
|
|
||||||
}, 2000);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
monitorSettingSave: {
|
monitorSettingSave: {
|
||||||
@@ -361,7 +360,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
|||||||
<fs-values-format modelValue={row.challengeType} dict={Dicts.challengeTypeDict} color={"auto"}></fs-values-format>
|
<fs-values-format modelValue={row.challengeType} dict={Dicts.challengeTypeDict} color={"auto"}></fs-values-format>
|
||||||
<fs-values-format modelValue={row.httpUploaderType} dict={httpUploaderTypeDict} color={"auto"}></fs-values-format>
|
<fs-values-format modelValue={row.httpUploaderType} dict={httpUploaderTypeDict} color={"auto"}></fs-values-format>
|
||||||
<fs-values-format class={"ml-5"} modelValue={row.httpUploaderAccess} dict={accessDict} color={"auto"}></fs-values-format>
|
<fs-values-format class={"ml-5"} modelValue={row.httpUploaderAccess} dict={accessDict} color={"auto"}></fs-values-format>
|
||||||
<a-tag class={"ml-5 flex items-center"}>{t("certd.domain.path")}: {row.httpUploadRootDir}</a-tag>
|
<a-tag class={"ml-5 flex items-center"}>
|
||||||
|
{t("certd.domain.path")}: {row.httpUploadRootDir}
|
||||||
|
</a-tag>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { message } from "ant-design-vue";
|
|
||||||
import * as api from "./api";
|
|
||||||
import { useFormDialog } from "/@/use/use-dialog";
|
|
||||||
import { compute } from "@fast-crud/fast-crud";
|
import { compute } from "@fast-crud/fast-crud";
|
||||||
import { Dicts } from "/@/components/plugins/lib/dicts";
|
import { Ref, ref } from "vue";
|
||||||
import { useSettingStore } from "/@/store/settings";
|
import * as api from "./api";
|
||||||
import DomainImportTaskStatus from "./import.vue";
|
import DomainImportTaskStatus from "./import.vue";
|
||||||
import { useI18n } from "/@/locales";
|
import { useI18n } from "/@/locales";
|
||||||
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
import { useFormDialog } from "/@/use/use-dialog";
|
||||||
export function useDomainImport() {
|
export function useDomainImport() {
|
||||||
const { openFormDialog } = useFormDialog();
|
const { openFormDialog } = useFormDialog();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@@ -92,3 +91,92 @@ export function useDomainImportManage() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function useSyncExpirationProcess(opts: { crudExpose: any }) {
|
||||||
|
const { openFormDialog } = useFormDialog();
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
return async function openSyncExpirationProcessDialog() {
|
||||||
|
const taskStatus: Ref<any> = ref({});
|
||||||
|
const errors: Ref<string[]> = ref([]);
|
||||||
|
const timerRef: Ref<any> = ref(null);
|
||||||
|
|
||||||
|
function stop() {
|
||||||
|
if (timerRef.value) {
|
||||||
|
clearTimeout(timerRef.value);
|
||||||
|
timerRef.value = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadStatus() {
|
||||||
|
const status = await api.SyncExpirationStatus();
|
||||||
|
taskStatus.value = status || {};
|
||||||
|
errors.value = taskStatus.value.errors || [];
|
||||||
|
|
||||||
|
if (taskStatus.value.status === "running") {
|
||||||
|
stop();
|
||||||
|
timerRef.value = setTimeout(async () => {
|
||||||
|
await loadStatus();
|
||||||
|
}, 3000);
|
||||||
|
} else {
|
||||||
|
stop();
|
||||||
|
await opts.crudExpose.doRefresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await loadStatus();
|
||||||
|
|
||||||
|
await openFormDialog({
|
||||||
|
title: t("certd.domain.syncExpirationProgress"),
|
||||||
|
body: () => {
|
||||||
|
const progress = Math.min(Math.round(taskStatus.value.progress || 0), 100);
|
||||||
|
const isRunning = taskStatus.value.status === "running";
|
||||||
|
const errorList = errors.value.map(item => {
|
||||||
|
return <div>{item}</div>;
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<div class={"w-full"}>
|
||||||
|
<div class={"mt-4 flex flex-wrap gap-2"}>
|
||||||
|
<a-tag color={isRunning ? "processing" : "success"}>{isRunning ? t("certd.domain.running") : t("certd.domain.done")}</a-tag>
|
||||||
|
|
||||||
|
<a-tag class={"m-0"} color={"blue"}>
|
||||||
|
{t("certd.domain.total")}:{taskStatus.value.total || 0}
|
||||||
|
</a-tag>
|
||||||
|
<a-tag class={"m-0"} color={"green"}>
|
||||||
|
{t("certd.success")}:{taskStatus.value.successCount || 0}
|
||||||
|
</a-tag>
|
||||||
|
<a-tag class={"m-0"} color={"red"}>
|
||||||
|
{t("certd.domain.failed")}:{taskStatus.value.errorCount || 0}
|
||||||
|
</a-tag>
|
||||||
|
<a-tag class={"m-0"} color={"cyan"}>
|
||||||
|
{t("certd.domain.current")}:{taskStatus.value.current || 0}
|
||||||
|
</a-tag>
|
||||||
|
</div>
|
||||||
|
<div class={"mt-4 pr-4"}>
|
||||||
|
<a-progress percent={progress} status={errors.value.length > 0 ? "exception" : isRunning ? "active" : "success"} />
|
||||||
|
</div>
|
||||||
|
{errors.value.length > 0 && <div class={"mt-2 break-words text-red-500 mb-4"}>{errorList}</div>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
wrapper: {
|
||||||
|
width: 600,
|
||||||
|
footer: false,
|
||||||
|
buttons: {
|
||||||
|
cancel: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
reset: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
ok: {
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onClosed() {
|
||||||
|
stop();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,6 +23,37 @@ export async function UpdateProfile(form: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function GetContactCapability() {
|
||||||
|
return await request({
|
||||||
|
url: "/mine/contact/capability",
|
||||||
|
method: "POST",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function UpdateMobile(form: any) {
|
||||||
|
return await request({
|
||||||
|
url: "/mine/contact/mobile",
|
||||||
|
method: "POST",
|
||||||
|
data: form,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function VerifyContactIdentity(form: any) {
|
||||||
|
return await request({
|
||||||
|
url: "/mine/contact/verifyIdentity",
|
||||||
|
method: "POST",
|
||||||
|
data: form,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function UpdateEmail(form: any) {
|
||||||
|
return await request({
|
||||||
|
url: "/mine/contact/email",
|
||||||
|
method: "POST",
|
||||||
|
data: form,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function GetOauthBounds() {
|
export async function GetOauthBounds() {
|
||||||
return await request({
|
return await request({
|
||||||
url: "/oauth/bounds",
|
url: "/oauth/bounds",
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user