Git Product home page Git Product logo

cloudflare-cli's Introduction

DESCRIPTION

CLI utility managing CloudFlare services - highly focused on DNS - using CloudFlare API

SYNOPSIS

Usage: cloudflare [Options] <command> <parameters>
Options:
 --details, -d    Display detailed info where possible
 --debug, -D      Display API debugging info
 --quiet, -q      Less verbose
 -E <email>
 -T <api_token>
Environment variables:
 CF_ACCOUNT  -  email address (as -E option)
 CF_TOKEN    -  API token (as -T option)
Enter "cloudflare help" to list available commands.

COMMAND REFERENCE

$ cloudflare help
Commands:
   show, add, delete, change, clear, invalidate, check
$ cloudflare show
Parameters:
   zones, settings, records, listing
$ cloudflare show zones
example.net active  #IDSTRING   OLD-NS1,OLD-NS2  NEW-NS1,NEW-NS2
$ cloudflare show settings
Usage: cloudflare show settings <zone>
$ cloudflare show settings example.net
advanced_ddos                  off
always_online                  on
automatic_https_rewrites       off
...
$ cloudflare show records
Usage: cloudflare show records <zone>
$ cloudflare show records example.net
www     auto CNAME     example.net.       ; proxiable,proxied #IDSTRING
@       auto A         198.51.100.1       ; proxiable,proxied #IDSTRING
*       3600 A         198.51.100.2       ;  #IDSTRING
...
$ cloudflare show listings
198.51.100.0/24 whitelist       2014-10-30T05:31:30.099176Z     # NOTES
198.51.100.4    block           2014-10-30T05:31:30.099176Z     # NOTES
CN              challenge       2014-10-30T05:31:30.099176Z     # NOTES
...
$ cloudflare add
Parameters:
   zone, record, whitelist, blacklist, challenge
$ cloudflare add zone
Usage: cloudflare add zone <name>
$ cloudflare add record
Usage: cloudflare add record <zone> <type> <name> <content> [ttl] [prio] [service] [protocol] [weight] [port]
   <zone>      domain zone to register the record in, see 'show zones' command
   <type>      one of: A, AAAA, CNAME, MX, NS, SRV, TXT, SPF, LOC
   <name>      subdomain name, or "@" to refer to the domain's root
   <content>   IP address for A, AAAA
               FQDN for CNAME, MX, NS, SRV
               any text for TXT, spf definition text for SPF
               coordinates for LOC (see RFC 1876 section 3)
   [ttl]       Time To Live, 1 = auto
   [prio]      required only by MX and SRV records, enter "10" if unsure
   These ones are only for SRV records:
   [service]   service name, eg. "sip"
   [protocol]  tcp, udp, tls
   [weight]    relative weight for records with the same priority
   [port]      layer-4 port number
$ cloudflare add whitelist
Usage: cloudflare add [<whitelist | blacklist | challenge>] [<IP | IP/mask | country_code>] [note]
$ cloudflare delete
Parameters:
   zone, record, listing
$ cloudflare delete zone
Usage: cloudflare delete zone <name>
$ cloudflare delete record
Usage: cloudflare delete record [<record-name> [<record-type> | first] | [<zone-name>|<zone-id>] <record-id>]
$ cloudflare delete record ftp.example.net
$ cloudflare delete record example.net 1234567890abcdef1234567890abcdef
$ cloudflare delete listing
Usage: cloudflare delete listing [<IP | IP range | country_code | ID | note_fragment>] [first]
$ cloudflare change
Parameters:
   zone, record
$ cloudflare change zone
Usage: cloudflare change zone <zone> <setting> <value> [<setting> <value> [ ... ]]
$ cloudflare change zone example.net
Settings:
   security_level [under_attack | high | medium | low | essentially_off]
   cache_level [aggressive | basic | simplified]
   rocket_loader [on | off | manual]
   minify <any variation of css, html, js delimited by comma>
   development_mode [on | off]
   mirage [on | off]
   ipv6 [on | off]
Other: see output of 'show zone' command
$ cloudflare change record
Usage: cloudflare set record <name> [type <type> | first | oldcontent <content>] <setting> <value> [<setting> <value> [ ... ]]
You must enter "type" and the record type (A, MX, ...) when the record name is ambiguous,
or enter "first" to modify the first matching record in the zone,
or enter "oldcontent" and the exact content of the record you want to modify if there are more records with the same name and type.
Settings:
  newname        Rename the record
  newtype        Change type
  content        See description in 'add record' command
  ttl            See description in 'add record' command
  proxied        Turn CF proxying on/off
