Skip to content

Commit 9dce8e4

Browse files
meowsbitszzyalbert
authored andcommitted
cmd/devp2p: update TTL max for Cloudflare (#23885)
This was apparently recently changed by Cloudflare, and began returning an error: 'TTL must be between 60 and 86400 seconds, or 1 for Automatic' Date: 2021-11-10 15:25:20-08:00 Signed-off-by: meows <[email protected]>
1 parent 5195029 commit 9dce8e4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmd/devp2p/dns_cloudflare.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ func (c *cloudflareClient) uploadRecords(name string, records map[string]string)
133133
log.Info(fmt.Sprintf("Creating %s = %q", path, val))
134134
ttl := rootTTL
135135
if path != name {
136-
ttl = treeNodeTTL // Max TTL permitted by Cloudflare
136+
ttl = treeNodeTTLCloudflare // Max TTL permitted by Cloudflare
137+
137138
}
138139
record := cloudflare.DNSRecord{Type: "TXT", Name: path, Content: val, TTL: ttl}
139140
_, err = c.CreateDNSRecord(context.Background(), c.zoneID, record)

cmd/devp2p/dnscmd.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ var (
115115
)
116116

117117
const (
118-
rootTTL = 30 * 60 // 30 min
119-
treeNodeTTL = 4 * 7 * 24 * 60 * 60 // 4 weeks
118+
rootTTL = 30 * 60 // 30 min
119+
treeNodeTTL = 4 * 7 * 24 * 60 * 60 // 4 weeks
120+
treeNodeTTLCloudflare = 24 * 60 * 60 // 1 day
120121
)
121122

122123
// dnsSync performs dnsSyncCommand.

0 commit comments

Comments
 (0)