readme
This commit is contained in:
parent
2e2d723b2a
commit
4fd9a9832a
80
README.md
Normal file
80
README.md
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
# Dynamic IP Updater with Cloudflare DNS
|
||||||
|
|
||||||
|
This project is a dynamic IP updater for Cloudflare DNS records. It listens for changes in the IPv4 address of the network interface and updates the DNS records in Cloudflare accordingly.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Automatically detects changes in the public IP address.
|
||||||
|
- Updates Cloudflare DNS records when the public IP changes.
|
||||||
|
- Listens for network interface events to detect IP changes.
|
||||||
|
- Handles errors and retries updates to Cloudflare.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Rust and Cargo installed.
|
||||||
|
- Cloudflare account with API token.
|
||||||
|
- Network interface with dynamic IP address.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. **Clone the repository:**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/yourusername/dynip-cloudflare.git
|
||||||
|
cd dynip-cloudflare
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Build the project:**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo build --release
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Create configuration file:**
|
||||||
|
|
||||||
|
Create a `config.toml` file in the current directory or in the configuration directory (typically `~/.config/dynip-cloudflare/`) with the following content:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
zone_id = "your_zone_id"
|
||||||
|
api_key = "your_api_key"
|
||||||
|
domains = ["example.com", "sub.example.com"]
|
||||||
|
max_errors_in_row = 5
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
1. **Run the program:**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./target/release/dynip-cloudflare
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Logging:**
|
||||||
|
|
||||||
|
The program logs to both stderr and a rotating file located in the `logs` directory. The log level is set to `Info`.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### `config.toml`
|
||||||
|
|
||||||
|
- `zone_id`: The Zone ID of your Cloudflare domain.
|
||||||
|
- `api_key`: The API key for your Cloudflare account.
|
||||||
|
- `domains`: A list of domain names to update.
|
||||||
|
- `max_errors_in_row`: Maximum number of consecutive errors before the program stops. Will be set to 10 as default
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```toml
|
||||||
|
zone_id = "your_zone_id"
|
||||||
|
api_key = "your_api_key"
|
||||||
|
domains = ["example.com", "sub.example.com"]
|
||||||
|
max_errors_in_row = 5
|
||||||
|
```
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
|
||||||
|
The program handles errors gracefully, with retries and logging of error messages. If the number of consecutive errors exceeds `max_errors_in_row`, the program will stop.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the MIT License.
|
Loading…
x
Reference in New Issue
Block a user