Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ providers/namecheap @willpower232
# providers/namedotcom NEEDS VOLUNTEER
providers/netcup @kordianbruck
providers/netlify @SphericalKat
providers/none @TomOnTime
providers/ns1 @costasd
# providers/opensrs NEEDS VOLUNTEER
providers/oracle @kallsyms
Expand Down
4 changes: 4 additions & 0 deletions integrationTest/profiles.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@
"slug": "$NETLIFY_ACCOUNT_SLUG",
"token": "$NETLIFY_TOKEN"
},
"NONE": {
"TYPE": "NONE",
"domain": "$NONE_DOMAIN",
},
"NS1": {
"TYPE": "NS1",
"api_token": "$NS1_TOKEN",
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"runtime/debug"

"github.com/StackExchange/dnscontrol/v4/commands"
"github.com/StackExchange/dnscontrol/v4/pkg/providers"
_ "github.com/StackExchange/dnscontrol/v4/pkg/providers/_all"
_ "github.com/StackExchange/dnscontrol/v4/pkg/rtype"
"github.com/StackExchange/dnscontrol/v4/pkg/version"
Expand All @@ -21,5 +22,6 @@ func main() {
if info, ok := debug.ReadBuildInfo(); !ok && info == nil {
fmt.Fprint(os.Stderr, "Warning: dnscontrol was built without Go modules. See https://docs.dnscontrol.org/getting-started/getting-started#source for more information on how to build dnscontrol correctly.\n\n")
}
providers.PostInitAllProviders()
os.Exit(commands.Run("DNSControl version " + version.Version()))
}
1 change: 1 addition & 0 deletions pkg/providers/_all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
_ "github.com/StackExchange/dnscontrol/v4/providers/namedotcom"
_ "github.com/StackExchange/dnscontrol/v4/providers/netcup"
_ "github.com/StackExchange/dnscontrol/v4/providers/netlify"
_ "github.com/StackExchange/dnscontrol/v4/providers/none"
_ "github.com/StackExchange/dnscontrol/v4/providers/ns1"
_ "github.com/StackExchange/dnscontrol/v4/providers/opensrs"
_ "github.com/StackExchange/dnscontrol/v4/providers/oracle"
Expand Down
43 changes: 36 additions & 7 deletions pkg/providers/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// Capability is a bitmasked set of "features" that a provider supports. Only use constants from this package.
type Capability uint32
type Capability int

const (
// Keep this list sorted.
Expand All @@ -26,97 +26,126 @@ const (
CanConcur

// CanGetZones indicates the provider supports the get-zones subcommand.
// When using providers.Register(), this is set automatically for you.
CanGetZones

// CanOnlyDiff1Features indicates the provider has not yet been upgraded to
// use the "diff2" differencing engine. Instead, it uses the the backwards
// compatibility mode. The diff2 engine is required to repliably provide
// IGNORE(), NO_PURGE, and other features.
// This capability is set automatically for the provider during the call to
// RegisterDomainServiceProviderType. It is set to Can() if we detect
// compatibility mode is in use. All other values (Unimplemented and Cannot)
// are equivalent.
CanOnlyDiff1Features

// CanUseAKAMAICDN indicates the provider support the specific AKAMAICDN records that only the Akamai EdgeDns provider supports
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseAKAMAICDN

// CanUseAKAMAITLC indicates the provider supports the specific AKAMAITLC records that only the Akamai EdgeDns provider supports
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseAKAMAITLC

// CanUseAlias indicates the provider support ALIAS records (or flattened CNAMES). Up to the provider to translate them to the appropriate record type.
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseAlias

// CanUseAzureAlias indicates the provider support the specific Azure_ALIAS records that only the Azure provider supports
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseAzureAlias

// CanUseCAA indicates the provider can handle CAA records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseCAA

// CanUseDHCID indicates the provider can handle DHCID records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseDHCID

// CanUseDNAME indicates the provider can handle DNAME records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseDNAME

// CanUseDS indicates that the provider can handle DS record types. This
// implies CanUseDSForChildren without specifying the latter explicitly.
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseDS

// CanUseDSForChildren indicates the provider can handle DS record types, but
// only for children records, not at the root of the zone.
CanUseDSForChildren

// CanUseHTTPS indicates the provider can handle HTTPS records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseHTTPS

// CanUseLOC indicates whether service provider handles LOC records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseLOC

// CanUseNAPTR indicates the provider can handle NAPTR records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseNAPTR

// CanUsePTR indicates the provider can handle PTR records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUsePTR

// CanUseRoute53Alias indicates the provider support the specific R53_ALIAS records that only the Route53 provider supports
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseRoute53Alias

// CanUseRP indicates the provider can handle RP records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseRP

// CanUseSMIMEA indicates the provider can handle SMIMEA records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseSMIMEA

// CanUseSOA indicates the provider supports full management of a zone's SOA record
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseSOA

// CanUseSRV indicates the provider can handle SRV records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseSRV

// CanUseSSHFP indicates the provider can handle SSHFP records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseSSHFP

// CanUseSVCB indicates the provider can handle SVCB records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseSVCB

// CanUseTLSA indicates the provider can handle TLSA records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseTLSA

// CanUseDNSKEY indicates that the provider can handle DNSKEY records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseDNSKEY

// CanUseOPENPGPKEY indicates that the provider can handle OPENPGPKEY records
// When using providers.Register(), this is set if RecordTypes[] includes it.
CanUseOPENPGPKEY

// DocCreateDomains means provider can add domains with the `dnscontrol create-domains` command
// When using providers.Register(), this is set automatically for you.
DocCreateDomains

// DocDualHost means provider allows full management of apex NS records, so we can safely dual-host with another provider
DocDualHost

// DocOfficiallySupported means it is actively used and maintained by stack exchange
// When using providers.Register(), this is set automatically for you.
DocOfficiallySupported

// CanUseAKAMAITLC indicates the provider supports the specific AKAMAITLC records that only the Akamai EdgeDns provider supports
CanUseAKAMAITLC
// IsRegistrar means the provider can update the parent's nameserver delegations.
// When using providers.Register(), this is set automatically for you.
IsRegistrar

// IsDnsServiceProvider means the provider can manage DNS zone data.
// When using providers.Register(), this is set automatically for you.
IsDnsServiceProvider
)

var providerCapabilities = map[string]map[Capability]bool{}
Expand Down
56 changes: 29 additions & 27 deletions pkg/providers/capability_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions pkg/providers/dualhostsupport.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package providers

//go:generate stringer -type DualHostSupport -trimprefix DualHostSupport

// DualHostSupport indicates the provider's level of support.
//
// if x < DualHostSupportSupported { // not supported }
// if x >= DualHostSupportSupported { // supported }
type DualHostSupport int

const (
// Enums that mean "not supported"
DualHostSupportNotSupported DualHostSupport = iota
DualHostSupportUntested
DualHostSupportUnimplemented // Provider supports this but DNSControl does not have code to support it

// Enums that mean "supported"
DualHostSupportAdditionsOnly // Provider does not permit modifying/deleting provider's NS records, only adding/removing additional records
DualHostSupportItsComplicated // Provider supports this, but check the documentation for limits and oddities.
DualHostSupportFull

// Pivot point. Below here means "not supported". Above here means "supported".
DualHostSupportSupported = DualHostSupportAdditionsOnly
)
29 changes: 29 additions & 0 deletions pkg/providers/dualhostsupport_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions pkg/providers/fieldtype.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package providers

//go:generate stringer -type FieldType -trimprefix FieldType

type FieldType int

const (
FieldTypeString FieldType = iota
FieldTypeBool
)
25 changes: 25 additions & 0 deletions pkg/providers/fieldtype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading