Compare commits

...

13 Commits

Author SHA1 Message Date
xiaojunnuo
a4b6580247 v1.34.10 2025-06-03 23:56:13 +08:00
xiaojunnuo
84fb1c5127 build: prepare to build 2025-06-03 23:54:07 +08:00
xiaojunnuo
ddfd0fb81d perf: 支持部署到飞牛OS 2025-06-03 23:52:43 +08:00
xiaojunnuo
37edbf5824 perf: 支持日志写入文件 2025-06-03 18:16:35 +08:00
xiaojunnuo
e15212bf49 Merge branch 'v2' into v2-dev 2025-06-03 17:45:50 +08:00
xiaojunnuo
6a0cc1b1f3 perf: 优化流水线名称过长时的显示 2025-06-03 17:40:26 +08:00
xiaojunnuo
0e8339c701 perf: 阿里云CLB支持部署到扩展域名 2025-06-03 17:39:52 +08:00
greper
5d71a4dbde Merge pull request #409 from 5aaee9/v2
修复 FlexCDN 的问题
2025-06-03 11:09:24 +08:00
xiaojunnuo
0b78030c59 Merge remote-tracking branch 'origin/v2-dev' into v2-dev 2025-06-03 10:24:21 +08:00
xiaojunnuo
24237c16bf chore: 隐藏导出按钮 2025-06-03 10:23:28 +08:00
5aaee9
c48da5dea7 fix(flexcdn): fix cert upload and skipSslVerify required 2025-06-01 01:23:44 +08:00
xiaojunnuo
a12b824339 build: publish 2025-05-31 00:57:52 +08:00
xiaojunnuo
c4a743189e build: trigger build image 2025-05-31 00:57:34 +08:00
44 changed files with 676 additions and 158 deletions

View File

