@certd/plugin-cert 1.22.7 → 1.22.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/access/eab-access.d.ts +4 -4
- package/dist/access/index.d.ts +1 -1
- package/dist/access/index.js +1 -1
- package/dist/bundle.js +1 -1
- package/dist/d/plugin/cert-plugin/acme.d.ts +2 -0
- package/dist/d/plugin/cert-plugin/index.d.ts +1 -0
- package/dist/dns-provider/api.d.ts +27 -27
- package/dist/dns-provider/base.d.ts +8 -8
- package/dist/dns-provider/base.js +6 -6
- package/dist/dns-provider/decorator.d.ts +3 -3
- package/dist/dns-provider/index.d.ts +4 -4
- package/dist/dns-provider/index.js +4 -4
- package/dist/dns-provider/registry.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/plugin/cert-plugin/acme.d.ts +58 -58
- package/dist/plugin/cert-plugin/base.d.ts +49 -49
- package/dist/plugin/cert-plugin/cert-reader.d.ts +16 -16
- package/dist/plugin/cert-plugin/cert-reader.js +45 -45
- package/dist/plugin/cert-plugin/index.d.ts +17 -17
- package/dist/plugin/cert-plugin/lego/dns.d.ts +1 -1
- package/dist/plugin/cert-plugin/lego/dns.js +1 -1
- package/dist/plugin/cert-plugin/lego/index.d.ts +17 -17
- package/dist/plugin/cert-plugin/lego.d.ts +16 -16
- package/dist/plugin/cert-plugin/lego.js +145 -153
- package/dist/plugin/index.d.ts +2 -2
- package/dist/plugin/index.js +2 -2
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/plugin-cert.mjs +0 -11786
- package/dist/plugin-cert.umd.js +0 -28
- package/stats.html +0 -6177
- package/test/user.secret.js +0 -7
- package/test/user.secret.ts +0 -4
|
@@ -13,12 +13,14 @@ export declare class AcmeService {
|
|
|
13
13
|
userContext: IContext;
|
|
14
14
|
logger: Logger;
|
|
15
15
|
sslProvider: SSLProvider;
|
|
16
|
+
skipLocalVerify: boolean;
|
|
16
17
|
eab?: ClientExternalAccountBindingOptions;
|
|
17
18
|
constructor(options: {
|
|
18
19
|
userContext: IContext;
|
|
19
20
|
logger: Logger;
|
|
20
21
|
sslProvider: SSLProvider;
|
|
21
22
|
eab?: ClientExternalAccountBindingOptions;
|
|
23
|
+
skipLocalVerify?: boolean;
|
|
22
24
|
});
|
|
23
25
|
getAccountConfig(email: string): Promise<any>;
|
|
24
26
|
buildAccountKey(email: string): string;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { HttpClient, IAccess, ILogger, Registrable } from "@certd/pipeline";
|
|
2
|
-
export type DnsProviderDefine = Registrable & {
|
|
3
|
-
accessType: string;
|
|
4
|
-
autowire?: {
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export type CreateRecordOptions = {
|
|
9
|
-
fullRecord: string;
|
|
10
|
-
type: string;
|
|
11
|
-
value: any;
|
|
12
|
-
domain: string;
|
|
13
|
-
};
|
|
14
|
-
export type RemoveRecordOptions<T> = CreateRecordOptions & {
|
|
15
|
-
record: T;
|
|
16
|
-
};
|
|
17
|
-
export type DnsProviderContext = {
|
|
18
|
-
access: IAccess;
|
|
19
|
-
logger: ILogger;
|
|
20
|
-
http: HttpClient;
|
|
21
|
-
};
|
|
22
|
-
export interface IDnsProvider<T = any> {
|
|
23
|
-
onInstance(): Promise<void>;
|
|
24
|
-
createRecord(options: CreateRecordOptions): Promise<T>;
|
|
25
|
-
removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
|
|
26
|
-
setCtx(ctx: DnsProviderContext): void;
|
|
27
|
-
}
|
|
1
|
+
import { HttpClient, IAccess, ILogger, Registrable } from "@certd/pipeline";
|
|
2
|
+
export type DnsProviderDefine = Registrable & {
|
|
3
|
+
accessType: string;
|
|
4
|
+
autowire?: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type CreateRecordOptions = {
|
|
9
|
+
fullRecord: string;
|
|
10
|
+
type: string;
|
|
11
|
+
value: any;
|
|
12
|
+
domain: string;
|
|
13
|
+
};
|
|
14
|
+
export type RemoveRecordOptions<T> = CreateRecordOptions & {
|
|
15
|
+
record: T;
|
|
16
|
+
};
|
|
17
|
+
export type DnsProviderContext = {
|
|
18
|
+
access: IAccess;
|
|
19
|
+
logger: ILogger;
|
|
20
|
+
http: HttpClient;
|
|
21
|
+
};
|
|
22
|
+
export interface IDnsProvider<T = any> {
|
|
23
|
+
onInstance(): Promise<void>;
|
|
24
|
+
createRecord(options: CreateRecordOptions): Promise<T>;
|
|
25
|
+
removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
|
|
26
|
+
setCtx(ctx: DnsProviderContext): void;
|
|
27
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CreateRecordOptions, DnsProviderContext, IDnsProvider, RemoveRecordOptions } from "./api.js";
|
|
2
|
-
export declare abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
|
|
3
|
-
ctx: DnsProviderContext;
|
|
4
|
-
setCtx(ctx: DnsProviderContext): void;
|
|
5
|
-
abstract createRecord(options: CreateRecordOptions): Promise<T>;
|
|
6
|
-
abstract onInstance(): Promise<void>;
|
|
7
|
-
abstract removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
|
|
8
|
-
}
|
|
1
|
+
import { CreateRecordOptions, DnsProviderContext, IDnsProvider, RemoveRecordOptions } from "./api.js";
|
|
2
|
+
export declare abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
|
|
3
|
+
ctx: DnsProviderContext;
|
|
4
|
+
setCtx(ctx: DnsProviderContext): void;
|
|
5
|
+
abstract createRecord(options: CreateRecordOptions): Promise<T>;
|
|
6
|
+
abstract onInstance(): Promise<void>;
|
|
7
|
+
abstract removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
|
|
8
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export class AbstractDnsProvider {
|
|
2
|
-
ctx;
|
|
3
|
-
setCtx(ctx) {
|
|
4
|
-
this.ctx = ctx;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
export class AbstractDnsProvider {
|
|
2
|
+
ctx;
|
|
3
|
+
setCtx(ctx) {
|
|
4
|
+
this.ctx = ctx;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kbnMtcHJvdmlkZXIvYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLE9BQWdCLG1CQUFtQjtJQUN2QyxHQUFHLENBQXNCO0lBRXpCLE1BQU0sQ0FBQyxHQUF1QjtRQUM1QixJQUFJLENBQUMsR0FBRyxHQUFHLEdBQUcsQ0FBQztJQUNqQixDQUFDO0NBT0YifQ==
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DnsProviderDefine } from "./api.js";
|
|
2
|
-
export declare const DNS_PROVIDER_CLASS_KEY = "pipeline:dns-provider";
|
|
3
|
-
export declare function IsDnsProvider(define: DnsProviderDefine): ClassDecorator;
|
|
1
|
+
import { DnsProviderDefine } from "./api.js";
|
|
2
|
+
export declare const DNS_PROVIDER_CLASS_KEY = "pipeline:dns-provider";
|
|
3
|
+
export declare function IsDnsProvider(define: DnsProviderDefine): ClassDecorator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./api.js";
|
|
2
|
-
export * from "./registry.js";
|
|
3
|
-
export * from "./decorator.js";
|
|
4
|
-
export * from "./base.js";
|
|
1
|
+
export * from "./api.js";
|
|
2
|
+
export * from "./registry.js";
|
|
3
|
+
export * from "./decorator.js";
|
|
4
|
+
export * from "./base.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./api.js";
|
|
2
|
-
export * from "./registry.js";
|
|
3
|
-
export * from "./decorator.js";
|
|
4
|
-
export * from "./base.js";
|
|
1
|
+
export * from "./api.js";
|
|
2
|
+
export * from "./registry.js";
|
|
3
|
+
export * from "./decorator.js";
|
|
4
|
+
export * from "./base.js";
|
|
5
5
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZG5zLXByb3ZpZGVyL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxXQUFXLENBQUMifQ==
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Registry } from "@certd/pipeline";
|
|
2
|
-
export declare const dnsProviderRegistry: Registry<unknown>;
|
|
1
|
+
import { Registry } from "@certd/pipeline";
|
|
2
|
+
export declare const dnsProviderRegistry: Registry<unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./plugin/index.js";
|
|
2
|
-
export * from "./dns-provider/index.js";
|
|
3
|
-
export * from "./access/index.js";
|
|
1
|
+
export * from "./plugin/index.js";
|
|
2
|
+
export * from "./dns-provider/index.js";
|
|
3
|
+
export * from "./access/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./plugin/index.js";
|
|
2
|
-
export * from "./dns-provider/index.js";
|
|
3
|
-
export * from "./access/index.js";
|
|
1
|
+
export * from "./plugin/index.js";
|
|
2
|
+
export * from "./dns-provider/index.js";
|
|
3
|
+
export * from "./access/index.js";
|
|
4
4
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsbUJBQW1CLENBQUMifQ==
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import * as acme from "@certd/acme-client";
|
|
2
|
-
import { Logger } from "log4js";
|
|
3
|
-
import { IContext } from "@certd/pipeline";
|
|
4
|
-
import { IDnsProvider } from "../../dns-provider/index.js";
|
|
5
|
-
import { ClientExternalAccountBindingOptions } from "@certd/acme-client";
|
|
6
|
-
export type CertInfo = {
|
|
7
|
-
crt: string;
|
|
8
|
-
key: string;
|
|
9
|
-
csr: string;
|
|
10
|
-
};
|
|
11
|
-
export type SSLProvider = "letsencrypt" | "buypass" | "zerossl";
|
|
12
|
-
type AcmeServiceOptions = {
|
|
13
|
-
userContext: IContext;
|
|
14
|
-
logger: Logger;
|
|
15
|
-
sslProvider: SSLProvider;
|
|
16
|
-
eab?: ClientExternalAccountBindingOptions;
|
|
17
|
-
skipLocalVerify?: boolean;
|
|
18
|
-
useMappingProxy?: boolean;
|
|
19
|
-
};
|
|
20
|
-
export declare class AcmeService {
|
|
21
|
-
options: AcmeServiceOptions;
|
|
22
|
-
userContext: IContext;
|
|
23
|
-
logger: Logger;
|
|
24
|
-
sslProvider: SSLProvider;
|
|
25
|
-
skipLocalVerify: boolean;
|
|
26
|
-
eab?: ClientExternalAccountBindingOptions;
|
|
27
|
-
constructor(options: AcmeServiceOptions);
|
|
28
|
-
getAccountConfig(email: string): Promise<any>;
|
|
29
|
-
buildAccountKey(email: string): string;
|
|
30
|
-
saveAccountConfig(email: string, conf: any): Promise<void>;
|
|
31
|
-
getAcmeClient(email: string, isTest?: boolean): Promise<acme.Client>;
|
|
32
|
-
createNewKey(): Promise<string>;
|
|
33
|
-
parseDomain(fullDomain: string): string;
|
|
34
|
-
challengeCreateFn(authz: any, challenge: any, keyAuthorization: string, dnsProvider: IDnsProvider): Promise<any>;
|
|
35
|
-
/**
|
|
36
|
-
* Function used to remove an ACME challenge response
|
|
37
|
-
*
|
|
38
|
-
* @param {object} authz Authorization object
|
|
39
|
-
* @param {object} challenge Selected challenge
|
|
40
|
-
* @param {string} keyAuthorization Authorization key
|
|
41
|
-
* @param recordItem challengeCreateFn create record item
|
|
42
|
-
* @param dnsProvider dnsProvider
|
|
43
|
-
* @returns {Promise}
|
|
44
|
-
*/
|
|
45
|
-
challengeRemoveFn(authz: any, challenge: any, keyAuthorization: string, recordItem: any, dnsProvider: IDnsProvider): Promise<void>;
|
|
46
|
-
order(options: {
|
|
47
|
-
email: string;
|
|
48
|
-
domains: string | string[];
|
|
49
|
-
dnsProvider: any;
|
|
50
|
-
csrInfo: any;
|
|
51
|
-
isTest?: boolean;
|
|
52
|
-
}): Promise<CertInfo>;
|
|
53
|
-
buildCommonNameByDomains(domains: string | string[]): {
|
|
54
|
-
commonName: string;
|
|
55
|
-
altNames: string[] | undefined;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
export {};
|
|
1
|
+
import * as acme from "@certd/acme-client";
|
|
2
|
+
import { Logger } from "log4js";
|
|
3
|
+
import { IContext } from "@certd/pipeline";
|
|
4
|
+
import { IDnsProvider } from "../../dns-provider/index.js";
|
|
5
|
+
import { ClientExternalAccountBindingOptions } from "@certd/acme-client";
|
|
6
|
+
export type CertInfo = {
|
|
7
|
+
crt: string;
|
|
8
|
+
key: string;
|
|
9
|
+
csr: string;
|
|
10
|
+
};
|
|
11
|
+
export type SSLProvider = "letsencrypt" | "buypass" | "zerossl";
|
|
12
|
+
type AcmeServiceOptions = {
|
|
13
|
+
userContext: IContext;
|
|
14
|
+
logger: Logger;
|
|
15
|
+
sslProvider: SSLProvider;
|
|
16
|
+
eab?: ClientExternalAccountBindingOptions;
|
|
17
|
+
skipLocalVerify?: boolean;
|
|
18
|
+
useMappingProxy?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare class AcmeService {
|
|
21
|
+
options: AcmeServiceOptions;
|
|
22
|
+
userContext: IContext;
|
|
23
|
+
logger: Logger;
|
|
24
|
+
sslProvider: SSLProvider;
|
|
25
|
+
skipLocalVerify: boolean;
|
|
26
|
+
eab?: ClientExternalAccountBindingOptions;
|
|
27
|
+
constructor(options: AcmeServiceOptions);
|
|
28
|
+
getAccountConfig(email: string): Promise<any>;
|
|
29
|
+
buildAccountKey(email: string): string;
|
|
30
|
+
saveAccountConfig(email: string, conf: any): Promise<void>;
|
|
31
|
+
getAcmeClient(email: string, isTest?: boolean): Promise<acme.Client>;
|
|
32
|
+
createNewKey(): Promise<string>;
|
|
33
|
+
parseDomain(fullDomain: string): string;
|
|
34
|
+
challengeCreateFn(authz: any, challenge: any, keyAuthorization: string, dnsProvider: IDnsProvider): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
* Function used to remove an ACME challenge response
|
|
37
|
+
*
|
|
38
|
+
* @param {object} authz Authorization object
|
|
39
|
+
* @param {object} challenge Selected challenge
|
|
40
|
+
* @param {string} keyAuthorization Authorization key
|
|
41
|
+
* @param recordItem challengeCreateFn create record item
|
|
42
|
+
* @param dnsProvider dnsProvider
|
|
43
|
+
* @returns {Promise}
|
|
44
|
+
*/
|
|
45
|
+
challengeRemoveFn(authz: any, challenge: any, keyAuthorization: string, recordItem: any, dnsProvider: IDnsProvider): Promise<void>;
|
|
46
|
+
order(options: {
|
|
47
|
+
email: string;
|
|
48
|
+
domains: string | string[];
|
|
49
|
+
dnsProvider: any;
|
|
50
|
+
csrInfo: any;
|
|
51
|
+
isTest?: boolean;
|
|
52
|
+
}): Promise<CertInfo>;
|
|
53
|
+
buildCommonNameByDomains(domains: string | string[]): {
|
|
54
|
+
commonName: string;
|
|
55
|
+
altNames: string[] | undefined;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { AbstractTaskPlugin, HttpClient, IAccessService, IContext, Step } from "@certd/pipeline";
|
|
2
|
-
import type { CertInfo } from "./acme.js";
|
|
3
|
-
import { Logger } from "log4js";
|
|
4
|
-
import { CertReader } from "./cert-reader.js";
|
|
5
|
-
export { CertReader };
|
|
6
|
-
export type { CertInfo };
|
|
7
|
-
export declare abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
|
|
8
|
-
domains: string[];
|
|
9
|
-
email: string;
|
|
10
|
-
renewDays: number;
|
|
11
|
-
forceUpdate: string;
|
|
12
|
-
successNotify: boolean;
|
|
13
|
-
intro: string;
|
|
14
|
-
csrInfo: string;
|
|
15
|
-
logger: Logger;
|
|
16
|
-
userContext: IContext;
|
|
17
|
-
accessService: IAccessService;
|
|
18
|
-
http: HttpClient;
|
|
19
|
-
lastStatus: Step;
|
|
20
|
-
cert?: CertInfo;
|
|
21
|
-
onInstance(): Promise<void>;
|
|
22
|
-
abstract onInit(): Promise<void>;
|
|
23
|
-
abstract doCertApply(): Promise<any>;
|
|
24
|
-
execute(): Promise<void>;
|
|
25
|
-
output(certReader: CertReader, isNew: boolean): Promise<void>;
|
|
26
|
-
zipCert(cert: CertInfo, applyTime: string): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* 是否更新证书
|
|
29
|
-
*/
|
|
30
|
-
condition(): Promise<CertReader>;
|
|
31
|
-
formatCert(pem: string): string;
|
|
32
|
-
formatCerts(cert: {
|
|
33
|
-
crt: string;
|
|
34
|
-
key: string;
|
|
35
|
-
csr: string;
|
|
36
|
-
}): CertInfo;
|
|
37
|
-
readLastCert(): Promise<CertReader | undefined>;
|
|
38
|
-
/**
|
|
39
|
-
* 检查是否过期,默认提前20天
|
|
40
|
-
* @param expires
|
|
41
|
-
* @param maxDays
|
|
42
|
-
* @returns {boolean}
|
|
43
|
-
*/
|
|
44
|
-
isWillExpire(expires: number, maxDays?: number): {
|
|
45
|
-
isWillExpire: boolean;
|
|
46
|
-
leftDays: number;
|
|
47
|
-
};
|
|
48
|
-
private sendSuccessEmail;
|
|
49
|
-
}
|
|
1
|
+
import { AbstractTaskPlugin, HttpClient, IAccessService, IContext, Step } from "@certd/pipeline";
|
|
2
|
+
import type { CertInfo } from "./acme.js";
|
|
3
|
+
import { Logger } from "log4js";
|
|
4
|
+
import { CertReader } from "./cert-reader.js";
|
|
5
|
+
export { CertReader };
|
|
6
|
+
export type { CertInfo };
|
|
7
|
+
export declare abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
|
|
8
|
+
domains: string[];
|
|
9
|
+
email: string;
|
|
10
|
+
renewDays: number;
|
|
11
|
+
forceUpdate: string;
|
|
12
|
+
successNotify: boolean;
|
|
13
|
+
intro: string;
|
|
14
|
+
csrInfo: string;
|
|
15
|
+
logger: Logger;
|
|
16
|
+
userContext: IContext;
|
|
17
|
+
accessService: IAccessService;
|
|
18
|
+
http: HttpClient;
|
|
19
|
+
lastStatus: Step;
|
|
20
|
+
cert?: CertInfo;
|
|
21
|
+
onInstance(): Promise<void>;
|
|
22
|
+
abstract onInit(): Promise<void>;
|
|
23
|
+
abstract doCertApply(): Promise<any>;
|
|
24
|
+
execute(): Promise<void>;
|
|
25
|
+
output(certReader: CertReader, isNew: boolean): Promise<void>;
|
|
26
|
+
zipCert(cert: CertInfo, applyTime: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* 是否更新证书
|
|
29
|
+
*/
|
|
30
|
+
condition(): Promise<CertReader>;
|
|
31
|
+
formatCert(pem: string): string;
|
|
32
|
+
formatCerts(cert: {
|
|
33
|
+
crt: string;
|
|
34
|
+
key: string;
|
|
35
|
+
csr: string;
|
|
36
|
+
}): CertInfo;
|
|
37
|
+
readLastCert(): Promise<CertReader | undefined>;
|
|
38
|
+
/**
|
|
39
|
+
* 检查是否过期,默认提前20天
|
|
40
|
+
* @param expires
|
|
41
|
+
* @param maxDays
|
|
42
|
+
* @returns {boolean}
|
|
43
|
+
*/
|
|
44
|
+
isWillExpire(expires: number, maxDays?: number): {
|
|
45
|
+
isWillExpire: boolean;
|
|
46
|
+
leftDays: number;
|
|
47
|
+
};
|
|
48
|
+
private sendSuccessEmail;
|
|
49
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { CertInfo } from "./acme.js";
|
|
2
|
-
import forge from "node-forge";
|
|
3
|
-
export declare class CertReader implements CertInfo {
|
|
4
|
-
crt: string;
|
|
5
|
-
key: string;
|
|
6
|
-
csr: string;
|
|
7
|
-
detail: any;
|
|
8
|
-
expires: number;
|
|
9
|
-
constructor(certInfo: CertInfo);
|
|
10
|
-
toCertInfo(): CertInfo;
|
|
11
|
-
getCrtDetail(crt: string): {
|
|
12
|
-
detail: forge.pki.Certificate;
|
|
13
|
-
expires: Date;
|
|
14
|
-
};
|
|
15
|
-
saveToFile(type: "crt" | "key", filepath?: string): string;
|
|
16
|
-
}
|
|
1
|
+
import { CertInfo } from "./acme.js";
|
|
2
|
+
import forge from "node-forge";
|
|
3
|
+
export declare class CertReader implements CertInfo {
|
|
4
|
+
crt: string;
|
|
5
|
+
key: string;
|
|
6
|
+
csr: string;
|
|
7
|
+
detail: any;
|
|
8
|
+
expires: number;
|
|
9
|
+
constructor(certInfo: CertInfo);
|
|
10
|
+
toCertInfo(): CertInfo;
|
|
11
|
+
getCrtDetail(crt: string): {
|
|
12
|
+
detail: forge.pki.Certificate;
|
|
13
|
+
expires: Date;
|
|
14
|
+
};
|
|
15
|
+
saveToFile(type: "crt" | "key", filepath?: string): string;
|
|
16
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import os from "os";
|
|
3
|
-
import forge from "node-forge";
|
|
4
|
-
import path from "path";
|
|
5
|
-
export class CertReader {
|
|
6
|
-
crt;
|
|
7
|
-
key;
|
|
8
|
-
csr;
|
|
9
|
-
detail;
|
|
10
|
-
expires;
|
|
11
|
-
constructor(certInfo) {
|
|
12
|
-
this.crt = certInfo.crt;
|
|
13
|
-
this.key = certInfo.key;
|
|
14
|
-
this.csr = certInfo.csr;
|
|
15
|
-
const { detail, expires } = this.getCrtDetail(this.crt);
|
|
16
|
-
this.detail = detail;
|
|
17
|
-
this.expires = expires.getTime();
|
|
18
|
-
}
|
|
19
|
-
toCertInfo() {
|
|
20
|
-
return {
|
|
21
|
-
crt: this.crt,
|
|
22
|
-
key: this.key,
|
|
23
|
-
csr: this.csr,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
getCrtDetail(crt) {
|
|
27
|
-
const pki = forge.pki;
|
|
28
|
-
const detail = pki.certificateFromPem(crt.toString());
|
|
29
|
-
const expires = detail.validity.notAfter;
|
|
30
|
-
return { detail, expires };
|
|
31
|
-
}
|
|
32
|
-
saveToFile(type, filepath) {
|
|
33
|
-
if (filepath == null) {
|
|
34
|
-
//写入临时目录
|
|
35
|
-
filepath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "", `cert.${type}`);
|
|
36
|
-
}
|
|
37
|
-
const dir = path.dirname(filepath);
|
|
38
|
-
if (!fs.existsSync(dir)) {
|
|
39
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
40
|
-
}
|
|
41
|
-
fs.writeFileSync(filepath, this[type]);
|
|
42
|
-
return filepath;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import os from "os";
|
|
3
|
+
import forge from "node-forge";
|
|
4
|
+
import path from "path";
|
|
5
|
+
export class CertReader {
|
|
6
|
+
crt;
|
|
7
|
+
key;
|
|
8
|
+
csr;
|
|
9
|
+
detail;
|
|
10
|
+
expires;
|
|
11
|
+
constructor(certInfo) {
|
|
12
|
+
this.crt = certInfo.crt;
|
|
13
|
+
this.key = certInfo.key;
|
|
14
|
+
this.csr = certInfo.csr;
|
|
15
|
+
const { detail, expires } = this.getCrtDetail(this.crt);
|
|
16
|
+
this.detail = detail;
|
|
17
|
+
this.expires = expires.getTime();
|
|
18
|
+
}
|
|
19
|
+
toCertInfo() {
|
|
20
|
+
return {
|
|
21
|
+
crt: this.crt,
|
|
22
|
+
key: this.key,
|
|
23
|
+
csr: this.csr,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
getCrtDetail(crt) {
|
|
27
|
+
const pki = forge.pki;
|
|
28
|
+
const detail = pki.certificateFromPem(crt.toString());
|
|
29
|
+
const expires = detail.validity.notAfter;
|
|
30
|
+
return { detail, expires };
|
|
31
|
+
}
|
|
32
|
+
saveToFile(type, filepath) {
|
|
33
|
+
if (filepath == null) {
|
|
34
|
+
//写入临时目录
|
|
35
|
+
filepath = path.join(os.tmpdir(), "/certd/tmp/", Math.floor(Math.random() * 1000000) + "", `cert.${type}`);
|
|
36
|
+
}
|
|
37
|
+
const dir = path.dirname(filepath);
|
|
38
|
+
if (!fs.existsSync(dir)) {
|
|
39
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
40
|
+
}
|
|
41
|
+
fs.writeFileSync(filepath, this[type]);
|
|
42
|
+
return filepath;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydC1yZWFkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcGx1Z2luL2NlcnQtcGx1Z2luL2NlcnQtcmVhZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxNQUFNLElBQUksQ0FBQztBQUNwQixPQUFPLEVBQUUsTUFBTSxJQUFJLENBQUM7QUFDcEIsT0FBTyxLQUFLLE1BQU0sWUFBWSxDQUFDO0FBQy9CLE9BQU8sSUFBSSxNQUFNLE1BQU0sQ0FBQztBQUN4QixNQUFNLE9BQU8sVUFBVTtJQUNyQixHQUFHLENBQVM7SUFDWixHQUFHLENBQVM7SUFDWixHQUFHLENBQVM7SUFFWixNQUFNLENBQU07SUFDWixPQUFPLENBQVM7SUFDaEIsWUFBWSxRQUFrQjtRQUM1QixJQUFJLENBQUMsR0FBRyxHQUFHLFFBQVEsQ0FBQyxHQUFHLENBQUM7UUFDeEIsSUFBSSxDQUFDLEdBQUcsR0FBRyxRQUFRLENBQUMsR0FBRyxDQUFDO1FBQ3hCLElBQUksQ0FBQyxHQUFHLEdBQUcsUUFBUSxDQUFDLEdBQUcsQ0FBQztRQUV4QixNQUFNLEVBQUUsTUFBTSxFQUFFLE9BQU8sRUFBRSxHQUFHLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ3hELElBQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDO1FBQ3JCLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ25DLENBQUM7SUFFRCxVQUFVO1FBQ1IsT0FBTztZQUNMLEdBQUcsRUFBRSxJQUFJLENBQUMsR0FBRztZQUNiLEdBQUcsRUFBRSxJQUFJLENBQUMsR0FBRztZQUNiLEdBQUcsRUFBRSxJQUFJLENBQUMsR0FBRztTQUNkLENBQUM7SUFDSixDQUFDO0lBRUQsWUFBWSxDQUFDLEdBQVc7UUFDdEIsTUFBTSxHQUFHLEdBQUcsS0FBSyxDQUFDLEdBQUcsQ0FBQztRQUN0QixNQUFNLE1BQU0sR0FBRyxHQUFHLENBQUMsa0JBQWtCLENBQUMsR0FBRyxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUM7UUFDdEQsTUFBTSxPQUFPLEdBQUcsTUFBTSxDQUFDLFFBQVEsQ0FBQyxRQUFRLENBQUM7UUFDekMsT0FBTyxFQUFFLE1BQU0sRUFBRSxPQUFPLEVBQUUsQ0FBQztJQUM3QixDQUFDO0lBRUQsVUFBVSxDQUFDLElBQW1CLEVBQUUsUUFBaUI7UUFDL0MsSUFBSSxRQUFRLElBQUksSUFBSSxFQUFFO1lBQ3BCLFFBQVE7WUFDUixRQUFRLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsTUFBTSxFQUFFLEVBQUUsYUFBYSxFQUFFLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxHQUFHLE9BQU8sQ0FBQyxHQUFHLEVBQUUsRUFBRSxRQUFRLElBQUksRUFBRSxDQUFDLENBQUM7U0FDNUc7UUFFRCxNQUFNLEdBQUcsR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBQ25DLElBQUksQ0FBQyxFQUFFLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQ3ZCLEVBQUUsQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLEVBQUUsU0FBUyxFQUFFLElBQUksRUFBRSxDQUFDLENBQUM7U0FDeEM7UUFFRCxFQUFFLENBQUMsYUFBYSxDQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztRQUN2QyxPQUFPLFFBQVEsQ0FBQztJQUNsQixDQUFDO0NBQ0YifQ==
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { CertInfo, SSLProvider } from "./acme.js";
|
|
2
|
-
import { AcmeService } from "./acme.js";
|
|
3
|
-
import { CertReader } from "./cert-reader.js";
|
|
4
|
-
import { CertApplyBasePlugin } from "./base.js";
|
|
5
|
-
export { CertReader };
|
|
6
|
-
export type { CertInfo };
|
|
7
|
-
export declare class CertApplyPlugin extends CertApplyBasePlugin {
|
|
8
|
-
sslProvider: SSLProvider;
|
|
9
|
-
eabAccessId: number;
|
|
10
|
-
dnsProviderType: string;
|
|
11
|
-
dnsProviderAccess: string;
|
|
12
|
-
useProxy: boolean;
|
|
13
|
-
skipLocalVerify: boolean;
|
|
14
|
-
acme: AcmeService;
|
|
15
|
-
onInit(): Promise<void>;
|
|
16
|
-
doCertApply(): Promise<CertReader>;
|
|
17
|
-
}
|
|
1
|
+
import type { CertInfo, SSLProvider } from "./acme.js";
|
|
2
|
+
import { AcmeService } from "./acme.js";
|
|
3
|
+
import { CertReader } from "./cert-reader.js";
|
|
4
|
+
import { CertApplyBasePlugin } from "./base.js";
|
|
5
|
+
export { CertReader };
|
|
6
|
+
export type { CertInfo };
|
|
7
|
+
export declare class CertApplyPlugin extends CertApplyBasePlugin {
|
|
8
|
+
sslProvider: SSLProvider;
|
|
9
|
+
eabAccessId: number;
|
|
10
|
+
dnsProviderType: string;
|
|
11
|
+
dnsProviderAccess: string;
|
|
12
|
+
useProxy: boolean;
|
|
13
|
+
skipLocalVerify: boolean;
|
|
14
|
+
acme: AcmeService;
|
|
15
|
+
onInit(): Promise<void>;
|
|
16
|
+
doCertApply(): Promise<CertReader>;
|
|
17
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dnsList: any[];
|
|
1
|
+
export declare const dnsList: any[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const dnsList = [];
|
|
1
|
+
export const dnsList = [];
|
|
2
2
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3BsdWdpbi9jZXJ0LXBsdWdpbi9sZWdvL2Rucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsRUFBRSxDQUFDIn0=
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { CertInfo } from "../acme.js";
|
|
2
|
-
import { CertReader } from "../cert-reader.js";
|
|
3
|
-
import { CertApplyBasePlugin } from "../base.js";
|
|
4
|
-
import { EabAccess } from "../../../access/index.js";
|
|
5
|
-
export { CertReader };
|
|
6
|
-
export type { CertInfo };
|
|
7
|
-
export declare class CertApplyLegoPlugin extends CertApplyBasePlugin {
|
|
8
|
-
acmeServer: string;
|
|
9
|
-
dnsType: string;
|
|
10
|
-
environment: string;
|
|
11
|
-
legoEabAccessId: number;
|
|
12
|
-
customArgs: string;
|
|
13
|
-
eab?: EabAccess;
|
|
14
|
-
onInstance(): Promise<void>;
|
|
15
|
-
onInit(): Promise<void>;
|
|
16
|
-
doCertApply(): Promise<CertReader>;
|
|
17
|
-
}
|
|
1
|
+
import type { CertInfo } from "../acme.js";
|
|
2
|
+
import { CertReader } from "../cert-reader.js";
|
|
3
|
+
import { CertApplyBasePlugin } from "../base.js";
|
|
4
|
+
import { EabAccess } from "../../../access/index.js";
|
|
5
|
+
export { CertReader };
|
|
6
|
+
export type { CertInfo };
|
|
7
|
+
export declare class CertApplyLegoPlugin extends CertApplyBasePlugin {
|
|
8
|
+
acmeServer: string;
|
|
9
|
+
dnsType: string;
|
|
10
|
+
environment: string;
|
|
11
|
+
legoEabAccessId: number;
|
|
12
|
+
customArgs: string;
|
|
13
|
+
eab?: EabAccess;
|
|
14
|
+
onInstance(): Promise<void>;
|
|
15
|
+
onInit(): Promise<void>;
|
|
16
|
+
doCertApply(): Promise<CertReader>;
|
|
17
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { CertInfo } from "./acme.js";
|
|
2
|
-
import { CertReader } from "./cert-reader.js";
|
|
3
|
-
import { CertApplyBasePlugin } from "./base.js";
|
|
4
|
-
import { EabAccess } from "../../access";
|
|
5
|
-
export { CertReader };
|
|
6
|
-
export type { CertInfo };
|
|
7
|
-
export declare class CertApplyLegoPlugin extends CertApplyBasePlugin {
|
|
8
|
-
dnsType: string;
|
|
9
|
-
environment: string;
|
|
10
|
-
|
|
11
|
-
customArgs: string;
|
|
12
|
-
eab?: EabAccess;
|
|
13
|
-
onInstance(): Promise<void>;
|
|
14
|
-
onInit(): Promise<void>;
|
|
15
|
-
doCertApply(): Promise<CertReader>;
|
|
16
|
-
}
|
|
1
|
+
import type { CertInfo } from "./acme.js";
|
|
2
|
+
import { CertReader } from "./cert-reader.js";
|
|
3
|
+
import { CertApplyBasePlugin } from "./base.js";
|
|
4
|
+
import { EabAccess } from "../../access";
|
|
5
|
+
export { CertReader };
|
|
6
|
+
export type { CertInfo };
|
|
7
|
+
export declare class CertApplyLegoPlugin extends CertApplyBasePlugin {
|
|
8
|
+
dnsType: string;
|
|
9
|
+
environment: string;
|
|
10
|
+
eabAccessId: number;
|
|
11
|
+
customArgs: string;
|
|
12
|
+
eab?: EabAccess;
|
|
13
|
+
onInstance(): Promise<void>;
|
|
14
|
+
onInit(): Promise<void>;
|
|
15
|
+
doCertApply(): Promise<CertReader>;
|
|
16
|
+
}
|