$ cloudflare clear
Parameters:
   cache
$ cloudflare clear cache
Usage: cloudflare clear cache <zone>
$ cloudflare invalidate
Usage: cloudflare invalidate <url-1> [url-2 [url-3 [...]]]
$ cloudflare check
Parameters:
   zone
$ cloudflare check zone
Usage: cloudflare check zone <zone>

REQUIREMENTS

  • bash 4.x
  • curl
  • php (php-cli) 5.x

DONATE

Support me to improve cloudflare-cli

cloudflare-cli's People

Contributors

artdevjs avatar bandie91 avatar fagiani avatar felixbuenemann avatar jordantrizz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cloudflare-cli's Issues

replace json_decode to jq

json_decode is a noob json converter I wrote but likely nobody understand.
I should replace it to the more known jq.

Syntax error when adding IP to whitelist

Hello
When I add the IP to the whitelist I get the following php error

Parse error: syntax error, unexpected T_FUNCTION in Command line code on line 10
(23) Failed writing body

Regards

Use icanhazip for external IP

Rather than installing another dependency, any reason not to try icanhazip if extip is unavailable? I know the comments say insert your own script for external IP... :)

if [ ! `which extip` ]; then
  currentip=`curl icanhazip.com`
else
  currentip=`extip -q`
fi

Review Shellcheck Errors

In cloudflare line 8:
VERSION=1.0.1
^-----^ SC2034: VERSION appears unused. Verify use (or export if used externally).

In cloudflare line 39:
Version $version
^------^ SC2154: version is referenced but not assigned (did you mean 'VERSION'?).

In cloudflare line 49:
exit ${2:-1}
^-----^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
exit "${2:-1}"

In cloudflare line 53:
if [ $BASH_VERSINFO -lt 4 ]; then
^------------^ SC2128: Expanding an array without an index only gives the first element.
^------------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
if [ "$BASH_VERSINFO" -lt 4 ]; then

In cloudflare line 76:
if [ "$method" != POST -o "${1:0:1}" = '{' ]
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

In cloudflare line 95:
curl_opts+=(--$formtype "$1")
^-------^ SC2206: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

