siennathesane / cloudflare-sync

A nice to have, MIT-licensed tool for using Cloudflare as a dynamic DNS provider.
MIT License
268 stars 19 forks source link

Tries to update AAAA record with IPv4 #12

Open DesertCookie opened 4 years ago

DesertCookie commented 4 years ago

Event though I have set type to AAAA in my config file, cloudflare-sync attempts to send an IPv4 to CloudFlare (which my PC does not have), thus resulting in a failure to update.

Are IPv6 records even supported by cloudflare-sync?

siennathesane commented 4 years ago

@DesertCookie currently they are not supported since I didn't use it at the time I wrote it (and still don't), but I could add support for it if it's a blocker for usage.

Sorry, it was a very basic MVP I wrote, mostly for myself, but if you have a need, I can totally do it, might take a bit though.

DesertCookie commented 4 years ago

Support for AAAA records would indeed be great. Don't hustle yourself though - maybe I'm quicker writing a program myself. But since IPv6 is the default since 2012 an the industry is slowly but surely transitioning, I think future-proofing your application is always a good idea.

siennathesane commented 4 years ago

I'll take a look and see how hard it would be to implement. :)

siennathesane commented 4 years ago

@DesertCookie I updated it to support AAAA records, but I can't test it because my ISP doesn't provide IPv6 addresses without some hassle. Can you test the latest commit and provide some feedback?

DesertCookie commented 4 years ago

After messing around for a while and solving several problems that caused errors to be thrown, this is the one I cannot get past: cannot unmarshal production configuration file.
My configuration file looks like this (reducted):

{
  "zone_id": "...",
  "zone_name": "domain.ext",
  "api_token": "...",
  "frequency": "30",
  "records": [
    {
      "type": "AAAA",
      "name": "sub.domain.ext",
      "proxied": true,
      "ttl": 120,
      "priority": 1
    }
  ]
}