mirror of https://github.com/certd/certd
perf: 优化证书申请过程
parent
259e797ea5
commit
f07ce6f47d
File diff suppressed because it is too large
Load Diff
|
@ -19,7 +19,7 @@
|
||||||
"log4js": "^6.3.0",
|
"log4js": "^6.3.0",
|
||||||
"node-forge": "^0.10.0",
|
"node-forge": "^0.10.0",
|
||||||
"qs": "^6.9.4",
|
"qs": "^6.9.4",
|
||||||
"@certd/tencentcloud-sdk-nodejs": "^4.0.39"
|
"tencentcloud-sdk-nodejs": "^4.0.44"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
|
|
|
@ -56,7 +56,7 @@ export default class DnspodDnsProvider extends DnsProvider {
|
||||||
mx: 1
|
mx: 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log('添加域名解析成功:', fullRecord, value, JSON.stringify(ret.record))
|
log.info('添加域名解析成功:', fullRecord, value, JSON.stringify(ret.record))
|
||||||
return ret.record
|
return ret.record
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import pkg from 'chai'
|
import pkg from 'chai'
|
||||||
import options from '../options.js'
|
|
||||||
import DnspodDnsProvider from '../../src/dns-provider/impl/dnspod.js'
|
import DnspodDnsProvider from '../../src/dns-provider/impl/dnspod.js'
|
||||||
import { Certd } from '../../src/index.js'
|
import { Certd } from '../../src/index.js'
|
||||||
|
import { createOptions } from '../../../../test/options.js'
|
||||||
const { expect } = pkg
|
const { expect } = pkg
|
||||||
describe('DnspodDnsProvider', function () {
|
describe('DnspodDnsProvider', function () {
|
||||||
it('#getDomainList', async function () {
|
it('#getDomainList', async function () {
|
||||||
|
const options = createOptions()
|
||||||
const dnsProvider = new DnspodDnsProvider(options.accessProviders.dnspod)
|
const dnsProvider = new DnspodDnsProvider(options.accessProviders.dnspod)
|
||||||
const domainList = await dnsProvider.getDomainList()
|
const domainList = await dnsProvider.getDomainList()
|
||||||
console.log('domainList', domainList)
|
console.log('domainList', domainList)
|
||||||
|
@ -12,6 +13,7 @@ describe('DnspodDnsProvider', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('#createRecord&removeRecord', async function () {
|
it('#createRecord&removeRecord', async function () {
|
||||||
|
const options = createOptions()
|
||||||
const dnsProvider = new DnspodDnsProvider(options.accessProviders.dnspod)
|
const dnsProvider = new DnspodDnsProvider(options.accessProviders.dnspod)
|
||||||
const record = await dnsProvider.createRecord({ fullRecord: '___certd___.__test__.certd.xyz', type: 'TXT', value: 'aaaa' })
|
const record = await dnsProvider.createRecord({ fullRecord: '___certd___.__test__.certd.xyz', type: 'TXT', value: 'aaaa' })
|
||||||
console.log('recordId', record.id)
|
console.log('recordId', record.id)
|
||||||
|
@ -22,11 +24,12 @@ describe('DnspodDnsProvider', function () {
|
||||||
|
|
||||||
it('#申请证书', async function () {
|
it('#申请证书', async function () {
|
||||||
this.timeout(300000)
|
this.timeout(300000)
|
||||||
options.cert.domains = ['*.certd.xyz', 'certd.xyz']
|
const options = createOptions()
|
||||||
|
options.cert.domains = ['*.certd.xyz', '*.test.certd.xyz', '*.base.certd.xyz']
|
||||||
options.cert.dnsProvider = 'dnspod'
|
options.cert.dnsProvider = 'dnspod'
|
||||||
options.args = { forceCert: true }
|
options.args = { forceCert: true }
|
||||||
const certd = new Certd()
|
const certd = new Certd(options)
|
||||||
const cert = await certd.certApply(options)
|
const cert = await certd.certApply()
|
||||||
expect(cert).ok
|
expect(cert).ok
|
||||||
expect(cert.crt).ok
|
expect(cert.crt).ok
|
||||||
expect(cert.key).ok
|
expect(cert.key).ok
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -16,7 +16,7 @@
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"log4js": "^6.3.0",
|
"log4js": "^6.3.0",
|
||||||
"ssh2": "^0.8.9",
|
"ssh2": "^0.8.9",
|
||||||
"@certd/tencentcloud-sdk-nodejs": "^4.0.39"
|
"tencentcloud-sdk-nodejs": "^4.0.44"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
|
|
Loading…
Reference in New Issue