woshiluo / cloudflare-ddns

Yet another ddns client over cloudflare api written by rust.
GNU General Public License v3.0
2 stars 0 forks source link

Provide an example please #1

Open barolo opened 1 month ago

barolo commented 1 month ago

How would I go about translating the following request?

curl --request POST \
        --url https://api.cloudflare.com/client/v4/zones/f098v34v3378f2dd32dkfb324kf43f5/dns_records \
        --header 'Content-Type: application/json' \
        --header 'X-Auth-Email: iiiiiii@proton.me' \
        --header 'X-Auth-Key:  fwfwefgfgegrgbrebg'\
    --data '{
    "content": "198.51.100.4",
    "name": "example",
    "proxied": false,
    "type": "A",
    "comment": "Domain verification record",
    "id": "023e10ujnviu43hg8734hvb3h372d0c353",
    "tags": [],
    "ttl": 3600
  }'
woshiluo commented 1 month ago

sorry for my slow responding.

here is an easy service to provide a simple ddns service.

Currently,it only support to automatic get your public ipv4 address and set it as your domain's A record ( and get your ipv6 address from your network interfaces then set AAAA record )

I may soon add the support for custom ip address or get private ip address from network interfaces.

If you need example for usage above, here it is

/usr/bin/cloudflare-ddns --token CF_TOKEN --zone DOMAIN --domain SUB_DOMAIN --ipserver SERVER --ipv6-device eth0