In cloudflare line 114:
output=curl -sS -H "X-Auth-Email: $CF_ACCOUNT" -H "X-Auth-Key: $CF_TOKEN" \ ^-- SC2006: Use $(...) notation instead of legacy backticked ...`.

Did you mean:
output=$(curl -sS -H "X-Auth-Email: $CF_ACCOUNT" -H "X-Auth-Key: $CF_TOKEN"
-X "$method" "${curl_opts[@]}"
"$APIv4_ENDPOINT$path$querystring" | json_decode "$@")

In cloudflare line 122:
let page++
^--------^ SC2219: Instead of 'let expr', prefer (( expr )) .

In cloudflare line 167:
php -r '
^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

In cloudflare line 258:
if('$debug') file_put_contents("php://stderr", var_export($data0, 1));
^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

In cloudflare line 397:
for zname_zid in call_cf_v4 GET /zones -- .result %"%s:%s$NL" ,name,id
^-- SC2006: Use $(...) notation instead of legacy backticked ....

Did you mean:
for zname_zid in $(call_cf_v4 GET /zones -- .result %"%s:%s$NL" ,name,id)

In cloudflare line 404:
subdomain=${BASH_REMATCH[2]}
^-------^ SC2034: subdomain appears unused. Verify use (or export if used externally).

In cloudflare line 415:
for test_record in call_cf_v4 GET /zones/$zone_id/dns_records -- .result ,name,type,id,ttl,content
^-- SC2006: Use $(...) notation instead of legacy backticked ....
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
for test_record in $(call_cf_v4 GET /zones/"$zone_id"/dns_records -- .result ,name,type,id,ttl,content)

In cloudflare line 418:
set -- $test_record
^----------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
set -- "$test_record"

In cloudflare line 432:
if [ ( -z "$record_type" -o "$test_record_type" = "$record_type" ) -a ( -z "$record_oldcontent" -o "$test_record_content" = "$record_oldcontent" ) ]
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
^-- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

In cloudflare line 434:
let rec_found++
^-------------^ SC2219: Instead of 'let expr', prefer (( expr )) .

In cloudflare line 460:
zone_id=call_cf_v4 GET /zones name="$1" -- .result ,id
^-- SC2006: Use $(...) notation instead of legacy backticked ....

Did you mean:
zone_id=$(call_cf_v4 GET /zones name="$1" -- .result ,id)

In cloudflare line 512:
source $HOME/.cloudflare
^---------------^ SC1090: Can't follow non-constant source. Use a directive to specify location.
^---^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
source "$HOME"/.cloudflare

In cloudflare line 558:
fieldspec=,id,value,'?editable?"Editable"?""','?modified_on?<",, mod: $modified_on"?""'
^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

In cloudflare line 562:
call_cf_v4 GET /zones/$zone_id/settings -- .result %"%-30s %s$TA%s%s$NL" "$fieldspec"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 GET /zones/"$zone_id"/settings -- .result %"%-30s %s$TA%s%s$NL" "$fieldspec"

In cloudflare line 572:
call_cf_v4 GET /zones/$zone_id/dns_records -- .result %"%-20s %11s %-8s %s %s$TA; %s #%s$NL"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 GET /zones/"$zone_id"/dns_records -- .result %"%-20s %11s %-8s %s %s$TA; %s #%s$NL" \

In cloudflare line 573:
',@zone_name@name,?<$ttl==1?"auto"?ttl,type,||priority||data.priority||"",content,!!proxiable proxied locked,id'
^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

In cloudflare line 576:
call_cf_v4 GET /user/firewall/access_rules/rules -- .result %"%s$TA%s$TA%s$TA# %s$NL" ',<$configuration["value"],mode,modified_on,notes'
^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

In cloudflare line 638:
call_cf_v4 POST /zones/$zone_id/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl,"priority":$prio}"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 POST /zones/"$zone_id"/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl,"priority":$prio}"

In cloudflare line 646:
set -- $content
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
set -- "$content"

In cloudflare line 661:
call_cf_v4 POST /zones/$zone_id/dns_records "{"type":"$type","ttl":$ttl,"name":"$name","data":{$locdata}}"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 POST /zones/"$zone_id"/dns_records "{"type":"$type","ttl":$ttl,"name":"$name","data":{$locdata}}"

In cloudflare line 669:
call_cf_v4 POST /zones/$zone_id/dns_records "{
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 POST /zones/"$zone_id"/dns_records "{

In cloudflare line 684:
call_cf_v4 POST /zones/$zone_id/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl}"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 POST /zones/"$zone_id"/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl}"

In cloudflare line 687:
call_cf_v4 POST /zones/$zone_id/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl,"proxied":$proxied}"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 POST /zones/"$zone_id"/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl,"proxied":$proxied}"

In cloudflare line 690:
call_cf_v4 POST /zones/$zone_id/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl,"proxied":$proxied}"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 POST /zones/"$zone_id"/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl,"proxied":$proxied}"

In cloudflare line 693:
call_cf_v4 POST /zones/$zone_id/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl}"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 POST /zones/"$zone_id"/dns_records "{"type":"$type","name":"$name","content":"$content","ttl":$ttl}"

In cloudflare line 719:
[ -z "$trg" -o -z "$trg_type" ] && die "Usage: cloudflare add [<whitelist | blacklist | challenge>] [<IP | IP/mask | country_code>] [note]"
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

In cloudflare line 721:
call_cf_v4 POST /user/firewall/access_rules/rules mode=$mode configuration[target]="$trg_type" configuration[value]="$trg" notes="$notes"
^------^ SC2102: Ranges can only match single chars (mentioned due to duplicates).

In cloudflare line 729:
call_cf_v4 POST /zones "{"name":"$1","jump_start":true}" -- .result '&<"status: $status"'
^-------------------^ SC2016: Expressions don't expand in single quotes, use double quotes for that.

In cloudflare line 752:
die "Unknown parameters: $@"
^-- SC2145: Argument mixes string and array. Use * or separate argument.

In cloudflare line 785:
call_cf_v4 DELETE /zones/$zone_id/dns_records/$record_id
^------^ SC2086: Double quote to prevent globbing and word splitting.
^--------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 DELETE /zones/"$zone_id"/dns_records/"$record_id"

In cloudflare line 791:
while read ruleid trg notes
^--^ SC2162: read without -r will mangle backslashes.

In cloudflare line 793:
if [ "$ruleid" = "$1" -o "$trg" = "$1" ] || grep -qF "$1" <<<"$notes"
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

In cloudflare line 795:
call_cf_v4 DELETE /user/firewall/access_rules/rules/$ruleid
^-----^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 DELETE /user/firewall/access_rules/rules/"$ruleid"

In cloudflare line 810:
call_cf_v4 DELETE /zones/$zone_id
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 DELETE /zones/"$zone_id"

In cloudflare line 862:
css|html|js) eval $s=on;;
^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
css|html|js) eval "$s"=on;;

In cloudflare line 877:
call_cf_v4 PATCH /zones/$zone_id/settings "{"items":[$setting_items]}"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 PATCH /zones/"$zone_id"/settings "{"items":[$setting_items]}"

In cloudflare line 919:
3) is_quiet && die || die "DNS record `$record_name' not found";;
^-- SC2015: Note that A && B || C is not if-then-else. C may run when A is true.

