Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6fe2d2c328 | ||
|
|
20f5865bb9 | ||
|
|
2b224c712f | ||
|
|
c446e24f1a | ||
|
|
2623f45a3b | ||
|
|
52e7208e8f | ||
|
|
d1498a7160 | ||
|
|
5c270b6b9d | ||
|
|
18718f6a25 | ||
|
|
653f409d91 | ||
|
|
0f0af2f309 | ||
|
|
7908ab79da | ||
|
|
ae3daa9bcf | ||
|
|
01df4d0f1d | ||
|
|
25ff6906c6 | ||
|
|
695548eade | ||
|
|
6221a4e464 | ||
|
|
115b819c66 | ||
|
|
bceb8cce0d | ||
|
|
8d2cf2095c | ||
|
|
1b1a1a5bc2 | ||
|
|
935ebe022a | ||
|
|
ff356571c8 | ||
|
|
76fb2141e4 | ||
|
|
b220500f40 | ||
|
|
1cbf70fb6a | ||
|
|
52ec48656d | ||
|
|
fddf3a0f68 | ||
|
|
98520a1213 | ||
|
|
d65d94b784 | ||
|
|
00f1e0da59 | ||
|
|
65ef685729 | ||
|
|
6e344140c6 | ||
|
|
97a01b6f6d |
2
.github/workflows/build-image.yml
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
# cache: 'npm'
|
# cache: 'npm'
|
||||||
# working-directory: ./packages/ui/certd-client
|
# working-directory: ./packages/ui/certd-client
|
||||||
- run: |
|
- run: |
|
||||||
npm install -g pnpm
|
npm install -g pnpm@8.15.7
|
||||||
pnpm install
|
pnpm install
|
||||||
npm run build
|
npm run build
|
||||||
working-directory: ./packages/ui/certd-client
|
working-directory: ./packages/ui/certd-client
|
||||||
|
|||||||
20
CHANGELOG.md
@@ -3,6 +3,26 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.24.4](https://github.com/certd/certd/compare/v1.24.3...v1.24.4) (2024-09-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复腾讯云cdn证书部署后会自动关闭hsts,http2.0等配置的bug ([7908ab7](https://github.com/certd/certd/commit/7908ab79da624c94fa05849925b15e480e3317c4))
|
||||||
|
* 修复腾讯云tke证书部署报错的bug ([653f409](https://github.com/certd/certd/commit/653f409d91a441850d6381f89a8dd390831f0d5e))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 插件选择支持搜索 ([d1498a7](https://github.com/certd/certd/commit/d1498a71601b74d38343b1d070eadd03705dd9d5))
|
||||||
|
* 前置任务步骤增加错误提示 ([ae3daa9](https://github.com/certd/certd/commit/ae3daa9bcf4fc363825aad9b77f5d3879aeeff70))
|
||||||
|
* 群晖部署教程 ([0f0af2f](https://github.com/certd/certd/commit/0f0af2f309390f388e7a272cea3a1dd30c01977d))
|
||||||
|
* 支持群晖 ([5c270b6](https://github.com/certd/certd/commit/5c270b6b9d45a2152f9fdb3c07bd98b7c803cb8e))
|
||||||
|
|
||||||
|
## [1.24.3](https://github.com/certd/certd/compare/v1.24.2...v1.24.3) (2024-09-06)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 支持多吉云cdn证书部署 ([65ef685](https://github.com/certd/certd/commit/65ef6857296784ca765926e09eafcb6fc8b6ecde))
|
||||||
|
|
||||||
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -157,17 +157,18 @@ docker compose up -d
|
|||||||
* [腾讯云](./doc/tencent/tencent.md)
|
* [腾讯云](./doc/tencent/tencent.md)
|
||||||
* [windows主机](./doc/host/host.md)
|
* [windows主机](./doc/host/host.md)
|
||||||
* [google证书](./doc/google/google.md)
|
* [google证书](./doc/google/google.md)
|
||||||
|
* [群晖部署certd及证书更新教程](./doc/synology/index.md)
|
||||||
|
|
||||||
|
|
||||||
## 八、问题处理
|
## 八、问题处理
|
||||||
### 7.1 忘记管理员密码
|
### 7.1 忘记管理员密码
|
||||||
解决方法如下:
|
解决方法如下:
|
||||||
1. 修改docker-compose.yaml文件,将环境变量`certd_system_resetAdminPassword`改为`true`
|
1. 修改docker-compose.yaml文件,将环境变量`certd_system_resetAdminPasswd`改为`true`
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
certd:
|
certd:
|
||||||
environment: # 环境变量
|
environment: # 环境变量
|
||||||
- certd_system_resetAdminPassword=false
|
- certd_system_resetAdminPasswd=false
|
||||||
```
|
```
|
||||||
2. 重启容器
|
2. 重启容器
|
||||||
```shell
|
```shell
|
||||||
@@ -175,7 +176,7 @@ docker compose up -d
|
|||||||
docker logs -f --tail 500 certd
|
docker logs -f --tail 500 certd
|
||||||
# 观察日志,当日志中输出“重置1号管理员用户的密码完成”,即可操作下一步
|
# 观察日志,当日志中输出“重置1号管理员用户的密码完成”,即可操作下一步
|
||||||
```
|
```
|
||||||
3. 修改docker-compose.yaml,将`certd_system_resetAdminPassword`改回`false`
|
3. 修改docker-compose.yaml,将`certd_system_resetAdminPasswd`改回`false`
|
||||||
4. 再次重启容器
|
4. 再次重启容器
|
||||||
```shell
|
```shell
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
23:58
|
7
|
||||||
|
|||||||
BIN
doc/synology/images/1.png
Normal file
|
After Width: | Height: | Size: 205 KiB |
BIN
doc/synology/images/2.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
doc/synology/images/3.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
doc/synology/images/4.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
doc/synology/images/5.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
doc/synology/images/6.png
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
doc/synology/images/deploy.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
41
doc/synology/index.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# 群晖部署和证书更新
|
||||||
|
|
||||||
|
|
||||||
|
## 一、群晖系统上部署Certd教程
|
||||||
|
|
||||||
|
### 1. 打开Container Manager
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 2. 新增项目
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 3. 配置Certd项目
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 4. 外网访问设置
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 5. 确认项目信息
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
点击完成安装,等待certd启动完成即可
|
||||||
|
|
||||||
|
### 6. 门户配置向导【可选】
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 二、更新群晖证书
|
||||||
|
|
||||||
|
## 1. 前提条件
|
||||||
|
* 已经部署了certd
|
||||||
|
* 群晖上已经设置好了证书(证书建议设置好描述,插件需要根据描述查找证书)
|
||||||
|
|
||||||
|
## 2. 在certd上配置自动更新群晖证书插件
|
||||||
|

|
||||||
@@ -9,5 +9,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmClient": "pnpm",
|
"npmClient": "pnpm",
|
||||||
"version": "1.24.2"
|
"version": "1.24.4"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.24.4](https://github.com/publishlab/node-acme-client/compare/v1.24.3...v1.24.4) (2024-09-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
|
## [1.24.3](https://github.com/publishlab/node-acme-client/compare/v1.24.2...v1.24.3) (2024-09-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/acme-client
|
||||||
|
|
||||||
## [1.24.2](https://github.com/publishlab/node-acme-client/compare/v1.24.1...v1.24.2) (2024-09-06)
|
## [1.24.2](https://github.com/publishlab/node-acme-client/compare/v1.24.1...v1.24.2) (2024-09-06)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
"description": "Simple and unopinionated ACME client",
|
"description": "Simple and unopinionated ACME client",
|
||||||
"private": false,
|
"private": false,
|
||||||
"author": "nmorsman",
|
"author": "nmorsman",
|
||||||
"version": "1.24.2",
|
"version": "1.24.4",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"types": "types/index.d.ts",
|
"types": "types/index.d.ts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"homepage": "https://github.com/publishlab/node-acme-client",
|
"homepage": "https://github.com/publishlab/node-acme-client",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 16"
|
"node": ">= 18"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"src",
|
"src",
|
||||||
@@ -59,5 +59,5 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||||
},
|
},
|
||||||
"gitHead": "bef6b981e26a010a797734e508de6822de8564f5"
|
"gitHead": "c49ccbde93dbad7062ac39d4f18eca7d561f573f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.24.4](https://github.com/certd/certd/compare/v1.24.3...v1.24.4) (2024-09-09)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 前置任务步骤增加错误提示 ([ae3daa9](https://github.com/certd/certd/commit/ae3daa9bcf4fc363825aad9b77f5d3879aeeff70))
|
||||||
|
* 群晖部署教程 ([0f0af2f](https://github.com/certd/certd/commit/0f0af2f309390f388e7a272cea3a1dd30c01977d))
|
||||||
|
* 支持群晖 ([5c270b6](https://github.com/certd/certd/commit/5c270b6b9d45a2152f9fdb3c07bd98b7c803cb8e))
|
||||||
|
|
||||||
|
## [1.24.3](https://github.com/certd/certd/compare/v1.24.2...v1.24.3) (2024-09-06)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 支持多吉云cdn证书部署 ([65ef685](https://github.com/certd/certd/commit/65ef6857296784ca765926e09eafcb6fc8b6ecde))
|
||||||
|
|
||||||
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
22:33
|
17:29
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/pipeline",
|
"name": "@certd/pipeline",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.24.2",
|
"version": "1.24.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -57,5 +57,5 @@
|
|||||||
"vite": "^4.3.8",
|
"vite": "^4.3.8",
|
||||||
"vue-tsc": "^1.6.5"
|
"vue-tsc": "^1.6.5"
|
||||||
},
|
},
|
||||||
"gitHead": "bef6b981e26a010a797734e508de6822de8564f5"
|
"gitHead": "c49ccbde93dbad7062ac39d4f18eca7d561f573f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import { AxiosInstance } from "axios";
|
|
||||||
import { IContext } from "../core/index.js";
|
import { IContext } from "../core/index.js";
|
||||||
|
|
||||||
export type HttpClient = AxiosInstance;
|
|
||||||
export type UserContext = IContext;
|
export type UserContext = IContext;
|
||||||
export type PipelineContext = IContext;
|
export type PipelineContext = IContext;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export class Executor {
|
|||||||
await this.notification("success");
|
await this.notification("success");
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
await this.notification("error", e);
|
await this.notification("error", e);
|
||||||
this.logger.error("pipeline 执行失败", e.stack);
|
this.logger.error("pipeline 执行失败", e);
|
||||||
} finally {
|
} finally {
|
||||||
clearInterval(intervalFlushLogId);
|
clearInterval(intervalFlushLogId);
|
||||||
await this.onChanged(this.runtime);
|
await this.onChanged(this.runtime);
|
||||||
@@ -217,11 +217,17 @@ export class Executor {
|
|||||||
if (item.component?.name === "pi-output-selector") {
|
if (item.component?.name === "pi-output-selector") {
|
||||||
const contextKey = input[key];
|
const contextKey = input[key];
|
||||||
if (contextKey != null) {
|
if (contextKey != null) {
|
||||||
|
if (typeof contextKey !== "string") {
|
||||||
|
throw new Error(`步骤${step.title}的${item.title}属性必须为String类型,请重新配置该属性`);
|
||||||
|
}
|
||||||
// "cert": "step.-BNFVPMKPu2O-i9NiOQxP.cert",
|
// "cert": "step.-BNFVPMKPu2O-i9NiOQxP.cert",
|
||||||
const arr = contextKey.split(".");
|
const arr = contextKey.split(".");
|
||||||
const id = arr[1];
|
const id = arr[1];
|
||||||
const outputKey = arr[2];
|
const outputKey = arr[2];
|
||||||
input[key] = this.currentStatusMap.get(id)?.status?.output[outputKey] ?? this.lastStatusMap.get(id)?.status?.output[outputKey];
|
input[key] = this.currentStatusMap.get(id)?.status?.output[outputKey] ?? this.lastStatusMap.get(id)?.status?.output[outputKey];
|
||||||
|
if (input[key] == null) {
|
||||||
|
this.logger.warn(`${item.title}的配置未找到对应的输出值,请确认对应的前置任务是否存在或者是否执行正确`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -231,14 +237,13 @@ export class Executor {
|
|||||||
//判断是否需要跳过
|
//判断是否需要跳过
|
||||||
const lastNode = this.lastStatusMap.get(step.id);
|
const lastNode = this.lastStatusMap.get(step.id);
|
||||||
const lastResult = lastNode?.status?.status;
|
const lastResult = lastNode?.status?.status;
|
||||||
|
let inputChanged = true;
|
||||||
|
const lastInputHash = lastNode?.status?.inputHash;
|
||||||
|
if (lastInputHash && newInputHash && lastInputHash === newInputHash) {
|
||||||
|
//参数有变化
|
||||||
|
inputChanged = false;
|
||||||
|
}
|
||||||
if (step.strategy?.runStrategy === RunStrategy.SkipWhenSucceed) {
|
if (step.strategy?.runStrategy === RunStrategy.SkipWhenSucceed) {
|
||||||
//如果是成功后跳过策略
|
|
||||||
let inputChanged = true;
|
|
||||||
const lastInputHash = lastNode?.status?.inputHash;
|
|
||||||
if (lastInputHash && newInputHash && lastInputHash === newInputHash) {
|
|
||||||
//参数有变化
|
|
||||||
inputChanged = false;
|
|
||||||
}
|
|
||||||
if (lastResult != null && lastResult === ResultType.success && !inputChanged) {
|
if (lastResult != null && lastResult === ResultType.success && !inputChanged) {
|
||||||
step.status!.output = lastNode?.status?.output;
|
step.status!.output = lastNode?.status?.output;
|
||||||
step.status!.files = lastNode?.status?.files;
|
step.status!.files = lastNode?.status?.files;
|
||||||
@@ -253,6 +258,7 @@ export class Executor {
|
|||||||
lastStatus,
|
lastStatus,
|
||||||
http,
|
http,
|
||||||
logger: currentLogger,
|
logger: currentLogger,
|
||||||
|
inputChanged,
|
||||||
accessService: this.options.accessService,
|
accessService: this.options.accessService,
|
||||||
emailService: this.options.emailService,
|
emailService: this.options.emailService,
|
||||||
pipelineContext: this.pipelineContext,
|
pipelineContext: this.pipelineContext,
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ export class RunHistory {
|
|||||||
|
|
||||||
logError(runnable: Runnable, e: Error) {
|
logError(runnable: Runnable, e: Error) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const errorInfo = runnable.runnableType == "step" ? e.stack : e.message;
|
const errorInfo = runnable.runnableType === "step" ? e : e.message;
|
||||||
this._loggers[runnable.id].error(`[${runnable.runnableType}] [${runnable.title}]<id:${runnable.id}> :${errorInfo}`);
|
this._loggers[runnable.id].error(`[${runnable.runnableType}] [${runnable.title}]<id:${runnable.id}> :`, errorInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
finally(runnable: Runnable) {
|
finally(runnable: Runnable) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { Logger } from "log4js";
|
|||||||
import { IAccessService } from "../access/index.js";
|
import { IAccessService } from "../access/index.js";
|
||||||
import { IEmailService } from "../service/index.js";
|
import { IEmailService } from "../service/index.js";
|
||||||
import { IContext } from "../core/index.js";
|
import { IContext } from "../core/index.js";
|
||||||
import { AxiosInstance } from "axios";
|
|
||||||
import { ILogger, logger } from "../utils/index.js";
|
import { ILogger, logger } from "../utils/index.js";
|
||||||
|
import { HttpClient } from "../utils/util.request";
|
||||||
|
|
||||||
export enum ContextScope {
|
export enum ContextScope {
|
||||||
global,
|
global,
|
||||||
@@ -60,11 +60,12 @@ export type TaskInstanceContext = {
|
|||||||
pipeline: Pipeline;
|
pipeline: Pipeline;
|
||||||
step: Step;
|
step: Step;
|
||||||
logger: Logger;
|
logger: Logger;
|
||||||
|
inputChanged: boolean;
|
||||||
accessService: IAccessService;
|
accessService: IAccessService;
|
||||||
emailService: IEmailService;
|
emailService: IEmailService;
|
||||||
pipelineContext: IContext;
|
pipelineContext: IContext;
|
||||||
userContext: IContext;
|
userContext: IContext;
|
||||||
http: AxiosInstance;
|
http: HttpClient;
|
||||||
fileStore: FileStore;
|
fileStore: FileStore;
|
||||||
lastStatus?: Runnable;
|
lastStatus?: Runnable;
|
||||||
signal: AbortSignal;
|
signal: AbortSignal;
|
||||||
|
|||||||
@@ -21,5 +21,6 @@ export const pluginGroups = {
|
|||||||
huawei: new PluginGroup("huawei", "华为云", 3),
|
huawei: new PluginGroup("huawei", "华为云", 3),
|
||||||
tencent: new PluginGroup("tencent", "腾讯云", 4),
|
tencent: new PluginGroup("tencent", "腾讯云", 4),
|
||||||
host: new PluginGroup("host", "主机", 5),
|
host: new PluginGroup("host", "主机", 5),
|
||||||
|
cdn: new PluginGroup("cdn", "CDN", 6),
|
||||||
other: new PluginGroup("other", "其他", 7),
|
other: new PluginGroup("other", "其他", 7),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import sleep from "./util.sleep.js";
|
import sleep from "./util.sleep.js";
|
||||||
import { request } from "./util.request.js";
|
import { http } from "./util.request.js";
|
||||||
|
export * from "./util.request.js";
|
||||||
export * from "./util.log.js";
|
export * from "./util.log.js";
|
||||||
export * from "./util.file.js";
|
export * from "./util.file.js";
|
||||||
export * from "./util.sp.js";
|
export * from "./util.sp.js";
|
||||||
@@ -7,5 +8,5 @@ export * as promises from "./util.promise.js";
|
|||||||
export * from "./util.hash.js";
|
export * from "./util.hash.js";
|
||||||
export const utils = {
|
export const utils = {
|
||||||
sleep,
|
sleep,
|
||||||
http: request,
|
http,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,29 +1,39 @@
|
|||||||
import axios from "axios";
|
import axios, { AxiosRequestConfig } from "axios";
|
||||||
import { logger } from "./util.log.js";
|
import { logger } from "./util.log.js";
|
||||||
import { Logger } from "log4js";
|
import { Logger } from "log4js";
|
||||||
|
|
||||||
export class HttpError extends Error {
|
export class HttpError extends Error {
|
||||||
request?: { url: string; method: string; data?: any };
|
|
||||||
response?: { data: any };
|
|
||||||
status?: number;
|
status?: number;
|
||||||
statusText?: string;
|
statusText?: string;
|
||||||
|
code?: string;
|
||||||
|
request?: { url: string; method: string; params?: any; data?: any };
|
||||||
|
response?: { data: any };
|
||||||
|
cause?: any;
|
||||||
constructor(error: any) {
|
constructor(error: any) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
super(error.message);
|
super(error.message);
|
||||||
this.name = error.name;
|
this.name = error.name;
|
||||||
this.stack = error.stack;
|
this.code = error.code;
|
||||||
this.status = error?.response?.status;
|
this.cause = error.cause;
|
||||||
this.statusText = error?.response?.statusText;
|
|
||||||
|
this.status = error.response?.status;
|
||||||
|
this.statusText = error.response?.statusText;
|
||||||
this.request = {
|
this.request = {
|
||||||
url: error?.response?.config?.url,
|
url: error.config?.url,
|
||||||
method: error?.response?.config?.method,
|
method: error.config?.method,
|
||||||
data: error?.response?.config?.data,
|
params: error.config?.params,
|
||||||
|
data: error.config?.data,
|
||||||
};
|
};
|
||||||
this.response = {
|
this.response = {
|
||||||
data: error?.response?.data,
|
data: error.response?.data,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
delete error.response;
|
||||||
|
delete error.config;
|
||||||
|
delete error.request;
|
||||||
|
logger.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -35,7 +45,7 @@ export function createAxiosService({ logger }: { logger: Logger }) {
|
|||||||
// 请求拦截
|
// 请求拦截
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
(config: any) => {
|
(config: any) => {
|
||||||
logger.info(`http request:${config.url},method:${config.method}`);
|
logger.info(`http request:${config.url},method:${config.method},params:${JSON.stringify(config.params)}`);
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
(error: Error) => {
|
(error: Error) => {
|
||||||
@@ -67,9 +77,13 @@ export function createAxiosService({ logger }: { logger: Logger }) {
|
|||||||
// default: break
|
// default: break
|
||||||
// }
|
// }
|
||||||
logger.error(
|
logger.error(
|
||||||
`请求出错:status:${error?.response?.status},statusText:${error?.response?.statusText},url:${error?.config?.url},method:${error?.config?.method}。`
|
`请求出错:status:${error.response?.status},statusText:${error.response?.statusText},url:${error.config?.url},method:${error.config?.method}。`
|
||||||
);
|
);
|
||||||
logger.error("返回数据:", JSON.stringify(error?.response?.data));
|
logger.error("返回数据:", JSON.stringify(error.response?.data));
|
||||||
|
|
||||||
|
if (error instanceof AggregateError) {
|
||||||
|
logger.error(error);
|
||||||
|
}
|
||||||
const err = new HttpError(error);
|
const err = new HttpError(error);
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
}
|
}
|
||||||
@@ -77,4 +91,8 @@ export function createAxiosService({ logger }: { logger: Logger }) {
|
|||||||
return service;
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const request = createAxiosService({ logger });
|
export const http = createAxiosService({ logger }) as HttpClient;
|
||||||
|
export type HttpClientResponse<R> = any;
|
||||||
|
export type HttpClient = {
|
||||||
|
request<D = any, R = any>(config: AxiosRequestConfig<D>): Promise<HttpClientResponse<R>>;
|
||||||
|
};
|
||||||
|
|||||||
@@ -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.24.3](https://github.com/certd/certd/compare/v1.24.2...v1.24.3) (2024-09-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|
||||||
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-huawei
|
**Note:** Version bump only for package @certd/lib-huawei
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-huawei",
|
"name": "@certd/lib-huawei",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.24.2",
|
"version": "1.24.3",
|
||||||
"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",
|
||||||
@@ -16,5 +16,5 @@
|
|||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
"rollup": "^3.7.4"
|
"rollup": "^3.7.4"
|
||||||
},
|
},
|
||||||
"gitHead": "bef6b981e26a010a797734e508de6822de8564f5"
|
"gitHead": "c49ccbde93dbad7062ac39d4f18eca7d561f573f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.24.4](https://github.com/certd/certd/compare/v1.24.3...v1.24.4) (2024-09-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
|
## [1.24.3](https://github.com/certd/certd/compare/v1.24.2...v1.24.3) (2024-09-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|
||||||
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/lib-k8s
|
**Note:** Version bump only for package @certd/lib-k8s
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/lib-k8s",
|
"name": "@certd/lib-k8s",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.24.2",
|
"version": "1.24.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"@kubernetes/client-node": "0.21.0"
|
"@kubernetes/client-node": "0.21.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/pipeline": "^1.24.2",
|
"@certd/pipeline": "^1.24.4",
|
||||||
"@rollup/plugin-commonjs": "^23.0.4",
|
"@rollup/plugin-commonjs": "^23.0.4",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
@@ -37,5 +37,5 @@
|
|||||||
"tslib": "^2.5.2",
|
"tslib": "^2.5.2",
|
||||||
"typescript": "^4.8.4"
|
"typescript": "^4.8.4"
|
||||||
},
|
},
|
||||||
"gitHead": "bef6b981e26a010a797734e508de6822de8564f5"
|
"gitHead": "c49ccbde93dbad7062ac39d4f18eca7d561f573f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.24.4](https://github.com/certd/certd/compare/v1.24.3...v1.24.4) (2024-09-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|
||||||
## [1.22.6](https://github.com/certd/certd/compare/v1.22.5...v1.22.6) (2024-08-03)
|
## [1.22.6](https://github.com/certd/certd/compare/v1.22.5...v1.22.6) (2024-08-03)
|
||||||
|
|
||||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/midway-flyway-js",
|
"name": "@certd/midway-flyway-js",
|
||||||
"version": "1.22.6",
|
"version": "1.24.4",
|
||||||
"description": "midway with flyway, sql upgrade way ",
|
"description": "midway with flyway, sql upgrade way ",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"@rollup/plugin-terser": "^0.4.3",
|
"@rollup/plugin-terser": "^0.4.3",
|
||||||
"@rollup/plugin-typescript": "^11.0.0",
|
"@rollup/plugin-typescript": "^11.0.0",
|
||||||
"@types/chai": "^4.3.3",
|
"@types/chai": "^4.3.3",
|
||||||
"@types/node": "16",
|
"@types/node": "^18",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.38.1",
|
"@typescript-eslint/eslint-plugin": "^5.38.1",
|
||||||
"@typescript-eslint/parser": "^5.38.1",
|
"@typescript-eslint/parser": "^5.38.1",
|
||||||
"better-sqlite3": "^11.1.2",
|
"better-sqlite3": "^11.1.2",
|
||||||
|
|||||||
@@ -3,6 +3,16 @@
|
|||||||
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.24.4](https://github.com/certd/certd/compare/v1.24.3...v1.24.4) (2024-09-09)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 支持群晖 ([5c270b6](https://github.com/certd/certd/commit/5c270b6b9d45a2152f9fdb3c07bd98b7c803cb8e))
|
||||||
|
|
||||||
|
## [1.24.3](https://github.com/certd/certd/compare/v1.24.2...v1.24.3) (2024-09-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/plugin-cert
|
||||||
|
|
||||||
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/plugin-cert",
|
"name": "@certd/plugin-cert",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.24.2",
|
"version": "1.24.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -13,8 +13,8 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certd/acme-client": "^1.24.2",
|
"@certd/acme-client": "^1.24.4",
|
||||||
"@certd/pipeline": "^1.24.2",
|
"@certd/pipeline": "^1.24.4",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"node-forge": "^0.10.0",
|
"node-forge": "^0.10.0",
|
||||||
"psl": "^1.9.0"
|
"psl": "^1.9.0"
|
||||||
@@ -53,5 +53,5 @@
|
|||||||
"vite": "^3.1.0",
|
"vite": "^3.1.0",
|
||||||
"vue-tsc": "^0.38.9"
|
"vue-tsc": "^0.38.9"
|
||||||
},
|
},
|
||||||
"gitHead": "bef6b981e26a010a797734e508de6822de8564f5"
|
"gitHead": "c49ccbde93dbad7062ac39d4f18eca7d561f573f"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ export class AcmeService {
|
|||||||
|
|
||||||
private async testDirectory(directoryUrl: string) {
|
private async testDirectory(directoryUrl: string) {
|
||||||
try {
|
try {
|
||||||
await utils.http({
|
await utils.http.request({
|
||||||
url: directoryUrl,
|
url: directoryUrl,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
|
|||||||
email!: string;
|
email!: string;
|
||||||
|
|
||||||
@TaskInput({
|
@TaskInput({
|
||||||
title: "PFX密码",
|
title: "PFX证书密码",
|
||||||
component: {
|
component: {
|
||||||
name: "a-input-password",
|
name: "a-input-password",
|
||||||
vModel: "value",
|
vModel: "value",
|
||||||
@@ -191,14 +191,14 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
|
|||||||
*/
|
*/
|
||||||
async condition() {
|
async condition() {
|
||||||
if (this.forceUpdate) {
|
if (this.forceUpdate) {
|
||||||
|
this.logger.info("强制更新证书选项已勾选,准备申请新证书");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let inputChanged = false;
|
const inputChanged = this.ctx.inputChanged;
|
||||||
const oldInput = JSON.stringify(this.lastStatus?.input?.domains);
|
if (inputChanged) {
|
||||||
const thisInput = JSON.stringify(this.domains);
|
this.logger.info("输入参数变更,准备申请新证书");
|
||||||
if (oldInput !== thisInput) {
|
return null;
|
||||||
inputChanged = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let oldCert: CertReader | undefined = undefined;
|
let oldCert: CertReader | undefined = undefined;
|
||||||
@@ -212,11 +212,6 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputChanged) {
|
|
||||||
this.logger.info("输入参数变更,申请新证书");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ret = this.isWillExpire(oldCert.expires, this.renewDays);
|
const ret = this.isWillExpire(oldCert.expires, this.renewDays);
|
||||||
if (!ret.isWillExpire) {
|
if (!ret.isWillExpire) {
|
||||||
this.logger.info(`证书还未过期:过期时间${dayjs(oldCert.expires).format("YYYY-MM-DD HH:mm:ss")},剩余${ret.leftDays}天`);
|
this.logger.info(`证书还未过期:过期时间${dayjs(oldCert.expires).format("YYYY-MM-DD HH:mm:ss")},剩余${ret.leftDays}天`);
|
||||||
|
|||||||
@@ -69,13 +69,15 @@ export class CertReader {
|
|||||||
const tmpDerPath = this.saveToFile("der");
|
const tmpDerPath = this.saveToFile("der");
|
||||||
logger.info("本地文件写入成功");
|
logger.info("本地文件写入成功");
|
||||||
try {
|
try {
|
||||||
await opts.handle({
|
return await opts.handle({
|
||||||
reader: this,
|
reader: this,
|
||||||
tmpCrtPath: tmpCrtPath,
|
tmpCrtPath: tmpCrtPath,
|
||||||
tmpKeyPath: tmpKeyPath,
|
tmpKeyPath: tmpKeyPath,
|
||||||
tmpPfxPath: tmpPfxPath,
|
tmpPfxPath: tmpPfxPath,
|
||||||
tmpDerPath: tmpDerPath,
|
tmpDerPath: tmpDerPath,
|
||||||
});
|
});
|
||||||
|
} catch (err) {
|
||||||
|
throw err;
|
||||||
} finally {
|
} finally {
|
||||||
//删除临时文件
|
//删除临时文件
|
||||||
logger.info("删除临时文件");
|
logger.info("删除临时文件");
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
FROM node:20-alpine AS builder
|
FROM node:18-alpine AS builder
|
||||||
EXPOSE 7001
|
EXPOSE 7001
|
||||||
WORKDIR /workspace/
|
WORKDIR /workspace/
|
||||||
COPY . /workspace/
|
COPY . /workspace/
|
||||||
RUN npm install -g pnpm
|
# armv7 目前只能用node18, pnpm9不支持node18,所以pnpm只能用8.15.7版本
|
||||||
|
# https://github.com/nodejs/docker-node/issues/1946
|
||||||
|
RUN npm install -g pnpm@8.15.7
|
||||||
|
|
||||||
#RUN cd /workspace/certd-client && pnpm install && npm run build
|
#RUN cd /workspace/certd-client && pnpm install && npm run build
|
||||||
RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf
|
RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf
|
||||||
RUN cd /workspace/certd-server && pnpm install && npm run build-on-docker
|
RUN cd /workspace/certd-server && yarn install && npm run build-on-docker
|
||||||
|
|
||||||
|
|
||||||
FROM node:20-alpine
|
FROM node:18-alpine
|
||||||
RUN apk add --no-cache openssl
|
RUN apk add --no-cache openssl
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
COPY --from=builder /workspace/certd-server/ /app/
|
COPY --from=builder /workspace/certd-server/ /app/
|
||||||
|
|||||||
@@ -3,6 +3,16 @@
|
|||||||
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.24.4](https://github.com/certd/certd/compare/v1.24.3...v1.24.4) (2024-09-09)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 插件选择支持搜索 ([d1498a7](https://github.com/certd/certd/commit/d1498a71601b74d38343b1d070eadd03705dd9d5))
|
||||||
|
|
||||||
|
## [1.24.3](https://github.com/certd/certd/compare/v1.24.2...v1.24.3) (2024-09-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @certd/ui-client
|
||||||
|
|
||||||
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/ui-client",
|
"name": "@certd/ui-client",
|
||||||
"version": "1.24.2",
|
"version": "1.24.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --open",
|
"dev": "vite --open",
|
||||||
@@ -58,13 +58,13 @@
|
|||||||
"vuedraggable": "^4.1.0"
|
"vuedraggable": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@certd/pipeline": "^1.24.2",
|
"@certd/pipeline": "^1.24.4",
|
||||||
"@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",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/mocha": "^10.0.6",
|
"@types/mocha": "^10.0.6",
|
||||||
"@types/node": "^20.11.28",
|
"@types/node": "^18",
|
||||||
"@types/nprogress": "^0.2.3",
|
"@types/nprogress": "^0.2.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
||||||
"@typescript-eslint/parser": "^7.2.0",
|
"@typescript-eslint/parser": "^7.2.0",
|
||||||
|
|||||||
@@ -68,6 +68,17 @@ h1, h2, h3, h4, h5, h6 {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex-col{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-y{
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.mb-2 {
|
.mb-2 {
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
}
|
}
|
||||||
@@ -137,6 +148,13 @@ h1, h2, h3, h4, h5, h6 {
|
|||||||
.w-100 {
|
.w-100 {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.h-100 {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overflow-hidden {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.block-header {
|
.block-header {
|
||||||
margin: 3px;
|
margin: 3px;
|
||||||
|
|||||||
@@ -8,43 +8,61 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="currentStep">
|
<template v-if="currentStep">
|
||||||
<pi-container v-if="currentStep._isAdd" class="pi-step-form">
|
<pi-container v-if="currentStep._isAdd" class="pi-step-form">
|
||||||
<a-tabs tab-position="left">
|
<template #header>
|
||||||
<a-tab-pane v-for="group of pluginGroups.groups" :key="group.key" :tab="group.title">
|
<a-row :gutter="10" class="mb-10">
|
||||||
<a-row :gutter="10">
|
<a-col :span="24" style="padding-left: 20px">
|
||||||
<a-col v-for="item of group.plugins" :key="item.key" class="step-plugin" :span="12">
|
<a-input-search v-model:value="pluginSearch.keyword" placeholder="搜索插件" :allow-clear="true" :show-search="true"></a-input-search>
|
||||||
<a-card
|
</a-col>
|
||||||
hoverable
|
</a-row>
|
||||||
:class="{ current: item.name === currentStep.type }"
|
</template>
|
||||||
@click="stepTypeSelected(item)"
|
<div class="flex-col h-100 w-100 overflow-hidden">
|
||||||
@dblclick="
|
<a-tabs v-model:active-key="pluginGroupActive" tab-position="left" class="flex-1 overflow-hidden">
|
||||||
stepTypeSelected(item);
|
<a-tab-pane v-for="group of computedPluginGroups" :key="group.key" :tab="group.title" class="scroll-y">
|
||||||
stepTypeSave();
|
<a-row v-if="!group.plugins || group.plugins.length === 0" :gutter="10">
|
||||||
"
|
<a-col class="flex-o">
|
||||||
>
|
<div class="flex-o m-10">没有找到插件</div>
|
||||||
<a-card-meta>
|
</a-col>
|
||||||
<template #title>
|
</a-row>
|
||||||
<a-avatar :src="item.icon || '/images/plugin.png'" />
|
<a-row v-else :gutter="10">
|
||||||
<span class="title">{{ item.title }}</span>
|
<a-col v-for="item of group.plugins" :key="item.key" class="step-plugin" :span="12">
|
||||||
<vip-button v-if="item.needPlus" mode="icon" />
|
<a-card
|
||||||
</template>
|
hoverable
|
||||||
<template #description>
|
:class="{ current: item.name === currentStep.type }"
|
||||||
<span :title="item.desc">{{ item.desc }}</span>
|
@click="stepTypeSelected(item)"
|
||||||
</template>
|
@dblclick="
|
||||||
</a-card-meta>
|
stepTypeSelected(item);
|
||||||
</a-card>
|
stepTypeSave();
|
||||||
</a-col>
|
"
|
||||||
</a-row>
|
>
|
||||||
</a-tab-pane>
|
<a-card-meta>
|
||||||
</a-tabs>
|
<template #title>
|
||||||
<div style="padding: 20px; margin-left: 100px">
|
<a-avatar :src="item.icon || '/images/plugin.png'" />
|
||||||
<a-button v-if="editMode" type="primary" @click="stepTypeSave"> 确定 </a-button>
|
<span class="title">{{ item.title }}</span>
|
||||||
|
<vip-button v-if="item.needPlus" mode="icon" />
|
||||||
|
</template>
|
||||||
|
<template #description>
|
||||||
|
<span :title="item.desc">{{ item.desc }}</span>
|
||||||
|
</template>
|
||||||
|
</a-card-meta>
|
||||||
|
</a-card>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div style="padding: 20px; margin-left: 100px">
|
||||||
|
<a-button v-if="editMode" type="primary" @click="stepTypeSave"> 确定 </a-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</pi-container>
|
</pi-container>
|
||||||
<pi-container v-else class="pi-step-form">
|
<pi-container v-else class="pi-step-form">
|
||||||
<a-form ref="stepFormRef" class="step-form" :model="currentStep" :label-col="labelCol" :wrapper-col="wrapperCol">
|
<template #header>
|
||||||
<div class="mb-10">
|
<div class="mb-10">
|
||||||
<a-alert type="info" :message="currentPlugin.title" :description="currentPlugin.desc"> </a-alert>
|
<a-alert type="info" :message="currentPlugin.title" :description="currentPlugin.desc"> </a-alert>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
<a-form ref="stepFormRef" class="step-form" :model="currentStep" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
<fs-form-item
|
<fs-form-item
|
||||||
v-model="currentStep.title"
|
v-model="currentStep.title"
|
||||||
:item="{
|
:item="{
|
||||||
@@ -66,9 +84,9 @@
|
|||||||
</a-form>
|
</a-form>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<a-form-item v-if="editMode" :wrapper-col="{ span: 14, offset: 4 }">
|
<div v-if="editMode" class="bottom-button">
|
||||||
<a-button type="primary" @click="stepSave"> 确定 </a-button>
|
<a-button type="primary" @click="stepSave"> 确定 </a-button>
|
||||||
</a-form-item>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</pi-container>
|
</pi-container>
|
||||||
</template>
|
</template>
|
||||||
@@ -77,7 +95,7 @@
|
|||||||
|
|
||||||
<script lang="tsx">
|
<script lang="tsx">
|
||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
import { computed, inject, Ref, ref } from "vue";
|
import { computed, inject, Ref, ref, watch } from "vue";
|
||||||
import _ from "lodash-es";
|
import _ from "lodash-es";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import { CopyOutlined } from "@ant-design/icons-vue";
|
import { CopyOutlined } from "@ant-design/icons-vue";
|
||||||
@@ -263,7 +281,45 @@ export default {
|
|||||||
const blankFn = () => {
|
const blankFn = () => {
|
||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const pluginSearch = ref({
|
||||||
|
keyword: "",
|
||||||
|
result: []
|
||||||
|
});
|
||||||
|
const pluginGroupActive = ref("all");
|
||||||
|
const computedPluginGroups: any = computed(() => {
|
||||||
|
const groups = pluginGroups.groups;
|
||||||
|
if (pluginSearch.value.keyword) {
|
||||||
|
const keyword = pluginSearch.value.keyword.toLowerCase();
|
||||||
|
const list = groups.all.plugins.filter((plugin) => {
|
||||||
|
return (
|
||||||
|
plugin.title?.toLowerCase().includes(keyword) || plugin.desc?.toLowerCase().includes(keyword) || plugin.name?.toLowerCase().includes(keyword)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
search: { key: "search", title: "搜索结果", plugins: list }
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return groups;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => {
|
||||||
|
return pluginSearch.value.keyword;
|
||||||
|
},
|
||||||
|
(val: any) => {
|
||||||
|
if (val) {
|
||||||
|
pluginGroupActive.value = "search";
|
||||||
|
} else {
|
||||||
|
pluginGroupActive.value = "all";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
pluginGroupActive,
|
||||||
|
computedPluginGroups,
|
||||||
|
pluginSearch,
|
||||||
stepTypeSelected,
|
stepTypeSelected,
|
||||||
stepTypeSave,
|
stepTypeSave,
|
||||||
pluginGroups,
|
pluginGroups,
|
||||||
@@ -321,8 +377,23 @@ export default {
|
|||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.pi-step-form {
|
.pi-step-form {
|
||||||
|
.bottom-button {
|
||||||
|
padding: 20px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
margin-left: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
.body {
|
.body {
|
||||||
padding: 10px;
|
padding: 0px;
|
||||||
|
|
||||||
|
.ant-tabs-content {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.ant-tabs-tabpane {
|
||||||
|
padding-right: 10px;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
.ant-card {
|
.ant-card {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,23 @@
|
|||||||
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.24.4](https://github.com/certd/certd/compare/v1.24.3...v1.24.4) (2024-09-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 修复腾讯云cdn证书部署后会自动关闭hsts,http2.0等配置的bug ([7908ab7](https://github.com/certd/certd/commit/7908ab79da624c94fa05849925b15e480e3317c4))
|
||||||
|
* 修复腾讯云tke证书部署报错的bug ([653f409](https://github.com/certd/certd/commit/653f409d91a441850d6381f89a8dd390831f0d5e))
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 支持群晖 ([5c270b6](https://github.com/certd/certd/commit/5c270b6b9d45a2152f9fdb3c07bd98b7c803cb8e))
|
||||||
|
|
||||||
|
## [1.24.3](https://github.com/certd/certd/compare/v1.24.2...v1.24.3) (2024-09-06)
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* 支持多吉云cdn证书部署 ([65ef685](https://github.com/certd/certd/commit/65ef6857296784ca765926e09eafcb6fc8b6ecde))
|
||||||
|
|
||||||
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
## [1.24.2](https://github.com/certd/certd/compare/v1.24.1...v1.24.2) (2024-09-06)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@certd/ui-server",
|
"name": "@certd/ui-server",
|
||||||
"version": "1.24.2",
|
"version": "1.24.4",
|
||||||
"description": "fast-server base midway",
|
"description": "fast-server base midway",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -21,13 +21,13 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alicloud/cs20151215": "^3.0.3",
|
"@alicloud/cs20151215": "^3.0.3",
|
||||||
"@alicloud/pop-core": "^1.7.10",
|
"@alicloud/pop-core": "^1.7.10",
|
||||||
"@certd/acme-client": "^1.24.2",
|
"@certd/acme-client": "^1.24.4",
|
||||||
"@certd/lib-huawei": "^1.24.2",
|
"@certd/lib-huawei": "^1.24.3",
|
||||||
"@certd/lib-k8s": "^1.24.2",
|
"@certd/lib-k8s": "^1.24.4",
|
||||||
"@certd/midway-flyway-js": "^1.22.6",
|
"@certd/midway-flyway-js": "^1.24.4",
|
||||||
"@certd/pipeline": "^1.24.2",
|
"@certd/pipeline": "^1.24.4",
|
||||||
"@certd/plugin-cert": "^1.24.2",
|
"@certd/plugin-cert": "^1.24.4",
|
||||||
"@certd/plugin-plus": "^1.24.2",
|
"@certd/plugin-plus": "^1.24.4",
|
||||||
"@koa/cors": "^5.0.0",
|
"@koa/cors": "^5.0.0",
|
||||||
"@midwayjs/bootstrap": "^3.16.2",
|
"@midwayjs/bootstrap": "^3.16.2",
|
||||||
"@midwayjs/cache": "^3.14.0",
|
"@midwayjs/cache": "^3.14.0",
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
"cache-manager": "^3.6.3",
|
"cache-manager": "^3.6.3",
|
||||||
"cron-parser": "^4.9.0",
|
"cron-parser": "^4.9.0",
|
||||||
"dayjs": "^1.11.7",
|
"dayjs": "^1.11.7",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
"glob": "^10.4.5",
|
"glob": "^10.4.5",
|
||||||
"https-proxy-agent": "^7.0.5",
|
"https-proxy-agent": "^7.0.5",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
@@ -62,10 +63,12 @@
|
|||||||
"nanoid": "^4.0.0",
|
"nanoid": "^4.0.0",
|
||||||
"nodemailer": "^6.9.3",
|
"nodemailer": "^6.9.3",
|
||||||
"pg": "^8.12.0",
|
"pg": "^8.12.0",
|
||||||
|
"querystring": "^0.2.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"ssh2": "^1.15.0",
|
"ssh2": "^1.15.0",
|
||||||
"strip-ansi": "^7.1.0",
|
"strip-ansi": "^7.1.0",
|
||||||
"svg-captcha": "^1.4.0",
|
"svg-captcha": "^1.4.0",
|
||||||
|
"syno": "^2.2.0",
|
||||||
"tencentcloud-sdk-nodejs": "^4.0.44",
|
"tencentcloud-sdk-nodejs": "^4.0.44",
|
||||||
"typeorm": "^0.3.20"
|
"typeorm": "^0.3.20"
|
||||||
},
|
},
|
||||||
@@ -77,7 +80,7 @@
|
|||||||
"@types/koa": "2.13.4",
|
"@types/koa": "2.13.4",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/mocha": "^10.0.1",
|
"@types/mocha": "^10.0.1",
|
||||||
"@types/node": "16",
|
"@types/node": "^18",
|
||||||
"@types/nodemailer": "^6.4.8",
|
"@types/nodemailer": "^6.4.8",
|
||||||
"@types/ssh2": "^1.15.0",
|
"@types/ssh2": "^1.15.0",
|
||||||
"c8": "^8.0.1",
|
"c8": "^8.0.1",
|
||||||
@@ -89,7 +92,7 @@
|
|||||||
"typescript": "~5.1.0"
|
"typescript": "~5.1.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0"
|
"node": ">=18.0.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -7,3 +7,4 @@ export * from './plugin-huawei/index.js';
|
|||||||
export * from './plugin-demo/index.js';
|
export * from './plugin-demo/index.js';
|
||||||
export * from './plugin-other/index.js';
|
export * from './plugin-other/index.js';
|
||||||
export * from './plugin-west/index.js';
|
export * from './plugin-west/index.js';
|
||||||
|
export * from './plugin-doge/index.js';
|
||||||
|
|||||||
39
packages/ui/certd-server/src/plugins/plugin-doge/access.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import { IsAccess, AccessInput } from '@certd/pipeline';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 这个注解将注册一个授权配置
|
||||||
|
* 在certd的后台管理系统中,用户可以选择添加此类型的授权
|
||||||
|
*/
|
||||||
|
@IsAccess({
|
||||||
|
name: 'dogecloud',
|
||||||
|
title: '多吉云',
|
||||||
|
desc: '',
|
||||||
|
})
|
||||||
|
export class DogeCloudAccess {
|
||||||
|
/**
|
||||||
|
* 授权属性配置
|
||||||
|
*/
|
||||||
|
@AccessInput({
|
||||||
|
title: 'AccessKey',
|
||||||
|
component: {
|
||||||
|
placeholder: 'AccessKey',
|
||||||
|
},
|
||||||
|
helper: '请前往[多吉云-密钥管理](https://console.dogecloud.com/user/keys)获取',
|
||||||
|
required: true,
|
||||||
|
encrypt: false,
|
||||||
|
})
|
||||||
|
accessKey = '';
|
||||||
|
|
||||||
|
@AccessInput({
|
||||||
|
title: 'SecretKey',
|
||||||
|
component: {
|
||||||
|
placeholder: 'SecretKey',
|
||||||
|
},
|
||||||
|
helper: '请前往[多吉云-密钥管理](https://console.dogecloud.com/user/keys)获取',
|
||||||
|
required: true,
|
||||||
|
encrypt: true,
|
||||||
|
})
|
||||||
|
secretKey = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
new DogeCloudAccess();
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export * from './access.js';
|
||||||
|
export * from './lib/index.js';
|
||||||
|
export * from './plugins/index.js';
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import crypto from 'crypto';
|
||||||
|
import querystring from 'querystring';
|
||||||
|
import { DogeCloudAccess } from '../access.js';
|
||||||
|
import { HttpClient } from '@certd/pipeline';
|
||||||
|
|
||||||
|
export class DogeClient {
|
||||||
|
accessKey: string;
|
||||||
|
secretKey: string;
|
||||||
|
http: HttpClient;
|
||||||
|
constructor(access: DogeCloudAccess, http: HttpClient) {
|
||||||
|
this.accessKey = access.accessKey;
|
||||||
|
this.secretKey = access.secretKey;
|
||||||
|
this.http = http;
|
||||||
|
}
|
||||||
|
|
||||||
|
async request(apiPath: string, data: any = {}, jsonMode = false, ignoreResNullCode = false) {
|
||||||
|
// 这里替换为你的多吉云永久 AccessKey 和 SecretKey,可在用户中心 - 密钥管理中查看
|
||||||
|
// 请勿在客户端暴露 AccessKey 和 SecretKey,那样恶意用户将获得账号完全控制权
|
||||||
|
|
||||||
|
const body = jsonMode ? JSON.stringify(data) : querystring.encode(data);
|
||||||
|
const sign = crypto
|
||||||
|
.createHmac('sha1', this.secretKey)
|
||||||
|
.update(Buffer.from(apiPath + '\n' + body, 'utf8'))
|
||||||
|
.digest('hex');
|
||||||
|
const authorization = 'TOKEN ' + this.accessKey + ':' + sign;
|
||||||
|
const res: any = await this.http.request({
|
||||||
|
url: 'https://api.dogecloud.com' + apiPath,
|
||||||
|
method: 'POST',
|
||||||
|
data: body,
|
||||||
|
responseType: 'json',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': jsonMode ? 'application/json' : 'application/x-www-form-urlencoded',
|
||||||
|
Authorization: authorization,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.code == null && ignoreResNullCode) {
|
||||||
|
//ignore
|
||||||
|
} else if (res.code !== 200) {
|
||||||
|
throw new Error('API Error: ' + res.msg);
|
||||||
|
}
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
|
||||||
|
import { CertInfo, CertReader } from '@certd/plugin-cert';
|
||||||
|
import { DogeClient } from '../../lib/index.js';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
@IsTaskPlugin({
|
||||||
|
name: 'DogeCloudDeployToCDN',
|
||||||
|
title: '部署证书到多吉云CDN',
|
||||||
|
group: pluginGroups.cdn.key,
|
||||||
|
default: {
|
||||||
|
strategy: {
|
||||||
|
runStrategy: RunStrategy.SkipWhenSucceed,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
export class DogeCloudDeployToCDNPlugin extends AbstractTaskPlugin {
|
||||||
|
@TaskInput({
|
||||||
|
title: '域名',
|
||||||
|
helper: 'CDN域名',
|
||||||
|
required: true,
|
||||||
|
})
|
||||||
|
domain!: string;
|
||||||
|
//证书选择,此项必须要有
|
||||||
|
@TaskInput({
|
||||||
|
title: '证书',
|
||||||
|
helper: '请选择前置任务输出的域名证书',
|
||||||
|
component: {
|
||||||
|
name: 'pi-output-selector',
|
||||||
|
from: 'CertApply',
|
||||||
|
},
|
||||||
|
required: true,
|
||||||
|
})
|
||||||
|
cert!: CertInfo;
|
||||||
|
|
||||||
|
//授权选择框
|
||||||
|
@TaskInput({
|
||||||
|
title: '多吉云授权',
|
||||||
|
helper: '多吉云AccessKey',
|
||||||
|
component: {
|
||||||
|
name: 'pi-access-selector',
|
||||||
|
type: 'dogecloud',
|
||||||
|
},
|
||||||
|
rules: [{ required: true, message: '此项必填' }],
|
||||||
|
})
|
||||||
|
accessId!: string;
|
||||||
|
|
||||||
|
@TaskInput({
|
||||||
|
title: '忽略部署接口报错',
|
||||||
|
helper: '当该域名部署后报错,但是实际上已经部署成功时,可以勾选',
|
||||||
|
value: false,
|
||||||
|
component: {
|
||||||
|
name: 'a-switch',
|
||||||
|
type: 'checked',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
ignoreDeployNullCode = false;
|
||||||
|
|
||||||
|
dogeClient!: DogeClient;
|
||||||
|
|
||||||
|
async onInstance() {
|
||||||
|
const access = await this.accessService.getById(this.accessId);
|
||||||
|
this.dogeClient = new DogeClient(access, this.ctx.http);
|
||||||
|
}
|
||||||
|
async execute(): Promise<void> {
|
||||||
|
const certId: number = await this.updateCert();
|
||||||
|
await this.bindCert(certId);
|
||||||
|
}
|
||||||
|
|
||||||
|
async updateCert() {
|
||||||
|
const certReader = new CertReader(this.cert);
|
||||||
|
const data = await this.dogeClient.request('/cdn/cert/upload.json', {
|
||||||
|
note: 'certd-' + dayjs().format('YYYYMMDDHHmmss'),
|
||||||
|
cert: certReader.crt,
|
||||||
|
private: certReader.key,
|
||||||
|
});
|
||||||
|
return data.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
async bindCert(certId: number) {
|
||||||
|
await this.dogeClient.request(
|
||||||
|
'/cdn/cert/bind.json',
|
||||||
|
{
|
||||||
|
id: certId,
|
||||||
|
domain: this.domain,
|
||||||
|
},
|
||||||
|
this.ignoreDeployNullCode
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new DogeCloudDeployToCDNPlugin();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './deploy-to-cdn/index.js';
|
||||||
@@ -93,20 +93,20 @@ export class DeployToCdnPlugin extends AbstractTaskPlugin {
|
|||||||
|
|
||||||
buildParams() {
|
buildParams() {
|
||||||
return {
|
return {
|
||||||
Https: {
|
Domain: this.domainName,
|
||||||
Switch: 'on',
|
Route: 'Https.CertInfo',
|
||||||
CertInfo: {
|
Value: JSON.stringify({
|
||||||
|
update: {
|
||||||
Certificate: this.cert.crt,
|
Certificate: this.cert.crt,
|
||||||
PrivateKey: this.cert.key,
|
PrivateKey: this.cert.key,
|
||||||
},
|
},
|
||||||
},
|
}),
|
||||||
Domain: this.domainName,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async doRequest(params: any) {
|
async doRequest(params: any) {
|
||||||
const client = await this.getClient();
|
const client = await this.getClient();
|
||||||
const ret = await client.UpdateDomainConfig(params);
|
const ret = await client.ModifyDomainConfig(params);
|
||||||
this.checkRet(ret);
|
this.checkRet(ret);
|
||||||
this.logger.info('设置腾讯云CDN证书成功:', ret.RequestId);
|
this.logger.info('设置腾讯云CDN证书成功:', ret.RequestId);
|
||||||
return ret.RequestId;
|
return ret.RequestId;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import dayjs from 'dayjs';
|
|||||||
name: 'DeployCertToTencentCLB',
|
name: 'DeployCertToTencentCLB',
|
||||||
title: '部署到腾讯云CLB',
|
title: '部署到腾讯云CLB',
|
||||||
group: pluginGroups.tencent.key,
|
group: pluginGroups.tencent.key,
|
||||||
desc: '暂时只支持单向认证证书,暂时只支持通用负载均衡',
|
desc: '暂时只支持单向认证证书,暂时只支持通用负载均衡,必须开启sni',
|
||||||
default: {
|
default: {
|
||||||
strategy: {
|
strategy: {
|
||||||
runStrategy: RunStrategy.SkipWhenSucceed,
|
runStrategy: RunStrategy.SkipWhenSucceed,
|
||||||
@@ -93,14 +93,13 @@ export class DeployToClbPlugin extends AbstractTaskPlugin {
|
|||||||
accessId!: string;
|
accessId!: string;
|
||||||
|
|
||||||
client: any;
|
client: any;
|
||||||
ClbClient: any;
|
|
||||||
async onInstance() {
|
async onInstance() {
|
||||||
this.client = await this.getClient();
|
this.client = await this.getClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
async getClient() {
|
async getClient() {
|
||||||
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/clb/v20180317/index.js');
|
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/clb/v20180317/index.js');
|
||||||
this.ClbClient = sdk.v20180317.Client;
|
const ClbClient = sdk.v20180317.Client;
|
||||||
|
|
||||||
const accessProvider = (await this.accessService.getById(this.accessId)) as TencentAccess;
|
const accessProvider = (await this.accessService.getById(this.accessId)) as TencentAccess;
|
||||||
|
|
||||||
@@ -118,7 +117,7 @@ export class DeployToClbPlugin extends AbstractTaskPlugin {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return new this.ClbClient(clientConfig);
|
return new ClbClient(clientConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
|
|||||||
@@ -89,19 +89,16 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
|
|||||||
})
|
})
|
||||||
cert!: any;
|
cert!: any;
|
||||||
|
|
||||||
TkeClient: any;
|
|
||||||
K8sClient: any;
|
K8sClient: any;
|
||||||
|
|
||||||
async onInstance() {
|
async onInstance() {
|
||||||
// const TkeClient = this.tencentcloud.tke.v20180525.Client;
|
// const TkeClient = this.tencentcloud.tke.v20180525.Client;
|
||||||
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/tke/v20220501/index.js');
|
|
||||||
this.TkeClient = sdk.v20220501.Client;
|
|
||||||
const k8sSdk = await import('@certd/lib-k8s');
|
const k8sSdk = await import('@certd/lib-k8s');
|
||||||
this.K8sClient = k8sSdk.K8sClient;
|
this.K8sClient = k8sSdk.K8sClient;
|
||||||
}
|
}
|
||||||
async execute(): Promise<void> {
|
async execute(): Promise<void> {
|
||||||
const accessProvider = await this.accessService.getById(this.accessId);
|
const accessProvider = await this.accessService.getById(this.accessId);
|
||||||
const tkeClient = this.getTkeClient(accessProvider, this.region);
|
const tkeClient = await this.getTkeClient(accessProvider, this.region);
|
||||||
const kubeConfigStr = await this.getTkeKubeConfig(tkeClient, this.clusterId);
|
const kubeConfigStr = await this.getTkeKubeConfig(tkeClient, this.clusterId);
|
||||||
|
|
||||||
this.logger.info('kubeconfig已成功获取');
|
this.logger.info('kubeconfig已成功获取');
|
||||||
@@ -127,7 +124,9 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
|
|||||||
await this.restartIngress({ k8sClient });
|
await this.restartIngress({ k8sClient });
|
||||||
}
|
}
|
||||||
|
|
||||||
getTkeClient(accessProvider: any, region = 'ap-guangzhou') {
|
async getTkeClient(accessProvider: any, region = 'ap-guangzhou') {
|
||||||
|
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/tke/v20180525/index.js');
|
||||||
|
const TkeClient = sdk.v20180525.Client;
|
||||||
const clientConfig = {
|
const clientConfig = {
|
||||||
credential: {
|
credential: {
|
||||||
secretId: accessProvider.secretId,
|
secretId: accessProvider.secretId,
|
||||||
@@ -141,7 +140,7 @@ export class DeployCertToTencentTKEIngressPlugin extends AbstractTaskPlugin {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return new this.TkeClient(clientConfig);
|
return new TkeClient(clientConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getTkeKubeConfig(client: any, clusterId: string) {
|
async getTkeKubeConfig(client: any, clusterId: string) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { utils } from '@certd/pipeline';
|
|||||||
|
|
||||||
export async function request(config: any): Promise<any> {
|
export async function request(config: any): Promise<any> {
|
||||||
try {
|
try {
|
||||||
return await utils.http(config);
|
return await utils.http.request(config);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const data = e.data || e.response?.data;
|
const data = e.data || e.response?.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|||||||