Cloudflare DDNS Script
Go to file
2020-07-23 12:52:07 +02:00
.gitignore new version 2020-07-23 12:52:07 +02:00
.sample.env new version 2020-07-23 12:52:07 +02:00
docker-compose.yml container name and from image 2019-01-22 13:03:56 +01:00
Dockerfile new version 2020-07-23 12:52:07 +02:00
package.json new version 2020-07-23 12:52:07 +02:00
README.md new version 2020-07-23 12:52:07 +02:00
script.js new version 2020-07-23 12:52:07 +02:00
yarn.lock new version 2020-07-23 12:52:07 +02:00

Docker DDNS Cloudflare

Simple container for setting setting and updating to your local ip address. Only makes requests if the IP has changed since last time. By default it runs once every minute and the IP is resolved by https://canihazip.com.

Quickstart 🚀

  1. Get yout api token here (Top right -> My Profile -> Scroll Down -> Global Api Key)

  2. Create an .env file:

EMAIL=my@mail.com
KEY=my_api_key
ZONE=example.org
DNS_RECORD=some.example.org
  1. Run the container
docker run -d --name ddns --restart always --env-file .env cupcakearmy/ddns-cloudflare

To check logs:

docker logs ddns

Docker-Copmose

With docker-compose:

git clone https://github.com/CupCakeArmy/docker-ddns-cloudflare.git
cp .sample.env .env
# Edit the .env file with your data
docker-compose up -d

Customize

Custom CRON

By default the script runs every 5 minutes. You can customize this by simply setting the CRON value in the .env file.

# .env

# e.g. every minute
CRON=* * * * *

Custom Resolver

By default the script checks the own ip by calling https://api.ipify.org/. This also can be configured. It has to be an endpoint that return a plain text containing the ip by get request.

# .env

RESOLVER=https://ipv4.icanhazip.com/