|
1 year ago | |
---|---|---|
LICENSE | 5 years ago | |
README.md | 1 year ago | |
cloudflare-template.sh | 1 year ago | |
cloudflare-templatev6.sh | 1 year ago | |
config4.ini | 1 year ago | |
config6.ini | 1 year ago |
README.md
Cloudflare Dynamic DNS IP Updater
This script is used to update Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP! Written in pure BASH.
Support Me
Table of Contents
Installation
git clone https://github.com/K0p1-Git/cloudflare-ddns-updater.git
Usage
This script is used with crontab. Specify the frequency of execution through crontab.
# ┌───────────── 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)
# │ │ │ │ │ ┌───────────── command to issue
# │ │ │ │ │ │
# │ │ │ │ │ │
# * * * * * /bin/bash {Location of the script}
Local variables
If you want to use your variables inside the script fill the script with them and execute it like the following example:
./cloudflare-template.sh local
Configuration file
If you want to use the configuration file to store your credentials execute the following commands:
mkdir -p ~/.cloudflare
cp config.ini ~/.cloudflare/config.ini
./cloudflare-template.sh file
Pass
If you want to use Pass you can execute the following commands:
gpg --batch --passphrase '' --quick-gen-key USER_ID default default
Execute:
pass insert -m credentials/cloudflare
Add your variables:
auth_email="" # The email used to login 'https://dash.cloudflare.com'
auth_method="" # Set to "global" for Global API Key or "token" for Scoped API Token
auth_key="" # Your API Token or Global API Key
zone_identifier="" # Can be found in the "Overview" tab of your domain
record_name="" # Which record you want to be synced
ttl="3600" # Set the DNS TTL (seconds)
proxy="false" # Set the proxy to true or false
sitename="" # Title of site "Example Site"
slackchannel="" # Slack Channel #example
slackuri="" # URI for Slack WebHook "https://hooks.slack.com/services/xxxxx"
discorduri="" # URI for Discord WebHook "https://discordapp.com/api/webhooks/xxxxx"
Tested Environments:
macOS Mojave version 10.14.6 (x86_64)
AlmaLinux 9.3 (Linux kernel: 5.14.0 | x86_64)
Debian Bullseye 11 (Linux kernel: 6.1.28 | aarch64)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Reference
This script was made with reference from Keld Norman video.