mirror of
https://github.com/certd/certd.git
synced 2026-04-14 20:40:53 +08:00
chore: 移除 autowire
This commit is contained in:
@@ -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 = [];
|
||||
@@ -92,4 +92,7 @@ for (const key in modules) {
|
||||
}
|
||||
}
|
||||
}
|
||||
process.exit();
|
||||
// import why from 'why-is-node-running'
|
||||
// setTimeout(() => why(), 100); // 延迟打印原因
|
||||
|
||||
process.exit(-1)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -132,7 +132,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"
|
||||
|
||||
@@ -26,11 +26,11 @@ process.on('uncaughtException', error => {
|
||||
});
|
||||
|
||||
@Configuration({
|
||||
detectorOptions: {
|
||||
ignore: [
|
||||
'**/plugins/**'
|
||||
]
|
||||
},
|
||||
// detectorOptions: {
|
||||
// ignore: [
|
||||
// '**/plugins/**'
|
||||
// ]
|
||||
// },
|
||||
imports: [
|
||||
koa,
|
||||
orm,
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -12,7 +12,7 @@ export class AutoBLoadPlugins {
|
||||
@Init()
|
||||
async init() {
|
||||
logger.info('加载插件开始');
|
||||
await this.pluginService.registerFromLocal("./metadata")
|
||||
// await this.pluginService.registerFromLocal("./metadata")
|
||||
await import("../../plugins/index.js")
|
||||
await this.pluginService.registerFromDb()
|
||||
logger.info('加载插件完成');
|
||||
|
||||
@@ -297,7 +297,7 @@ export class PluginService extends BaseService<PluginEntity> {
|
||||
}
|
||||
//排序
|
||||
list = list.sort((a, b) => {
|
||||
return a.order??10 - b.order ??10;
|
||||
return (a.order??10) - (b.order ??10);
|
||||
});
|
||||
|
||||
for (const item of list) {
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
export * from '@certd/plugin-cert';
|
||||
export * from '@certd/plugin-plus';
|
||||
// export * from './plugin-aliyun/index.js';
|
||||
// export * from './plugin-tencent/index.js';
|
||||
// export * from './plugin-host/index.js';
|
||||
// export * from './plugin-huawei/index.js';
|
||||
// export * from './plugin-demo/index.js';
|
||||
// export * from './plugin-other/index.js';
|
||||
// export * from './plugin-west/index.js';
|
||||
// export * from './plugin-doge/index.js';
|
||||
// export * from './plugin-qiniu/index.js';
|
||||
// export * from './plugin-woai/index.js';
|
||||
// export * from './plugin-cachefly/index.js';
|
||||
// export * from './plugin-gcore/index.js';
|
||||
// export * from './plugin-qnap/index.js';
|
||||
// export * from './plugin-aws/index.js';
|
||||
// export * from './plugin-dnsla/index.js';
|
||||
// export * from './plugin-upyun/index.js';
|
||||
// export * from './plugin-volcengine/index.js'
|
||||
// export * from './plugin-jdcloud/index.js'
|
||||
// export * from './plugin-51dns/index.js'
|
||||
// export * from './plugin-notification/index.js'
|
||||
export * from './plugin-aliyun/index.js';
|
||||
export * from './plugin-tencent/index.js';
|
||||
export * from './plugin-host/index.js';
|
||||
export * from './plugin-huawei/index.js';
|
||||
export * from './plugin-demo/index.js';
|
||||
export * from './plugin-other/index.js';
|
||||
export * from './plugin-west/index.js';
|
||||
export * from './plugin-doge/index.js';
|
||||
export * from './plugin-qiniu/index.js';
|
||||
export * from './plugin-woai/index.js';
|
||||
export * from './plugin-cachefly/index.js';
|
||||
export * from './plugin-gcore/index.js';
|
||||
export * from './plugin-qnap/index.js';
|
||||
export * from './plugin-aws/index.js';
|
||||
export * from './plugin-dnsla/index.js';
|
||||
export * from './plugin-upyun/index.js';
|
||||
export * from './plugin-volcengine/index.js'
|
||||
export * from './plugin-jdcloud/index.js'
|
||||
export * from './plugin-51dns/index.js'
|
||||
export * from './plugin-notification/index.js'
|
||||
|
||||
@@ -16,6 +16,7 @@ export type Dns51Record = {
|
||||
icon: 'arcticons:dns-changer-3',
|
||||
// 这里是对应的 cloudflare的access类型名称
|
||||
accessType: '51dns',
|
||||
order:999,
|
||||
})
|
||||
export class Dns51DnsProvider extends AbstractDnsProvider<Dns51Record> {
|
||||
access!: Dns51Access;
|
||||
|
||||
@@ -8,6 +8,7 @@ import { AliyunAccess, AliyunClient } from '@certd/plugin-lib';
|
||||
desc: '阿里云DNS解析提供商',
|
||||
accessType: 'aliyun',
|
||||
icon: 'svg:icon-aliyun',
|
||||
order:0,
|
||||
})
|
||||
export class AliyunDnsProvider extends AbstractDnsProvider {
|
||||
client: any;
|
||||
|
||||
@@ -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,4 +1,3 @@
|
||||
|
||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||
import * as _ from 'lodash-es';
|
||||
import { DnspodAccess } from '../access/index.js';
|
||||
|
||||
@@ -16,7 +16,7 @@ export class VolcengineDnsProvider extends AbstractDnsProvider {
|
||||
|
||||
|
||||
async onInstance() {
|
||||
this.access = this.ctx.access
|
||||
this.access = this.ctx.access as VolcengineAccess
|
||||
this.client = new VolcengineDnsClient({
|
||||
access: this.access,
|
||||
logger: this.logger,
|
||||
|
||||
Reference in New Issue
Block a user