Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imzlh/cloudflare-njs-ddns
Cloudflare DDNS impl for Nginx-NJS
https://github.com/imzlh/cloudflare-njs-ddns
cloudflare ddns-updater nginx njs
Last synced: 4 days ago
JSON representation
Cloudflare DDNS impl for Nginx-NJS
- Host: GitHub
- URL: https://github.com/imzlh/cloudflare-njs-ddns
- Owner: imzlh
- Created: 2024-08-05T10:18:02.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2024-08-05T10:28:11.000Z (about 2 months ago)
- Last Synced: 2024-09-25T00:28:11.484Z (9 days ago)
- Topics: cloudflare, ddns-updater, nginx, njs
- Language: TypeScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# CFDDNS-njs
Use your NGINX to auto update your domain record!
Easy-to-use, single-file, full NJS feature!add this to your custom nginx.conf
js_import ddns from cfddns.js;
js_shared_dict_zone zone=njs:1m type=string;
location @ddns{
js_var $ddns_cf_token "[CloudFlare API Token]";
js_var $ddns_cf_domain "[domain, for example: imzlh.top]";
js_var $ddns_cf_record_name "[full domain, for example: cloud.imzlh.top]";
js_var $ddns_cf_record_type "[AAAA for ipv6, A for ipv4]";
js_var $ddns_ipapi "[https://6.ipw.cn for ipv6, https://4.ipw.cn for ipv4]";
js_var $ddns_cache njs.cfddns;
js_periodic ddns.main interval=60s;
}And then, your ddns WORKS!
2024/08/05 18:16:30 [info] 2779#0: js: Cache miss for imzlh.top
2024/08/05 18:16:33 [info] 2779#0: js: No need to update cloud.imzlh.top.imzlh.top (AAAA) to 2409:...If you want to know status, just add it to `nginx.conf` and visit `/@ddns`:
location = /@ddns{
js_var $ddns_cache "njs.cfddns";
js_content ddns.status;
}