In cloudflare line 935:
[ "$setting" = newtype -o "$setting" = new_type ] && setting=type
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
^-----^ SC2209: Use var=$(command) to assign output (or quote to assign string).

In cloudflare line 936:
[ "$setting" = newname -o "$setting" = new_name ] && setting=name
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

In cloudflare line 941:
[ "$value" = on -o "$value" = 1 ] && value=true
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

In cloudflare line 942:
[ "$value" = off -o "$value" = 0 ] && value=false
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

In cloudflare line 946:
if [ "$setting" != content ] && ( expr "$value" : '[0-9]+$' >/dev/null || expr "$value" : '[0-9]+.[0-9]+$' >/dev/null || [ "$value" = true -o "$value" = false ] )
^-- SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

In cloudflare line 955:
call_cf_v4 PUT /zones/$zone_id/dns_records/$record_id "{$old_data,$new_data}"
^------^ SC2086: Double quote to prevent globbing and word splitting.
^--------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 PUT /zones/"$zone_id"/dns_records/"$record_id" "{$old_data,$new_data}"

In cloudflare line 970:
call_cf_v4 DELETE /zones/$zone_id/purge_cache '{"purge_everything":true}'
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 DELETE /zones/"$zone_id"/purge_cache '{"purge_everything":true}'

In cloudflare line 985:
call_cf_v4 PUT /zones/$zone_id/activation_check
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 PUT /zones/"$zone_id"/activation_check

In cloudflare line 1010:
zone_id=get_zone_id "$domain" 2>/dev/null; echo "$zone_id"
^-- SC2006: Use $(...) notation instead of legacy backticked ....

Did you mean:
zone_id=$(get_zone_id "$domain" 2>/dev/null; echo "$zone_id")

In cloudflare line 1029:
call_cf_v4 DELETE /zones/$zone_id/purge_cache "{"files":[$urls]}"
^------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
call_cf_v4 DELETE /zones/"$zone_id"/purge_cache "{"files":[$urls]}"

In cloudflare line 1039:
*|help)
^-- SC2221: This pattern always overrides a later one on line 1039.
^--^ SC2222: This pattern never matches because of a previous pattern on line 1039.

For more information:
https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array. ...
https://www.shellcheck.net/wiki/SC1090 -- Can't follow non-constant source....
https://www.shellcheck.net/wiki/SC2034 -- VERSION appears unused. Verify us...

No suitable DNS zone found

Hi @bAndie91

I'm facing another issue when trying to use the cloudflare change record subdomain.domain.co.uk proxied true command. This is what I get:

No suitable DNS zone found for `subdomain.domain.co.uk'

As this record exists (changed here on the example but kept same structure), I've then tried tweaking the regex within the findout_record() function and this line:

if [[ "$record_name" =~ ^((.*)\.|)$zone$ ]]

has become:

if [[ "$record_name" =~ (^(.*)\.)$zone$ ]]

I'm trying to understand if this is due to the depth of the TLD (.co.uk in this case) or other reason.

Any tips on something I may be doing wrong and somehow else to fix it?

If you find that this is a good solution, I can submit a PR.

Thanks one more time!

how to set CF account & CF tokens?

Hi,I am new to bash scripts.
when I run
bash cloudflare show zones
vm reply with
No $CF_ACCOUNT set.
then I run
bash cloudflare show zones -E [email protected] -T
It returns with
bash: syntax error near unexpected token `newline'
I run
bash cloudflare show zones -E [email protected] -T in-RipHRCY6-Vj
It returns with
No $CF_ACCOUNT set.
what should I do?

Thanks a lot.

Adding a new zone won't trigger jump start

Hello @bAndie91

I've tried using cloudflare add zone mydomain.com and that won't trigger the DNS discovery process as listed on the API docs. I've opened a support ticket on CloudFlare to understand how come the default value is true and it is not working unless its present on the request payload.

Regardless of this issue with their documentation, I'd like to understand if having the jump_start parameter as part of the add zone command is something desired and I can work on a PR for that.

In that case, I'd like only to make sure I get the implementation approach correctly because the only way I was able to get it working was changing this line:

call_cf_v4 POST /zones name="$1" -- .result '&<"status: $status"'

to this:

