Skip to content
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

ddns-scripts: cloudflare: use PATCH method, minimize changes #25711

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gadall
Copy link

@gadall gadall commented Jan 8, 2025

Maintainer: me
Compile tested: none, shell-only
Run tested: mediatek/mt7622, aarch64_cortex-a53, Linksys E8450 (UBI), SNAPSHOT r0-285bdd2, tested updating A record to the current IPv4 address

Description:

Use the PATCH method which is the intended way to update an existing record with the cloudflare API, and update the "content" (rdata) only, that is, the IP address, leaving any other existing details intact.

In particular this removes the hard-coded 120 second TTL overriding the existing value set at cloudflare.

@neheb
Copy link
Contributor

neheb commented Jan 9, 2025

need to bump PKG_RELEASE

@gadall gadall force-pushed the cloudflare-ddns-patch branch from 5a8caaf to a96ec69 Compare January 9, 2025 01:26
@gadall
Copy link
Author

gadall commented Jan 9, 2025

@neheb Thanks

Using the PUT method recreates the DNS record with and only with
the newly provided data. This seems unnecessary. In particular,
we don't need to hardcode a TTL of 120. Any existing comment
would be lost too.

The only detail we need to change is the IP address. Leave everything
else as it was.

Signed-off-by: Gedalya Nie <[email protected]>
@gadall gadall force-pushed the cloudflare-ddns-patch branch from a96ec69 to 99dddb8 Compare January 9, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants