mieqq
稳了,感谢老哥
dns 好像解析不了,直接从 cloudflare api 拿 record 了
[Host]
myipv6.domain = script:ddns
[Script]
ddns = type=dns,script-path=js/ddns.js
ddns.js
$httpClient.get(
{
url: "https://api.cloudflare.com/client/v4/zones/xxxx/dns_records/xxxx",
headers: {
"X-Auth-Email": "xxxx@gmail.com",
"X-Auth-Key": "xxxxxxxxxxxxxxxxxxxx",
},
},
function (error, response, data) {
if (error) {
$done({});
} else {
let res = JSON.parse(data);
$done({ addresses: [res.result.content], ttl: 600 });
}
}
);