Compare commits

..

9 Commits

Author SHA1 Message Date
xiaojunnuo
1bde777bee v1.36.3 2025-07-07 22:20:26 +08:00
xiaojunnuo
fa4f5df3e7 build: prepare to build 2025-07-07 22:18:24 +08:00
xiaojunnuo
8a3c3810e0 build: prepare to build 2025-07-07 22:14:35 +08:00
xiaojunnuo
144532530a perf: 优化部署到腾讯TKE插件,支持Opaque类型选择,优化填写说明 2025-07-07 21:30:45 +08:00
xiaojunnuo
0f1129e19b chore: 2025-07-07 18:20:25 +08:00
xiaojunnuo
1f74580f15 chore: cname的key转为小写 2025-07-07 16:27:25 +08:00
xiaojunnuo
f93ba9970c fix: 修复开放接口添加按钮文本显示问题 2025-07-07 14:21:00 +08:00
xiaojunnuo
f87a3d0892 build: publish 2025-07-07 00:47:44 +08:00
xiaojunnuo
c661ad67d0 build: trigger build image 2025-07-07 00:47:26 +08:00
39 changed files with 316 additions and 207 deletions

View File

@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
### Bug Fixes
* 修复开放接口添加按钮文本显示问题 ([f93ba99](https://github.com/certd/certd/commit/f93ba9970c12680f38eba2a7abd4b72cf3f5b6a6))
### Performance Improvements
* 优化部署到腾讯TKE插件支持Opaque类型选择优化填写说明 ([1445325](https://github.com/certd/certd/commit/144532530a865b634e68539e4888e26f52f73492))
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
### Bug Fixes

View File

@@ -1 +1 @@
23:01
00:47

View File

@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
### Bug Fixes
* 修复notification编辑按钮无法打开对话框的bug ([0cea26c](https://github.com/certd/certd/commit/0cea26c6287f52adf273b4a525c37bea8555c68c))
* 优化更新飞牛os证书有效期修复某些情况下部署证书后飞牛无法访问https的bug ([610c919](https://github.com/certd/certd/commit/610c919c72037becc0ed326f5d5b18c963dfcb3a))
### Performance Improvements
* 证书检查支持自定义dns服务器 ([c53bb7c](https://github.com/certd/certd/commit/c53bb7cf677faa32729709ae0c10359db5194d7a))
## [1.36.1](https://github.com/certd/certd/compare/v1.36.0...v1.36.1) (2025-07-02)
### Bug Fixes

View File

@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.36.2"
"version": "1.36.3"
}

View File

@@ -28,6 +28,7 @@
"deploy1": "node --experimental-json-modules deploy.js ",
"check": "node --experimental-json-modules publish-check.js",
"init": "lerna run build",
"init:dev": "lerna run build",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/publishlab/node-acme-client/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/acme-client
## [1.36.2](https://github.com/publishlab/node-acme-client/compare/v1.36.1...v1.36.2) (2025-07-06)
**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.2",
"version": "1.36.3",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.36.2",
"@certd/basic": "^1.36.3",
"@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": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/basic
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
### Performance Improvements

View File

@@ -1 +1 @@
00:43
22:18

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.36.2",
"version": "1.36.3",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -45,5 +45,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/pipeline
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
**Note:** Version bump only for package @certd/pipeline

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.36.2",
"version": "1.36.3",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -17,8 +17,8 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.36.2",
"@certd/plus-core": "^1.36.1",
"@certd/basic": "^1.36.3",
"@certd/plus-core": "^1.36.3",
"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": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/lib-huawei
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
**Note:** Version bump only for package @certd/lib-huawei

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.36.2",
"version": "1.36.3",
"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": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/lib-iframe
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
**Note:** Version bump only for package @certd/lib-iframe

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.36.2",
"version": "1.36.3",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/jdcloud
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
**Note:** Version bump only for package @certd/jdcloud

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/jdcloud",
"version": "1.36.2",
"version": "1.36.3",
"description": "jdcloud openApi sdk",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
@@ -61,5 +61,5 @@
"fetch"
]
},
"gitHead": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/lib-k8s
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
**Note:** Version bump only for package @certd/lib-k8s

View File

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

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/lib-server
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
**Note:** Version bump only for package @certd/lib-server

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.36.2",
"version": "1.36.3",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -27,10 +27,10 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.36.2",
"@certd/basic": "^1.36.2",
"@certd/pipeline": "^1.36.2",
"@certd/plus-core": "^1.36.1",
"@certd/acme-client": "^1.36.3",
"@certd/basic": "^1.36.3",
"@certd/pipeline": "^1.36.3",
"@certd/plus-core": "^1.36.3",
"@midwayjs/cache": "~3.14.0",
"@midwayjs/core": "~3.20.3",
"@midwayjs/i18n": "~3.20.3",
@@ -61,5 +61,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.36.2",
"version": "1.36.3",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/plugin-cert
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
**Note:** Version bump only for package @certd/plugin-cert

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.36.2",
"version": "1.36.3",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -16,10 +16,10 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/acme-client": "^1.36.2",
"@certd/basic": "^1.36.2",
"@certd/pipeline": "^1.36.2",
"@certd/plugin-lib": "^1.36.2",
"@certd/acme-client": "^1.36.3",
"@certd/basic": "^1.36.3",
"@certd/pipeline": "^1.36.3",
"@certd/plugin-lib": "^1.36.3",
"@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": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -321,7 +321,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
name: "a-input-number",
vModel: "value",
},
helper: "等待解析生效时长(秒)",
helper: "等待解析生效时长(秒)如果使用CNAME方式校验本地验证失败可以尝试延长此时间比如5-10分钟",
})
waitDnsDiffuseTime = 30;

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
**Note:** Version bump only for package @certd/plugin-lib
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
**Note:** Version bump only for package @certd/plugin-lib

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.36.2",
"version": "1.36.3",
"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.2",
"@certd/pipeline": "^1.36.2",
"@certd/basic": "^1.36.3",
"@certd/pipeline": "^1.36.3",
"@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": "8671887abcdfb93a7ecb709f223bd6add6f03c67"
"gitHead": "ce4dc9e3fa1af0702398c6f3809d33ced8cec284"
}

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
### Bug Fixes
* 修复开放接口添加按钮文本显示问题 ([f93ba99](https://github.com/certd/certd/commit/f93ba9970c12680f38eba2a7abd4b72cf3f5b6a6))
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
### Bug Fixes

View File

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

View File

@@ -273,8 +273,7 @@ export default {
monitorCronSetting: "Monitoring Schedule",
cronTrigger: "Scheduled trigger for monitoring",
dnsServer: "DNS Server",
// dnsServerHelper: "使用自定义的域名解析服务器1.1.1.1,8.8.8.8",
dnsServerHelper: "Use a custom domain name resolution server, such as: 1.1.1.1,8.8.8.8",
dnsServerHelper: "Use a custom domain name resolution server, such as: 1.1.1.1 , support multiple",
},
},
checkStatus: {

View File

@@ -278,7 +278,7 @@ export default {
monitorCronSetting: "监控定时设置",
cronTrigger: "定时触发监控",
dnsServer: "DNS服务器",
dnsServerHelper: "使用自定义的域名解析服务器1.1.1.1,8.8.8.8",
dnsServerHelper: "使用自定义的域名解析服务器1.1.1.1 , 支持多个",
},
},
checkStatus: {

View File

@@ -53,13 +53,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
width: 600,
},
},
actionbar: {
buttons: {
add: {
text: t("certd.actionbar.add"),
},
},
},
actionbar: {},
rowHandle: {
width: 300,
fixed: "right",

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.36.3](https://github.com/certd/certd/compare/v1.36.2...v1.36.3) (2025-07-07)
### Performance Improvements
* 优化部署到腾讯TKE插件支持Opaque类型选择优化填写说明 ([1445325](https://github.com/certd/certd/commit/144532530a865b634e68539e4888e26f52f73492))
## [1.36.2](https://github.com/certd/certd/compare/v1.36.1...v1.36.2) (2025-07-06)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.36.2",
"version": "1.36.3",
"description": "fast-server base midway",
"private": true,
"type": "module",
@@ -42,20 +42,20 @@
"@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.2",
"@certd/basic": "^1.36.2",
"@certd/commercial-core": "^1.36.1",
"@certd/acme-client": "^1.36.3",
"@certd/basic": "^1.36.3",
"@certd/commercial-core": "^1.36.3",
"@certd/cv4pve-api-javascript": "^8.4.1",
"@certd/jdcloud": "^1.36.2",
"@certd/lib-huawei": "^1.36.2",
"@certd/lib-k8s": "^1.36.2",
"@certd/lib-server": "^1.36.2",
"@certd/midway-flyway-js": "^1.36.2",
"@certd/pipeline": "^1.36.2",
"@certd/plugin-cert": "^1.36.2",
"@certd/plugin-lib": "^1.36.2",
"@certd/plugin-plus": "^1.36.1",
"@certd/plus-core": "^1.36.1",
"@certd/jdcloud": "^1.36.3",
"@certd/lib-huawei": "^1.36.3",
"@certd/lib-k8s": "^1.36.3",
"@certd/lib-server": "^1.36.3",
"@certd/midway-flyway-js": "^1.36.3",
"@certd/pipeline": "^1.36.3",
"@certd/plugin-cert": "^1.36.3",
"@certd/plugin-lib": "^1.36.3",
"@certd/plugin-plus": "^1.36.3",
"@certd/plus-core": "^1.36.3",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
"@koa/cors": "^5.0.0",

View File

@@ -100,7 +100,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
}
param.hostRecord = hostRecord;
const cnameKey = utils.id.simpleNanoId();
const cnameKey = utils.id.simpleNanoId().toLowerCase();
const safeDomain = param.domain.replaceAll('.', '-');
param.recordValue = `${safeDomain}.${cnameKey}.${cnameProvider.domain}`;
}

View File

@@ -1,101 +1,77 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { utils } from "@certd/basic";
import dayjs from "dayjs";
import { CertApplyPluginNames } from "@certd/plugin-cert";
import yaml from "js-yaml";
@IsTaskPlugin({
name: 'DeployCertToTencentTKEIngress',
title: '腾讯云-部署到TKE-ingress',
name: "DeployCertToTencentTKEIngress",
title: "腾讯云-部署到TKE",
needPlus: false,
icon: 'svg:icon-tencentcloud',
icon: "svg:icon-tencentcloud",
group: pluginGroups.tencent.key,
desc: 'serverless集群请使用K8S部署插件Qcloud类型需要【上传到腾讯云】作为前置任务ApiServer未开启外网访问则需要做域名的内网IP映射',
desc: "修改TKE集群密钥配置支持Opaque和TLS证书类型。注意\n1. serverless集群请使用K8S部署插件\n2. Opaque类型需要【上传到腾讯云】作为前置任务;\n3. ApiServer需要开通公网访问或者certd可访问实际上底层仍然是通过KubeClient进行部署",
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,
},
},
runStrategy: RunStrategy.SkipWhenSucceed
}
}
})
export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
@TaskInput({ title: '大区', value: 'ap-guangzhou', required: true })
region!: string;
@TaskInput({
title: '集群ID',
required: true,
desc: '例如cls-6lbj1vee',
request: true,
})
clusterId!: string;
@TaskInput({ title: '集群namespace', value: 'default', required: true })
namespace!: string;
@TaskInput({ title: '证书的secret名称', required: true })
secretName!: string | string[];
@TaskInput({ title: 'ingress名称', required: true })
ingressName!: string | string[];
@TaskInput({
title: 'ingress类型',
title: "ingress证书类型",
component: {
name: 'a-auto-complete',
vModel: 'value',
options: [{ value: 'qcloud' }, { value: 'nginx' }],
name: "a-select",
vModel: "value",
options: [{ value: "nginx", label: "TLS证书格式Nginx可用" }, {
value: "qcloud",
label: "Opaque格式CLB可用原qcloud"
}]
},
helper: '可选 qcloud / nginx',
helper: "clb将部署Opaque类型的证书nginx类型将部署TLS证书格式",
required: true
})
ingressClass!: string;
// @TaskInput({ title: "集群内网ip", helper: "如果开启了外网的话,无需设置" })
// clusterIp!: string;
@TaskInput({
title: '集群域名',
helper: '可不填,默认为:[clusterId].ccs.tencent-cloud.com',
})
clusterDomain!: string;
/**
* AccessProvider的key,或者一个包含access的具体的对象
*/
@TaskInput({
title: 'Access授权',
helper: 'access授权',
title: "Access授权",
helper: "access授权",
component: {
name: 'access-selector',
type: 'tencent',
name: "access-selector",
type: "tencent"
},
required: true,
required: true
})
accessId!: string;
@TaskInput({
title: '腾讯云证书id',
helper: '请选择“上传证书到腾讯云”前置任务的输出',
title: "腾讯云证书id",
helper: "请选择“上传证书到腾讯云”前置任务的输出",
component: {
name: 'output-selector',
from: 'UploadCertToTencent',
name: "output-selector",
from: "UploadCertToTencent"
},
mergeScript: `
return {
show: ctx.compute(({form})=>{
return form.ingressClass === "qcloud"
return form.ingressClass === "qcloud"|| form.ingressClass === "clb"
})
}
`,
required: true,
required: true
})
tencentCertId!: string;
@TaskInput({
title: '域名证书',
helper: '请选择前置任务输出的域名证书',
title: "域名证书",
helper: "请选择前置任务输出的域名证书",
component: {
name: 'output-selector',
from: [...CertApplyPluginNames],
name: "output-selector",
from: [...CertApplyPluginNames]
},
mergeScript: `
return {
@@ -104,26 +80,90 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
})
}
`,
required: true,
required: true
})
cert!: any;
@TaskInput({ title: "大区", value: "ap-guangzhou", required: true })
region!: string;
@TaskInput({
title: "集群ID",
required: true,
desc: "例如cls-6lbj1vee",
request: true
})
clusterId!: string;
@TaskInput({ title: "集群namespace", value: "default", required: true })
namespace!: string;
@TaskInput({
title: "证书的secret名称",
helper: "集群->配置管理->Secret,复制名称",
required: true,
component: {
name: "a-select",
vModel: "value",
mode: "tags",
open: false
}
})
secretName!: string | string[];
@TaskInput({
title: "集群域名",
helper: "ApiServer需要开通公网访问填写`ApiServer公网IP:443`\n默认为:[clusterId].ccs.tencent-cloud.com可能访问不通",
component: {
placeholder: "xx.xxx.xx.xx:443"
}
})
clusterDomain!: string;
@TaskInput({
title: "ingress名称",
required: false,
helper: "填写之后会自动重启ingress",
component: {
name: "a-select",
vModel: "value",
mode: "tags",
open: false
}
})
ingressName!: string | string[];
// @TaskInput({ title: "集群内网ip", helper: "如果开启了外网的话,无需设置" })
// clusterIp!: string;
K8sClient: any;
async onInstance() {
// const TkeClient = this.tencentcloud.tke.v20180525.Client;
const k8sSdk = await import('@certd/lib-k8s');
const k8sSdk = await import("@certd/lib-k8s");
this.K8sClient = k8sSdk.K8sClient;
}
async execute(): Promise<void> {
const accessProvider = await this.getAccess(this.accessId);
const tkeClient = await this.getTkeClient(accessProvider, this.region);
const kubeConfigStr = await this.getTkeKubeConfig(tkeClient, this.clusterId);
let kubeConfigStr = await this.getTkeKubeConfig(tkeClient, this.clusterId);
this.logger.info('kubeconfig已成功获取');
if (this.clusterDomain) {
const kubeConfig = yaml.load(kubeConfigStr);
kubeConfig.clusters[0].cluster.server = `https://${this.clusterDomain}`;
kubeConfigStr = yaml.dump(kubeConfig);
}
this.logger.info("kubeconfig已成功获取");
const k8sClient = new this.K8sClient({
kubeConfigStr,
logger: this.logger,
logger: this.logger
});
// if (this.clusterIp != null) {
// if (!this.clusterDomain) {
@@ -132,31 +172,34 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
// // 修改内网解析ip地址
// k8sClient.setLookup({ [this.clusterDomain]: { ip: this.clusterIp } });
// }
const ingressType = this.ingressClass || 'qcloud';
if (ingressType === 'qcloud') {
const ingressType = this.ingressClass || "qcloud";
if (ingressType === "qcloud" || ingressType === "clb") {
await this.patchQcloudCertSecret({ k8sClient });
} else {
await this.patchNginxCertSecret({ k8sClient });
}
await utils.sleep(5000); // 停留2秒等待secret部署完成
await this.restartIngress({ k8sClient });
if (this.ingressName) {
this.logger.info("正在重启ingress:", this.ingressName);
await this.restartIngress({ k8sClient });
}
}
async getTkeClient(accessProvider: any, region = 'ap-guangzhou') {
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/tke/v20180525/index.js');
async getTkeClient(accessProvider: any, region = "ap-guangzhou") {
const sdk = await import("tencentcloud-sdk-nodejs/tencentcloud/services/tke/v20180525/index.js");
const TkeClient = sdk.v20180525.Client;
const clientConfig = {
credential: {
secretId: accessProvider.secretId,
secretKey: accessProvider.secretKey,
secretKey: accessProvider.secretKey
},
region,
profile: {
httpProfile: {
endpoint: 'tke.tencentcloudapi.com',
},
},
endpoint: "tke.tencentcloudapi.com"
}
}
};
return new TkeClient(clientConfig);
@@ -165,49 +208,42 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
async getTkeKubeConfig(client: any, clusterId: string) {
// Depends on tencentcloud-sdk-nodejs version 4.0.3 or higher
const params = {
ClusterId: clusterId,
ClusterId: clusterId
};
const ret = await client.DescribeClusterKubeconfig(params);
this.checkRet(ret);
this.logger.info('注意:后续操作需要在【集群->基本信息】中开启外网或内网访问,https://console.cloud.tencent.com/tke2/cluster');
this.logger.info("注意:后续操作需要在【集群->基本信息】中开启外网或内网访问,https://console.cloud.tencent.com/tke2/cluster");
return ret.Kubeconfig;
}
appendTimeSuffix(name: string) {
if (name == null) {
name = 'certd';
}
return name + '-' + dayjs().format('YYYYMMDD-HHmmss');
}
async patchQcloudCertSecret(options: { k8sClient: any }) {
if (this.tencentCertId == null) {
throw new Error('请先将【上传证书到腾讯云】作为前置任务');
throw new Error("请先将【上传证书到腾讯云】作为前置任务");
}
this.logger.info('腾讯云证书ID:', this.tencentCertId);
const certIdBase64 = Buffer.from(this.tencentCertId).toString('base64');
this.logger.info("腾讯云证书ID:", this.tencentCertId);
const certIdBase64 = Buffer.from(this.tencentCertId).toString("base64");
const { namespace, secretName } = this;
const body = {
data: {
qcloud_cert_id: certIdBase64,
qcloud_cert_id: certIdBase64
},
metadata: {
labels: {
certd: this.appendTimeSuffix('certd'),
},
},
certd: this.appendTimeSuffix("certd")
}
}
};
let secretNames: any = secretName;
if (typeof secretName === 'string') {
if (typeof secretName === "string") {
secretNames = [secretName];
}
for (const secret of secretNames) {
await options.k8sClient.patchSecret({
namespace,
secretName: secret,
body,
body
});
this.logger.info(`CertSecret已更新:${secret}`);
}
@@ -218,24 +254,24 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
const { cert } = this;
const crt = cert.crt;
const key = cert.key;
const crtBase64 = Buffer.from(crt).toString('base64');
const keyBase64 = Buffer.from(key).toString('base64');
const crtBase64 = Buffer.from(crt).toString("base64");
const keyBase64 = Buffer.from(key).toString("base64");
const { namespace, secretName } = this;
const body = {
data: {
'tls.crt': crtBase64,
'tls.key': keyBase64,
"tls.crt": crtBase64,
"tls.key": keyBase64
},
metadata: {
labels: {
certd: this.appendTimeSuffix('certd'),
},
},
certd: this.appendTimeSuffix("certd")
}
}
};
let secretNames = secretName;
if (typeof secretName === 'string') {
if (typeof secretName === "string") {
secretNames = [secretName];
}
for (const secret of secretNames) {
@@ -251,12 +287,12 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
const body = {
metadata: {
labels: {
certd: this.appendTimeSuffix('certd'),
},
},
certd: this.appendTimeSuffix("certd")
}
}
};
let ingressNames = this.ingressName;
if (typeof ingressName === 'string') {
let ingressNames = this.ingressName || [];
if (typeof ingressName === "string") {
ingressNames = [ingressName];
}
for (const ingress of ingressNames) {
@@ -264,9 +300,11 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
this.logger.info(`ingress已重启:${ingress}`);
}
}
checkRet(ret: any) {
if (!ret || ret.Error) {
throw new Error('执行失败:' + ret.Error.Code + ',' + ret.Error.Message);
throw new Error("执行失败:" + ret.Error.Code + "," + ret.Error.Message);
}
}
}

