Compare commits

...

25 Commits

Author SHA1 Message Date
xiaojunnuo
93017c044d v1.35.4 2025-06-13 12:22:12 +08:00
xiaojunnuo
c223ddbb9a build: prepare to build 2025-06-13 12:19:21 +08:00
xiaojunnuo
f00aeacb8b perf: 支持s3 access做测试 2025-06-13 12:18:26 +08:00
xiaojunnuo
5b49071d6b Merge remote-tracking branch 'origin/v2-dev' into v2-dev 2025-06-13 09:53:30 +08:00
xiaojunnuo
17053a882b chore: 2025-06-13 09:53:07 +08:00
xiaojunnuo
5e723d31a4 chore: 2025-06-13 00:40:54 +08:00
xiaojunnuo
3283bd8b75 build: publish 2025-06-13 00:40:05 +08:00
xiaojunnuo
770d3c0015 build: trigger build image 2025-06-13 00:39:33 +08:00
xiaojunnuo
d15dfafd5d v1.35.3 2025-06-13 00:29:59 +08:00
xiaojunnuo
545c13d55c build: prepare to build 2025-06-13 00:27:18 +08:00
xiaojunnuo
e2099ac9ca fix: 修复重试次数设置无效的bug 2025-06-13 00:25:08 +08:00
xiaojunnuo
c937583a50 fix: 修复消息内容存在()<>等括号情况下无法发送tg通知的bug 2025-06-13 00:24:55 +08:00
xiaojunnuo
43c7a19849 perf: 支持雨云dns解析以及雨云证书更新 2025-06-12 23:51:21 +08:00
xiaojunnuo
83543487e7 perf: 支持雨云dns解析 2025-06-12 22:41:08 +08:00
xiaojunnuo
434b259525 chore: 2025-06-11 22:40:21 +08:00
xiaojunnuo
add8efaba8 chore: 2025-06-10 18:44:32 +08:00
xiaojunnuo
12ed79ca60 chore: 雨云支持 2025-06-10 18:41:25 +08:00
xiaojunnuo
1e863382d3 perf: 授权列表类型颜色优化 2025-06-10 18:40:23 +08:00
xiaojunnuo
bad3504d4a perf: github 版本检查支持执行脚本 2025-06-10 12:13:04 +08:00
xiaojunnuo
d94f207162 chore: 首创流水线模式自动申请和部署证书,已被多个项目“借鉴”,被抄也是一种成功。 2025-06-10 10:59:40 +08:00
xiaojunnuo
2c4b7781a4 chore: 2025-06-10 10:52:58 +08:00
xiaojunnuo
4574c6ff07 chore: 2025-06-10 10:52:30 +08:00
xiaojunnuo
7b5043e87b chore: 增加专业版过期通知 2025-06-10 10:21:09 +08:00
xiaojunnuo
a06f3ac5da build: publish 2025-06-09 23:58:39 +08:00
xiaojunnuo
721346a40a build: trigger build image 2025-06-09 23:58:23 +08:00
58 changed files with 890 additions and 195 deletions

View File

