Compare commits

...
11 Commits
68 changed files with 522 additions and 337 deletions
+15
View File
@@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
### Bug Fixes
* 修复部署到openwrt错误的bug ([9ac33f9](https://github.com/certd/certd/commit/9ac33f9b9ba7727fcbbd320dd866bc048cbb3d72))
* 修复新版本上传到阿里云cas后,其他依赖任务无法部署的bug ([99f5b8e](https://github.com/certd/certd/commit/99f5b8ebc1c64798ceb42042ad71cf71e967beb0))
* esxi部署失败的bug ([6ab1fca](https://github.com/certd/certd/commit/6ab1fcaf894f7ce343af4b5bf4b0d67438df6618))
### Performance Improvements
* 修改sql升级语句,兼容mysql5.7 ([02f89a9](https://github.com/certd/certd/commit/02f89a9c9d77850437285844670aed441e5953c3))
* 已登录状态访问登录页面自动跳转到首页 ([bd8caff](https://github.com/certd/certd/commit/bd8caff0b754cb13530cf0f1644b33e29fde5d01))
* 优化access授权支持remote-auto-complete ([2f40f79](https://github.com/certd/certd/commit/2f40f795ee6131132d3fab2601f92a567bbdc4b7))
* access 插件支持remote-select等配置 ([d286c04](https://github.com/certd/certd/commit/d286c040a5232dcca829945734affead3ee08b3c))
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements ### Performance Improvements
+1 -1
View File
@@ -62,7 +62,7 @@ services:
# - certd_typeorm_dataSource_default_password=yourpasswd # 密码 # - certd_typeorm_dataSource_default_password=yourpasswd # 密码
# - certd_typeorm_dataSource_default_database=certd # 数据库名 # - certd_typeorm_dataSource_default_database=certd # 数据库名
# #↓↓↓↓ ----------------------------- 使用mysql数据库,需要提前创建数据库 charset=utf8mb4, collation=utf8mb4_bin # #↓↓↓↓ ----------------------------- 使用mysql8数据库,需要提前创建数据库 charset=utf8mb4, collation=utf8mb4_bin
# - certd_flyway_scriptDir=./db/migration-mysql # 升级脚本目录 # - certd_flyway_scriptDir=./db/migration-mysql # 升级脚本目录
# - certd_typeorm_dataSource_default_type=mysql # 数据库类型, 或者 mariadb # - certd_typeorm_dataSource_default_type=mysql # 数据库类型, 或者 mariadb
# - certd_typeorm_dataSource_default_host=localhost # 数据库地址 # - certd_typeorm_dataSource_default_host=localhost # 数据库地址
+1 -1
View File
@@ -58,7 +58,7 @@
| 3.| **Dokploy-部署server证书** | 自动更新Dokploy server证书 | | 3.| **Dokploy-部署server证书** | 自动更新Dokploy server证书 |
| 4.| **飞牛NAS-部署证书** | | | 4.| **飞牛NAS-部署证书** | |
| 5.| **1Panel-部署面板证书** | 更新1Panel的面板证书 | | 5.| **1Panel-部署面板证书** | 更新1Panel的面板证书 |
| 6.| **1Panel-更新证书** | 更新1Panel的证书,包括面板证书和站点证书 | | 6.| **1Panel-更新站点证书** | 更新1Panel的站点证书 |
| 7.| **宝塔-删除过期证书** | 删除证书夹中过期证书 | | 7.| **宝塔-删除过期证书** | 删除证书夹中过期证书 |
| 8.| **宝塔-WAF证书部署** | 部署宝塔云WAF/aaWAF | | 8.| **宝塔-WAF证书部署** | 部署宝塔云WAF/aaWAF |
| 9.| **宝塔-面板证书部署** | 部署宝塔面板本身的ssl证书 | | 9.| **宝塔-面板证书部署** | 部署宝塔面板本身的ssl证书 |
+1 -1
View File
@@ -9,5 +9,5 @@
} }
}, },
"npmClient": "pnpm", "npmClient": "pnpm",
"version": "1.38.8" "version": "1.38.9"
} }
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/publishlab/node-acme-client/compare/v1.38.8...v1.38.9) (2026-02-09)
**Note:** Version bump only for package @certd/acme-client
## [1.38.8](https://github.com/publishlab/node-acme-client/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/publishlab/node-acme-client/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements ### Performance Improvements
+2 -2
View File
@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client", "description": "Simple and unopinionated ACME client",
"private": false, "private": false,
"author": "nmorsman", "author": "nmorsman",
"version": "1.38.8", "version": "1.38.9",
"type": "module", "type": "module",
"module": "scr/index.js", "module": "scr/index.js",
"main": "src/index.js", "main": "src/index.js",
@@ -18,7 +18,7 @@
"types" "types"
], ],
"dependencies": { "dependencies": {
"@certd/basic": "^1.38.8", "@certd/basic": "^1.38.9",
"@peculiar/x509": "^1.11.0", "@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5", "asn1js": "^3.0.5",
"axios": "^1.9.0", "axios": "^1.9.0",
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
### Bug Fixes
* esxi部署失败的bug ([6ab1fca](https://github.com/certd/certd/commit/6ab1fcaf894f7ce343af4b5bf4b0d67438df6618))
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/basic **Note:** Version bump only for package @certd/basic
+1 -1
View File
@@ -1 +1 @@
02:23 23:08
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/basic", "name": "@certd/basic",
"private": false, "private": false,
"version": "1.38.8", "version": "1.38.9",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
+1 -1
View File
@@ -1,4 +1,4 @@
import * as _ from 'lodash-es'; import * as _ from "lodash-es";
function isUnMergeable(srcValue: any) { function isUnMergeable(srcValue: any) {
return srcValue != null && srcValue instanceof UnMergeable; return srcValue != null && srcValue instanceof UnMergeable;
} }
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
**Note:** Version bump only for package @certd/pipeline
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/pipeline **Note:** Version bump only for package @certd/pipeline
+3 -3
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/pipeline", "name": "@certd/pipeline",
"private": false, "private": false,
"version": "1.38.8", "version": "1.38.9",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -18,8 +18,8 @@
"compile": "tsc --skipLibCheck --watch" "compile": "tsc --skipLibCheck --watch"
}, },
"dependencies": { "dependencies": {
"@certd/basic": "^1.38.8", "@certd/basic": "^1.38.9",
"@certd/plus-core": "^1.38.8", "@certd/plus-core": "^1.38.9",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13" "reflect-metadata": "^0.1.13"
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
**Note:** Version bump only for package @certd/lib-huawei
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/lib-huawei **Note:** Version bump only for package @certd/lib-huawei
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-huawei", "name": "@certd/lib-huawei",
"private": false, "private": false,
"version": "1.38.8", "version": "1.38.9",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts", "types": "./dist/d/index.d.ts",
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
**Note:** Version bump only for package @certd/lib-iframe
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/lib-iframe **Note:** Version bump only for package @certd/lib-iframe
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-iframe", "name": "@certd/lib-iframe",
"private": false, "private": false,
"version": "1.38.8", "version": "1.38.9",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
**Note:** Version bump only for package @certd/jdcloud
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/jdcloud **Note:** Version bump only for package @certd/jdcloud
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/jdcloud", "name": "@certd/jdcloud",
"version": "1.38.8", "version": "1.38.9",
"description": "jdcloud openApi sdk", "description": "jdcloud openApi sdk",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
**Note:** Version bump only for package @certd/lib-k8s
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/lib-k8s **Note:** Version bump only for package @certd/lib-k8s
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-k8s", "name": "@certd/lib-k8s",
"private": false, "private": false,
"version": "1.38.8", "version": "1.38.9",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -17,7 +17,7 @@
"pub": "npm publish" "pub": "npm publish"
}, },
"dependencies": { "dependencies": {
"@certd/basic": "^1.38.8", "@certd/basic": "^1.38.9",
"@kubernetes/client-node": "0.21.0" "@kubernetes/client-node": "0.21.0"
}, },
"devDependencies": { "devDependencies": {
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
**Note:** Version bump only for package @certd/lib-server
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements ### Performance Improvements
+6 -6
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/lib-server", "name": "@certd/lib-server",
"version": "1.38.8", "version": "1.38.9",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
@@ -28,11 +28,11 @@
], ],
"license": "AGPL", "license": "AGPL",
"dependencies": { "dependencies": {
"@certd/acme-client": "^1.38.8", "@certd/acme-client": "^1.38.9",
"@certd/basic": "^1.38.8", "@certd/basic": "^1.38.9",
"@certd/pipeline": "^1.38.8", "@certd/pipeline": "^1.38.9",
"@certd/plugin-lib": "^1.38.8", "@certd/plugin-lib": "^1.38.9",
"@certd/plus-core": "^1.38.8", "@certd/plus-core": "^1.38.9",
"@midwayjs/cache": "3.14.0", "@midwayjs/cache": "3.14.0",
"@midwayjs/core": "3.20.11", "@midwayjs/core": "3.20.11",
"@midwayjs/i18n": "3.20.13", "@midwayjs/i18n": "3.20.13",
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
### Performance Improvements
* 修改sql升级语句,兼容mysql5.7 ([02f89a9](https://github.com/certd/certd/commit/02f89a9c9d77850437285844670aed441e5953c3))
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/midway-flyway-js **Note:** Version bump only for package @certd/midway-flyway-js
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/midway-flyway-js", "name": "@certd/midway-flyway-js",
"version": "1.38.8", "version": "1.38.9",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
+7 -1
View File
@@ -31,6 +31,12 @@ const DefaultLogger = {
console.error(args); console.error(args);
}, },
}; };
let customLogger:any = null;
export function setFlywayLogger (logger: any) {
customLogger = logger;
};
export class Flyway { export class Flyway {
scriptDir; scriptDir;
flywayTableName; flywayTableName;
@@ -43,7 +49,7 @@ export class Flyway {
this.flywayTableName = opts.flywayTableName ?? 'flyway_history'; this.flywayTableName = opts.flywayTableName ?? 'flyway_history';
this.baseline = opts.baseline ?? false; this.baseline = opts.baseline ?? false;
this.allowHashNotMatch = opts.allowHashNotMatch ?? false; this.allowHashNotMatch = opts.allowHashNotMatch ?? false;
this.logger = opts.logger || DefaultLogger; this.logger = customLogger || opts.logger || DefaultLogger;
this.connection = opts.connection; this.connection = opts.connection;
} }
+1 -4
View File
@@ -1,6 +1,3 @@
// src/index.ts
export { FlywayConfiguration as Configuration } from './configuration.js'; export { FlywayConfiguration as Configuration } from './configuration.js';
// eslint-disable-next-line node/no-unpublished-import export { Flyway, setFlywayLogger } from './flyway.js';
export { Flyway } from './flyway.js';
// eslint-disable-next-line node/no-unpublished-import
export { FlywayHistory } from './entity.js'; export { FlywayHistory } from './entity.js';
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
**Note:** Version bump only for package @certd/plugin-cert
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/plugin-cert **Note:** Version bump only for package @certd/plugin-cert
+5 -5
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-cert", "name": "@certd/plugin-cert",
"private": false, "private": false,
"version": "1.38.8", "version": "1.38.9",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@@ -17,10 +17,10 @@
"compile": "tsc --skipLibCheck --watch" "compile": "tsc --skipLibCheck --watch"
}, },
"dependencies": { "dependencies": {
"@certd/acme-client": "^1.38.8", "@certd/acme-client": "^1.38.9",
"@certd/basic": "^1.38.8", "@certd/basic": "^1.38.9",
"@certd/pipeline": "^1.38.8", "@certd/pipeline": "^1.38.9",
"@certd/plugin-lib": "^1.38.8", "@certd/plugin-lib": "^1.38.9",
"psl": "^1.9.0", "psl": "^1.9.0",
"punycode.js": "^2.3.1" "punycode.js": "^2.3.1"
}, },
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
**Note:** Version bump only for package @certd/plugin-lib
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
**Note:** Version bump only for package @certd/plugin-lib **Note:** Version bump only for package @certd/plugin-lib
+5 -5
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-lib", "name": "@certd/plugin-lib",
"private": false, "private": false,
"version": "1.38.8", "version": "1.38.9",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@@ -22,10 +22,10 @@
"@alicloud/pop-core": "^1.7.10", "@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.11", "@alicloud/tea-util": "^1.4.11",
"@aws-sdk/client-s3": "^3.964.0", "@aws-sdk/client-s3": "^3.964.0",
"@certd/acme-client": "^1.38.8", "@certd/acme-client": "^1.38.9",
"@certd/basic": "^1.38.8", "@certd/basic": "^1.38.9",
"@certd/pipeline": "^1.38.8", "@certd/pipeline": "^1.38.9",
"@certd/plus-core": "^1.38.8", "@certd/plus-core": "^1.38.9",
"@kubernetes/client-node": "0.21.0", "@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0", "ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5", "basic-ftp": "^5.0.5",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
### Performance Improvements
* 已登录状态访问登录页面自动跳转到首页 ([bd8caff](https://github.com/certd/certd/commit/bd8caff0b754cb13530cf0f1644b33e29fde5d01))
* 优化access授权支持remote-auto-complete ([2f40f79](https://github.com/certd/certd/commit/2f40f795ee6131132d3fab2601f92a567bbdc4b7))
* access 插件支持remote-select等配置 ([d286c04](https://github.com/certd/certd/commit/d286c040a5232dcca829945734affead3ee08b3c))
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements ### Performance Improvements
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-client", "name": "@certd/ui-client",
"version": "1.38.8", "version": "1.38.9",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite --open", "dev": "vite --open",
@@ -106,8 +106,8 @@
"zod-defaults": "^0.1.3" "zod-defaults": "^0.1.3"
}, },
"devDependencies": { "devDependencies": {
"@certd/lib-iframe": "^1.38.8", "@certd/lib-iframe": "^1.38.9",
"@certd/pipeline": "^1.38.8", "@certd/pipeline": "^1.38.9",
"@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12", "@types/chai": "^4.3.12",
@@ -23,7 +23,7 @@ defineOptions({
const props = defineProps< const props = defineProps<
{ {
watches: string[]; watches?: string[];
} & ComponentPropsType } & ComponentPropsType
>(); >();
@@ -48,6 +48,18 @@ const message = ref("");
const hasError = ref(false); const hasError = ref(false);
const loading = ref(false); const loading = ref(false);
function getInputFromForm(form: any, pluginType: string) {
let input: any = {};
if (pluginType === "plugin") {
input = form?.input || {};
} else if (pluginType === "access") {
input = form?.access || {};
} else {
input = form || {};
}
return input;
}
const getOptions = async () => { const getOptions = async () => {
if (loading.value) { if (loading.value) {
return; return;
@@ -63,15 +75,14 @@ const getOptions = async () => {
} }
const pluginType = getPluginType(); const pluginType = getPluginType();
const { form } = getScope(); const { form } = getScope();
const input = (pluginType === "plugin" ? form?.input : form) || {}; const input = getInputFromForm(form, pluginType);
for (let key in define.input) { for (let key in define.input) {
const inWatches = props.watches?.includes(key); const inWatches = props.watches?.includes(key);
const inputDefine = define.input[key]; const inputDefine = define.input[key];
if (inWatches && inputDefine.required) { if (inWatches && inputDefine.required) {
const value = input[key]; const value = input[key];
if (value == null || value === "") { if (value == null || value === "") {
console.log("remote-select required", key); console.log("remote-auto-complete required", key);
return; return;
} }
} }
@@ -129,12 +140,14 @@ watch(
() => { () => {
const pluginType = getPluginType(); const pluginType = getPluginType();
const { form, key } = getScope(); const { form, key } = getScope();
const input = (pluginType === "plugin" ? form?.input : form) || {}; const input = getInputFromForm(form, pluginType);
const watches = {}; const watches: any = {};
for (const key of props.watches) { if (props.watches && props.watches.length > 0) {
//@ts-ignore for (const key of props.watches) {
watches[key] = input[key]; watches[key] = input[key];
}
} }
return { return {
form: watches, form: watches,
key, key,
@@ -144,6 +157,9 @@ watch(
const { form } = value; const { form } = value;
const oldForm: any = oldValue?.form; const oldForm: any = oldValue?.form;
let changed = oldForm == null || optionsRef.value.length == 0; let changed = oldForm == null || optionsRef.value.length == 0;
if (!props.watches || props.watches.length === 0) {
return;
}
for (const key of props.watches) { for (const key of props.watches) {
//@ts-ignore //@ts-ignore
if (oldForm && form[key] != oldForm[key]) { if (oldForm && form[key] != oldForm[key]) {
@@ -57,7 +57,7 @@ const VNodes = defineComponent({
const props = defineProps< const props = defineProps<
{ {
watches: string[]; watches?: string[];
search?: boolean; search?: boolean;
pager?: boolean; pager?: boolean;
} & ComponentPropsType } & ComponentPropsType
@@ -79,6 +79,17 @@ const getPluginType: any = inject("get:plugin:type", () => {
return "plugin"; return "plugin";
}); });
function getInputFromForm(form: any, pluginType: string) {
let input: any = {};
if (pluginType === "plugin") {
input = form?.input || {};
} else if (pluginType === "access") {
input = form?.access || {};
} else {
input = form || {};
}
return input;
}
const searchKeyRef = ref(""); const searchKeyRef = ref("");
const optionsRef = ref([]); const optionsRef = ref([]);
const message = ref(""); const message = ref("");
@@ -104,7 +115,7 @@ const getOptions = async () => {
} }
const pluginType = getPluginType(); const pluginType = getPluginType();
const { form } = getScope(); const { form } = getScope();
const input = (pluginType === "plugin" ? form?.input : form) || {}; const input = getInputFromForm(form, pluginType);
for (let key in define.input) { for (let key in define.input) {
const inWatches = props.watches?.includes(key); const inWatches = props.watches?.includes(key);
@@ -200,12 +211,14 @@ watch(
() => { () => {
const pluginType = getPluginType(); const pluginType = getPluginType();
const { form, key } = getScope(); const { form, key } = getScope();
const input = (pluginType === "plugin" ? form?.input : form) || {}; const input = getInputFromForm(form, pluginType);
const watches = {}; const watches: any = {};
for (const key of props.watches) { if (props.watches && props.watches.length > 0) {
//@ts-ignore for (const key of props.watches) {
watches[key] = input[key]; watches[key] = input[key];
}
} }
return { return {
form: watches, form: watches,
key, key,
@@ -215,11 +228,12 @@ watch(
const { form } = value; const { form } = value;
const oldForm: any = oldValue?.form; const oldForm: any = oldValue?.form;
let changed = oldForm == null || optionsRef.value.length == 0; let changed = oldForm == null || optionsRef.value.length == 0;
for (const key of props.watches) { if (props.watches && props.watches.length > 0) {
//@ts-ignore for (const key of props.watches) {
if (oldForm && form[key] != oldForm[key]) { if (oldForm && form[key] != oldForm[key]) {
changed = true; changed = true;
break; break;
}
} }
} }
if (changed) { if (changed) {
@@ -101,6 +101,14 @@ function setupAccessGuard(router: Router) {
return r.meta?.auth || r.meta?.permission; return r.meta?.auth || r.meta?.permission;
}); });
if (to.path === LOGIN_PATH && accessStore.accessToken) {
return {
path: DEFAULT_HOME_PATH,
// 携带当前跳转的页面,登录后重新跳转该页面
replace: true,
};
}
if (!needAuth) { if (!needAuth) {
return true; return true;
} }
@@ -10,6 +10,9 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
provide("get:plugin:type", () => { provide("get:plugin:type", () => {
return "access"; return "access";
}); });
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
const AccessTypeDictRef = dict({ const AccessTypeDictRef = dict({
url: "/pi/access/accessTypeDict", url: "/pi/access/accessTypeDict",
}); });
@@ -1,12 +1,11 @@
import { ColumnCompositionProps, compute, dict } from "@fast-crud/fast-crud"; import { ColumnCompositionProps, compute, dict } from "@fast-crud/fast-crud";
import { Modal } from "ant-design-vue";
import { forEach, get, merge, set } from "lodash-es";
import { computed, provide, ref, toRef } from "vue"; import { computed, provide, ref, toRef } from "vue";
import { useReference } from "/@/use/use-refrence"; import { useReference } from "/@/use/use-refrence";
import { forEach, get, merge, set } from "lodash-es";
import { Modal } from "ant-design-vue";
import { mitter } from "/@/utils/util.mitt"; import { mitter } from "/@/utils/util.mitt";
import { useI18n } from "/src/locales";
import * as pipelineApi from "/@/views/certd/pipeline/api";
import { getAddonTypeDefine } from "/@/views/certd/addon/api"; import { getAddonTypeDefine } from "/@/views/certd/addon/api";
import { useI18n } from "/src/locales";
export function addonProvide(api: any) { export function addonProvide(api: any) {
provide("addonApi", api); provide("addonApi", api);
@@ -30,6 +29,10 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
}, },
}; };
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
function buildDefineFields(define: any, form: any, mode: string) { function buildDefineFields(define: any, form: any, mode: string) {
const formWrapperRef = crudExpose.getFormWrapperRef(); const formWrapperRef = crudExpose.getFormWrapperRef();
const columnsRef = toRef(formWrapperRef.formOptions, "columns"); const columnsRef = toRef(formWrapperRef.formOptions, "columns");
@@ -26,6 +26,10 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
}, },
}; };
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
function buildDefineFields(define: any, form: any, mode: string) { function buildDefineFields(define: any, form: any, mode: string) {
const formWrapperRef = crudExpose.getFormWrapperRef(); const formWrapperRef = crudExpose.getFormWrapperRef();
const columnsRef = toRef(formWrapperRef.formOptions, "columns"); const columnsRef = toRef(formWrapperRef.formOptions, "columns");
@@ -103,7 +103,7 @@ import SmsCode from "/@/views/framework/login/sms-code.vue";
import { useI18n } from "/@/locales"; import { useI18n } from "/@/locales";
import { LanguageToggle } from "/@/vben/layouts"; import { LanguageToggle } from "/@/vben/layouts";
import CaptchaInput from "/@/components/captcha/captcha-input.vue"; import CaptchaInput from "/@/components/captcha/captcha-input.vue";
import { useRoute } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import OauthFooter from "/@/views/framework/oauth/oauth-footer.vue"; import OauthFooter from "/@/views/framework/oauth/oauth-footer.vue";
import * as oauthApi from "../oauth/api"; import * as oauthApi from "../oauth/api";
import { notification } from "ant-design-vue"; import { notification } from "ant-design-vue";
@@ -113,6 +113,7 @@ export default defineComponent({
setup() { setup() {
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const userStore = useUserStore();
const queryBindCode = ref(route.query.bindCode as string | undefined); const queryBindCode = ref(route.query.bindCode as string | undefined);
@@ -120,7 +121,7 @@ export default defineComponent({
const urlLoginType = route.query.loginType as string | undefined; const urlLoginType = route.query.loginType as string | undefined;
const verifyCodeInputRef = ref(); const verifyCodeInputRef = ref();
const loading = ref(false); const loading = ref(false);
const userStore = useUserStore();
const settingStore = useSettingStore(); const settingStore = useSettingStore();
const formRef = ref(); const formRef = ref();
let defaultLoginType = settingStore.sysPublic.defaultLoginType || "password"; let defaultLoginType = settingStore.sysPublic.defaultLoginType || "password";
@@ -250,6 +251,7 @@ export default defineComponent({
} }
return sysPublicSettings.oauthOnly && settingStore.isPlus && sysPublicSettings.oauthEnabled; return sysPublicSettings.oauthOnly && settingStore.isPlus && sysPublicSettings.oauthEnabled;
}); });
return { return {
t, t,
loading, loading,
@@ -11,6 +11,8 @@ typeorm:
default: default:
logging: false logging: false
flyway:
allowHashNotMatch: true
account: account:
server: server:
+14
View File
@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.9](https://github.com/certd/certd/compare/v1.38.8...v1.38.9) (2026-02-09)
### Bug Fixes
* 修复部署到openwrt错误的bug ([9ac33f9](https://github.com/certd/certd/commit/9ac33f9b9ba7727fcbbd320dd866bc048cbb3d72))
* 修复新版本上传到阿里云cas后,其他依赖任务无法部署的bug ([99f5b8e](https://github.com/certd/certd/commit/99f5b8ebc1c64798ceb42042ad71cf71e967beb0))
* esxi部署失败的bug ([6ab1fca](https://github.com/certd/certd/commit/6ab1fcaf894f7ce343af4b5bf4b0d67438df6618))
### Performance Improvements
* 修改sql升级语句,兼容mysql5.7 ([02f89a9](https://github.com/certd/certd/commit/02f89a9c9d77850437285844670aed441e5953c3))
* 优化access授权支持remote-auto-complete ([2f40f79](https://github.com/certd/certd/commit/2f40f795ee6131132d3fab2601f92a567bbdc4b7))
* access 插件支持remote-select等配置 ([d286c04](https://github.com/certd/certd/commit/d286c040a5232dcca829945734affead3ee08b3c))
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06) ## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements ### Performance Improvements
@@ -97,7 +97,7 @@ CREATE TABLE `cd_cert_info`
CREATE INDEX `index_cert_info_user_id` ON `cd_cert_info` (`user_id`); CREATE INDEX `index_cert_info_user_id` ON `cd_cert_info` (`user_id`);
CREATE INDEX `index_cert_info_domain` ON `cd_cert_info` (`domain`); CREATE INDEX `index_cert_info_domain` ON `cd_cert_info` (`domain`);
CREATE INDEX `index_cert_info_domains` ON `cd_cert_info` (`domains`(200)); CREATE INDEX `index_cert_info_domains` ON `cd_cert_info` (`domains`(190));
CREATE INDEX `index_cert_info_pipeline` ON `cd_cert_info` (`pipeline_id`); CREATE INDEX `index_cert_info_pipeline` ON `cd_cert_info` (`pipeline_id`);
@@ -124,7 +124,7 @@ CREATE TABLE `cd_site_info`
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
); ) ENGINE=InnoDB;
CREATE INDEX `index_site_info_user_id` ON `cd_site_info` (`user_id`); CREATE INDEX `index_site_info_user_id` ON `cd_site_info` (`user_id`);
CREATE INDEX `index_site_info_domain` ON `cd_site_info` (`domain`); CREATE INDEX `index_site_info_domain` ON `cd_site_info` (`domain`);
@@ -16,5 +16,5 @@ CREATE TABLE `cd_domain`
); );
CREATE INDEX `index_domain_user_id` ON `cd_domain` (`user_id`); CREATE INDEX `index_domain_user_id` ON `cd_domain` (`user_id`);
CREATE INDEX `index_domain_domain` ON `cd_domain` (`domain`); CREATE INDEX `index_domain_domain` ON `cd_domain` (`domain`(100));
@@ -1,5 +1,5 @@
CREATE TABLE `cd_oauth_bound` CREATE TABLE IF NOT EXISTS `cd_oauth_bound`
( (
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL, `id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
`user_id` bigint NOT NULL, `user_id` bigint NOT NULL,
@@ -7,8 +7,8 @@ CREATE TABLE `cd_oauth_bound`
`open_id` varchar(512) NOT NULL, `open_id` varchar(512) NOT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
); ) ENGINE=InnoDB;
CREATE INDEX `index_oauth_bound_user_id` ON `cd_oauth_bound` (`user_id`); CREATE INDEX `index_oauth_bound_user_id` ON `cd_oauth_bound` (`user_id`);
CREATE INDEX `index_oauth_bound_open_id` ON `cd_oauth_bound` (`open_id`); CREATE INDEX `index_oauth_bound_open_id` ON `cd_oauth_bound` (`open_id`(190));
+2
View File
@@ -75,6 +75,8 @@ function transformMysql() {
pgSql = pgSql.replaceAll(/text/g, 'longtext'); pgSql = pgSql.replaceAll(/text/g, 'longtext');
//双引号 替换成反引号 //双引号 替换成反引号
pgSql = pgSql.replaceAll(/"/g, '`'); pgSql = pgSql.replaceAll(/"/g, '`');
//create table if not exists
pgSql = pgSql.replaceAll(/CREATE TABLE ([ ]+)`/g, 'CREATE TABLE IF NOT EXISTS `');
fs.writeFileSync(`./migration-mysql/${notFile}`, pgSql); fs.writeFileSync(`./migration-mysql/${notFile}`, pgSql);
} }
@@ -14,72 +14,26 @@ input:
region: region:
title: 大区 title: 大区
component: component:
name: a-auto-complete name: remote-auto-complete
vModel: value vModel: value
options: type: access
- value: oss-cn-hangzhou typeName: alioss
label: 华东1(杭州) action: onGetRegionList
- value: oss-cn-shanghai
label: 华东2(上海)
- value: oss-cn-nanjing
label: 华东5(南京-本地地域)
- value: oss-cn-fuzhou
label: 华东6(福州-本地地域)
- value: oss-cn-wuhan-lr
label: 华中1(武汉-本地地域)
- value: oss-cn-qingdao
label: 华北1(青岛)
- value: oss-cn-beijing
label: 华北2(北京)
- value: oss-cn-zhangjiakou
label: 华北 3(张家口)
- value: oss-cn-huhehaote
label: 华北5(呼和浩特)
- value: oss-cn-wulanchabu
label: 华北6(乌兰察布)
- value: oss-cn-shenzhen
label: 华南1(深圳)
- value: oss-cn-heyuan
label: 华南2(河源)
- value: oss-cn-guangzhou
label: 华南3(广州)
- value: oss-cn-chengdu
label: 西南1(成都)
- value: oss-cn-hongkong
label: 中国香港
- value: oss-us-west-1
label: 美国(硅谷)①
- value: oss-us-east-1
label: 美国(弗吉尼亚)①
- value: oss-ap-northeast-1
label: 日本(东京)①
- value: oss-ap-northeast-2
label: 韩国(首尔)
- value: oss-ap-southeast-1
label: 新加坡①
- value: oss-ap-southeast-2
label: 澳大利亚(悉尼)①
- value: oss-ap-southeast-3
label: 马来西亚(吉隆坡)①
- value: oss-ap-southeast-5
label: 印度尼西亚(雅加达)①
- value: oss-ap-southeast-6
label: 菲律宾(马尼拉)
- value: oss-ap-southeast-7
label: 泰国(曼谷)
- value: oss-eu-central-1
label: 德国(法兰克福)①
- value: oss-eu-west-1
label: 英国(伦敦)
- value: oss-me-east-1
label: 阿联酋(迪拜)①
- value: oss-rg-china-mainland
label: 无地域属性(中国内地)
required: true required: true
bucket: bucket:
title: Bucket title: Bucket
helper: 存储桶名称 helper: 存储桶名称
required: true required: true
component:
name: remote-auto-complete
vModel: value
type: access
action: onGetBucketList
search: false
pager: false
watches:
- accessId
- region
pluginType: access pluginType: access
type: builtIn type: builtIn
scriptFilePath: /plugins/plugin-lib/aliyun/access/alioss-access.js scriptFilePath: /plugins/plugin-lib/aliyun/access/alioss-access.js
@@ -3,9 +3,9 @@ default:
strategy: strategy:
runStrategy: 1 runStrategy: 1
name: 1PanelDeployToWebsitePlugin name: 1PanelDeployToWebsitePlugin
title: 1Panel-更新证书 title: 1Panel-更新站点证书
icon: svg:icon-onepanel icon: svg:icon-onepanel
desc: 更新1Panel的证书,包括面板证书和站点证书 desc: 更新1Panel的站点证书
group: panel group: panel
needPlus: false needPlus: false
input: input:
+14 -14
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-server", "name": "@certd/ui-server",
"version": "1.38.8", "version": "1.38.9",
"description": "fast-server base midway", "description": "fast-server base midway",
"private": true, "private": true,
"type": "module", "type": "module",
@@ -48,20 +48,20 @@
"@aws-sdk/client-iam": "^3.964.0", "@aws-sdk/client-iam": "^3.964.0",
"@aws-sdk/client-route-53": "^3.964.0", "@aws-sdk/client-route-53": "^3.964.0",
"@aws-sdk/client-s3": "^3.964.0", "@aws-sdk/client-s3": "^3.964.0",
"@certd/acme-client": "^1.38.8", "@certd/acme-client": "^1.38.9",
"@certd/basic": "^1.38.8", "@certd/basic": "^1.38.9",
"@certd/commercial-core": "^1.38.8", "@certd/commercial-core": "^1.38.9",
"@certd/cv4pve-api-javascript": "^8.4.2", "@certd/cv4pve-api-javascript": "^8.4.2",
"@certd/jdcloud": "^1.38.8", "@certd/jdcloud": "^1.38.9",
"@certd/lib-huawei": "^1.38.8", "@certd/lib-huawei": "^1.38.9",
"@certd/lib-k8s": "^1.38.8", "@certd/lib-k8s": "^1.38.9",
"@certd/lib-server": "^1.38.8", "@certd/lib-server": "^1.38.9",
"@certd/midway-flyway-js": "^1.38.8", "@certd/midway-flyway-js": "^1.38.9",
"@certd/pipeline": "^1.38.8", "@certd/pipeline": "^1.38.9",
"@certd/plugin-cert": "^1.38.8", "@certd/plugin-cert": "^1.38.9",
"@certd/plugin-lib": "^1.38.8", "@certd/plugin-lib": "^1.38.9",
"@certd/plugin-plus": "^1.38.8", "@certd/plugin-plus": "^1.38.9",
"@certd/plus-core": "^1.38.8", "@certd/plus-core": "^1.38.9",
"@google-cloud/publicca": "^1.3.0", "@google-cloud/publicca": "^1.3.0",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.185", "@huaweicloud/huaweicloud-sdk-cdn": "^3.1.185",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.185", "@huaweicloud/huaweicloud-sdk-core": "^3.1.185",
@@ -4,7 +4,7 @@ import { MidwayConfig } from '@midwayjs/core';
// import { fileURLToPath } from 'node:url'; // import { fileURLToPath } from 'node:url';
// // const __filename = fileURLToPath(import.meta.url); // // const __filename = fileURLToPath(import.meta.url);
// const __dirname = dirname(fileURLToPath(import.meta.url)); // const __dirname = dirname(fileURLToPath(import.meta.url));
import { FlywayHistory } from '@certd/midway-flyway-js'; import { FlywayHistory, setFlywayLogger } from '@certd/midway-flyway-js';
import { UserEntity } from '../modules/sys/authority/entity/user.js'; import { UserEntity } from '../modules/sys/authority/entity/user.js';
import { PipelineEntity } from '../modules/pipeline/entity/pipeline.js'; import { PipelineEntity } from '../modules/pipeline/entity/pipeline.js';
//import { logger } from '../utils/logger'; //import { logger } from '../utils/logger';
@@ -15,6 +15,7 @@ import { commercialEntities } from '@certd/commercial-core';
import { tmpdir } from 'node:os'; import { tmpdir } from 'node:os';
import { DefaultUploadFileMimeType, uploadWhiteList } from '@midwayjs/upload'; import { DefaultUploadFileMimeType, uploadWhiteList } from '@midwayjs/upload';
import path from 'path'; import path from 'path';
import { logger } from '@certd/basic';
const env = process.env.NODE_ENV || 'development'; const env = process.env.NODE_ENV || 'development';
@@ -137,4 +138,6 @@ mergeConfig(development, 'development');
mergeConfig(development, env); mergeConfig(development, env);
setFlywayLogger(logger);
export default development; export default development;
@@ -78,7 +78,7 @@ export class MainConfiguration {
app: koa.Application; app: koa.Application;
async onReady() { async onReady() {
// 设置flyway logger
// add middleware // add middleware
@@ -53,6 +53,7 @@ export class HandleController extends BaseController {
const accessGetter = new AccessGetter(userId, this.accessService.getById.bind(this.accessService)); const accessGetter = new AccessGetter(userId, this.accessService.getById.bind(this.accessService));
const access = await newAccess(body.typeName, inputAccess,accessGetter); const access = await newAccess(body.typeName, inputAccess,accessGetter);
mergeUtils.merge(access, body.input);
const res = await access.onRequest(body); const res = await access.onRequest(body);
return this.ok(res); return this.ok(res);
@@ -5,7 +5,7 @@ import {
createRemoteSelectInputDefine createRemoteSelectInputDefine
} from "@certd/plugin-lib"; } from "@certd/plugin-lib";
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
import { AliyunClient, AliyunSslClient } from "../../../plugin-lib/aliyun/lib/index.js"; import { AliyunClient, AliyunSslClient, CasCertId } from "../../../plugin-lib/aliyun/lib/index.js";
import { AliyunClientV2 } from "../../../plugin-lib/aliyun/lib/aliyun-client-v2.js"; import { AliyunClientV2 } from "../../../plugin-lib/aliyun/lib/aliyun-client-v2.js";
@IsTaskPlugin({ @IsTaskPlugin({
@@ -31,7 +31,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
}, },
required: true required: true
}) })
cert!: CertInfo | number; cert!: CertInfo | CasCertId | number;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -298,18 +298,25 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
async getAliyunCertId(access: AliyunAccess) { async getAliyunCertId(access: AliyunAccess) {
let certId: any = this.cert; let certId: any = this.cert;
if (typeof this.cert === "object") { if (typeof this.cert === "object") {
const certInfo = this.cert as CertInfo;
const casCert = this.cert as CasCertId;
const sslClient = new AliyunSslClient({ const sslClient = new AliyunSslClient({
access, access,
logger: this.logger, logger: this.logger,
endpoint: this.casEndpoint endpoint: this.casEndpoint
}); });
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt)); if (certInfo.crt) {
const certIdRes = await sslClient.uploadCertificate({ const certName = this.buildCertName(CertReader.getMainDomain(certInfo.crt));
name: certName, const certIdRes = await sslClient.uploadCertificate({
cert: this.cert name: certName,
}); cert: certInfo,
certId = certIdRes.certId as any; });
certId = certIdRes.certId as any;
}else if (casCert.certId){
certId = casCert.certId;
}
} }
return certId; return certId;
@@ -2,7 +2,7 @@ import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert"; import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib"; import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
import { AliyunSslClient } from "../../../plugin-lib/aliyun/lib/ssl-client.js"; import { AliyunSslClient, CasCertId } from "../../../plugin-lib/aliyun/lib/ssl-client.js";
@IsTaskPlugin({ @IsTaskPlugin({
name: "AliyunDeployCertToAll", name: "AliyunDeployCertToAll",
@@ -27,7 +27,7 @@ export class AliyunDeployCertToAll extends AbstractTaskPlugin {
}, },
required: true, required: true,
}) })
cert!: CertInfo | number; cert!: CertInfo | CasCertId | number;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -155,11 +155,17 @@ export class AliyunDeployCertToAll extends AbstractTaskPlugin {
// //
let certId: any = this.cert; let certId: any = this.cert;
if (typeof this.cert === "object") { if (typeof this.cert === "object") {
const certIdRes = await sslClient.uploadCertificate({ const certInfo = this.cert as CertInfo;
name: this.appendTimeSuffix("certd"), const casCert = this.cert as CasCertId;
cert: this.cert, if (casCert.certId) {
}); certId = casCert.certId;
certId = certIdRes.certId as any; } else {
const certIdRes = await sslClient.uploadCertificate({
name: this.appendTimeSuffix("certd"),
cert: certInfo,
});
certId = certIdRes.certId as any;
}
} }
const jobId = await this.createDeployJob(sslClient, certId); const jobId = await this.createDeployJob(sslClient, certId);
@@ -4,7 +4,7 @@ import {
createRemoteSelectInputDefine createRemoteSelectInputDefine
} from "@certd/plugin-lib"; } from "@certd/plugin-lib";
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
import { AliyunSslClient } from "../../../plugin-lib/aliyun/lib/ssl-client.js"; import { AliyunSslClient, CasCertId } from "../../../plugin-lib/aliyun/lib/ssl-client.js";
import { CertApplyPluginNames, CertInfo, CertReader } from "@certd/plugin-cert"; import { CertApplyPluginNames, CertInfo, CertReader } from "@certd/plugin-cert";
import {optionsUtils} from "@certd/basic"; import {optionsUtils} from "@certd/basic";
@@ -30,7 +30,7 @@ export class DeployCertToAliyunApig extends AbstractTaskPlugin {
}, },
required: true, required: true,
}) })
cert!: CertInfo | string; cert!: CertInfo | CasCertId |number;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -137,11 +137,16 @@ export class DeployCertToAliyunApig extends AbstractTaskPlugin {
logger: this.logger, logger: this.logger,
region: this.casRegion, region: this.casRegion,
}); });
const certInfo = this.cert as CertInfo;
certId = await sslClient.uploadCert({ const casCert = this.cert as CasCertId;
name: this.buildCertName(CertReader.getMainDomain(this.cert.crt)), if (casCert.certId) {
cert: this.cert, certId = casCert.certId;
}); } else {
certId = await sslClient.uploadCert({
name: this.buildCertName(CertReader.getMainDomain(certInfo.crt)),
cert: certInfo,
});
}
} }
const certIdentify = `${certId}-${this.casRegion}` const certIdentify = `${certId}-${this.casRegion}`
@@ -1,9 +1,9 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline'; import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib'; import { CertInfo, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
import { optionsUtils } from '@certd/basic'; import { optionsUtils } from '@certd/basic';
import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert"; import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert";
import { AliyunClient, AliyunSslClient } from "../../../plugin-lib/aliyun/lib/index.js"; import { AliyunClient, AliyunSslClient, CasCertId } from "../../../plugin-lib/aliyun/lib/index.js";
@IsTaskPlugin({ @IsTaskPlugin({
name: 'DeployCertToAliyunCDN', name: 'DeployCertToAliyunCDN',
title: '阿里云-部署证书至CDN', title: '阿里云-部署证书至CDN',
@@ -43,7 +43,7 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
template:false, template:false,
required: true, required: true,
}) })
cert!: string; cert!: CertInfo | CasCertId |number;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -113,13 +113,18 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
let certName = this.appendTimeSuffix(this.certName); let certName = this.appendTimeSuffix(this.certName);
if (typeof this.cert === 'object') { if (typeof this.cert === 'object') {
// @ts-ignore const certInfo = this.cert as CertInfo;
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt)) const casCert = this.cert as CasCertId;
const certIdRes = await sslClient.uploadCertificate({ if (casCert.certId) {
name:certName, certId = casCert.certId;
cert: this.cert, } else {
}); certName = this.buildCertName(CertReader.getMainDomain(certInfo.crt))
certId = certIdRes.certId as any; const certIdRes = await sslClient.uploadCertificate({
name:certName,
cert: certInfo,
});
certId = certIdRes.certId as any;
}
} }
const client = await this.getClient(access); const client = await this.getClient(access);
@@ -7,9 +7,9 @@ import {
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
import { CertInfo } from '@certd/plugin-cert'; import { CertInfo } from '@certd/plugin-cert';
import { CertApplyPluginNames} from '@certd/plugin-cert'; import { CertApplyPluginNames } from '@certd/plugin-cert';
import { optionsUtils } from "@certd/basic"; import { optionsUtils } from "@certd/basic";
import { AliyunClient } from "../../../plugin-lib/aliyun/lib/index.js"; import { AliyunClient, CasCertId } from "../../../plugin-lib/aliyun/lib/index.js";
@IsTaskPlugin({ @IsTaskPlugin({
name: 'DeployCertToAliyunDCDN', name: 'DeployCertToAliyunDCDN',
title: '阿里云-部署证书至DCDN', title: '阿里云-部署证书至DCDN',
@@ -32,7 +32,7 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
}, },
required: true, required: true,
}) })
cert!: CertInfo | number; cert!: CertInfo | CasCertId | number;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -68,18 +68,18 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
domainName!: string | string[]; domainName!: string | string[];
async onInstance() {} async onInstance() { }
async execute(): Promise<void> { async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云DCDN'); this.logger.info('开始部署证书到阿里云DCDN');
if(!this.domainName){ if (!this.domainName) {
throw new Error('您还未选择DCDN域名'); throw new Error('您还未选择DCDN域名');
} }
const access = (await this.getAccess(this.accessId)) as AliyunAccess; const access = (await this.getAccess(this.accessId)) as AliyunAccess;
const client = await this.getClient(access); const client = await this.getClient(access);
if(typeof this.domainName === 'string'){ if (typeof this.domainName === 'string') {
this.domainName = [this.domainName]; this.domainName = [this.domainName];
} }
for (const domainName of this.domainName ) { for (const domainName of this.domainName) {
this.logger.info(`[${domainName}]开始部署`) this.logger.info(`[${domainName}]开始部署`)
const params = await this.buildParams(domainName); const params = await this.buildParams(domainName);
await this.doRequest(client, params); await this.doRequest(client, params);
@@ -100,30 +100,32 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
return client; return client;
} }
async buildParams(domainName:string) { async buildParams(domainName: string) {
const CertName = (this.certName ?? 'certd') + '-' + dayjs().format('YYYYMMDDHHmmss'); const CertName = (this.certName ?? 'certd') + '-' + dayjs().format('YYYYMMDDHHmmss');
if (typeof this.cert !== 'object') { let certId: any = this.cert
const certId = this.cert; if (typeof this.cert === 'object') {
this.logger.info('使用已上传的证书:', certId); const certInfo = this.cert as CertInfo;
return { if (certInfo.crt) {
DomainName: domainName, this.logger.info('上传证书:', CertName);
SSLProtocol: 'on', const cert: any = this.cert;
CertType: 'cas', return {
CertName: CertName, DomainName: domainName,
CertId: certId, SSLProtocol: 'on',
}; CertName: CertName,
CertType: 'upload',
SSLPub: cert.crt,
SSLPri: cert.key,
};
}
} }
this.logger.info('使用已上传的证书:', certId);
this.logger.info('上传证书:', CertName);
const cert: any = this.cert;
return { return {
DomainName: domainName, DomainName: domainName,
SSLProtocol: 'on', SSLProtocol: 'on',
CertType: 'cas',
CertName: CertName, CertName: CertName,
CertType: 'upload', CertId: certId,
SSLPub: cert.crt,
SSLPri: cert.key,
}; };
} }
@@ -5,7 +5,7 @@ import {
createRemoteSelectInputDefine createRemoteSelectInputDefine
} from "@certd/plugin-lib"; } from "@certd/plugin-lib";
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
import { AliyunSslClient } from "../../../plugin-lib/aliyun/lib/ssl-client.js"; import { AliyunSslClient, CasCertId } from "../../../plugin-lib/aliyun/lib/ssl-client.js";
import { AliyunClientV2 } from "../../../plugin-lib/aliyun/lib/aliyun-client-v2.js"; import { AliyunClientV2 } from "../../../plugin-lib/aliyun/lib/aliyun-client-v2.js";
import dayjs from "dayjs"; import dayjs from "dayjs";
@@ -32,7 +32,7 @@ export class AliyunDeployCertToESA extends AbstractTaskPlugin {
}, },
required: true required: true
}) })
cert!: CertInfo; cert!: CertInfo | CasCertId | number;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -117,14 +117,21 @@ export class AliyunDeployCertToESA extends AbstractTaskPlugin {
endpoint: this.casEndpoint endpoint: this.casEndpoint
}); });
certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt)); const certInfo = this.cert as CertInfo;
const casCert = this.cert as CasCertId;
if (casCert.certId) {
certId = casCert.certId;
certName = casCert.certName;
} else {
certName = this.buildCertName(CertReader.getMainDomain(certInfo.crt));
const certIdRes = await sslClient.uploadCertificate({ const certIdRes = await sslClient.uploadCertificate({
name: certName, name: certName,
cert: this.cert cert: certInfo
}); });
certId = certIdRes.certId as any; certId = certIdRes.certId as any;
this.logger.info("上传证书成功", certId, certName); this.logger.info("上传证书成功", certId, certName);
}
} }
return { return {
certId, certId,
@@ -5,7 +5,7 @@ import {
createRemoteSelectInputDefine createRemoteSelectInputDefine
} from "@certd/plugin-lib"; } from "@certd/plugin-lib";
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
import { AliyunSslClient } from "../../../plugin-lib/aliyun/lib/ssl-client.js"; import { AliyunSslClient, CasCertId } from "../../../plugin-lib/aliyun/lib/ssl-client.js";
@IsTaskPlugin({ @IsTaskPlugin({
name: "AliyunDeployCertToGA", name: "AliyunDeployCertToGA",
@@ -30,7 +30,7 @@ export class AliyunDeployCertToGA extends AbstractTaskPlugin {
}, },
required: true required: true
}) })
cert!: CertInfo|number; cert!: CertInfo|number | CasCertId;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -123,7 +123,7 @@ export class AliyunDeployCertToGA extends AbstractTaskPlugin {
logger: this.logger, logger: this.logger,
endpoint: this.casEndpoint endpoint: this.casEndpoint
}); });
return await sslClient.uploadCertOrGet(this.cert) return await sslClient.uploadCertOrGet(this.cert as any)
} }
async execute(): Promise<void> { async execute(): Promise<void> {
@@ -6,7 +6,7 @@ import {
} from "@certd/plugin-lib"; } from "@certd/plugin-lib";
import { CertApplyPluginNames} from '@certd/plugin-cert'; import { CertApplyPluginNames} from '@certd/plugin-cert';
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
import { AliyunClient, AliyunSslClient } from "../../../plugin-lib/aliyun/lib/index.js"; import { AliyunClient, AliyunSslClient, CasCertId } from "../../../plugin-lib/aliyun/lib/index.js";
import { AliyunClientV2 } from '../../../plugin-lib/aliyun/lib/aliyun-client-v2.js'; import { AliyunClientV2 } from '../../../plugin-lib/aliyun/lib/aliyun-client-v2.js';
@IsTaskPlugin({ @IsTaskPlugin({
name: 'AliyunDeployCertToNLB', name: 'AliyunDeployCertToNLB',
@@ -31,7 +31,7 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
}, },
required: true, required: true,
}) })
cert!: CertInfo | number; cert!: CertInfo | number | CasCertId;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -286,17 +286,25 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
async getAliyunCertId(access: AliyunAccess) { async getAliyunCertId(access: AliyunAccess) {
let certId: any = this.cert; let certId: any = this.cert;
if (typeof this.cert === 'object') { if (typeof this.cert === 'object') {
const casCert = this.cert as CasCertId;
if (casCert.certId) {
return casCert.certId;
}
const certInfo = this.cert as CertInfo;
const sslClient = new AliyunSslClient({ const sslClient = new AliyunSslClient({
access, access,
logger: this.logger, logger: this.logger,
endpoint: this.casEndpoint, endpoint: this.casEndpoint,
}); });
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt)) const certName = this.buildCertName(CertReader.getMainDomain(certInfo.crt))
const certIdRes = await sslClient.uploadCertificate({ const certIdRes = await sslClient.uploadCertificate({
name: certName, name: certName,
cert: this.cert, cert: certInfo,
}); });
certId = certIdRes.certId as any; certId = certIdRes.certId as any;
} }
@@ -1,14 +1,13 @@
import {AbstractTaskPlugin, IsTaskPlugin, Pager, pluginGroups, RunStrategy, TaskInput} from '@certd/pipeline'; import { optionsUtils } from "@certd/basic";
import { AbstractTaskPlugin, IsTaskPlugin, Pager, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { CertApplyPluginNames, CertInfo } from '@certd/plugin-cert';
import { import {
createCertDomainGetterInputDefine, createCertDomainGetterInputDefine,
createRemoteSelectInputDefine createRemoteSelectInputDefine
} from '@certd/plugin-lib'; } from '@certd/plugin-lib';
import {CertInfo, CertReader} from '@certd/plugin-cert'; import { isArray } from "lodash-es";
import { CertApplyPluginNames} from '@certd/plugin-cert';
import {optionsUtils} from "@certd/basic";
import {isArray} from "lodash-es";
import { AliyunAccess } from '../../../plugin-lib/aliyun/access/index.js'; import { AliyunAccess } from '../../../plugin-lib/aliyun/access/index.js';
import { AliyunSslClient } from '../../../plugin-lib/aliyun/lib/index.js'; import { CasCertId } from '../../../plugin-lib/aliyun/lib/index.js';
@IsTaskPlugin({ @IsTaskPlugin({
name: 'DeployCertToAliyunOSS', name: 'DeployCertToAliyunOSS',
title: '阿里云-部署证书至OSS', title: '阿里云-部署证书至OSS',
@@ -32,7 +31,7 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
}, },
required: true, required: true,
}) })
cert!: CertInfo | string; cert!: CertInfo | number | CasCertId;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -147,7 +146,6 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
this.logger.info('开始部署证书到阿里云OSS'); this.logger.info('开始部署证书到阿里云OSS');
const access = (await this.getAccess(this.accessId)) as AliyunAccess; const access = (await this.getAccess(this.accessId)) as AliyunAccess;
await this.getAliyunCertId(access)
this.logger.info(`bucket: ${this.bucket}, region: ${this.region}, domainName: ${this.domainName}`); this.logger.info(`bucket: ${this.bucket}, region: ${this.region}, domainName: ${this.domainName}`);
const client = await this.getClient(access); const client = await this.getClient(access);
if (typeof this.domainName === "string"){ if (typeof this.domainName === "string"){
@@ -169,12 +167,19 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
}); });
let certStr = "" let certStr = ""
if (typeof this.cert === "object" ){ if (typeof this.cert === "object" ){
certStr = ` const certInfo = this.cert as CertInfo;
<PrivateKey>${this.cert.key}</PrivateKey> if (certInfo.crt){
<Certificate>${this.cert.crt}</Certificate> certStr = `
` <PrivateKey>${certInfo.key}</PrivateKey>
}else{ <Certificate>${certInfo.crt}</Certificate>
`
}else{
const casCert = this.cert as CasCertId;
certStr = `<CertId>${casCert.certIdentifier}</CertId>`
}
}else {
certStr = `<CertId>${this.cert}-${this.casRegion}</CertId>` certStr = `<CertId>${this.cert}-${this.casRegion}</CertId>`
} }
@@ -196,34 +201,6 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
return res; return res;
} }
async getAliyunCertId(access: AliyunAccess) {
let certId: any = this.cert;
let certName: any = this.appendTimeSuffix("certd");
if (typeof this.cert === "object") {
let endpoint = `cas.${this.casRegion}.aliyuncs.com`;
if (this.casRegion === "cn-hangzhou" || !this.casRegion){
endpoint = "cas.aliyuncs.com";
}
const sslClient = new AliyunSslClient({
access,
logger: this.logger,
endpoint: endpoint
});
certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt));
const certIdRes = await sslClient.uploadCertificate({
name: certName,
cert: this.cert
});
certId = certIdRes.certId as any;
this.logger.info("上传证书成功", certId, certName);
}
return {
certId,
certName
};
}
async getClient(access: AliyunAccess) { async getClient(access: AliyunAccess) {
// @ts-ignore // @ts-ignore
@@ -1,10 +1,10 @@
import {AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy, TaskInput} from '@certd/pipeline'; import { AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import {CertInfo} from '@certd/plugin-cert'; import { CertInfo } from '@certd/plugin-cert';
import { import {
createCertDomainGetterInputDefine, createCertDomainGetterInputDefine,
createRemoteSelectInputDefine createRemoteSelectInputDefine
} from '@certd/plugin-lib'; } from '@certd/plugin-lib';
import {CertApplyPluginNames} from '@certd/plugin-cert'; import { CertApplyPluginNames } from '@certd/plugin-cert';
import { AliyunAccess } from '../../../plugin-lib/aliyun/access/index.js'; import { AliyunAccess } from '../../../plugin-lib/aliyun/access/index.js';
import { AliyunClient, AliyunSslClient, CasCertInfo } from '../../../plugin-lib/aliyun/lib/index.js'; import { AliyunClient, AliyunSslClient, CasCertInfo } from '../../../plugin-lib/aliyun/lib/index.js';
@@ -31,9 +31,9 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
}, },
required: true, required: true,
}) })
cert!: CertInfo | number; cert!: CertInfo | number | CasCertInfo;
@TaskInput(createCertDomainGetterInputDefine({props: {required: false}})) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -44,9 +44,9 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
component: { component: {
name: 'a-select', name: 'a-select',
options: [ options: [
{value: 'cas.aliyuncs.com', label: '中国大陆'}, { value: 'cas.aliyuncs.com', label: '中国大陆' },
{value: 'cas.ap-southeast-1.aliyuncs.com', label: '新加坡'}, { value: 'cas.ap-southeast-1.aliyuncs.com', label: '新加坡' },
{value: 'cas.eu-central-1.aliyuncs.com', label: '德国(法兰克福)'}, { value: 'cas.eu-central-1.aliyuncs.com', label: '德国(法兰克福)' },
], ],
}, },
required: true, required: true,
@@ -99,24 +99,24 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
@TaskInput({ @TaskInput({
title: "部署默认证书", title: "部署默认证书",
value: true, value: true,
component: { component: {
name: "a-switch", name: "a-switch",
vModel: "checked" vModel: "checked"
}
} }
}
) )
deployDefault!: boolean; deployDefault!: boolean;
@TaskInput({ @TaskInput({
title: "部署扩展证书", title: "部署扩展证书",
value: false, value: false,
component: { component: {
name: "a-switch", name: "a-switch",
vModel: "checked" vModel: "checked"
}
} }
}
) )
deployExtension!: boolean; deployExtension!: boolean;
@@ -126,8 +126,8 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
title: '扩展域名列表', title: '扩展域名列表',
helper: '要部署扩展域名列表', helper: '要部署扩展域名列表',
action: AliyunDeployCertToSLB.prototype.onGetExtensionDomainList.name, action: AliyunDeployCertToSLB.prototype.onGetExtensionDomainList.name,
watches: ['listeners','deployExtension'], watches: ['listeners', 'deployExtension'],
mergeScript:` mergeScript: `
return { return {
show: ctx.compute(({form})=>{ show: ctx.compute(({form})=>{
return form.deployExtension; return form.deployExtension;
@@ -143,7 +143,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
} }
async getLBClient(access: AliyunAccess, region: string) { async getLBClient(access: AliyunAccess, region: string) {
const client = new AliyunClient({logger: this.logger}); const client = new AliyunClient({ logger: this.logger });
const version = '2014-05-15'; const version = '2014-05-15';
await client.init({ await client.init({
accessKeyId: access.accessKeyId, accessKeyId: access.accessKeyId,
@@ -163,10 +163,10 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
const aliyunCert = await this.getAliyunCertId(access); const aliyunCert = await this.getAliyunCertId(access);
const slbServerCertId = await this.uploadServerCert(client, aliyunCert); const slbServerCertId = await this.uploadServerCert(client, aliyunCert);
if (this.deployDefault!==false) { if (this.deployDefault !== false) {
this.logger.info("部署监听器默认证书") this.logger.info("部署监听器默认证书")
for (const listener of this.listeners) { for (const listener of this.listeners) {
const {port, loadBalanceId} = this.resolveListenerKey(listener) const { port, loadBalanceId } = this.resolveListenerKey(listener)
const params = { const params = {
RegionId: this.regionId, RegionId: this.regionId,
LoadBalancerId: loadBalanceId, LoadBalancerId: loadBalanceId,
@@ -185,7 +185,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
const clientV2 = this.getCLBClientV2(access); const clientV2 = this.getCLBClientV2(access);
for (const domainStr of this.extensionDomains) { for (const domainStr of this.extensionDomains) {
const {extensionDomainId} = this.resolveListenerKey(domainStr) const { extensionDomainId } = this.resolveListenerKey(domainStr)
const res = await clientV2.doRequest({ const res = await clientV2.doRequest({
action: "SetDomainExtensionAttribute", action: "SetDomainExtensionAttribute",
// 接口版本 // 接口版本
@@ -251,11 +251,20 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
if (typeof this.cert === 'object') { if (typeof this.cert === 'object') {
const name = this.appendTimeSuffix('certd'); const name = this.appendTimeSuffix('certd');
const certIdRes = await sslClient.uploadCertificate({
name: name, const casCert = this.cert as CasCertInfo;
cert: this.cert, if (casCert.certIdentifier) {
}); certId = casCert.certId;
certId = certIdRes.certId as any; } else {
const cert = this.cert as CertInfo;
const certIdRes = await sslClient.uploadCertificate({
name: name,
cert: cert,
});
certId = certIdRes.certId as any;
}
} }
return await sslClient.getCertInfo(certId); return await sslClient.getCertInfo(certId);
@@ -360,7 +369,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
const allDomains: any[] = [] const allDomains: any[] = []
for (const ls of this.listeners) { for (const ls of this.listeners) {
const {port, loadBalanceId, protocol} = this.resolveListenerKey(ls) const { port, loadBalanceId, protocol } = this.resolveListenerKey(ls)
const domains = await this.doGetExtensionDomainList({ const domains = await this.doGetExtensionDomainList({
access, access,
loadBalancerId: loadBalanceId, loadBalancerId: loadBalanceId,
@@ -381,7 +390,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
listenerProtocol: string, listenerProtocol: string,
access: AliyunAccess access: AliyunAccess
}) { }) {
const {loadBalancerId, listenerPort, listenerProtocol, access} = data; const { loadBalancerId, listenerPort, listenerProtocol, access } = data;
const client = access.getClient(`slb.${this.regionId}.aliyuncs.com`) const client = access.getClient(`slb.${this.regionId}.aliyuncs.com`)
let queries = { let queries = {
@@ -412,7 +421,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
return { return {
value: value, value: value,
label: label, label: label,
domain:i.Domain domain: i.Domain
}; };
}); });
} }
@@ -1,11 +1,11 @@
import { AbstractTaskPlugin, IsTaskPlugin, Pager,PageSearch, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline"; import { AbstractTaskPlugin, IsTaskPlugin, Pager, PageSearch, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { CertApplyPluginNames, CertInfo, CertReader } from "@certd/plugin-cert"; import { CertApplyPluginNames, CertInfo, CertReader } from "@certd/plugin-cert";
import { import {
createCertDomainGetterInputDefine, createCertDomainGetterInputDefine,
createRemoteSelectInputDefine createRemoteSelectInputDefine
} from "@certd/plugin-lib"; } from "@certd/plugin-lib";
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
import { AliyunClient, AliyunSslClient } from "../../../plugin-lib/aliyun/lib/index.js"; import { AliyunClient, AliyunSslClient, CasCertInfo } from "../../../plugin-lib/aliyun/lib/index.js";
@IsTaskPlugin({ @IsTaskPlugin({
name: 'AliyunDeployCertToWaf', name: 'AliyunDeployCertToWaf',
@@ -30,7 +30,7 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
}, },
required: true, required: true,
}) })
cert!: CertInfo | number; cert!: CertInfo | number | CasCertInfo;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } })) @TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[]; certDomains!: string[];
@@ -83,8 +83,8 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
helper: '请选择要部署证书的CNAME站点', helper: '请选择要部署证书的CNAME站点',
action: AliyunDeployCertToWaf.prototype.onGetCnameList.name, action: AliyunDeployCertToWaf.prototype.onGetCnameList.name,
watches: ['accessId', 'regionId'], watches: ['accessId', 'regionId'],
pager:true, pager: true,
search:true, search: true,
}) })
) )
cnameDomains!: string[]; cnameDomains!: string[];
@@ -105,7 +105,7 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
}) })
tlsVersion!: string; tlsVersion!: string;
@TaskInput({ @TaskInput({
title: '启用TLSv3', title: '启用TLSv3',
value: true, value: true,
component: { component: {
@@ -118,7 +118,7 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
async onInstance() {} async onInstance() { }
async getWafClient(access: AliyunAccess) { async getWafClient(access: AliyunAccess) {
const client = new AliyunClient({ logger: this.logger }); const client = new AliyunClient({ logger: this.logger });
@@ -152,11 +152,17 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
endpoint: this.casEndpoint, endpoint: this.casEndpoint,
}); });
const certIdRes = await sslClient.uploadCertificate({ const cert = this.cert as CertInfo;
name: this.buildCertName(CertReader.getMainDomain(this.cert.crt)), if (cert.crt) {
cert: this.cert, const certIdRes = await sslClient.uploadCertificate({
}); name: this.buildCertName(CertReader.getMainDomain(cert.crt)),
certId = certIdRes.certId as any; cert: cert,
});
certId = certIdRes.certId as any;
}else {
const casCert = this.cert as CasCertInfo;
certId = casCert.certId;
}
} }
const client = await this.getWafClient(access); const client = await this.getWafClient(access);
@@ -211,13 +217,13 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
const pager = new Pager(data) const pager = new Pager(data)
const instanceId = await this.getInstanceId(client); const instanceId = await this.getInstanceId(client);
const params:any = { const params: any = {
RegionId: this.regionId, RegionId: this.regionId,
InstanceId: instanceId, InstanceId: instanceId,
PageSize: pager.pageSize, PageSize: pager.pageSize,
PageNumber: pager.pageNo, PageNumber: pager.pageNo,
}; };
if (data.searchKey){ if (data.searchKey) {
params.Domain = data.searchKey params.Domain = data.searchKey
} }
@@ -235,7 +241,7 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
domain: item.Domain, domain: item.Domain,
}; };
}); });
const list= this.ctx.utils.options.buildGroupOptions(options, this.certDomains); const list = this.ctx.utils.options.buildGroupOptions(options, this.certDomains);
// const list = [{value:"1",label:"1"},{value:"2",label:"2"}] // const list = [{value:"1",label:"1"},{value:"2",label:"2"}]
// const total = 120 // const total = 120
@@ -1,7 +1,7 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline'; import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline';
import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert"; import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert";
import { AliyunAccess } from '../../../plugin-lib/aliyun/access/index.js'; import { AliyunAccess } from '../../../plugin-lib/aliyun/access/index.js';
import { AliyunSslClient } from '../../../plugin-lib/aliyun/lib/index.js'; import { AliyunSslClient, CasCertId } from '../../../plugin-lib/aliyun/lib/index.js';
/** /**
* 1 cn-hangzhou cas.aliyuncs.com cas-vpc.cn-hangzhou.aliyuncs.com * 1 cn-hangzhou cas.aliyuncs.com cas-vpc.cn-hangzhou.aliyuncs.com
* 西 ap-southeast-3 cas.ap-southeast-3.aliyuncs.com cas-vpc.ap-southeast-3.aliyuncs.com * 西 ap-southeast-3 cas.ap-southeast-3.aliyuncs.com cas-vpc.ap-southeast-3.aliyuncs.com
@@ -78,7 +78,7 @@ export class UploadCertToAliyun extends AbstractTaskPlugin {
@TaskOutput({ @TaskOutput({
title: '上传成功后的阿里云CertId', title: '上传成功后的阿里云CertId',
}) })
aliyunCertId!: string; aliyunCertId!: CasCertId;
async onInstance() {} async onInstance() {}
@@ -1,4 +1,5 @@
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline"; import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
import { AliyunAccess } from "./aliyun-access.js";
@IsAccess({ @IsAccess({
name: "alioss", name: "alioss",
@@ -22,9 +23,36 @@ export class AliossAccess extends BaseAccess {
@AccessInput({ @AccessInput({
title: "大区", title: "大区",
component: { component: {
name: "a-auto-complete", name: "remote-auto-complete",
vModel: "value", vModel: "value",
options: [ type: "access",
typeName: "alioss",
action: AliossAccess.prototype.onGetRegionList.name
},
required: true,
})
region!: string;
@AccessInput({
title: "Bucket",
helper: "存储桶名称",
required: true,
component: {
name: "remote-auto-complete",
vModel: "value",
type: "access",
action: AliossAccess.prototype.onGetBucketList.name,
search: false,
pager: false,
watches: ["accessId", "region"],
},
})
bucket!: string;
onGetRegionList(){
return {
list: [
{ value: "oss-cn-hangzhou", label: "华东1(杭州)" }, { value: "oss-cn-hangzhou", label: "华东1(杭州)" },
{ value: "oss-cn-shanghai", label: "华东2(上海)" }, { value: "oss-cn-shanghai", label: "华东2(上海)" },
{ value: "oss-cn-nanjing", label: "华东5(南京-本地地域)" }, { value: "oss-cn-nanjing", label: "华东5(南京-本地地域)" },
@@ -54,18 +82,36 @@ export class AliossAccess extends BaseAccess {
{ value: "oss-eu-west-1", label: "英国(伦敦)" }, { value: "oss-eu-west-1", label: "英国(伦敦)" },
{ value: "oss-me-east-1", label: "阿联酋(迪拜)①" }, { value: "oss-me-east-1", label: "阿联酋(迪拜)①" },
{ value: "oss-rg-china-mainland", label: "无地域属性(中国内地)" }, { value: "oss-rg-china-mainland", label: "无地域属性(中国内地)" },
], ]
}, }
required: true, }
})
region!: string;
@AccessInput({ async onGetBucketList() {
title: "Bucket", const access = (await this.ctx.accessService.getById(this.accessId)) as AliyunAccess;
helper: "存储桶名称", const client = await this.getClient(access);
required: true,
}) let res;
bucket!: string; const buckets = [];
do {
const requestData = { marker: res?.nextMarker || null, "max-keys": 1000 };
res = await client.listBuckets(requestData);
buckets.push(...(res?.buckets || []));
} while (!!res?.nextMarker);
return buckets.filter(bucket => bucket?.region === this.region).map(bucket => ({ label: `${bucket.name}<${bucket.region}>`, value: bucket.name }));
}
async getClient(access: AliyunAccess) {
// @ts-ignore
const OSS = await import("ali-oss");
return new OSS.default({
accessKeyId: access.accessKeyId,
accessKeySecret: access.accessKeySecret,
// yourRegion填写Bucket所在地域。以华东1(杭州)为例,Region填写为oss-cn-hangzhou。
region: this.region,
//@ts-ignore
authorizationV4: true,
});
}
} }
new AliossAccess(); new AliossAccess();
@@ -126,18 +126,25 @@ export class AliyunSslClient {
} }
} }
async uploadCertOrGet(cert: CertInfo | number ) :Promise<CasCertId>{ async uploadCertOrGet(cert: CertInfo | number | CasCertId ) :Promise<CasCertId>{
if (typeof cert === "object") { if (typeof cert === "object") {
const casCert = cert as CasCertId;
if (casCert.certId) {
return casCert;
}
const certInfo = cert as CertInfo;
// 上传证书到阿里云 // 上传证书到阿里云
this.logger.info(`开始上传证书`); this.logger.info(`开始上传证书`);
const certName = CertReader.buildCertName(cert); const certName = CertReader.buildCertName(certInfo);
const res = await this.uploadCertificate({ const res = await this.uploadCertificate({
name: certName, name: certName,
cert: cert cert: certInfo
}); });
this.logger.info("上传证书成功", JSON.stringify(res)); this.logger.info("上传证书成功", JSON.stringify(res));
return res return res
} }
//number类型
const certId = cert as any; const certId = cert as any;
let certName: any = utils.string.appendTimeSuffix(certId); let certName: any = utils.string.appendTimeSuffix(certId);
const certIdentifier = this.getCertIdentifier(certId); const certIdentifier = this.getCertIdentifier(certId);
@@ -7,9 +7,9 @@ import { OnePanelClient } from "../client.js";
@IsTaskPlugin({ @IsTaskPlugin({
name: "1PanelDeployToWebsitePlugin", name: "1PanelDeployToWebsitePlugin",
title: "1Panel-更新证书", title: "1Panel-更新站点证书",
icon: "svg:icon-onepanel", icon: "svg:icon-onepanel",
desc: "更新1Panel的证书,包括面板证书和站点证书", desc: "更新1Panel的站点证书",
group: pluginGroups.panel.key, group: pluginGroups.panel.key,
default: { default: {
strategy: { strategy: {
@@ -195,7 +195,7 @@ export class OnePanelDeployToWebsitePlugin extends AbstractTaskPlugin {
currentNode: this.currentNode, currentNode: this.currentNode,
}); });
if (!res?.items) { if (!res?.items) {
throw new Error("没有找到证书,请先在1Panel中手动上传证书,并关联站点或设置面板证书,后续才可以自动更新"); throw new Error("没有找到证书,请先在1Panel中手动上传证书,并关联站点,后续才可以自动更新");
} }
const list = res.items.map(item => { const list = res.items.map(item => {
const domains = item.domains ? [] : item.domains.split(","); const domains = item.domains ? [] : item.domains.split(",");
@@ -59,7 +59,7 @@ export class EsxiDeployCertPlugin extends AbstractPlusTaskPlugin {
handle: async (ctx) => { handle: async (ctx) => {
const crtPath = ctx.tmpCrtPath; const crtPath = ctx.tmpCrtPath;
const keyPath = ctx.tmpKeyPath; const keyPath = ctx.tmpKeyPath;
sshClient.uploadFiles({ await sshClient.uploadFiles({
connectConf: sshConf, connectConf: sshConf,
transports: [ transports: [
{ {
@@ -59,7 +59,7 @@ export class OpenwrtDeployCertPlugin extends AbstractPlusTaskPlugin {
handle: async (ctx) => { handle: async (ctx) => {
const crtPath = ctx.tmpCrtPath; const crtPath = ctx.tmpCrtPath;
const keyPath = ctx.tmpKeyPath; const keyPath = ctx.tmpKeyPath;
sshClient.uploadFiles({ await sshClient.uploadFiles({
connectConf: sshConf, connectConf: sshConf,
transports: [ transports: [
{ {