Compare commits

..

36 Commits

Author SHA1 Message Date
xiaojunnuo
c725cee044 v1.37.1 2025-09-29 20:35:30 +08:00
xiaojunnuo
367ef4ecb2 build: prepare to build 2025-09-29 20:32:54 +08:00
xiaojunnuo
c3a64facd5 chore 2025-09-29 20:32:31 +08:00
xiaojunnuo
2671781e1b fix: 修复某些情况下cname申请证书报错主域名不一致的bug 2025-09-29 18:58:19 +08:00
xiaojunnuo
9291fa68aa perf: dns解析支持阿里esa 2025-09-28 23:29:56 +08:00
xiaojunnuo
6ebb3659f4 perf: cname主域名校验提示优化,显示不一致的两方便于排查问题 2025-09-28 16:18:39 +08:00
xiaojunnuo
109696e965 fix: 修复版本比较bug 2025-09-28 12:49:53 +08:00
xiaojunnuo
b86bbd370c chore: deploy 1.37.0 2025-09-28 12:44:02 +08:00
xiaojunnuo
1575a4fb1a chore: deploy 1.37.0 2025-09-28 12:42:54 +08:00
xiaojunnuo
e2f500be90 chore: deploy 1.37.0 2025-09-28 12:37:22 +08:00
xiaojunnuo
284b00a826 chore: 2025-09-28 12:21:42 +08:00
xiaojunnuo
66180e19b5 build: publish 2025-09-28 12:18:46 +08:00
xiaojunnuo
1531462d22 build: trigger build image 2025-09-28 12:18:30 +08:00
xiaojunnuo
e17cd1f298 v1.37.0 2025-09-28 12:17:05 +08:00
xiaojunnuo
13092e9f80 build: prepare to build 2025-09-28 12:14:35 +08:00
xiaojunnuo
8133b8b9dd build: prepare to build 2025-09-28 12:07:54 +08:00
xiaojunnuo
e25aafac6d chore: 2025-09-28 12:07:51 +08:00
xiaojunnuo
037c7beb1b build: prepare to build 2025-09-28 12:06:22 +08:00
xiaojunnuo
faac4dfc30 chore: 2025-09-28 12:06:13 +08:00
xiaojunnuo
469a088a4d build: prepare to build 2025-09-28 11:30:24 +08:00
xiaojunnuo
9c854f727f chore: 2025-09-28 11:29:57 +08:00
xiaojunnuo
8f6e5bd24b feat: dist打包前检查 2025-09-28 11:02:25 +08:00
xiaojunnuo
992f91cf4c Merge branch 'refs/heads/v2' into v2-dev 2025-09-28 10:42:17 +08:00
xiaojunnuo
0c61d4c978 feat: @certd/ui-server module import报错的问题 2025-09-28 09:58:22 +08:00
xiaojunnuo
72d32edf9a build: publish 2025-09-27 09:41:54 +08:00
xiaojunnuo
dde39def9e build: trigger build image 2025-09-27 09:41:37 +08:00
xiaojunnuo
6b43007c44 v1.36.25 2025-09-27 09:40:13 +08:00
xiaojunnuo
876558cf77 build: prepare to build 2025-09-27 09:38:14 +08:00
xiaojunnuo
b35a146edf chore: 2025-09-27 09:37:30 +08:00
xiaojunnuo
86cf6a9908 chore: 2025-09-27 09:30:22 +08:00
xiaojunnuo
b0f7288ac0 build: prepare to build 2025-09-27 09:28:26 +08:00
xiaojunnuo
32fcc1a8fb chore: 2025-09-27 09:27:21 +08:00
xiaojunnuo
eb4d125eaf fix: 固定midwayjs版本,修复ui-server import 错误的bug 2025-09-27 09:26:17 +08:00
xiaojunnuo
87e5cced3c chore: 2025-09-27 09:03:29 +08:00
xiaojunnuo
bcd9ee2d48 build: publish 2025-09-27 08:36:18 +08:00
xiaojunnuo
edf3d87458 build: trigger build image 2025-09-27 08:36:02 +08:00
76 changed files with 990 additions and 535 deletions

View File

@@ -3,7 +3,7 @@ on:
push:
branches: ['v2-dev']
paths:
- "build.trigger"
- "trigger/build.trigger"
# schedule:
# - # 国际时间 19:17 执行北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
@@ -68,7 +68,7 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
@@ -82,34 +82,4 @@ jobs:
push: true
context: ./packages/ui/
tags: |
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:${{steps.get_certd_version.outputs.result}}
greper/certd:latest
greper/certd:${{steps.get_certd_version.outputs.result}}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{steps.get_certd_version.outputs.result}}
- name: Build armv7
uses: docker/build-push-action@v6
with:
platforms: linux/arm/v7
push: true
context: ./packages/ui/
tags: |
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:armv7
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:${{steps.get_certd_version.outputs.result}}-armv7
greper/certd:armv7
greper/certd:${{steps.get_certd_version.outputs.result}}-armv7
ghcr.io/${{ github.repository }}:armv7
ghcr.io/${{ github.repository }}:${{steps.get_certd_version.outputs.result}}-armv7
# - name: Build agent
# uses: docker/build-push-action@v6
# with:
# platforms: linux/amd64,linux/arm64
# push: true
# context: ./packages/ui/agent/
# tags: |
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:latest
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:${{steps.get_certd_version.outputs.result}}
# greper/certd-agent:latest
# greper/certd-agent:${{steps.get_certd_version.outputs.result}}

View File

@@ -3,12 +3,13 @@ on:
push:
branches: ['v2-dev']
paths:
- "deploy.trigger"
- "trigger/deploy.trigger"
workflow_run:
workflows: [ "build-image" ]
types:
- completed
# schedule:
# - # 国际时间 19:17 执行北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
# - cron: '17 19 * * *'
@@ -54,14 +55,3 @@ jobs:
retry-count: 3
retry-delay: 5000
- name: deploy-certd-doc
uses: tyrrrz/action-http-request@master
with:
url: http://flow-openapi.aliyun.com/pipeline/webhook/IiSxLDp9aOhgDUxJPytv
method: POST
body: |
{}
headers: |
Content-Type: application/json
retry-count: 3
retry-delay: 5000

View File

@@ -1,9 +1,13 @@
name: build-image-for-test
name: build-image-for-release
on:
push:
branches: ['v2-dev']
paths:
- "build-dev.trigger"
- "trigger/release.trigger"
# workflow_run:
# workflows: [ "deploy-demo" ]
# types:
# - completed
# schedule:
# - # 国际时间 19:17 执行北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
@@ -20,7 +24,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: v2-dev
lfs: true
- name: get_certd_version
id: get_certd_version
@@ -75,17 +79,19 @@ jobs:
username: ${{ secrets.dockerhub_username }}
password: ${{ secrets.dockerhub_password }}
# - name: Build default platforms
# uses: docker/build-push-action@v6
# with:
# platforms: linux/amd64,linux/arm64
# push: true
# context: ./packages/ui/
# tags: |
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-dev:latest
# greper/certd-dev:latest
# ghcr.io/${{ github.repository }}:dev-latest
- name: Build default platforms
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
context: ./packages/ui/
tags: |
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:${{steps.get_certd_version.outputs.result}}
greper/certd:latest
greper/certd:${{steps.get_certd_version.outputs.result}}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{steps.get_certd_version.outputs.result}}
- name: Build armv7
uses: docker/build-push-action@v6
with:
@@ -96,4 +102,30 @@ jobs:
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:armv7
registry.cn-shenzhen.aliyuncs.com/handsfree/certd:${{steps.get_certd_version.outputs.result}}-armv7
greper/certd:armv7
greper/certd:${{steps.get_certd_version.outputs.result}}-armv7
greper/certd:${{steps.get_certd_version.outputs.result}}-armv7
ghcr.io/${{ github.repository }}:armv7
ghcr.io/${{ github.repository }}:${{steps.get_certd_version.outputs.result}}-armv7
# - name: Build agent
# uses: docker/build-push-action@v6
# with:
# platforms: linux/amd64,linux/arm64
# push: true
# context: ./packages/ui/agent/
# tags: |
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:latest
# registry.cn-shenzhen.aliyuncs.com/handsfree/certd-agent:${{steps.get_certd_version.outputs.result}}
# greper/certd-agent:latest
# greper/certd-agent:${{steps.get_certd_version.outputs.result}}
- name: deploy-certd-doc
uses: tyrrrz/action-http-request@master
with:
url: http://flow-openapi.aliyun.com/pipeline/webhook/IiSxLDp9aOhgDUxJPytv
method: POST
body: |
{}
headers: |
Content-Type: application/json
retry-count: 3
retry-delay: 5000

View File

