mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
chore: 修复metadata 插件加载失败的问题
This commit is contained in:
@@ -46,27 +46,27 @@
|
|||||||
| 42.| **UCloud授权** | 优刻得授权 |
|
| 42.| **UCloud授权** | 优刻得授权 |
|
||||||
| 43.| **FTP授权** | |
|
| 43.| **FTP授权** | |
|
||||||
| 44.| **s3/minio授权** | S3/minio oss授权 |
|
| 44.| **s3/minio授权** | S3/minio oss授权 |
|
||||||
| 45.| **EAB授权** | ZeroSSL证书申请需要EAB授权 |
|
| 45.| **宝塔云WAF授权** | 用于连接和管理宝塔云WAF服务的授权配置 |
|
||||||
| 46.| **google cloud** | 谷歌云授权 |
|
| 46.| **易盾DCDN授权** | https://user.yiduncdn.com |
|
||||||
| 47.| **宝塔云WAF授权** | 用于连接和管理宝塔云WAF服务的授权配置 |
|
| 47.| **易盾rcdn授权** | 易盾CDN,每月免费30G,[注册即领](https://rhcdn.yiduncdn.com/register?code=8mn536rrzfbf8) |
|
||||||
| 48.| **易盾DCDN授权** | https://user.yiduncdn.com |
|
| 48.| **易发云短信** | sms.yfyidc.cn/ |
|
||||||
| 49.| **易盾rcdn授权** | 易盾CDN,每月免费30G,[注册即领](https://rhcdn.yiduncdn.com/register?code=8mn536rrzfbf8) |
|
| 49.| **cdnfly授权** | |
|
||||||
| 50.| **易发云短信** | sms.yfyidc.cn/ |
|
| 50.| **群晖登录授权** | |
|
||||||
| 51.| **cdnfly授权** | |
|
| 51.| **k8s授权** | |
|
||||||
| 52.| **群晖登录授权** | |
|
| 52.| **1panel授权** | 账号和密码 |
|
||||||
| 53.| **k8s授权** | |
|
| 53.| **LeCDN授权** | |
|
||||||
| 54.| **1panel授权** | 账号和密码 |
|
| 54.| **白山云授权** | |
|
||||||
| 55.| **LeCDN授权** | |
|
| 55.| **plesk授权** | |
|
||||||
| 56.| **白山云授权** | |
|
| 56.| **易支付** | |
|
||||||
| 57.| **plesk授权** | |
|
| 57.| **支付宝** | |
|
||||||
| 58.| **易支付** | |
|
| 58.| **微信支付** | |
|
||||||
| 59.| **支付宝** | |
|
| 59.| **长亭雷池授权** | |
|
||||||
| 60.| **微信支付** | |
|
| 60.| **lucky** | |
|
||||||
| 61.| **长亭雷池授权** | |
|
| 61.| **括彩云cdn授权** | 括彩云CDN,每月免费30G,[注册即领](https://kuocaicdn.com/register?code=8mn536rrzfbf8) |
|
||||||
| 62.| **lucky** | |
|
| 62.| **uniCloud** | unicloud授权 |
|
||||||
| 63.| **括彩云cdn授权** | 括彩云CDN,每月免费30G,[注册即领](https://kuocaicdn.com/register?code=8mn536rrzfbf8) |
|
| 63.| **猫云授权** | |
|
||||||
| 64.| **uniCloud** | unicloud授权 |
|
| 64.| **EAB授权** | ZeroSSL证书申请需要EAB授权 |
|
||||||
| 65.| **猫云授权** | |
|
| 65.| **google cloud** | 谷歌云授权 |
|
||||||
| 66.| **雨云授权** | https://app.rainyun.com/ |
|
| 66.| **雨云授权** | https://app.rainyun.com/ |
|
||||||
| 67.| **GoEdge授权** | |
|
| 67.| **GoEdge授权** | |
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const customFileDetector = new DirectoryFileDetector({
|
|||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
// 加载框架并执行
|
// 加载框架并执行
|
||||||
await Bootstrap.configure({
|
await Bootstrap.configure({
|
||||||
|
ignore: ["**/plugins/**","/plugins/","plugins","dist/plugins","/dist/plugins","dist\\plugins","dist/plugins"],
|
||||||
moduleDetector: customFileDetector,
|
moduleDetector: customFileDetector,
|
||||||
}).run();
|
}).run();
|
||||||
// 获取依赖注入容器
|
// 获取依赖注入容器
|
||||||
|
|||||||
+3
-1
@@ -1,2 +1,4 @@
|
|||||||
import { Bootstrap } from '@midwayjs/bootstrap';
|
import { Bootstrap } from '@midwayjs/bootstrap';
|
||||||
await Bootstrap.run();
|
await Bootstrap.configure({
|
||||||
|
ignore: ["**/plugins/**","/plugins/","plugins","dist/plugins","/dist/plugins","dist\\plugins"]
|
||||||
|
}).run();
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ export default async function loadModules(dir) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const content = fs.readFileSync(file, 'utf8')
|
const content = fs.readFileSync(file, 'utf8')
|
||||||
|
if(content.includes(" abstract ")){
|
||||||
|
continue
|
||||||
|
}
|
||||||
const lines = content.split('\n')
|
const lines = content.split('\n')
|
||||||
let allExport = true
|
let allExport = true
|
||||||
for (let line of lines) {
|
for (let line of lines) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"start": "cross-env NODE_ENV=production node --optimize-for-size ./bootstrap.js",
|
"start": "cross-env NODE_ENV=production node --optimize-for-size ./bootstrap.js",
|
||||||
"dev-start": "cross-env NODE_ENV=dev & mwtsc --watch --run @midwayjs/mock/app",
|
"dev-start": "cross-env NODE_ENV=dev & mwtsc --watch --run @midwayjs/mock/app",
|
||||||
"dc": "cd ../../../ && pnpm run dev",
|
"dc": "cd ../../../ && pnpm run dev",
|
||||||
"dev": "cross-env NODE_ENV=local & pnpm run dev-start",
|
"dev": "pnpm run dev-start",
|
||||||
"dev-commlocal": "cross-env NODE_ENV=dev-commlocal mwtsc --watch --run @midwayjs/mock/app",
|
"dev-commlocal": "cross-env NODE_ENV=dev-commlocal mwtsc --watch --run @midwayjs/mock/app",
|
||||||
"dev-commpro": "cross-env NODE_ENV=dev-commpro mwtsc --watch --run @midwayjs/mock/app",
|
"dev-commpro": "cross-env NODE_ENV=dev-commpro mwtsc --watch --run @midwayjs/mock/app",
|
||||||
"dev-pg": "cross-env NODE_ENV=dev-pg mwtsc --watch --run @midwayjs/mock/app",
|
"dev-pg": "cross-env NODE_ENV=dev-pg mwtsc --watch --run @midwayjs/mock/app",
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ export class PluginService extends BaseService<PluginEntity> {
|
|||||||
const scriptFilePath = item.scriptFilePath;
|
const scriptFilePath = item.scriptFilePath;
|
||||||
const res = await import((`${scriptFilePath}`))
|
const res = await import((`${scriptFilePath}`))
|
||||||
const classNames = Object.keys(res)
|
const classNames = Object.keys(res)
|
||||||
return res[classNames[0]]
|
return res[classNames[classNames.length - 1]]
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPluginClassFromDb(pluginName: string) {
|
async getPluginClassFromDb(pluginName: string) {
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
import { IAccessService } from '@certd/pipeline';
|
import { IAccessService } from '@certd/pipeline';
|
||||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||||
import { AliesaAccess, AliyunAccess, AliyunClientV2 } from '../../plugin-lib/aliyun/index.js';
|
import { AliesaAccess, AliyunAccess } from '../../plugin-lib/aliyun/index.js';
|
||||||
|
import { AliyunClientV2 } from '../../plugin-lib/aliyun/lib/aliyun-client-v2.js';
|
||||||
|
|
||||||
|
|
||||||
@IsDnsProvider({
|
@IsDnsProvider({
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import {
|
|||||||
createCertDomainGetterInputDefine,
|
createCertDomainGetterInputDefine,
|
||||||
createRemoteSelectInputDefine
|
createRemoteSelectInputDefine
|
||||||
} from "@certd/plugin-lib";
|
} from "@certd/plugin-lib";
|
||||||
import { AliyunAccess, AliyunClientV2 } from "../../../plugin-lib/aliyun/access/index.js";
|
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
|
||||||
import { AliyunClient, AliyunSslClient } from "../../../plugin-lib/aliyun/lib/index.js";
|
import { AliyunClient, AliyunSslClient } from "../../../plugin-lib/aliyun/lib/index.js";
|
||||||
|
import { AliyunClientV2 } from "../../../plugin-lib/aliyun/lib/aliyun-client-v2.js";
|
||||||
|
|
||||||
@IsTaskPlugin({
|
@IsTaskPlugin({
|
||||||
name: "AliyunDeployCertToALB",
|
name: "AliyunDeployCertToALB",
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import {
|
|||||||
createCertDomainGetterInputDefine,
|
createCertDomainGetterInputDefine,
|
||||||
createRemoteSelectInputDefine
|
createRemoteSelectInputDefine
|
||||||
} from "@certd/plugin-lib";
|
} from "@certd/plugin-lib";
|
||||||
import { AliyunAccess, AliyunClientV2 } from "../../../plugin-lib/aliyun/access/index.js";
|
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
|
||||||
import { AliyunSslClient } from "../../../plugin-lib/aliyun/lib/ssl-client.js";
|
import { AliyunSslClient } from "../../../plugin-lib/aliyun/lib/ssl-client.js";
|
||||||
|
import { AliyunClientV2 } from "../../../plugin-lib/aliyun/lib/aliyun-client-v2.js";
|
||||||
|
|
||||||
@IsTaskPlugin({
|
@IsTaskPlugin({
|
||||||
name: "AliyunDeployCertToESA",
|
name: "AliyunDeployCertToESA",
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ import {
|
|||||||
createRemoteSelectInputDefine
|
createRemoteSelectInputDefine
|
||||||
} from "@certd/plugin-lib";
|
} from "@certd/plugin-lib";
|
||||||
import { CertApplyPluginNames} from '@certd/plugin-cert';
|
import { CertApplyPluginNames} from '@certd/plugin-cert';
|
||||||
import { AliyunAccess, AliyunClientV2 } from "../../../plugin-lib/aliyun/access/index.js";
|
import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js";
|
||||||
import { AliyunClient, AliyunSslClient } from "../../../plugin-lib/aliyun/lib/index.js";
|
import { AliyunClient, AliyunSslClient } from "../../../plugin-lib/aliyun/lib/index.js";
|
||||||
|
import { AliyunClientV2 } from '../../../plugin-lib/aliyun/lib/aliyun-client-v2.js';
|
||||||
@IsTaskPlugin({
|
@IsTaskPlugin({
|
||||||
name: 'AliyunDeployCertToNLB',
|
name: 'AliyunDeployCertToNLB',
|
||||||
title: '阿里云-部署至NLB(网络负载均衡)',
|
title: '阿里云-部署至NLB(网络负载均衡)',
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { CancelError, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from
|
|||||||
import { utils } from "@certd/basic";
|
import { utils } from "@certd/basic";
|
||||||
|
|
||||||
import { AcmeService, DomainsVerifyPlan, DomainVerifyPlan, PrivateKeyType, SSLProvider } from "./acme.js";
|
import { AcmeService, DomainsVerifyPlan, DomainVerifyPlan, PrivateKeyType, SSLProvider } from "./acme.js";
|
||||||
import * as _ from "lodash-es";
|
|
||||||
import { createDnsProvider, DnsProviderContext, DnsVerifier, DomainVerifiers, HttpVerifier, IDnsProvider, IDomainVerifierGetter, ISubDomainsGetter } from "@certd/plugin-lib";
|
import { createDnsProvider, DnsProviderContext, DnsVerifier, DomainVerifiers, HttpVerifier, IDnsProvider, IDomainVerifierGetter, ISubDomainsGetter } from "@certd/plugin-lib";
|
||||||
import { CertReader } from "@certd/plugin-lib";
|
import { CertReader } from "@certd/plugin-lib";
|
||||||
import { CertApplyBasePlugin } from "./base.js";
|
import { CertApplyBasePlugin } from "./base.js";
|
||||||
@@ -10,6 +9,7 @@ import { GoogleClient } from "../../libs/google.js";
|
|||||||
import { EabAccess } from "../../access/index.js";
|
import { EabAccess } from "../../access/index.js";
|
||||||
import { DomainParser } from "@certd/plugin-lib";
|
import { DomainParser } from "@certd/plugin-lib";
|
||||||
import { ossClientFactory } from "../../../plugin-lib/oss/factory.js";
|
import { ossClientFactory } from "../../../plugin-lib/oss/factory.js";
|
||||||
|
import { merge } from "lodash-es";
|
||||||
|
|
||||||
export * from "./base.js";
|
export * from "./base.js";
|
||||||
export type CnameRecordInput = {
|
export type CnameRecordInput = {
|
||||||
@@ -472,7 +472,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
|||||||
}
|
}
|
||||||
const domains = this["domains"];
|
const domains = this["domains"];
|
||||||
|
|
||||||
const csrInfo = _.merge(
|
const csrInfo = merge(
|
||||||
{
|
{
|
||||||
// country: "CN",
|
// country: "CN",
|
||||||
// state: "GuangDong",
|
// state: "GuangDong",
|
||||||
|
|||||||
@@ -1,94 +1,5 @@
|
|||||||
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
|
import { AccessInput, BaseAccess, IsAccess } from "@certd/pipeline";
|
||||||
import { ILogger } from "@certd/basic";
|
import { AliyunClientV2 } from "../lib/aliyun-client-v2.js";
|
||||||
export type AliyunClientV2Req = {
|
|
||||||
action: string;
|
|
||||||
version: string;
|
|
||||||
protocol?: "HTTPS";
|
|
||||||
// 接口 HTTP 方法
|
|
||||||
method?: "GET" | "POST";
|
|
||||||
authType?: "AK";
|
|
||||||
style?: "RPC" | "ROA";
|
|
||||||
// 接口 PATH
|
|
||||||
pathname?: string;
|
|
||||||
|
|
||||||
data?: any;
|
|
||||||
};
|
|
||||||
export class AliyunClientV2 {
|
|
||||||
access: AliyunAccess;
|
|
||||||
logger: ILogger;
|
|
||||||
endpoint: string;
|
|
||||||
|
|
||||||
client: any;
|
|
||||||
constructor(opts: { access: AliyunAccess; logger: ILogger; endpoint: string }) {
|
|
||||||
this.access = opts.access;
|
|
||||||
this.logger = opts.logger;
|
|
||||||
this.endpoint = opts.endpoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getClient() {
|
|
||||||
if (this.client) {
|
|
||||||
return this.client;
|
|
||||||
}
|
|
||||||
const $OpenApi = await import("@alicloud/openapi-client");
|
|
||||||
// const Credential = await import("@alicloud/credentials");
|
|
||||||
// //@ts-ignore
|
|
||||||
// const credential = new Credential.default.default({
|
|
||||||
//
|
|
||||||
// type: "access_key",
|
|
||||||
// });
|
|
||||||
const config = new $OpenApi.Config({
|
|
||||||
accessKeyId: this.access.accessKeyId,
|
|
||||||
accessKeySecret: this.access.accessKeySecret,
|
|
||||||
});
|
|
||||||
// Endpoint 请参考 https://api.aliyun.com/product/FC
|
|
||||||
// config.endpoint = `esa.${this.regionId}.aliyuncs.com`;
|
|
||||||
config.endpoint = this.endpoint;
|
|
||||||
//@ts-ignore
|
|
||||||
this.client = new $OpenApi.default.default(config);
|
|
||||||
return this.client;
|
|
||||||
}
|
|
||||||
|
|
||||||
async doRequest(req: AliyunClientV2Req) {
|
|
||||||
const client = await this.getClient();
|
|
||||||
|
|
||||||
const $OpenApi = await import("@alicloud/openapi-client");
|
|
||||||
const $Util = await import("@alicloud/tea-util");
|
|
||||||
const OpenApiUtil = await import("@alicloud/openapi-util");
|
|
||||||
const params = new $OpenApi.Params({
|
|
||||||
// 接口名称
|
|
||||||
action: req.action,
|
|
||||||
// 接口版本
|
|
||||||
version: req.version,
|
|
||||||
// 接口协议
|
|
||||||
protocol: "HTTPS",
|
|
||||||
// 接口 HTTP 方法
|
|
||||||
method: req.method ?? "POST",
|
|
||||||
authType: req.authType ?? "AK",
|
|
||||||
style: req.style ?? "RPC",
|
|
||||||
// 接口 PATH
|
|
||||||
pathname: req.pathname ?? `/`,
|
|
||||||
// 接口请求体内容格式
|
|
||||||
reqBodyType: "json",
|
|
||||||
// 接口响应体内容格式
|
|
||||||
bodyType: "json",
|
|
||||||
});
|
|
||||||
|
|
||||||
if (req.data?.query) {
|
|
||||||
//@ts-ignore
|
|
||||||
req.data.query = OpenApiUtil.default.default.query(req.data.query);
|
|
||||||
}
|
|
||||||
const runtime = new $Util.RuntimeOptions({});
|
|
||||||
const request = new $OpenApi.OpenApiRequest(req.data);
|
|
||||||
// 复制代码运行请自行打印 API 的返回值
|
|
||||||
// 返回值实际为 Map 类型,可从 Map 中获得三类数据:响应体 body、响应头 headers、HTTP 返回的状态码 statusCode。
|
|
||||||
const res = await client.callApi(params, request, runtime);
|
|
||||||
/**
|
|
||||||
* res?.body?.
|
|
||||||
*/
|
|
||||||
return res?.body;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@IsAccess({
|
@IsAccess({
|
||||||
name: "aliyun",
|
name: "aliyun",
|
||||||
title: "阿里云授权",
|
title: "阿里云授权",
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
import { ILogger } from "@certd/basic";
|
||||||
|
import { AliyunAccess } from "../access/aliyun-access.js";
|
||||||
|
|
||||||
|
export type AliyunClientV2Req = {
|
||||||
|
action: string;
|
||||||
|
version: string;
|
||||||
|
protocol?: "HTTPS";
|
||||||
|
// 接口 HTTP 方法
|
||||||
|
method?: "GET" | "POST";
|
||||||
|
authType?: "AK";
|
||||||
|
style?: "RPC" | "ROA";
|
||||||
|
// 接口 PATH
|
||||||
|
pathname?: string;
|
||||||
|
|
||||||
|
data?: any;
|
||||||
|
};
|
||||||
|
export class AliyunClientV2 {
|
||||||
|
access: AliyunAccess;
|
||||||
|
logger: ILogger;
|
||||||
|
endpoint: string;
|
||||||
|
|
||||||
|
client: any;
|
||||||
|
constructor(opts: { access: AliyunAccess; logger: ILogger; endpoint: string }) {
|
||||||
|
this.access = opts.access;
|
||||||
|
this.logger = opts.logger;
|
||||||
|
this.endpoint = opts.endpoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
async getClient() {
|
||||||
|
if (this.client) {
|
||||||
|
return this.client;
|
||||||
|
}
|
||||||
|
const $OpenApi = await import("@alicloud/openapi-client");
|
||||||
|
// const Credential = await import("@alicloud/credentials");
|
||||||
|
// //@ts-ignore
|
||||||
|
// const credential = new Credential.default.default({
|
||||||
|
//
|
||||||
|
// type: "access_key",
|
||||||
|
// });
|
||||||
|
const config = new $OpenApi.Config({
|
||||||
|
accessKeyId: this.access.accessKeyId,
|
||||||
|
accessKeySecret: this.access.accessKeySecret,
|
||||||
|
});
|
||||||
|
// Endpoint 请参考 https://api.aliyun.com/product/FC
|
||||||
|
// config.endpoint = `esa.${this.regionId}.aliyuncs.com`;
|
||||||
|
config.endpoint = this.endpoint;
|
||||||
|
//@ts-ignore
|
||||||
|
this.client = new $OpenApi.default.default(config);
|
||||||
|
return this.client;
|
||||||
|
}
|
||||||
|
|
||||||
|
async doRequest(req: AliyunClientV2Req) {
|
||||||
|
const client = await this.getClient();
|
||||||
|
|
||||||
|
const $OpenApi = await import("@alicloud/openapi-client");
|
||||||
|
const $Util = await import("@alicloud/tea-util");
|
||||||
|
const OpenApiUtil = await import("@alicloud/openapi-util");
|
||||||
|
const params = new $OpenApi.Params({
|
||||||
|
// 接口名称
|
||||||
|
action: req.action,
|
||||||
|
// 接口版本
|
||||||
|
version: req.version,
|
||||||
|
// 接口协议
|
||||||
|
protocol: "HTTPS",
|
||||||
|
// 接口 HTTP 方法
|
||||||
|
method: req.method ?? "POST",
|
||||||
|
authType: req.authType ?? "AK",
|
||||||
|
style: req.style ?? "RPC",
|
||||||
|
// 接口 PATH
|
||||||
|
pathname: req.pathname ?? `/`,
|
||||||
|
// 接口请求体内容格式
|
||||||
|
reqBodyType: "json",
|
||||||
|
// 接口响应体内容格式
|
||||||
|
bodyType: "json",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (req.data?.query) {
|
||||||
|
//@ts-ignore
|
||||||
|
req.data.query = OpenApiUtil.default.default.query(req.data.query);
|
||||||
|
}
|
||||||
|
const runtime = new $Util.RuntimeOptions({});
|
||||||
|
const request = new $OpenApi.OpenApiRequest(req.data);
|
||||||
|
// 复制代码运行请自行打印 API 的返回值
|
||||||
|
// 返回值实际为 Map 类型,可从 Map 中获得三类数据:响应体 body、响应头 headers、HTTP 返回的状态码 statusCode。
|
||||||
|
const res = await client.callApi(params, request, runtime);
|
||||||
|
/**
|
||||||
|
* res?.body?.
|
||||||
|
*/
|
||||||
|
return res?.body;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user