1
0
mirror of https://github.com/EV21/dynb.git synced 2025-12-26 16:39:32 +01:00

2 Commits

Author SHA1 Message Date
05120c25e4 feat: add tzdata to Dockerfile for timezone config
You can now set your timezone with the environment variable
`TZ="Europe/Berlin"`
2022-05-26 16:10:47 +02:00
dcb3d7436b fix: 🐛 curl/libcurl doesn't support dns-server option
the latest alpine we are using for the docker image
does also drops the support for that option like debian/ubuntu/etc
2022-05-26 13:30:23 +02:00
3 changed files with 11 additions and 16 deletions

View File

@@ -7,7 +7,8 @@ apk add \
bash \ bash \
curl \ curl \
jq \ jq \
bind-tools bind-tools \
tzdata
WORKDIR /usr/src/app WORKDIR /usr/src/app

View File

@@ -155,17 +155,15 @@ services:
image: ev21/dynb image: ev21/dynb
container_name: dynb container_name: dynb
network_mode: host network_mode: host
build:
context: .
dockerfile: ./Dockerfile
environment: environment:
- DYNB_DYN_DOMAIN=dyndns.example.com - DYNB_DYN_DOMAIN=dyndns.example.com
- DYNB_SERVICE_PROVIDER=inwx - DYNB_SERVICE_PROVIDER=desec
- DYNB_UPDATE_METHOD=dyndns - DYNB_UPDATE_METHOD=dyndns
- DYNB_IP_MODE=64 - DYNB_IP_MODE=64
- DYNB_USERNAME=User42 - DYNB_USERNAME=User42
- DYNB_PASSWORD=SuperSecretPassword - DYNB_PASSWORD=SuperSecretPassword
- DYNB_INTERVAL=60 - DYNB_INTERVAL=60
- TZ=Europe/Berlin
``` ```
## environment variables ## environment variables

14
dynb.sh
View File

@@ -66,7 +66,7 @@ _response=
_statusHostname= _statusHostname=
_statusUsername= _statusUsername=
_statusPassword= _statusPassword=
_version=0.3.0 _version=0.3.2
_userAgent="DynB/$_version github.com/EV21/dynb" _userAgent="DynB/$_version github.com/EV21/dynb"
_configFile=$HOME/.local/share/dynb/.env _configFile=$HOME/.local/share/dynb/.env
_statusFile=/tmp/dynb.status _statusFile=/tmp/dynb.status
@@ -209,17 +209,12 @@ function getRemoteIP
{ {
local ip_version=$1 local ip_version=$1
local ip_check_server=$2 local ip_check_server=$2
if [[ -n $_DNS_checkServer ]]
then
curl --silent "$_interface_str" --user-agent "$_userAgent" \
--ipv"${ip_version}" --dns-servers "$_DNS_checkServer" --location "${ip_check_server}"
else
curl --silent "$_interface_str" --user-agent "$_userAgent" \ curl --silent "$_interface_str" --user-agent "$_userAgent" \
--ipv"${ip_version}" --location "${ip_check_server}" --ipv"${ip_version}" --location "${ip_check_server}"
fi local curls_status_code=$?
# shellcheck disable=2181 # shellcheck disable=2181
if [[ $? -gt 0 ]]; then if [[ $curls_status_code -gt 0 ]]; then
errorMessage "IPCheck (getRemoteIP ${1}) request failed" errorMessage "IPCheck (getRemoteIP $ip_version) request failed"
exit 1 exit 1
fi fi
} }
@@ -817,6 +812,7 @@ function main
while : while :
do do
doUpdates doUpdates
debugMessage "wait $DYNB_INTERVAL seconds until next check"
sleep $DYNB_INTERVAL sleep $DYNB_INTERVAL
done done
else doUpdates else doUpdates