A simple ddns-client to update DNS records at the supported providers
606
A simple DDNS Client written in Typescript / Deno.
This project's purpose was mostly to test Deno and learn Typescript (I have a lot to learn here).
config.json and as environment variables.envfileUse environment variable DDNS_CRON to schedule it.
docker-compose.yml file# docker-compose.yml
version: "3.7"
services:
ddns_client:
container_name: ddns-client
environment:
- GD_KEY=YOUR_KEY_HERE
- GD_SECRET=YOUR_SECRET_HERE
- DDNS_CRON=1 */60 * * * *
- DDNS_LOGLEVEL=info
image: sherex/ddns-client:latest
volumes:
- "./config:/app/config"
# Creates the config directory and places config.json inside
$ docker-compose up
# Edit 'config/config.json' - I recommend VSCode to use the JSON schema.
# Start the container
$ docker-compose up # -d # Add '-d' switch to run as daemon
Check out configuration further down.
Use environment variable DDNS_CRON to schedule it.
# Creates the config directory and places config.json inside
# Replace $PWD with %cd% on Windows
$ docker run -v $PWD/config:/app/config -d -e "DDNS_CRON=1 */60 * * * *" --name ddns-client sherex/ddns-client
# Edit 'config/config.json' - I recommend VSCode to use the JSON schema.
# Start the container
$ docker start ddns-client -a # '-a' Attach STDOUT/STDERR and forward signals
Check out configuration further down.
Requires Deno
$ git clone https://github.com/sherex/ddns-client
$ cd ddns-client
# Run the client to create a template config.json
$ deno run --allow-read --allow-write --allow-net --allow-env src/index.ts
$ vim config.json # Or what editor you prefer
# Run the client
$ deno run --allow-read --allow-write --allow-net --allow-env src/index.ts
Check out configuration further down.
Check out config.template.json for an example config.
Check out config.schema.json for configuration options and description.
Tip: VS Code has great support for JSON schema.
Keys and secrets can be set as properties under each provider.
If the value ends with _ENV it will try to get the value from the corresponding env variable.
Example:
GD_KEY_ENVwill be replaced with the value of env variableGD_KEY
The minimum level to log can be configured with the environment variable DDNS_LOGLEVEL.
It can be one of the values (case insensitive):
silly | debug | verbose | info | warn | error
The default is info.
The index.docker.ts file starts index.ts as a subprocess and exits when it's done.
But if you set the environment variable DDNS_CRON to a cron string, it will stay running and start index.ts every time the cron string matches.
The docker container on Docker Hub uses this file.
It uses deno_cron for the cron jobs.
config.json $schema propterty for validationContent type
Image
Digest
Size
28.5 MB
Last updated
about 6 years ago
docker pull sherex/ddns-client