mirror of https://github.com/certd/certd
fix: 修复dns.la域名申请失败的bug
parent
425bba67c5
commit
1de8eee6ea
|
@ -60,6 +60,7 @@ type AcmeServiceOptions = {
|
||||||
reverseProxy?: string;
|
reverseProxy?: string;
|
||||||
privateKeyType?: PrivateKeyType;
|
privateKeyType?: PrivateKeyType;
|
||||||
signal?: AbortSignal;
|
signal?: AbortSignal;
|
||||||
|
maxCheckRetryCount?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export class AcmeService {
|
export class AcmeService {
|
||||||
|
@ -144,7 +145,7 @@ export class AcmeService {
|
||||||
accountKey: conf.key,
|
accountKey: conf.key,
|
||||||
accountUrl: conf.accountUrl,
|
accountUrl: conf.accountUrl,
|
||||||
externalAccountBinding: this.eab,
|
externalAccountBinding: this.eab,
|
||||||
backoffAttempts: 20,
|
backoffAttempts: this.options.maxCheckRetryCount || 20,
|
||||||
backoffMin: 5000,
|
backoffMin: 5000,
|
||||||
backoffMax: 10000,
|
backoffMax: 10000,
|
||||||
urlMapping,
|
urlMapping,
|
||||||
|
@ -282,15 +283,7 @@ export class AcmeService {
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
async challengeRemoveFn(
|
async challengeRemoveFn(authz: any, challenge: any, keyAuthorization: string, recordReq: any, recordRes: any, dnsProvider?: IDnsProvider, httpUploader?: HttpChallengeUploader) {
|
||||||
authz: any,
|
|
||||||
challenge: any,
|
|
||||||
keyAuthorization: string,
|
|
||||||
recordReq: any,
|
|
||||||
recordRes: any,
|
|
||||||
dnsProvider?: IDnsProvider,
|
|
||||||
httpUploader?: HttpChallengeUploader
|
|
||||||
) {
|
|
||||||
this.logger.info("执行清理");
|
this.logger.info("执行清理");
|
||||||
|
|
||||||
/* http-01 */
|
/* http-01 */
|
||||||
|
@ -387,14 +380,7 @@ export class AcmeService {
|
||||||
): Promise<{ recordReq?: any; recordRes?: any; dnsProvider?: any; challenge: Challenge; keyAuthorization: string }> => {
|
): Promise<{ recordReq?: any; recordRes?: any; dnsProvider?: any; challenge: Challenge; keyAuthorization: string }> => {
|
||||||
return await this.challengeCreateFn(authz, keyAuthorizationGetter, providers);
|
return await this.challengeCreateFn(authz, keyAuthorizationGetter, providers);
|
||||||
},
|
},
|
||||||
challengeRemoveFn: async (
|
challengeRemoveFn: async (authz: acme.Authorization, challenge: Challenge, keyAuthorization: string, recordReq: any, recordRes: any, dnsProvider: IDnsProvider): Promise<any> => {
|
||||||
authz: acme.Authorization,
|
|
||||||
challenge: Challenge,
|
|
||||||
keyAuthorization: string,
|
|
||||||
recordReq: any,
|
|
||||||
recordRes: any,
|
|
||||||
dnsProvider: IDnsProvider
|
|
||||||
): Promise<any> => {
|
|
||||||
return await this.challengeRemoveFn(authz, challenge, keyAuthorization, recordReq, recordRes, dnsProvider, httpUploader);
|
return await this.challengeRemoveFn(authz, challenge, keyAuthorization, recordReq, recordRes, dnsProvider, httpUploader);
|
||||||
},
|
},
|
||||||
signal: this.options.signal,
|
signal: this.options.signal,
|
||||||
|
|
|
@ -203,8 +203,7 @@ HTTP文件验证:不支持泛域名,需要配置网站文件上传`,
|
||||||
},
|
},
|
||||||
maybeNeed: true,
|
maybeNeed: true,
|
||||||
required: false,
|
required: false,
|
||||||
helper:
|
helper: "google服务账号授权与EAB授权选填其中一个,[服务账号授权获取方法](https://certd.docmirror.cn/guide/use/google/)\n服务账号授权需要配置代理或者服务器本身在海外",
|
||||||
"google服务账号授权与EAB授权选填其中一个,[服务账号授权获取方法](https://certd.docmirror.cn/guide/use/google/)\n服务账号授权需要配置代理或者服务器本身在海外",
|
|
||||||
mergeScript: `
|
mergeScript: `
|
||||||
return {
|
return {
|
||||||
show: ctx.compute(({form})=>{
|
show: ctx.compute(({form})=>{
|
||||||
|
@ -268,6 +267,17 @@ HTTP文件验证:不支持泛域名,需要配置网站文件上传`,
|
||||||
})
|
})
|
||||||
skipLocalVerify = false;
|
skipLocalVerify = false;
|
||||||
|
|
||||||
|
@TaskInput({
|
||||||
|
title: "检查解析重试次数",
|
||||||
|
value: 20,
|
||||||
|
component: {
|
||||||
|
name: "a-input-number",
|
||||||
|
vModel: "value",
|
||||||
|
},
|
||||||
|
helper: "检查域名验证解析记录重试次数,如果你的域名服务商解析生效速度慢,可以适当增加此值",
|
||||||
|
})
|
||||||
|
maxCheckRetryCount = 20;
|
||||||
|
|
||||||
acme!: AcmeService;
|
acme!: AcmeService;
|
||||||
|
|
||||||
eab!: EabAccess;
|
eab!: EabAccess;
|
||||||
|
@ -314,6 +324,7 @@ HTTP文件验证:不支持泛域名,需要配置网站文件上传`,
|
||||||
reverseProxy: this.reverseProxy,
|
reverseProxy: this.reverseProxy,
|
||||||
privateKeyType: this.privateKeyType,
|
privateKeyType: this.privateKeyType,
|
||||||
signal: this.ctx.signal,
|
signal: this.ctx.signal,
|
||||||
|
maxCheckRetryCount: this.maxCheckRetryCount,
|
||||||
// cnameProxyService: this.ctx.cnameProxyService,
|
// cnameProxyService: this.ctx.cnameProxyService,
|
||||||
// dnsProviderCreator: this.createDnsProvider.bind(this),
|
// dnsProviderCreator: this.createDnsProvider.bind(this),
|
||||||
});
|
});
|
||||||
|
|
|
@ -130,12 +130,23 @@ export class DnslaDnsProvider extends AbstractDnsProvider<DnslaRecord> {
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
const url = `/api/record`;
|
const url = `/api/record`;
|
||||||
|
/**
|
||||||
|
* A 1
|
||||||
|
* NS 2
|
||||||
|
* CNAME 5
|
||||||
|
* MX 15
|
||||||
|
* TXT 16
|
||||||
|
* AAAA 28
|
||||||
|
* SRV 33
|
||||||
|
* CAA 257
|
||||||
|
* URL转发 256
|
||||||
|
*/
|
||||||
const res = await this.doRequestApi(url, {
|
const res = await this.doRequestApi(url, {
|
||||||
domainId: domainId,
|
domainId: domainId,
|
||||||
type: type,
|
type: 16,
|
||||||
host: fullRecord,
|
host: fullRecord,
|
||||||
data: value,
|
data: value,
|
||||||
ttl: 60,
|
ttl: 300,
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|
Loading…
Reference in New Issue