Compare commits

...

11 Commits

Author SHA1 Message Date
xiaojunnuo 51cc08411f perf: 优化宝塔网站证书在并发部署时导致nginx配置文件错乱的问题 2025-11-24 23:18:56 +08:00
xiaojunnuo d75034deae build: release 2025-11-19 23:57:16 +08:00
xiaojunnuo 4ce23debb6 build: publish 2025-11-19 23:55:03 +08:00
xiaojunnuo 063706a7bf build: trigger build image 2025-11-19 23:54:03 +08:00
xiaojunnuo eb41a3655f v1.37.10 2025-11-19 23:52:19 +08:00
xiaojunnuo a84476187f build: prepare to build 2025-11-19 23:49:47 +08:00
xiaojunnuo 70b603d601 perf: 站点证书监控备注输入框改成textarea 2025-11-19 23:49:09 +08:00
xiaojunnuo c9709f2698 perf: 优化dokploy 部署插件,配置选择serverId 2025-11-19 23:47:26 +08:00
xiaojunnuo be4f479afd build: release 2025-11-19 15:41:19 +08:00
xiaojunnuo a251465dbc build: publish 2025-11-19 15:30:56 +08:00
xiaojunnuo 9b7051f2be build: trigger build image 2025-11-19 15:30:33 +08:00
40 changed files with 271 additions and 249 deletions
+7
View File
@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
### Performance Improvements
* 优化dokploy 部署插件,配置选择serverId ([c9709f2](https://github.com/certd/certd/commit/c9709f26981c1cc9f71c14babb204329fcae0db5))
* 站点证书监控备注输入框改成textarea ([70b603d](https://github.com/certd/certd/commit/70b603d601c34f39148c2ab70c655c51babf563d))
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
### Bug Fixes
+17
View File
@@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
### Performance Improvements
* 优化dokploy 部署插件,配置选择serverId ([c9709f2](https://github.com/certd/certd/commit/c9709f26981c1cc9f71c14babb204329fcae0db5))
* 站点证书监控备注输入框改成textarea ([70b603d](https://github.com/certd/certd/commit/70b603d601c34f39148c2ab70c655c51babf563d))
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
### Bug Fixes
* 商用证书上传保存失败的bug ([075b1dc](https://github.com/certd/certd/commit/075b1dc0eb8c39acc277277b1b334d66b6717ab2))
### Performance Improvements
* 优化阿里云clb 过期证书清理报错的问题 ([d465367](https://github.com/certd/certd/commit/d4653678b2e3643460f918992eeae4044d3a1cc7))
## [1.37.8](https://github.com/certd/certd/compare/v1.37.7...v1.37.8) (2025-11-17)
### Bug Fixes
+1 -1
View File
@@ -62,7 +62,7 @@
| 14.| **威联通-部署证书到威联通** | 部署证书到qnap |
| 15.| **飞牛NAS-部署证书** | |
| 16.| **Proxmox-上传证书到Proxmox** | |
| 17.| **Dokploy-更新证书** | 自动更新Dokploy证书 |
| 17.| **Dokploy-部署server证书** | 自动更新Dokploy server证书 |
## 5. 阿里云
| 序号 | 名称 | 说明 |
+1 -1
View File
@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.37.9"
"version": "1.37.10"
}
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/publishlab/node-acme-client/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/acme-client
## [1.37.9](https://github.com/publishlab/node-acme-client/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/acme-client
+3 -3
View File
@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client",
"private": false,
"author": "nmorsman",
"version": "1.37.9",
"version": "1.37.10",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.37.9",
"@certd/basic": "^1.37.10",
"@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5",
"axios": "^1.7.2",
@@ -70,5 +70,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/basic
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/basic
+1 -1
View File
@@ -1 +1 @@
15:24
23:49
+3 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.37.9",
"version": "1.37.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -17,6 +17,7 @@
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"async-lock": "^1.4.1",
"axios": "^1.7.2",
"dayjs": "^1.11.7",
"http-proxy-agent": "^7.0.2",
@@ -46,5 +47,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
+9 -38
View File
@@ -1,46 +1,17 @@
import { logger, utils } from './index.js';
import { logger } from "./index.js";
// @ts-ignore
import AsyncLock from "async-lock";
export class Locker {
locked: Record<string, any> = {};
private asyncLocker: AsyncLock;
async execute(lockStr: string, callback: any) {
await this.lock(lockStr);
const timeoutId = setTimeout(() => {
logger.warn('Lock timeout,自动解锁', lockStr);
this.unlock(lockStr);
}, 20000);
try {
return await callback();
} finally {
clearTimeout(timeoutId);
this.unlock(lockStr);
}
constructor() {
this.asyncLocker = new AsyncLock();
}
async lock(str: string) {
const isLocked = this.isLocked(str);
if (isLocked) {
let count = 0;
while (true) {
await utils.sleep(100);
if (!this.isLocked(str)) {
break;
}
count++;
if (count > 20) {
throw new Error('Lock timeout');
}
}
}
this.locked[str] = true;
}
unlock(str: string) {
delete this.locked[str];
}
isLocked(str: string) {
return this.locked[str] ?? false;
async execute(lockStr: string, callback: any, options?: { timeout?: number }) {
const timeout = options?.timeout ?? 20000;
return this.asyncLocker.acquire(lockStr, callback, { timeout });
}
}
+14
View File
@@ -0,0 +1,14 @@
import { random } from "lodash-es";
import { locker } from "./dist/utils/util.lock.js";
async function testLocker() {
for (let i = 0; i < 10; i++) {
await locker.execute("test", async () => {
console.log("test", i);
await new Promise(resolve => setTimeout(resolve, Math.random() * 1000));
throw new Error("test error");
});
}
}
await testLocker();
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/pipeline
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/pipeline
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.37.9",
"version": "1.37.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -18,8 +18,8 @@
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"@certd/basic": "^1.37.9",
"@certd/plus-core": "^1.37.9",
"@certd/basic": "^1.37.10",
"@certd/plus-core": "^1.37.10",
"dayjs": "^1.11.7",
"lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13"
@@ -45,5 +45,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/lib-huawei
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/lib-huawei
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.37.9",
"version": "1.37.10",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts",
@@ -24,5 +24,5 @@
"prettier": "^2.8.8",
"tslib": "^2.8.1"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/lib-iframe
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/lib-iframe
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.37.9",
"version": "1.37.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/jdcloud
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/jdcloud
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/jdcloud",
"version": "1.37.9",
"version": "1.37.10",
"description": "jdcloud openApi sdk",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
@@ -61,5 +61,5 @@
"fetch"
]
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/lib-k8s
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/lib-k8s
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.37.9",
"version": "1.37.10",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -17,7 +17,7 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.37.9",
"@certd/basic": "^1.37.10",
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
@@ -32,5 +32,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/lib-server
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/lib-server
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.37.9",
"version": "1.37.10",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -28,11 +28,11 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.37.9",
"@certd/basic": "^1.37.9",
"@certd/pipeline": "^1.37.9",
"@certd/plugin-lib": "^1.37.9",
"@certd/plus-core": "^1.37.9",
"@certd/acme-client": "^1.37.10",
"@certd/basic": "^1.37.10",
"@certd/pipeline": "^1.37.10",
"@certd/plugin-lib": "^1.37.10",
"@certd/plus-core": "^1.37.10",
"@midwayjs/cache": "3.14.0",
"@midwayjs/core": "3.20.11",
"@midwayjs/i18n": "3.20.13",
@@ -64,5 +64,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/midway-flyway-js
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.37.9",
"version": "1.37.10",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
### Performance Improvements
* 优化dokploy 部署插件,配置选择serverId ([c9709f2](https://github.com/certd/certd/commit/c9709f26981c1cc9f71c14babb204329fcae0db5))
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/plugin-cert
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.37.9",
"version": "1.37.10",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -17,10 +17,10 @@
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"@certd/acme-client": "^1.37.9",
"@certd/basic": "^1.37.9",
"@certd/pipeline": "^1.37.9",
"@certd/plugin-lib": "^1.37.9",
"@certd/acme-client": "^1.37.10",
"@certd/basic": "^1.37.10",
"@certd/pipeline": "^1.37.10",
"@certd/plugin-lib": "^1.37.10",
"@google-cloud/publicca": "^1.3.0",
"dayjs": "^1.11.7",
"jszip": "^3.10.1",
@@ -43,5 +43,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
@@ -36,6 +36,7 @@ export class CertReader {
detail: CertificateInfo;
//毫秒时间戳
effective: number;
//毫秒时间戳
expires: number;
constructor(certInfo: CertInfo) {
this.cert = certInfo;
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
**Note:** Version bump only for package @certd/plugin-lib
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
**Note:** Version bump only for package @certd/plugin-lib
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.37.9",
"version": "1.37.10",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -22,8 +22,8 @@
"@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.10",
"@aws-sdk/client-s3": "^3.787.0",
"@certd/basic": "^1.37.9",
"@certd/pipeline": "^1.37.9",
"@certd/basic": "^1.37.10",
"@certd/pipeline": "^1.37.10",
"@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5",
@@ -53,5 +53,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "ac70821fea8fb283709870a3eb08f1cd92c94aeb"
"gitHead": "eb41a3655fe91af94f1c42a51aaa9122edfcf40e"
}
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
### Performance Improvements
* 站点证书监控备注输入框改成textarea ([70b603d](https://github.com/certd/certd/commit/70b603d601c34f39148c2ab70c655c51babf563d))
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
### Bug Fixes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.37.9",
"version": "1.37.10",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -106,8 +106,8 @@
"zod-defaults": "^0.1.3"
},
"devDependencies": {
"@certd/lib-iframe": "^1.37.9",
"@certd/pipeline": "^1.37.9",
"@certd/lib-iframe": "^1.37.10",
"@certd/pipeline": "^1.37.10",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",
@@ -555,7 +555,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
search: {
show: false,
},
type: "text",
type: "textarea",
column: {
width: 200,
sorter: true,
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.10](https://github.com/certd/certd/compare/v1.37.9...v1.37.10) (2025-11-19)
### Performance Improvements
* 优化dokploy 部署插件,配置选择serverId ([c9709f2](https://github.com/certd/certd/commit/c9709f26981c1cc9f71c14babb204329fcae0db5))
## [1.37.9](https://github.com/certd/certd/compare/v1.37.8...v1.37.9) (2025-11-19)
### Performance Improvements
+14 -14
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/ui-server",
"version": "1.37.9",
"version": "1.37.10",
"description": "fast-server base midway",
"private": true,
"type": "module",
@@ -45,20 +45,20 @@
"@aws-sdk/client-cloudfront": "^3.699.0",
"@aws-sdk/client-iam": "^3.699.0",
"@aws-sdk/client-s3": "^3.705.0",
"@certd/acme-client": "^1.37.9",
"@certd/basic": "^1.37.9",
"@certd/commercial-core": "^1.37.9",
"@certd/acme-client": "^1.37.10",
"@certd/basic": "^1.37.10",
"@certd/commercial-core": "^1.37.10",
"@certd/cv4pve-api-javascript": "^8.4.2",
"@certd/jdcloud": "^1.37.9",
"@certd/lib-huawei": "^1.37.9",
"@certd/lib-k8s": "^1.37.9",
"@certd/lib-server": "^1.37.9",
"@certd/midway-flyway-js": "^1.37.9",
"@certd/pipeline": "^1.37.9",
"@certd/plugin-cert": "^1.37.9",
"@certd/plugin-lib": "^1.37.9",
"@certd/plugin-plus": "^1.37.9",
"@certd/plus-core": "^1.37.9",
"@certd/jdcloud": "^1.37.10",
"@certd/lib-huawei": "^1.37.10",
"@certd/lib-k8s": "^1.37.10",
"@certd/lib-server": "^1.37.10",
"@certd/midway-flyway-js": "^1.37.10",
"@certd/pipeline": "^1.37.10",
"@certd/plugin-cert": "^1.37.10",
"@certd/plugin-lib": "^1.37.10",
"@certd/plugin-plus": "^1.37.10",
"@certd/plus-core": "^1.37.10",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
"@koa/cors": "^5.0.0",
@@ -50,6 +50,14 @@ export class DokployAccess extends BaseAccess {
return "ok"
}
async getServerList(){
const req = {
url :"/api/server.all",
method: "get",
}
return await this.doRequest(req);
}
async getCertList(){
const req = {
url :"/api/certificates.all",
@@ -96,7 +104,7 @@ export class DokployAccess extends BaseAccess {
headers,
baseURL: this.endpoint,
...req,
logRes: true,
logRes: false,
});
}
@@ -1,13 +1,13 @@
import { AbstractTaskPlugin, IsTaskPlugin, PageSearch, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline";
import {CertApplyPluginNames, CertInfo} from "@certd/plugin-cert";
import {CertApplyPluginNames, CertInfo, CertReader} from "@certd/plugin-cert";
import {createCertDomainGetterInputDefine, createRemoteSelectInputDefine} from "@certd/plugin-lib";
import {DokployAccess} from "../access.js";
@IsTaskPlugin({
//命名规范,插件类型+功能(就是目录plugin-demo中的demo),大写字母开头,驼峰命名
name: "DokployRefreshCert",
title: "Dokploy-更新证书",
desc: "自动更新Dokploy证书",
title: "Dokploy-部署server证书",
desc: "自动更新Dokploy server证书",
icon: "svg:icon-lucky",
//插件分组
group: pluginGroups.panel.key,
@@ -52,12 +52,12 @@ export class DokployRefreshCert extends AbstractTaskPlugin {
createRemoteSelectInputDefine({
title: "证书名称",
helper: "要更新的证书名称,如果这里没有,请先给手动绑定一次证书",
action: DokployRefreshCert.prototype.onGetCertList.name,
action: DokployRefreshCert.prototype.onGetServerList.name,
pager: false,
search: false
})
)
certList!: string[];
serverList!: string[];
//插件实例化时执行的方法
async onInstance() {
@@ -67,46 +67,61 @@ export class DokployRefreshCert extends AbstractTaskPlugin {
async execute(): Promise<void> {
const access = await this.getAccess<DokployAccess>(this.accessId);
if (!this.serverList || this.serverList.length === 0) {
throw new Error("请先选择要部署证书的server");
}
// await access.createCert({cert:this.cert})
const certList = await access.getCertList();
const oldCertList = await access.getCertList();
for (const certId of this.certList) {
this.logger.info(`----------- 开始更新证书:${certId}`);
const [serverId,name] = certId.split("#");
const founds = certList.filter((item: any) => item.name === name);
if (founds){
for (const found of founds) {
await access.removeCert({id:found.certificateId})
}
const certReader = new CertReader(this.cert);
for (const serverId of this.serverList) {
this.logger.info(`----------- 开始部署server证书:${serverId}`);
if(!serverId){
this.logger.error(`----------- serverId不能为空,跳过更新`);
continue;
}
await access.createCert({
name,
name: certReader.buildCertName(),
cert: this.cert,
serverId: serverId,
});
this.logger.info(`----------- 更新证书${certId}成功`);
this.logger.info(`----------- 部署server${serverId}证书成功`);
}
this.logger.info(`----------- 等待10秒后开始清理过期证书`);
await this.ctx.utils.sleep(10000);
//清理过期证书
for (const certItem of oldCertList) {
const certDetail = CertReader.readCertDetail(certItem.certificateData);
if (certDetail.expires.getTime() < new Date().getTime()){
this.logger.info(`----------- 证书${certItem.certificateId}已过期`);
await access.removeCert({id:certItem.certificateId});
this.logger.info(`----------- 清理过期证书${certItem.certificateId}成功`);
}else{
this.logger.info(`----------- 证书${certItem.certificateId}还未过期`);
}
}
this.logger.info("部署完成");
}
async onGetCertList(data: PageSearch = {}) {
async onGetServerList(data: PageSearch = {}) {
const access = await this.getAccess<DokployAccess>(this.accessId);
const res = await access.getCertList()
const res = await access.getServerList()
const list = res
if (!list || list.length === 0) {
throw new Error("没有找到证书,你可以直接手动输入id,如果id不存在将自动创建");
throw new Error("没有找到Server,你可以直接手动输入serverId");
}
const options = list.map((item: any) => {
return {
label: `${item.name}<${item.serverId}>`,
value: `${item.serverId}#${item.name}`,
domain: item.name
value: `${item.serverId}`,
};
});
return options;
+58 -128
View File
@@ -46,7 +46,7 @@ importers:
packages/core/acme-client:
dependencies:
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../basic
'@peculiar/x509':
specifier: ^1.11.0
@@ -124,6 +124,9 @@ importers:
packages/core/basic:
dependencies:
async-lock:
specifier: ^1.4.1
version: 1.4.1
axios:
specifier: ^1.7.2
version: 1.9.0(debug@4.4.1)
@@ -207,11 +210,11 @@ importers:
packages/core/pipeline:
dependencies:
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../basic
'@certd/plus-core':
specifier: ^1.37.4
version: 1.37.4
specifier: ^1.37.10
version: link:../../pro/plus-core
dayjs:
specifier: ^1.11.7
version: 1.11.13
@@ -415,7 +418,7 @@ importers:
packages/libs/lib-k8s:
dependencies:
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/basic
'@kubernetes/client-node':
specifier: 0.21.0
@@ -455,20 +458,20 @@ importers:
packages/libs/lib-server:
dependencies:
'@certd/acme-client':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/pipeline
'@certd/plugin-lib':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../plugins/plugin-lib
'@certd/plus-core':
specifier: ^1.37.4
version: 1.37.4
specifier: ^1.37.10
version: link:../../pro/plus-core
'@midwayjs/cache':
specifier: 3.14.0
version: 3.14.0
@@ -613,16 +616,16 @@ importers:
packages/plugins/plugin-cert:
dependencies:
'@certd/acme-client':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/pipeline
'@certd/plugin-lib':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../plugin-lib
'@google-cloud/publicca':
specifier: ^1.3.0
@@ -701,10 +704,10 @@ importers:
specifier: ^3.787.0
version: 3.810.0(aws-crt@1.26.2)
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/basic
'@certd/pipeline':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/pipeline
'@kubernetes/client-node':
specifier: 0.21.0
@@ -789,19 +792,19 @@ importers:
packages/pro/commercial-core:
dependencies:
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/basic
'@certd/lib-server':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../libs/lib-server
'@certd/pipeline':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/pipeline
'@certd/plugin-plus':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../plugin-plus
'@certd/plus-core':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../plus-core
'@midwayjs/core':
specifier: 3.20.11
@@ -886,22 +889,22 @@ importers:
specifier: ^1.0.2
version: 1.0.3
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/basic
'@certd/lib-k8s':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../libs/lib-k8s
'@certd/pipeline':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/pipeline
'@certd/plugin-cert':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../plugins/plugin-cert
'@certd/plugin-lib':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../plugins/plugin-lib
'@certd/plus-core':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../plus-core
ali-oss:
specifier: ^6.21.0
@@ -1004,7 +1007,7 @@ importers:
packages/pro/plus-core:
dependencies:
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/basic
dayjs:
specifier: ^1.11.7
@@ -1300,10 +1303,10 @@ importers:
version: 0.1.3(zod@3.24.4)
devDependencies:
'@certd/lib-iframe':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../libs/lib-iframe
'@certd/pipeline':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/pipeline
'@rollup/plugin-commonjs':
specifier: ^25.0.7
@@ -1486,47 +1489,47 @@ importers:
specifier: ^3.705.0
version: 3.810.0(aws-crt@1.26.2)
'@certd/acme-client':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/acme-client
'@certd/basic':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/basic
'@certd/commercial-core':
specifier: ^1.37.4
version: 1.37.4(better-sqlite3@11.10.0)(encoding@0.1.13)(mysql2@3.14.1)(pg@8.16.0)(reflect-metadata@0.2.2)(ts-node@10.9.2(@types/node@18.19.100)(typescript@5.8.3))
specifier: ^1.37.10
version: link:../../pro/commercial-core
'@certd/cv4pve-api-javascript':
specifier: ^8.4.2
version: 8.4.2
'@certd/jdcloud':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../libs/lib-jdcloud
'@certd/lib-huawei':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../libs/lib-huawei
'@certd/lib-k8s':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../libs/lib-k8s
'@certd/lib-server':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../libs/lib-server
'@certd/midway-flyway-js':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../libs/midway-flyway-js
'@certd/pipeline':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../core/pipeline
'@certd/plugin-cert':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../plugins/plugin-cert
'@certd/plugin-lib':
specifier: ^1.37.4
specifier: ^1.37.10
version: link:../../plugins/plugin-lib
'@certd/plugin-plus':
specifier: ^1.37.4
version: 1.37.4(encoding@0.1.13)
specifier: ^1.37.10
version: link:../../pro/plugin-plus
'@certd/plus-core':
specifier: ^1.37.4
version: 1.37.4
specifier: ^1.37.10
version: link:../../pro/plus-core
'@huaweicloud/huaweicloud-sdk-cdn':
specifier: ^3.1.120
version: 3.1.149
@@ -1569,6 +1572,9 @@ importers:
'@midwayjs/validate':
specifier: 3.20.13
version: 3.20.13
'@peculiar/x509':
specifier: ^1.11.0
version: 1.12.3
'@volcengine/openapi':
specifier: ^1.28.1
version: 1.30.1(buffer@6.0.3)
@@ -2769,18 +2775,9 @@ packages:
'@better-scroll/zoom@2.5.1':
resolution: {integrity: sha512-aGvFY5ooeZWS4RcxQLD+pGLpQHQxpPy0sMZV3yadcd2QK53PK9gS4Dp+BYfRv8lZ4/P2LoNEhr6Wq1DN6+uPlA==}
'@certd/commercial-core@1.37.4':
resolution: {integrity: sha512-Axx1yBekqPy6D9LjjrijVbmO8Ck6E9Fv0+Jcy8cuua269sSpME8k3nj0U8Y4ec0JwfE6GbQYF9gaUE0kSSNexg==}
'@certd/cv4pve-api-javascript@8.4.2':
resolution: {integrity: sha512-udGce7ewrVl4DmZvX+17PjsnqsdDIHEDatr8QP0AVrY2p+8JkaSPW4mXCKiLGf82C9K2+GXgT+qNIqgW7tfF9Q==}
'@certd/plugin-plus@1.37.4':
resolution: {integrity: sha512-h3oSqMBSBYAz8dPcZ4fexrUk32Y2pJcixZMycOZi5onaM9Q5skkWqW3X625B7kdyYaIsojWQzETerXmwJzTBxQ==}
'@certd/plus-core@1.37.4':
resolution: {integrity: sha512-7RFOBjZW98hgsTqoq2T8E6ANhWkuNP7Yi3Y1rZ7m5aXAOgn2H1Aci/Jz9bmD6MZgawfU7j2MLoBXFLEPLpwruQ==}
'@certd/vue-js-cron-core@6.0.3':
resolution: {integrity: sha512-kqzoAMhYz9j6FGNWEODRYtt4NpUEUwjpkU89z5WVg2tCtOcI5VhwyUGOd8AxiBCRfd6PtXvzuqw85PaOps9wrQ==}
@@ -5744,6 +5741,9 @@ packages:
resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==}
engines: {node: '>= 0.4'}
async-lock@1.4.1:
resolution: {integrity: sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ==}
async-validator@4.2.5:
resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==}
@@ -15385,84 +15385,12 @@ snapshots:
dependencies:
'@better-scroll/core': 2.5.1
'@certd/commercial-core@1.37.4(better-sqlite3@11.10.0)(encoding@0.1.13)(mysql2@3.14.1)(pg@8.16.0)(reflect-metadata@0.2.2)(ts-node@10.9.2(@types/node@18.19.100)(typescript@5.8.3))':
dependencies:
'@certd/basic': link:packages/core/basic
'@certd/lib-server': link:packages/libs/lib-server
'@certd/pipeline': link:packages/core/pipeline
'@certd/plugin-plus': 1.37.4(encoding@0.1.13)
'@certd/plus-core': 1.37.4
'@midwayjs/core': 3.20.11
'@midwayjs/koa': 3.20.13
'@midwayjs/logger': 3.4.2
'@midwayjs/typeorm': 3.20.11
alipay-sdk: 4.14.0
dayjs: 1.11.13
typeorm: 0.3.24(better-sqlite3@11.10.0)(mysql2@3.14.1)(pg@8.16.0)(reflect-metadata@0.2.2)(ts-node@10.9.2(@types/node@18.19.100)(typescript@5.8.3))
wechatpay-node-v3: 2.2.1
transitivePeerDependencies:
- '@google-cloud/spanner'
- '@sap/hana-client'
- babel-plugin-macros
- better-sqlite3
- encoding
- hdb-pool
- ioredis
- mongodb
- mssql
- mysql2
- oracledb
- pg
- pg-native
- pg-query-stream
- proxy-agent
- redis
- reflect-metadata
- sql.js
- sqlite3
- supports-color
- ts-node
- typeorm-aurora-data-api-driver
'@certd/cv4pve-api-javascript@8.4.2':
dependencies:
debug: 4.4.1(supports-color@8.1.1)
transitivePeerDependencies:
- supports-color
'@certd/plugin-plus@1.37.4(encoding@0.1.13)':
dependencies:
'@alicloud/pop-core': 1.8.0
'@baiducloud/sdk': 1.0.3
'@certd/basic': link:packages/core/basic
'@certd/lib-k8s': link:packages/libs/lib-k8s
'@certd/pipeline': link:packages/core/pipeline
'@certd/plugin-cert': link:packages/plugins/plugin-cert
'@certd/plugin-lib': link:packages/plugins/plugin-lib
'@certd/plus-core': 1.37.4
ali-oss: 6.23.0
baidu-aip-sdk: 4.16.16
basic-ftp: 5.0.5
cos-nodejs-sdk-v5: 2.14.7
crypto-js: 4.2.0
dayjs: 1.11.13
form-data: 4.0.2
https-proxy-agent: 7.0.6
js-yaml: 4.1.0
jsencrypt: 3.3.2
jsrsasign: 11.1.0
qiniu: 7.14.0
tencentcloud-sdk-nodejs: 4.1.112(encoding@0.1.13)
transitivePeerDependencies:
- encoding
- proxy-agent
- supports-color
'@certd/plus-core@1.37.4':
dependencies:
'@certd/basic': link:packages/core/basic
dayjs: 1.11.13
'@certd/vue-js-cron-core@6.0.3':
dependencies:
mustache: 4.2.0
@@ -19206,6 +19134,8 @@ snapshots:
async-function@1.0.0: {}
async-lock@1.4.1: {}
async-validator@4.2.5: {}
async@3.2.3: {}
+1 -1
View File
@@ -1 +1 @@
01:18
23:54
+1 -1
View File
@@ -1 +1 @@
01:28
23:57