XIU2/CloudflareSpeedTest · error
[错误] 缺少配置项 [PROXIED] !
Error message
[错误] 缺少配置项 [PROXIED] !
What it means
_READ() requires PROXIED from cfst_ddns.conf (grep 'PROXIED=' | awk -F '=' '{print $NF}') and exits 1 at script/cfst_ddns.sh:31 when empty. The value is spliced raw as a JSON boolean — "proxied":${PROXIED} (lines 53/59) — so it must be exactly true or false; anything else produces an invalid JSON body and Cloudflare rejects the PUT.
Source
Thrown at script/cfst_ddns.sh:31
CONFIG=$(cat "cfst_ddns.conf")
FOLDER=$(echo "${CONFIG}"|grep 'FOLDER='|awk -F '=' '{print $NF}')
[[ -z "${FOLDER}" ]] && echo -e "[错误] 缺少配置项 [FOLDER] !" && exit 1
ZONE_ID=$(echo "${CONFIG}"|grep 'ZONE_ID='|awk -F '=' '{print $NF}')
[[ -z "${ZONE_ID}" ]] && echo -e "[错误] 缺少配置项 [ZONE_ID] !" && exit 1
DNS_RECORDS_ID=$(echo "${CONFIG}"|grep 'DNS_RECORDS_ID='|awk -F '=' '{print $NF}')
[[ -z "${DNS_RECORDS_ID}" ]] && echo -e "[错误] 缺少配置项 [DNS_RECORDS_ID] !" && exit 1
KEY=$(echo "${CONFIG}"|grep 'KEY='|awk -F '=' '{print $NF}')
[[ -z "${KEY}" ]] && echo -e "[错误] 缺少配置项 [KEY] !" && exit 1
EMAIL=$(echo "${CONFIG}"|grep 'EMAIL='|awk -F '=' '{print $NF}')
[[ -z "${EMAIL}" ]] && echo -e "[信息] 缺少配置项 [EMAIL],由 [API 密钥] 方式转为 [API 令牌] 方式!"
TYPE=$(echo "${CONFIG}"|grep 'TYPE='|awk -F '=' '{print $NF}')
[[ -z "${TYPE}" ]] && echo -e "[错误] 缺少配置项 [TYPE] !" && exit 1
NAME=$(echo "${CONFIG}"|grep 'NAME='|awk -F '=' '{print $NF}')
[[ -z "${NAME}" ]] && echo -e "[错误] 缺少配置项 [NAME] !" && exit 1
TTL=$(echo "${CONFIG}"|grep 'TTL='|awk -F '=' '{print $NF}')
[[ -z "${TTL}" ]] && echo -e "[错误] 缺少配置项 [TTL] !" && exit 1
PROXIED=$(echo "${CONFIG}"|grep 'PROXIED='|awk -F '=' '{print $NF}')
[[ -z "${PROXIED}" ]] && echo -e "[错误] 缺少配置项 [PROXIED] !" && exit 1
}
_UPDATE() {
# 这里可以自己添加、修改 CFST 的运行参数
./cfst -o "result_ddns.txt"
# 判断结果文件是否存在,如果不存在说明结果为 0
[[ ! -e "result_ddns.txt" ]] && echo "CFST 测速结果 IP 数量为 0,跳过下面步骤..." && exit 0
CONTENT=$(sed -n "2,1p" result_ddns.txt | awk -F, '{print $1}')
if [[ -z "${CONTENT}" ]]; then
echo "CFST 测速结果 IP 数量为 0,跳过下面步骤..."
exit 0
fi
# 如果 EMAIL 变量是空的,那么就代表要使用 API 令牌方式
if [[ -n "${EMAIL}" ]]; then
# API 密钥方式(全局权限)
curl -X PUT "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/${DNS_RECORDS_ID}" \View on GitHub (pinned to 1da0c025d7)
Solutions
- Set PROXIED=true or PROXIED=false (lowercase, no quotes) in cfst_ddns.conf
- Pick false if you want cfst's IP to be the actually-resolved address; true hides it behind Cloudflare's proxy
- Re-run; _READ should now reach the end and _UPDATE will start
Example fix
# cfst_ddns.conf (before) PROXIED= # (after) PROXIED=false
Defensive patterns
Strategy: validation
Validate before calling
proxied=$(grep '^PROXIED=' cfst_ddns.conf | head -1 | cut -d= -f2-)
[[ $proxied == true || $proxied == false ]] || { echo "PROXIED must be true|false, got '$proxied'" >&2; exit 1; } Type guard
is_json_bool(){ [[ $1 == true || $1 == false ]]; } Prevention
- Only the lowercase bare words true/false are valid — the value becomes a JSON boolean verbatim
- If you proxy the record, the optimized IP is hidden behind Cloudflare (use a second unproxied name for testing)
- Add the true/false check to a preflight so a typo fails before the PUT, not inside Cloudflare's parser
When it happens
Trigger: cfst_ddns.conf has a missing, commented, or empty 'PROXIED=' line.
Common situations: User leaves the sample blank; enters 'yes'/'no'/'True' (capitalized) which breaks the JSON literal; a template from an older version lacks the key entirely.
Related errors
AI-assisted analysis of XIU2/CloudflareSpeedTest@1da0c025d7 (2026-08-15).
Data as JSON: /api/errors/3a40b9890d448ba1.
Report an issue: GitHub.