This application can be used to periodically check for IP changes and update Cloudflare DNS records accordingly.
You will need to supply the following environment variables:
RUST_LOG
: The log level for the application. Valid values aretrace
,debug
,info
,warn
,error
CLOUDFLARE_API_KEY
: Your Cloudflare API keyCLOUDFLARE_EMAIL
: The email address associated with your Cloudflare accountCLOUDFLARE_ZONE_ID
: The ID of the zone you want to monitor
export RUST_LOG=info
export [email protected]
export CLOUDFLARE_API_KEY=9351d89f6b1gdc2c0b0a5ef8c75d28eb8bf96
export CLOUDFLARE_ZONE=f681de33cd6c1eb8eb1bb7e8bd801222
cargo run --release
docker run jofish89/cloudflare-ddns:latest \
-e RUST_LOG=info \
-e [email protected] \
-e CLOUDFLARE_API_KEY=9351d89f6b1gdc2c0b0a5ef8c75d28eb8bf96 \
-e CLOUDFLARE_ZONE=f681de33cd6c1eb8eb1bb7e8bd801222
apiVersion: batch/v1
kind: CronJob
metadata:
name: cloudflare-ddns-job
spec:
schedule: "0 * * * *" # Hourly
jobTemplate:
spec:
template:
spec:
containers:
- name: cloudflare-ddns
image: jofish89/cloudflare-ddns:latest
env:
- name: RUST_LOG
value: "info"
- name: CLOUDFLARE_EMAIL
value: "[email protected]"
- name: CLOUDFLARE_API_KEY
value: "9351d89f6b1gdc2c0b0a5ef8c75d28eb8bf96"
- name: CLOUDFLARE_ZONE
value: "f681de33cd6c1eb8eb1bb7e8bd801222"
restartPolicy: OnFailure