@@ -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.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
* 支持雨云dns解析 ([8354348](https://github.com/certd/certd/commit/83543487e7418683bd79cfe3b9e0d792bdb977f7))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
* github 版本检查支持执行脚本 ([bad3504](https://github.com/certd/certd/commit/bad3504d4a15e6989b967b66aa9da8c6981f25bf))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes ### Bug Fixes

View File

@@ -1,9 +1,9 @@
# Certd # Certd
Certd 是一个免费全自动申请和自动部署更新SSL证书管理系统。 Certd® 是一个免费全自动证书管理系统,让你的网站证书永不过期
后缀d取自linux守护进程的命名风格意为证书守护进程。 首创流水线申请部署证书模式,已被多个项目“借鉴”,被抄也是一种成功。
关键字:证书自动申请、证书自动更新、证书自动续期、证书自动续签、证书管理工具 >后缀d取自linux守护进程的命名风格意为证书守护进程。
> 关于证书续期: > 关于证书续期:
>* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。 >* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。
@@ -13,6 +13,7 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
> 流水线数量现已调整为无限制,欢迎大家使用 > 流水线数量现已调整为无限制,欢迎大家使用
## 一、特性 ## 一、特性
本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。 本项目不仅支持证书申请过程自动化,还可以自动化部署更新证书,让你的证书永不过期。
@@ -32,9 +33,6 @@ Certd 是一个免费全自动申请和自动部署更新SSL证书的管理系
![](./docs/images/intro/intro.svg) ![](./docs/images/intro/intro.svg)
## 二、在线体验 ## 二、在线体验
官方Demo地址自助注册后体验 官方Demo地址自助注册后体验

View File

@@ -1 +1 @@
09:12 00:39

View File

@@ -3,6 +3,36 @@
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.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
* 支持雨云dns解析 ([8354348](https://github.com/certd/certd/commit/83543487e7418683bd79cfe3b9e0d792bdb977f7))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
* github 版本检查支持执行脚本 ([bad3504](https://github.com/certd/certd/commit/bad3504d4a15e6989b967b66aa9da8c6981f25bf))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes
* 修复阿里云新加坡clb无法部署证书的bug ([c1fbc8c](https://github.com/certd/certd/commit/c1fbc8cd68ae020ef342e4e92f4d9b4869ca1ead))
* 修复阿里云新加坡clb无法部署证书的bug ([3e84e11](https://github.com/certd/certd/commit/3e84e116e863b54c6b4d7db160af372dacc5857f))
* 修复检查github release 插件无法保存最后版本的bug ([a92107c](https://github.com/certd/certd/commit/a92107cc47133883b099d5228b06373e84c8bb50))
* 修复站点监控定时器多次添加的bug ([9361679](https://github.com/certd/certd/commit/936167972fe83e519bc01a0dd961d9c0635d24ab))
### Performance Improvements
* 阿里云dns操作增加重试机制 ([424fd96](https://github.com/certd/certd/commit/424fd96615c05e949af8c837c261c1400bdffba2))
* 优化阿里云nlb支持部署扩展证书 ([9cbdfda](https://github.com/certd/certd/commit/9cbdfda829b231733d54c66c5024d46e6fc11af3))
* 子域名托管帮助链接优化为打开新窗口 ([7c0cdd1](https://github.com/certd/certd/commit/7c0cdd169e2f943e703e433677f2f437d4aa02ee))
* history增加触发类型显示 ([7f6070c](https://github.com/certd/certd/commit/7f6070c960ed7bf02add5ab36436de6573f2f1fa))
## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07) ## [1.35.1](https://github.com/certd/certd/compare/v1.35.0...v1.35.1) (2025-06-07)
### Bug Fixes ### Bug Fixes

View File

@@ -9,5 +9,5 @@
} }
}, },
"npmClient": "pnpm", "npmClient": "pnpm",
"version": "1.35.2" "version": "1.35.4"
} }

View File

@@ -20,7 +20,7 @@
"afterpublishOnly": "npm run copylogs && time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push", "afterpublishOnly": "npm run copylogs && time /t >build.trigger && git add ./build.trigger && git commit -m \"build: trigger build image\" && TIMEOUT /T 10 && git push",
"transform-sql": "cd ./packages/ui/certd-server/db/ && node --experimental-json-modules transform.js", "transform-sql": "cd ./packages/ui/certd-server/db/ && node --experimental-json-modules transform.js",
"commitAll": "git add . && git commit -m \"build: publish\" && git push && npm run commitPro", "commitAll": "git add . && git commit -m \"build: publish\" && git push && npm run commitPro",
"commitPro": "cd ./packages/core/ && git add . && git commit -m \"build: publish\" && git push", "commitPro": "cd ./packages/pro/ && git add . && git commit -m \"build: publish\" && git push",
"copylogs": "copyfiles \"CHANGELOG.md\" ./docs/guide/changelogs/", "copylogs": "copyfiles \"CHANGELOG.md\" ./docs/guide/changelogs/",
"prepublishOnly1": "npm run check && lerna run build ", "prepublishOnly1": "npm run check && lerna run build ",
"prepublishOnly2": "npm run check && npm run before-build && lerna run build ", "prepublishOnly2": "npm run check && npm run before-build && lerna run build ",

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.4](https://github.com/publishlab/node-acme-client/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/acme-client
## [1.35.3](https://github.com/publishlab/node-acme-client/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/acme-client
## [1.35.2](https://github.com/publishlab/node-acme-client/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/publishlab/node-acme-client/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/acme-client **Note:** Version bump only for package @certd/acme-client

View File

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

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/basic
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/basic
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/basic **Note:** Version bump only for package @certd/basic

View File

@@ -1 +1 @@
23:54 12:19

View File

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

View File

@@ -3,6 +3,18 @@
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.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复消息内容存在()<>等括号情况下无法发送tg通知的bug ([c937583](https://github.com/certd/certd/commit/c937583a50d8513d76adead3648f83eee2fcc6f9))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/pipeline **Note:** Version bump only for package @certd/pipeline

View File

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

View File

@@ -37,6 +37,7 @@ export type AccessContext = {
http: HttpClient; http: HttpClient;
logger: ILogger; logger: ILogger;
utils: typeof utils; utils: typeof utils;
accessService: IAccessService;
}; };
export abstract class BaseAccess implements IAccess { export abstract class BaseAccess implements IAccess {

View File

@@ -1,5 +1,5 @@
// src/decorator/memoryCache.decorator.ts // src/decorator/memoryCache.decorator.ts
import { AccessContext, AccessDefine, AccessInputDefine } from "./api.js"; import { AccessContext, AccessDefine, AccessInputDefine, IAccessService } from "./api.js";
import { Decorator } from "../decorator/index.js"; import { Decorator } from "../decorator/index.js";
import * as _ from "lodash-es"; import * as _ from "lodash-es";
import { accessRegistry } from "./registry.js"; import { accessRegistry } from "./registry.js";
@@ -41,7 +41,7 @@ export function AccessInput(input?: AccessInputDefine): PropertyDecorator {
}; };
} }
export async function newAccess(type: string, input: any, ctx?: AccessContext) { export async function newAccess(type: string, input: any, accessService: IAccessService, ctx?: AccessContext) {
const register = accessRegistry.get(type); const register = accessRegistry.get(type);
if (register == null) { if (register == null) {
throw new Error(`access ${type} not found`); throw new Error(`access ${type} not found`);
@@ -58,6 +58,7 @@ export async function newAccess(type: string, input: any, ctx?: AccessContext) {
http, http,
logger, logger,
utils, utils,
accessService,
}; };
} }
access.setCtx(ctx); access.setCtx(ctx);

View File

@@ -121,9 +121,13 @@ export abstract class BaseNotification implements INotification {
async onTestRequest() { async onTestRequest() {
return await this.doSend({ return await this.doSend({
userId: 0, userId: 0,
title: "【Certd】测试通知【*.foo.com】标题长度测试、测试、测试", title: "【标题】测试通知【*.foo.com】标题长度测试、测试、测试",
content: `测试通知,*.foo.com content: `测试通知
域名测试: *.foo.com
换行测试 换行测试
(括号测试)
<尖括号测试>
[中括号测试]
`, `,
pipeline: { pipeline: {
id: 1, id: 1,

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/lib-huawei
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-huawei
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-huawei **Note:** Version bump only for package @certd/lib-huawei

View File

@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-huawei", "name": "@certd/lib-huawei",
"private": false, "private": false,
"version": "1.35.2", "version": "1.35.4",
"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",
@@ -24,5 +24,5 @@
"prettier": "^2.8.8", "prettier": "^2.8.8",
"tslib": "^2.8.1" "tslib": "^2.8.1"
}, },
"gitHead": "a619f8a2fee68169ae3c57cf6e8de18141de17ba" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/lib-iframe
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-iframe
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-iframe **Note:** Version bump only for package @certd/lib-iframe

View File

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

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/jdcloud
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/jdcloud
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/jdcloud **Note:** Version bump only for package @certd/jdcloud

View File

@@ -1,6 +1,6 @@
{ {
"name": "@certd/jdcloud", "name": "@certd/jdcloud",
"version": "1.35.2", "version": "1.35.4",
"description": "jdcloud openApi sdk", "description": "jdcloud openApi sdk",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
@@ -61,5 +61,5 @@
"fetch" "fetch"
] ]
}, },
"gitHead": "a619f8a2fee68169ae3c57cf6e8de18141de17ba" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/lib-k8s
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-k8s
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-k8s **Note:** Version bump only for package @certd/lib-k8s

View File

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

View File

@@ -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.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/lib-server
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/lib-server **Note:** Version bump only for package @certd/lib-server

View File

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

View File

@@ -1,16 +1,16 @@
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core'; import {Inject, Provide, Scope, ScopeEnum} from '@midwayjs/core';
import { InjectEntityModel } from '@midwayjs/typeorm'; import {InjectEntityModel} from '@midwayjs/typeorm';
import { Repository } from 'typeorm'; import {Repository} from 'typeorm';
import { BaseService, PageReq, PermissionException, ValidateException } from '../../../index.js'; import {AccessGetter, BaseService, PageReq, PermissionException, ValidateException} from '../../../index.js';
import { AccessEntity } from '../entity/access.js'; import {AccessEntity} from '../entity/access.js';
import { AccessDefine, accessRegistry, newAccess } from '@certd/pipeline'; import {AccessDefine, accessRegistry, newAccess} from '@certd/pipeline';
import { EncryptService } from './encrypt-service.js'; import {EncryptService} from './encrypt-service.js';
/** /**
* 授权 * 授权
*/ */
@Provide() @Provide()
@Scope(ScopeEnum.Request, { allowDowngrade: true }) @Scope(ScopeEnum.Request, {allowDowngrade: true})
export class AccessService extends BaseService<AccessEntity> { export class AccessService extends BaseService<AccessEntity> {
@InjectEntityModel(AccessEntity) @InjectEntityModel(AccessEntity)
repository: Repository<AccessEntity>; repository: Repository<AccessEntity>;
@@ -95,6 +95,7 @@ export class AccessService extends BaseService<AccessEntity> {
param.encryptSetting = JSON.stringify(encryptSetting); param.encryptSetting = JSON.stringify(encryptSetting);
param.setting = JSON.stringify(json); param.setting = JSON.stringify(json);
} }
/** /**
* 修改 * 修改
* @param param 数据 * @param param 数据
@@ -140,7 +141,8 @@ export class AccessService extends BaseService<AccessEntity> {
id: entity.id, id: entity.id,
...setting, ...setting,
}; };
return await newAccess(entity.type, input); const accessGetter = new AccessGetter(userId, this.getById.bind(this));
return await newAccess(entity.type, input,accessGetter);
} }
async getById(id: any, userId: number): Promise<any> { async getById(id: any, userId: number): Promise<any> {

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/midway-flyway-js **Note:** Version bump only for package @certd/midway-flyway-js

View File

@@ -1,6 +1,6 @@
{ {
"name": "@certd/midway-flyway-js", "name": "@certd/midway-flyway-js",
"version": "1.35.2", "version": "1.35.4",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11", "typeorm": "^0.3.11",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "a619f8a2fee68169ae3c57cf6e8de18141de17ba" "gitHead": "d15dfafd5d8c74c1a51c859b2586c26ca01e3bf8"
} }

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/plugin-cert
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/plugin-cert
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
**Note:** Version bump only for package @certd/plugin-cert **Note:** Version bump only for package @certd/plugin-cert

View File

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

View File

@@ -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.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
**Note:** Version bump only for package @certd/plugin-lib
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes ### Bug Fixes

View File

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

View File

@@ -54,6 +54,9 @@ export default class S3OssClientImpl extends BaseOssClient<S3Access> {
Prefix: dirKey, // The name of the object. For example, 'sample_upload.txt'. Prefix: dirKey, // The name of the object. For example, 'sample_upload.txt'.
}; };
const res = await this.client.send(new ListObjectsCommand({ ...params })); const res = await this.client.send(new ListObjectsCommand({ ...params }));
if (!res.Contents) {
return [];
}
return res.Contents.map(item => { return res.Contents.map(item => {
return { return {
path: item.Key, path: item.Key,

View File

@@ -1,4 +1,6 @@
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline"; import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
import { ossClientFactory } from "../oss/index.js";
import S3OssClientImpl from "../oss/impls/s3.js";
/** /**
* 这个注解将注册一个授权配置 * 这个注解将注册一个授权配置
@@ -82,6 +84,32 @@ export class S3Access extends BaseAccess {
required: true, required: true,
}) })
bucket!: string; bucket!: string;
@AccessInput({
title: "测试",
component: {
name: "api-test",
action: "TestRequest",
},
helper: "点击测试接口是否正常",
})
testRequest = true;
async onTestRequest() {
const client: S3OssClientImpl = await ossClientFactory.createOssClientByType("s3", {
access: this,
rootDir: "",
ctx: {
accessService: this.ctx.accessService,
logger: this.ctx.logger,
utils: this.ctx.utils,
},
});
await client.listDir("/");
return "ok";
}
} }
new S3Access(); new S3Access();

View File

@@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
**Note:** Version bump only for package @certd/ui-client
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 授权列表类型颜色优化 ([1e86338](https://github.com/certd/certd/commit/1e863382d3d1a8cc95a1abf51e75bf6eaea3244f))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Performance Improvements ### Performance Improvements

View File

@@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-client", "name": "@certd/ui-client",
"version": "1.35.2", "version": "1.35.4",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite --open", "dev": "vite --open",
@@ -30,10 +30,10 @@
"@aws-sdk/client-s3": "^3.535.0", "@aws-sdk/client-s3": "^3.535.0",
"@aws-sdk/s3-request-presigner": "^3.535.0", "@aws-sdk/s3-request-presigner": "^3.535.0",
"@ctrl/tinycolor": "^4.1.0", "@ctrl/tinycolor": "^4.1.0",
"@fast-crud/fast-crud": "^1.25.8", "@fast-crud/fast-crud": "^1.25.13",
"@fast-crud/fast-extends": "^1.25.8", "@fast-crud/fast-extends": "^1.25.13",
"@fast-crud/ui-antdv4": "^1.25.8", "@fast-crud/ui-antdv4": "^1.25.13",
"@fast-crud/ui-interface": "^1.25.8", "@fast-crud/ui-interface": "^1.25.13",
"@iconify/tailwind": "^1.2.0", "@iconify/tailwind": "^1.2.0",
"@iconify/vue": "^4.1.1", "@iconify/vue": "^4.1.1",
"@manypkg/get-packages": "^2.2.2", "@manypkg/get-packages": "^2.2.2",
@@ -102,8 +102,8 @@
"zod-defaults": "^0.1.3" "zod-defaults": "^0.1.3"
}, },
"devDependencies": { "devDependencies": {
"@certd/lib-iframe": "^1.35.2", "@certd/lib-iframe": "^1.35.4",
"@certd/pipeline": "^1.35.2", "@certd/pipeline": "^1.35.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",

View File

@@ -334,6 +334,22 @@ function install(app: App, options: any = {}) {
return columnProps; return columnProps;
}, },
}); });
registerMergeColumnPlugin({
name: "reset-values-format-colors",
order: 10,
handle: (columnProps: ColumnCompositionProps) => {
// 你可以在此处做你自己的处理
// 比如你可以定义一个readonly的公共属性处理该字段只读不能编辑
if (columnProps.column?.component?.name === "fs-values-format") {
// 合并column配置
if (!columnProps.column.component.autoColors) {
columnProps.column.component.autoColors = ["green", "cyan", "blue", "purple", "geekblue"];
}
}
return columnProps;
},
});
} }
export default { export default {

View File

@@ -49,38 +49,38 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
pageRequest, pageRequest,
addRequest, addRequest,
editRequest, editRequest,
delRequest delRequest,
}, },
toolbar: { toolbar: {
show: false show: false,
}, },
search: { search: {
show: false show: false,
}, },
form: { form: {
wrapper: { wrapper: {
width: "1050px" width: "1050px",
} },
}, },
rowHandle: { rowHandle: {
width: 200 width: 200,
}, },
table: { table: {
scroll: { scroll: {
x: 800 x: 800,
}, },
rowSelection: { rowSelection: {
type: "radio", type: "radio",
selectedRowKeys: selectedRowKey, selectedRowKeys: selectedRowKey,
onChange: onSelectChange onChange: onSelectChange,
}, },
customRow: (record: any) => { customRow: (record: any) => {
return { return {
onClick: () => { onClick: () => {
onSelectChange([record.id]); onSelectChange([record.id]);
} // 点击行 }, // 点击行
}; };
} },
}, },
columns: { columns: {
id: { id: {
@@ -88,25 +88,25 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
key: "id", key: "id",
type: "number", type: "number",
column: { column: {
width: 50 width: 50,
}, },
form: { form: {
show: false show: false,
} },
}, },
name: { name: {
title: "名称", title: "名称",
search: { search: {
show: true show: true,
}, },
type: ["text"], type: ["text"],
form: { form: {
rules: [{ required: true, message: "请填写名称" }], rules: [{ required: true, message: "请填写名称" }],
helper: "随便填,当多个相同类型的授权时,便于区分" helper: "随便填,当多个相同类型的授权时,便于区分",
}, },
column: { column: {
width: 200 width: 200,
} },
}, },
from: { from: {
title: "级别", title: "级别",
@@ -114,29 +114,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
dict: dict({ dict: dict({
data: [ data: [
{ label: "系统", value: "sys" }, { label: "系统", value: "sys" },
{ label: "用户", value: "user" } { label: "用户", value: "user" },
] ],
}), }),
search: { search: {
show: false show: false,
}, },
form: { form: {
show: false show: false,
}, },
column: { column: {
width: 100, width: 100,
align: "center", align: "center",
component: { component: {
color: "auto" color: "auto",
}, },
order: 10 order: 10,
}, },
valueBuilder: ({ row, key, value }) => { valueBuilder: ({ row, key, value }) => {
row[key] = row.userId > 0 ? "user" : "sys"; row[key] = row.userId > 0 ? "user" : "sys";
} },
}, },
...commonColumnsDefine ...commonColumnsDefine,
} },
} },
}; };
} }

View File

@@ -130,7 +130,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await api.DoCheck(row.id); await api.DoCheck(row.id);
await crudExpose.doRefresh(); await crudExpose.doRefresh();
notification.success({ notification.success({
message: "检查完成", message: "检查任务已提交,请稍后刷新查看结果",
}); });
}, },
}, },

View File

@@ -137,7 +137,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await api.DoCheck(row.id); await api.DoCheck(row.id);
await crudExpose.doRefresh(); await crudExpose.doRefresh();
notification.success({ notification.success({
message: "检查任务已提交", message: "检查任务已提交,请稍后刷新查看结果",
}); });
}, },
}, },

View File

@@ -3,6 +3,24 @@
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.35.4](https://github.com/certd/certd/compare/v1.35.3...v1.35.4) (2025-06-13)
### Performance Improvements
* 支持s3 access做测试 ([f00aeac](https://github.com/certd/certd/commit/f00aeacb8b5c81f0bafa4c1b76723dec2b6b7784))
## [1.35.3](https://github.com/certd/certd/compare/v1.35.2...v1.35.3) (2025-06-12)
### Bug Fixes
* 修复重试次数设置无效的bug ([e2099ac](https://github.com/certd/certd/commit/e2099ac9ca344bc70bfa4219002e9138708973ae))
### Performance Improvements
* 支持雨云dns解析 ([8354348](https://github.com/certd/certd/commit/83543487e7418683bd79cfe3b9e0d792bdb977f7))
* 支持雨云dns解析以及雨云证书更新 ([43c7a19](https://github.com/certd/certd/commit/43c7a1984926f5d4647760cc134bb0aede3a7b7a))
* github 版本检查支持执行脚本 ([bad3504](https://github.com/certd/certd/commit/bad3504d4a15e6989b967b66aa9da8c6981f25bf))
## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09) ## [1.35.2](https://github.com/certd/certd/compare/v1.35.1...v1.35.2) (2025-06-09)
### Bug Fixes ### Bug Fixes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-server", "name": "@certd/ui-server",
"version": "1.35.2", "version": "1.35.4",
"description": "fast-server base midway", "description": "fast-server base midway",
"private": true, "private": true,
"type": "module", "type": "module",
@@ -42,20 +42,20 @@
"@aws-sdk/client-cloudfront": "^3.699.0", "@aws-sdk/client-cloudfront": "^3.699.0",
"@aws-sdk/client-iam": "^3.699.0", "@aws-sdk/client-iam": "^3.699.0",
"@aws-sdk/client-s3": "^3.705.0", "@aws-sdk/client-s3": "^3.705.0",
"@certd/acme-client": "^1.35.2", "@certd/acme-client": "^1.35.4",
"@certd/basic": "^1.35.2", "@certd/basic": "^1.35.4",
"@certd/commercial-core": "^1.35.2", "@certd/commercial-core": "^1.35.4",
"@certd/cv4pve-api-javascript": "^8.4.1", "@certd/cv4pve-api-javascript": "^8.4.1",
"@certd/jdcloud": "^1.35.2", "@certd/jdcloud": "^1.35.4",
"@certd/lib-huawei": "^1.35.2", "@certd/lib-huawei": "^1.35.4",
"@certd/lib-k8s": "^1.35.2", "@certd/lib-k8s": "^1.35.4",
"@certd/lib-server": "^1.35.2", "@certd/lib-server": "^1.35.4",
"@certd/midway-flyway-js": "^1.35.2", "@certd/midway-flyway-js": "^1.35.4",
"@certd/pipeline": "^1.35.2", "@certd/pipeline": "^1.35.4",
"@certd/plugin-cert": "^1.35.2", "@certd/plugin-cert": "^1.35.4",
"@certd/plugin-lib": "^1.35.2", "@certd/plugin-lib": "^1.35.4",
"@certd/plugin-plus": "^1.35.2", "@certd/plugin-plus": "^1.35.4",
"@certd/plus-core": "^1.35.2", "@certd/plus-core": "^1.35.4",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120", "@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120", "@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
"@koa/cors": "^5.0.0", "@koa/cors": "^5.0.0",

View File

@@ -1,5 +1,5 @@
import {ALL, Body, Controller, Inject, Post, Provide} from '@midwayjs/core'; import {ALL, Body, Controller, Inject, Post, Provide} from '@midwayjs/core';
import {AccessService, BaseController, Constants} from '@certd/lib-server'; import {AccessGetter, AccessService, BaseController, Constants} from '@certd/lib-server';
import { import {
AccessRequestHandleReq, AccessRequestHandleReq,
IAccessService, IAccessService,
@@ -33,6 +33,7 @@ export class HandleController extends BaseController {
@Post('/access', { summary: Constants.per.authOnly }) @Post('/access', { summary: Constants.per.authOnly })
async accessRequest(@Body(ALL) body: AccessRequestHandleReq) { async accessRequest(@Body(ALL) body: AccessRequestHandleReq) {
const userId = this.getUserId();
let inputAccess = body.input.access; let inputAccess = body.input.access;
if (body.input.id > 0) { if (body.input.id > 0) {
const oldEntity = await this.accessService.info(body.input.id); const oldEntity = await this.accessService.info(body.input.id);
@@ -48,8 +49,8 @@ export class HandleController extends BaseController {
inputAccess = this.accessService.decryptAccessEntity(param); inputAccess = this.accessService.decryptAccessEntity(param);
} }
} }
const accessGetter = new AccessGetter(userId, this.accessService.getById.bind(this.accessService));
const access = await newAccess(body.typeName, inputAccess); const access = await newAccess(body.typeName, inputAccess,accessGetter);
const res = await access.onRequest(body); const res = await access.onRequest(body);

View File

@@ -1,11 +1,15 @@
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core'; import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
import { PipelineService } from '../pipeline/service/pipeline-service.js'; import { PipelineService } from '../pipeline/service/pipeline-service.js';
import { logger } from '@certd/basic'; import { logger } from '@certd/basic';
import { SysSettingsService } from '@certd/lib-server'; import {SysSettingsService, SysSiteInfo} from '@certd/lib-server';
import { SiteInfoService } from '../monitor/index.js'; import { SiteInfoService } from '../monitor/index.js';
import { Cron } from '../cron/cron.js'; import { Cron } from '../cron/cron.js';
import {UserSettingsService} from "../mine/service/user-settings-service.js"; import {UserSettingsService} from "../mine/service/user-settings-service.js";
import {UserSiteMonitorSetting} from "../mine/service/models.js"; import {UserSiteMonitorSetting} from "../mine/service/models.js";
import {getPlusInfo} from "@certd/plus-core";
import dayjs from "dayjs";
import {NotificationService} from "../pipeline/service/notification-service.js";
import {UserService} from "../sys/authority/service/user-service.js";
@Autoload() @Autoload()
@Scope(ScopeEnum.Request, { allowDowngrade: true }) @Scope(ScopeEnum.Request, { allowDowngrade: true })
@@ -33,6 +37,13 @@ export class AutoCRegisterCron {
@Inject() @Inject()
cron: Cron; cron: Cron;
@Inject()
notificationService: NotificationService;
@Inject()
userService: UserService;
@Init() @Init()
async init() { async init() {
logger.info('加载定时trigger开始'); logger.info('加载定时trigger开始');
@@ -44,6 +55,9 @@ export class AutoCRegisterCron {
// const metas = listPropertyDataFromClass(CLASS_KEY, this.echoPlugin); // const metas = listPropertyDataFromClass(CLASS_KEY, this.echoPlugin);
// console.log('metas', metas); // console.log('metas', metas);
await this.registerSiteMonitorCron(); await this.registerSiteMonitorCron();
await this.registerPlusExpireCheckCron();
} }
async registerSiteMonitorCron() { async registerSiteMonitorCron() {
@@ -69,4 +83,58 @@ export class AutoCRegisterCron {
await this.siteInfoService.triggerJobOnce() await this.siteInfoService.triggerJobOnce()
} }
} }
registerPlusExpireCheckCron(){
// 添加plus即将到期检查任务
this.cron.register({
name: 'plus-expire-check',
cron: `0 10 9 * * *`, // 一天只能检查一次,否则会重复发送通知
job: async () => {
const plusInfo = getPlusInfo()
if (!plusInfo.originVipType || plusInfo.originVipType==="free" ) {
return
}
let label ="专业版"
if( plusInfo.originVipType === 'comm'){
label = "商业版"
}
const siteInfo = await this.sysSettingsService.getSetting<SysSiteInfo>(SysSiteInfo)
const appTitle = siteInfo.title || "certd"
const expiresDate = dayjs(plusInfo.expireTime).format("YYYY-MM-DD")
// plusInfo.expireTime= dayjs("2025-06-10").valueOf()
let expiresDays =Math.floor((plusInfo.expireTime - new Date().getTime())/ 1000 / 60 / 60 / 24)
let title = ""
let content =""
if(expiresDays === 20 ||expiresDays === 10 || expiresDays === 3 || expiresDays === 1 || expiresDays === 0){
title = `vip(${label})即将到期`
content = `您的${appTitle} vip (${label})剩余${expiresDays}天(${expiresDate})到期,请及时续期,以免影响业务`
}else if (expiresDays === -1 || expiresDays === -3 || expiresDays === -7) {
title = `vip(${label})已过期`
content = `您的${appTitle} vip (${label})已过期${Math.abs(expiresDays)}天(${expiresDate}),请尽快续期,以免影响业务`
}
if(title){
logger.warn(title)
logger.warn(content)
const url = await this.notificationService.getBindUrl("");
const adminUsers = await this.userService.getAdmins()
for (const adminUser of adminUsers) {
logger.info(`发送vip到期通知给管理员${adminUser.username}`)
await this.notificationService.send({
useDefault: true,
logger: logger,
body:{
title,
content,
errorMessage:title,
url
}
},adminUser.id)
}
}
}
})
}
} }

View File

@@ -104,7 +104,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
* @param notify * @param notify
* @param retryTimes * @param retryTimes
*/ */
async doCheck(site: SiteInfoEntity, notify = true, retryTimes = 3) { async doCheck(site: SiteInfoEntity, notify = true, retryTimes = null) {
if (!site?.domain) { if (!site?.domain) {
throw new Error("站点域名不能为空"); throw new Error("站点域名不能为空");
} }
@@ -152,7 +152,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
//检查ip //检查ip
await this.checkAllIp(site); await this.checkAllIp(site,retryTimes);
if (!notify) { if (!notify) {
return; return;
@@ -181,7 +181,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
} }
} }
async checkAllIp(site: SiteInfoEntity) { async checkAllIp(site: SiteInfoEntity,retryTimes = null) {
if (!site.ipCheck) { if (!site.ipCheck) {
return; return;
} }
@@ -225,7 +225,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
logger.error("send notify error", e); logger.error("send notify error", e);
} }
}; };
await this.siteIpService.checkAll(site, onFinished); await this.siteIpService.checkAll(site, retryTimes,onFinished);
} }
/** /**
@@ -234,7 +234,7 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
* @param notify * @param notify
* @param retryTimes * @param retryTimes
*/ */
async check(id: number, notify = false, retryTimes = 3) { async check(id: number, notify = false, retryTimes = null) {
const site = await this.info(id); const site = await this.info(id);
if (!site) { if (!site) {
throw new Error("站点不存在"); throw new Error("站点不存在");
@@ -326,7 +326,6 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
return setting; return setting;
} }
for (const site of sites) { for (const site of sites) {
let retryTimes = 3;
const setting = await getFromCache(site.userId) const setting = await getFromCache(site.userId)
if (isCommon) { if (isCommon) {
//公共的检查排除有设置cron的用户 //公共的检查排除有设置cron的用户
@@ -334,8 +333,8 @@ export class SiteInfoService extends BaseService<SiteInfoEntity> {
//设置了cron跳过公共检查 //设置了cron跳过公共检查
continue; continue;
} }
retryTimes = setting.retryTimes??retryTimes
} }
let retryTimes = setting?.retryTimes
this.doCheck(site,true,retryTimes).catch(e => { this.doCheck(site,true,retryTimes).catch(e => {
logger.error(`检查站点证书失败,${site.domain}`, e.message); logger.error(`检查站点证书失败,${site.domain}`, e.message);
}); });

View File

@@ -88,7 +88,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
await this.updateIpCount(entity.id) await this.updateIpCount(entity.id)
} }
async check(ipId: number, domain: string, port: number) { async check(ipId: number, domain: string, port: number,retryTimes = null) {
if(!ipId){ if(!ipId){
return return
} }
@@ -105,7 +105,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
const res = await siteTester.test({ const res = await siteTester.test({
host: domain, host: domain,
port: port, port: port,
retryTimes: 3, retryTimes : retryTimes??3,
ipAddress: entity.ipAddress ipAddress: entity.ipAddress
}); });
@@ -154,7 +154,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
} }
} }
async checkAll(siteInfo: SiteInfoEntity,onFinish?: (e: any) => void) { async checkAll(siteInfo: SiteInfoEntity,retryTimes = null,onFinish?: (e: any) => void) {
const siteId = siteInfo.id; const siteId = siteInfo.id;
const ips = await this.repository.find({ const ips = await this.repository.find({
where: { where: {
@@ -167,7 +167,7 @@ export class SiteIpService extends BaseService<SiteIpEntity> {
for (const item of ips) { for (const item of ips) {
const func = async () => { const func = async () => {
try { try {
return await this.check(item.id, domain, port); return await this.check(item.id, domain, port,retryTimes);
} catch (e) { } catch (e) {
logger.error("check site item error", e); logger.error("check site item error", e);
return { return {

View File

@@ -18,7 +18,7 @@ export type SiteTestRes = {
export class SiteTester { export class SiteTester {
async test(req: SiteTestReq): Promise<SiteTestRes> { async test(req: SiteTestReq): Promise<SiteTestRes> {
logger.info("测试站点:", JSON.stringify(req)); logger.info("测试站点:", JSON.stringify(req));
const maxRetryTimes = req.retryTimes ?? 3; const maxRetryTimes = req.retryTimes==null ? 3 : req.retryTimes;
let tryCount = 0; let tryCount = 0;
let result: SiteTestRes = {}; let result: SiteTestRes = {};
while (true) { while (true) {
@@ -28,12 +28,12 @@ export class SiteTester {
} catch (e) { } catch (e) {
tryCount++; tryCount++;
if (tryCount > maxRetryTimes) { if (tryCount > maxRetryTimes) {
logger.error(`测试站点出错,重试${maxRetryTimes}次。`, e.message); logger.error(`测试站点出错,已超过最大重试次数(${maxRetryTimes}`, e.message);
throw e; throw e;
} }
//指数退避 //指数退避
const time = 2 ** tryCount; const time = 2 ** tryCount;
logger.error(`测试站点出错,${time}s后重试`, e); logger.error(`测试站点出错,${time}s后重试(${tryCount}/${maxRetryTimes})`, e);
await utils.sleep(time * 1000); await utils.sleep(time * 1000);
} }
} }

View File

@@ -1,6 +1,6 @@
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core'; import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { InjectEntityModel } from '@midwayjs/typeorm'; import { InjectEntityModel } from '@midwayjs/typeorm';
import { MoreThan, Not, Repository } from 'typeorm'; import {In, MoreThan, Not, Repository} from 'typeorm';
import { UserEntity } from '../entity/user.js'; import { UserEntity } from '../entity/user.js';
import * as _ from 'lodash-es'; import * as _ from 'lodash-es';
import { BaseService, CommonException, Constants, FileService, SysInstallInfo, SysSettingsService } from '@certd/lib-server'; import { BaseService, CommonException, Constants, FileService, SysInstallInfo, SysSettingsService } from '@certd/lib-server';
@@ -15,6 +15,8 @@ import { DbAdapter } from '../../../db/index.js';
import { simpleNanoId, utils } from '@certd/basic'; import { simpleNanoId, utils } from '@certd/basic';
export type RegisterType = 'username' | 'mobile' | 'email'; export type RegisterType = 'username' | 'mobile' | 'email';
export const AdminRoleId = 1
/** /**
* 系统用户 * 系统用户
*/ */
@@ -275,7 +277,7 @@ export class UserService extends BaseService<UserEntity> {
}, },
}); });
const roleIds = userRoles.map(item => item.roleId); const roleIds = userRoles.map(item => item.roleId);
if (roleIds.includes(1)) { if (roleIds.includes(AdminRoleId)) {
return true; return true;
} }
} }
@@ -313,4 +315,23 @@ export class UserService extends BaseService<UserEntity> {
return result; return result;
} }
async getAdmins() {
const admins = await this.userRoleService.find({
where: {
roleId: AdminRoleId,
},
});
const userIds = admins.map(item => item.userId);
return await this.repository.find({
where: {
id: In(userIds),
status: 1,
},
order: {
updateTime: 'DESC',
},
})
}
} }

View File

@@ -24,3 +24,4 @@ export * from './plugin-notification/index.js'
export * from './plugin-flex/index.js' export * from './plugin-flex/index.js'
export * from './plugin-farcdn/index.js' export * from './plugin-farcdn/index.js'
export * from './plugin-fnos/index.js' export * from './plugin-fnos/index.js'
export * from './plugin-rainyun/index.js'

View File

@@ -1,5 +1,6 @@
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline"; import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from "@certd/pipeline";
import { GithubAccess } from "../access.js"; import { GithubAccess } from "../access.js";
import {SshClient} from "@certd/plugin-lib";
@IsTaskPlugin({ @IsTaskPlugin({
//命名规范,插件类型+功能就是目录plugin-demo中的demo大写字母开头驼峰命名 //命名规范,插件类型+功能就是目录plugin-demo中的demo大写字母开头驼峰命名
@@ -56,6 +57,31 @@ export class GithubCheckRelease extends AbstractTaskPlugin {
lastVersion?: string; lastVersion?: string;
@TaskInput({
title: '主机登录配置',
helper: '登录',
component: {
name: 'access-selector',
type: 'ssh',
},
required: false,
})
sshAccessId!: string;
@TaskInput({
title: 'shell脚本命令',
component: {
name: 'a-textarea',
vModel: 'value',
rows: 6,
placeholder: `#拉取最新版镜像\ndocker pull greper/certd:latest \n#重建容器 \nnohup sh -c 'sleep 10; cd ~/deploy/certd/ ; docker compose down; docker compose up -d' >/dev/null & `,
},
helper: '有新版本后执行命令,比如:拉取最新版镜像,然后重建容器\n注意自己升级自己需要使用nobup配合sleep',
required: false,
})
script!: string;
//插件实例化时执行的方法 //插件实例化时执行的方法
async onInstance() { async onInstance() {
} }
@@ -100,6 +126,19 @@ export class GithubCheckRelease extends AbstractTaskPlugin {
}) })
} }
if (this.script != null && this.script.trim() != "") {
const connectConf = await this.getAccess(this.sshAccessId);
const sshClient = new SshClient(this.logger);
const scripts = this.script.split('\n');
await sshClient.exec({
connectConf,
script: scripts,
env: {
REPO: this.repoName,
LAST_VERSION: this.lastVersion,
}
});
}
} }

View File

@@ -59,7 +59,8 @@ export class TelegramNotification extends BaseNotification {
skipSslVerify: boolean; skipSslVerify: boolean;
replaceText(text: string) { replaceText(text: string) {
return text.replaceAll('.', '\\.').replaceAll('*', '\\*'); // .*()<> 等都需要用\\进行替换
return text.replace(/[\\.*()<>]/g, '\\$&');
} }
async send(body: NotificationBody) { async send(body: NotificationBody) {
if (!this.botToken || !this.chatId) { if (!this.botToken || !this.chatId) {

View File

@@ -0,0 +1,152 @@
import {AccessInput, BaseAccess, IsAccess} from "@certd/pipeline";
import {HttpRequestConfig} from "@certd/basic";
import { CertInfo } from "@certd/plugin-cert";
/**
*/
@IsAccess({
name: "rainyun",
title: "雨云授权",
desc: "https://app.rainyun.com/",
icon: "svg:icon-lucky"
})
export class RainyunAccess extends BaseAccess {
@AccessInput({
title: "ApiKey",
component: {
placeholder: "api-key",
component: {
name: "a-input",
vModel: "value"
}
},
helper:"https://app.rainyun.com/account/settings/api-key",
encrypt: true,
required: true
})
apiKey!: string;
@AccessInput({
title: "测试",
component: {
name: "api-test",
action: "TestRequest"
},
helper: "点击测试接口是否正常"
})
testRequest = true;
async onTestRequest() {
await this.getDomainList({limit:1});
return "ok"
}
// {"columnFilters":{"domains.Domain":"domain"},"sort":[],"page":1,"perPage":20}
async getDomainList(req:{offset?:number,limit?:number,query?:string}){
const size = req.limit ?? 20;
const offset = req.offset ?? 0;
let page = Math.floor(offset / size);
if(offset % size === 0 ){
page++
}
const options ={
page: page,
perPage: size,
columnFilters: {
"domains.Domain": req.query??""
},
}
const res = await this.doRequest({
url: `/product/domain/?options=${encodeURIComponent(JSON.stringify(options))}`,
method: "GET",
});
return {
total: res.TotalRecords,
list: res.Records || [],
limit: size,
offset: offset
}
}
async getCertList(req:{offset?:number,limit?:number,query?:string}){
const size = req.limit ?? 20;
const offset = req.offset ?? 0;
let page = Math.floor(offset / size);
if(offset % size === 0 ){
page++
}
const options ={
columnFilters: {
Domain: req.query??""
},
sort:[],
page: page,
perPage: size,
}
const res = await this.doRequest({
url: `product/sslcenter/?options=${encodeURIComponent(JSON.stringify(options))}`,
method: "GET",
});
return {
total: res.TotalRecords,
list: res.Records || [],
limit: size,
offset: offset
}
}
async doCertReplace(req:{certId:number,cert:CertInfo}){
// /product/sslcenter/{id}
return await this.doRequest({
url: `product/sslcenter/${req.certId}`,
method: "PUT",
data: {
cert: req.cert.crt,
key: req.cert.key,
}
});
}
async getDomainId(domain:string){
const res = await this.getDomainList({query: domain,limit:1});
if (res.list.length === 0) {
throw new Error(`域名${domain}不存在` );
}
return res.list[0].id;
}
async doRequest(req:HttpRequestConfig){
const res = await this.ctx.http.request({
url: req.url,
baseURL:"https://api.v2.rainyun.com",
method: req.method|| "POST",
data: req.data,
params: req.params,
headers:{
"X-Api-Key": this.apiKey
},
// httpProxy: this.httpProxy||undefined,
});
if (res.code === 200) {
return res.data;
}
throw new Error(res.message || res);
}
}
new RainyunAccess();

View File

@@ -0,0 +1,66 @@
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
import { RainyunAccess } from "./access.js";
@IsDnsProvider({
name: "rainyun",
title: "雨云",
desc: "雨云DNS解析提供商",
accessType: "rainyun",
icon: "svg:icon-lucky",
order: 0
})
export class RainyunDnsProvider extends AbstractDnsProvider {
client: any;
async onInstance() {
}
async createRecord(options: CreateRecordOptions): Promise<any> {
const access: RainyunAccess = this.ctx.access as RainyunAccess;
const domainId = await access.getDomainId(options.domain);
if (!domainId) {
throw new Error(`域名${options.domain}未找到`);
}
const { fullRecord, hostRecord, value, type, domain } = options;
this.logger.info("添加域名解析:", fullRecord, value, domain);
const ret = await access.doRequest({
url: `/product/domain/${domainId}/dns`,
method: "POST",
data: {
host: hostRecord,
value: value,
level: 1,
type: type,
line: "DEFAULT",
ttl: 60
}
});
this.logger.info("添加域名解析成功:", JSON.stringify(options), ret);
return {
recordId: ret,
domainId: domainId
};
}
async removeRecord(options: RemoveRecordOptions<any>): Promise<any> {
const { fullRecord, value } = options.recordReq;
const access: RainyunAccess = this.ctx.access as RainyunAccess;
const record = options.recordRes;
const ret = await access.doRequest({
url: `/product/domain/${record.domainId}/dns?record_id=${record.recordId}`,
method: "DELETE",
});
this.logger.info("删除域名解析成功:", fullRecord, value, ret);
return ret;
}
}
new RainyunDnsProvider();

View File

@@ -0,0 +1,2 @@
export * from "./plugins/index.js";
export * from "./access.js";

View File

@@ -0,0 +1,113 @@
import { AbstractTaskPlugin, IsTaskPlugin, PageReq, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert";
import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib";
import { RainyunAccess } from "../access.js";
@IsTaskPlugin({
//命名规范,插件类型+功能就是目录plugin-demo中的demo大写字母开头驼峰命名
name: "RainyunRefreshCert",
title: "雨云-更新证书",
desc: "app.rainyun.com",
icon: "svg:icon-lucky",
//插件分组
group: pluginGroups.cdn.key,
needPlus: false,
default: {
//默认值配置照抄即可
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed
}
}
})
//类名规范跟上面插件名称name一致
export class RainyunRefreshCert extends AbstractTaskPlugin {
//证书选择,此项必须要有
@TaskInput({
title: "域名证书",
helper: "请选择前置任务输出的域名证书",
component: {
name: "output-selector",
from: [...CertApplyPluginNames]
}
// required: true, // 必填
})
cert!: CertInfo;
@TaskInput(createCertDomainGetterInputDefine({ props: { required: false } }))
certDomains!: string[];
//授权选择框
@TaskInput({
title: "雨云授权",
component: {
name: "access-selector",
type: "rainyun" //固定授权类型
},
required: true //必填
})
accessId!: string;
//
@TaskInput(
createRemoteSelectInputDefine({
title: "证书Id",
helper: "要更新的rainyun证书id",
action: RainyunRefreshCert.prototype.onGetCertList.name
})
)
certList!: number[];
//插件实例化时执行的方法
async onInstance() {
}
//插件执行方法
async execute(): Promise<void> {
const access = await this.getAccess<RainyunAccess>(this.accessId);
for (const item of this.certList) {
this.logger.info(`----------- 开始更新证书:${item}`);
await access.doCertReplace({
certId: item,
cert: this.cert
});
this.logger.info(`----------- 更新证书${item}成功`);
}
this.logger.info("部署完成");
}
async onGetCertList(req: PageReq = {}) {
const access = await this.getAccess<RainyunAccess>(this.accessId);
const offset = req.offset ?? 0;
const limit = req.limit ?? 100;
const res = await access.getCertList({
offset,
limit
});
const total = res.total;
const list = res.list;
if (!list || list.length === 0) {
throw new Error("没有找到证书,请先在控制台上传一次证书且关联站点");
}
const options = list.map((item: any) => {
return {
label: `${item.Domain}<${item.ID}>`,
value: item.ID,
domain: item.Domain.split(",").map(item => item.trim())
};
});
return {
list: this.ctx.utils.options.buildGroupOptions(options, this.certDomains),
total: total,
offset: offset,
limit: limit
};
}
}
//实例化一下,注册插件
new RainyunRefreshCert();

130
pnpm-lock.yaml generated
View File

@@ -46,7 +46,7 @@ importers:
packages/core/acme-client: packages/core/acme-client:
dependencies: dependencies:
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../basic version: link:../basic
'@peculiar/x509': '@peculiar/x509':
specifier: ^1.11.0 specifier: ^1.11.0
@@ -207,10 +207,10 @@ importers:
packages/core/pipeline: packages/core/pipeline:
dependencies: dependencies:
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../basic version: link:../basic
'@certd/plus-core': '@certd/plus-core':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../pro/plus-core version: link:../../pro/plus-core
dayjs: dayjs:
specifier: ^1.11.7 specifier: ^1.11.7
@@ -415,7 +415,7 @@ importers:
packages/libs/lib-k8s: packages/libs/lib-k8s:
dependencies: dependencies:
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/basic version: link:../../core/basic
'@kubernetes/client-node': '@kubernetes/client-node':
specifier: 0.21.0 specifier: 0.21.0
@@ -455,16 +455,16 @@ importers:
packages/libs/lib-server: packages/libs/lib-server:
dependencies: dependencies:
'@certd/acme-client': '@certd/acme-client':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/acme-client version: link:../../core/acme-client
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/basic version: link:../../core/basic
'@certd/pipeline': '@certd/pipeline':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/pipeline version: link:../../core/pipeline
'@certd/plus-core': '@certd/plus-core':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../pro/plus-core version: link:../../pro/plus-core
'@midwayjs/cache': '@midwayjs/cache':
specifier: ~3.14.0 specifier: ~3.14.0
@@ -607,16 +607,16 @@ importers:
packages/plugins/plugin-cert: packages/plugins/plugin-cert:
dependencies: dependencies:
'@certd/acme-client': '@certd/acme-client':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/acme-client version: link:../../core/acme-client
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/basic version: link:../../core/basic
'@certd/pipeline': '@certd/pipeline':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/pipeline version: link:../../core/pipeline
'@certd/plugin-lib': '@certd/plugin-lib':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../plugin-lib version: link:../plugin-lib
'@google-cloud/publicca': '@google-cloud/publicca':
specifier: ^1.3.0 specifier: ^1.3.0
@@ -698,10 +698,10 @@ importers:
specifier: ^3.787.0 specifier: ^3.787.0
version: 3.810.0(aws-crt@1.26.2) version: 3.810.0(aws-crt@1.26.2)
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/basic version: link:../../core/basic
'@certd/pipeline': '@certd/pipeline':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/pipeline version: link:../../core/pipeline
'@kubernetes/client-node': '@kubernetes/client-node':
specifier: 0.21.0 specifier: 0.21.0
@@ -789,19 +789,19 @@ importers:
packages/pro/commercial-core: packages/pro/commercial-core:
dependencies: dependencies:
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/basic version: link:../../core/basic
'@certd/lib-server': '@certd/lib-server':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../libs/lib-server version: link:../../libs/lib-server
'@certd/pipeline': '@certd/pipeline':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/pipeline version: link:../../core/pipeline
'@certd/plugin-plus': '@certd/plugin-plus':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../plugin-plus version: link:../plugin-plus
'@certd/plus-core': '@certd/plus-core':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../plus-core version: link:../plus-core
'@midwayjs/core': '@midwayjs/core':
specifier: ~3.20.3 specifier: ~3.20.3
@@ -886,22 +886,22 @@ importers:
specifier: ^1.0.2 specifier: ^1.0.2
version: 1.0.3 version: 1.0.3
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/basic version: link:../../core/basic
'@certd/lib-k8s': '@certd/lib-k8s':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../libs/lib-k8s version: link:../../libs/lib-k8s
'@certd/pipeline': '@certd/pipeline':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/pipeline version: link:../../core/pipeline
'@certd/plugin-cert': '@certd/plugin-cert':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../plugins/plugin-cert version: link:../../plugins/plugin-cert
'@certd/plugin-lib': '@certd/plugin-lib':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../plugins/plugin-lib version: link:../../plugins/plugin-lib
'@certd/plus-core': '@certd/plus-core':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../plus-core version: link:../plus-core
ali-oss: ali-oss:
specifier: ^6.21.0 specifier: ^6.21.0
@@ -1004,7 +1004,7 @@ importers:
packages/pro/plus-core: packages/pro/plus-core:
dependencies: dependencies:
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/basic version: link:../../core/basic
dayjs: dayjs:
specifier: ^1.11.7 specifier: ^1.11.7
@@ -1083,17 +1083,17 @@ importers:
specifier: ^4.1.0 specifier: ^4.1.0
version: 4.1.0 version: 4.1.0
'@fast-crud/fast-crud': '@fast-crud/fast-crud':
specifier: ^1.25.8 specifier: ^1.25.13
version: 1.25.11(vue@3.5.14(typescript@5.8.3)) version: 1.25.13(vue@3.5.14(typescript@5.8.3))
'@fast-crud/fast-extends': '@fast-crud/fast-extends':
specifier: ^1.25.8 specifier: ^1.25.13
version: 1.25.11(aws-crt@1.26.2)(vue@3.5.14(typescript@5.8.3)) version: 1.25.13(aws-crt@1.26.2)(vue@3.5.14(typescript@5.8.3))
'@fast-crud/ui-antdv4': '@fast-crud/ui-antdv4':
specifier: ^1.25.8 specifier: ^1.25.13
version: 1.25.11 version: 1.25.13
'@fast-crud/ui-interface': '@fast-crud/ui-interface':
specifier: ^1.25.8 specifier: ^1.25.13
version: 1.25.11 version: 1.25.13
'@iconify/tailwind': '@iconify/tailwind':
specifier: ^1.2.0 specifier: ^1.2.0
version: 1.2.0 version: 1.2.0
@@ -1294,10 +1294,10 @@ importers:
version: 0.1.3(zod@3.24.4) version: 0.1.3(zod@3.24.4)
devDependencies: devDependencies:
'@certd/lib-iframe': '@certd/lib-iframe':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../libs/lib-iframe version: link:../../libs/lib-iframe
'@certd/pipeline': '@certd/pipeline':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/pipeline version: link:../../core/pipeline
'@rollup/plugin-commonjs': '@rollup/plugin-commonjs':
specifier: ^25.0.7 specifier: ^25.0.7
@@ -1480,46 +1480,46 @@ importers:
specifier: ^3.705.0 specifier: ^3.705.0
version: 3.810.0(aws-crt@1.26.2) version: 3.810.0(aws-crt@1.26.2)
'@certd/acme-client': '@certd/acme-client':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/acme-client version: link:../../core/acme-client
'@certd/basic': '@certd/basic':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/basic version: link:../../core/basic
'@certd/commercial-core': '@certd/commercial-core':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../pro/commercial-core version: link:../../pro/commercial-core
'@certd/cv4pve-api-javascript': '@certd/cv4pve-api-javascript':
specifier: ^8.4.1 specifier: ^8.4.1
version: 8.4.1 version: 8.4.1
'@certd/jdcloud': '@certd/jdcloud':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../libs/lib-jdcloud version: link:../../libs/lib-jdcloud
'@certd/lib-huawei': '@certd/lib-huawei':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../libs/lib-huawei version: link:../../libs/lib-huawei
'@certd/lib-k8s': '@certd/lib-k8s':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../libs/lib-k8s version: link:../../libs/lib-k8s
'@certd/lib-server': '@certd/lib-server':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../libs/lib-server version: link:../../libs/lib-server
'@certd/midway-flyway-js': '@certd/midway-flyway-js':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../libs/midway-flyway-js version: link:../../libs/midway-flyway-js
'@certd/pipeline': '@certd/pipeline':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../core/pipeline version: link:../../core/pipeline
'@certd/plugin-cert': '@certd/plugin-cert':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../plugins/plugin-cert version: link:../../plugins/plugin-cert
'@certd/plugin-lib': '@certd/plugin-lib':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../plugins/plugin-lib version: link:../../plugins/plugin-lib
'@certd/plugin-plus': '@certd/plugin-plus':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../pro/plugin-plus version: link:../../pro/plugin-plus
'@certd/plus-core': '@certd/plus-core':
specifier: ^1.35.1 specifier: ^1.35.2
version: link:../../pro/plus-core version: link:../../pro/plus-core
'@huaweicloud/huaweicloud-sdk-cdn': '@huaweicloud/huaweicloud-sdk-cdn':
specifier: ^3.1.120 specifier: ^3.1.120
@@ -3393,17 +3393,17 @@ packages:
resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
'@fast-crud/fast-crud@1.25.11': '@fast-crud/fast-crud@1.25.13':
resolution: {integrity: sha512-goqkB2ve05TSZ1pEXZZpyK2XuTn2jAM/0CYwYIUlZaQzY0xaKkh+7/8/wX/ZRsAV+Ppee6FEnnbEZaIA3YUb8w==} resolution: {integrity: sha512-2UDp0Wzsf9CXA9qJnyYjHYOR2usBRPij/8/15ksyFhBPLC8JJgXHFUae0lXqhib6QCV0CYrF8t7REEtxKmkUfw==}
'@fast-crud/fast-extends@1.25.11': '@fast-crud/fast-extends@1.25.13':
resolution: {integrity: sha512-TmH/SpDeHmKkcKmXlBj93R/ibhmtf7yki1z2wEIX1bEpAi0Nb5O5YwZXZO4sbze3LfTDAJhP1H74eerp009qWQ==} resolution: {integrity: sha512-Hn4p/sdO96KB/+umfrZhgPM3ZbaU78uMamjl+UKhyEB5U42jN45XSEsP4ax1IHFCpvxLvTMnmTzRHqkbgTS18g==}
'@fast-crud/ui-antdv4@1.25.11': '@fast-crud/ui-antdv4@1.25.13':
resolution: {integrity: sha512-0MceuaHdMizkRkTbRTNAqeWbJd6CkVsRPXYsOYBtM6L7HrtOJ/a/xqVlZaZyHlNqp2ZgwUV4eU4b0xWtPgksLA==} resolution: {integrity: sha512-3BDfZRGH9rBEYKw6hUyXD1kI9XtUFl9U/dX4PDH98i1tMg3GhUJ51gDZjZ8as9HsMrCE88m8ZUPjjQU/HLVY1w==}
'@fast-crud/ui-interface@1.25.11': '@fast-crud/ui-interface@1.25.13':
resolution: {integrity: sha512-/mu0fGNfugsl3NgoP7sEPDm8UGWXf4o8s6JxuhUIspS10YKwRs+1HgrI59YxRYq34/L2oGkCBVyPC0traT7kZA==} resolution: {integrity: sha512-hWjN6j6H2e9YxtqKL+fpls4/TTLZX6TuazjuxE+VoH0EdJF9QRk/D8GLxORGvnRgPABClbQvVPyofb6rPHjbAw==}
'@fidm/asn1@1.0.4': '@fidm/asn1@1.0.4':
resolution: {integrity: sha512-esd1jyNvRb2HVaQGq2Gg8Z0kbQPXzV9Tq5Z14KNIov6KfFD6PTaRIO8UpcsYiTNzOqJpmyzWgVTrUwFV3UF4TQ==} resolution: {integrity: sha512-esd1jyNvRb2HVaQGq2Gg8Z0kbQPXzV9Tq5Z14KNIov6KfFD6PTaRIO8UpcsYiTNzOqJpmyzWgVTrUwFV3UF4TQ==}
@@ -14546,10 +14546,10 @@ snapshots:
'@aws-sdk/crt-loader': 3.810.0 '@aws-sdk/crt-loader': 3.810.0
'@aws-sdk/signature-v4-multi-region': 3.810.0 '@aws-sdk/signature-v4-multi-region': 3.810.0
'@aws-sdk/types': 3.804.0 '@aws-sdk/types': 3.804.0
'@smithy/querystring-parser': 4.0.2 '@smithy/querystring-parser': 4.0.4
'@smithy/signature-v4': 5.1.0 '@smithy/signature-v4': 5.1.2
'@smithy/types': 4.2.0 '@smithy/types': 4.3.1
'@smithy/util-middleware': 4.0.2 '@smithy/util-middleware': 4.0.4
tslib: 2.8.1 tslib: 2.8.1
transitivePeerDependencies: transitivePeerDependencies:
- bufferutil - bufferutil
@@ -15935,7 +15935,7 @@ snapshots:
'@eslint/js@8.57.0': {} '@eslint/js@8.57.0': {}
'@fast-crud/fast-crud@1.25.11(vue@3.5.14(typescript@5.8.3))': '@fast-crud/fast-crud@1.25.13(vue@3.5.14(typescript@5.8.3))':
dependencies: dependencies:
'@iconify/types': 2.0.0 '@iconify/types': 2.0.0
file-saver: 2.0.5 file-saver: 2.0.5
@@ -15945,7 +15945,7 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- vue - vue
'@fast-crud/fast-extends@1.25.11(aws-crt@1.26.2)(vue@3.5.14(typescript@5.8.3))': '@fast-crud/fast-extends@1.25.13(aws-crt@1.26.2)(vue@3.5.14(typescript@5.8.3))':
dependencies: dependencies:
'@aws-sdk/client-s3': 3.810.0(aws-crt@1.26.2) '@aws-sdk/client-s3': 3.810.0(aws-crt@1.26.2)
'@aws-sdk/s3-request-presigner': 3.810.0 '@aws-sdk/s3-request-presigner': 3.810.0
@@ -15977,9 +15977,9 @@ snapshots:
- utf-8-validate - utf-8-validate
- vue - vue
'@fast-crud/ui-antdv4@1.25.11': {} '@fast-crud/ui-antdv4@1.25.13': {}
'@fast-crud/ui-interface@1.25.11': '@fast-crud/ui-interface@1.25.13':
dependencies: dependencies:
lodash-es: 4.17.21 lodash-es: 4.17.21