Giter Club home page Giter Club logo

asuswrt-merlin-ddns-cloudflare's People

Contributors

alphabt avatar eddietx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

asuswrt-merlin-ddns-cloudflare's Issues

Allow multiple DNS Record Names to be updated

With this ddns-start script I know I can configure one DNS Record Name to work correctly.

I have a few domains at Cloudflare that I point at my router.
I run a nginx server configured with the domains on the router and it handles the domains.

How may I be able to configure multiple DNS Record Names to work correctly?
For example, domainone.org, domaintwo.com, domainthree.net all point to my router and I would like this script to accommodate them.
Currently only one domainone.org can update automatically.

Any advice is appreciated.

Stuck on "Applying Settings"

(OSX) (RT-AC66U_380.70_0.trx)

I could not successfully SSH into the router so I telnet'd and
touch /jffs/scripts/ddns-script
and
nano /jffs/scripts/ddns-script

after this I filled out variables accordingly.

I got to the "Applying Settings" screen as I hit "Save" - left it over night, but still on the same screen.

TTL issue - value needs to be in seconds not minutes

TTL is in seconds and not minutes. And the minimum TTL is 2 hours (7200 seconds) or else the API will reject it.

This script was erroring without any error messages until I started debugging with manual values, where I could finally see what the issue was. I suspect the API might've changed the TTL from seconds to minutes recently, as I had this same script going without any issue earlier this year.

IPv6 Only

Hello, I have a need, but I don't know how to modify the script. My network environment has an IPv6 public network address, but no IPv4 public network address, I want DDNS to update only IPv6. Want the script to give the user an option to UPDATE_IPv4.

Restricted API instead of Global API?

I was wondering if you had tried this with the new Restricted API keys Cloudflare has in BETA? Here is an example POST:

curl -i -X POST "https://api.cloudflare.com/client/v4/zones//purge_cache"
-H "Authorization: Bearer "
-H "Content-Type: application/json"
--data '{"purge_everything":true}'

We may be able to change the curl commands to use the new Restricted API and limit exposure to a hack instead of using the Global API key. What do you think?

FYI: https://community.cloudflare.com/t/restricted-api-keys/13647/106

Router Firmware Not Pulling IP (Suggested Addition to Script)

My router stopped updating my IP to Cloudflare a while back, but I never looked at the issue until recent after having to try to connect to my house externally. After a lot of troubleshooting, I finally figured out that the ${1} was not returning my IP, so the router was not pulling it for some reason. After looking over the original documentation at Merlin's github https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-DDNS I figured out that it could be caused by double NAT, so I updated the script and viola. Below is what I updated, hope it helps.

Added this variable to the top

DNS_QUERY_SITE="https://myip.dnsomatic.com/"    # Site used to get external DNS if router isn't able to pull it due to double NAT

Added the IF block to test if IPv4 is null, and if so then query external site to obtain IP, also updated the logger to in the failure to include IP as that's how I figured the issue out.

# Update IPv4
#Get IPv4 from Router otherwise from external source
IPv4=${1}
if [ -z "$IPv4" ]; then
  IPv4="$(curl -fs4 $DNS_QUERY_SITE)"
  logger "IP ${IPv4} obtained external source $DNS_QUERY_SITE"
else
  logger "IP ${IPv4} obtained by router"
fi

A_RECORD_IDS=$(get_dns_record_ids $RECORD_NAME A $API_TOKEN $ZONE_ID)

for A_RECORD_ID in $A_RECORD_IDS; do
  RESPONSE="$(update_dns_record $RECORD_NAME $A_RECORD_ID A $IPv4 $RECORD_TTL $API_TOKEN $ZONE_ID)"
  echo $RESPONSE | grep '"success":\ *true' >/dev/null

  if [ $? -eq 0 ]; then
    logger "Updated A record for ${RECORD_NAME} to ${IPv4}"
  else
    logger "Unable to update A record for ${RECORD_NAME} with ${IPv4}"
    RESULT=false
  fi
done

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.