Page 2 of 3

Re: Cloudflare DDNS

Posted: Mon Mar 14, 2022 9:24 am
by Lantis
As per this post (viewtopic.php?p=59708#p59708) a bit further up the page, if you’re trying to update “vpn.domain.com”, the syntax is “vpn@domain.com

Re: Cloudflare DDNS

Posted: Sat Apr 09, 2022 3:31 am
by wgblondel
I tried everything, I don't know how to make this work.
Is there a way to get a better error message than "Update failed. Ensure your configuration is valid and that you are connected to the internet." ??

Re: Cloudflare DDNS

Posted: Sat Apr 09, 2022 7:24 am
by Lantis
If you would like to provide some details of what you have tried and what hasn't worked, someone might be able to assist you.

I've never really tried it, but i suspect DDNS doesn't work as expected in Wireless Bridge mode. If that's how you're trying to use it, can you also include some details of what you're trying to achieve?

Re: Cloudflare DDNS

Posted: Sat Apr 09, 2022 9:42 am
by wgblondel
I don't know what details I can give, attached is a screenshot of the options I put. The API key I gave has authorization to modify the DNS zone of the given domain.

The error I always get is "Update failed. Ensure your configuration is valid and that you are connected to the internet.". It would be useful to get the Cloudflare API answer instead.

My router isn't in Wireless bridge mode, it is in Gateway mode and connects to another wifi router (double NAT). Sorry, my signature was old :D

EDIT: it seems I can't attach any image
EDIT2: here is the screenshot https://imgur.com/a/7pppWQC

Re: Cloudflare DDNS

Posted: Sun Apr 10, 2022 2:03 am
by Lantis
I expect your problem is also answered by this post
viewtopic.php?p=59708#p59708

Code: Select all

If you want to update a domain, enter it as "@example.com". If you want to update a subdomain enter it as "sub.domain@example.com".
So in your example (don't know if that's a real domain or dummy data): @2566335.xyz

Re: Cloudflare DDNS

Posted: Fri Jun 03, 2022 4:48 pm
by Swimmer
I'm having the same error.

Code: Select all

Update failed.  Ensure your configuration is valid and that you are connected to the internet.
Using 1.13, installed the extension for cloudflare APIv4, using:

domain name: vpn@mydomain.com
email: cloudflare_user@mydomain.com
API Key: created api token with Edit Zone privileges https://developers.cloudflare.com/api/tokens/create/)
Check: 15
Force Update: 3
IP Source: Internet

any suggestions / debug?

Re: Cloudflare DDNS

Posted: Sat Jun 04, 2022 5:41 am
by Lantis
Try running the script manually with debugging.

Code: Select all

sh /usr/lib/ddns-gargoyle/cloudflare-ddns-helper.sh your@domain.com useremail apikey localip 0 1 0
The last “0” should be changed to “1” if you are trying to update an IPV6 record.

Re: Cloudflare DDNS

Posted: Fri Jun 17, 2022 10:10 am
by Swimmer
Thank you for the reply.

Code: Select all

+ logger -t cloudflare-ddns-helper 'Cloudflare responded with an error'
+ cat /var/run/cloudflare-ddns-helper.dat
+ logger -t cloudflare-ddns-helper '{"success":false,"errors":[{"code":6003,"message":"Invalid' request 'headers","error_chain":[{"code":6103,"message":"Invalid' format 'for' X-Auth-Key 'header"}]}],"messages":[],"result":null}'
+ return 1
+ exit 3

Re: Cloudflare DDNS

Posted: Fri Jun 17, 2022 4:01 pm
by Swimmer
@lantis, I have found the issue and I was able to create a similar script but I'm having issues "greping" in busybox.

I'm currently using the following grep to identify the ID needed to update the record.

```
grep -Po '(?<="id":")[^"]*')
```
Any suggestions on replacing the grep to something busybox can understand?

The main issue is regarding authentication.
The API want a Bearer token and not a X-Auth-Key

Re: Cloudflare DDNS

Posted: Sat Jun 18, 2022 7:19 am
by Lantis
Just to clarify, you want to use an API token instead of the API Keys? The script is designed to be used with the "Global API Key" generated for your account and shouldn't require any mods to make that happen.

If you want to use the API Token, I'll probably need a full sample of the interaction to try and help you with your grep.