diff --git a/commands/types/dnscontrol.d.ts b/commands/types/dnscontrol.d.ts index a9664b2b9d..5c6b2114ec 100644 --- a/commands/types/dnscontrol.d.ts +++ b/commands/types/dnscontrol.d.ts @@ -2948,29 +2948,6 @@ declare function OPENPGPKEY(name: string, target: string, ...modifiers: RecordMo */ declare function PANIC(message: string): never; -/** - * **DEPRECATED**: This record type is deprecated. Please use `URL` (for temporary redirects) or `URL301` (for permanent redirects) instead. PORKBUN_URLFWD will continue to work but is no longer recommended for new configurations. - * - * `PORKBUN_URLFWD` is a [Porkbun](../../provider/porkbun.md)-specific feature that maps to Porkbun's URL forwarding feature, which creates HTTP 301 (permanent) or 302 (temporary) redirects. - * - * ```javascript - * D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), - * PORKBUN_URLFWD("urlfwd1", "http://example.com"), - * PORKBUN_URLFWD("urlfwd2", "http://example.org", {type: "permanent", includePath: "yes", wildcard: "no"}) - * ); - * ``` - * - * The fields are: - * * name: the record name - * * target: where you'd like to forward the domain to - * * type: valid types are: `temporary` (302 / 307) or `permanent` (301), default to `temporary` - * * includePath: whether to include the URI path in the redirection. Valid options are `yes` or `no`, default to `no` - * * wildcard: forward all subdomains of the domain. Valid options are `yes` or `no`, default to `yes` - * - * @see https://docs.dnscontrol.org/language-reference/domain-modifiers/service-provider-specific//porkbun_urlfwd - */ -declare function PORKBUN_URLFWD(name: string, target: string, ...modifiers: RecordModifier[]): DomainModifier; - /** * `PTR` adds a [PTR Resource record](https://www.rfc-editor.org/rfc/rfc1035) to the domain. * diff --git a/documentation/language-reference/domain-modifiers/PORKBUN_URLFWD.md b/documentation/language-reference/domain-modifiers/PORKBUN_URLFWD.md deleted file mode 100644 index c2cc0707aa..0000000000 --- a/documentation/language-reference/domain-modifiers/PORKBUN_URLFWD.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: PORKBUN_URLFWD -parameters: - - name - - target - - modifiers... -provider: PORKBUN -parameter_types: - name: string - target: string - "modifiers...": RecordModifier[] ---- - -{% hint style="warning" %} -**DEPRECATED**: This record type is deprecated. Please use `URL` (for temporary redirects) or `URL301` (for permanent redirects) instead. PORKBUN_URLFWD will continue to work but is no longer recommended for new configurations. -{% endhint %} - -`PORKBUN_URLFWD` is a [Porkbun](../../provider/porkbun.md)-specific feature that maps to Porkbun's URL forwarding feature, which creates HTTP 301 (permanent) or 302 (temporary) redirects. - - -{% code title="dnsconfig.js" %} -```javascript -D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), - PORKBUN_URLFWD("urlfwd1", "http://example.com"), - PORKBUN_URLFWD("urlfwd2", "http://example.org", {type: "permanent", includePath: "yes", wildcard: "no"}) -); -``` -{% endcode %} - -The fields are: -* name: the record name -* target: where you'd like to forward the domain to -* type: valid types are: `temporary` (302 / 307) or `permanent` (301), default to `temporary` -* includePath: whether to include the URI path in the redirection. Valid options are `yes` or `no`, default to `no` -* wildcard: forward all subdomains of the domain. Valid options are `yes` or `no`, default to `yes` diff --git a/documentation/provider/porkbun.md b/documentation/provider/porkbun.md index 74e9f74d0c..7f8b21dcfa 100644 --- a/documentation/provider/porkbun.md +++ b/documentation/provider/porkbun.md @@ -99,5 +99,5 @@ D("example.com", REG_PORKBUN, DnsProvider(DSP_PORKBUN), {% endcode %} {% hint style="info" %} -**NOTE**: The legacy `PORKBUN_URLFWD` record type is deprecated. Please use `URL` or `URL301` instead. +**NOTE**: The legacy `PORKBUN_URLFWD` record type is deprecated and is removed in v5.x. Please use `URL` or `URL301` instead. {% endhint %} diff --git a/integrationTest/helpers_integration_test.go b/integrationTest/helpers_integration_test.go index e375741964..ca65cbc851 100644 --- a/integrationTest/helpers_integration_test.go +++ b/integrationTest/helpers_integration_test.go @@ -751,12 +751,6 @@ func tlsa(name string, usage, selector, matchingtype uint8, target string) *mode return r } -func porkbunUrlfwd(name, target, t, includePath, wildcard string) *models.RecordConfig { - rc, err := globalDC.NewRecordConfig(name, defaultTTL, privatetypes.TypePORKBUNURLFWD, target, t, includePath, wildcard) - panicOnErr(err) - return rc -} - func url(name, target string) *models.RecordConfig { rc, err := globalDC.NewRecordConfig(name, defaultTTL, privatetypes.TypeURL, target, false, false) panicOnErr(err) diff --git a/integrationTest/integration_test.go b/integrationTest/integration_test.go index 896e295350..e45ecc1176 100644 --- a/integrationTest/integration_test.go +++ b/integrationTest/integration_test.go @@ -2133,15 +2133,6 @@ func makeTests() []*TestGroup { })).ExpectNoChanges(), ), - // PORKBUN features - - testgroup("PORKBUN_URLFWD tests", - only("PORKBUN"), - tc("Add a urlfwd", porkbunUrlfwd("urlfwd1", "http://example.com", "", "", "")), - tc("Update a urlfwd", porkbunUrlfwd("urlfwd1", "http://example.org", "", "", "")), - tc("Update a urlfwd with metadata", porkbunUrlfwd("urlfwd1", "http://example.org", "permanent", "no", "no")), - ), - // GCORE features testgroup("GCORE metadata tests", diff --git a/models/backfill.go b/models/backfill.go index 76480454b1..53279a5978 100644 --- a/models/backfill.go +++ b/models/backfill.go @@ -66,13 +66,6 @@ func backfill(rc *RecordConfig) error { case dnsrdatav2.OPENPGPKEY: rc.SetTarget(rd.PublicKey) - case privatetypesrdata.PORKBUNURLFWD: - if rc.Metadata == nil { - rc.Metadata = map[string]string{} - } - rc.Metadata["type"] = rd.TypeName - rc.Metadata["includePath"] = rd.IncludePath - rc.Metadata["wildcard"] = rd.Wildcard case dnsrdatav2.PTR: rc.SetTarget(rd.Ptr) diff --git a/models/domain.go b/models/domain.go index 65fad9cc22..01d4b9c9e9 100644 --- a/models/domain.go +++ b/models/domain.go @@ -198,7 +198,7 @@ func (dc *DomainConfig) Punycode() error { // Set the target: switch rec.Type { // #rtype_variations - case "ALIAS", "MX", "NS", "CNAME", "DNAME", "PTR", "SRV", "URL", "URL301", "FRAME", "R53_ALIAS", "AKAMAICDN", "AKAMAITLC", "CLOUDNS_WR", "PORKBUN_URLFWD", "BUNNY_DNS_RDR": + case "ALIAS", "MX", "NS", "CNAME", "DNAME", "PTR", "SRV", "URL", "URL301", "FRAME", "R53_ALIAS", "AKAMAICDN", "AKAMAITLC", "CLOUDNS_WR", "BUNNY_DNS_RDR": // These rtypes are hostnames, therefore need to be converted (unlike, for example, an AAAA record) t, err := idna.ToASCII(rec.GetTargetField()) if err != nil { diff --git a/models/fixhack.go b/models/fixhack.go index aa6307a4f9..3eeb2fb527 100644 --- a/models/fixhack.go +++ b/models/fixhack.go @@ -176,15 +176,6 @@ func (rc *RecordConfig) FixUp(origin string) { errorChk(err) rc.SetRDATA(rd) - case "PORKBUN_URLFWD": - // NB(tlim): Should this use privatetypesrdata.MakePORKBUNURLFWD() instead? - rc.SetRDATA(&privatetypesrdata.PORKBUNURLFWD{ - Target: rc.GetTargetField(), - TypeName: rc.Metadata["type"], - IncludePath: rc.Metadata["includePath"], - Wildcard: rc.Metadata["wildcard"], - }) - case "PTR": rd, err := MakePTR(origin, nil, rc.GetTargetField()) errorChk(err) diff --git a/models/makers.go b/models/makers.go index 18835621ef..dd6fe8fe26 100644 --- a/models/makers.go +++ b/models/makers.go @@ -233,11 +233,6 @@ func MakeOPENPGPKEY(origin string, _ map[string]string, args ...any) (dnsv2.RDAT return dnsrdatav2.OPENPGPKEY{PublicKey: mustbe.OpenPGPKey(args[0])}, nil } -func MakePORKBUNURLFWD(origin string, _ map[string]string, args ...any) (dnsv2.RDATA, error) { - mustbe.ValidArgs(args) - return privatetypesrdata.PORKBUNURLFWD{}, nil -} - func MakePTR(origin string, _ map[string]string, args ...any) (dnsv2.RDATA, error) { mustbe.ValidArgs(args) if len(args) != 1 { diff --git a/pkg/js/helpers.js b/pkg/js/helpers.js index 7ebd24b0cd..1f2d622d3b 100644 --- a/pkg/js/helpers.js +++ b/pkg/js/helpers.js @@ -1368,7 +1368,6 @@ var CLOUDNS_WR = recordBuilder('CLOUDNS_WR'); /** * @deprecated Please use URL or URL301 instead */ -var PORKBUN_URLFWD = recordBuilder('PORKBUN_URLFWD'); var BUNNY_DNS_RDR = recordBuilder('BUNNY_DNS_RDR'); // MIKROTIK_FWD(name, target, modifiers...) diff --git a/pkg/normalize/validate.go b/pkg/normalize/validate.go index 81531f978c..5dae4fc91f 100644 --- a/pkg/normalize/validate.go +++ b/pkg/normalize/validate.go @@ -569,6 +569,8 @@ func ValidateAndNormalizeConfig(config *models.DNSConfig) (errs []error) { for _, d := range config.Domains { // Check that CNAMES don't have to co-exist with any other records errs = append(errs, checkCNAMEs(d)...) + // Check that only one SOA record exist for a zone + errs = append(errs, checkMultipleSOAs(d)...) // Check that if any advanced record types are used in a domain, every provider for that domain supports them err := checkProviderCapabilities(d) if err != nil { @@ -679,6 +681,19 @@ func checkCNAMEs(dc *models.DomainConfig) (errs []error) { return } +func checkMultipleSOAs(dc *models.DomainConfig) (errs []error) { + soas := map[string]bool{} + for _, r := range dc.Records { + if r.Type == "SOA" { + if soas[r.GetLabel()] { + errs = append(errs, fmt.Errorf("%s: cannot have multiple SOAs with same name: %s", r.FilePos, r.GetLabelFQDN())) + } + soas[r.GetLabel()] = true + } + } + return +} + func checkDuplicates(records []*models.RecordConfig) (errs []error) { seen := map[string]*models.RecordConfig{} for _, r := range records { diff --git a/pkg/normalize/validate_test.go b/pkg/normalize/validate_test.go index cb53911499..4dc244f296 100644 --- a/pkg/normalize/validate_test.go +++ b/pkg/normalize/validate_test.go @@ -76,6 +76,42 @@ func TestCheckSoa(t *testing.T) { } } +func TestCheckMultipleSOAs(t *testing.T) { + dcSingleSoa := &models.DomainConfig{ + Name: "foo.com", + RegistrarName: "BIND", + Records: []*models.RecordConfig{ + makeRC("@", "foo.com", "ns1.foo.com.", models.RecordConfig{ + Type: "SOA", + SoaExpire: 1, SoaMinttl: 1, SoaRefresh: 1, SoaRetry: 1, SoaSerial: 1, SoaMbox: "bar.foo.com", + }), + }, + } + + t.Run("single_SOA", func(t *testing.T) { + errs := checkMultipleSOAs(dcSingleSoa) + if errs != nil { + t.Error("checkMultipleSOAs function failed with single SOA record") + } + }) + + dcTwoSoas := dcSingleSoa + // Add another SOA record to DC + dcTwoSoas.Records = append(dcTwoSoas.Records, + makeRC("@", "foo.com", "ns2.foo.com.", models.RecordConfig{ + Type: "SOA", + SoaExpire: 1, SoaMinttl: 1, SoaRefresh: 1, SoaRetry: 1, SoaSerial: 1, SoaMbox: "bar.foo.com", + }), + ) + + t.Run("two_SOAs", func(t *testing.T) { + errs := checkMultipleSOAs(dcTwoSoas) + if len(errs) < 1 { + t.Error("checkMultipleSOAs function failed to catch two SOAs") + } + }) +} + func TestCheckLabel(t *testing.T) { tests := []struct { label string diff --git a/pkg/privatetypes/rdata/rdata_porkbun_urlfwd.go b/pkg/privatetypes/rdata/rdata_porkbun_urlfwd.go deleted file mode 100644 index f98291bb9d..0000000000 --- a/pkg/privatetypes/rdata/rdata_porkbun_urlfwd.go +++ /dev/null @@ -1,43 +0,0 @@ -package privatetypesrdata - -import ( - "fmt" - "strings" - - dnsv2 "codeberg.org/miekg/dns" - "github.com/DNSControl/dnscontrol/v4/pkg/mustbe" - "github.com/DNSControl/dnscontrol/v4/pkg/txtutil" -) - -type PORKBUNURLFWD struct { - Target string - TypeName string - IncludePath string - Wildcard string -} - -func (rd PORKBUNURLFWD) Len() int { - return len(rd.String()) -} - -func (rd PORKBUNURLFWD) String() string { - parts := make([]string, 0, 4) - parts = append(parts, txtutil.ZoneifyString(rd.Target)) - parts = append(parts, txtutil.ZoneifyString(rd.TypeName)) - parts = append(parts, txtutil.ZoneifyString(rd.IncludePath)) - parts = append(parts, txtutil.ZoneifyString(rd.Wildcard)) - return strings.Join(parts, " ") -} - -func MakePORKBUNURLFWD(origin string, _ map[string]string, args ...any) (dnsv2.RDATA, error) { - mustbe.ValidArgs(args) - if len(args) != 4 { - return nil, fmt.Errorf("PORKBUN_URLFWD expects 4 arguments, got %d: %+v", len(args), args) - } - return PORKBUNURLFWD{ - Target: mustbe.RawString(args[0]), - TypeName: mustbe.RawString(args[1]), - IncludePath: mustbe.RawString(args[2]), - Wildcard: mustbe.RawString(args[3]), - }, nil -} diff --git a/pkg/privatetypes/t_porkbun_urlfwd.go b/pkg/privatetypes/t_porkbun_urlfwd.go deleted file mode 100644 index 2ef83a6a19..0000000000 --- a/pkg/privatetypes/t_porkbun_urlfwd.go +++ /dev/null @@ -1,71 +0,0 @@ -package privatetypes - -import ( - "fmt" - "strconv" - - dnsv2 "codeberg.org/miekg/dns" - dnsutilv2 "codeberg.org/miekg/dns/dnsutil" - "github.com/DNSControl/dnscontrol/v4/pkg/mustbe" - privatetypesrdata "github.com/DNSControl/dnscontrol/v4/pkg/privatetypes/rdata" -) - -// PORKBUN_URLFWD - -func init() { - Register(TypePORKBUNURLFWD, "PORKBUN_URLFWD", func() dnsv2.RR { return new(PORKBUNURLFWD) }, privatetypesrdata.MakePORKBUNURLFWD) -} - -const TypePORKBUNURLFWD = uint16(65297) - -type PORKBUNURLFWD struct { - Hdr dnsv2.Header - - privatetypesrdata.PORKBUNURLFWD - // Target string - // TypeName string - // IncludePath string - // Wildcard string -} - -// Typer interface. - -func (rr *PORKBUNURLFWD) Type() uint16 { return TypePORKBUNURLFWD } - -// RR interface. - -func (rr *PORKBUNURLFWD) Header() *dnsv2.Header { return &rr.Hdr } -func (rr *PORKBUNURLFWD) Len() int { - return rr.Hdr.Len() + rr.Data().Len() -} -func (rr *PORKBUNURLFWD) Data() dnsv2.RDATA { - return &privatetypesrdata.PORKBUNURLFWD{Target: rr.Target, TypeName: rr.TypeName, IncludePath: rr.IncludePath, Wildcard: rr.Wildcard} -} -func (rr *PORKBUNURLFWD) Clone() dnsv2.RR { - return &PORKBUNURLFWD{ - Hdr: rr.Hdr, - PORKBUNURLFWD: privatetypesrdata.PORKBUNURLFWD{ - Target: rr.Target, - TypeName: rr.TypeName, - IncludePath: rr.IncludePath, - Wildcard: rr.Wildcard, - }} -} -func (rr *PORKBUNURLFWD) String() string { - return (rr.Header().Name + "\t" + - strconv.FormatInt(int64(rr.Header().TTL), 10) + "\t" + - dnsutilv2.ClassToString(rr.Header().Class) + "\tPORKBUN_URLFWD\t" + rr.Data().String()) -} - -// Parse makes an RDATA for this type using the tokens from dnsv2's parser. -func (rr *PORKBUNURLFWD) Parse(tokens []string, s string) error { - args := TokensToArgs(tokens) - if len(args) != 4 { - return fmt.Errorf("PORKBUN_URLFWD requires exactly 4 arguments, got %d: %v", len(args), args) - } - rr.Target = mustbe.RawString(args[0]) - rr.TypeName = mustbe.RawString(args[1]) - rr.IncludePath = mustbe.RawString(args[2]) - rr.Wildcard = mustbe.RawString(args[3]) - return nil -} diff --git a/pkg/privatetypes/t_porkbun_urlfwd_test.go b/pkg/privatetypes/t_porkbun_urlfwd_test.go deleted file mode 100644 index 8c94361505..0000000000 --- a/pkg/privatetypes/t_porkbun_urlfwd_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package privatetypes - -import ( - "testing" - - dnsv2 "codeberg.org/miekg/dns" - privatetypesrdata "github.com/DNSControl/dnscontrol/v4/pkg/privatetypes/rdata" -) - -func TestPorkbunUrlfwd_Plain(t *testing.T) { - y := &PORKBUNURLFWD{ - Hdr: dnsv2.Header{Name: "example.org.", Class: dnsv2.ClassINET}, - PORKBUNURLFWD: privatetypesrdata.PORKBUNURLFWD{ - Target: "http://example.com", - TypeName: "urlfwd", - IncludePath: "no", - Wildcard: "no", - }, - } - rry, err := dnsv2.New(y.String()) - if err != nil { - t.Fatal(err) - } - if rry.String() != y.String() { - t.Fatalf("PORKBUN_URLFWD string presentations should be identical:\n%s\n%s", rry.String(), y.String()) - } -} - -func TestPorkbunUrlfwd_WithMetadata(t *testing.T) { - y := &PORKBUNURLFWD{ - Hdr: dnsv2.Header{Name: "example.org.", Class: dnsv2.ClassINET}, - PORKBUNURLFWD: privatetypesrdata.PORKBUNURLFWD{ - Target: "http://example.com", - TypeName: "urlfwd", - IncludePath: "permanent", - Wildcard: "no", - }, - } - rry, err := dnsv2.New(y.String()) - if err != nil { - t.Fatal(err) - } - if rry.String() != y.String() { - t.Fatalf("PORKBUN_URLFWD string presentations should be identical:\n%s\n%s", rry.String(), y.String()) - } -} - -func TestPorkbunUrlfwd_WithWildcard(t *testing.T) { - y := &PORKBUNURLFWD{ - Hdr: dnsv2.Header{Name: "example.org.", Class: dnsv2.ClassINET}, - PORKBUNURLFWD: privatetypesrdata.PORKBUNURLFWD{ - Target: "http://example.com", - TypeName: "urlfwd", - IncludePath: "no", - Wildcard: "yes", - }, - } - rry, err := dnsv2.New(y.String()) - if err != nil { - t.Fatal(err) - } - if rry.String() != y.String() { - t.Fatalf("PORKBUN_URLFWD string presentations should be identical:\n%s\n%s", rry.String(), y.String()) - } -} diff --git a/pkg/privatetypes/types_generate.yaml b/pkg/privatetypes/types_generate.yaml index 3fdae2fd0c..0d9b292f21 100644 --- a/pkg/privatetypes/types_generate.yaml +++ b/pkg/privatetypes/types_generate.yaml @@ -188,37 +188,6 @@ types: fields: [] test_data: [] - - name: Porkbun_Urlfwd - codepoint: 65297 - fields: - - name: Target - type: RawString - - name: TypeName - type: RawString - - name: IncludePath - type: RawString - - name: Wildcard - type: RawString - test_data: - - name: "plain" - values: - Target: http://example.com - TypeName: urlfwd - IncludePath: no - Wildcard: no - - name: "with metadata" - values: - Target: http://example.com - TypeName: urlfwd - IncludePath: permanent - Wildcard: no - - name: "with wildcard" - values: - Target: http://example.com - TypeName: urlfwd - IncludePath: no - Wildcard: yes - - name: R53_Alias codepoint: 65298 fields: diff --git a/providers/cloudns/cloudnsProvider.go b/providers/cloudns/cloudnsProvider.go index 707a918c42..480fb570c5 100644 --- a/providers/cloudns/cloudnsProvider.go +++ b/providers/cloudns/cloudnsProvider.go @@ -84,6 +84,44 @@ func init() { providers.RegisterRegistrarType(providerName, newReg) providers.RegisterCustomRecordType("CLOUDNS_WR", providerName, "") providers.RegisterMaintainer(providerName, providerMaintainer) + providers.RegisterCredsMetadata(providerName, providers.CredsMetadata{ + DisplayName: "ClouDNS", + Kind: providers.KindDNS | providers.KindRegistrar, + DocsURL: "https://docs.dnscontrol.org/provider/cloudns", + PortalURL: "https://www.cloudns.net/api-settings/", + Notes: "ClouDNS supports two auth methods: a main API user (auth-id) or a sub-user API account (sub-auth-id). Both use the same auth-password.", + Fields: []providers.CredsField{ + { + Key: "_authMethod", + Label: "Which authentication method do you want to use?", + Help: "Choose whether to authenticate with your main API auth-id or with a sub-user sub-auth-id.", + Choices: []string{"auth-id", "sub-auth-id"}, + Required: true, + Internal: true, + }, + { + Key: "auth-id", + Label: "Auth ID", + Help: "Your ClouDNS API auth-id.", + Required: true, + ShowIf: map[string]string{"_authMethod": "auth-id"}, + }, + { + Key: "sub-auth-id", + Label: "Sub-auth ID", + Help: "Your ClouDNS sub-user API sub-auth-id.", + Required: true, + ShowIf: map[string]string{"_authMethod": "sub-auth-id"}, + }, + { + Key: "auth-password", + Label: "Auth password", + Help: "The API password associated with the chosen auth-id or sub-auth-id.", + Secret: true, + Required: true, + }, + }, + }) } // GetNameservers returns the nameservers for a domain. diff --git a/providers/porkbun/porkbunProvider.go b/providers/porkbun/porkbunProvider.go index 09f1919ac2..2655a5963b 100644 --- a/providers/porkbun/porkbunProvider.go +++ b/providers/porkbun/porkbunProvider.go @@ -110,7 +110,39 @@ func init() { } providers.RegisterDomainServiceProviderType(providerName, fns, features) providers.RegisterMaintainer(providerName, providerMaintainer) - providers.RegisterCustomRecordType("PORKBUN_URLFWD", providerName, "") + providers.RegisterCredsMetadata(providerName, providers.CredsMetadata{ + DisplayName: "Porkbun", + Kind: providers.KindDNS | providers.KindRegistrar, + DocsURL: "https://docs.dnscontrol.org/provider/porkbun", + PortalURL: "https://porkbun.com/account/api", + Notes: "Porkbun requires API access to be enabled for each domain before DNSControl can manage it.", + Fields: []providers.CredsField{ + { + Key: "api_key", + Label: "API key", + Help: "The API Key generated from Porkbun API Access.", + Secret: true, + Required: true, + }, + { + Key: "secret_key", + Label: "Secret key", + Help: "The Secret Key shown when creating the Porkbun API key.", + Secret: true, + Required: true, + }, + { + Key: "max_attempts", + Label: "Max attempts (optional)", + Help: "Override retry attempts. Leave blank to use the default of 5.", + }, + { + Key: "max_duration", + Label: "Max duration (optional)", + Help: "Retry duration limit, such as 5m. Leave blank for no limit.", + }, + }, + }) providers.RegisterCustomRecordType("URL", providerName, "") providers.RegisterCustomRecordType("URL301", providerName, "") } @@ -122,7 +154,7 @@ func (c *porkbunProvider) GetNameservers(domain string) ([]*models.Nameserver, e // isURLForwardingType returns true if the record type is a URL forwarding type. func isURLForwardingType(recordType string) bool { - return recordType == "PORKBUN_URLFWD" || recordType == "URL" || recordType == "URL301" + return recordType == "URL" || recordType == "URL301" } func genComparable(rec *models.RecordConfig) string { @@ -152,7 +184,7 @@ func (c *porkbunProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, exi if record.Type == "URL301" { record.Metadata[metaType] = "permanent" } else { - // Default for URL and PORKBUN_URLFWD + // Default for URL record.Metadata[metaType] = "temporary" } } @@ -162,14 +194,6 @@ func (c *porkbunProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, exi if record.Metadata[metaWildcard] == "" { record.Metadata[metaWildcard] = "yes" } - if record.Type == "PORKBUN_URLFWD" { - printer.Warnf("`PORKBUN_URLFWD` is deprecated. Please use `URL` or `URL301` instead.\n") - if record.Metadata[metaType] == "permanent" { - record.Type = "URL301" - } else { - record.Type = "URL" - } - } } }