ddclient packaged into a Docker container with a FastAPI-based backend API and optional integragion with healthchecks.io.
- Runs
ddclientto update dynamic DNS records. - Exposes a FastAPI-based API to expose execution information.
- Pings
healthchecks.iowith the status ofddclientruns (see API Endpoints). - Allows mounting a custom
ddclient.confconfiguration file.
- Docker
- Docker Compose (optional)
Important
The default ddclient.conf file does not contain any valid DNS domain configurations and will result in nothing happening. While the default file can be used for testing, this container is designed to have a custom ddclient.conf file supplied as a mount.
To run the container using Docker Compose, modify the sample docker-compose.yml file to meet your requirements or create a docker-compose.yml with the following content:
services:
ddclient-api:
image: ghcr.io/smith8ca/ddclient-extended:latest
container_name: ddclient-api
ports:
- "8000:8000"
environment:
- DDCLIENT_INTERVAL=360m
- HEALTHCHECKS_URL=YOUR-HC-URL
- HEALTHCHECKS_ID=YOUR-UUID
volumes:
- /path/to/your/ddclient.conf:/tmp/ddclient.conf:roTo launch with Docker Run:
docker run -d -p 8000:8000 --name ddclient-api \
-e DDCLIENT_INTERVAL=360m \
-e HEALTHCHECKS_URL=YOUR-HC-URL \
-e HEALTHCHECKS_ID=YOUR-UUID \
-v /path/to/your/ddclient.conf:/tmp/ddclient.conf:ro \
ghcr.io/smith8ca/ddclient-extended:latestBe sure to update the environment variables accordingly. See the Environment Variables section for more information.
First, clone the repository:
git clone https://github.com/smith8ca/ddclient-extended.gitBuild the Docker image by running the following:
docker build -t ddclient-extended .
By default, the curl command used to ping healthchecks has the --insecure flag enabled to avoid issues with self-signed certificates typically used in self-hosted environments. Otherwise, the curl commands will fail. You can read more about this behavior here.
If you are self-hosting Healthchecks and you would like the healthcheck pings to communicate over HTTPS, you may supply your Certificate Authority to the container by mounting a custom ca.pem file to /etc/ssl/certs/ca.pem:ro and setting the HEALTHCHECKS_CUSTOM_CA environment variable to true as shown below:
services:
ddclient-api:
image: ghcr.io/smith8ca/ddclient-extended:latest
container_name: ddclient-api
ports:
- "8000:8000"
environment:
- HEALTHCHECKS_URL=https://example.lan
- HEALTHCHECKS_ID=YOUR-UUID
- HEALTHCHECKS_CUSTOM_CA=true
volumes:
- /path/to/your/ca.pem:/etc/ssl/certs/ca.pem:roThis will force the curl command to execute healthcheck pings over HTTPS using your certificate authority.
The following environment variables can be used to configure the Docker container:
| Variable | Description | Default | Required |
|---|---|---|---|
DDCLIENT_INTERVAL |
The interval between ddclient runs | 360m | No |
HEALTHCHECKS_URL |
The base URL for healthchecks.io | N/A | No |
HEALTHCHECKS_ID |
The UUID for the healthchecks.io check | N/A | No |
HEALTHCHECKS_CUSTOM_CA |
Whether to use a custom certificate authority | false | No |
The FastAPI application exposes the following API endpoints:
- GET /last_healthcheck_status: Returns the status of the last health check.
- GET /last_healthcheck_timestamp: Returns the timestamp of the last health check.
- GET /last_update_ip: Returns the IP address of the last
ddclientupdate. - GET /last_update_status: Returns the status of the last
ddclientupdate. - GET /last_update_timestamp: Returns the timestamp of the last
ddclientupdate. - POST /run_ddclient: Manually triggers the
ddclientto run once and returns the output.
FastAPI automatically generates interactive API documentation. You can access it at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
To see the project's wishlist for upcoming features and planned improvements, please refer to the ROADMAP.md file.
- ddclient: This project uses ddclient, a Perl client used to update dynamic DNS entries for accounts on various DNS providers.
- FastAPI: This project uses FastAPI, a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints.
- Healthchecks: This project is built to work with healthchecks, an open-source cron job and background task monitoring service
This project is licensed under the GNU General Public License v3.0.