A simple DDNS updater using cloudflare API
This project is a simple small DDNS updater using cloudflare API.
-
Small: This would probably this smallest DDNS updater for both the size of the execution file and the memory footprint.
-
Stable: This project has been run on my test server for months.
We try to use cpp-httplib to make a fully C++ based DDNS updater while most DDNS projects are based on Python or Go. Make C++ Great Again.
Run this project
./AkashaDDNS config.json
To write config.json, you should replace all 123 in the following json example.
API Key must include the accessibility to read and edit the API Key Type
. API-Key-Type have two choice Auth
or other else. This depend on whether your api key is for your or not.
IP Version must be IPv4
or IPv6
.
{
"Header":
{
"API-Key-Type":"Zone",
"API-Key":"123",
"Email":"test@example.com"
},
"Zone":
{
"Name":"example.com"
},
"Target":
{
"DNS-Name":"test.example.com"
},
"Setting":
{
"IP-Version":"IPv4"
}
}
To make AkashaDDNS a service, you can run this code by shell. Please replace /path/to into your path.
sudo su
cat << EOF > /etc/systemd/system/akashaddns.service
Description=AkashaDDNS Service
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/path/to/AkashaDDNS /path/to/config.json
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable akashaddns
To start or stop AkashaDDNS
sudo systemctl start akashaddns
sudo systemctl stop akashaddns
To look up the log of AkashaDDNS
sudo systemctl status akashaddns
Please Install All Dependence before building.
To build debug version, run
make AkashaDDNS
To build other versions, run
make AkashaDDNS Version=release
make AkashaDDNS Version=release-min
To build all versions, run
make all
OpenSSL (3.0+)
- OpenSSL (3.0+) You should install it follow the instruction in cpp-httplib
- nlohmann-json You should install it into your system include path
- cpp-httplib