https://github.com/cf-jongsik/cf-ddns
Cloudflare DDNS agent
https://github.com/cf-jongsik/cf-ddns
cloudflare ddns ddns-client ddns-script ddns-updater
Last synced: 2 months ago
JSON representation
Cloudflare DDNS agent
- Host: GitHub
- URL: https://github.com/cf-jongsik/cf-ddns
- Owner: cf-jongsik
- Created: 2024-07-14T18:44:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-15T13:59:03.000Z (almost 2 years ago)
- Last Synced: 2025-09-12T05:53:43.249Z (10 months ago)
- Topics: cloudflare, ddns, ddns-client, ddns-script, ddns-updater
- Language: Shell
- Homepage: https://hub.docker.com/r/neomax7/cf-ddns
- Size: 126 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Cloudflare DNS update agent
This docker image create and update A record of Cloudflare DNS
and let you use Cloudflare as dynamic DNS service.
#INSTALLATION
##OPTION 1 - install on VM
1. clone the repo
```bash
git clone https://github.com/cf-jongsik/cf-ddns.git
```
2. install
```bash
./install.sh
```
uninstall
```bash
./uninstall.sh
```
##OPTION 2 - docker compose
1. Edit the following sample then save as docker-compose.yaml
```dockerfile
services:
cf-ddns:
image: docker.io/neomax7/cf-ddns:latest
environment:
- TOKEN=PLACE_YOUR_OWN_TOKEN # your TOKEN from Cloudflare Dashboard (require ZONE edit)
- ZONE=PLACE_YOUR_OWN_ZONE # your ZONE ID from Cloudflare Dashboard
- RECORD=PLACE_YOUR_SUBDOMAIN # Subdomain of your choice , example: test.example.com => example.com = zone , test = subdomain
#- TIMEZONE=PLACE_YOUR_TIMEZONE # OPTIONAL: for more accurate cronjob otherwise its UTC
#- CRON=* * * * * # OPTIONAL: default is every 5 min, make sure no quote or double quote
```
2. in the same directory as above file
```bash
docker compose up -d
```
##OPTION 3 - docker
```bash
docker run -d --rm --env TOKEN=YOUR_TOKEN --env ZONE=YOUR_ZONE_ID --env RECORD=RECORD_OF_CHOICE --env CRON="* * * * *" neomax7/cf-ddns:latest
```
OR use env-file
```bash
docker run -d --rm --env-file .env neomax7/cf-ddns:latest
```
#Environment Variables
This agent takes following environment variables
```bash
#required
TOKEN = Cloudflare API TOKEN with DNS EDIT permission
ZONE = ZONE ID from Cloudflare dashboard
RECORD = name of A record wish to register
#optional
CRON = typical cron schedule ex: */5 * * * *
TIMEZONE = your timezone
```
#DESCRIPTION
script content
1. \$CRON schedule fires the script
2. the script searches for the \$RECORD in your \$ZONE
3. if the \$RECORD exists, delete the record
(currently Cloudflare API doenst let you patch or put with Bearer token)
4. create the \$RECORD with public IP from ifconfig.me