Update ddclient config
Some checks failed
Deploy to Fighter / Deploy (push) Failing after 1s
Deploy to Fighter / Notify (push) Successful in 1s

This commit is contained in:
Joey Hafner 2024-05-28 13:07:30 -07:00
parent 9dcb3186da
commit b3fbe645d3
2 changed files with 31 additions and 39 deletions

View File

@ -15,4 +15,13 @@ docker-compose up -d --force-recreate
First we export the variables in the `ddclient_secrets.env` file (which are all simple key-value pairs). Then, the [`envsubst`](https://www.baeldung.com/linux/envsubst-command) command looks for env variable references (like `$USER_Jafner_chat`) in the `ddclient.template` file (via stdin) and replaces them with the values from the current shell. We remove the secrets from the shell to preserve security. Finally, we recreate the container to apply the new settings. First we export the variables in the `ddclient_secrets.env` file (which are all simple key-value pairs). Then, the [`envsubst`](https://www.baeldung.com/linux/envsubst-command) command looks for env variable references (like `$USER_Jafner_chat`) in the `ddclient.template` file (via stdin) and replaces them with the values from the current shell. We remove the secrets from the shell to preserve security. Finally, we recreate the container to apply the new settings.
[StackOverflow - Set environment variables from file of ke/value pairs](https://stackoverflow.com/questions/19331497/set-environment-variables-from-file-of-key-value-pairs) [StackOverflow - Set environment variables from file of ke/value pairs](https://stackoverflow.com/questions/19331497/set-environment-variables-from-file-of-key-value-pairs)
## Getting credentials for Cloudflare domains
Cloudflare requires a token to be set in the `ddclient_secrets.env` file, which is not stored in Git. To get this token, we need to log into our Cloudflare account and go to the [API Tokens page](https://dash.cloudflare.com/profile/api-tokens). We create a new token with the following permissions:
- Name: `ddclient <zone_name>`
- Permissions: Zone DNS Edit
- Zone Resources: Include Specific zone, <zone_name>
- IP Filtering: Off
- TTL: None.

View File

@ -1,43 +1,26 @@
# jafner.dev daemon=300
syslog=yes
pid=/var/run/ddclient/ddclient.pid
ssl=no
use=web use=web
web=dynamicdns.park-your-domain.com/getip
protocol=googledomains
daemon=1800
ssl=yes
login=$USER_Jafner_dev
password=$PASS_Jafner_dev
@.jafner.dev, *.jafner.dev
# jafner.chat # jafner.dev
use=web protocol=cloudflare, \
web=dynamicdns.park-your-domain.com/getip zone=jafner.dev,\
web-skip='IP Address' ttl=1,\
protocol=cloudflare password='$TOKEN_Jafner_dev', \
daemon=1800 jafner.dev
ssl=yes
login=$USER_Jafner_chat
password=$PASS_Jafner_chat
zone=jafner.chat
jafner.chat,*.jafner.chat
# jafner.net # jafner.net
use=web protocol=cloudflare, \
web=dynamicdns.park-your-domain.com/getip zone=jafner.net, \
web-skip='IP Address' ttl=1, \
protocol=cloudflare password='$TOKEN_Jafner_net', \
daemon=1800 jafner.net, *.jafner.net
ssl=yes
login=$USER_Jafner_net
password=$PASS_Jafner_net
zone=jafner.net
jafner.net,*.jafner.net
# meganmcdonough.art # jafner.chat
use=web protocol=cloudflare,\
web=dynamicdns.park-your-domain.com/getip zone=jafner.chat,\
protocol=googledomains ttl=1,\
daemon=1800 password='$TOKEN_Jafner_chat',\
ssl=yes jafner.chat, *.jafner.chat
login=$USER_Meganmcdonough_art
password=$PASS_Meganmcdonough_art
meganmcdonough.art