From 35fcdd5768a2fdd26abc88e7f52aace3bcbd902a Mon Sep 17 00:00:00 2001 From: NiceDevil <17103076+nicedevil007@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:04:10 +0100 Subject: [PATCH] Inadyn as new DynDNS Service --- Linux/Inadyn/README.md | 106 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 Linux/Inadyn/README.md diff --git a/Linux/Inadyn/README.md b/Linux/Inadyn/README.md new file mode 100644 index 0000000..235779b --- /dev/null +++ b/Linux/Inadyn/README.md @@ -0,0 +1,106 @@ +# Inadyn Installation on AlpineLinux + +This is made with the following example for DYNDNS Provider desec.io + +domain: mydomain.dedyn.io +token: XXXXXXXXXX + +Change this in the config file (and maybe duplicate it for mutiple entries) + +>custom mydomain.dedyn.io { +> username = mydomain.dedyn.io +> password = 'XXXXXXXXXX' +> checkip-server = checkipv4.dedyn.io +> checkip-path = / +> checkip-ssl = true +> ddns-server = update.dedyn.io +> ddns-path = "/update?username=%u&password=%p&myipv4=%i" +> ssl = true +> hostname = mydomain.dedyn.io +>} + +```bash +# Use Alpine Edge Repositories +cat </etc/apk/repositories +https://dl-cdn.alpinelinux.org/alpine/edge/main +https://dl-cdn.alpinelinux.org/alpine/edge/community +EOF + +# Update Alpine Linux +apk update +apk upgrade -a + +# Install default Tools (used by ansible f.e.) +apk add nano python3 openssh-server tzdata + +# Configure Timezone (Change) +ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime +#ln -s /usr/share/zoneinfo/Europe/Vienna /etc/localtime + +# Make ssh Server autoboot +rc-update add sshd +service sshd start + +# Install Inadyn as DynDNS Updater +apk add inadyn +cat </etc/inadyn/inadyn.conf +# How often the IP is checked. The value denotes seconds +period = 300 + +### Custom provider example +custom dedyn1 { + username = mydomain.dedyn.io + password = 'XXXXXXXXXX' + checkip-server = checkipv4.dedyn.io + checkip-path = / + checkip-ssl = true + ddns-server = update.dedyn.io + ddns-path = "/update?username=%u&password=%p&myipv4=%i" + ssl = true + hostname = mydomain.dedyn.io +} + +#custom dedyn2 { +# username = 2nddomain.dedyn.io +# password = 'XXXXXXXXXX' +# checkip-server = checkipv4.dedyn.io +# checkip-path = / +# checkip-ssl = true +# ddns-server = update.dedyn.io +# ddns-path = "/update?username=%u&password=%p&myipv4=%i" +# ssl = true +# hostname = 2nddomain.dedyn.io +#} +EOF +chmod 600 /etc/inadyn/inadyn.conf + +# Adjust initd script to have syslog output for debugging +cat </etc/init.d/inadyn +#!/sbin/openrc-run +name=$RC_SVCNAME +description="DynDNS client" +cfgfile="/etc/$RC_SVCNAME/$RC_SVCNAME.conf" +command="/usr/sbin/$RC_SVCNAME" +command_args="-s --syslog -f $cfgfile" +command_user="$RC_SVCNAME" +supervisor="supervise-daemon" +command_args_foreground="--foreground" + +depend() { + need net + use logger dns + after bootmisc +} + +start_pre() { + checkpath --directory --owner $command_user:$command_user --mode 0755 \ + /run/$RC_SVCNAME /var/cache/$RC_SVCNAME + $command --check-config -f $cfgfile +} +EOF + +rc-update add inadyn + +# Reboot to have everything nice and fresh +reboot +``` \ No newline at end of file