Sign inSign up

linuxcontainers/cloudflare-ddns-docker

By linuxcontainers

•Updated 7 months ago

Linux Container

Image
Internet of things
1

4.1K

linuxcontainers/cloudflare-ddns-docker repository overview

⁠☁️ Cloudflare DDNS IP Updater - Docker

Lightweight Docker Container that dynamically updates the IP via Cloudflare API. Access your home network remotely via a custom domain name without a static IP!

⁠About

This is a fork of officialEmmel/cloudflare-ddns-updater⁠ script added with docker support and some notification services.

  • lightweight docker image based on latest alpine
  • written in pure BASH
  • scheduled with crond
  • notifications

Pull image from Docker Hub: linuxcontainers/cloudflare-ddns-docker⁠

⁠Configuration

⁠Example docker-compose.yml
services:
  ddns:
    image: linuxcontainers/cloudflare-ddns-docker
    restart: always
    container_name: ddns
    environment:
      - CRON_JOB=* * * * *
      - [email protected]
      - AUTH_METHOD=global
      - AUTH_KEY=abcdefgh12345
      - ZONE_IDENTIFIER=123456abcdefgh
      - RECORD_NAME=example.com
      - RECORD_TYPE=A
      - TTL=3600
      - PROXY=true
      - SITENAME=example.com
      - NOTIFICATION_LEVEL=on_success_or_error
      - NTFYURI=https://ntfy.example.com/ddns

⁠Environment variables
⁠Required
NameDescription
AUTH_EMAIL(required) Mail used to register with Cloudflare
AUTH_METHOD(required) global for Global API Key or token for Scoped API Token
ZONE_IDENTIFIER(required) Can be found in the "Overview" tab of your domain
RECORD_NAME(required) Which record you want to be synced
TTL(required) DNS TTL in seconds
PROXY(required) proxy through cloudflare network true or false
CRON_JOB(required) Array of IPs that cant access the command
⁠Notifications
NameDescription
SITENAMEUsed for notifications as identifier
NOTIFICATION_LEVELon_error to get notified only on error; on_success_or_error to get notified on success or error; always to get notified oon every try even if ip has not changed
⁠Slack
NameDescription
SLACKURISlack Uri
SLACKCHANNELSlackchannel
⁠Discord Webhook
NameDescription
DISCORDURIDiscord WebHook uri
⁠Ntfy
NameDescription
NTFYURINtfy uri and topic
⁠Telegram
NameDescription
TELEGRAM_TOKENTelegram bot token
TELEGRAM_CHAT_IDTelegram chat id
⁠How to use cron

Cron⁠ is used to schedule the script execution. You can use crontab.guru⁠ as helper to get the cron job working.

# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday 7 is also Sunday on some systems)
# │ │ │ │ │                               
# │ │ │ │ │ 
# │ │ │ │ │ 
# * * * * * 

Tag summary

Content type

Image

Digest

sha256:f96ed2269…

Size

7.1 MB

Last updated

7 months ago

docker pull linuxcontainers/cloudflare-ddns-docker