Skip to content

Commit d50aef0

Browse files
Add TLSA support for BunnyDNS (#3943)
BunnyDNS now supports TLS records on their console <!-- ## Before submiting a pull request Please make sure you've run the following commands from the root directory. bin/generate-all.sh (this runs commands like "go generate", fixes formatting, and so on) ## Release changelog section Help keep the release changelog clear by pre-naming the proper section in the GitHub pull request title. Some examples: * CICD: Add required GHA permissions for goreleaser * DOCS: Fixed providers with "contributor support" table * ROUTE53: Allow R53_ALIAS records to enable target health evaluation More examples/context can be found in the file .goreleaser.yml under the 'build' > 'changelog' key. !--> Signed-off-by: baalajimaestro <[email protected]>
1 parent 154e95f commit d50aef0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

providers/bunnydns/bunnydnsProvider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var features = providers.DocumentationNotes{
2525
providers.CanUseSOA: providers.Cannot(),
2626
providers.CanUseSRV: providers.Can(),
2727
providers.CanUseSSHFP: providers.Cannot(),
28-
providers.CanUseTLSA: providers.Cannot(),
28+
providers.CanUseTLSA: providers.Can(),
2929
providers.DocCreateDomains: providers.Can(),
3030
providers.DocDualHost: providers.Cannot(),
3131
providers.DocOfficiallySupported: providers.Cannot(),

providers/bunnydns/convert.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ func fromRecordConfig(rc *models.RecordConfig) (*record, error) {
3333
r.Tag = rc.CaaTag
3434
case recordTypeMX:
3535
r.Priority = rc.MxPreference
36+
case recordTypeTLSA:
37+
r.Value = fmt.Sprintf("%d %d %d %s", rc.TlsaUsage, rc.TlsaSelector, rc.TlsaMatchingType, rc.GetTargetField())
3638
}
3739

3840
// While Bunny DNS does not use trailing dots, it still accepts and even preserves them for certain record types.
@@ -70,6 +72,8 @@ func toRecordConfig(domain string, r *record) (*models.RecordConfig, error) {
7072
err = rc.SetTargetMX(r.Priority, recordValue)
7173
case "SRV":
7274
err = rc.SetTargetSRV(r.Priority, r.Weight, r.Port, recordValue)
75+
case "TLSA":
76+
err = rc.SetTargetTLSAString(recordValue)
7377
default:
7478
err = rc.PopulateFromStringFunc(rc.Type, recordValue, domain, nil)
7579
}
@@ -96,6 +100,7 @@ const (
96100
recordTypePTR recordType = 10
97101
recordTypeScript recordType = 11
98102
recordTypeNS recordType = 12
103+
recordTypeTLSA recordType = 15
99104
)
100105

101106
func recordTypeFromString(t string) recordType {
@@ -124,6 +129,8 @@ func recordTypeFromString(t string) recordType {
124129
return recordTypeScript
125130
case "NS":
126131
return recordTypeNS
132+
case "TLSA":
133+
return recordTypeTLSA
127134
case "BUNNY_DNS_RDR":
128135
return recordTypeRedirect
129136
default:
@@ -159,6 +166,8 @@ func recordTypeToString(t recordType) string {
159166
return "SCRIPT"
160167
case recordTypeNS:
161168
return "NS"
169+
case recordTypeTLSA:
170+
return "TLSA"
162171
default:
163172
panic(fmt.Errorf("BUNNY_DNS: native rtype %v unimplemented", t))
164173
}

0 commit comments

Comments
 (0)