Skip to content

OpenSumeru/AkashaDDNS

Repository files navigation

AkashaDDNS

A simple DDNS updater using cloudflare API

Table of Contents

  1. Introduction
  2. Usage
  3. Build
  4. Dependence
  5. Rust Version

Introduction

This project is a simple small DDNS updater using cloudflare API.

Advantages

  1. Small: This would probably this smallest DDNS updater for both the size of the execution file and the memory footprint.

  2. Stable: This project has been run on my test server for months.

About the development of the project

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.

Usage

Basic Run

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"
    }
}

Auto Restart

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

Build

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

Dependence

All Third Party Library

cpp-httplib

nlohmann-json

OpenSSL (3.0+)

Build Dependence

  • 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

Rust Version

AkashaDDNS-rust