72
pnpm-lock.yaml generated
View File

@@ -46,7 +46,7 @@ importers:
packages/core/acme-client:
dependencies:
'@certd/basic':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../basic
'@peculiar/x509':
specifier: ^1.11.0
@@ -207,7 +207,7 @@ importers:
packages/core/pipeline:
dependencies:
'@certd/basic':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../basic
'@certd/plus-core':
specifier: ^1.36.1
@@ -415,7 +415,7 @@ importers:
packages/libs/lib-k8s:
dependencies:
'@certd/basic':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/basic
'@kubernetes/client-node':
specifier: 0.21.0
@@ -455,13 +455,13 @@ importers:
packages/libs/lib-server:
dependencies:
'@certd/acme-client':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/pipeline
'@certd/plus-core':
specifier: ^1.36.1
@@ -607,16 +607,16 @@ importers:
packages/plugins/plugin-cert:
dependencies:
'@certd/acme-client':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/pipeline
'@certd/plugin-lib':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../plugin-lib
'@google-cloud/publicca':
specifier: ^1.3.0
@@ -698,10 +698,10 @@ importers:
specifier: ^3.787.0
version: 3.810.0(aws-crt@1.26.2)
'@certd/basic':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/pipeline
'@kubernetes/client-node':
specifier: 0.21.0
@@ -789,19 +789,19 @@ importers:
packages/pro/commercial-core:
dependencies:
'@certd/basic':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../../core/basic
'@certd/lib-server':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../../libs/lib-server
'@certd/pipeline':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../../core/pipeline
'@certd/plugin-plus':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../plugin-plus
'@certd/plus-core':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../plus-core
'@midwayjs/core':
specifier: ~3.20.3
@@ -886,22 +886,22 @@ importers:
specifier: ^1.0.2
version: 1.0.3
'@certd/basic':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../../core/basic
'@certd/lib-k8s':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../../libs/lib-k8s
'@certd/pipeline':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../../core/pipeline
'@certd/plugin-cert':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../../plugins/plugin-cert
'@certd/plugin-lib':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../../plugins/plugin-lib
'@certd/plus-core':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../plus-core
ali-oss:
specifier: ^6.21.0
@@ -1004,7 +1004,7 @@ importers:
packages/pro/plus-core:
dependencies:
'@certd/basic':
specifier: ^1.36.0
specifier: ^1.36.1
version: link:../../core/basic
dayjs:
specifier: ^1.11.7
@@ -1294,10 +1294,10 @@ importers:
version: 0.1.3(zod@3.24.4)
devDependencies:
'@certd/lib-iframe':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../libs/lib-iframe
'@certd/pipeline':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/pipeline
'@rollup/plugin-commonjs':
specifier: ^25.0.7
@@ -1480,10 +1480,10 @@ importers:
specifier: ^3.705.0
version: 3.810.0(aws-crt@1.26.2)
'@certd/acme-client':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/basic
'@certd/commercial-core':
specifier: ^1.36.1
@@ -1492,28 +1492,28 @@ importers:
specifier: ^8.4.1
version: 8.4.1
'@certd/jdcloud':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../libs/lib-jdcloud
'@certd/lib-huawei':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../libs/lib-huawei
'@certd/lib-k8s':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../libs/lib-k8s
'@certd/lib-server':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../libs/lib-server
'@certd/midway-flyway-js':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../libs/midway-flyway-js
'@certd/pipeline':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../core/pipeline
'@certd/plugin-cert':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../plugins/plugin-cert
'@certd/plugin-lib':
specifier: ^1.36.1
specifier: ^1.36.2
version: link:../../plugins/plugin-lib
'@certd/plugin-plus':
specifier: ^1.36.1