octodns / octodns-cloudflare

Cloudflare DNS provider for octoDNS
MIT License
24 stars 18 forks source link

#81: TTL to proxy status #82

Closed gmemstr closed 9 months ago

gmemstr commented 9 months ago

In #81 I described some difficulties setting the proxy status of a record when using something like a octodns_bind.ZoneFileSource source. This processor allows us to assign special meaning to a TTL to toggle the status.

Example:

processors:
  ttl-to-proxy:
    class: octodns_cloudflare.processor.ttl.TtlToProxy
    # TTL default to zero
    # ttl: 0
zones:
  exxampled.com.:
    sources:
      - config
    processors:
      - ttl-to-proxy
    targets:
      - cloudflare
# Not proxied
foobar.gmem.ca. IN 86400 CNAME cluster
# Proxied, auto-ttl set
foobar.gmem.ca. IN 0 CNAME cluster
ross commented 9 months ago

You can run what CI runs locally by doing ./script/bootstrap once and then running ./script/cibuild. There's also ./script/test and ./script/coverage.

gmemstr commented 9 months ago

Updated and wrote some basic tests :)