feat: add cloudflare auto ttl
This commit is contained in:
14
dns.go
14
dns.go
@@ -74,6 +74,13 @@ func buildRecord(cfg *Config) interface{} {
|
||||
"type": "A",
|
||||
"values": []string{cfg.PublicIP},
|
||||
}
|
||||
if cfg.CloudflareAutoTTL {
|
||||
aRec["octodns"] = map[string]interface{}{
|
||||
"cloudflare": map[string]interface{}{
|
||||
"auto-ttl": true,
|
||||
},
|
||||
}
|
||||
}
|
||||
if cfg.PublicIPv6 == "" {
|
||||
return aRec
|
||||
}
|
||||
@@ -82,6 +89,13 @@ func buildRecord(cfg *Config) interface{} {
|
||||
"type": "AAAA",
|
||||
"values": []string{cfg.PublicIPv6},
|
||||
}
|
||||
if cfg.CloudflareAutoTTL {
|
||||
aaaaRec["octodns"] = map[string]interface{}{
|
||||
"cloudflare": map[string]interface{}{
|
||||
"auto-ttl": true,
|
||||
},
|
||||
}
|
||||
}
|
||||
return []interface{}{aRec, aaaaRec}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user