openwrt / openwrt/packages

<ddns-scripts> ddns-scripts_cloudflare.com-v4 - subdomain problem and missing docs

Open
#10,922 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

I eventually was able to fix it by reverse engineering the code, but it took me frustratingly long, so I'd like to suggest a better (proper) implementation be made and some actual docs. Currently there are no docs on this and the interface is misleading, causing errors. The only bit of helpful info is a rather obscure post within a bug report thread in here https://github.com/openwrt/packages/issues/5097

  • Let's please fix the non-standard and undocumented subdomain@domain.com format and instead allow the expected and intuitive subdomain.domain.com like all others. I'm aware the core ddns script is splitting the fqdn but using @ is a very dirty workaround. Why not instead check if the ddns service is cloudflare-v4 and do the needful cleanly? The dirty @ can still be kept for backward compatibility (even if ugly) to prevent breaking people's current configurations.

Obviously I first tried subdomain.domain.com which actually does not fail! It changes the IP for domain.com (instead of subdomain.domain.com) which redirected my website and all services using doomain.com to my home IP. This isn't just annoying, it's an actual problem (think about an actual business website!).

  • Could I also suggest writing some actual docs for how to configure ddns with cloudflare-v4 for openwrt (both config files and LUCI GUI)?

For others (like me) who struggled, my working /etc/config/ddns is:

config ddns 'global'
        option ddns_dateformat '%F %R'
        option ddns_loglines '250'
        option upd_privateip '0'

config service 'box_ddns'
        option service_name 'cloudflare.com-v4'
        option ip_source 'web'
        option ip_url 'http://icanhazip.com'
        option lookup_host 'box.domain.com'
        option username '<your_cloudflare_email_login>'
        option password '<your_cloudflare_api_key>'
        option enabled '1'
        option use_https '1'
        option domain 'box@domain.com'

Note the box@domain.com instead of box.domain.com for the domain entry (the latter is what you actually want) and box.domain.com for the lookup_host entry. Quite confusing and non-intuitive.

If you use the LUCI DDNS GUI then use:

Lookup Hostname: box.domain.com
Domain: box@domain.com
Username: <your_cloudflare_email_login>
Password: <your_cloudflare_api_key>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the ddns-scripts cloudflare-v4 handling and the /etc/config/ddns example, then compare it with the LuCI DDNS GUI fields described in the issue. Done means subdomain.domain.com updates the intended subdomain without breaking the existing subdomain@domain.com format, with configuration guidance covering both files and LuCI.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.