Sign inSign up

atoy3731/cloudflare-updater

By atoy3731

Updated 3 months ago

Source: https://github.com/atoy3731/cloudflare-updater

Image
0

2.8K

atoy3731/cloudflare-updater repository overview

Cloudflare DDNS Updater

This docker image gives you the ability to update a Cloudflare DNS record via the API to manage your DDNS on a homelab.

Source

The source code can be found here: https://github.com/atoy3731/cloudflare-updater

Creating Cloudflare Token

Follow the guide here for creating a token: https://developers.cloudflare.com/api/tokens/create

Your token needs to have the following permissions for the zone you're trying to update:

  • Zone -> Zone (READ)
  • Zone -> DNS (EDIT)
Configurations

This script uses the following environment variables for configurations.

Environment VariablesDescriptionExampleRequired
CLOUDFLARE_TOKENThe API token for interacting with Cloudflare.AbCdEf12345Yes
CLOUDFLARE_ZONEThe Cloudflare zone you want to update.example.comYes
CLOUDFLARE_RECORDThe Cloudflare record you want to update*.example.comYes
CLOUDFLARE_DNS_TTLThe TTL (in minutes) for the DNS entry.1No
INTERVAL_MINSThe interval (in minutes) you want the updater to run.5No
IP_URLURL to acquire your public IP. Must return IP in plain-text.https://checkip.amazonaws.com/No
LOG_LEVELLevel for logging (info, debug, warning)infoNo
Running from Docker Compose
  1. Clone the source repository: git clone [email protected]:atoy3731/cloudflare-updater.git
  2. Go into the Docker deploy directory: cd deploy/docker
  3. Modify the docker-compose.yaml file with your configurations.
  4. Run docker-compose up -d
  5. Check logs of the container with: docker logs -f cloudflare-updater
Running in Kubernetes
  1. Clone the source repository: git clone [email protected]:atoy3731/cloudflare-updater.git
  2. Go into the K8s deploy directory: cd deploy/k8s
  3. Copy the secret.yaml.example and configmap.yaml.example files:
    cp secret.yaml.example secret.yaml
    cp configmap.yaml.example configmap.yaml
    
  4. Update secret.yaml and configmap.yaml to you specific values.
  5. Ensure you're pointing at the right Kubernetes cluster: kubectl cluster-info
  6. Apply the manifests: kubectl apply -f .

Tag summary

Content type

Image

Digest

sha256:9be54ca6c

Size

4.7 MB

Last updated

3 months ago

docker pull atoy3731/cloudflare-updater