openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
4.01k stars 3.49k forks source link

<ddns-scripts> Cloudflare DDNS Updater script #23385

Open Grommish opened 9 months ago

Grommish commented 9 months ago

On the following Description, new information needs to be added https://github.com/openwrt/packages/blob/fa69fdc2b081abb57fc05c8d16356b16bdfdec5c/net/ddns-scripts/Makefile#L88

If possible, adding it to the lUCI configuration editing dialog to avoid having to edit the /etc/config/ddns file directly.

Example API from https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-update-dns-record,

curl --request PUT \
  --url https://api.cloudflare.com/client/v4/zones/zone_id/dns_records/dns_record_id \
  --header 'Content-Type: application/json' \
  --header 'X-Auth-Email: ' \
  --data '{
  "content": "198.51.100.4",
  "name": "example.com",
  "proxied": false,
  "type": "A",
  "comment": "Domain verification record",
  "tags": [
    "owner:dns-team"
  ],
  "ttl": 3600
}'
brada4 commented 9 months ago

Why? API returns zone-id based on zone name.

Grommish commented 9 months ago

From the link I provided:

image

It is required to be sent. I couldn't get a successful update until I added both option id and option zone-id to the config file.

Perhaps something changed? I'm not sure what to tell you. The scripts grabs those options from the config to put in place of __ID and __ZONE_ID (I believe, I'm not looking at the script itself at the moment)

brada4 commented 9 months ago

You just describe what script is already doing.

 # extract zone id

There is no point in posting more random links.

Grommish commented 9 months ago

I'm not asking for a script update, I'm asking for a description update in the Makefile because there is no mention of what needs to be manually altered and cannot be set via the luci interface. The script can (and does) extract the value, as long as it's actually there in the config to be pulled. This is a documentation issue, which is why the OP is for the line it is, in the file it is.

On Tue, Feb 13, 2024, 12:26 AM Andrew @.***> wrote:

You just describe what script is already doing.

extract zone id

There is no point in posting more random links.

— Reply to this email directly, view it on GitHub https://github.com/openwrt/packages/issues/23385#issuecomment-1940449236, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBY6JXTK3Y6PAY2VP6N5BDYTL2R7AVCNFSM6AAAAABDEVS6ICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBQGQ2DSMRTGY . You are receiving this because you authored the thread.Message ID: @.***>

brada4 commented 9 months ago

id is email and zone-id is queried from API. You do not need extra parameters.