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

49 Commits

Author SHA1 Message Date
9efc3df858 minor: 📝 update CHANGELOG 2023-02-26 18:55:04 +01:00
715e548dfb minor: increase version 2023-02-26 18:51:53 +01:00
1624691612 fix: set constant alpine version as latest couses issues 2023-02-26 18:51:03 +01:00
7d66155cc1 minor: 📝 update CHANGELOG 2023-02-26 18:00:39 +01:00
fdd4d03e74 fix: incorrect dns ip handling via domrobot 2023-02-26 17:57:42 +01:00
e743532664 minor: 📝 update README 2022-11-24 22:15:47 +01:00
3d76946db5 minor: 📝 update CHANGELOG 2022-11-21 16:15:10 +01:00
0448d698ae minor: increase version 2022-11-21 16:12:08 +01:00
2ac50d326f fix: handle some curl exit codes 2022-11-21 16:09:12 +01:00
327e896754 feat: use provider checkip API 2022-11-21 10:45:16 +01:00
d44f76e1ef minor: 📝 update CHANGELOG 2022-11-10 18:03:11 +01:00
6d16b0807e doc: 📝 update default values in table 2022-11-10 18:01:19 +01:00
05a58af921 feat: use provider DNS servers 2022-11-10 16:19:51 +01:00
0eec80f604 feat: temporarily disable an ip version if the connectivity/routing does not work 2022-11-10 12:01:36 +01:00
15ea0345bd minor: 📝 update CHANGELOG 2022-11-07 22:14:38 +01:00
c1869343f6 doc: 📝 add dynu.com as DynDNS2 provider 2022-11-07 22:12:52 +01:00
b683937e59 feat: add support for dynu.com as DynDNS2 provider 2022-11-07 22:12:35 +01:00
3eb90f61f7 refactor: multiple exractions 2022-11-07 16:21:41 +01:00
c83b893fc8 minor: 📝 update CHANGELOG 2022-11-03 13:11:54 +01:00
c9794f7c22 minor: increase version 2022-11-03 13:03:40 +01:00
b8bbce7ec2 doc: 📝 change TTL to 60 for IPv64.net 2022-11-03 12:01:32 +01:00
bd6f1336b2 fix: delete status file after success 2022-11-03 10:44:10 +01:00
260bc7172f doc: 📝 add IPv64.net as DynDNS2 provider 2022-11-03 07:11:19 +01:00
a85b2bf911 fix: more status file issues 2022-11-02 21:21:01 +01:00
a496acbebf fix: incorrect status code handling
no persistent status file was written in case of an error as the return status code was always 0
2022-11-02 19:07:52 +01:00
c81da8846e feat: add support for IPv64.net as DynDNS2 provider 2022-11-02 18:09:20 +01:00
122e08a42a refactor: combine if statements 2022-11-02 15:03:44 +01:00
2352d655a3 refactor(extract method): read_config_file 2022-06-30 14:28:08 +02:00
341d535f21 minor: 📝 update CHANGELOG 2022-06-30 13:57:27 +02:00
fc2c499daa minor: increase version 2022-06-30 13:52:48 +02:00
39d5143108 minor: lint tables in README 2022-06-30 13:51:01 +02:00
e58d87cf94 doc: 📝 update providers in README 2022-06-30 13:20:49 +02:00
9d41354695 feat: add support for ddnss.de as DynDNS2 provider 2022-06-30 09:46:40 +02:00
d8a298f58a minor: change .gitignore 2022-06-30 09:30:24 +02:00
3e89610e22 minor: response output as debug message 2022-06-30 09:30:24 +02:00
faa9c371c1 refactor: extract methods 2022-06-30 09:30:09 +02:00
11fccf2f0e minor: fix typo 2022-06-12 18:41:27 +02:00
75715cb0a8 minor: 📝 update CHANGELOG 2022-06-07 10:00:10 +02:00
6313ee4347 minor: set version 0.3.3 2022-06-07 09:58:10 +02:00
f37230401f fix: wrong parameter name for DuckDNS
Co-authored-by: Qrrbrbirlbel <Qrrbrbirlbel@users.noreply.github.com>
2022-06-06 22:26:40 +02:00
d6c98c04ad doc: 📝 add comments to docker-compose.yml example 2022-05-28 15:20:16 +02:00
64a5a76b6d minor: 📝 update CHANGELOG 2022-05-26 16:15:12 +02:00
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
fa60312c0d minor: 📝 update CHANGELOG.md 2022-05-26 10:35:03 +02:00
ba6e91bbd6 dev: 🔃 strip more prefix variants from commits for changelog 2022-05-26 10:27:03 +02:00
756c17d117 fix: abort on all dig errors 2022-04-12 20:23:52 +02:00
3d1b27aaed minor: 🎨 change code style 2022-01-31 20:40:29 +01:00
8721af229d dev: add github action with shellcheck for PRs 2021-11-05 20:58:17 +01:00
7 changed files with 872 additions and 474 deletions