call_cf_v4 POST /zones "{\"name\":\"$1\",\"jump_start\":$2}" -- .result '&<"status: $status"'

Would something like that make sense?

Thanks again!

Existing record change issue

Hi

Just made a dummy fix on this part:

                record_content_esc=${record_content//\"/\\\"}
                old_data="\"name\":\"$record_name\",\"type\":\"$record_type\",\"ttl\":$record_ttl,\"content\":\"$record_content_esc\""
                new_data=
                while [ -n "$1" ]
                do
                        setting=$1
                        shift
                        value=$1
                        shift

                        [ "$setting" = service_mode ] && setting=proxied
                        [ "$setting" = newtype -o "$setting" = new_type ] && setting=type
                        if [ "$setting" = proxied ]
                        then
                                value=${value,,}
                                [ "$value" = on -o "$value" = 1 ] && value=true
                                [ "$value" = off -o "$value" = 0 ] && value=false
                        fi
                        [ "$setting" = type ] && value=${value^^}

                        if expr "$value" : '[0-9\.]\+$' >/dev/null || [ "$value" = true -o "$value" = false ]
                        then
                                value_escq=$value
                     else
                                value_escq=\"${value//\"/\\\"}\"
                        fi

###Amirbekyan
                        if [ "$setting" = content ]
                        then
                                value_escq=\"${value}\"
                        fi
###fin

                        new_data="$new_data${new_data:+,}\"$setting\":$value_escq"
                done

                call_cf_v4 PUT /zones/$zone_id/dns_records/$record_id "{$old_data,$new_data}"
                ;;

        *)
                die "Parameters:
   zone, record"

line 903

otherwise script wasn't adding brackets to the IP given as new parameter, e.g.

./cloudflare -E [email] -T [token] change record [domain] "type" A content 0.1.4.7

and script was ending with this error:

E9005: Content for A record is invalid. Must be a valid IPv4 address

No suitable DNS zone found

I'm having problems with delete record or change record. Somehow I always get no suitable DNS zone found altho zone and record exist.

cf delete record test.domain.com
Searching zone ...
No suitable DNS zone found for `test.domain.com'

cf show records domain.com
mx auto A 66.66.66.66 ; proxiable #queroo9oinaphiebae7eex0ain8aliez
@ auto A 66.66.66.66 ; proxiable,proxied #ieth1axei1ooquaesoo4hubai5puuhoh
test auto A 127.0.0.1 ; #ethohfoo6eiqu2jahb6oog0aenaemufe
mail auto CNAME domain.com. ; proxiable,proxied #omeojeilohxei5joh6meniutex6aahei
nabiralnik auto CNAME domain.com. ; proxiable,proxied #ower1duu7no0vuhoukiungohc1aemoo2
posta auto CNAME domain.com. ; proxiable,proxied #ieth1axei1ooquaesoo4hubai5puuhoh
www auto CNAME domain.com. ; proxiable,proxied #uah4cheil5shaechoqu2alee7wu3wua9
@ auto MX 10 mx.domain.com. ; #caech8lae7kae0geephaev3eehee0eij
@ auto TXT google-site-verification=3vXA3iRx_Ev2brRf1Xr1KhOmUPYVxPG1IT66a1MbIe4 ; #eijeephiengizaiph5qui9il4eizoo0h

Sorry if this is some kind of duplicate issue report

Change record issue still exists

Hi

Recently I opened an issue concerning the existing record change. I see you have made some changes but your version still doesn't work. It pushes IP as plain without quots:

<<< curl -X PUT -H Content-Type: application/json --data {"name":"some.domain.name","type":"A","ttl":1,"content":"0.1.4.7","content":0.1.4.7,"proxied":true} https://api.cloudflare.com/client/v4/zones/s0m3z0n3/dns_records/s0m3r3c0rd?page=1&per_page=50

the output is:
E1004: DNS Validation Error
E9041: Invalid proxied mode. Record cannot be proxied
if proxied setting is added in the end of the line, and:
E1004: DNS Validation Error
E9005: Content for A record is invalid. Must be a valid IPv4 address
if not.

command I use:
cloudflare -E [email protected] -T mYT0k3n change record some.domain.name type A content ip.add.re.ss

Regards

Requires bash 4.x

I was trying to figure out why I couldn't get this to work on OSX El Capitan, and it took me a while to realise I didn't have the correct version of bash installed. After installing this through brew and adjusting the script to use brew's version of bash it runs smoothly. Please consider adding this requirement to the docs somewhere, since a lot of webdevelopers use OSX.

end maintaining

i don't maintain this project anymore.
feel free to request ownership on this repo, and I'll transfer it to you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.