cf-ddns.sh icon indicating copy to clipboard operation
cf-ddns.sh copied to clipboard

Turning off proxy

Open danartif opened this issue 8 years ago • 4 comments

When running script it turns off Proxy (Turns cloud to grey) How can i stop this?

Thanks dan

danartif avatar Oct 24 '16 01:10 danartif

This appears to be a bug in cf-ddns.sh. I hadn't noticed this behavior before, but it looks like if you do an update to the DNS record without specifying the proxy state, it defaults to off. I will work on a fix. Good catch!

As a quick and dirty workaround, you can change the end of line 269 to --data "{"id":"${zone_id}","type":"A","name":"${record_name}","content":"${WAN_addr}", "proxiable":true,"proxied":true}"`

gstuartj avatar Oct 24 '16 13:10 gstuartj

Brilliant, Appreciate it

Thank you

danartif avatar Oct 24 '16 13:10 danartif

I did edit that comment, so make sure both "proxiable" and "proxied" are set to true in that line. Thanks for bringing this to my attention.

gstuartj avatar Oct 24 '16 14:10 gstuartj

269 didn't work for me unless i done it wrong but what did work was just adding the proxy statements to this- tested with false and it turns proxy off, and also tested with true and it doesn't turn proxy off. (Unless you actually meant this line and the line number was wrong)

# Perform record update
api_dns_update=`${curl_command} -s -X PUT "${cf_api_url}/zones/${zone_id}/dns_records/${record_id}" -H "X-Auth-Email: ${cf_email}" -H "X-Auth-Key: ${cf_api_key}" -H "Content-Type: application/json" --data "{\"id\":\"${zone_id}\",\"type\":\"A\",\"name\":\"${record_name}\",\"content\":\"${WAN_addr}\", \"proxiable\":true,\"proxied\":true}"`

danartif avatar Oct 25 '16 01:10 danartif