Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apollo-roboto/rust-cloudflare-dynamic-public-ip
Auto update cloudflare DNS entries when the public IP changes
https://github.com/apollo-roboto/rust-cloudflare-dynamic-public-ip
Last synced: 9 days ago
JSON representation
Auto update cloudflare DNS entries when the public IP changes
- Host: GitHub
- URL: https://github.com/apollo-roboto/rust-cloudflare-dynamic-public-ip
- Owner: Apollo-Roboto
- Created: 2024-08-30T04:15:58.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-12-09T00:33:00.000Z (18 days ago)
- Last Synced: 2024-12-09T01:24:12.742Z (18 days ago)
- Language: Rust
- Homepage:
- Size: 126 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rust-cloudflare-dynamic-public-ip
Update public ip in cloudflare's DNS records automatically. You never know when your ISP is pushing updates to your router and cycle your public IP, breaking DNS records, this is my solution.
## Build and test
```
cargo build
cargo test
```## Run
Create a `.env` file with the following secrets:
```env
CLOUDFLARE_TOKEN=xxx
CLOUDFLARE_ZONE_ID=b9bf66d603b6864d47a45ed8ebf36c8f
````CLOUDFLARE_ZONE_ID` can be a comma seperated list for multiple domains.
```bash
# display help
cargo run -- --help# get the current ip
cargo run -- current# see the affected DNS records
cargo run -- check# monitor changes and update cloudflare DNS record
cargo run -- monitor
```### Docker
```
docker run --rm -it --env-file .env ghcr.io/apollo-roboto/rust-cloudflare-dynamic-public-ip:latest
```## MQTT
MQTT can be configured with environment variables and is enabled with `MQTT_ENABLED=true`
All variables:
```env
MQTT_ENABLED
MQTT_HOST # required
MQTT_PORT # defaults to 1883
MQTT_ID # default will have a random id similar to cfdpip-xxxxxx
MQTT_BASE_TOPIC # defaults to cfdpip
```### Topics
| Topic | Example Payload |
|-------|-----------------|
| `cfdpip/ipchange` | `{ "old": "1.2.3.4", "new": "1.2.3.5" }` |