Cloudflare DDNS Script
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Nicco fb7416dbec
Merge pull request #5 from cupcakearmy/1.2.1
3 months ago
.github workflow 1 year ago
src changelog, update deps & adapt pr 3 months ago
.dockerignore pnpm & typescript 10 months ago
.gitignore changelog, update deps & adapt pr 3 months ago
.sample.env Update .sample.env 3 months ago
CHANGELOG.md changelog, update deps & adapt pr 3 months ago
Dockerfile 1.2.0 6 months ago
README.md Update README.md 3 months ago
docker-compose.yml pnpm & typescript 10 months ago
package.json changelog, update deps & adapt pr 3 months ago
pnpm-lock.yaml changelog, update deps & adapt pr 3 months ago
tsconfig.json pnpm & typescript 10 months ago

README.md

Docker DDNS Cloudflare

Docker Pulls Docker Image Size (tag) Docker Image Version (tag latest semver)

Features 🌈

  • Simple container for setting setting and updating cloudflare records to your local ip address.
  • Only makes requests if the IP has changed.
  • By default it runs once every minute and the IP is resolved by https://api.ipify.org/.

Quickstart 🚀

  1. Get your API Token here (Top right -> My Profile -> API Tokens)

Click create token. You can then use the Edit DNS Zone template. Give it a name.

  1. Create an .env file:
TOKEN=mytoken
# Or (Legacy mode)
EMAIL=my@mail.com
KEY=Global_API_Key

ZONE=example.org
DNS_RECORD=some.example.org
PROXIED=false
  1. Run the container
docker run -d --name ddns --restart always --env-file .env cupcakearmy/ddns-cloudflare

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

ENV Reference

Env Description Default
EMAIL [Legacy] E-Mail of the Cloudflare account.
KEY [Legacy] Key for authentication.
TOKEN API Token that can be used instead of EMAIL & KEY.
ZONE Cloudflare zone where your domain is.
DNS_RECORD The actual DNS record that should be updated.
PROXIED Whether the record is proxied by CloudFlare or not.
CRON Frequency of updates. */5 * * * *
RESOLVER The endpoint used to determine your public ip. https://api.ipify.org/

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/