mirror of https://github.com/certd/certd
refactor: define
parent
2669f509e1
commit
fd130f86fd
|
@ -1,4 +1,4 @@
|
|||
import { util, Store, pluginRegistry } from '@certd/api'
|
||||
import { util, Store, providerRegistry } from '@certd/api'
|
||||
import { AcmeService } from './acme.js'
|
||||
import { FileStore } from './store/file-store.js'
|
||||
import { CertStore } from './store/cert-store.js'
|
||||
|
@ -124,7 +124,7 @@ export class Certd {
|
|||
|
||||
createProviderByType (type, options) {
|
||||
try {
|
||||
const Provider = pluginRegistry.get(type)
|
||||
const Provider = providerRegistry.get(type)
|
||||
return new Provider(options)
|
||||
} catch (e) {
|
||||
throw new Error('暂不支持此dnsProvider,请先use该provider:' + type, e)
|
||||
|
|
|
@ -2,6 +2,33 @@ import { AbstractDnsProvider } from '@certd/api'
|
|||
import Core from '@alicloud/pop-core'
|
||||
import _ from 'lodash-es'
|
||||
export class AliyunDnsProvider extends AbstractDnsProvider {
|
||||
static define () {
|
||||
return {
|
||||
name: 'aliyun',
|
||||
label: '阿里云',
|
||||
desc: '',
|
||||
input: {
|
||||
accessKeyId: {
|
||||
type: String,
|
||||
desc: 'accessKeyId',
|
||||
attrs: {
|
||||
placeholder: 'accessKeyId'
|
||||
}
|
||||
},
|
||||
accessKeySecret: {
|
||||
type: String,
|
||||
desc: 'accessKeySecret',
|
||||
attrs: {
|
||||
placeholder: 'accessKeySecret'
|
||||
}
|
||||
}
|
||||
},
|
||||
output: {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
constructor (dnsProviderConfig) {
|
||||
super()
|
||||
this.client = new Core({
|
||||
|
@ -12,10 +39,6 @@ export class AliyunDnsProvider extends AbstractDnsProvider {
|
|||
})
|
||||
}
|
||||
|
||||
static name () {
|
||||
return 'aliyun'
|
||||
}
|
||||
|
||||
async getDomainList () {
|
||||
const params = {
|
||||
RegionId: 'cn-hangzhou'
|
||||
|
|
|
@ -2,8 +2,23 @@ import { AbstractDnsProvider, util } from '@certd/api'
|
|||
import _ from 'lodash-es'
|
||||
const request = util.request
|
||||
export class DnspodDnsProvider extends AbstractDnsProvider {
|
||||
static name () {
|
||||
return 'dnspod'
|
||||
static define () {
|
||||
return {
|
||||
name: 'dnspod',
|
||||
label: 'dnspod',
|
||||
desc: '腾讯云的域名解析接口已迁移到dnspod',
|
||||
input: {
|
||||
id: {
|
||||
type: String,
|
||||
desc: 'dnspod的账户id'
|
||||
},
|
||||
token: {
|
||||
type: String,
|
||||
label: 'token',
|
||||
desc: 'dnspod的开放接口token'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
constructor (dnsProviderConfig) {
|
||||
|
|
Loading…
Reference in New Issue