View File

@@ -158,7 +158,7 @@ body_process = ReSub(r'((^|\n)[A-Z]\w+(-\w+)*: .*(\n\s+.*)*)+$', r'') | strip
## ##
## Available constructs are those listed in ``body_process`` doc. ## Available constructs are those listed in ``body_process`` doc.
subject_process = (strip | subject_process = (strip |
ReSub(r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$', r'\4') | ReSub(r'^([cC]hg|[fF]ix|[nN]ew|[dD]oc|[fF]eat|[aA]dd|[cC]hange)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$', r'\4') |
SetIfEmpty("No commit message.") | ucfirst | final_dot) SetIfEmpty("No commit message.") | ucfirst | final_dot)

16
.github/workflows/shellcheck.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Run shellcheck with reviewdog
on: [pull_request]
jobs:
shellcheck:
name: runner / shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: shellcheck
uses: reviewdog/action-shellcheck@v1.9.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
path: "."
pattern: "*.sh"
exclude: "./.git/*"

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.env* .env*
docker-compose* docker-compose*
.vscode

View File

@@ -1,127 +1,228 @@
# Changelog # Changelog
## 0.5.3 (2023-02-26)
### Fix
* Set constant alpine version as latest couses issues. [Eduard Veit]
## 0.5.2 (2023-02-26)
### Fix
* Incorrect dns ip handling via domrobot. [Eduard Veit]
## 0.5.1 (2022-11-21)
### Features
* Use provider checkip API. [Eduard Veit]
### Fix
* Handle some curl exit codes. [Eduard Veit]
## 0.5.0 (2022-11-10)
### Features
* Use provider DNS servers. [Eduard Veit]
* Temporarily disable an ip version if the connectivity/routing does not work. [Eduard Veit]
### Documentation
* 📝 update default values in table. [Eduard Veit]
## 0.4.0 (2022-11-07)
### Features
* ✨ add support for dynu.com as DynDNS2 provider. [Eduard Veit]
### Documentation
* 📝 add dynu.com as DynDNS2 provider. [Eduard Veit]
## 0.3.5 (2022-11-03)
### Features
* ✨ add support for IPv64.net as DynDNS2 provider. [Eduard Veit]
### Fix
* Delete status file after success. [Eduard Veit]
* More status file issues. [Eduard Veit]
* Incorrect status code handling. [Eduard Veit]
no persistent status file was written in case of an error as the return status code was always 0
### Documentation
* 📝 change TTL to 60 for IPv64.net. [Eduard Veit]
* 📝 add IPv64.net as DynDNS2 provider. [Eduard Veit]
## 0.3.4 (2022-06-30)
### Features
* ✨ add support for ddnss.de as DynDNS2 provider. [Eduard Veit]
### Documentation
* 📝 update providers in README. [Eduard Veit]
## 0.3.3 (2022-06-07)
### Fix
* Wrong parameter name for DuckDNS. [Eduard Veit]
### Documentation
* 📝 add comments to docker-compose.yml example. [Eduard Veit]
## 0.3.2 (2022-05-26)
### Features
* ✨ add tzdata to Dockerfile for timezone config. [Eduard Veit]
You can now set your timezone with the environment variable
`TZ="Europe/Berlin"`
## 0.3.1 (2022-05-26)
### Fix
* 🐛 curl/libcurl doesn't support dns-server option. [Eduard Veit]
the latest alpine we are using for the docker image
does also drops the support for that option like debian/ubuntu/etc
## 0.3.0 (2022-05-26)
### Features
* ✨ validate ip address respons from ip check web service. [Eduard Veit]
* ✨ check internet connection for selected ip versions. [Eduard Veit]
* 🎨 colorful info, debug and error messages. [Eduard Veit]
### Fix
* Abort on all dig errors. [Eduard Veit]
### Documentation
* 📝 add labels to Dockerfile. [Eduard Veit]
## 0.2.0 (2021-09-24) ## 0.2.0 (2021-09-24)
### New ### Features
* :sparkles: enable parameter extensions for `docker run --interactive` [Eduard Veit] * enable parameter extensions for `docker run --interactive` [Eduard Veit]
* :sparkles: add pre-commit hooks for markdown. [Eduard Veit] ### Changed
* :sparkles: change git hooks and add shfmt. [Eduard Veit] * Handle dns server selection. [Eduard Veit]
* :sparkles: add pre-commit git hook for shellcheck. [Eduard Veit]
### Changes
* :wrench: remove md-toc from pre-commit. [Eduard Veit]
* :wrench: handle dns server selection. [Eduard Veit]
### Documentation ### Documentation
* :memo: update CHANGELOG.md. [Eduard Veit] * 📝 update CHANGELOG.md. [Eduard Veit]
* :memo: document docker parameters. [Eduard Veit] * 📝 document docker parameters. [Eduard Veit]
* :memo: change default dns server setting. [Eduard Veit] * 📝 change default dns server setting. [Eduard Veit]
* :memo: update CHANGELOG. [Eduard Veit] * 📝 update CHANGELOG. [Eduard Veit]
* :memo: update README.md. [Eduard Veit] * 📝 update README.md. [Eduard Veit]
### Other
* :art: lint README.md. [Eduard Veit]
* :art: add shfmt params to pre-commit check. [Eduard Veit]
* :art: fix shell style. [Eduard Veit]
* :recycle: seperate parsing logic. [Eduard Veit]
* :recycle: normalizing pre-commit configuration to a top-level map. [Eduard Veit]
* :recycle: refactorings. [Eduard Veit]
* Refactor: :recycle: remove unused help message. [Eduard Veit]
## 0.1.2 (2021-04-23) ## 0.1.2 (2021-04-23)
### Documentation ### Documentation
* :memo: document environment variables. [Eduard Veit] * 📝 document environment variables. [Eduard Veit]
### Other
* :recycle: refactor: method extractions and other beautifications. [Eduard Veit]
## 0.1.1 (2021-04-23) ## 0.1.1 (2021-04-23)
### Fix ### Fix
* :bug: fix loop and error handling in case of connection issues. [Eduard Veit] * 🐛 fix loop and error handling in case of connection issues. [Eduard Veit]
## 0.1.0 (2021-04-22) ## 0.1.0 (2021-04-22)
### New ### Features
* :sparkles: add Dockerfile. [Eduard Veit] * add Dockerfile. [Eduard Veit]
* :sparkles: add loop mode. [Eduard Veit] * add loop mode. [Eduard Veit]
* :sparkles: add support for Duck DNS as DynDNS2 provider. [Eduard Veit] * add support for Duck DNS as DynDNS2 provider. [Eduard Veit]
* :sparkles: add support for deSEC as DynDNS2 provider. [Eduard Veit] * add support for deSEC as DynDNS2 provider. [Eduard Veit]
* :sparkles: add completion. [Eduard Veit] * add completion. [Eduard Veit]
:sparkles: add man page add man page
* :sparkles: replace getopt with argbash. [Eduard Veit] * 🔃 replace getopt with argbash. [Eduard Veit]
* :sparkles: add interpretaton of status codes and act accordingly. [Eduard Veit] * add interpretaton of status codes and act accordingly. [Eduard Veit]
* :sparkles: make network interface configurable. [Eduard Veit] * make network interface configurable. [Eduard Veit]
* :sparkles: add DynDNS2 support for dynv6.com. [Eduard Veit] * add DynDNS2 support for dynv6.com. [Eduard Veit]
* :sparkles: add .gitchangelog.rc. [Eduard Veit] ### Added
* :sparkles: add dynb.sh. [Eduard Veit] * 📝 README.md. [Eduard Veit]
* ✨ dynb.sh. [Eduard Veit]
### Changed
* 🔃 rename environment variables. [Eduard Veit]
### Fix ### Fix
* :bug: fix sourcing of config file. [Eduard Veit] * 🐛 fix error handling. [Eduard Veit]
:recycle: do some shellcheck fixes * 🐛 fix sourcing of config file. [Eduard Veit]
♻️ do some shellcheck fixes
### Documentation ### Documentation
* :memo: document example of an docker-compose.yml file. [Eduard Veit] * 📝 document example of an docker-compose.yml file. [Eduard Veit]
* :memo: document loop mode and dig as requirement. [Eduard Veit] * 📝 document `loop mode` and mention `dig` as requirement. [Eduard Veit]
* :memo: update example of .env in README.md. [Eduard Veit] * 📝 update example of .env in README.md. [Eduard Veit]
* :memo: add CHANGELOG.md. [Eduard Veit] * 📝 CHANGELOG.md. [Eduard Veit]
* :memo: add example.env. [Eduard Veit] * 📝 add example.env. [Eduard Veit]
* :memo: write README.md. [Eduard Veit]
### Other
* :recycle: refactor: rename environment variables. [Eduard Veit]
* :recycle: refactor, fix and debug error handling. [Eduard Veit]
* :recycle: refactor main code. [Eduard Veit]
* Initial commit. [EV21]

View File

@@ -1,4 +1,4 @@
FROM alpine:latest FROM alpine:3.16.4
RUN \ RUN \
apk update \ apk update \
@@ -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

@@ -7,8 +7,6 @@ IPv4 (A) and IPv6 (AAAA) record updates are supported.
<!-- TOC --> <!-- TOC -->
- [✨ Update Methods](#-update-methods) - [✨ Update Methods](#-update-methods)
- [APIs](#apis)
- [DynDNS2](#dyndns2)
- [📦 Requirements](#-requirements) - [📦 Requirements](#-requirements)
- [🚀 Installation](#-installation) - [🚀 Installation](#-installation)
- [⚙ Configuration](#-configuration) - [⚙ Configuration](#-configuration)
@@ -25,18 +23,16 @@ IPv4 (A) and IPv6 (AAAA) record updates are supported.
The following update methods are currently implemented: The following update methods are currently implemented:
### APIs | Provider | API | TTL in seconds | Credentials | own domain via NS record | free (sub-) domain |
|---------------------|-----------------------|----------------|----------------------------------------------------------------------------------------------|------------------------------------------|--------------------------------------|
- INWX.com Domrobot JSON-RPC-API\ | INWX.com | Domrobot JSON-RPC-API | 300 | customer login `username` & `password`. Mobile TAN (OTP) is currently not supported by DynB. | ✔️ 🆓 for your registered domains @ inwx | ⛔ for your registered domains @ inwx |
Limitations: | INWX.com | DynDNS2 | 60 | specific dyndns `username` & `password` | ✔️ 🆓 for your registered domains @ inwx | ⛔ for your registered domains @ inwx |
- minimum TTL is 300 (5 minutes) | deSEC.io (dedyn.io) | DynDNS2 | 60 | `token` | ✔️ 🆓 | ✔️ |
| DuckDNS.org | DynDNS2 | 60 | `token` | ⛔ | ✔️ |
### DynDNS2 | dynv6.com | DynDNS2 | 60 | `token` | ✔️ 🆓 | ✔️ |
| ddnss.de | DynDNS2 | 10 | `update key` as `token` | ⛔ | ✔️ |
- INWX.com | IPv64.net | DynDNS2 | 60 | `DynDNS Updatehash` as `token` | ✔️ 💲 | ✔️ |
- deSEC.io (dedyn.io) | dynu.com | DynDNS2 | 30 | `username` & `password` | ✔️ 🆓 | ✔️ |
- DuckDNS.org
- dynv6.com
## 📦 Requirements ## 📦 Requirements
@@ -57,7 +53,7 @@ or simply clone this repo
git clone https://github.com/EV21/dynb.git git clone https://github.com/EV21/dynb.git
``` ```
If you want to add the script to you PATH, run :point_down: If you want to add the script to you PATH, run 👇
```shell ```shell
bash dynb.sh --link bash dynb.sh --link
@@ -79,7 +75,7 @@ DYNB_SERVICE_PROVIDER=inwx
## update method options: domrobot, dyndns ## update method options: domrobot, dyndns
DYNB_UPDATE_METHOD=domrobot DYNB_UPDATE_METHOD=domrobot
## ip mode could be either: 4, 6 or dual for dualstack ## ip mode could be either: 4, 6 or 64 for dualstack
DYNB_IP_MODE=64 DYNB_IP_MODE=64
## If you are using the DomRobot RPC-API enter your credentials for the web interface login here ## If you are using the DomRobot RPC-API enter your credentials for the web interface login here
@@ -92,14 +88,14 @@ DYNB_TOKEN=
## 🏃 Run ## 🏃 Run
If you have a config file just run :point_down: If you have a config file just run 👇
```bash ```bash
dynb dynb
``` ```
Alternatively you can use parameters if your system meets the relevant requirements. This example shows the long form parameter, there are also short ones.\ Alternatively you can use parameters if your system meets the relevant requirements. This example shows the long form parameter, there are also short ones.\
Call the help function :point_down: Call the help function 👇
```bash ```bash
dynb --help dynb --help
@@ -123,13 +119,13 @@ Just use the parameter `--interval 60` or the environment variable `DYNB_INTERVA
### crontab ### crontab
execute :point_down: execute 👇
```bash ```bash
crontab -e crontab -e
``` ```
then enter :point_down: to run dynb every five minutes. then add the following line 👇 to run dynb every five minutes.
```bash ```bash
*/5 * * * * $HOME/.local/bin/dynb >> $HOME/.local/share/dynb/dynb-cron.log */5 * * * * $HOME/.local/bin/dynb >> $HOME/.local/share/dynb/dynb-cron.log
@@ -155,25 +151,33 @@ services:
image: ev21/dynb image: ev21/dynb
container_name: dynb container_name: dynb
network_mode: host network_mode: host
build: stdin_open: true
context: . tty: true
dockerfile: ./Dockerfile
environment: environment:
- DYNB_DYN_DOMAIN=dyndns.example.com - DYNB_DYN_DOMAIN=dyndns.example.com
- DYNB_SERVICE_PROVIDER=inwx # Providers: deSec, DuckDNS, dynv6, inwx, ddnss, ipv64
- DYNB_SERVICE_PROVIDER=desec
# Possible update methods are: dyndns, domrobot
- DYNB_UPDATE_METHOD=dyndns - DYNB_UPDATE_METHOD=dyndns
# IP modes: 4 (IPv4 only), 6 (IPv6 only), 64 both
- DYNB_IP_MODE=64 - DYNB_IP_MODE=64
# If your provider uses tokens use DYNB_TOKEN instead of DYNB_USERNAME and DYNB_PASSWORD
- DYNB_USERNAME=User42 - DYNB_USERNAME=User42
- DYNB_PASSWORD=SuperSecretPassword - DYNB_PASSWORD=SuperSecretPassword
- DYNB_INTERVAL=60 # The interval in seconds is the time the script waits before executing it again
- DYNB_INTERVAL=300
# TZ: Timezone setting for correct log time
- TZ=Europe/Berlin
# TERM: For colorful console output (attached mode)
- TERM=xterm-256color
``` ```
## environment variables ## environment variables
| variable | default value | description | | variable | default value | description |
| --------------------- | --------------- | -------------------------------------------------------------------------------------------------------------- | |-----------------------|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|
| DYNB_DYN_DOMAIN | undefined | required; `dyndns.example.com` | | DYNB_DYN_DOMAIN | undefined | required; `dyndns.example.com` |
| DYNB_SERVICE_PROVIDER | undefined | required; `deSEC`, `duckdns`, `dynv6`, `inwx` | | DYNB_SERVICE_PROVIDER | undefined | required; `deSEC`, `duckdns`, `dynv6`, `inwx`, `ddnss`, `ipv64` |
| DYNB_UPDATE_METHOD | undefined | required; `dyndns` or `domrobot` (with inwx) | | DYNB_UPDATE_METHOD | undefined | required; `dyndns` or `domrobot` (with inwx) |
| DYNB_IP_MODE | undefined | required; `4`, `6` or `64` for both | | DYNB_IP_MODE | undefined | required; `4`, `6` or `64` for both |
| DYNB_USERNAME | undefined | the requirement depends on your provider and the update method | | DYNB_USERNAME | undefined | the requirement depends on your provider and the update method |
@@ -181,6 +185,6 @@ services:
| DYNB_TOKEN | undefined | the requirement depends on your provider and the update method | | DYNB_TOKEN | undefined | the requirement depends on your provider and the update method |
| DYNB_INTERVAL | undefined | without this setting the script/docker container will run one time and exits | | DYNB_INTERVAL | undefined | without this setting the script/docker container will run one time and exits |
| DYNB_DEBUG | undefined | more console outputs | | DYNB_DEBUG | undefined | more console outputs |
| DYNB_IPv4_CHECK_SITE | api64.ipify.org | You need a website or Web-API that outputs your remote IP | | DYNB_IPv4_CHECK_SITE | tries in this order `ip64.ev21.de` (anonymous logging for 7 days), `api64.ipify.org`, `api.my-ip.io/ip`, `ip.anysrc.net/plain` | You need a website or Web-API that outputs your remote IP |
| DYNB_IPv6_CHECK_SITE | api64.ipify.org | You need a website or Web-API that outputs your remote IP | | DYNB_IPv6_CHECK_SITE | tries in this order `ip64.ev21.de` (anonymous logging for 7 days), `api64.ipify.org`, `api.my-ip.io/ip`, `ip.anysrc.net/plain` | You need a website or Web-API that outputs your remote IP |
| DYNB_DNS_CHECK_SERVER | undefined | If you are using a local DNS Resolver/Server make sure it answers with the public answer or set another server | | DYNB_DNS_CHECK_SERVER | using the DynDNS2 providers DNS servers | If you are using a local DNS Resolver/Server make sure it answers with the public answer or set another server |

965
dynb.sh

File diff suppressed because it is too large Load Diff