@@ -3,6 +3,31 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
### Bug Fixes
* 修复版本比较bug ([109696e](https://github.com/certd/certd/commit/109696e965d68c50c8627ffd40203edd1d2daea5))
* 修复某些情况下cname申请证书报错主域名不一致的bug ([2671781](https://github.com/certd/certd/commit/2671781e1bb0838981728d85eacf0e1a25a0fa48))
### Performance Improvements
* cname主域名校验提示优化显示不一致的两方便于排查问题 ([6ebb365](https://github.com/certd/certd/commit/6ebb3659f42155e4e8da600c493fb5227cd08137))
* dns解析支持阿里esa ([9291fa6](https://github.com/certd/certd/commit/9291fa68aa7a88a05c2f888bf3048df36a8fbde3))
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
### Features
* @certd/ui-server module import报错的问题 ([0c61d4c](https://github.com/certd/certd/commit/0c61d4c9788677c83c567db5381b9e257ec90bba))
* dist打包前检查 ([8f6e5bd](https://github.com/certd/certd/commit/8f6e5bd24b3b65fbfcba36c08f532a3abad2d606))
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
### Bug Fixes
* 固定midwayjs版本修复ui-server import 错误的bug ([eb4d125](https://github.com/certd/certd/commit/eb4d125eaf4a41e88c752d0c68993829589f8f27))
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
### Bug Fixes

View File

@@ -1 +0,0 @@
2

View File

@@ -1 +0,0 @@
5

View File

@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
### Features
* @certd/ui-server module import报错的问题 ([0c61d4c](https://github.com/certd/certd/commit/0c61d4c9788677c83c567db5381b9e257ec90bba))
* dist打包前检查 ([8f6e5bd](https://github.com/certd/certd/commit/8f6e5bd24b3b65fbfcba36c08f532a3abad2d606))
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
### Bug Fixes
* 固定midwayjs版本修复ui-server import 错误的bug ([eb4d125](https://github.com/certd/certd/commit/eb4d125eaf4a41e88c752d0c68993829589f8f27))
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
### Bug Fixes
* 修复 ui-server 加载失败问题 ([c2ccdbe](https://github.com/certd/certd/commit/c2ccdbec9dd08bca4688eeb2f34d0105eec43ba1))
* 修复 ui-server 加载失败问题 ([063f5c3](https://github.com/certd/certd/commit/063f5c3b55e47df22543a64f02e039e84f92cd14))
### Performance Improvements
* 重置管理员密码同时会关闭验证码,防止验证码失效之后无法登录 ([03899d4](https://github.com/certd/certd/commit/03899d4d9c76fc2077dacc53ab88e2c9ca41af7c))
## [1.36.23](https://github.com/certd/certd/compare/v1.36.22...v1.36.23) (2025-09-26)
### Bug Fixes

View File

@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.36.24"
"version": "1.37.1"
}

View File

@@ -18,7 +18,7 @@
"devb": "lerna run dev-build",
"i-all": "lerna link && lerna exec npm install ",
"publish": "npm run prepublishOnly2 && lerna publish --force-publish=pro/plus-core --conventional-commits --create-release github && npm run afterpublishOnly && npm run commitAll",
"afterpublishOnly": "npm run copylogs && time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push",
"afterpublishOnly": "npm run copylogs && time /t >trigger/build.trigger && git add ./trigger/build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push",
"transform-sql": "cd ./packages/ui/certd-server/db/ && node --experimental-json-modules transform.js",
"commitAll": "git add . && git commit -m \"build: publish\" && git push && npm run commitPro",
"commitPro": "cd ./packages/pro/ && git add . && git commit -m \"build: publish\" && git push",
@@ -37,7 +37,6 @@
},
"license": "AGPL-3.0",
"dependencies": {
"@certd/ui-server": "link:packages/ui/certd-server",
"axios": "^1.7.7",
"copyfiles": "^2.4.1",
"lodash-es": "^4.17.21",

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/publishlab/node-acme-client/compare/v1.37.0...v1.37.1) (2025-09-29)
**Note:** Version bump only for package @certd/acme-client
# [1.37.0](https://github.com/publishlab/node-acme-client/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/acme-client
## [1.36.25](https://github.com/publishlab/node-acme-client/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/acme-client
## [1.36.24](https://github.com/publishlab/node-acme-client/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/acme-client

View File

@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client",
"private": false,
"author": "nmorsman",
"version": "1.36.24",
"version": "1.37.1",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.36.24",
"@certd/basic": "^1.37.1",
"@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5",
"axios": "^1.7.2",
@@ -69,5 +69,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
**Note:** Version bump only for package @certd/basic
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/basic
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/basic
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/basic

View File

@@ -1 +1 @@
08:32
20:32

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.36.24",
"version": "1.37.1",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -45,5 +45,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -22,12 +22,14 @@ import { sp } from "./util.sp.js";
import { hashUtils } from "./util.hash.js";
import { promises } from "./util.promise.js";
import { fileUtils } from "./util.file.js";
import * as _ from "lodash-es";
import { cache } from "./util.cache.js";
import dayjs from "dayjs";
import { domainUtils } from "./util.domain.js";
export * from "./util.domain.js";
import { optionsUtils } from "./util.options.js";
export * from "./util.options.js";
import { amountUtils } from "./util.amount.js";
export * from "./util.amount.js";
import { nanoid } from "nanoid";
import * as id from "./util.id.js";
import { locker } from "./util.lock.js";
@@ -43,7 +45,6 @@ export const utils = {
hash: hashUtils,
promises,
file: fileUtils,
_,
mergeUtils,
cache,
nanoid,

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
**Note:** Version bump only for package @certd/pipeline
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/pipeline
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/pipeline
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/pipeline

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.36.24",
"version": "1.37.1",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -17,8 +17,8 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.36.24",
"@certd/plus-core": "^1.36.24",
"@certd/basic": "^1.37.1",
"@certd/plus-core": "^1.37.1",
"dayjs": "^1.11.7",
"lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13"
@@ -44,5 +44,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
**Note:** Version bump only for package @certd/lib-huawei
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/lib-huawei
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/lib-huawei
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/lib-huawei

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.36.24",
"version": "1.37.1",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts",
@@ -24,5 +24,5 @@
"prettier": "^2.8.8",
"tslib": "^2.8.1"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
**Note:** Version bump only for package @certd/lib-iframe
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/lib-iframe
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/lib-iframe
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/lib-iframe

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.36.24",
"version": "1.37.1",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
**Note:** Version bump only for package @certd/jdcloud
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/jdcloud
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/jdcloud
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/jdcloud

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/jdcloud",
"version": "1.36.24",
"version": "1.37.1",
"description": "jdcloud openApi sdk",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
@@ -61,5 +61,5 @@
"fetch"
]
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
**Note:** Version bump only for package @certd/lib-k8s
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/lib-k8s
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/lib-k8s
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/lib-k8s

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.36.24",
"version": "1.37.1",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -17,7 +17,7 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.36.24",
"@certd/basic": "^1.37.1",
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
@@ -32,5 +32,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
**Note:** Version bump only for package @certd/lib-server
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
### Features
* dist打包前检查 ([8f6e5bd](https://github.com/certd/certd/commit/8f6e5bd24b3b65fbfcba36c08f532a3abad2d606))
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
### Bug Fixes
* 固定midwayjs版本修复ui-server import 错误的bug ([eb4d125](https://github.com/certd/certd/commit/eb4d125eaf4a41e88c752d0c68993829589f8f27))
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.36.24",
"version": "1.37.1",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -27,19 +27,20 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.36.24",
"@certd/basic": "^1.36.24",
"@certd/pipeline": "^1.36.24",
"@certd/plugin-lib": "^1.36.24",
"@certd/plus-core": "^1.36.24",
"@midwayjs/cache": "~3.14.0",
"@midwayjs/core": "~3.20.3",
"@midwayjs/i18n": "~3.20.3",
"@midwayjs/info": "~3.20.3",
"@midwayjs/koa": "~3.20.3",
"@midwayjs/logger": "~3.4.2",
"@midwayjs/typeorm": "~3.20.3",
"@midwayjs/upload": "^3.20.3",
"@certd/acme-client": "^1.37.1",
"@certd/basic": "^1.37.1",
"@certd/pipeline": "^1.37.1",
"@certd/plugin-lib": "^1.37.1",
"@certd/plus-core": "^1.37.1",
"@midwayjs/cache": "3.14.0",
"@midwayjs/core": "3.20.11",
"@midwayjs/i18n": "3.20.13",
"@midwayjs/info": "3.20.13",
"@midwayjs/koa": "3.20.13",
"@midwayjs/logger": "3.4.2",
"@midwayjs/typeorm": "3.20.11",
"@midwayjs/upload": "3.20.13",
"@midwayjs/validate": "3.20.13",
"better-sqlite3": "^11.1.2",
"cross-env": "^7.0.3",
"dayjs": "^1.11.7",
@@ -62,5 +63,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -1,5 +1,3 @@
export * from './api/index.js'
export * from './entity/addon.js'
export * from './service/addon-service.js'
export * from './service/addon-getter.js'
export * from './service/addon-sys-getter.js'

View File

@@ -1,18 +0,0 @@
import { IAddonGetter } from "../api/index.js";
export class AddonGetter implements IAddonGetter {
userId: number;
getter: <T>(id: any, userId?: number) => Promise<T>;
constructor(userId: number, getter: (id: any, userId: number) => Promise<any>) {
this.userId = userId;
this.getter = getter;
}
async getById<T = any>(id: any) {
return await this.getter<T>(id, this.userId);
}
async getCommonById<T = any>(id: any) {
return await this.getter<T>(id, 0);
}
}

View File

@@ -1,24 +1,19 @@
import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
import { Provide, Scope, ScopeEnum } from "@midwayjs/core";
import { InjectEntityModel } from "@midwayjs/typeorm";
import { In, Repository } from "typeorm";
import { AddonDefine, BaseService, PageReq, PermissionException, ValidateException } from "../../../index.js";
import { addonRegistry, newAddon } from "../api/index.js";
import { AddonDefine, BaseService, PageReq, ValidateException } from "../../../index.js";
import { addonRegistry } from "../api/index.js";
import { AddonEntity } from "../entity/addon.js";
import { http, logger, utils } from "@certd/basic";
import { TaskServiceBuilder } from "@certd/ui-server/dist/modules/pipeline/service/getter/task-service-getter.js";
/**
* Addon
*/
@Provide()
@Scope(ScopeEnum.Request, {allowDowngrade: true})
@Scope(ScopeEnum.Request, { allowDowngrade: true })
export class AddonService extends BaseService<AddonEntity> {
@InjectEntityModel(AddonEntity)
repository: Repository<AddonEntity>;
@Inject()
private taskServiceBuilder: TaskServiceBuilder;
//@ts-ignore
getRepository() {
return this.repository;
@@ -34,21 +29,21 @@ export class AddonService extends BaseService<AddonEntity> {
async add(param) {
let oldEntity = null;
if (param._copyFrom){
if (param._copyFrom) {
oldEntity = await this.info(param._copyFrom);
if (oldEntity == null) {
throw new ValidateException('该Addon配置不存在,请确认是否已被删除');
throw new ValidateException("该Addon配置不存在,请确认是否已被删除");
}
if (oldEntity.userId !== param.userId) {
throw new ValidateException('您无权查看该Addon配置');
if (oldEntity.userId !== param.userId) {
throw new ValidateException("您无权查看该Addon配置");
}
}
if (!param.userId){
param.isSystem = true
}else{
param.isSystem = false
if (!param.userId) {
param.isSystem = true;
} else {
param.isSystem = false;
}
delete param._copyFrom
delete param._copyFrom;
return await super.add(param);
}
@@ -60,7 +55,7 @@ export class AddonService extends BaseService<AddonEntity> {
async update(param) {
const oldEntity = await this.info(param.id);
if (oldEntity == null) {
throw new ValidateException('该Addon配置不存在,请确认是否已被删除');
throw new ValidateException("该Addon配置不存在,请确认是否已被删除");
}
return await super.update(param);
}
@@ -68,64 +63,24 @@ export class AddonService extends BaseService<AddonEntity> {
async getSimpleInfo(id: number) {
const entity = await this.info(id);
if (entity == null) {
throw new ValidateException('该Addon配置不存在,请确认是否已被删除');
throw new ValidateException("该Addon配置不存在,请确认是否已被删除");
}
return {
id: entity.id,
name: entity.name,
userId: entity.userId,
addonType: entity.addonType,
type: entity.type,
type: entity.type
};
}
async getAddonById(id: any, checkUserId: boolean, userId?: number): Promise<any> {
const serviceGetter = this.taskServiceBuilder.create({userId:userId??0})
const ctx = {
http: http,
logger: logger,
utils: utils,
serviceGetter
};
if (!id){
//使用图片验证码
return await newAddon("captcha", "image", {},ctx);
}
const entity = await this.info(id);
if (entity == null) {
//使用图片验证码
return await newAddon("captcha", "image", {},ctx);
}
if (checkUserId) {
if (userId == null) {
throw new ValidateException('userId不能为空');
}
if (userId !== entity.userId) {
throw new PermissionException('您对该Addon无访问权限');
}
}
const setting = JSON.parse(entity.setting ??"{}")
const input = {
id: entity.id,
...setting,
};
return await newAddon(entity.addonType, entity.type, input,ctx);
}
async getById(id: any, userId: number): Promise<any> {
return await this.getAddonById(id, true, userId);
}
getDefineList(addonType: string) {
return addonRegistry.getDefineList();
}
getDefineByType(type: string,prefix?: string) {
return addonRegistry.getDefine(type,prefix) as AddonDefine;
getDefineByType(type: string, prefix?: string) {
return addonRegistry.getDefine(type, prefix) as AddonDefine;
}
@@ -139,31 +94,30 @@ export class AddonService extends BaseService<AddonEntity> {
return await this.repository.find({
where: {
id: In(ids),
userId,
userId
},
select: {
id: true,
name: true,
addonType: true,
type: true,
userId:true,
isSystem: true,
},
userId: true,
isSystem: true
}
});
}
async getDefault(userId: number,addonType: string): Promise<any> {
async getDefault(userId: number, addonType: string): Promise<any> {
const res = await this.repository.findOne({
where: {
userId,
addonType
},
order: {
isDefault: 'DESC',
},
isDefault: "DESC"
}
});
if (!res) {
return null;
@@ -179,16 +133,16 @@ export class AddonService extends BaseService<AddonEntity> {
type: res.type,
name: res.name,
userId: res.userId,
setting,
setting
};
}
async setDefault(id: number, userId: number,addonType:string) {
async setDefault(id: number, userId: number, addonType: string) {
if (!id) {
throw new ValidateException('id不能为空');
throw new ValidateException("id不能为空");
}
if (!userId) {
throw new ValidateException('userId不能为空');
throw new ValidateException("userId不能为空");
}
await this.repository.update(
{
@@ -196,7 +150,7 @@ export class AddonService extends BaseService<AddonEntity> {
addonType
},
{
isDefault: false,
isDefault: false
}
);
await this.repository.update(
@@ -206,22 +160,22 @@ export class AddonService extends BaseService<AddonEntity> {
addonType
},
{
isDefault: true,
isDefault: true
}
);
}
async getOrCreateDefault(opts:{addonType:string,type:string, inputs: any, userId: any}) {
const {addonType,type,inputs,userId} = opts;
async getOrCreateDefault(opts: { addonType: string, type: string, inputs: any, userId: any }) {
const { addonType, type, inputs, userId } = opts;
const addonDefine = this.getDefineByType( type,addonType)
const addonDefine = this.getDefineByType(type, addonType);
const defaultConfig = await this.getDefault(userId,addonType);
const defaultConfig = await this.getDefault(userId, addonType);
if (defaultConfig) {
return defaultConfig;
}
const setting = {
...inputs,
...inputs
};
const res = await this.repository.save({
userId,
@@ -229,7 +183,7 @@ export class AddonService extends BaseService<AddonEntity> {
type: type,
name: addonDefine.title,
setting: JSON.stringify(setting),
isDefault: true,
isDefault: true
});
return this.buildAddonInstanceConfig(res);
}

View File

@@ -1,17 +0,0 @@
import { IAccessService } from '@certd/pipeline';
import { AddonService } from './addon-service.js';
export class AddonSysGetter implements IAccessService {
addonService: AddonService;
constructor(addonService: AddonService) {
this.addonService = addonService;
}
async getById<T = any>(id: any) {
return await this.addonService.getById(id, 0);
}
async getCommonById<T = any>(id: any) {
return await this.addonService.getById(id, 0);
}
}

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
**Note:** Version bump only for package @certd/midway-flyway-js
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.36.24",
"version": "1.37.1",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -25,9 +25,9 @@
],
"license": "MIT",
"dependencies": {
"@midwayjs/core": "~3.20.3",
"@midwayjs/logger": "~3.4.2",
"@midwayjs/typeorm": "~3.20.3",
"@midwayjs/core": "3.20.11",
"@midwayjs/logger": "3.4.2",
"@midwayjs/typeorm": "3.20.11",
"better-sqlite3": "^11.1.2"
},
"devDependencies": {
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
### Performance Improvements
* cname主域名校验提示优化显示不一致的两方便于排查问题 ([6ebb365](https://github.com/certd/certd/commit/6ebb3659f42155e4e8da600c493fb5227cd08137))
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/plugin-cert
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/plugin-cert
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/plugin-cert

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.36.24",
"version": "1.37.1",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -16,10 +16,10 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/acme-client": "^1.36.24",
"@certd/basic": "^1.36.24",
"@certd/pipeline": "^1.36.24",
"@certd/plugin-lib": "^1.36.24",
"@certd/acme-client": "^1.37.1",
"@certd/basic": "^1.37.1",
"@certd/pipeline": "^1.37.1",
"@certd/plugin-lib": "^1.37.1",
"@google-cloud/publicca": "^1.3.0",
"dayjs": "^1.11.7",
"jszip": "^3.10.1",
@@ -43,5 +43,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -2,3 +2,4 @@ export * from "./api.js";
export * from "./registry.js";
export * from "./decorator.js";
export * from "./base.js";
export * from "./domain-parser.js";

View File

@@ -635,8 +635,8 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
}
// 主域名异常
if (cnameRecord.mainDomain !== mainDomain) {
throw new Error(`CNAME记录${domain}的域名与配置的主域名不一致请确认是否在流水线创建之后修改了子域名托管您需要重新校验CNAME记录的校验状态`);
if (cnameRecord.mainDomain && mainDomain && cnameRecord.mainDomain !== mainDomain) {
throw new Error(`CNAME记录${domain}的域名与配置的主域名不一致${cnameRecord.mainDomain}${mainDomain}请确认是否在流水线创建之后修改了子域名托管您需要重新校验CNAME记录的校验状态`);
}
let dnsProvider = cnameRecord.commonDnsProvider;

View File

@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
### Performance Improvements
* dns解析支持阿里esa ([9291fa6](https://github.com/certd/certd/commit/9291fa68aa7a88a05c2f888bf3048df36a8fbde3))
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/plugin-lib
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/plugin-lib
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/plugin-lib

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.36.24",
"version": "1.37.1",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -21,8 +21,8 @@
"@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.10",
"@aws-sdk/client-s3": "^3.787.0",
"@certd/basic": "^1.36.24",
"@certd/pipeline": "^1.36.24",
"@certd/basic": "^1.37.1",
"@certd/pipeline": "^1.37.1",
"@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5",
@@ -53,5 +53,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "f070030f6b5dd6dc1451400f55f5d723743a6aa9"
"gitHead": "e17cd1f298a72595f01e466b5e5c8971828c6bd9"
}

View File

@@ -0,0 +1,45 @@
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
@IsAccess({
name: "aliesa",
title: "阿里云ESA授权",
desc: "",
icon: "ant-design:aliyun-outlined",
order: 0,
})
export class AliesaAccess extends BaseAccess {
@AccessInput({
title: "阿里云授权",
component: {
name: "access-selector",
vModel: "modelValue",
type: "aliyun",
},
helper: "请选择阿里云授权",
required: true,
})
accessId = "";
@AccessInput({
title: "地区",
component: {
name: "a-select",
vModel: "value",
options: [
{
label: "杭州",
value: "cn-hangzhou",
},
{
label: "新加坡",
value: "ap-southeast-1",
},
],
},
helper: "请选择ESA地区",
required: true,
})
region = "";
}
new AliesaAccess();

View File

@@ -1,2 +1,3 @@
export * from "./aliyun-access.js";
export * from "./alioss-access.js";
export * from "./aliesa-access.js";

View File

@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
### Bug Fixes
* 修复版本比较bug ([109696e](https://github.com/certd/certd/commit/109696e965d68c50c8627ffd40203edd1d2daea5))
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
**Note:** Version bump only for package @certd/ui-client
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
**Note:** Version bump only for package @certd/ui-client
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
**Note:** Version bump only for package @certd/ui-client

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.36.24",
"version": "1.37.1",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -105,8 +105,8 @@
"zod-defaults": "^0.1.3"
},
"devDependencies": {
"@certd/lib-iframe": "^1.36.24",
"@certd/pipeline": "^1.36.24",
"@certd/lib-iframe": "^1.37.1",
"@certd/pipeline": "^1.37.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",

View File

@@ -447,6 +447,7 @@ export default {
description: "Description",
createTime: "Creation Time",
updateTime: "Update Time",
mainDomain: "Main Domain",
edit: "Edit",
groupName: "Group Name",
enterGroupName: "Please enter group name",

View File

@@ -453,6 +453,7 @@ export default {
description: "说明",
createTime: "创建时间",
updateTime: "更新时间",
mainDomain: "主域名",
edit: "编辑",
groupName: "分组名称",
enterGroupName: "请输入分组名称",

View File

@@ -189,7 +189,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
column: {
width: 120,
align: "center",
align: "left",
cellRender({ value, row }) {
async function resetStatus() {
Modal.confirm({
@@ -202,7 +202,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
});
}
return (
<div class={"flex flex-center"}>
<div class={"flex flex-left"}>
<fs-values-format modelValue={value} dict={dictRef}></fs-values-format>
{row.error && (
<a-tooltip title={row.error}>
@@ -268,8 +268,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
},
mainDomain: {
title: t("certd.mainDomain"),
type: "text",
form: {
show: false,
},
},
createTime: {
title: t("certd.create_time"),
title: t("certd.createTime"),
type: "datetime",
form: {
show: false,
@@ -281,7 +288,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
updateTime: {
title: t("certd.update_time"),
title: t("certd.updateTime"),
type: "datetime",
form: {
show: false,

View File

@@ -177,6 +177,8 @@ function isNewVersion(version: string, latestVersion: string) {
for (let i = 0; i < current.length; i++) {
if (parseInt(latest[i]) > parseInt(current[i])) {
return true;
} else if (parseInt(latest[i]) < parseInt(current[i])) {
return false;
}
}
return false;
@@ -191,7 +193,7 @@ async function loadLatestVersion() {
const minVersion = settingsStore.productInfo?.app?.minVersion;
if (minVersion) {
//
debugger;
if (isNewVersion(version.value, minVersion)) {
notification.error({
message: settingsStore.productInfo?.app?.minVersionTip ?? "版本过低,为了您的数据安全,请尽快升级",

View File

@@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.1](https://github.com/certd/certd/compare/v1.37.0...v1.37.1) (2025-09-29)
### Bug Fixes
* 修复某些情况下cname申请证书报错主域名不一致的bug ([2671781](https://github.com/certd/certd/commit/2671781e1bb0838981728d85eacf0e1a25a0fa48))
### Performance Improvements
* dns解析支持阿里esa ([9291fa6](https://github.com/certd/certd/commit/9291fa68aa7a88a05c2f888bf3048df36a8fbde3))
# [1.37.0](https://github.com/certd/certd/compare/v1.36.25...v1.37.0) (2025-09-28)
### Features
* dist打包前检查 ([8f6e5bd](https://github.com/certd/certd/commit/8f6e5bd24b3b65fbfcba36c08f532a3abad2d606))
## [1.36.25](https://github.com/certd/certd/compare/v1.36.24...v1.36.25) (2025-09-27)
### Bug Fixes
* 固定midwayjs版本修复ui-server import 错误的bug ([eb4d125](https://github.com/certd/certd/commit/eb4d125eaf4a41e88c752d0c68993829589f8f27))
## [1.36.24](https://github.com/certd/certd/compare/v1.36.23...v1.36.24) (2025-09-27)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.36.24",
"version": "1.37.1",
"description": "fast-server base midway",
"private": true,
"type": "module",
@@ -43,34 +43,34 @@
"@aws-sdk/client-cloudfront": "^3.699.0",
"@aws-sdk/client-iam": "^3.699.0",
"@aws-sdk/client-s3": "^3.705.0",
"@certd/acme-client": "^1.36.24",
"@certd/basic": "^1.36.24",
"@certd/commercial-core": "^1.36.24",
"@certd/acme-client": "^1.37.1",
"@certd/basic": "^1.37.1",
"@certd/commercial-core": "^1.37.1",
"@certd/cv4pve-api-javascript": "^8.4.2",
"@certd/jdcloud": "^1.36.24",
"@certd/lib-huawei": "^1.36.24",
"@certd/lib-k8s": "^1.36.24",
"@certd/lib-server": "^1.36.24",
"@certd/midway-flyway-js": "^1.36.24",
"@certd/pipeline": "^1.36.24",
"@certd/plugin-cert": "^1.36.24",
"@certd/plugin-lib": "^1.36.24",
"@certd/plugin-plus": "^1.36.24",
"@certd/plus-core": "^1.36.24",
"@certd/jdcloud": "^1.37.1",
"@certd/lib-huawei": "^1.37.1",
"@certd/lib-k8s": "^1.37.1",
"@certd/lib-server": "^1.37.1",
"@certd/midway-flyway-js": "^1.37.1",
"@certd/pipeline": "^1.37.1",
"@certd/plugin-cert": "^1.37.1",
"@certd/plugin-lib": "^1.37.1",
"@certd/plugin-plus": "^1.37.1",
"@certd/plus-core": "^1.37.1",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
"@koa/cors": "^5.0.0",
"@midwayjs/bootstrap": "~3.20.3",
"@midwayjs/cache": "~3.14.0",
"@midwayjs/core": "~3.20.3",
"@midwayjs/i18n": "~3.20.3",
"@midwayjs/info": "~3.20.3",
"@midwayjs/koa": "~3.20.3",
"@midwayjs/logger": "~3.4.2",
"@midwayjs/static-file": "~3.20.3",
"@midwayjs/typeorm": "~3.20.3",
"@midwayjs/upload": "~3.20.3",
"@midwayjs/validate": "~3.20.3",
"@midwayjs/bootstrap": "3.20.11",
"@midwayjs/cache": "3.14.0",
"@midwayjs/core": "3.20.11",
"@midwayjs/i18n": "3.20.13",
"@midwayjs/info": "3.20.13",
"@midwayjs/koa": "3.20.13",
"@midwayjs/logger": "3.4.2",
"@midwayjs/static-file": "3.20.13",
"@midwayjs/typeorm": "3.20.11",
"@midwayjs/upload": "3.20.13",
"@midwayjs/validate": "3.20.13",
"@volcengine/openapi": "^1.28.1",
"ali-oss": "^6.21.0",
"axios": "^1.7.2",
@@ -123,7 +123,7 @@
"uuid": "^10.0.0"
},
"devDependencies": {
"@midwayjs/mock": "~3.20.3",
"@midwayjs/mock": "3.20.11",
"@types/ali-oss": "^6.16.11",
"@types/cache-manager": "^4.0.6",
"@types/jest": "^29.5.13",
@@ -142,7 +142,7 @@
"why-is-node-running": "^3.2.2"
},
"engines": {
"node": ">=18.0.0"
"node": ">=20.0.0"
},
"repository": {
"type": "git",

View File

@@ -1,7 +1,7 @@
import {ALL, Body, Controller, Inject, Post, Provide, Query} from '@midwayjs/core';
import {Constants, CrudController} from '@certd/lib-server';
import {SubDomainService} from "../../../modules/pipeline/service/sub-domain-service.js";
import {DomainParser} from '@certd/plugin-cert/dist/dns-provider/domain-parser.js';
import {DomainParser} from '@certd/plugin-cert';
import { SubDomainsGetter } from '../../../modules/pipeline/service/getter/sub-domain-getter.js';
/**

View File

@@ -2,7 +2,7 @@ import { Autoload, Init, Inject, Scope, ScopeEnum } from "@midwayjs/core";
import { CertInfoService } from "../monitor/index.js";
import { pipelineEmitter } from "@certd/pipeline";
import { CertInfo, EVENT_CERT_APPLY_SUCCESS } from "@certd/plugin-cert";
import { PipelineEvent } from "@certd/pipeline/dist/service/emit.js";
import { PipelineEvent } from "@certd/pipeline";
@Autoload()
@Scope(ScopeEnum.Request, { allowDowngrade: true })

View File

@@ -1,7 +1,8 @@
import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
import { AddonService, SysSettingsService } from "@certd/lib-server";
import { SysSettingsService } from "@certd/lib-server";
import { logger } from "@certd/basic";
import { ICaptchaAddon } from "../../../plugins/plugin-captcha/api.js";
import { AddonGetterService } from "../../pipeline/service/addon-getter-service.js";
@Provide()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
@@ -9,45 +10,48 @@ export class CaptchaService {
@Inject()
sysSettingsService: SysSettingsService;
@Inject()
addonService: AddonService;
addonGetterService: AddonGetterService;
async getCaptcha(captchaAddonId?:number){
async getCaptcha(captchaAddonId?: number) {
if (!captchaAddonId) {
const settings = await this.sysSettingsService.getPublicSettings()
captchaAddonId = settings.captchaAddonId ?? 0
const settings = await this.sysSettingsService.getPublicSettings();
captchaAddonId = settings.captchaAddonId ?? 0;
}
const addon:ICaptchaAddon = await this.addonService.getAddonById(captchaAddonId,true,0)
const addon: ICaptchaAddon = await this.addonGetterService.getAddonById(captchaAddonId, true, 0, {
type: "captcha",
name: "image"
});
if (!addon) {
throw new Error('验证码插件还未配置')
throw new Error("验证码插件还未配置");
}
return await addon.getCaptcha()
return await addon.getCaptcha();
}
async doValidate(opts:{form:any,must?:boolean,captchaAddonId?:number}){
async doValidate(opts: { form: any, must?: boolean, captchaAddonId?: number }) {
if (!opts.captchaAddonId) {
const settings = await this.sysSettingsService.getPublicSettings()
opts.captchaAddonId = settings.captchaAddonId ?? 0
const settings = await this.sysSettingsService.getPublicSettings();
opts.captchaAddonId = settings.captchaAddonId ?? 0;
}
const addon = await this.addonService.getById(opts.captchaAddonId,0)
const addon = await this.addonGetterService.getById(opts.captchaAddonId, 0);
if (!addon) {
if (opts.must) {
throw new Error('请先配置验证码插件');
throw new Error("请先配置验证码插件");
}
logger.warn('验证码插件还未配置,忽略验证码校验')
return true
logger.warn("验证码插件还未配置,忽略验证码校验");
return true;
}
if (!opts.form) {
throw new Error('请输入验证码');
throw new Error("请输入验证码");
}
const res = await addon.onValidate(opts.form)
const res = await addon.onValidate(opts.form);
if (!res) {
throw new Error('验证码错误');
throw new Error("验证码错误");
}
return true
return true;
}

View File

@@ -4,7 +4,7 @@ import {In, Not, Repository} from 'typeorm';
import {AccessService, BaseService} from '@certd/lib-server';
import {DomainEntity} from '../entity/domain.js';
import {SubDomainService} from "../../pipeline/service/sub-domain-service.js";
import {DomainParser} from "@certd/plugin-cert/dist/dns-provider/domain-parser.js";
import {DomainParser} from "@certd/plugin-cert";
import {DomainVerifiers} from "@certd/plugin-cert";
import { SubDomainsGetter } from '../../pipeline/service/getter/sub-domain-getter.js';
import { CnameRecordService } from '../../cname/service/cname-record-service.js';

View File

@@ -17,7 +17,7 @@ import { getAuthoritativeDnsResolver, walkTxtRecord } from "@certd/acme-client";
import { CnameProviderService } from "./cname-provider-service.js";
import { CnameProviderEntity } from "../entity/cname-provider.js";
import { CommonDnsProvider } from "./common-provider.js";
import { DomainParser } from "@certd/plugin-cert/dist/dns-provider/domain-parser.js";
import { DomainParser } from "@certd/plugin-cert";
import punycode from "punycode.js";
import { SubDomainService } from "../../pipeline/service/sub-domain-service.js";
import { SubDomainsGetter } from "../../pipeline/service/getter/sub-domain-getter.js";
@@ -37,7 +37,7 @@ type CnameCheckCacheValue = {
* 授权
*/
@Provide()
@Scope(ScopeEnum.Request, {allowDowngrade: true})
@Scope(ScopeEnum.Request, { allowDowngrade: true })
export class CnameRecordService extends BaseService<CnameRecordEntity> {
@InjectEntityModel(CnameRecordEntity)
repository: Repository<CnameRecordEntity>;
@@ -71,16 +71,16 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
*/
async add(param: any): Promise<CnameRecordEntity> {
if (!param.domain) {
throw new ValidateException('域名不能为空');
throw new ValidateException("域名不能为空");
}
if (!param.userId) {
throw new ValidateException('userId不能为空');
throw new ValidateException("userId不能为空");
}
if (param.domain.startsWith('*.')) {
if (param.domain.startsWith("*.")) {
param.domain = param.domain.substring(2);
}
param.domain = param.domain.trim()
const info = await this.getRepository().findOne({where: {domain: param.domain, userId: param.userId}});
param.domain = param.domain.trim();
const info = await this.getRepository().findOne({ where: { domain: param.domain, userId: param.userId } });
if (info) {
return info;
}
@@ -90,28 +90,28 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
//获取默认的cnameProviderId
cnameProvider = await this.cnameProviderService.getByPriority();
if (cnameProvider == null) {
throw new ValidateException('找不到CNAME服务请先前往“系统管理->CNAME服务设置”添加CNAME服务');
throw new ValidateException("找不到CNAME服务请先前往“系统管理->CNAME服务设置”添加CNAME服务");
}
} else {
cnameProvider = await this.cnameProviderService.info(param.cnameProviderId);
}
await this.cnameProviderChanged(param.userId, param, cnameProvider);
param.status = 'cname';
const {id} = await super.add(param);
param.status = "cname";
const { id } = await super.add(param);
return await this.info(id);
}
private async cnameProviderChanged(userId: number, param: any, cnameProvider: CnameProviderEntity) {
param.cnameProviderId = cnameProvider.id;
const subDomainGetter = new SubDomainsGetter(userId, this.subDomainService)
const subDomainGetter = new SubDomainsGetter(userId, this.subDomainService);
const domainParser = new DomainParser(subDomainGetter);
const realDomain = await domainParser.parse(param.domain);
const prefix = param.domain.replace(realDomain, '');
const prefix = param.domain.replace(realDomain, "");
let hostRecord = `_acme-challenge.${prefix}`;
if (hostRecord.endsWith('.')) {
if (hostRecord.endsWith(".")) {
hostRecord = hostRecord.substring(0, hostRecord.length - 1);
}
param.hostRecord = hostRecord;
@@ -119,33 +119,33 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
const randomKey = utils.id.simpleNanoId(6).toLowerCase();
const userIdHex = utils.hash.toHex(userId)
let userKeyHash = ""
const installInfo = await this.sysSettingsService.getSetting<SysInstallInfo>(SysInstallInfo)
userKeyHash = `${installInfo.siteId}_${userIdHex}_${randomKey}`
userKeyHash = utils.hash.md5(userKeyHash).substring(0, 10)
logger.info(`userKeyHash:${userKeyHash},subjectId:${installInfo.siteId},randomKey:${randomKey},userIdHex:${userIdHex}`)
const userIdHex = utils.hash.toHex(userId);
let userKeyHash = "";
const installInfo = await this.sysSettingsService.getSetting<SysInstallInfo>(SysInstallInfo);
userKeyHash = `${installInfo.siteId}_${userIdHex}_${randomKey}`;
userKeyHash = utils.hash.md5(userKeyHash).substring(0, 10);
logger.info(`userKeyHash:${userKeyHash},subjectId:${installInfo.siteId},randomKey:${randomKey},userIdHex:${userIdHex}`);
const cnameKey = `${userKeyHash}-${userIdHex}-${randomKey}`;
const safeDomain = param.domain.replaceAll('.', '-');
const safeDomain = param.domain.replaceAll(".", "-");
param.recordValue = `${safeDomain}.${cnameKey}.${cnameProvider.domain}`;
}
async update(param: any) {
if (!param.id) {
throw new ValidateException('id不能为空');
throw new ValidateException("id不能为空");
}
const old = await this.info(param.id);
if (!old) {
throw new ValidateException('数据不存在');
throw new ValidateException("数据不存在");
}
if (param.domain && old.domain !== param.domain) {
throw new ValidateException('域名不允许修改');
throw new ValidateException("域名不允许修改");
}
if (param.cnameProviderId && old.cnameProviderId !== param.cnameProviderId) {
const cnameProvider = await this.cnameProviderService.info(param.cnameProviderId);
await this.cnameProviderChanged(old.userId, param, cnameProvider);
param.status = 'cname';
param.status = "cname";
}
return await super.update(param);
}
@@ -170,7 +170,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
} else {
record.commonDnsProvider = new CommonDnsProvider({
config: record.cnameProvider,
plusService: this.plusService,
plusService: this.plusService
});
}
@@ -179,15 +179,15 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
async getByDomain(domain: string, userId: number, createOnNotFound = true) {
if (!domain) {
throw new ValidateException('domain不能为空');
throw new ValidateException("domain不能为空");
}
if (userId == null) {
throw new ValidateException('userId不能为空');
throw new ValidateException("userId不能为空");
}
let record = await this.getRepository().findOne({where: {domain, userId}});
let record = await this.getRepository().findOne({ where: { domain, userId } });
if (record == null) {
if (createOnNotFound) {
record = await this.add({domain, userId});
record = await this.add({ domain, userId });
} else {
throw new ValidateException(`找不到${domain}的CNAME记录`);
}
@@ -203,22 +203,34 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
return {
...record,
cnameProvider: {
...provider,
} as CnameProvider,
...provider
} as CnameProvider
} as CnameRecord;
}
private async fillMainDomain(record: CnameRecordEntity) {
if (!record.mainDomain) {
async fillMainDomain(record: CnameRecordEntity, update = true) {
const notMainDomain = !record.mainDomain;
const hasErrorMainDomain = record.mainDomain && !record.mainDomain.includes(".");
if (notMainDomain || hasErrorMainDomain) {
let domainPrefix = record.hostRecord.replace("_acme-challenge", "");
if (domainPrefix.startsWith(".")) {
domainPrefix = domainPrefix.substring(1);
}
record.mainDomain = record.domain.replace(domainPrefix+".", "");
await this.update({
id: record.id,
mainDomain: record.mainDomain
});
if (domainPrefix) {
const prefixStr = domainPrefix + ".";
record.mainDomain = record.domain.substring(prefixStr.length);
}else{
record.mainDomain = record.domain;
}
if (update) {
await this.update({
id: record.id,
mainDomain: record.mainDomain
});
}
}
}
@@ -231,11 +243,13 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
if (!bean) {
throw new ValidateException(`CnameRecord:${id} 不存在`);
}
if (bean.status === 'valid') {
if (bean.status === "valid") {
return true;
}
const subDomainGetter = new SubDomainsGetter(bean.userId, this.subDomainService)
await this.getByDomain(bean.domain, bean.userId);
const subDomainGetter = new SubDomainsGetter(bean.userId, this.subDomainService);
const domainParser = new DomainParser(subDomainGetter);
const cacheKey = `cname.record.verify.${bean.id}`;
@@ -245,7 +259,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
value = {
validating: false,
pass: false,
startTime: new Date().getTime(),
startTime: new Date().getTime()
};
}
let ttl = 5 * 60 * 1000;
@@ -267,16 +281,16 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
//公共CNAME
return new CommonDnsProvider({
config: cnameProvider,
plusService: this.plusService,
plusService: this.plusService
});
}
const serviceGetter = this.taskServiceBuilder.create({userId:cnameProvider.userId})
const serviceGetter = this.taskServiceBuilder.create({ userId: cnameProvider.userId });
const access = await this.accessService.getById(cnameProvider.accessId, cnameProvider.userId);
const context = {access, logger, http, utils, domainParser,serviceGetter};
const context = { access, logger, http, utils, domainParser, serviceGetter };
const dnsProvider: IDnsProvider = await createDnsProvider({
dnsProviderType: cnameProvider.dnsProviderType,
context,
context
});
return dnsProvider;
};
@@ -284,15 +298,15 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
const clearVerifyRecord = async () => {
cache.delete(cacheKey);
try {
let dnsProvider = value.dnsProvider
let dnsProvider = value.dnsProvider;
if (!dnsProvider) {
dnsProvider = await buildDnsProvider();
}
await dnsProvider.removeRecord({
recordReq: value.recordReq,
recordRes: value.recordRes,
recordRes: value.recordRes
});
logger.info('删除CNAME的校验DNS记录成功');
logger.info("删除CNAME的校验DNS记录成功");
} catch (e) {
logger.error(`删除CNAME的校验DNS记录失败 ${e.message}req:${JSON.stringify(value.recordReq)}recordRes:${JSON.stringify(value.recordRes)}`, e);
}
@@ -305,8 +319,8 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
if (value.startTime + ttl < new Date().getTime()) {
logger.warn(`cname验证超时,停止检查,${bean.domain} ${testRecordValue}`);
clearInterval(value.intervalId);
await this.updateStatus(bean.id, 'timeout');
await clearVerifyRecord()
await this.updateStatus(bean.id, "timeout");
await clearVerifyRecord();
return false;
}
@@ -317,7 +331,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
logger.info(`检查CNAME配置 ${fullDomain} ${testRecordValue}`);
//检查是否有重复的acme配置
await this.checkRepeatAcmeChallengeRecords(fullDomain,bean.recordValue)
await this.checkRepeatAcmeChallengeRecords(fullDomain, bean.recordValue);
// const txtRecords = await dns.promises.resolveTxt(fullDomain);
// if (txtRecords.length) {
@@ -334,9 +348,9 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
if (success) {
clearInterval(value.intervalId);
logger.info(`检测到CNAME配置,修改状态 ${fullDomain} ${testRecordValue}`);
await this.updateStatus(bean.id, 'valid', "");
await this.updateStatus(bean.id, "valid", "");
value.pass = true;
await clearVerifyRecord()
await clearVerifyRecord();
return success;
}
};
@@ -347,88 +361,88 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
}
cache.set(cacheKey, value, {
ttl: ttl,
ttl: ttl
});
const domain = await domainParser.parse(bean.recordValue);
const fullRecord = bean.recordValue;
const hostRecord = fullRecord.replace(`.${domain}`, '');
const hostRecord = fullRecord.replace(`.${domain}`, "");
const req = {
domain: domain,
fullRecord: fullRecord,
hostRecord: hostRecord,
type: 'TXT',
value: testRecordValue,
type: "TXT",
value: testRecordValue
};
const dnsProvider = await buildDnsProvider();
if(dnsProvider.usePunyCode()){
if (dnsProvider.usePunyCode()) {
//是否需要中文转英文
req.domain = dnsProvider.punyCodeEncode(req.domain)
req.fullRecord = dnsProvider.punyCodeEncode(req.fullRecord)
req.hostRecord = dnsProvider.punyCodeEncode(req.hostRecord)
req.value = dnsProvider.punyCodeEncode(req.value)
req.domain = dnsProvider.punyCodeEncode(req.domain);
req.fullRecord = dnsProvider.punyCodeEncode(req.fullRecord);
req.hostRecord = dnsProvider.punyCodeEncode(req.hostRecord);
req.value = dnsProvider.punyCodeEncode(req.value);
}
const recordRes = await dnsProvider.createRecord(req);
value.dnsProvider = dnsProvider;
value.validating = true;
value.recordReq = req;
value.recordRes = recordRes;
await this.updateStatus(bean.id, 'validating', "");
await this.updateStatus(bean.id, "validating", "");
value.intervalId = setInterval(async () => {
try {
await checkRecordValue();
} catch (e) {
logger.error('检查cname出错', e);
logger.error("检查cname出错", e);
await this.updateError(bean.id, e.message);
}
}, 10000);
}
async updateStatus(id: number, status: CnameRecordStatusType, error?: string) {
const updated: any = {status}
const updated: any = { status };
if (error != null) {
updated.error = error
updated.error = error;
}
await this.getRepository().update(id, updated);
}
async updateError(id: number, error: string) {
await this.getRepository().update(id, {error});
await this.getRepository().update(id, { error });
}
async checkRepeatAcmeChallengeRecords(acmeRecordDomain: string,targetCnameDomain:string) {
async checkRepeatAcmeChallengeRecords(acmeRecordDomain: string, targetCnameDomain: string) {
let dnsResolver = null
try{
dnsResolver = await getAuthoritativeDnsResolver(acmeRecordDomain)
}catch (e) {
logger.error(`获取${acmeRecordDomain}的权威DNS服务器失败${e.message}`)
return
let dnsResolver = null;
try {
dnsResolver = await getAuthoritativeDnsResolver(acmeRecordDomain);
} catch (e) {
logger.error(`获取${acmeRecordDomain}的权威DNS服务器失败${e.message}`);
return;
}
let cnameRecords = []
try{
let cnameRecords = [];
try {
cnameRecords = await dnsResolver.resolveCname(acmeRecordDomain);
}catch (e) {
logger.error(`查询CNAME记录失败${e.message}`)
return
} catch (e) {
logger.error(`查询CNAME记录失败${e.message}`);
return;
}
targetCnameDomain = targetCnameDomain.toLowerCase()
targetCnameDomain = punycode.toASCII(targetCnameDomain)
targetCnameDomain = targetCnameDomain.toLowerCase();
targetCnameDomain = punycode.toASCII(targetCnameDomain);
if (cnameRecords.length > 0) {
for (const cnameRecord of cnameRecords) {
if(cnameRecord.toLowerCase() !== targetCnameDomain){
if (cnameRecord.toLowerCase() !== targetCnameDomain) {
//确保只有一个cname记录
throw new Error(`${acmeRecordDomain}存在多个CNAME记录请删除多余的CNAME记录${cnameRecord}`)
throw new Error(`${acmeRecordDomain}存在多个CNAME记录请删除多余的CNAME记录${cnameRecord}`);
}
}
}
// 确保权威服务器里面没有纯粹的TXT记录
let txtRecords = []
try{
let txtRecords = [];
try {
const txtRecordRes = await dnsResolver.resolveTxt(acmeRecordDomain);
if (txtRecordRes && txtRecordRes.length > 0) {
@@ -436,13 +450,13 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
logger.info(`TXT records: ${JSON.stringify(txtRecords)}`);
txtRecords = txtRecords.concat(...txtRecordRes);
}
}catch (e) {
logger.error(`查询Txt记录失败${e.message}`)
} catch (e) {
logger.error(`查询Txt记录失败${e.message}`);
}
if (txtRecords.length === 0) {
//如果权威服务器中查不到txt无需继续检查
return
return;
}
if (cnameRecords.length > 0) {
// 从cname记录中获取txt记录
@@ -451,7 +465,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
if (res.length > 0) {
for (const txtRecord of txtRecords) {
if (!res.includes(txtRecord)) {
throw new Error(`${acmeRecordDomain}存在多个TXT记录请删除多余的TXT记录:${txtRecord}`)
throw new Error(`${acmeRecordDomain}存在多个TXT记录请删除多余的TXT记录:${txtRecord}`);
}
}
}
@@ -459,10 +473,10 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
}
async resetStatus (id: number) {
async resetStatus(id: number) {
if (!id) {
throw new ValidateException('id不能为空');
throw new ValidateException("id不能为空");
}
await this.getRepository().update(id, {status: 'cname',mainDomain: ""});
await this.getRepository().update(id, { status: "cname", mainDomain: "" });
}
}

View File

@@ -0,0 +1,65 @@
import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
import { http, logger, utils } from "@certd/basic";
import { TaskServiceBuilder } from "./getter/task-service-getter.js";
import { AddonService, newAddon, PermissionException, ValidateException } from "@certd/lib-server";
/**
* Addon
*/
@Provide()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
export class AddonGetterService {
@Inject()
taskServiceBuilder: TaskServiceBuilder;
@Inject()
addonService: AddonService;
async getAddonById(id: any, checkUserId: boolean, userId?: number, defaultAddon?:{type:string,name:string} ): Promise<any> {
const serviceGetter = this.taskServiceBuilder.create({
userId
});
const ctx = {
http,
logger,
utils,
serviceGetter
}
if (!id) {
if (!defaultAddon) {
return null;
}
return await newAddon(defaultAddon.type, defaultAddon.name, {}, ctx);
}
const entity = await this.addonService.info(id);
if (entity == null) {
if (!defaultAddon) {
return null;
}
return await newAddon(defaultAddon.type, defaultAddon.name, {}, ctx);
}
if (checkUserId) {
if (userId == null) {
throw new ValidateException("userId不能为空");
}
if (userId !== entity.userId) {
throw new PermissionException("您对该Addon无访问权限");
}
}
const setting = JSON.parse(entity.setting ?? "{}");
const input = {
id: entity.id,
...setting
};
return await newAddon(entity.addonType, entity.type, input, ctx);
}
async getById(id: any, userId: number): Promise<any> {
return await this.getAddonById(id, true, userId);
}
}

View File

@@ -32,7 +32,7 @@ export class TaskServiceGetter implements IServiceGetter{
return await this.getNotificationService() as T
} else if (serviceName === 'domainVerifierGetter') {
return await this.getDomainVerifierGetter() as T
} else{
}else{
if(!serviceNames.includes(serviceName)){
throw new Error(`${serviceName} not in whitelist`)
}
@@ -53,6 +53,7 @@ export class TaskServiceGetter implements IServiceGetter{
return new AccessGetter(this.userId, accessService.getById.bind(accessService));
}
async getCnameProxyService(): Promise<CnameProxyService> {
const cnameRecordService:CnameRecordService = await this.appCtx.getAsync("cnameRecordService")
return new CnameProxyService(this.userId, cnameRecordService.getWithAccessByDomain.bind(cnameRecordService));

View File

@@ -0,0 +1,105 @@
import { IAccessService } from '@certd/pipeline';
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
import { AliesaAccess, AliyunAccess, AliyunClientV2 } from '@certd/plugin-lib';
@IsDnsProvider({
name: 'aliesa',
title: '阿里ESA',
desc: '阿里ESA DNS解析',
accessType: 'aliesa',
icon: 'svg:icon-aliyun',
order: 0,
})
export class AliesaDnsProvider extends AbstractDnsProvider {
client: AliyunClientV2
async onInstance() {
const access: AliesaAccess = this.ctx.access as AliesaAccess
const accessGetter = await this.ctx.serviceGetter.get("accessService") as IAccessService
const aliAccess = await accessGetter.getById(access.accessId) as AliyunAccess
const endpoint = `esa.${access.region}.aliyuncs.com`
this.client = aliAccess.getClient(endpoint)
}
async getSiteItem(domain: string) {
const ret = await this.client.doRequest({
// 接口名称
action: "ListSites",
// 接口版本
version: "2024-09-10",
// 接口协议
protocol: "HTTPS",
// 接口 HTTP 方法
method: "GET",
authType: "AK",
style: "RPC",
data: {
query: {
SiteName: domain,
// ["SiteSearchType"] = "exact";
SiteSearchType: "exact",
AccessType: "NS"
}
}
})
const list = ret.Sites
if (list?.length === 0) {
throw new Error(`阿里云ESA中不存在此域名站点:${domain}请确认域名已添加到ESA中且为NS接入方式`);
}
return list[0]
}
async createRecord(options: CreateRecordOptions): Promise<any> {
const { fullRecord, value, type, domain } = options;
this.logger.info('添加域名解析:', fullRecord, value, domain);
const siteItem = await this.getSiteItem(domain)
const siteId = siteItem.SiteId
const res = await this.client.doRequest({
action: "CreateRecord",
version: "2024-09-10",
method: "POST",
data: {
query: {
SiteId: siteId,
RecordName: fullRecord,
Type: type,
// queries["Ttl"] = 1231311;
Ttl: 100,
Data: JSON.stringify({ Value: value }),
}
}
})
this.logger.info('添加域名解析成功:', fullRecord, value, res.RecordId);
return {
RecordId: res.RecordId,
SiteId: siteId,
}
}
async removeRecord(options: RemoveRecordOptions<any>): Promise<any> {
const record = options.recordRes;
await this.client.doRequest({
action: "DeleteRecord",
version: "2024-09-10",
data: {
query: {
RecordId: record.RecordId,
}
}
})
this.logger.info('删除域名解析成功:', record.RecordId);
}
}
new AliesaDnsProvider();

View File

@@ -1 +1,2 @@
import './aliyun-dns-provider.js';
import './aliesa-dns-provider.js';

View File

@@ -6,7 +6,7 @@ import {
createRemoteSelectInputDefine
} from "@certd/plugin-lib";
import { CertApplyPluginNames, CertInfo, CertReader } from "@certd/plugin-cert";
import {optionsUtils} from "@certd/basic/dist/utils/util.options.js";
import {optionsUtils} from "@certd/basic";
@IsTaskPlugin({
name: 'DeployCertToAliyunApig',

View File

@@ -1,7 +1,7 @@
import {AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput} from '@certd/pipeline';
import {AliyunAccess, createCertDomainGetterInputDefine, createRemoteSelectInputDefine} from "@certd/plugin-lib";
import {CertApplyPluginNames, CertInfo} from '@certd/plugin-cert';
import {optionsUtils} from "@certd/basic/dist/utils/util.options.js";
import {optionsUtils} from "@certd/basic";
@IsTaskPlugin({
name: 'DeployCertToAliyunApiGateway',

View File

@@ -1,6 +1,6 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { AliyunAccess, AliyunClient, AliyunSslClient, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
import { optionsUtils } from '@certd/basic/dist/utils/util.options.js';
import { optionsUtils } from '@certd/basic';
import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert";
@IsTaskPlugin({
name: 'DeployCertToAliyunCDN',

View File

@@ -8,7 +8,7 @@ import {
} from "@certd/plugin-lib";
import { CertInfo } from '@certd/plugin-cert';
import { CertApplyPluginNames} from '@certd/plugin-cert';
import { optionsUtils } from "@certd/basic/dist/utils/util.options.js";
import { optionsUtils } from "@certd/basic";
@IsTaskPlugin({
name: 'DeployCertToAliyunDCDN',
title: '阿里云-部署证书至DCDN',

View File

@@ -7,7 +7,7 @@ import {
} from '@certd/plugin-lib';
import {CertInfo, CertReader} from '@certd/plugin-cert';
import { CertApplyPluginNames} from '@certd/plugin-cert';
import {optionsUtils} from "@certd/basic/dist/utils/util.options.js";
import {optionsUtils} from "@certd/basic";
import {isArray} from "lodash-es";
@IsTaskPlugin({
name: 'DeployCertToAliyunOSS',

View File

@@ -3,7 +3,7 @@ import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { AwsAccess, AwsRegions } from "../access.js";
import { AwsAcmClient } from "../libs/aws-acm-client.js";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { optionsUtils } from "@certd/basic/dist/utils/util.options.js";
import { optionsUtils } from "@certd/basic";
@IsTaskPlugin({
name: 'AwsDeployToCloudFront',

View File

@@ -1,7 +1,7 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { CertInfo, CertReader } from '@certd/plugin-cert';
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
import { optionsUtils } from '@certd/basic/dist/utils/util.options.js';
import { optionsUtils } from '@certd/basic';
import { CertApplyPluginNames} from '@certd/plugin-cert';
@IsTaskPlugin({
//命名规范,插件类型+功能就是目录plugin-demo中的demo大写字母开头驼峰命名

View File

@@ -1,7 +1,7 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { optionsUtils } from "@certd/basic/dist/utils/util.options.js";
import { optionsUtils } from "@certd/basic";
import { JDCloudAccess } from "../access.js";
@IsTaskPlugin({

View File

@@ -1,7 +1,7 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { optionsUtils } from "@certd/basic/dist/utils/util.options.js";
import { optionsUtils } from "@certd/basic";
import { JDCloudAccess } from "../access.js";
@IsTaskPlugin({

View File

@@ -1,7 +1,7 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine, QiniuAccess, QiniuClient } from '@certd/plugin-lib';
import { CertInfo } from '@certd/plugin-cert';
import { optionsUtils } from '@certd/basic/dist/utils/util.options.js';
import { optionsUtils } from '@certd/basic';
import { CertApplyPluginNames} from '@certd/plugin-cert';
@IsTaskPlugin({
name: 'QiniuDeployCertToCDN',

View File

@@ -2,7 +2,7 @@ import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { UpyunAccess } from "../access.js";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { optionsUtils } from "@certd/basic/dist/utils/util.options.js";
import { optionsUtils } from "@certd/basic";
import { UpyunClient } from "../client.js";
@IsTaskPlugin({

View File

@@ -1,7 +1,7 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { optionsUtils } from "@certd/basic/dist/utils/util.options.js";
import { optionsUtils } from "@certd/basic";
import { VolcengineAccess } from "../access.js";
import { VolcengineCdnClient } from "../cdn-client.js";

273
pnpm-lock.yaml generated
View File

@@ -49,7 +49,7 @@ importers:
packages/core/acme-client:
dependencies:
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../basic
'@peculiar/x509':
specifier: ^1.11.0
@@ -210,10 +210,10 @@ importers:
packages/core/pipeline:
dependencies:
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../basic
'@certd/plus-core':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../pro/plus-core
dayjs:
specifier: ^1.11.7
@@ -418,7 +418,7 @@ importers:
packages/libs/lib-k8s:
dependencies:
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/basic
'@kubernetes/client-node':
specifier: 0.21.0
@@ -458,44 +458,47 @@ importers:
packages/libs/lib-server:
dependencies:
'@certd/acme-client':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/pipeline
'@certd/plugin-lib':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../plugins/plugin-lib
'@certd/plus-core':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../pro/plus-core
'@midwayjs/cache':
specifier: ~3.14.0
specifier: 3.14.0
version: 3.14.0
'@midwayjs/core':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
'@midwayjs/i18n':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/info':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/koa':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/logger':
specifier: ~3.4.2
specifier: 3.4.2
version: 3.4.2
'@midwayjs/typeorm':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
'@midwayjs/upload':
specifier: ^3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/validate':
specifier: 3.20.13
version: 3.20.13
better-sqlite3:
specifier: ^11.1.2
version: 11.10.0
@@ -555,14 +558,14 @@ importers:
packages/libs/midway-flyway-js:
dependencies:
'@midwayjs/core':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
'@midwayjs/logger':
specifier: ~3.4.2
specifier: 3.4.2
version: 3.4.2
'@midwayjs/typeorm':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
better-sqlite3:
specifier: ^11.1.2
version: 11.10.0
@@ -613,16 +616,16 @@ importers:
packages/plugins/plugin-cert:
dependencies:
'@certd/acme-client':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/pipeline
'@certd/plugin-lib':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../plugin-lib
'@google-cloud/publicca':
specifier: ^1.3.0
@@ -704,10 +707,10 @@ importers:
specifier: ^3.787.0
version: 3.810.0(aws-crt@1.26.2)
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/pipeline
'@kubernetes/client-node':
specifier: 0.21.0
@@ -795,32 +798,32 @@ importers:
packages/pro/commercial-core:
dependencies:
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/basic
'@certd/lib-server':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../libs/lib-server
'@certd/pipeline':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/pipeline
'@certd/plugin-plus':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../plugin-plus
'@certd/plus-core':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../plus-core
'@midwayjs/core':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
'@midwayjs/koa':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/logger':
specifier: ~3.4.2
specifier: 3.4.2
version: 3.4.2
'@midwayjs/typeorm':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
alipay-sdk:
specifier: ^4.13.0
version: 4.14.0
@@ -892,19 +895,19 @@ importers:
specifier: ^1.0.2
version: 1.0.3
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/basic
'@certd/lib-k8s':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../libs/lib-k8s
'@certd/pipeline':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/pipeline
'@certd/plugin-cert':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../plugins/plugin-cert
'@certd/plus-core':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../plus-core
ali-oss:
specifier: ^6.21.0
@@ -1007,7 +1010,7 @@ importers:
packages/pro/plus-core:
dependencies:
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/basic
dayjs:
specifier: ^1.11.7
@@ -1303,10 +1306,10 @@ importers:
version: 0.1.3(zod@3.24.4)
devDependencies:
'@certd/lib-iframe':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../libs/lib-iframe
'@certd/pipeline':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/pipeline
'@rollup/plugin-commonjs':
specifier: ^25.0.7
@@ -1489,46 +1492,46 @@ importers:
specifier: ^3.705.0
version: 3.810.0(aws-crt@1.26.2)
'@certd/acme-client':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/basic
'@certd/commercial-core':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../pro/commercial-core
'@certd/cv4pve-api-javascript':
specifier: ^8.4.2
version: 8.4.2
'@certd/jdcloud':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../libs/lib-jdcloud
'@certd/lib-huawei':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../libs/lib-huawei
'@certd/lib-k8s':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../libs/lib-k8s
'@certd/lib-server':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../libs/lib-server
'@certd/midway-flyway-js':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../libs/midway-flyway-js
'@certd/pipeline':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../core/pipeline
'@certd/plugin-cert':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../plugins/plugin-cert
'@certd/plugin-lib':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../plugins/plugin-lib
'@certd/plugin-plus':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../pro/plugin-plus
'@certd/plus-core':
specifier: ^1.36.22
specifier: ^1.36.24
version: link:../../pro/plus-core
'@huaweicloud/huaweicloud-sdk-cdn':
specifier: ^3.1.120
@@ -1540,38 +1543,38 @@ importers:
specifier: ^5.0.0
version: 5.0.0
'@midwayjs/bootstrap':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
'@midwayjs/cache':
specifier: ~3.14.0
specifier: 3.14.0
version: 3.14.0
'@midwayjs/core':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
'@midwayjs/i18n':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/info':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/koa':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/logger':
specifier: ~3.4.2
specifier: 3.4.2
version: 3.4.2
'@midwayjs/static-file':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/typeorm':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
'@midwayjs/upload':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@midwayjs/validate':
specifier: ~3.20.3
version: 3.20.5
specifier: 3.20.13
version: 3.20.13
'@volcengine/openapi':
specifier: ^1.28.1
version: 1.30.1(buffer@6.0.3)
@@ -1724,8 +1727,8 @@ importers:
version: 10.0.0
devDependencies:
'@midwayjs/mock':
specifier: ~3.20.3
version: 3.20.4
specifier: 3.20.11
version: 3.20.11
'@types/ali-oss':
specifier: ^6.16.11
version: 6.16.11
@@ -3727,12 +3730,12 @@ packages:
resolution: {integrity: sha512-3lBouSuF7CqlseLB+FKES0K4FQ02JrbEoRtJhxnsyB1s5v4AP03gsoohN8jp7DcOImhaR9scYdztq3/sLfk/qQ==}
engines: {node: '>=14.18.0'}
'@midwayjs/async-hooks-context-manager@3.20.4':
resolution: {integrity: sha512-t1Jq+Ykjgk6kDHckMAS5XhQ0wp70hN9tkeXLMqIDQxu1cuNTZnZ8j16cFTXuQRcIB0cprCf3fHrsVlHEAYJVEg==}
'@midwayjs/async-hooks-context-manager@3.20.11':
resolution: {integrity: sha512-pRsHit3tzhl1jSLuvTmjRteqt+bJ6Vj7QQaGrF4mi1hrO7FrNJ/lAIZ8DHa7ndpXEwOt9BQR1xtLYdWGSpbQYw==}
engines: {node: '>=12.17.0'}
'@midwayjs/bootstrap@3.20.4':
resolution: {integrity: sha512-3puwSUrIhzBB0Lig5oNcc8rZVSLY+JpoikBHgyv3jpergdLKD1BCU1IREOT6f53mgMQk6Uo9rem9KSNZeb8vVg==}
'@midwayjs/bootstrap@3.20.11':
resolution: {integrity: sha512-XU4ltfo6b59lowkuO45j/IQ/ySze9Wvf4DIhd85yjZ02TMsHKkYYO7wEWERpXYvUPcTkfchQ23T7V1IIBWlpRA==}
engines: {node: '>=12.11.0'}
'@midwayjs/cache@3.14.0':
@@ -3743,8 +3746,8 @@ packages:
resolution: {integrity: sha512-jcgGZq2+Ty6qkZ5rQF+ViIn6ntV6n/JuvZ/OmgDsAkS+/SyNc3UuNPlUHzzGrrVWgtJq2w8MzjXbl7a3paIVdw==}
engines: {node: '>=10'}
'@midwayjs/core@3.20.4':
resolution: {integrity: sha512-ePwj5XFAzhJXErKh2TnkGi1B+QsIJdoQpef3i/c4NEeW5bjXfDTaQO02lxq/Ln6h6hVHi9lPN3Qh4sS1ufqJPA==}
'@midwayjs/core@3.20.11':
resolution: {integrity: sha512-BF0g2FWDG9ENzWvsWldUq6ABBAupQdpEAkgCRlwceCMUMlyKVCGA+vl9zRYUGcxb0v0fWhyfiACernx7ozeL4Q==}
engines: {node: '>=12'}
'@midwayjs/event-bus@1.11.1':
@@ -3754,45 +3757,45 @@ packages:
'@midwayjs/glob@1.1.1':
resolution: {integrity: sha512-xoNU+JdCxE214KQrB0qgs88+Da7KYVICeuTL9VeKwaxZXj6a/PbpmEaH4+5BHLvZRRe78tHGR19+nKZrmMHBJg==}
'@midwayjs/i18n@3.20.5':
resolution: {integrity: sha512-b1AdEedNvWLJ4Y6SCDMuyidzkPTpEBZelHvZDWWn3nTEyNeQ/E2mDiSGmP8lWibJmy+ByIxmqU+PGIbZQ6DXLA==}
'@midwayjs/i18n@3.20.13':
resolution: {integrity: sha512-zyQTmoMNL56wMfe7nbgnoAsojkDxXn5EXCEnYZ6ePOzOI0h2qinkLMsjCokjju6X9v6udnFOOX17TM/vtQPynw==}
engines: {node: '>=12'}
'@midwayjs/info@3.20.5':
resolution: {integrity: sha512-ioXVmnD+7wx8qOSarWQFy4xacKAgWrUbikq89GUUNbTqfhkWch62gXAmSfcP4XsQQKJoqsuwUsKEciWEul5buQ==}
'@midwayjs/info@3.20.13':
resolution: {integrity: sha512-d9QFtx1u3He9cjLSYygR2DhP035mzqoFvJDwmLspB5lKlNhtAKG5M+c7wlsKFPnRBXpvrbPhsxMS5roz53HJKA==}
engines: {node: '>=12'}
'@midwayjs/koa@3.20.5':
resolution: {integrity: sha512-E5QboNjRuaGtIxPiDbxjE7o5bSVfBgNnCSRCV94qMw3a8y9FACYi/RI58J3WY0qxvnO8sLEZx9ukvV1gY0PfKQ==}
'@midwayjs/koa@3.20.13':
resolution: {integrity: sha512-Y5T6M+XhBm5k9ZeZ8b93TgqWnRuaxHRgHQhDWEgXBdKbr7SFoGWaOIAzZ328/yIXBYQjLIxZ0zOSGoXVGCUDNA==}
engines: {node: '>=12'}
'@midwayjs/logger@3.4.2':
resolution: {integrity: sha512-BxSdSMog4jxeqpHwgauuKZT6iAiu/Vr1HDjO9l81iqU+l8c9veAJVeLT08nTqKdjUiQXnxTaW6nYlvnzF2HdMA==}
engines: {node: '>=10'}
'@midwayjs/mock@3.20.4':
resolution: {integrity: sha512-rjPROfRvbsw+fTOmmKzmkMU6uLSZyFXM5Za2uZ9ud4AS81z+cvf5Q5RmF4ANdu60xkxZ22qUv1LUW2ELhoVKZA==}
'@midwayjs/mock@3.20.11':
resolution: {integrity: sha512-n/yhIjsWMYoThBiQjRJ8uzLh94FfUXy+8Otjy3ZAXl4yoEECKQ22PeThBXJkiITkleIHMU8bOFLjR2bom1oGmA==}
engines: {node: '>=12'}
'@midwayjs/session@3.20.5':
resolution: {integrity: sha512-Eu3VaerT009wAmNCQTMaR3cdDC4PgHLOxKl5+V3Sml0U6P4X7BKOnwJaEPMoWs1PLbKx0MIhrL33LQX2fVInUQ==}
'@midwayjs/session@3.20.11':
resolution: {integrity: sha512-zGuzyGgWVtNEn7TMMUzevQJynFy0WXiZBjLJirbJ6gJcD2c7kog38Ud0FzZUWGckVdT6mpJgg20+SaK+ciVmbQ==}
engines: {node: '>=12'}
'@midwayjs/static-file@3.20.5':
resolution: {integrity: sha512-EjEmqi1Qw3ob0J+UkMdd8T2zrnHTI3bgGTr+ZmXpRcRSGbJMgYU2T50PSCMFS6C8W07iz6cHO2jt4/Hiq9p2OQ==}
'@midwayjs/static-file@3.20.13':
resolution: {integrity: sha512-aX67LvpIPYVWpuhuWSATgTBNvaNbvOFk7wbh0BTS0XRaO6vVieNe0mJoBXFkf89w1qExAHgIPHZDPIoEOHEBiQ==}
engines: {node: '>=12'}
'@midwayjs/typeorm@3.20.4':
resolution: {integrity: sha512-sf+inpoHGZIWbhUYR7O0ItqUyW4e2eKyxdpxnA86U0jtaHP7JszAg71rVQ8u/BthEzgI4FtQEUShRUOR7DB4FQ==}
'@midwayjs/typeorm@3.20.11':
resolution: {integrity: sha512-QMCUwLhQStK1RuF+7hbpHoPOGT5DxIt4YalJNC8KtnaBMsIBVf4W+7dHbk9WpsBBx/GCraKfTYIoPA2wJWVj5g==}
engines: {node: '>=12'}
hasBin: true
'@midwayjs/upload@3.20.5':
resolution: {integrity: sha512-FZIzZcz9MDpDCWLV2A786YUn3MwOr7vs84KOFX8lyPR6wd9ObrBZNAjGNueJZVcNZTLig4akXAdliwfDhSIGPA==}
'@midwayjs/upload@3.20.13':
resolution: {integrity: sha512-oq2GoKnTAnGM+6GyYWFG4N+CR1bSikU98125tFh2LCYlh3Nl6DymDWefOcz9S4zFaray8rmU3WK9Hum4Ub2vLw==}
engines: {node: '>=12'}
'@midwayjs/validate@3.20.5':
resolution: {integrity: sha512-x43MIlZyV5cj15/xdK4EjnvYb2k3DipB1E5Ks9G3f/GmmrNZLomjzaEl1rFOyzCn5S+r7MMu/9oxWz7FfBVNLA==}
'@midwayjs/validate@3.20.13':
resolution: {integrity: sha512-iaumyVf1vdrxhPU1hqVX0Cx4sXYJWP61TzK/DHSAdq5yej9jRGStVyPjXodD3g2iOhY3EW3TInOT2s5RMKxWYw==}
engines: {node: '>=12'}
'@noble/hashes@1.8.0':
@@ -9203,8 +9206,8 @@ packages:
resolution: {integrity: sha512-abVWOHY6z6qSTvNtapWMAnvHS9SUiUCaQQQubClSAT9ybQPsZ6ioKcRarnownS4fMD0sXQgQ5ey8CYEuwoa1Yg==}
engines: {node: '>= 7.6.0'}
koa@2.16.1:
resolution: {integrity: sha512-umfX9d3iuSxTQP4pnzLOz0HKnPg0FaUUIKcye2lOiz3KPu1Y3M3xlz76dISdFPQs37P9eJz1wUpcTS6KDPn9fA==}
koa@2.16.2:
resolution: {integrity: sha512-+CCssgnrWKx9aI3OeZwroa/ckG4JICxvIFnSiOUyl2Uv+UTI+xIw0FfFrWS7cQFpoePpr9o8csss7KzsTzNL8Q==}
engines: {node: ^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4}
kolorist@1.8.0:
@@ -16582,11 +16585,11 @@ snapshots:
jju: 1.4.0
js-yaml: 4.1.0
'@midwayjs/async-hooks-context-manager@3.20.4': {}
'@midwayjs/async-hooks-context-manager@3.20.11': {}
'@midwayjs/bootstrap@3.20.4':
'@midwayjs/bootstrap@3.20.11':
dependencies:
'@midwayjs/async-hooks-context-manager': 3.20.4
'@midwayjs/async-hooks-context-manager': 3.20.11
'@midwayjs/event-bus': 1.11.1
'@midwayjs/cache@3.14.0':
@@ -16598,7 +16601,7 @@ snapshots:
scmp: 2.1.0
should-send-same-site-none: 2.0.5
'@midwayjs/core@3.20.4':
'@midwayjs/core@3.20.11':
dependencies:
'@midwayjs/glob': 1.1.1
class-transformer: 0.5.1
@@ -16611,23 +16614,23 @@ snapshots:
dependencies:
picomatch: 2.3.1
'@midwayjs/i18n@3.20.5':
'@midwayjs/i18n@3.20.13':
dependencies:
picomatch: 2.3.1
'@midwayjs/info@3.20.5':
'@midwayjs/info@3.20.13':
dependencies:
picomatch: 2.3.1
'@midwayjs/koa@3.20.5':
'@midwayjs/koa@3.20.13':
dependencies:
'@koa/router': 12.0.2
'@midwayjs/cookies': 1.3.0
'@midwayjs/core': 3.20.4
'@midwayjs/session': 3.20.5
'@midwayjs/core': 3.20.11
'@midwayjs/session': 3.20.11
'@types/koa': 2.15.0
'@types/qs': 6.9.18
koa: 2.16.1
koa: 2.16.2
koa-bodyparser: 4.4.1
qs: 6.14.0
transitivePeerDependencies:
@@ -16638,9 +16641,9 @@ snapshots:
dayjs: 1.11.13
safe-stable-stringify: 2.5.0
'@midwayjs/mock@3.20.4':
'@midwayjs/mock@3.20.11':
dependencies:
'@midwayjs/async-hooks-context-manager': 3.20.4
'@midwayjs/async-hooks-context-manager': 3.20.11
'@types/superagent': 4.1.14
'@types/supertest': 2.0.16
js-yaml: 4.1.0
@@ -16649,11 +16652,11 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@midwayjs/session@3.20.5':
'@midwayjs/session@3.20.11':
dependencies:
'@midwayjs/cookies': 1.3.0
'@midwayjs/static-file@3.20.5':
'@midwayjs/static-file@3.20.13':
dependencies:
koa-range: 0.3.0
koa-static-cache: 5.1.4
@@ -16661,16 +16664,16 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@midwayjs/typeorm@3.20.4': {}
'@midwayjs/typeorm@3.20.11': {}
'@midwayjs/upload@3.20.5':
'@midwayjs/upload@3.20.13':
dependencies:
file-type: 16.5.4
raw-body: 2.5.2
'@midwayjs/validate@3.20.5':
'@midwayjs/validate@3.20.13':
dependencies:
'@midwayjs/i18n': 3.20.5
'@midwayjs/i18n': 3.20.13
joi: 17.13.3
'@noble/hashes@1.8.0': {}
@@ -18157,7 +18160,7 @@ snapshots:
'@types/superagent@4.1.14':
dependencies:
'@types/cookiejar': 2.1.5
'@types/node': 18.19.100
'@types/node': 20.17.47
'@types/supertest@2.0.16':
dependencies:
@@ -23531,7 +23534,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
koa@2.16.1:
koa@2.16.2:
dependencies:
accepts: 1.3.8
cache-content-type: 1.0.1

View File

@@ -1,6 +1,7 @@
import fs from 'fs'
import childProcess from 'child_process';
import { join } from "path";
function check(){
const gitAdd = fs.readFileSync("./node_modules/@lerna-lite/version/dist/lib/git-add.js","utf-8")
if(gitAdd.indexOf("('git', ['add', '.']") > -1){
@@ -19,4 +20,73 @@ function check(){
}
}
function checkDist(){
function scanDir(root,excludes,stopDirName = "src"){
//扫描文件,忽略node_modules
const files = fs.readdirSync(root)
const dirs = []
for (const file of files) {
if (excludes.includes(file)) {
continue;
}
const filePath = join(root, file);
if (!fs.statSync(filePath).isDirectory()) {
continue;
}
if(file === stopDirName){
dirs.push(filePath)
continue;
}
const res = scanDir(filePath,excludes,stopDirName)
for (const item of res){
dirs.push(item)
}
}
return dirs
}
const srcDirs = scanDir("./packages",["node_modules",".git","dist","certd-client"],"src")
console.log("检查dist",srcDirs)
//检查包含 import xxx from "*/dist/*"
const hasDistFiles = []
for (const srcDir of srcDirs) {
const files = fs.readdirSync(srcDir,{recursive:true})
for (const file of files) {
const filePath = join(srcDir, file);
if(!file.endsWith(".ts")){
continue;
}
const content = fs.readFileSync(filePath,"utf-8")
const lines = content.split("\n")
for (const line of lines) {
if( line.indexOf("@certd")>-1 && line.indexOf("dist") > -1){
hasDistFiles.push({
filepath:filePath,
line: line
})
break;
}
}
}
}
if(hasDistFiles.length > 0){
console.error("dist文件被引用")
console.error(hasDistFiles)
throw new Error("dist文件被引用")
} else {
console.log("dist检查通过 √")
}
}
checkDist()
check()

1
trigger/build.trigger Normal file
View File

@@ -0,0 +1 @@
555

View File

@@ -1,2 +1 @@
4

1
trigger/release.trigger Normal file
View File

@@ -0,0 +1 @@
666