Crates.io | dynaflare |
lib.rs | dynaflare |
version | 1.0.3 |
source | src |
created_at | 2024-11-17 05:15:50.059756 |
updated_at | 2024-12-10 19:35:42.15819 |
description | Simple DDNS client for Cloudflare |
homepage | |
repository | https://github.com/Yzen90/dynaflare |
max_upload_size | |
id | 1450904 |
size | 83,842 |
git clone https://github.com/Yzen90/dynaflare.git
cd dynaflare
cargo build --release
cargo install dynaflare
DynaFlare looks in the current working directory for a configuration.toml
file with the following fields:
interval
(Optional): String with one or more pairs of a positive integer immediately followed by 'days', 'h', 'min', 's', 'ms', 'μs' or 'ns'. If not provided, dynaflare will check and update de provided records only once and then exit. Otherwise dynaflare will keep runing and continuously check at this interval for public ip changes and update the dns records when necessary.
zone_id
(Required): ID of the Clouldflare Zone that contains the provided dns records.
api_token
(Required): Cloudflare API token with DNS read and edit permissions for the provided zone.
records
(Required): DNS records to update or create with the current public IPv4 address.
count_repeated_errors
(Optional): Defaults to false
. If true
, consecutive identical errors are shown only the first time, then the additional error count is shown until there is a successful request or a different error.
log_level
(Optional): The log level filter, defaults to INFO
. Valid values are TRACE
, DEBUG
, INFO
, WARN
, ERROR
, or OFF
.
configuration.toml
interval = "1min 30s"
zone_id = "cloudflare zone id here"
api_token = "cloudflare api token here"
records = ["dynamic.example.com"]
count_repeated_errors = true
A systemd service unit file template for DynaFlare is provided in the repository that can be used as follows to install a systemd service:
export DYNAFLARE_USER=dynaflare # User that the process will be executed as
export DYNAFLARE_WDIR=/usr/local/etc/dynaflare # Directory where configuration.toml is located
export DYNAFLARE_EXEC=/usr/local/bin/dynaflare # Path of dynaflare executable file
envsubst < dynaflare.service | sudo tee /etc/systemd/system/dynaflare.service
sudo systemctl start dynaflare
sudo systemctl status dynaflare
sudo systemctl enable dynaflare
[Unit]
Description=DynaFlare, a simple DDNS client for Cloudflare
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=dynaflare
WorkingDirectory=/usr/local/etc/dynaflare
ExecStart=/usr/local/bin/dynaflare
[Install]
WantedBy=multi-user.target