mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
chore: 支持手动上传证书并部署
This commit is contained in:
7
packages/core/acme-client/.prettierrc
Normal file
7
packages/core/acme-client/.prettierrc
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"printWidth": 220,
|
||||
"bracketSpacing": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "es5",
|
||||
"arrowParens": "avoid"
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/ban-ts-ignore": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
// "no-unused-expressions": "off",
|
||||
"max-len": [0, 160, 2, { "ignoreUrls": true }]
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off"
|
||||
}
|
||||
}
|
||||
|
||||
7
packages/core/basic/.prettierrc
Normal file
7
packages/core/basic/.prettierrc
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"printWidth": 220,
|
||||
"bracketSpacing": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "es5",
|
||||
"arrowParens": "avoid"
|
||||
}
|
||||
@@ -7,8 +7,8 @@ function sha256(data: string, digest: BinaryToTextEncoding = 'hex') {
|
||||
return crypto.createHash('sha256').update(data).digest(digest);
|
||||
}
|
||||
|
||||
function HmacSha256(data: string, key: string, digest: BinaryToTextEncoding = 'base64') {
|
||||
return crypto.createHmac('sha256', Buffer.from(key, 'base64')).update(data).digest(digest);
|
||||
function hmacSha256(data: string, digest: BinaryToTextEncoding = 'base64') {
|
||||
return crypto.createHmac('sha256', data).update(Buffer.alloc(0)).digest(digest);
|
||||
}
|
||||
|
||||
function base64(data: string) {
|
||||
@@ -18,5 +18,5 @@ export const hashUtils = {
|
||||
md5,
|
||||
sha256,
|
||||
base64,
|
||||
HmacSha256,
|
||||
hmacSha256,
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/ban-ts-ignore": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
// "no-unused-expressions": "off",
|
||||
"max-len": [0, 160, 2, { "ignoreUrls": true }]
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
{
|
||||
"printWidth": 160
|
||||
"printWidth": 220,
|
||||
"bracketSpacing": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "es5",
|
||||
"arrowParens": "avoid"
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import { createAxiosService, hashUtils, HttpRequestConfig, ILogger, logger, util
|
||||
import { IAccessService } from "../access/index.js";
|
||||
import { RegistryItem } from "../registry/index.js";
|
||||
import { Decorator } from "../decorator/index.js";
|
||||
import { ICnameProxyService, IEmailService, IPluginConfigService, IUrlService } from "../service/index.js";
|
||||
import { ICnameProxyService, IEmailService, IPluginConfigService, IServiceGetter, IUrlService } from "../service/index.js";
|
||||
import { FileStore } from "./file-store.js";
|
||||
import { cloneDeep, forEach, merge } from "lodash-es";
|
||||
import { INotificationService } from "../notification/index.js";
|
||||
@@ -33,7 +33,7 @@ export type ExecutorOptions = {
|
||||
user: UserInfo;
|
||||
baseURL?: string;
|
||||
sysInfo?: SysInfo;
|
||||
serviceGetter: (name: string) => any;
|
||||
serviceGetter: IServiceGetter;
|
||||
};
|
||||
|
||||
export class Executor {
|
||||
@@ -366,6 +366,7 @@ export class Executor {
|
||||
step,
|
||||
pipeline: this.pipeline,
|
||||
}),
|
||||
serviceGetter: this.options.serviceGetter,
|
||||
};
|
||||
instance.setCtx(taskCtx);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Registrable } from "../registry/index.js";
|
||||
import { FileItem, FormItemProps, Pipeline, Runnable, Step } from "../dt/index.js";
|
||||
import { FileStore } from "../core/file-store.js";
|
||||
import { IAccessService } from "../access/index.js";
|
||||
import { ICnameProxyService, IEmailService, IUrlService } from "../service/index.js";
|
||||
import { ICnameProxyService, IEmailService, IServiceGetter, IUrlService } from "../service/index.js";
|
||||
import { CancelError, IContext, RunHistory, RunnableCollection } from "../core/index.js";
|
||||
import { HttpRequestConfig, ILogger, logger, utils } from "@certd/basic";
|
||||
import { HttpClient } from "@certd/basic";
|
||||
@@ -116,7 +116,7 @@ export type TaskInstanceContext = {
|
||||
emitter: TaskEmitter;
|
||||
|
||||
//service 容器
|
||||
serviceContainer?: Record<string, any>;
|
||||
serviceGetter?: IServiceGetter;
|
||||
};
|
||||
|
||||
export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
@@ -224,7 +224,7 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
|
||||
getStepFromPipeline(stepId: string) {
|
||||
let found: any = null;
|
||||
RunnableCollection.each(this.ctx.pipeline.stages, (step) => {
|
||||
RunnableCollection.each(this.ctx.pipeline.stages, step => {
|
||||
if (step.id === stepId) {
|
||||
found = step;
|
||||
return;
|
||||
|
||||
@@ -3,3 +3,6 @@ export * from "./cname.js";
|
||||
export * from "./config.js";
|
||||
export * from "./url.js";
|
||||
export * from "./emit.js";
|
||||
export type IServiceGetter = {
|
||||
get: (name: string) => Promise<any>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user