oznu / docker-cloudflare-ddns

A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.
https://hub.docker.com/r/oznu/cloudflare-ddns/
GNU General Public License v3.0
1.07k stars 213 forks source link

Use modern Bearer login #17

Closed jamct closed 4 years ago

jamct commented 4 years ago

Cloudflare prefers scoped API tokens instead of global API keys (which is deprecated). This PR uses Bearer token login (no E-Mail needed). In API v4 another URL for token verification must be called. The PR also adds a mandatory parameter for creating and updating a record.

To use scoped API token, navigate to cloudflare settings and create a token with the following scopes: Zone.Zone Settings, Zone.Zone, Zone.DNS

oznu commented 4 years ago

Hi @jamct,

Thanks for this. Any chance of making this backwards compatible so I don't break existing user's setups? Perhaps checking for the existence of the EMAIL variable to determine what type of call to make?

jamct commented 4 years ago

good idea.I will add a fix tomorrow.

jamct commented 4 years ago

I added a switch to make it backwards compatible.

oznu commented 4 years ago

Thanks; I'll give this a test tomorrow.