mirror of https://github.com/certd/certd
Merge branch 'v2-dev' into v2
commit
f9553e7d44
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -3,6 +3,18 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 根据SOA记录判断子域名托管有缺陷,改回手动配置子域名托管记录的方式 ([1b280a2](https://github.com/certd/certd/commit/1b280a2940f9e2d919b0bf23b89cc185be1fa498))
|
||||
* 修复宝塔授权测试按钮显示错误的bug ([048696e](https://github.com/certd/certd/commit/048696ee9386491bb68592fb3a47d1c900bb68bf))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署证书到火山dcdn ([5f85219](https://github.com/certd/certd/commit/5f852194953dc1b4e6336770f417507b8f5a33ad))
|
||||
* 支持部署证书到unicloud ([a63d687](https://github.com/certd/certd/commit/a63d687f1c573159f0857693f37602b0e1e44072))
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
|
|
@ -1 +1 @@
|
|||
17:28
|
||||
00:32
|
||||
|
|
|
@ -3,6 +3,18 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 根据SOA记录判断子域名托管有缺陷,改回手动配置子域名托管记录的方式 ([1b280a2](https://github.com/certd/certd/commit/1b280a2940f9e2d919b0bf23b89cc185be1fa498))
|
||||
* 修复宝塔授权测试按钮显示错误的bug ([048696e](https://github.com/certd/certd/commit/048696ee9386491bb68592fb3a47d1c900bb68bf))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署证书到火山dcdn ([5f85219](https://github.com/certd/certd/commit/5f852194953dc1b4e6336770f417507b8f5a33ad))
|
||||
* 支持部署证书到unicloud ([a63d687](https://github.com/certd/certd/commit/a63d687f1c573159f0857693f37602b0e1e44072))
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
|
|
@ -9,5 +9,5 @@
|
|||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.34.0"
|
||||
"version": "1.34.1"
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
"init": "lerna run build",
|
||||
"docs:dev": "vitepress dev docs",
|
||||
"docs:build": "vitepress build docs",
|
||||
"docs:preview": "vitepress preview docs"
|
||||
"docs:preview": "vitepress preview docs",
|
||||
"pub": "echo 1"
|
||||
},
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/publishlab/node-acme-client/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 根据SOA记录判断子域名托管有缺陷,改回手动配置子域名托管记录的方式 ([1b280a2](https://github.com/publishlab/node-acme-client/commit/1b280a2940f9e2d919b0bf23b89cc185be1fa498))
|
||||
|
||||
# [1.34.0](https://github.com/publishlab/node-acme-client/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
|
@ -18,7 +18,7 @@
|
|||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.0",
|
||||
"@certd/basic": "^1.34.1",
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"asn1js": "^3.0.5",
|
||||
"axios": "^1.7.2",
|
||||
|
@ -51,7 +51,8 @@
|
|||
"lint": "eslint .",
|
||||
"lint-types": "tsd",
|
||||
"prepublishOnly": "npm run build-docs",
|
||||
"test": "mocha -t 60000 \"test/setup.js\" \"test/**/*.spec.js\""
|
||||
"test": "mocha -t 60000 \"test/setup.js\" \"test/**/*.spec.js\"",
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -68,5 +69,5 @@
|
|||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import {assert} from 'chai'
|
||||
import {resolveDomainBySoaRecord} from "../src/util.js"
|
||||
describe('dns', () => {
|
||||
it('resolveDomainBySoaRecord', async () => {
|
||||
const resp = await resolveDomainBySoaRecord("a.corp.smartdeer.com")
|
||||
|
||||
assert.equal(resp, "smartdeer.com")
|
||||
|
||||
});
|
||||
|
||||
})
|
|
@ -3,6 +3,12 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署证书到火山dcdn ([5f85219](https://github.com/certd/certd/commit/5f852194953dc1b4e6336770f417507b8f5a33ad))
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
|
|
@ -1 +1 @@
|
|||
17:24
|
||||
00:16
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
|
@ -12,7 +12,8 @@
|
|||
"build": "npm run before-build && tsc --skipLibCheck",
|
||||
"dev-build": "npm run build",
|
||||
"preview": "vite preview",
|
||||
"test": "mocha --loader=ts-node/esm"
|
||||
"test": "mocha --loader=ts-node/esm",
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.7.2",
|
||||
|
@ -44,5 +45,5 @@
|
|||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { domainUtils } from './util.domain.js';
|
||||
import { domainUtils } from "./util.domain.js";
|
||||
|
||||
function groupByDomain(options: any[], inDomains: string[]) {
|
||||
const matched = [];
|
||||
|
@ -19,16 +19,16 @@ function groupByDomain(options: any[], inDomains: string[]) {
|
|||
function buildGroupOptions(options: any[], inDomains: string[]) {
|
||||
const grouped = groupByDomain(options, inDomains);
|
||||
const groupOptions = [];
|
||||
groupOptions.push({ value: 'matched', disabled: true, label: '----已匹配----' });
|
||||
groupOptions.push({ value: "matched", disabled: true, label: "----已匹配----" });
|
||||
if (grouped.matched.length === 0) {
|
||||
options.push({ value: '', disabled: true, label: '没有可以匹配的域名' });
|
||||
options.push({ value: "", disabled: true, label: "没有可以匹配的域名" });
|
||||
} else {
|
||||
for (const matched of grouped.matched) {
|
||||
groupOptions.push(matched);
|
||||
}
|
||||
}
|
||||
if (grouped.notMatched.length > 0) {
|
||||
groupOptions.push({ value: 'unmatched', disabled: true, label: '----未匹配----' });
|
||||
groupOptions.push({ value: "unmatched", disabled: true, label: "----未匹配----" });
|
||||
for (const notMatched of grouped.notMatched) {
|
||||
groupOptions.push(notMatched);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
|
@ -13,11 +13,12 @@
|
|||
"dev-build": "npm run build",
|
||||
"build3": "rollup -c",
|
||||
"preview": "vite preview",
|
||||
"test": "mocha --loader=ts-node/esm"
|
||||
"test": "mocha --loader=ts-node/esm",
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.0",
|
||||
"@certd/plus-core": "^1.34.0",
|
||||
"@certd/basic": "^1.34.1",
|
||||
"@certd/plus-core": "^1.34.1",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
|
@ -43,5 +44,5 @@
|
|||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
import { Decorator } from "./index.js";
|
||||
|
||||
export type AutowireProp = {
|
||||
name?: string;
|
||||
type?: any;
|
||||
};
|
||||
export const AUTOWIRE_KEY = "pipeline:autowire";
|
||||
|
||||
export function Autowire(props?: AutowireProp): PropertyDecorator {
|
||||
return (target, propertyKey) => {
|
||||
const _type = Reflect.getMetadata("design:type", target, propertyKey);
|
||||
target = Decorator.target(target, propertyKey);
|
||||
props = props || {};
|
||||
props.type = _type;
|
||||
Reflect.defineMetadata(AUTOWIRE_KEY, props || {}, target, propertyKey);
|
||||
};
|
||||
}
|
|
@ -1,2 +1 @@
|
|||
export * from "./utils.js";
|
||||
export * from "./common.js";
|
||||
|
|
|
@ -51,10 +51,6 @@ export type PluginDefine = Registrable & {
|
|||
[key: string]: TaskOutputDefine;
|
||||
};
|
||||
|
||||
autowire?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
shortcut?: {
|
||||
[key: string]: {
|
||||
title: string;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { pluginRegistry } from "./registry.js";
|
||||
import { PluginDefine, TaskInputDefine, TaskOutputDefine } from "./api.js";
|
||||
import { Decorator } from "../decorator/index.js";
|
||||
import { AUTOWIRE_KEY } from "../decorator/index.js";
|
||||
import "reflect-metadata";
|
||||
import { merge, sortBy } from "lodash-es";
|
||||
// 提供一个唯一 key
|
||||
|
@ -12,7 +11,6 @@ export function IsTaskPlugin(define: PluginDefine): ClassDecorator {
|
|||
target = Decorator.target(target);
|
||||
|
||||
const inputs: any = {};
|
||||
const autowires: any = {};
|
||||
const outputs: any = {};
|
||||
const properties = Decorator.getClassProperties(target);
|
||||
for (const property in properties) {
|
||||
|
@ -21,11 +19,6 @@ export function IsTaskPlugin(define: PluginDefine): ClassDecorator {
|
|||
inputs[property] = input;
|
||||
}
|
||||
|
||||
const autowire = Reflect.getMetadata(AUTOWIRE_KEY, target, property);
|
||||
if (autowire) {
|
||||
autowires[property] = autowire;
|
||||
}
|
||||
|
||||
const output = Reflect.getMetadata(PLUGIN_OUTPUT_KEY, target, property);
|
||||
if (output) {
|
||||
outputs[property] = output;
|
||||
|
@ -57,7 +50,7 @@ export function IsTaskPlugin(define: PluginDefine): ClassDecorator {
|
|||
},
|
||||
};
|
||||
|
||||
define = merge(defaultConfig, define, { input: inputMap, autowire: autowires, output: outputs });
|
||||
define = merge(defaultConfig, define, { input: inputMap, output: outputs });
|
||||
|
||||
Reflect.defineMetadata(PLUGIN_CLASS_KEY, define, target);
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ export class Registry<T = any> {
|
|||
}
|
||||
|
||||
getDefineList() {
|
||||
const list = [];
|
||||
let list = [];
|
||||
for (const key in this.storage) {
|
||||
const define = this.getDefine(key);
|
||||
if (define) {
|
||||
|
@ -78,6 +78,10 @@ export class Registry<T = any> {
|
|||
list.push({ ...define, key });
|
||||
}
|
||||
}
|
||||
|
||||
list = list.sort((a, b) => {
|
||||
return (a.order ?? 10) - (b?.order ?? 10);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
|
@ -10,7 +10,8 @@
|
|||
"before-build": "rimraf dist && rimraf tsconfig.tsbuildinfo && rimraf .rollup.cache",
|
||||
"build": "npm run before-build && rollup -c ",
|
||||
"dev-build": "npm run build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.7.2",
|
||||
|
@ -23,5 +24,5 @@
|
|||
"prettier": "^2.8.8",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
|
@ -13,7 +13,8 @@
|
|||
"dev-build": "npm run build",
|
||||
"build3": "rollup -c",
|
||||
"build2": "vue-tsc --noEmit && vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"nanoid": "^4.0.0"
|
||||
|
@ -30,5 +31,5 @@
|
|||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
|
@ -9,7 +9,8 @@
|
|||
"test": "cross-env NODE_CONFIG_DIR=./test/config mocha --recursive --require babel-register",
|
||||
"dev": "babel src --out-dir babel -w",
|
||||
"build": "rollup -c ",
|
||||
"dev-build": "npm run build"
|
||||
"dev-build": "npm run build",
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"author": "",
|
||||
"license": "Apache",
|
||||
|
@ -60,5 +61,5 @@
|
|||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
|
@ -13,10 +13,11 @@
|
|||
"dev-build": "npm run build",
|
||||
"build3": "rollup -c",
|
||||
"build2": "vue-tsc --noEmit && vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.0",
|
||||
"@certd/basic": "^1.34.1",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -31,5 +32,5 @@
|
|||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
|
@ -27,10 +27,10 @@
|
|||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.34.0",
|
||||
"@certd/basic": "^1.34.0",
|
||||
"@certd/pipeline": "^1.34.0",
|
||||
"@certd/plus-core": "^1.34.0",
|
||||
"@certd/acme-client": "^1.34.1",
|
||||
"@certd/basic": "^1.34.1",
|
||||
"@certd/pipeline": "^1.34.1",
|
||||
"@certd/plus-core": "^1.34.1",
|
||||
"@midwayjs/cache": "~3.14.0",
|
||||
"@midwayjs/core": "~3.20.3",
|
||||
"@midwayjs/i18n": "~3.20.3",
|
||||
|
@ -61,5 +61,5 @@
|
|||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
|
@ -46,5 +46,5 @@
|
|||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 根据SOA记录判断子域名托管有缺陷,改回手动配置子域名托管记录的方式 ([1b280a2](https://github.com/certd/certd/commit/1b280a2940f9e2d919b0bf23b89cc185be1fa498))
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
@ -12,13 +12,14 @@
|
|||
"dev-build": "npm run build",
|
||||
"build3": "rollup -c",
|
||||
"build2": "vue-tsc --noEmit && vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.34.0",
|
||||
"@certd/basic": "^1.34.0",
|
||||
"@certd/pipeline": "^1.34.0",
|
||||
"@certd/plugin-lib": "^1.34.0",
|
||||
"@certd/acme-client": "^1.34.1",
|
||||
"@certd/basic": "^1.34.1",
|
||||
"@certd/pipeline": "^1.34.1",
|
||||
"@certd/plugin-lib": "^1.34.1",
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"dayjs": "^1.11.7",
|
||||
"jszip": "^3.10.1",
|
||||
|
@ -42,5 +43,5 @@
|
|||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -4,9 +4,6 @@ import { IAccess, Registrable } from "@certd/pipeline";
|
|||
export type DnsProviderDefine = Registrable & {
|
||||
accessType: string;
|
||||
icon?: string;
|
||||
autowire?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
|
||||
export type CreateRecordOptions = {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { CreateRecordOptions, DnsProviderContext, DnsProviderDefine, IDnsProvider, RemoveRecordOptions } from "./api.js";
|
||||
import { dnsProviderRegistry } from "./registry.js";
|
||||
import { Decorator } from "@certd/pipeline";
|
||||
import { HttpClient, ILogger } from "@certd/basic";
|
||||
|
||||
export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
|
||||
|
@ -39,8 +38,6 @@ export async function createDnsProvider(opts: { dnsProviderType: string; context
|
|||
}
|
||||
// @ts-ignore
|
||||
const dnsProvider: IDnsProvider = new DnsProviderClass();
|
||||
|
||||
Decorator.inject(dnsProviderDefine.autowire, dnsProvider, context);
|
||||
dnsProvider.setCtx(context);
|
||||
await dnsProvider.onInstance();
|
||||
return dnsProvider;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { dnsProviderRegistry } from "./registry.js";
|
||||
import { DnsProviderDefine } from "./api.js";
|
||||
import { Decorator, AUTOWIRE_KEY } from "@certd/pipeline";
|
||||
import { Decorator } from "@certd/pipeline";
|
||||
import * as _ from "lodash-es";
|
||||
|
||||
// 提供一个唯一 key
|
||||
|
@ -9,15 +9,6 @@ export const DNS_PROVIDER_CLASS_KEY = "pipeline:dns-provider";
|
|||
export function IsDnsProvider(define: DnsProviderDefine): ClassDecorator {
|
||||
return (target: any) => {
|
||||
target = Decorator.target(target);
|
||||
const autowires: any = {};
|
||||
const properties = Decorator.getClassProperties(target);
|
||||
for (const property in properties) {
|
||||
const autowire = Reflect.getMetadata(AUTOWIRE_KEY, target, property);
|
||||
if (autowire) {
|
||||
autowires[property] = autowire;
|
||||
}
|
||||
}
|
||||
_.merge(define, { autowire: autowires });
|
||||
|
||||
Reflect.defineMetadata(DNS_PROVIDER_CLASS_KEY, define, target);
|
||||
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
import { IDomainParser, ISubDomainsGetter } from "./api";
|
||||
//@ts-ignore
|
||||
import psl from "psl";
|
||||
import { ILogger, utils, logger as globalLogger } from "@certd/basic";
|
||||
import { resolveDomainBySoaRecord } from "@certd/acme-client";
|
||||
import { logger, utils } from "@certd/basic";
|
||||
|
||||
export class DomainParser implements IDomainParser {
|
||||
subDomainsGetter: ISubDomainsGetter;
|
||||
constructor(subDomainsGetter: ISubDomainsGetter) {
|
||||
logger: ILogger;
|
||||
constructor(subDomainsGetter: ISubDomainsGetter, logger?: ILogger) {
|
||||
this.subDomainsGetter = subDomainsGetter;
|
||||
this.logger = logger || globalLogger;
|
||||
}
|
||||
|
||||
parseDomain(fullDomain: string) {
|
||||
parseDomainByPsl(fullDomain: string) {
|
||||
const parsed = psl.parse(fullDomain) as psl.ParsedDomain;
|
||||
if (parsed.error) {
|
||||
throw new Error(`解析${fullDomain}域名失败:` + JSON.stringify(parsed.error));
|
||||
|
@ -19,38 +21,46 @@ export class DomainParser implements IDomainParser {
|
|||
}
|
||||
|
||||
async parse(fullDomain: string) {
|
||||
logger.info(`查找主域名:${fullDomain}`);
|
||||
this.logger.info(`查找主域名:${fullDomain}`);
|
||||
const cacheKey = `domain_parse:${fullDomain}`;
|
||||
const value = utils.cache.get(cacheKey);
|
||||
if (value) {
|
||||
logger.info(`从缓存获取到主域名:${fullDomain}->${value}`);
|
||||
this.logger.info(`从缓存获取到主域名:${fullDomain}->${value}`);
|
||||
return value;
|
||||
}
|
||||
|
||||
const subDomains = await this.subDomainsGetter.getSubDomains();
|
||||
if (subDomains && subDomains.length > 0) {
|
||||
const fullDomainDot = "." + fullDomain;
|
||||
for (const subDomain of subDomains) {
|
||||
if (fullDomainDot.endsWith("." + subDomain)) {
|
||||
//找到子域名托管
|
||||
utils.cache.set(cacheKey, subDomain, {
|
||||
ttl: 60 * 1000,
|
||||
});
|
||||
this.logger.info(`获取到子域名托管域名:${fullDomain}->${subDomain}`);
|
||||
return subDomain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const res = this.parseDomainByPsl(fullDomain);
|
||||
this.logger.info(`从psl获取主域名:${fullDomain}->${res}`);
|
||||
|
||||
let soaManDomain = null;
|
||||
try {
|
||||
const mainDomain = await resolveDomainBySoaRecord(fullDomain);
|
||||
if (mainDomain) {
|
||||
utils.cache.set(cacheKey, mainDomain, {
|
||||
ttl: 2 * 60 * 1000,
|
||||
});
|
||||
logger.info(`获取到主域名:${fullDomain}->${mainDomain}`);
|
||||
return mainDomain;
|
||||
this.logger.info(`从SOA获取到主域名:${fullDomain}->${mainDomain}`);
|
||||
soaManDomain = mainDomain;
|
||||
}
|
||||
} catch (e) {
|
||||
logger.error("从SOA获取主域名失败", e.message);
|
||||
this.logger.error("从SOA获取主域名失败", e.message);
|
||||
}
|
||||
if (soaManDomain && soaManDomain !== res) {
|
||||
this.logger.warn(`SOA获取的主域名(${soaManDomain})和psl获取的主域名(${res})不一致,请确认是否有设置子域名托管`);
|
||||
}
|
||||
|
||||
// const subDomains = await this.subDomainsGetter.getSubDomains();
|
||||
// if (subDomains && subDomains.length > 0) {
|
||||
// for (const subDomain of subDomains) {
|
||||
// if (fullDomain.endsWith(subDomain)) {
|
||||
// //找到子域名托管
|
||||
// return subDomain;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
const res = this.parseDomain(fullDomain);
|
||||
logger.info(`从psl获取主域名:${fullDomain}->${res}`);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -248,7 +248,10 @@ export class AcmeService {
|
|||
fullRecord = cname.fullRecord;
|
||||
}
|
||||
} else {
|
||||
this.logger.error("未找到域名Cname校验计划,使用默认的dnsProvider");
|
||||
this.logger.error(`未找到域名${fullDomain}的CNAME校验计划,请修改证书申请配置`);
|
||||
}
|
||||
if (dnsProvider == null) {
|
||||
throw new Error(`未找到域名${fullDomain}CNAME校验计划的DnsProvider,请修改证书申请配置`);
|
||||
}
|
||||
} else if (domainVerifyPlan.type === "http") {
|
||||
const httpVerifyPlan = domainVerifyPlan.httpVerifyPlan;
|
||||
|
|
|
@ -27,7 +27,8 @@ export abstract class CertApplyBaseConvertPlugin extends AbstractTaskPlugin {
|
|||
"1、支持多个域名打到一个证书上,例如: foo.com,*.foo.com,*.bar.com\n" +
|
||||
"2、子域名被通配符包含的不要填写,例如:www.foo.com已经被*.foo.com包含,不要填写www.foo.com\n" +
|
||||
"3、泛域名只能通配*号那一级(*.foo.com的证书不能用于xxx.yyy.foo.com、不能用于foo.com)\n" +
|
||||
"4、输入一个,空格之后,再输入下一个",
|
||||
"4、输入一个,空格之后,再输入下一个 \n" +
|
||||
"5、如果您配置了子域托管解析,请先[设置托管子域名](#/certd/pipeline/subDomain)",
|
||||
})
|
||||
domains!: string[];
|
||||
|
||||
|
|
|
@ -327,7 +327,7 @@ HTTP文件验证:不支持泛域名,需要配置网站文件上传`,
|
|||
}
|
||||
this.eab = eab;
|
||||
const subDomainsGetter = await this.ctx.serviceGetter.get<ISubDomainsGetter>("subDomainsGetter");
|
||||
const domainParser = new DomainParser(subDomainsGetter);
|
||||
const domainParser = new DomainParser(subDomainsGetter, this.logger);
|
||||
this.acme = new AcmeService({
|
||||
userId: this.ctx.user.id,
|
||||
userContext: this.userContext,
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署证书到火山dcdn ([5f85219](https://github.com/certd/certd/commit/5f852194953dc1b4e6336770f417507b8f5a33ad))
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
@ -12,13 +12,14 @@
|
|||
"dev-build": "npm run build",
|
||||
"build3": "rollup -c",
|
||||
"build2": "vue-tsc --noEmit && vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@aws-sdk/client-s3": "^3.787.0",
|
||||
"@certd/basic": "^1.34.0",
|
||||
"@certd/pipeline": "^1.34.0",
|
||||
"@certd/basic": "^1.34.1",
|
||||
"@certd/pipeline": "^1.34.1",
|
||||
"@kubernetes/client-node": "0.21.0",
|
||||
"ali-oss": "^6.22.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
|
@ -49,5 +50,5 @@
|
|||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "9749fc817d3cfd435e8cb3f2f86edc81d69e2310"
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ export function createRemoteSelectInputDefine(opts?: {
|
|||
multi?: boolean;
|
||||
required?: boolean;
|
||||
rules?: any;
|
||||
mergeScript?: string;
|
||||
}) {
|
||||
const title = opts?.title || "请选择";
|
||||
const certDomainsInputKey = opts?.certDomainsInputKey || "certDomains";
|
||||
|
@ -66,7 +67,9 @@ export function createRemoteSelectInputDefine(opts?: {
|
|||
},
|
||||
rules: opts?.rules,
|
||||
required: opts.required ?? true,
|
||||
mergeScript: `
|
||||
mergeScript:
|
||||
opts.mergeScript ??
|
||||
`
|
||||
return {
|
||||
component:{
|
||||
form: ctx.compute(({form})=>{
|
||||
|
@ -80,3 +83,5 @@ export function createRemoteSelectInputDefine(opts?: {
|
|||
|
||||
return merge(item, opts?.formItem);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { HttpClient, ILogger, utils } from "@certd/basic";
|
||||
import { HttpClient, ILogger, safePromise, utils } from "@certd/basic";
|
||||
import { QiniuAccess } from "../access.js";
|
||||
import fs from "fs";
|
||||
|
||||
|
@ -77,7 +77,7 @@ export class QiniuClient {
|
|||
const http = new HttpClient({ timeout: 10000, middlewares: [auth] });
|
||||
console.log("http", http);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
try {
|
||||
http.get({
|
||||
url: opts.url,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// @ts-ignore
|
||||
import path from "path";
|
||||
import { isArray } from "lodash-es";
|
||||
import { ILogger } from "@certd/basic";
|
||||
import { ILogger, safePromise } from "@certd/basic";
|
||||
import { SshAccess } from "./ssh-access.js";
|
||||
|
||||
import fs from "fs";
|
||||
|
@ -70,7 +70,7 @@ export class AsyncSsh2Client {
|
|||
const ssh2 = await import("ssh2");
|
||||
const ssh2Constants = await import("ssh2/lib/protocol/constants.js");
|
||||
const { SUPPORTED_KEX, SUPPORTED_SERVER_HOST_KEY, SUPPORTED_CIPHER, SUPPORTED_MAC } = ssh2Constants.default;
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
try {
|
||||
const conn = new ssh2.default.Client();
|
||||
conn
|
||||
|
@ -108,7 +108,7 @@ export class AsyncSsh2Client {
|
|||
});
|
||||
}
|
||||
async getSftp() {
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
this.logger.info("获取sftp");
|
||||
this.conn.sftp((err: any, sftp: any) => {
|
||||
if (err) {
|
||||
|
@ -122,7 +122,7 @@ export class AsyncSsh2Client {
|
|||
|
||||
async fastPut(options: { sftp: any; localPath: string; remotePath: string; opts?: { mode?: string } }) {
|
||||
const { sftp, localPath, remotePath, opts } = options;
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
this.logger.info(`开始上传:${localPath} => ${remotePath}`);
|
||||
sftp.fastPut(localPath, remotePath, { ...(opts ?? {}) }, (err: Error) => {
|
||||
if (err) {
|
||||
|
@ -138,7 +138,7 @@ export class AsyncSsh2Client {
|
|||
|
||||
async listDir(options: { sftp: any; remotePath: string }) {
|
||||
const { sftp, remotePath } = options;
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
this.logger.info(`listDir:${remotePath}`);
|
||||
sftp.readdir(remotePath, (err: Error, list: any) => {
|
||||
if (err) {
|
||||
|
@ -152,7 +152,7 @@ export class AsyncSsh2Client {
|
|||
|
||||
async unlink(options: { sftp: any; remotePath: string }) {
|
||||
const { sftp, remotePath } = options;
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
this.logger.info(`开始删除远程文件:${remotePath}`);
|
||||
sftp.unlink(remotePath, (err: Error) => {
|
||||
if (err) {
|
||||
|
@ -182,7 +182,7 @@ export class AsyncSsh2Client {
|
|||
// script += "\r\nexit\r\n";
|
||||
// //保证windows下正常退出
|
||||
// }
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
this.logger.info(`执行命令:[${this.connConf.host}][exec]: \n` + script);
|
||||
// pty 伪终端,window下的输出会带上conhost.exe之类的多余的字符串,影响返回结果判断
|
||||
// linux下 当使用keyboard-interactive 登录时,需要pty
|
||||
|
@ -232,7 +232,7 @@ export class AsyncSsh2Client {
|
|||
async shell(script: string | string[]): Promise<string> {
|
||||
const stripAnsiModule = await import("strip-ansi");
|
||||
const stripAnsi = stripAnsiModule.default;
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
return safePromise<any>((resolve, reject) => {
|
||||
this.logger.info(`执行shell脚本:[${this.connConf.host}][shell]: ` + script);
|
||||
this.conn.shell((err: Error, stream: any) => {
|
||||
if (err) {
|
||||
|
@ -299,7 +299,7 @@ export class AsyncSsh2Client {
|
|||
}
|
||||
|
||||
async download(param: { remotePath: string; savePath: string; sftp: any }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
const { remotePath, savePath, sftp } = param;
|
||||
sftp.fastGet(
|
||||
remotePath,
|
||||
|
@ -385,44 +385,40 @@ export class SshClient {
|
|||
|
||||
async scpUpload(options: { conn: any; localPath: string; remotePath: string; opts?: { mode?: string } }) {
|
||||
const { conn, localPath, remotePath } = options;
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
// 关键步骤:构造 SCP 命令
|
||||
try {
|
||||
this.logger.info(`开始上传:${localPath} => ${remotePath}`);
|
||||
conn.conn.exec(
|
||||
`scp -t ${remotePath}`, // -t 表示目标模式
|
||||
(err, stream) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
try {
|
||||
// 准备 SCP 协议头
|
||||
const fileStats = fs.statSync(localPath);
|
||||
const fileName = path.basename(localPath);
|
||||
|
||||
// SCP 协议格式:C[权限] [文件大小] [文件名]\n
|
||||
stream.write(`C0644 ${fileStats.size} ${fileName}\n`);
|
||||
|
||||
// 通过管道传输文件
|
||||
fs.createReadStream(localPath)
|
||||
.on("error", e => {
|
||||
this.logger.info("read stream error", e);
|
||||
reject(e);
|
||||
})
|
||||
.pipe(stream)
|
||||
.on("finish", async () => {
|
||||
this.logger.info(`上传完成:${localPath} => ${remotePath}`);
|
||||
resolve(true);
|
||||
})
|
||||
.on("error", reject);
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
this.logger.info(`开始上传:${localPath} => ${remotePath}`);
|
||||
conn.conn.exec(
|
||||
`scp -t ${remotePath}`, // -t 表示目标模式
|
||||
(err, stream) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
try {
|
||||
// 准备 SCP 协议头
|
||||
const fileStats = fs.statSync(localPath);
|
||||
const fileName = path.basename(localPath);
|
||||
|
||||
// SCP 协议格式:C[权限] [文件大小] [文件名]\n
|
||||
stream.write(`C0644 ${fileStats.size} ${fileName}\n`);
|
||||
|
||||
// 通过管道传输文件
|
||||
fs.createReadStream(localPath)
|
||||
.on("error", e => {
|
||||
this.logger.info("read stream error", e);
|
||||
reject(e);
|
||||
})
|
||||
.pipe(stream)
|
||||
.on("finish", async () => {
|
||||
this.logger.info(`上传完成:${localPath} => ${remotePath}`);
|
||||
resolve(true);
|
||||
})
|
||||
.on("error", reject);
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TencentAccess } from "../access.js";
|
||||
import { ILogger } from "@certd/basic";
|
||||
import { ILogger, safePromise } from "@certd/basic";
|
||||
import fs from "fs";
|
||||
|
||||
export class TencentCosClient {
|
||||
|
@ -26,7 +26,7 @@ export class TencentCosClient {
|
|||
|
||||
async uploadFile(key: string, file: Buffer | string) {
|
||||
const cos = await this.getCosClient();
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
let readableStream = file as any;
|
||||
if (typeof file === "string") {
|
||||
readableStream = fs.createReadStream(file);
|
||||
|
@ -54,7 +54,7 @@ export class TencentCosClient {
|
|||
|
||||
async removeFile(key: string) {
|
||||
const cos = await this.getCosClient();
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
cos.deleteObject(
|
||||
{
|
||||
Bucket: this.bucket,
|
||||
|
@ -75,7 +75,7 @@ export class TencentCosClient {
|
|||
async downloadFile(key: string, savePath: string) {
|
||||
const cos = await this.getCosClient();
|
||||
const writeStream = fs.createWriteStream(savePath);
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
cos.getObject(
|
||||
{
|
||||
Bucket: this.bucket,
|
||||
|
@ -96,7 +96,7 @@ export class TencentCosClient {
|
|||
|
||||
async listDir(dirKey: string) {
|
||||
const cos = await this.getCosClient();
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
cos.getBucket(
|
||||
{
|
||||
Bucket: this.bucket,
|
||||
|
|
|
@ -3,6 +3,17 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 根据SOA记录判断子域名托管有缺陷,改回手动配置子域名托管记录的方式 ([1b280a2](https://github.com/certd/certd/commit/1b280a2940f9e2d919b0bf23b89cc185be1fa498))
|
||||
* 修复宝塔授权测试按钮显示错误的bug ([048696e](https://github.com/certd/certd/commit/048696ee9386491bb68592fb3a47d1c900bb68bf))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署证书到火山dcdn ([5f85219](https://github.com/certd/certd/commit/5f852194953dc1b4e6336770f417507b8f5a33ad))
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
|
@ -19,7 +19,8 @@
|
|||
"upgrade": "yarn upgrade-interactive --latest",
|
||||
"tsc": "vue-tsc --noEmit --skipLibCheck",
|
||||
"circle:check": "pnpm dependency-cruise --validate --output-type err-html -f dependency-report.html src",
|
||||
"afterPubPush": "git add . && git commit -m \"build: publish success\" && git push"
|
||||
"afterPubPush": "git add . && git commit -m \"build: publish success\" && git push",
|
||||
"pub": "echo 1"
|
||||
},
|
||||
"author": "greper",
|
||||
"license": "AGPL-3.0",
|
||||
|
@ -101,8 +102,8 @@
|
|||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.34.0",
|
||||
"@certd/pipeline": "^1.34.0",
|
||||
"@certd/lib-iframe": "^1.34.1",
|
||||
"@certd/pipeline": "^1.34.1",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
|
|
@ -69,12 +69,10 @@ function createService() {
|
|||
const err = new CodeError(errorMessage, dataAxios.code, dataAxios.data);
|
||||
// @ts-ignore
|
||||
response.config.onError(err);
|
||||
return;
|
||||
}
|
||||
//@ts-ignore
|
||||
const showErrorNotify = response?.config?.showErrorNotify;
|
||||
errorCreate(`${errorMessage}: ${response.config.url}`, showErrorNotify, dataAxios);
|
||||
return dataAxios;
|
||||
}
|
||||
},
|
||||
error => {
|
||||
|
|
|
@ -67,7 +67,6 @@ export function errorLog(error: any, notify = true) {
|
|||
|
||||
/**
|
||||
* @description 创建一个错误
|
||||
* @param {String} msg 错误信息
|
||||
*/
|
||||
export function errorCreate(msg: string, notify = true, data?: any) {
|
||||
const err = new CodeError(msg, data.code, data.data);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<fs-copyable v-model="cnameRecord.hostRecord"></fs-copyable>
|
||||
</td>
|
||||
<td style="text-align: center">CNAME</td>
|
||||
<td class="record-value">
|
||||
<td class="record-value" :title="cnameRecord.recordValue">
|
||||
<fs-copyable v-model="cnameRecord.recordValue"></fs-copyable>
|
||||
</td>
|
||||
<td class="status center flex-center">
|
||||
|
@ -38,12 +38,12 @@ const statusDict = dict({
|
|||
{ label: "验证中", value: "validating", color: "blue" },
|
||||
{ label: "验证成功", value: "valid", color: "green" },
|
||||
{ label: "验证失败", value: "failed", color: "red" },
|
||||
{ label: "验证超时", value: "timeout", color: "red" }
|
||||
]
|
||||
{ label: "验证超时", value: "timeout", color: "red" },
|
||||
],
|
||||
});
|
||||
|
||||
defineOptions({
|
||||
name: "CnameRecordInfo"
|
||||
name: "CnameRecordInfo",
|
||||
});
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -55,7 +55,7 @@ const emit = defineEmits<{
|
|||
{
|
||||
id: number | null;
|
||||
status: string | null;
|
||||
}
|
||||
},
|
||||
];
|
||||
}>();
|
||||
|
||||
|
@ -64,7 +64,7 @@ const cnameRecord = ref<CnameRecord | null>(null);
|
|||
function onRecordChange() {
|
||||
emit("change", {
|
||||
id: cnameRecord.value?.id,
|
||||
status: cnameRecord.value?.status
|
||||
status: cnameRecord.value?.status,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -90,11 +90,11 @@ async function doRefresh() {
|
|||
|
||||
watch(
|
||||
() => props.domain,
|
||||
async (value) => {
|
||||
async value => {
|
||||
await doRefresh();
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import { ref, inject } from "vue";
|
|||
import { Form } from "ant-design-vue";
|
||||
|
||||
defineOptions({
|
||||
name: "ApiTest"
|
||||
name: "ApiTest",
|
||||
});
|
||||
|
||||
const getScope: any = inject("get:scope");
|
||||
|
@ -49,14 +49,14 @@ const doTest = async () => {
|
|||
type: pluginType,
|
||||
typeName: form.type,
|
||||
action: props.action,
|
||||
input: pluginType === "plugin" ? form.input : form
|
||||
input: pluginType === "plugin" ? form.input : form,
|
||||
},
|
||||
{
|
||||
onError(err: any) {
|
||||
hasError.value = true;
|
||||
message.value = `错误:${err.message}`;
|
||||
},
|
||||
showErrorNotify: false
|
||||
showErrorNotify: false,
|
||||
}
|
||||
);
|
||||
message.value = "测试请求成功";
|
||||
|
|
|
@ -53,11 +53,15 @@ const getOptions = async () => {
|
|||
if (!define) {
|
||||
return;
|
||||
}
|
||||
const pluginType = getPluginType();
|
||||
const { form } = getScope();
|
||||
const input = pluginType === "plugin" ? form.input : form;
|
||||
|
||||
for (let key in define.input) {
|
||||
const inWatches = props.watches.includes(key);
|
||||
const inputDefine = define.input[key];
|
||||
if (inWatches && inputDefine.required) {
|
||||
const value = props.form[key];
|
||||
const value = input[key];
|
||||
if (value == null || value === "") {
|
||||
console.log("remote-select required", key);
|
||||
return;
|
||||
|
@ -69,8 +73,6 @@ const getOptions = async () => {
|
|||
hasError.value = false;
|
||||
loading.value = true;
|
||||
optionsRef.value = [];
|
||||
const { form } = getScope();
|
||||
const pluginType = getPluginType();
|
||||
|
||||
try {
|
||||
const res = await doRequest(
|
||||
|
@ -78,7 +80,7 @@ const getOptions = async () => {
|
|||
type: pluginType,
|
||||
typeName: form.type,
|
||||
action: props.action,
|
||||
input: pluginType === "plugin" ? form.input : form,
|
||||
input,
|
||||
},
|
||||
{
|
||||
onError(err: any) {
|
||||
|
@ -115,11 +117,16 @@ async function refreshOptions() {
|
|||
watch(
|
||||
() => {
|
||||
const values = [];
|
||||
|
||||
const pluginType = getPluginType();
|
||||
const { form } = getScope();
|
||||
const input = pluginType === "plugin" ? form.input : form;
|
||||
|
||||
for (const item of props.watches) {
|
||||
values.push(props.form[item]);
|
||||
values.push(input[item]);
|
||||
}
|
||||
return {
|
||||
form: props.form,
|
||||
form: input,
|
||||
watched: values,
|
||||
};
|
||||
},
|
||||
|
|
|
@ -16,9 +16,9 @@ export const aboutResource = [
|
|||
show: () => {
|
||||
const settingStore = useSettingStore();
|
||||
return !settingStore.isComm;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default aboutResource;
|
||||
|
|
|
@ -98,17 +98,17 @@ export const certdResources = [
|
|||
keepAlive: true,
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: "子域名托管设置",
|
||||
// name: "SubDomain",
|
||||
// path: "/certd/pipeline/subDomain",
|
||||
// component: "/certd/pipeline/sub-domain/index.vue",
|
||||
// meta: {
|
||||
// icon: "material-symbols:approval-delegation-outline",
|
||||
// auth: true,
|
||||
// keepAlive: true,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: "子域名托管设置",
|
||||
name: "SubDomain",
|
||||
path: "/certd/pipeline/subDomain",
|
||||
component: "/certd/pipeline/sub-domain/index.vue",
|
||||
meta: {
|
||||
icon: "material-symbols:approval-delegation-outline",
|
||||
auth: true,
|
||||
keepAlive: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "流水线分组管理",
|
||||
name: "PipelineGroupManager",
|
||||
|
|
|
@ -3,6 +3,17 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 根据SOA记录判断子域名托管有缺陷,改回手动配置子域名托管记录的方式 ([1b280a2](https://github.com/certd/certd/commit/1b280a2940f9e2d919b0bf23b89cc185be1fa498))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署证书到火山dcdn ([5f85219](https://github.com/certd/certd/commit/5f852194953dc1b4e6336770f417507b8f5a33ad))
|
||||
* 支持部署证书到unicloud ([a63d687](https://github.com/certd/certd/commit/a63d687f1c573159f0857693f37602b0e1e44072))
|
||||
|
||||
# [1.34.0](https://github.com/certd/certd/compare/v1.33.8...v1.34.0) (2025-04-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// 扫描目录,列出文件,然后加载为模块
|
||||
|
||||
import { join } from 'path';
|
||||
import fs from 'fs'
|
||||
import path, { join } from "path";
|
||||
import fs from "fs";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import path from 'path'
|
||||
import * as yaml from "js-yaml";
|
||||
import {AbstractTaskPlugin, BaseAccess, BaseNotification} from "@certd/pipeline";
|
||||
import { AbstractTaskPlugin, BaseAccess, BaseNotification } from "@certd/pipeline";
|
||||
|
||||
function scanDir(dir) {
|
||||
const files = fs.readdirSync(dir);
|
||||
const result = [];
|
||||
|
@ -84,7 +84,6 @@ for (const key in modules) {
|
|||
}else{
|
||||
console.log(`[warning] 未知的插件类型:${pluginDefine.name}`)
|
||||
}
|
||||
delete pluginDefine.autowire
|
||||
const filePath = path.join(`./metadata/${pluginDefine.pluginType}_${pluginDefine.name}.yaml`)
|
||||
|
||||
pluginDefine.scriptFilePath = location
|
||||
|
@ -93,4 +92,7 @@ for (const key in modules) {
|
|||
}
|
||||
}
|
||||
}
|
||||
process.exit();
|
||||
// import why from 'why-is-node-running'
|
||||
// setTimeout(() => why(), 100); // 延迟打印原因
|
||||
|
||||
process.exit()
|
||||
|
|
|
@ -3,6 +3,7 @@ title: 51dns
|
|||
desc: 51DNS
|
||||
icon: arcticons:dns-changer-3
|
||||
accessType: 51dns
|
||||
order: 999
|
||||
type: builtIn
|
||||
pluginType: dnsProvider
|
||||
scriptFilePath: ../../../plugins/plugin-51dns/index.js
|
||||
|
|
|
@ -3,6 +3,7 @@ title: 阿里云
|
|||
desc: 阿里云DNS解析提供商
|
||||
accessType: aliyun
|
||||
icon: svg:icon-aliyun
|
||||
order: 0
|
||||
type: builtIn
|
||||
pluginType: dnsProvider
|
||||
scriptFilePath: ../../../plugins/plugin-aliyun/dns-provider/aliyun-dns-provider.js
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@certd/ui-server",
|
||||
"version": "1.34.0",
|
||||
"version": "1.34.1",
|
||||
"description": "fast-server base midway",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
|
@ -28,7 +28,8 @@
|
|||
"heap": "cross-env NODE_ENV=local clinic heapprofiler -- node ./bootstrap.js",
|
||||
"flame": "clinic flame -- node ./bootstrap.js",
|
||||
"tsc": "tsc --skipLibCheck",
|
||||
"slimming": "node ./slimming.js"
|
||||
"slimming": "node ./slimming.js",
|
||||
"pub": "echo 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alicloud/fc20230330": "^4.1.7",
|
||||
|
@ -39,19 +40,19 @@
|
|||
"@aws-sdk/client-acm": "^3.699.0",
|
||||
"@aws-sdk/client-cloudfront": "^3.699.0",
|
||||
"@aws-sdk/client-s3": "^3.705.0",
|
||||
"@certd/acme-client": "^1.34.0",
|
||||
"@certd/basic": "^1.34.0",
|
||||
"@certd/commercial-core": "^1.34.0",
|
||||
"@certd/jdcloud": "^1.34.0",
|
||||
"@certd/lib-huawei": "^1.34.0",
|
||||
"@certd/lib-k8s": "^1.34.0",
|
||||
"@certd/lib-server": "^1.34.0",
|
||||
"@certd/midway-flyway-js": "^1.34.0",
|
||||
"@certd/pipeline": "^1.34.0",
|
||||
"@certd/plugin-cert": "^1.34.0",
|
||||
"@certd/plugin-lib": "^1.34.0",
|
||||
"@certd/plugin-plus": "^1.34.0",
|
||||
"@certd/plus-core": "^1.34.0",
|
||||
"@certd/acme-client": "^1.34.1",
|
||||
"@certd/basic": "^1.34.1",
|
||||
"@certd/commercial-core": "^1.34.1",
|
||||
"@certd/jdcloud": "^1.34.1",
|
||||
"@certd/lib-huawei": "^1.34.1",
|
||||
"@certd/lib-k8s": "^1.34.1",
|
||||
"@certd/lib-server": "^1.34.1",
|
||||
"@certd/midway-flyway-js": "^1.34.1",
|
||||
"@certd/pipeline": "^1.34.1",
|
||||
"@certd/plugin-cert": "^1.34.1",
|
||||
"@certd/plugin-lib": "^1.34.1",
|
||||
"@certd/plugin-plus": "^1.34.1",
|
||||
"@certd/plus-core": "^1.34.1",
|
||||
"@corsinvest/cv4pve-api-javascript": "^8.3.0",
|
||||
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120",
|
||||
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120",
|
||||
|
@ -132,7 +133,8 @@
|
|||
"prettier": "^2.8.8",
|
||||
"rimraf": "^5.0.5",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
"typescript": "^5.4.2",
|
||||
"why-is-node-running": "^3.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
|
|
|
@ -80,7 +80,10 @@ export class AccessController extends CrudController<AccessService> {
|
|||
|
||||
@Post('/accessTypeDict', { summary: Constants.per.authOnly })
|
||||
async getAccessTypeDict() {
|
||||
const list: AccessDefine[] = this.service.getDefineList();
|
||||
let list: AccessDefine[] = this.service.getDefineList();
|
||||
list = list.sort((a,b) => {
|
||||
return (a.order??10) - (b.order??10);
|
||||
});
|
||||
const dict = [];
|
||||
for (const item of list) {
|
||||
dict.push({
|
||||
|
|
|
@ -2,7 +2,7 @@ import https from 'node:https';
|
|||
import fs from 'fs';
|
||||
import { Application } from '@midwayjs/koa';
|
||||
import { createSelfCertificate } from './self-certificate.js';
|
||||
import { logger } from '@certd/basic';
|
||||
import {logger, safePromise} from '@certd/basic';
|
||||
|
||||
export type HttpsServerOptions = {
|
||||
enabled: boolean;
|
||||
|
@ -23,7 +23,7 @@ export class HttpsServer {
|
|||
}
|
||||
|
||||
async close() {
|
||||
return new Promise((resolve, reject) => {
|
||||
return safePromise((resolve, reject) => {
|
||||
this.server.close(() => {
|
||||
resolve(true);
|
||||
});
|
||||
|
|
|
@ -114,4 +114,5 @@ export class CnameProviderService extends BaseService<CnameProviderEntity> {
|
|||
}
|
||||
return await super.info(id, infoIgnoreProperty);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ type CnameCheckCacheValue = {
|
|||
recordRes?: any;
|
||||
startTime: number;
|
||||
intervalId?: NodeJS.Timeout;
|
||||
dnsProvider?: IDnsProvider;
|
||||
};
|
||||
/**
|
||||
* 授权
|
||||
|
@ -235,6 +236,23 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
|||
return dnsProvider;
|
||||
};
|
||||
|
||||
const clearVerifyRecord = async () => {
|
||||
cache.delete(cacheKey);
|
||||
try {
|
||||
let dnsProvider =value.dnsProvider
|
||||
if (!dnsProvider) {
|
||||
dnsProvider = await buildDnsProvider();
|
||||
}
|
||||
await dnsProvider.removeRecord({
|
||||
recordReq: value.recordReq,
|
||||
recordRes: value.recordRes,
|
||||
});
|
||||
logger.info('删除CNAME的校验DNS记录成功');
|
||||
} catch (e) {
|
||||
logger.error(`删除CNAME的校验DNS记录失败, ${e.message},req:${JSON.stringify(value.recordReq)},recordRes:${JSON.stringify(value.recordRes)}`, e);
|
||||
}
|
||||
};
|
||||
|
||||
const checkRecordValue = async () => {
|
||||
if (value.pass) {
|
||||
return true;
|
||||
|
@ -243,7 +261,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
|||
logger.warn(`cname验证超时,停止检查,${bean.domain} ${testRecordValue}`);
|
||||
clearInterval(value.intervalId);
|
||||
await this.updateStatus(bean.id, 'timeout');
|
||||
cache.delete(cacheKey);
|
||||
await clearVerifyRecord()
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -270,17 +288,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
|||
logger.info(`检测到CNAME配置,修改状态 ${fullDomain} ${testRecordValue}`);
|
||||
await this.updateStatus(bean.id, 'valid');
|
||||
value.pass = true;
|
||||
cache.delete(cacheKey);
|
||||
try {
|
||||
const dnsProvider = await buildDnsProvider();
|
||||
await dnsProvider.removeRecord({
|
||||
recordReq: value.recordReq,
|
||||
recordRes: value.recordRes,
|
||||
});
|
||||
logger.info('删除CNAME的校验DNS记录成功');
|
||||
} catch (e) {
|
||||
logger.error(`删除CNAME的校验DNS记录失败, ${e.message},req:${JSON.stringify(value.recordReq)},recordRes:${JSON.stringify(value.recordRes)}`, e);
|
||||
}
|
||||
await clearVerifyRecord()
|
||||
return success;
|
||||
}
|
||||
};
|
||||
|
@ -306,6 +314,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
|||
};
|
||||
const dnsProvider = await buildDnsProvider();
|
||||
const recordRes = await dnsProvider.createRecord(req);
|
||||
value.dnsProvider = dnsProvider;
|
||||
value.validating = true;
|
||||
value.recordReq = req;
|
||||
value.recordRes = recordRes;
|
||||
|
|
|
@ -61,7 +61,7 @@ export class CommonDnsProvider implements IDnsProvider {
|
|||
domain: options.recordReq.domain,
|
||||
hostRecord: options.recordReq.hostRecord,
|
||||
recordValue: options.recordReq.value,
|
||||
recordId: options.recordRes.recordId,
|
||||
recordId: options.recordRes?.recordId,
|
||||
providerId: this.config.id,
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { logger, utils } from '@certd/basic';
|
||||
import {logger, safePromise, utils} from '@certd/basic';
|
||||
import { merge } from 'lodash-es';
|
||||
import https from 'https';
|
||||
import { PeerCertificate } from 'tls';
|
||||
|
@ -49,7 +49,7 @@ export class SiteTester {
|
|||
);
|
||||
options.agent = agent;
|
||||
// 创建 HTTPS 请求
|
||||
const requestPromise = new Promise((resolve, reject) => {
|
||||
const requestPromise = safePromise((resolve, reject) => {
|
||||
const req = https.request(options, res => {
|
||||
// 获取证书
|
||||
// @ts-ignore
|
||||
|
|
|
@ -285,12 +285,22 @@ export class PluginService extends BaseService<PluginEntity> {
|
|||
async registerFromLocal(localDir: string) {
|
||||
//scan path
|
||||
const files = fs.readdirSync(localDir);
|
||||
let list = []
|
||||
for (const file of files) {
|
||||
if (!file.endsWith(".yaml")) {
|
||||
continue;
|
||||
}
|
||||
const item = yaml.load(fs.readFileSync(path.join(localDir, file), "utf8"));
|
||||
|
||||
list.push(item);
|
||||
|
||||
}
|
||||
//排序
|
||||
list = list.sort((a, b) => {
|
||||
return (a.order??10) - (b.order ??10);
|
||||
});
|
||||
|
||||
for (const item of list) {
|
||||
await this.registerPlugin(item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,15 +16,15 @@ export type Dns51Record = {
|
|||
icon: 'arcticons:dns-changer-3',
|
||||
// 这里是对应的 cloudflare的access类型名称
|
||||
accessType: '51dns',
|
||||
order:999,
|
||||
})
|
||||
export class Dns51DnsProvider extends AbstractDnsProvider<Dns51Record> {
|
||||
// 通过Autowire传递context
|
||||
access!: Dns51Access;
|
||||
|
||||
client!:Dns51Client;
|
||||
async onInstance() {
|
||||
//一些初始化的操作
|
||||
// 也可以通过ctx成员变量传递context, 与Autowire效果一样
|
||||
// 也可以通过ctx成员变量传递context
|
||||
this.access = this.ctx.access as Dns51Access;
|
||||
this.client = new Dns51Client({
|
||||
logger: this.logger,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||
import { Autowire } from '@certd/pipeline';
|
||||
|
||||
import { AliyunAccess, AliyunClient } from '@certd/plugin-lib';
|
||||
|
||||
|
@ -9,13 +8,12 @@ import { AliyunAccess, AliyunClient } from '@certd/plugin-lib';
|
|||
desc: '阿里云DNS解析提供商',
|
||||
accessType: 'aliyun',
|
||||
icon: 'svg:icon-aliyun',
|
||||
order:0,
|
||||
})
|
||||
export class AliyunDnsProvider extends AbstractDnsProvider {
|
||||
client: any;
|
||||
@Autowire()
|
||||
access!: AliyunAccess;
|
||||
async onInstance() {
|
||||
const access: any = this.access;
|
||||
const access: AliyunAccess = this.ctx.access as AliyunAccess
|
||||
|
||||
this.client = new AliyunClient({ logger: this.logger });
|
||||
await this.client.init({
|
||||
|
|
|
@ -25,11 +25,10 @@ export type CloudflareRecord = {
|
|||
accessType: 'cloudflare',
|
||||
})
|
||||
export class CloudflareDnsProvider extends AbstractDnsProvider<CloudflareRecord> {
|
||||
// 通过Autowire传递context
|
||||
access!: CloudflareAccess;
|
||||
async onInstance() {
|
||||
//一些初始化的操作
|
||||
// 也可以通过ctx成员变量传递context, 与Autowire效果一样
|
||||
// 也可以通过ctx成员变量传递context
|
||||
this.access = this.ctx.access as CloudflareAccess;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||
import { Autowire } from '@certd/pipeline';
|
||||
|
||||
import { DemoAccess } from './access.js';
|
||||
import { isDev } from '../../utils/env.js';
|
||||
|
@ -19,12 +18,11 @@ type DemoRecord = {
|
|||
accessType: 'demo',
|
||||
})
|
||||
export class DemoDnsProvider extends AbstractDnsProvider<DemoRecord> {
|
||||
// 通过Autowire注入工具对象
|
||||
@Autowire()
|
||||
access!: DemoAccess;
|
||||
|
||||
async onInstance() {
|
||||
// 也可以通过ctx成员变量传递context, 与Autowire效果一样
|
||||
this.access = this.ctx.access as DemoAccess
|
||||
// 也可以通过ctx成员变量传递context
|
||||
this.logger.debug('access', this.access);
|
||||
//初始化的操作
|
||||
//...
|
||||
|
|
|
@ -16,11 +16,10 @@ export type DnslaRecord = {
|
|||
accessType: 'dnsla',
|
||||
})
|
||||
export class DnslaDnsProvider extends AbstractDnsProvider<DnslaRecord> {
|
||||
// 通过Autowire传递context
|
||||
access!: DnslaAccess;
|
||||
async onInstance() {
|
||||
//一些初始化的操作
|
||||
// 也可以通过ctx成员变量传递context, 与Autowire效果一样
|
||||
// 通过ctx成员变量传递context
|
||||
this.access = this.ctx.access as DnslaAccess;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline';
|
||||
import { CertInfo, CertReader } from '@certd/plugin-cert';
|
||||
import * as fs from 'fs';
|
||||
import { Constants } from '@certd/lib-server';
|
||||
import path from 'path';
|
||||
import { CertApplyPluginNames} from '@certd/plugin-cert';
|
||||
const dataDir = "./data"
|
||||
@IsTaskPlugin({
|
||||
name: 'CopyToLocal',
|
||||
title: '主机-复制到本机',
|
||||
|
@ -209,37 +209,37 @@ export class CopyCertToLocalPlugin extends AbstractTaskPlugin {
|
|||
this.logger.info('复制到目标路径');
|
||||
if (crtPath) {
|
||||
crtPath = crtPath.trim();
|
||||
crtPath = crtPath.startsWith('/') ? crtPath : path.join(Constants.dataDir, crtPath);
|
||||
crtPath = crtPath.startsWith('/') ? crtPath : path.join(dataDir, crtPath);
|
||||
this.copyFile(tmpCrtPath, crtPath);
|
||||
this.hostCrtPath = crtPath;
|
||||
}
|
||||
if (keyPath) {
|
||||
keyPath = keyPath.trim();
|
||||
keyPath = keyPath.startsWith('/') ? keyPath : path.join(Constants.dataDir, keyPath);
|
||||
keyPath = keyPath.startsWith('/') ? keyPath : path.join(dataDir, keyPath);
|
||||
this.copyFile(tmpKeyPath, keyPath);
|
||||
this.hostKeyPath = keyPath;
|
||||
}
|
||||
if (icPath) {
|
||||
icPath = icPath.trim();
|
||||
icPath = icPath.startsWith('/') ? icPath : path.join(Constants.dataDir, icPath);
|
||||
icPath = icPath.startsWith('/') ? icPath : path.join(dataDir, icPath);
|
||||
this.copyFile(tmpIcPath, icPath);
|
||||
this.hostIcPath = icPath;
|
||||
}
|
||||
if (pfxPath) {
|
||||
pfxPath = pfxPath.trim();
|
||||
pfxPath = pfxPath.startsWith('/') ? pfxPath : path.join(Constants.dataDir, pfxPath);
|
||||
pfxPath = pfxPath.startsWith('/') ? pfxPath : path.join(dataDir, pfxPath);
|
||||
this.copyFile(tmpPfxPath, pfxPath);
|
||||
this.hostPfxPath = pfxPath;
|
||||
}
|
||||
if (derPath) {
|
||||
derPath = derPath.trim();
|
||||
derPath = derPath.startsWith('/') ? derPath : path.join(Constants.dataDir, derPath);
|
||||
derPath = derPath.startsWith('/') ? derPath : path.join(dataDir, derPath);
|
||||
this.copyFile(tmpDerPath, derPath);
|
||||
this.hostDerPath = derPath;
|
||||
}
|
||||
if (jksPath) {
|
||||
jksPath = jksPath.trim();
|
||||
jksPath = jksPath.startsWith('/') ? jksPath : path.join(Constants.dataDir, jksPath);
|
||||
jksPath = jksPath.startsWith('/') ? jksPath : path.join(dataDir, jksPath);
|
||||
this.copyFile(tmpJksPath, jksPath);
|
||||
this.hostJksPath = jksPath;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import * as _ from "lodash-es";
|
||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
import { Autowire } from "@certd/pipeline";
|
||||
|
||||
import { HuaweiAccess } from "../access/index.js";
|
||||
import { ApiRequestOptions, HuaweiYunClient } from "@certd/lib-huawei";
|
||||
|
@ -18,12 +17,12 @@ export type SearchRecordOptions = {
|
|||
})
|
||||
export class HuaweiDnsProvider extends AbstractDnsProvider {
|
||||
client!: HuaweiYunClient;
|
||||
@Autowire()
|
||||
access!: HuaweiAccess;
|
||||
domainEndpoint = "https://domains-external.myhuaweicloud.com";
|
||||
dnsEndpoint = "https://dns.cn-south-1.myhuaweicloud.com";
|
||||
|
||||
async onInstance() {
|
||||
this.access = this.ctx.access as HuaweiAccess
|
||||
const access: any = this.access;
|
||||
this.client = new HuaweiYunClient(access, this.logger);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
import { Autowire } from "@certd/pipeline";
|
||||
import { JDCloudAccess } from "./access.js";
|
||||
|
||||
@IsDnsProvider({
|
||||
|
@ -10,11 +9,11 @@ import { JDCloudAccess } from "./access.js";
|
|||
icon: "svg:icon-jdcloud"
|
||||
})
|
||||
export class JDCloudDnsProvider extends AbstractDnsProvider {
|
||||
@Autowire()
|
||||
access!: JDCloudAccess;
|
||||
|
||||
|
||||
async onInstance() {
|
||||
this.access = this.ctx.access as JDCloudAccess
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,11 +17,10 @@ export type NamesiloRecord = {
|
|||
accessType: 'namesilo',
|
||||
})
|
||||
export class NamesiloDnsProvider extends AbstractDnsProvider<NamesiloRecord> {
|
||||
// 通过Autowire传递context
|
||||
access!: NamesiloAccess;
|
||||
async onInstance() {
|
||||
//一些初始化的操作
|
||||
// 也可以通过ctx成员变量传递context, 与Autowire效果一样
|
||||
// 也可以通过ctx成员变量传递context
|
||||
this.access = this.ctx.access as NamesiloAccess;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import { Autowire } from '@certd/pipeline';
|
||||
|
||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||
import * as _ from 'lodash-es';
|
||||
import { DnspodAccess } from '../access/index.js';
|
||||
|
@ -13,13 +11,13 @@ import { DnspodAccess } from '../access/index.js';
|
|||
icon: 'svg:icon-tencentcloud',
|
||||
})
|
||||
export class DnspodDnsProvider extends AbstractDnsProvider {
|
||||
@Autowire()
|
||||
access!: DnspodAccess;
|
||||
|
||||
loginToken: any;
|
||||
|
||||
endpoint = '';
|
||||
async onInstance() {
|
||||
this.access = this.ctx.access as DnspodAccess
|
||||
const access: DnspodAccess = this.access as DnspodAccess;
|
||||
this.loginToken = access.id + ',' + access.token;
|
||||
this.endpoint = access.endpoint || 'https://dnsapi.cn';
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import { Autowire } from '@certd/pipeline';
|
||||
|
||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||
import { TencentAccess } from '@certd/plugin-lib';
|
||||
|
||||
|
@ -11,7 +9,6 @@ import { TencentAccess } from '@certd/plugin-lib';
|
|||
icon: 'svg:icon-tencentcloud',
|
||||
})
|
||||
export class TencentDnsProvider extends AbstractDnsProvider {
|
||||
@Autowire()
|
||||
access!: TencentAccess;
|
||||
|
||||
client!: any;
|
||||
|
@ -19,6 +16,7 @@ export class TencentDnsProvider extends AbstractDnsProvider {
|
|||
endpoint = 'dnspod.tencentcloudapi.com';
|
||||
|
||||
async onInstance() {
|
||||
this.access = this.ctx.access as TencentAccess
|
||||
const clientConfig = {
|
||||
credential: this.access,
|
||||
region: '',
|
||||
|
|
|
@ -0,0 +1,204 @@
|
|||
import {AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput} from "@certd/pipeline";
|
||||
import {createCertDomainGetterInputDefine, createRemoteSelectInputDefine} from "@certd/plugin-lib";
|
||||
import {CertApplyPluginNames, CertInfo, CertReader} from "@certd/plugin-cert";
|
||||
import {VolcengineAccess} from "../access.js";
|
||||
import {VolcengineClient} from "../ve-client.js";
|
||||
|
||||
@IsTaskPlugin({
|
||||
name: "VolcengineDeployToDCDN",
|
||||
title: "火山引擎-部署证书至DCDN",
|
||||
icon: "svg:icon-volcengine",
|
||||
group: pluginGroups.volcengine.key,
|
||||
desc: "部署至火山引擎全站加速",
|
||||
// showRunStrategy: true,
|
||||
default: {
|
||||
strategy: {
|
||||
runStrategy: RunStrategy.SkipWhenSucceed
|
||||
}
|
||||
}
|
||||
})
|
||||
export class VolcengineDeployToDCDN extends AbstractTaskPlugin {
|
||||
@TaskInput({
|
||||
title: "域名证书",
|
||||
helper: "请选择前置任务输出的域名证书",
|
||||
component: {
|
||||
name: "output-selector",
|
||||
from: [...CertApplyPluginNames]
|
||||
},
|
||||
required: true
|
||||
})
|
||||
cert!: CertInfo;
|
||||
|
||||
@TaskInput(createCertDomainGetterInputDefine({props: {required: false}}))
|
||||
certDomains!: string[];
|
||||
|
||||
@TaskInput({
|
||||
title: "自动匹配",
|
||||
helper: "是否根据证书自动匹配合适的DCDN域名进行部署",
|
||||
value: false,
|
||||
component: {
|
||||
name: "a-switch",
|
||||
type: "checked"
|
||||
},
|
||||
required: true
|
||||
})
|
||||
autoMatch!: boolean;
|
||||
|
||||
@TaskInput({
|
||||
title: "Access授权",
|
||||
helper: "火山引擎AccessKeyId、AccessKeySecret",
|
||||
component: {
|
||||
name: "access-selector",
|
||||
type: "volcengine"
|
||||
},
|
||||
required: true
|
||||
})
|
||||
accessId!: string;
|
||||
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: "DCDN域名",
|
||||
helper: "选择要部署证书的DCDN域名",
|
||||
action: VolcengineDeployToDCDN.prototype.onGetDomainList.name,
|
||||
watches: ["certDomains", "accessId"],
|
||||
required: true,
|
||||
mergeScript: `
|
||||
return {
|
||||
show: ctx.compute(({form})=>{
|
||||
return !form.autoMatch
|
||||
})
|
||||
}
|
||||
`
|
||||
})
|
||||
)
|
||||
domainList!: string | string[];
|
||||
|
||||
|
||||
async onInstance() {
|
||||
}
|
||||
|
||||
async uploadCert(client: VolcengineClient) {
|
||||
const certService = await client.getCertCenterService();
|
||||
let certId = this.cert;
|
||||
if (typeof certId !== "string") {
|
||||
const certInfo = this.cert as CertInfo;
|
||||
this.logger.info(`开始上传证书`);
|
||||
certId = await certService.ImportCertificate({
|
||||
certName: this.appendTimeSuffix("certd"),
|
||||
cert: certInfo
|
||||
});
|
||||
this.logger.info(`上传证书成功:${certId}`);
|
||||
} else {
|
||||
this.logger.info(`使用已有证书ID:${certId}`);
|
||||
}
|
||||
return certId
|
||||
}
|
||||
|
||||
|
||||
async execute(): Promise<void> {
|
||||
this.logger.info("开始部署证书到火山引擎DCDN");
|
||||
|
||||
const client = await this.getClient();
|
||||
let certId = await this.uploadCert(client);
|
||||
|
||||
const service = await client.getDCDNService();
|
||||
|
||||
this.certDomains = new CertReader(this.cert).getAllDomains()
|
||||
|
||||
|
||||
let domainList = this.domainList
|
||||
if (!this.autoMatch) {
|
||||
//手动根据域名部署
|
||||
if (!this.domainList || this.domainList.length === 0) {
|
||||
throw new Error("域名列表不能为空");
|
||||
}
|
||||
} else {
|
||||
//自动匹配
|
||||
const options = await this.getDomainOptions(service);
|
||||
const grouped = this.ctx.utils.options.groupByDomain(options, this.certDomains);
|
||||
|
||||
const matched = grouped.matched
|
||||
|
||||
domainList = matched.map(item => item.domain)
|
||||
|
||||
if (domainList.length === 0) {
|
||||
this.logger.warn("没有匹配到域名,跳过部署")
|
||||
this.logger.info("当前证书域名:", this.certDomains)
|
||||
this.logger.info("当前DCDN域名:", grouped.notMatched.map(item => item.domain))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//域名十个十个的分割
|
||||
for (let i = 0; i < domainList.length; i += 10) {
|
||||
const batch = domainList.slice(i, i + 10);
|
||||
this.logger.info(`开始部署证书到域名:${batch}`);
|
||||
const res = await service.request({
|
||||
action: "CreateCertBind",
|
||||
method: "POST",
|
||||
body: {
|
||||
"DomainNames": batch,
|
||||
"CertSource": "volc",
|
||||
"CertId": certId
|
||||
},
|
||||
version: "2021-04-01"
|
||||
});
|
||||
this.logger.info(`部署证书到域名成功:`,JSON.stringify(res));
|
||||
}
|
||||
|
||||
this.logger.info("部署完成");
|
||||
|
||||
}
|
||||
|
||||
|
||||
async getClient() {
|
||||
const access = await this.getAccess<VolcengineAccess>(this.accessId);
|
||||
|
||||
return new VolcengineClient({
|
||||
logger: this.logger,
|
||||
access,
|
||||
http: this.http
|
||||
})
|
||||
}
|
||||
|
||||
async onGetDomainList(data: any) {
|
||||
if (!this.accessId) {
|
||||
throw new Error("请选择Access授权");
|
||||
}
|
||||
|
||||
const client = await this.getClient();
|
||||
const service = await client.getDCDNService();
|
||||
const options = await this.getDomainOptions(service);
|
||||
return this.ctx.utils.options.buildGroupOptions(options, this.certDomains);
|
||||
}
|
||||
|
||||
private async getDomainOptions(service: any) {
|
||||
const res = await service.request({
|
||||
method: "POST",
|
||||
action: "DescribeUserDomains",
|
||||
body: {
|
||||
"PageSize": 1000
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const list = res.Result?.Domains;
|
||||
if (!list || list.length === 0) {
|
||||
throw new Error("找不到DCDN域名,您也可以手动输入域名");
|
||||
}
|
||||
const options = list.map((item: any) => {
|
||||
return {
|
||||
value: item.Domain,
|
||||
label: `${item.Domain}<${item.Scope}>`,
|
||||
domain: item.Domain
|
||||
};
|
||||
});
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
new VolcengineDeployToDCDN();
|
|
@ -100,6 +100,19 @@ export class VolcengineClient {
|
|||
return service;
|
||||
}
|
||||
|
||||
async getDCDNService( opts?: { }) {
|
||||
const CommonService = await this.getServiceCls();
|
||||
|
||||
const service = new CommonService({
|
||||
serviceName: "dcdn",
|
||||
defaultVersion: "2023-01-01"
|
||||
});
|
||||
service.setAccessKeyId(this.opts.access.accessKeyId);
|
||||
service.setSecretKey(this.opts.access.secretAccessKey);
|
||||
service.setRegion("cn-north-1");
|
||||
return service;
|
||||
}
|
||||
|
||||
async getServiceCls() {
|
||||
if (this.CommonService) {
|
||||
return this.CommonService;
|
||||
|
@ -114,11 +127,11 @@ export class VolcengineClient {
|
|||
defaultVersion: string;
|
||||
}) {
|
||||
super(Object.assign({ host: "open.volcengineapi.com" }, options));
|
||||
this.Generic = async (req: { action: string, body?: any, method?: string, query?: any }) => {
|
||||
const { action, method, body, query } = req;
|
||||
this.Generic = async (req: { action: string, body?: any, method?: string, query?: any ,version?:string}) => {
|
||||
const { action, method, body, query,version } = req;
|
||||
return await this.fetchOpenAPI({
|
||||
Action: action,
|
||||
Version: options.defaultVersion,
|
||||
Version: version||options.defaultVersion,
|
||||
method: method as any,
|
||||
headers: {
|
||||
"content-type": "application/json"
|
||||
|
@ -129,8 +142,11 @@ export class VolcengineClient {
|
|||
};
|
||||
}
|
||||
|
||||
async request(req: { action: string, body?: any, method?: string, query?: any }) {
|
||||
async request(req: { action: string, body?: any, method?: string, query?: any,version?:string }) {
|
||||
const res = await this.Generic(req);
|
||||
if (res ==="Not Found"){
|
||||
throw new Error(`${res} (检查method)`);
|
||||
}
|
||||
if (res.errorcode) {
|
||||
throw new Error(`${res.errorcode}:${res.message}`);
|
||||
}
|
||||
|
@ -146,4 +162,5 @@ export class VolcengineClient {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
import { Autowire } from "@certd/pipeline";
|
||||
|
||||
import { VolcengineDnsClient } from "./dns-client.js";
|
||||
import { VolcengineAccess } from "./access.js";
|
||||
|
@ -13,11 +12,11 @@ import { VolcengineAccess } from "./access.js";
|
|||
})
|
||||
export class VolcengineDnsProvider extends AbstractDnsProvider {
|
||||
client: VolcengineDnsClient;
|
||||
@Autowire()
|
||||
access!: VolcengineAccess;
|
||||
|
||||
|
||||
async onInstance() {
|
||||
this.access = this.ctx.access as VolcengineAccess
|
||||
this.client = new VolcengineDnsClient({
|
||||
access: this.access,
|
||||
logger: this.logger,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||
import { Autowire } from '@certd/pipeline';
|
||||
|
||||
import { WestAccess } from './access.js';
|
||||
|
||||
|
@ -22,12 +21,11 @@ type westRecord = {
|
|||
accessType: 'west',
|
||||
})
|
||||
export class WestDnsProvider extends AbstractDnsProvider<westRecord> {
|
||||
// 通过Autowire注入工具对象
|
||||
@Autowire()
|
||||
access!: WestAccess;
|
||||
|
||||
async onInstance() {
|
||||
// 也可以通过ctx成员变量传递context, 与Autowire效果一样
|
||||
this.access = this.ctx.access as WestAccess
|
||||
// 也可以通过ctx成员变量传递context
|
||||
this.logger.debug('access:', this.access);
|
||||
//初始化的操作
|
||||
//...
|
||||
|
|
119
pnpm-lock.yaml
119
pnpm-lock.yaml
|
@ -46,7 +46,7 @@ importers:
|
|||
packages/core/acme-client:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../basic
|
||||
'@peculiar/x509':
|
||||
specifier: ^1.11.0
|
||||
|
@ -207,10 +207,10 @@ importers:
|
|||
packages/core/pipeline:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../basic
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../pro/plus-core
|
||||
dayjs:
|
||||
specifier: ^1.11.7
|
||||
|
@ -415,7 +415,7 @@ importers:
|
|||
packages/libs/lib-k8s:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/basic
|
||||
'@kubernetes/client-node':
|
||||
specifier: 0.21.0
|
||||
|
@ -455,16 +455,16 @@ importers:
|
|||
packages/libs/lib-server:
|
||||
dependencies:
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../pro/plus-core
|
||||
'@midwayjs/cache':
|
||||
specifier: ~3.14.0
|
||||
|
@ -607,16 +607,16 @@ importers:
|
|||
packages/plugins/plugin-cert:
|
||||
dependencies:
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../plugin-lib
|
||||
'@google-cloud/publicca':
|
||||
specifier: ^1.3.0
|
||||
|
@ -689,10 +689,10 @@ importers:
|
|||
specifier: ^3.787.0
|
||||
version: 3.787.0(aws-crt@1.25.3)
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/pipeline
|
||||
'@kubernetes/client-node':
|
||||
specifier: 0.21.0
|
||||
|
@ -780,19 +780,19 @@ importers:
|
|||
packages/pro/commercial-core:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/basic
|
||||
'@certd/lib-server':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../libs/lib-server
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-plus':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../plugin-plus
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../plus-core
|
||||
'@midwayjs/core':
|
||||
specifier: ~3.20.3
|
||||
|
@ -877,22 +877,22 @@ importers:
|
|||
specifier: ^1.0.2
|
||||
version: 1.0.2
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/basic
|
||||
'@certd/lib-k8s':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../libs/lib-k8s
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-cert':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../plugins/plugin-cert
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../plugins/plugin-lib
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../plus-core
|
||||
ali-oss:
|
||||
specifier: ^6.21.0
|
||||
|
@ -989,7 +989,7 @@ importers:
|
|||
packages/pro/plus-core:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/basic
|
||||
dayjs:
|
||||
specifier: ^1.11.7
|
||||
|
@ -1279,10 +1279,10 @@ importers:
|
|||
version: 0.1.3(zod@3.24.2)
|
||||
devDependencies:
|
||||
'@certd/lib-iframe':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../libs/lib-iframe
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/pipeline
|
||||
'@rollup/plugin-commonjs':
|
||||
specifier: ^25.0.7
|
||||
|
@ -1419,9 +1419,6 @@ importers:
|
|||
vite-plugin-compression:
|
||||
specifier: ^0.5.1
|
||||
version: 0.5.1(vite@5.4.14(@types/node@18.19.80)(less@4.2.2)(terser@5.39.0))
|
||||
vite-plugin-dynamic-base:
|
||||
specifier: ^1.1.0
|
||||
version: 1.1.0(vite@5.4.14(@types/node@18.19.80)(less@4.2.2)(terser@5.39.0))
|
||||
vite-plugin-html:
|
||||
specifier: ^3.2.2
|
||||
version: 3.2.2(vite@5.4.14(@types/node@18.19.80)(less@4.2.2)(terser@5.39.0))
|
||||
|
@ -1465,43 +1462,43 @@ importers:
|
|||
specifier: ^3.705.0
|
||||
version: 3.758.0(aws-crt@1.25.3)
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/basic
|
||||
'@certd/commercial-core':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../pro/commercial-core
|
||||
'@certd/jdcloud':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../libs/lib-jdcloud
|
||||
'@certd/lib-huawei':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../libs/lib-huawei
|
||||
'@certd/lib-k8s':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../libs/lib-k8s
|
||||
'@certd/lib-server':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../libs/lib-server
|
||||
'@certd/midway-flyway-js':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../libs/midway-flyway-js
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-cert':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../plugins/plugin-cert
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../plugins/plugin-lib
|
||||
'@certd/plugin-plus':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../pro/plugin-plus
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.33.7
|
||||
specifier: ^1.34.0
|
||||
version: link:../../pro/plus-core
|
||||
'@corsinvest/cv4pve-api-javascript':
|
||||
specifier: ^8.3.0
|
||||
|
@ -1738,6 +1735,9 @@ importers:
|
|||
typescript:
|
||||
specifier: ^5.4.2
|
||||
version: 5.8.2
|
||||
why-is-node-running:
|
||||
specifier: ^3.2.2
|
||||
version: 3.2.2
|
||||
|
||||
packages:
|
||||
|
||||
|
@ -13015,11 +13015,6 @@ packages:
|
|||
peerDependencies:
|
||||
vite: '>=2.0.0'
|
||||
|
||||
vite-plugin-dynamic-base@1.1.0:
|
||||
resolution: {integrity: sha512-/hIOTuzedlPRiUTCIY1cJx7UDDUF0brxWIifE7xG1czCJy0Aw6k3QPbHVjPCs30YuU+WAgrX4ACOySLIp2NHkw==}
|
||||
peerDependencies:
|
||||
vite: '>= 2.9.5'
|
||||
|
||||
vite-plugin-html@3.2.2:
|
||||
resolution: {integrity: sha512-vb9C9kcdzcIo/Oc3CLZVS03dL5pDlOFuhGlZYDCJ840BhWl/0nGeZWf3Qy7NlOayscY4Cm/QRgULCQkEZige5Q==}
|
||||
peerDependencies:
|
||||
|
@ -13337,6 +13332,11 @@ packages:
|
|||
engines: {node: '>=8'}
|
||||
hasBin: true
|
||||
|
||||
why-is-node-running@3.2.2:
|
||||
resolution: {integrity: sha512-NKUzAelcoCXhXL4dJzKIwXeR8iEVqsA0Lq6Vnd0UXvgaKbzVo4ZTHROF2Jidrv+SgxOQ03fMinnNhzZATxOD3A==}
|
||||
engines: {node: '>=20.11'}
|
||||
hasBin: true
|
||||
|
||||
wide-align@1.1.5:
|
||||
resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==}
|
||||
|
||||
|
@ -18063,8 +18063,10 @@ snapshots:
|
|||
'@swc/core-win32-arm64-msvc': 1.11.22
|
||||
'@swc/core-win32-ia32-msvc': 1.11.22
|
||||
'@swc/core-win32-x64-msvc': 1.11.22
|
||||
optional: true
|
||||
|
||||
'@swc/counter@0.1.3': {}
|
||||
'@swc/counter@0.1.3':
|
||||
optional: true
|
||||
|
||||
'@swc/helpers@0.5.15':
|
||||
dependencies:
|
||||
|
@ -18073,6 +18075,7 @@ snapshots:
|
|||
'@swc/types@0.1.21':
|
||||
dependencies:
|
||||
'@swc/counter': 0.1.3
|
||||
optional: true
|
||||
|
||||
'@szmarczak/http-timer@1.1.2':
|
||||
dependencies:
|
||||
|
@ -21769,13 +21772,13 @@ snapshots:
|
|||
resolve: 1.22.10
|
||||
semver: 6.3.1
|
||||
|
||||
eslint-plugin-prettier@3.4.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@7.32.0)(prettier@2.8.8):
|
||||
eslint-plugin-prettier@3.4.1(eslint-config-prettier@8.10.0(eslint@7.32.0))(eslint@7.32.0)(prettier@2.8.8):
|
||||
dependencies:
|
||||
eslint: 7.32.0
|
||||
prettier: 2.8.8
|
||||
prettier-linter-helpers: 1.0.0
|
||||
optionalDependencies:
|
||||
eslint-config-prettier: 8.10.0(eslint@8.57.0)
|
||||
eslint-config-prettier: 8.10.0(eslint@7.32.0)
|
||||
|
||||
eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@8.57.0)(prettier@2.8.8):
|
||||
dependencies:
|
||||
|
@ -24489,7 +24492,7 @@ snapshots:
|
|||
eslint: 7.32.0
|
||||
eslint-config-prettier: 8.10.0(eslint@7.32.0)
|
||||
eslint-plugin-node: 11.1.0(eslint@7.32.0)
|
||||
eslint-plugin-prettier: 3.4.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@7.32.0)(prettier@2.8.8)
|
||||
eslint-plugin-prettier: 3.4.1(eslint-config-prettier@8.10.0(eslint@7.32.0))(eslint@7.32.0)(prettier@2.8.8)
|
||||
execa: 5.1.1
|
||||
inquirer: 7.3.3
|
||||
json5: 2.2.3
|
||||
|
@ -27988,14 +27991,6 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
vite-plugin-dynamic-base@1.1.0(vite@5.4.14(@types/node@18.19.80)(less@4.2.2)(terser@5.39.0)):
|
||||
dependencies:
|
||||
'@swc/core': 1.11.22
|
||||
node-html-parser: 5.4.2
|
||||
vite: 5.4.14(@types/node@18.19.80)(less@4.2.2)(terser@5.39.0)
|
||||
transitivePeerDependencies:
|
||||
- '@swc/helpers'
|
||||
|
||||
vite-plugin-html@3.2.2(vite@5.4.14(@types/node@18.19.80)(less@4.2.2)(terser@5.39.0)):
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 4.2.1
|
||||
|
@ -28348,6 +28343,8 @@ snapshots:
|
|||
siginfo: 2.0.0
|
||||
stackback: 0.0.2
|
||||
|
||||
why-is-node-running@3.2.2: {}
|
||||
|
||||
wide-align@1.1.5:
|
||||
dependencies:
|
||||
string-width: 4.2.3
|
||||
|
|
Loading…
Reference in New Issue