feat: add cloudflare auto ttl

This commit is contained in:
2026-03-15 19:34:38 +03:00
parent 735e2052e8
commit 4dbe4da184
3 changed files with 27 additions and 0 deletions

14
dns.go
View File

@@ -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}
}