-
Notifications
You must be signed in to change notification settings - Fork 3.8k
ddns-scripts: add API-based registered IP verification for Cloudflare proxied records #28185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Why are the changes to the core needed? Why does it have to be not only the Cloudflare script that is adjusted? This is a big change, and I can't guarantee that the other providers will work if I merge it. Because I do not have all of them for testing. |
Thank you for the feedback. I agree with you about major changes to the core and have already worked on minimizing those changes. I've modified dynamic_dns_functions.sh so that the API IP retrieval is in update_cloudflare_com_v4.sh with a generalized API check in dynamic_dns_functions.sh. This allows for other providers that utilize origin proxies to use the function within their respective scripts. Also, use_api_check defaults to 0 if not specifically set so that it doesn't interfere with with other non-proxied providers. Should I replace the current files in this PR with the new changes or does this require a new PR? |
70e9697 to
1168dfa
Compare
bf02e55 to
20b95e8
Compare
20b95e8 to
d84ffd4
Compare
|
Hi @feckert, I've pushed the simplified changes as discussed. The PR now contains only: ~25 lines added to dynamic_dns_functions.sh (API check block in get_registered_ip()) Key points: use_api_check defaults to 0 — existing providers are completely unaffected Let me know if you'd like any further changes. |
feckert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source change is now OK.
However, you must update PKG_RELEASE in the Makefile and also document the new configuration use_api_check option in the uci.
Description
Problem
When using Cloudflare with proxy enabled (orange cloud), DNS lookups return Cloudflare's edge IP instead of the actual origin IP registered in the dashboard. This causes ddns-scripts to incorrectly detect IP mismatches, triggering unnecessary updates and potential rate limiting.
Solution
Add an optional
use_api_checkconfiguration option that enables provider scripts to fetch the registered IP directly via their API, bypassing DNS lookups.Changes
dynamic_dns_functions.sh:get_registered_ip()(~25 lines)use_api_checkis enabled, sources the provider script withGET_REGISTERED_IP=1flagupdate_cloudflare_com_v4.sh:GET_REGISTERED_IPmode (~15 lines)Usage
Enable in
/etc/config/ddns:Behavior
Testing
References
Testing Environment
OpenWrt mediatek/filogic 24.10.5 r29087-d9c5716d1d / LuCI openwrt-24.10 branch 25.365.52131~3ac2e08
GL.iNet GL-MT6000 ARMv8 Processor rev 4
ddns-scripts 2.8.2-r64
Test Log Output
Cloudflare with use_api_check '1' (proxied record):
No-IP without use_api_check (regression test):