From 5358e491f3583a79755b55e6aac9aeae1aa5cee7 Mon Sep 17 00:00:00 2001 From: meowsbits Date: Thu, 11 Nov 2021 08:07:11 -0800 Subject: [PATCH] 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 --- cmd/devp2p/dns_cloudflare.go | 3 ++- cmd/devp2p/dnscmd.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/devp2p/dns_cloudflare.go b/cmd/devp2p/dns_cloudflare.go index 596254df9..d67aaea1a 100644 --- a/cmd/devp2p/dns_cloudflare.go +++ b/cmd/devp2p/dns_cloudflare.go @@ -133,7 +133,8 @@ func (c *cloudflareClient) uploadRecords(name string, records map[string]string) log.Info(fmt.Sprintf("Creating %s = %q", path, val)) ttl := rootTTL if path != name { - ttl = treeNodeTTL // Max TTL permitted by Cloudflare + ttl = treeNodeTTLCloudflare // Max TTL permitted by Cloudflare + } record := cloudflare.DNSRecord{Type: "TXT", Name: path, Content: val, TTL: ttl} _, err = c.CreateDNSRecord(context.Background(), c.zoneID, record) diff --git a/cmd/devp2p/dnscmd.go b/cmd/devp2p/dnscmd.go index 66deef56e..85f28b8cb 100644 --- a/cmd/devp2p/dnscmd.go +++ b/cmd/devp2p/dnscmd.go @@ -115,8 +115,9 @@ var ( ) const ( - rootTTL = 30 * 60 // 30 min - treeNodeTTL = 4 * 7 * 24 * 60 * 60 // 4 weeks + rootTTL = 30 * 60 // 30 min + treeNodeTTL = 4 * 7 * 24 * 60 * 60 // 4 weeks + treeNodeTTLCloudflare = 24 * 60 * 60 // 1 day ) // dnsSync performs dnsSyncCommand.