@@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Bug Fixes
* **flexcdn:** fix cert upload and skipSslVerify required ([c48da5d](https://github.com/certd/certd/commit/c48da5dea7f0f0cdeae643b106b4a678acc3b14b))
### Performance Improvements
* 阿里云CLB支持部署到扩展域名 ([0e8339c](https://github.com/certd/certd/commit/0e8339c70190890d449099e1d26e5ed06ff135fb))
* 优化流水线名称过长时的显示 ([6a0cc1b](https://github.com/certd/certd/commit/6a0cc1b1f3ad508f9e4093b3b682b163f12389eb))
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
* 支持日志写入文件 ([37edbf5](https://github.com/certd/certd/commit/37edbf5824d6aaae68ea1ef7259c6f739d418d2c))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Bug Fixes

View File

@@ -1 +1 @@
23:14
00:57

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Bug Fixes
* 修复Farcdn证书有效期错误的问题 ([1fe4c36](https://github.com/certd/certd/commit/1fe4c367f7128de9ba5e3395ae06bc81e63a7d5a))
### Performance Improvements
* 不止证书自动化,插件解锁无限可能 ([a9b302e](https://github.com/certd/certd/commit/a9b302e38d3328d75df8b2da3d8b914851e55e9c))
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
* 支持github 新版本检查并发布通知 ([356703c](https://github.com/certd/certd/commit/356703c83ea18c6efb8931402e181280d7b7e696))
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
### Bug Fixes

View File

@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.34.9"
"version": "1.34.10"
}

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.34.10](https://github.com/publishlab/node-acme-client/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/acme-client
## [1.34.9](https://github.com/publishlab/node-acme-client/compare/v1.34.8...v1.34.9) (2025-05-30)
**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.34.9",
"version": "1.34.10",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.34.9",
"@certd/basic": "^1.34.10",
"@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": "d876ea671137e7a4d99a23bb8a5baed06f119dfb"
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
}

View File

@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Performance Improvements
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
* 支持日志写入文件 ([37edbf5](https://github.com/certd/certd/commit/37edbf5824d6aaae68ea1ef7259c6f739d418d2c))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/basic

View File

@@ -1 +1 @@
00:54
23:54

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.34.9",
"version": "1.34.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -45,5 +45,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "d876ea671137e7a4d99a23bb8a5baed06f119dfb"
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
}

View File

@@ -18,16 +18,31 @@ const OutputAppender = {
},
};
let logFilePath = "./logs/app.log";
export function resetLogConfigure() {
// @ts-ignore
log4js.configure({
appenders: { std: { type: "stdout" }, output: { type: OutputAppender } },
categories: { default: { appenders: ["std"], level: "info" }, pipeline: { appenders: ["std", "output"], level: "info" } },
appenders: {
std: { type: "stdout" },
output: { type: OutputAppender },
file: {
type: "dateFile",
filename: logFilePath,
keepFileExt: true,
compress: true,
numBackups: 3,
},
},
categories: { default: { appenders: ["std", "file"], level: "info" }, pipeline: { appenders: ["std", "file", "output"], level: "info" } },
});
}
resetLogConfigure();
export const logger = log4js.getLogger("default");
export function resetLogFilePath(filePath: string) {
logFilePath = filePath;
resetLogConfigure();
}
export function buildLogger(write: (text: string) => void) {
const logger = log4js.getLogger("pipeline");
const _secrets: string[] = [];
@@ -41,8 +56,15 @@ export function buildLogger(write: (text: string) => void) {
if (item == null) {
continue;
}
//换成同长度的*号, item可能有多行
text = text.replaceAll(item, "*".repeat(item.length));
if (item.includes(text)) {
//整个包含
text = "*".repeat(text.length);
continue;
}
if (text.includes(item)) {
//换成同长度的*号, item可能有多行
text = text.replaceAll(item, "*".repeat(item.length));
}
}
write(text);
},

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Performance Improvements
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/pipeline

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.34.9",
"version": "1.34.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -17,8 +17,8 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.34.9",
"@certd/plus-core": "^1.34.9",
"@certd/basic": "^1.34.10",
"@certd/plus-core": "^1.34.10",
"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": "d876ea671137e7a4d99a23bb8a5baed06f119dfb"
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
}

View File

@@ -152,6 +152,16 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
this.logger = ctx.logger;
this.accessService = ctx.accessService;
this.http = ctx.http;
// 将证书加入secret
// @ts-ignore
if (this.cert && this.cert.crt && this.cert.key) {
//有证书
// @ts-ignore
const cert: any = this.cert;
this.registerSecret(cert.crt);
this.registerSecret(cert.key);
this.registerSecret(cert.one);
}
}
async getAccess<T = any>(accessId: string | number, isCommon = false) {
@@ -186,6 +196,14 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
return res as T;
}
registerSecret(value: string) {
// @ts-ignore
if (this.logger?.addSecret) {
// @ts-ignore
this.logger.addSecret(value);
}
}
randomFileId() {
return Math.random().toString(36).substring(2, 9);
}

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/lib-huawei
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/lib-huawei

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.34.9",
"version": "1.34.10",
"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": "d876ea671137e7a4d99a23bb8a5baed06f119dfb"
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
}

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/lib-iframe
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/lib-iframe

View File

@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.34.9",
"version": "1.34.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "d876ea671137e7a4d99a23bb8a5baed06f119dfb"
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
}

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/jdcloud
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/jdcloud

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/jdcloud",
"version": "1.34.9",
"version": "1.34.10",
"description": "jdcloud openApi sdk",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
@@ -61,5 +61,5 @@
"fetch"
]
},
"gitHead": "d876ea671137e7a4d99a23bb8a5baed06f119dfb"
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
}

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/lib-k8s
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/lib-k8s

View File

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

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/lib-server
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Performance Improvements

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.34.9",
"version": "1.34.10",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -27,10 +27,10 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.34.9",
"@certd/basic": "^1.34.9",
"@certd/pipeline": "^1.34.9",
"@certd/plus-core": "^1.34.9",
"@certd/acme-client": "^1.34.10",
"@certd/basic": "^1.34.10",
"@certd/pipeline": "^1.34.10",
"@certd/plus-core": "^1.34.10",
"@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": "d876ea671137e7a4d99a23bb8a5baed06f119dfb"
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
}

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/midway-flyway-js

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.34.9",
"version": "1.34.10",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "d876ea671137e7a4d99a23bb8a5baed06f119dfb"
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
}

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
**Note:** Version bump only for package @certd/plugin-cert
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Performance Improvements

View File

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

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Performance Improvements
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
**Note:** Version bump only for package @certd/plugin-lib

View File

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

View File

@@ -165,10 +165,16 @@ export class AsyncSsh2Client {
});
}
/**
*
* @param script
* @param opts {withStdErr 返回{stdOut,stdErr}}
*/
async exec(
script: string,
opts: {
throwOnStdErr?: boolean;
withStdErr?: boolean;
env?: any;
} = {}
): Promise<string> {
@@ -193,6 +199,7 @@ export class AsyncSsh2Client {
return;
}
let data = "";
let stdErr = "";
let hasErrorLog = false;
stream
.on("close", (code: any, signal: any) => {
@@ -205,7 +212,15 @@ export class AsyncSsh2Client {
}
if (code === 0) {
resolve(data);
if (opts.withStdErr === true) {
//@ts-ignore
resolve({
stdErr,
stdOut: data,
});
} else {
resolve(data);
}
} else {
reject(new Error(data));
}
@@ -221,7 +236,7 @@ export class AsyncSsh2Client {
})
.stderr.on("data", (ret: Buffer) => {
const err = this.convert(iconv, ret);
data += err;
stdErr += err;
hasErrorLog = true;
this.logger.error(`[${this.connConf.host}][error]: ` + err.trimEnd());
});
@@ -323,9 +338,6 @@ export class AsyncSsh2Client {
export class SshClient {
logger: ILogger;
constructor(logger: ILogger) {
this.logger = logger;
}
/**
*
* @param connectConf
@@ -382,6 +394,9 @@ export class SshClient {
},
});
}
constructor(logger: ILogger) {
this.logger = logger;
}
async scpUpload(options: { conn: any; localPath: string; remotePath: string; opts?: { mode?: string } }) {
const { conn, localPath, remotePath } = options;

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.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Performance Improvements
* 优化流水线名称过长时的显示 ([6a0cc1b](https://github.com/certd/certd/commit/6a0cc1b1f3ad508f9e4093b3b682b163f12389eb))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Performance Improvements

View File

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

View File

@@ -111,6 +111,11 @@ function install(app: App, options: any = {}) {
columnSizeSaver.clear();
},
},
buttons: {
export: {
show: false,
},
},
},
rowHandle: {
fixed: "right",

View File

@@ -44,46 +44,46 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
props: {
multiple: true,
crossPage: true,
selectedRowKeys
}
}
}
selectedRowKeys,
},
},
},
},
request: {
pageRequest,
addRequest,
editRequest,
delRequest
delRequest,
},
actionbar: {
buttons: {
add: {
show: false
}
}
show: false,
},
},
},
search: {
formItem: {
labelCol: {
style: {
// width: "100px"
}
},
},
wrapperCol: {
style: {
width: "50%"
}
}
}
width: "50%",
},
},
},
},
rowHandle: {
minWidth: 200,
fixed: "right",
buttons: {
edit: {
show: false
}
}
show: false,
},
},
},
columns: {
id: {
@@ -91,11 +91,11 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
key: "id",
type: "number",
column: {
width: 100
width: 100,
},
form: {
show: false
}
show: false,
},
},
userId: {
title: "用户Id",
@@ -103,69 +103,69 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
search: {
show: computed(() => {
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
})
}),
},
form: {
show: false
show: false,
},
column: {
show: computed(() => {
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
}),
width: 100
}
width: 100,
},
},
pipelineId: {
title: "流水线Id",
type: "number",
search: {
show: true
show: true,
},
form: {
show: false
show: false,
},
column: {
width: 100
}
width: 100,
},
},
pipelineTitle: {
title: "流水线名称",
type: "text",
search: {
show: true
show: true,
},
column: {
width: 300,
tooltip: true,
ellipsis: true,
cellRender: ({ row, value }) => {
return (
<router-link to={{ path: "/certd/pipeline/detail", query: { id: row.pipelineId, editMode: false, historyId: row.id } }}>{value}</router-link>
);
}
}
return <router-link to={{ path: "/certd/pipeline/detail", query: { id: row.pipelineId, editMode: false, historyId: row.id } }}>{value}</router-link>;
},
},
},
createTime: {
title: "创建时间",
type: "datetime",
form: {
show: false
show: false,
},
column: {
sorter: true,
width: 160,
align: "center"
}
align: "center",
},
},
updateTime: {
title: "更新时间",
type: "datetime",
form: {
show: false
show: false,
},
column: {
show: true
}
}
}
}
show: true,
},
},
},
},
};
}

View File

@@ -155,6 +155,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
show: true,
},
type: "text",
helper: "也支持填写CNAME域名",
form: {
rules: [{ required: true, message: "请输入IP" }],
},

View File

@@ -345,14 +345,12 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
},
column: {
width: 350,
// tooltip: true,
ellipsis: true,
sorter: true,
component: {
on: {
// 注意必须要on前缀
onClick({ row }) {
router.push({ path: "/certd/pipeline/detail", query: { id: row.id, editMode: "false" } });
},
},
showTitle: true,
cellRender: ({ row, value }) => {
return <router-link to={{ path: "/certd/pipeline/detail", query: { id: row.id, editMode: false } }}>{value}</router-link>;
},
},
},

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
### Bug Fixes
* **flexcdn:** fix cert upload and skipSslVerify required ([c48da5d](https://github.com/certd/certd/commit/c48da5dea7f0f0cdeae643b106b4a678acc3b14b))
### Performance Improvements
* 阿里云CLB支持部署到扩展域名 ([0e8339c](https://github.com/certd/certd/commit/0e8339c70190890d449099e1d26e5ed06ff135fb))
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
* 支持日志写入文件 ([37edbf5](https://github.com/certd/certd/commit/37edbf5824d6aaae68ea1ef7259c6f739d418d2c))
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.34.9",
"version": "1.34.10",
"description": "fast-server base midway",
"private": true,
"type": "module",
@@ -41,19 +41,19 @@
"@aws-sdk/client-acm": "^3.699.0",
"@aws-sdk/client-cloudfront": "^3.699.0",
"@aws-sdk/client-s3": "^3.705.0",
"@certd/acme-client": "^1.34.9",
"@certd/basic": "^1.34.9",
"@certd/commercial-core": "^1.34.9",
"@certd/jdcloud": "^1.34.9",
"@certd/lib-huawei": "^1.34.9",
"@certd/lib-k8s": "^1.34.9",
"@certd/lib-server": "^1.34.9",
"@certd/midway-flyway-js": "^1.34.9",
"@certd/pipeline": "^1.34.9",
"@certd/plugin-cert": "^1.34.9",
"@certd/plugin-lib": "^1.34.9",
"@certd/plugin-plus": "^1.34.9",
"@certd/plus-core": "^1.34.9",
"@certd/acme-client": "^1.34.10",
"@certd/basic": "^1.34.10",
"@certd/commercial-core": "^1.34.10",
"@certd/jdcloud": "^1.34.10",
"@certd/lib-huawei": "^1.34.10",
"@certd/lib-k8s": "^1.34.10",
"@certd/lib-server": "^1.34.10",
"@certd/midway-flyway-js": "^1.34.10",
"@certd/pipeline": "^1.34.10",
"@certd/plugin-cert": "^1.34.10",
"@certd/plugin-lib": "^1.34.10",
"@certd/plugin-plus": "^1.34.10",
"@certd/plus-core": "^1.34.10",
"@corsinvest/cv4pve-api-javascript": "^8.3.0",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",

View File

@@ -19,6 +19,12 @@ import path from 'path';
const env = process.env.NODE_ENV || 'development';
const development = {
midwayLogger: {
default: {
dir: './logs',
},
// ...
},
keys: 'certd',
koa: {
port: 7001,

View File

@@ -22,3 +22,4 @@ export * from './plugin-51dns/index.js'
export * from './plugin-notification/index.js'
export * from './plugin-flex/index.js'
export * from './plugin-farcdn/index.js'
export * from './plugin-fnos/index.js'

View File

@@ -1,13 +1,21 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
import { CertInfo } from '@certd/plugin-cert';
import { AliyunAccess, AliyunClient, AliyunSslClient, CasCertInfo, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib';
import { CertApplyPluginNames} from '@certd/plugin-cert';
import {AbstractTaskPlugin, IsTaskPlugin, PageReq, pluginGroups, RunStrategy, TaskInput} from '@certd/pipeline';
import {CertInfo} from '@certd/plugin-cert';
import {
AliyunAccess,
AliyunClient,
AliyunSslClient,
CasCertInfo,
createCertDomainGetterInputDefine,
createRemoteSelectInputDefine
} from '@certd/plugin-lib';
import {CertApplyPluginNames} from '@certd/plugin-cert';
@IsTaskPlugin({
name: 'AliyunDeployCertToSLB',
title: '阿里云-部署至SLB(传统负载均衡)',
title: '阿里云-部署至CLB(传统负载均衡)',
icon: 'svg:icon-aliyun',
group: pluginGroups.aliyun.key,
desc: '部署证书到阿里云SLB(传统负载均衡)',
desc: '部署证书到阿里云CLB(传统负载均衡)',
needPlus: false,
default: {
strategy: {
@@ -27,9 +35,27 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
})
cert!: CertInfo | number;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
@TaskInput(createCertDomainGetterInputDefine({props: {required: false}}))
certDomains!: string[];
@TaskInput({
title: '证书接入点',
helper: '不会选就保持默认即可',
value: 'cas.aliyuncs.com',
component: {
name: 'a-select',
options: [
{value: 'cas.aliyuncs.com', label: '中国大陆'},
{value: 'cas.ap-southeast-1.aliyuncs.com', label: '新加坡'},
{value: 'cas.eu-central-1.aliyuncs.com', label: '德国(法兰克福)'},
],
},
required: true,
})
casEndpoint!: string;
@TaskInput({
title: 'Access授权',
helper: '阿里云授权AccessKeyId、AccessKeySecret',
@@ -41,10 +67,11 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
})
accessId!: string;
@TaskInput(
createRemoteSelectInputDefine({
title: 'LB所在地区',
typeName: 'AliyunDeployCertToSLB',
multi: false,
action: AliyunDeployCertToSLB.prototype.onGetRegionList.name,
watches: ['accessId'],
@@ -56,7 +83,6 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
createRemoteSelectInputDefine({
title: '负载均衡列表',
helper: '要部署证书的负载均衡ID',
typeName: 'AliyunDeployCertToSLB',
action: AliyunDeployCertToSLB.prototype.onGetLoadBalanceList.name,
watches: ['regionId'],
})
@@ -67,33 +93,59 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
createRemoteSelectInputDefine({
title: '监听器列表',
helper: '要部署证书的监听器列表',
typeName: 'AliyunDeployCertToSLB',
action: AliyunDeployCertToSLB.prototype.onGetListenerList.name,
watches: ['loadBalancers'],
})
)
listeners!: string[];
@TaskInput({
title: '证书接入点',
helper: '不会选就保持默认即可',
value: 'cas.aliyuncs.com',
component: {
name: 'a-select',
options: [
{ value: 'cas.aliyuncs.com', label: '中国大陆' },
{ value: 'cas.ap-southeast-1.aliyuncs.com', label: '新加坡' },
{ value: 'cas.eu-central-1.aliyuncs.com', label: '德国(法兰克福)' },
],
},
required: true,
})
casEndpoint!: string;
async onInstance() {}
@TaskInput({
title: "部署默认证书",
value: true,
component: {
name: "a-switch",
vModel: "checked"
}
}
)
deployDefault!: boolean;
@TaskInput({
title: "部署扩展证书",
value: false,
component: {
name: "a-switch",
vModel: "checked"
}
}
)
deployExtension!: boolean;
@TaskInput(
createRemoteSelectInputDefine({
title: '扩展域名列表',
helper: '要部署扩展域名列表',
action: AliyunDeployCertToSLB.prototype.onGetExtensionDomainList.name,
watches: ['listeners','deployExtension'],
mergeScript:`
return {
show: ctx.compute(({form})=>{
return form.deployExtension;
})
}
`
})
)
extensionDomains!: string[];
async onInstance() {
}
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';
await client.init({
accessKeyId: access.accessKeyId,
@@ -106,30 +158,76 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
}
async execute(): Promise<void> {
this.logger.info(`开始部署证书到阿里云(slb)`);
this.logger.info(`开始部署证书到阿里云(clb)`);
const access = await this.getAccess<AliyunAccess>(this.accessId);
const client = await this.getLBClient(access, this.regionId);
const aliyunCert = await this.getAliyunCertId(access);
const slbServerCertId = await this.uploadServerCert(client, aliyunCert);
for (const listener of this.listeners) {
const arr = listener.split('_');
const loadBalanceId = arr[0];
const port = arr[2];
const params = {
RegionId: this.regionId,
LoadBalancerId: loadBalanceId,
ListenerPort: parseInt(port),
ServerCertificateId: slbServerCertId,
};
const res = await client.request('SetLoadBalancerHTTPSListenerAttribute', params);
this.checkRet(res);
this.logger.info(`部署${listener}监听器证书成功`, JSON.stringify(res));
if (this.deployDefault!==false) {
this.logger.info("部署监听器默认证书")
for (const listener of this.listeners) {
const {port, loadBalanceId} = this.resolveListenerKey(listener)
const params = {
RegionId: this.regionId,
LoadBalancerId: loadBalanceId,
ListenerPort: port,
ServerCertificateId: slbServerCertId,
};
const res = await client.request('SetLoadBalancerHTTPSListenerAttribute', params);
this.checkRet(res);
this.logger.info(`部署${listener}监听器证书成功`, JSON.stringify(res));
}
}
if (this.deployExtension) {
this.logger.info("部署监听器扩展域名证书")
const clientV2 = this.getCLBClientV2(access);
for (const domainStr of this.extensionDomains) {
const {extensionDomainId} = this.resolveListenerKey(domainStr)
const res = await clientV2.doRequest({
action: "SetDomainExtensionAttribute",
// 接口版本
version: "2014-05-15",
data: {
query: {
RegionId: this.regionId,
DomainExtensionId: extensionDomainId,
ServerCertificateId: slbServerCertId
}
}
})
this.logger.info(`部署扩展域名${extensionDomainId}证书成功`, JSON.stringify(res))
}
}
this.logger.info('执行完成');
}
getCLBClientV2(access: AliyunAccess) {
return access.getClient("slb.aliyuncs.com")
}
resolveListenerKey(listener: string) {
const arr = listener.split('_');
const loadBalanceId = arr[0];
const protocol = arr[1];
const port = arr[2];
let extensionDomainId = undefined;
if (arr.length > 3) {
extensionDomainId = arr[3];
}
return {
loadBalanceId,
port: parseInt(port),
extensionDomainId: extensionDomainId,
protocol: protocol
}
}
async uploadServerCert(client: any, aliyunCert: CasCertInfo) {
const params = {
RegionId: this.regionId,
@@ -248,6 +346,78 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
});
}
async onGetExtensionDomainList(data: PageReq) {
if (!this.accessId) {
throw new Error('请先选择Access授权');
}
if (!this.regionId) {
throw new Error('请先选择地区');
}
if (!this.listeners && this.listeners.length == 0) {
throw new Error('请先选择监听器');
}
const access = await this.getAccess<AliyunAccess>(this.accessId);
const allDomains: any[] = []
for (const ls of this.listeners) {
const {port, loadBalanceId, protocol} = this.resolveListenerKey(ls)
const domains = await this.doGetExtensionDomainList({
access,
loadBalancerId: loadBalanceId,
listenerPort: port,
listenerProtocol: protocol,
});
allDomains.push(...domains)
}
return this.ctx.utils.options.buildGroupOptions(allDomains, this.certDomains)
}
async doGetExtensionDomainList(data: {
loadBalancerId: string,
listenerPort: number,
listenerProtocol: string,
access: AliyunAccess
}) {
const {loadBalancerId, listenerPort, listenerProtocol, access} = data;
const client = access.getClient("slb.aliyuncs.com")
let queries = {
RegionId: this.regionId,
LoadBalancerId: loadBalancerId,
ListenerPort: listenerPort
};
const res = await client.doRequest({
// 接口名称
action: "DescribeDomainExtensions",
// 接口版本
version: "2014-05-15",
data: {
query: queries,
}
})
this.checkRet(res);
const list = res?.DomainExtensions.DomainExtension;
if (!list || list.length === 0) {
return []
}
return list.map((i: any) => {
const value = `${loadBalancerId}_${listenerProtocol ?? "HTTPS"}_${listenerPort}_${i.DomainExtensionId}`;
const label = `${i.DomainExtensionId}<${i.Domain}>`;
return {
value: value,
label: label,
domain:i.Domain
};
});
}
checkRet(ret: any) {
if (ret.Code != null) {
throw new Error(ret.Message);

View File

@@ -78,7 +78,8 @@ export class FlexCDNAccess extends BaseAccess {
vModel: "checked"
},
encrypt: false,
required: true
required: true,
value: false,
})
skipSslVerify!: boolean;

View File

@@ -1,5 +1,5 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { CertApplyPluginNames, CertInfo,CertReader } from "@certd/plugin-cert";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { FlexCDNAccess } from "../access.js";
import { FlexCDNClient } from "../client.js";
@@ -83,7 +83,24 @@ export class FlexCDNRefreshCert extends AbstractTaskPlugin {
const sslCert = JSON.parse(this.ctx.utils.hash.base64Decode(res.sslCertJSON))
this.logger.info(`证书信息:${sslCert.name}${sslCert.dnsNames}`);
const certReader = new CertReader(this.cert)
/**
* commonNames: commonNames,
* dnsNames: dnsNames,
* timeBeginAt: Math.floor((new Date(currentInfo.validFrom)).getTime() / 1000),
* timeEndAt: Math.floor((new Date(currentInfo.validTo)).getTime() / 1000),
*
*/
const commonNames =[ certReader.getMainDomain()]
const dnsNames = certReader.getAltNames()
const timeBeginAt = Math.floor(certReader.detail.notBefore.getTime() / 1000);
const timeEndAt = Math.floor(certReader.detail.notAfter.getTime() / 1000);
const body = {
...sslCert, // inherit old cert info like name and description
commonNames,
dnsNames,
timeBeginAt,
timeEndAt,
name: sslCert.name,
sslCertId: item,
certData: this.ctx.utils.hash.base64(this.cert.crt),
@@ -122,7 +139,7 @@ export class FlexCDNRefreshCert extends AbstractTaskPlugin {
const options = list.map((item: any) => {
return {
label: `${item.name}<${item.id}-${item.dnsNames[0]}>`,
label: `${item.name}<${item.id}-${item.dnsNames?.[0]}>`,
value: item.id,
domain: item.dnsNames
};

View File

@@ -0,0 +1,170 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import {
createCertDomainGetterInputDefine,
createRemoteSelectInputDefine,
SshAccess,
SshClient
} from "@certd/plugin-lib";
@IsTaskPlugin({
//命名规范,插件类型+功能就是目录plugin-demo中的demo大写字母开头驼峰命名
name: "FnOSDeployToNAS",
title: "飞牛NAS-部署证书",
icon: "svg:icon-lucky",
//插件分组
group: pluginGroups.panel.key,
needPlus: false,
default: {
//默认值配置照抄即可
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed
}
}
})
//类名规范跟上面插件名称name一致
export class FnOSDeployToNAS extends AbstractTaskPlugin {
//证书选择,此项必须要有
@TaskInput({
title: "域名证书",
helper: "请选择前置任务输出的域名证书",
component: {
name: "output-selector",
from: [...CertApplyPluginNames]
}
// required: true, // 必填
})
cert!: CertInfo;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[];
//授权选择框
@TaskInput({
title: "飞牛SSH授权",
component: {
name: "access-selector",
type: "ssh" //固定授权类型
},
helper:"请先配置sudo免密\nsudo visudo\n#在文件最后一行增加以下内容需要将username替换成自己的用户名\nusername ALL=(ALL) NOPASSWD: NOPASSWD: ALL\nctrl+x 保存退出",
required: true //必填
})
accessId!: string;
@TaskInput(
createRemoteSelectInputDefine({
title: "证书Id",
helper: "要更新的证书id",
action: FnOSDeployToNAS.prototype.onGetCertList.name
})
)
certList!: number[];
//插件实例化时执行的方法
async onInstance() {
}
//插件执行方法
async execute(): Promise<void> {
const access: SshAccess = await this.getAccess<SshAccess>(this.accessId);
const client = new SshClient(this.logger);
//复制证书
const list = await this.doGetCertList()
for (const target of this.certList) {
this.logger.info(`----------- 准备部署:${target}`);
let found = false
for (const item of list) {
if (item.sum === target) {
this.logger.info(`----------- 找到证书,开始部署:${item.sum},${item.domain}`)
const certPath = item.certificate;
const keyPath = item.privateKey;
const cmd = `
sudo tee ${certPath} > /dev/null <<'EOF'
${this.cert.crt}
EOF
sudo tee ${keyPath} > /dev/null <<'EOF'
${this.cert.key}
EOF
`
const res = await client.exec({
connectConf: access,
script: cmd
});
if (res.indexOf("Permission denied") > -1){
this.logger.error("权限不足,请先配置 sudo 免密")
}
found = true
break
}
}
if (!found) {
throw new Error(`没有找到证书:${target}请修改任务重新选择证书id`);
}
}
this.logger.info("证书已上传,准备重启...");
const restartCmd= `
echo "正在重启相关服务..."
systemctl restart webdav.service
systemctl restart smbftpd.service
systemctl restart trim_nginx.service
echo "服务重启完成!"
`
await client.exec({
connectConf: access,
script: restartCmd
});
this.logger.info("部署完成");
}
async doGetCertList(){
const access: SshAccess = await this.getAccess<SshAccess>(this.accessId);
const client = new SshClient(this.logger);
/**
* :/usr/trim/etc$ cat network_cert_all.conf | jq .
*/
const sslListCmd = "cat /usr/trim/etc/network_cert_all.conf | jq ."
const res:string = await client.exec({
connectConf: access,
script: sslListCmd
});
let list = []
try{
list = JSON.parse(res.trim())
}catch (e){
throw new Error(`证书列表解析失败:${res}`)
}
if (!list || list.length === 0) {
throw new Error("没有找到证书,请先在证书管理也没上传一次证书");
}
return list
}
async onGetCertList() {
const list = await this.doGetCertList()
const options = list.map((item: any) => {
return {
label: `${item.domain}<${item.used?'已使用':"未使用"}-${item.sum}>`,
value: item.sum,
domain: item.san
};
});
return this.ctx.utils.options.buildGroupOptions(options, this.certDomains);
}
}
new FnOSDeployToNAS();