Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/canxin121/cf-ddns
lightweight yet powerful cloudflare ddns powered by rust
https://github.com/canxin121/cf-ddns
Last synced: 2 months ago
JSON representation
lightweight yet powerful cloudflare ddns powered by rust
- Host: GitHub
- URL: https://github.com/canxin121/cf-ddns
- Owner: canxin121
- Created: 2024-09-04T14:43:37.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-09-17T04:36:16.000Z (4 months ago)
- Last Synced: 2024-09-17T07:34:29.156Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 56.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## Cf-ddns
### feature
- Cf-ddns can automatically sync the local machine's IP address with the DNS records on Cloudflare without affecting the DNS records that are manually configured on the web interface or those automatically configured by other machines running the program. This is achieved by using `comment` in the Cloudflare DNS records and a special device name to distinguish between operations performed by different machines and manual operations.
- Cf-ddns can dynamic load `config.toml`, the modified config will be automically loadded when next interval came. (Also you can immediately reload config by restart the service mannuly)
### usage
Put `config.toml` in working dictory`config.toml` example
```toml
token = "cf token"
device = "a unique device id"# Zone1
[[zones]]
name = "my-site.cn"[[zones.records]]
# required
name = "@"# below are all optional
# default: all, ["all", "v4", "v6"]
type = "all"
# default: false
proxied = true
# default: [], you should create the tag mannuly in cf web
tags = ["tag1"]
# default: "[{device}] "
comment = "a comment for this record"
# default: None
ttl = 60[[zones.records]]
name = "www"
type = "v6"
comment = "a comment for this record"[[zones.records]]
name = "alist"
type = "v6"# Zone2
[[zones]]
name = "my-site.com"[[zones.records]]
name = "@"
```Then create a service to run the program
Linux systemd example:
```
[Unit]
Description=Cloudflare DDNS Service
After=network.target[Service]
ExecStart=/opt/cf-ddns/cf-ddns
WorkingDirectory=/opt/cf-ddns
Restart=always
RestartSec=5
User=root[Install]
WantedBy=multi-user.target
```