Skip to content

Commit

Permalink
inadyn: updated to 2.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RMerl committed Feb 1, 2021
1 parent 390fb6b commit 36de882
Show file tree
Hide file tree
Showing 21 changed files with 423 additions and 216 deletions.
52 changes: 51 additions & 1 deletion release/src/router/inadyn/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,51 @@ Change Log
All notable changes to the project are documented in this file.


[v2.8.1][] - 2021-01-31
-----------------------

### Fixes
- Issue #340: the new settings `ttl` and `proxied`, introduced in
[v2.8][], were missing from custom provider sections. Found and
fixed by André Colomb


[v2.8][] - 2021-01-31
---------------------

Improved `--exec SCRIPT` support and massive Cloudflare plugin updates.

### Changes
- Issue #306: New keyword `default` to use the built-in In-a-dyn default
`checkip-server` in the configuration file
- Issue #306: Automatically fall back to use built-in checkip-server if
the provider's server fails. Warnings added to log so user can change
their preferences
- Issue #310: Extended support for external script. By default it runs
only on successful DDNS update (`compat` mode). New `event` mode
calls the script on any action, with added new environment variables.
- Cloudflare plugin, curated by Simon Pilkington:
- Increased size of response buffer, JSON reply is quite big and
In-a-dyn is used to one-liner replies from most servers
- Add `ttl` option, by なつき
- Add `proxied` option, by なつき
- Use 1.1.1.1 as default checkip server, by なつき
- Updated examples for IPv4 and IPv6, by なつき
- New multi-arch docker image, by なつき

### Fixes
- Issue #309: Do not attempt to `chown(2)` the cache or pidfile dirs,
because this may fail and cause In-a-dyn to fail. Users that want to
drop-privs must ensure the cache and pidfile directories are writable
by the `-p uid:gid` specified
- Issue #313: Cloudflare, get zone name from username field in config
- Issue #314: twoDNS changed API, drop support and remove custom example
- Issue #327: Fix duiadns.net plugin, by Sergey Aleynikov
- Issue #328: Fix TLS regression with multiple data packets, by なつき
- Issue #329: Fix creation of new Cloudflare record, by なつき
- Fix default install prefix, regression introduced in v2.6


[v2.7][] - 2020-03-22
---------------------

Expand Down Expand Up @@ -806,7 +851,12 @@ First stable version.
- port to pSOS


[UNRELEASED]: https://github.com/troglobit/inadyn/compare/v2.3...HEAD
[UNRELEASED]: https://github.com/troglobit/inadyn/compare/v2.8.1...HEAD
[v2.8.1]: https://github.com/troglobit/inadyn/compare/v2.8...v2.8.1
[v2.8]: https://github.com/troglobit/inadyn/compare/v2.7...v2.8
[v2.7]: https://github.com/troglobit/inadyn/compare/v2.6...v2.7
[v2.6]: https://github.com/troglobit/inadyn/compare/v2.5...v2.6
[v2.5]: https://github.com/troglobit/inadyn/compare/v2.4...v2.5
[v2.4]: https://github.com/troglobit/inadyn/compare/v2.3.1...v2.4
[v2.3.1]: https://github.com/troglobit/inadyn/compare/v2.3...v2.3.1
[v2.3]: https://github.com/troglobit/inadyn/compare/v2.2.1...v2.3
Expand Down
24 changes: 11 additions & 13 deletions release/src/router/inadyn/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ if HAVE_SYSTEMD
systemd_DATA = inadyn.service
endif

## Generate MD5 checksum file
MD5 = md5sum
md5-dist:
@for file in $(DIST_ARCHIVES); do \
$(MD5) $$file > ../$$file.md5; \
done

## Check if tagged in git
release-hook:
@if [ ! `git tag | grep $(PACKAGE_VERSION)` ]; then \
Expand All @@ -40,15 +33,20 @@ package build-deb:
@dpkg-buildpackage -uc -us -B

## Target to run when building a release
release: release-hook distcheck package md5-dist
release: release-hook distcheck package
@for file in $(DIST_ARCHIVES); do \
md5sum $$file > ../$$file.md5; \
sha256sum $$file > ../$$file.sha256; \
done
@mv $(DIST_ARCHIVES) ../
@echo
@echo "Resulting release files:"
@echo "================================================================="
@for file in $(DIST_ARCHIVES); do \
printf "%-32s Distribution tarball\n" $$file; \
printf "%-32s " $$file.md5; cat ../$$file.md5 | cut -f1 -d' '; \
@for file in $(DIST_ARCHIVES); do \
printf "%-32s Distribution tarball\n" $$file; \
printf "%-32s " $$file.md5; cat ../$$file.md5 | cut -f1 -d' '; \
printf "%-32s " $$file.sha256; cat ../$$file.sha256 | cut -f1 -d' '; \
done
@for file in `cd ..; ls $(PACKAGE)_$(VERSION)*`; do \
printf "%-32s Debian/Ubuntu package\n" $$file; \
@for file in `cd ..; ls inadyn_$(VERSION)* inadyn-dbg*_$(VERSION)*`; do \
printf "%-32s Debian/Ubuntu package\n" $$file; \
done
61 changes: 29 additions & 32 deletions release/src/router/inadyn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ take a small fee, but also provide more domains to choose from:
* <https://connect.yandex.ru>
* <https://www.cloudflare.com>

DDNS providers not supported natively like <http://twoDNS.de>, can be
enabled using the generic DDNS plugin. See below for configuration
examples.
DDNS providers not supported natively can be enabled using the generic
DDNS plugin. See below for configuration examples.

In-A-Dyn defaults to HTTPS, but not all providers may support this, so
try disabling SSL for the update (`ssl = false`) or the checkip phase
Expand Down Expand Up @@ -126,17 +125,20 @@ This looks for the default `.conf` file, to check any file, use:
hostname = some.example.com
}

# We override checkip server with the In-a-dyn built-in 'default',
# api.ipify.org, for details on this, see below.
provider freemyip {
password = YOUR_TOKEN
hostname = YOUR_DOMAIN.freemyip.com
password = YOUR_TOKEN
hostname = YOUR_DOMAIN.freemyip.com
checkip-server = default
}

provider dyn {
ssl = false
username = charlie
password = snoopy
hostname = { peanuts, woodstock }
user-agent = Mozilla/4.0
user-agent = Mozilla/4.0
}

# Google Domains - notice use of '@' to update root entry
Expand Down Expand Up @@ -202,22 +204,14 @@ This looks for the default `.conf` file, to check any file, use:
hostname = yourhost.example.com
}

# Create a unique API token with the following Permissions:
# Zone: Zone - Read
# Zone: DNS - Edit
#
# If the token is limited to a specific zone (it should be)
# it will also need the following permission:
# Account: Account Settings - Read
#
# For more information, see this Cloudflare Community post:
# https://community.cloudflare.com/t/bug-zone-detail-by-name-requires-zone-list-permission/128042
#
# Note: global API keys are NOT supported for security reasons
# Create a unique custom API token with the following permissions:
# -> Zone.Zone - Read, Zone.DNS - Edit.
provider cloudflare.com {
username = unused (but currently something must be entered)
password = your_api_token
hostname = yourhost.example.com
username = zone.name
password = api_token_important_read_comment
hostname = hostname.zone.name
ttl = 1 # optional, value of 1 is 'automatic'.
proxied = false # optional.
}

Notice how the config has three different users of the No-IP provider --
Expand All @@ -242,9 +236,11 @@ and password **must** be the *Update key* found in the *Advanced*
configuration tab.

Sometimes the default `checkip-server` for a DDNS provider can be very
slow to respond, to this end Inadyn now supports overriding this server
with a custom one, like for custom DDNS provider, or even a custom
command. See the man pages, or the below section, for more information.
slow to respond, to this end In-a-dyn now support overriding it with a
custom one, or a custom command. The easiest way to change it is to set
`checkip-server = default`, triggering In-a-dyn to use `api.ipify.org`,
which it also use for custom DDNS providers. See the man pages, or the
below section, for more information.

Some providers require using a specific browser to send updates, this
can be worked around using the `user-agent = STRING` setting, as shown
Expand All @@ -268,21 +264,22 @@ and/or password, you can leave these fields out. Basic authentication,
will still be used in communication with the server, but with empty
username and password.

A DDNS provider like <http://twoDNS.de> can be setup like this:
A custom DDNS provider can be setup like this:

custom twoDNS {
custom example {
username = myuser
password = mypass
checkip-server = checkip.two-dns.de
checkip-server = checkip.example.com
checkip-path = /
ddns-server = update.twodns.de
ddns-server = update.example.com
ddns-path = "/update?hostname="
hostname = myhostname.dd-dns.de
hostname = myhostname.example.net
}

For <https://www.namecheap.com> DDNS can look as follows. Notice how
the hostname syntax differs between these two DDNS providers. You need
to investigate details like this yourself when using the generic/custom
You can even override existing plugin support for known DDNS providers,
e.g., for <https://www.namecheap.com> it can look as follows. Notice
how the hostname syntax differs between these two examples. You need to
investigate details like this yourself when using the generic/custom
DDNS plugin:

custom namecheap {
Expand Down
4 changes: 2 additions & 2 deletions release/src/router/inadyn/configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ(2.61)
AC_INIT([In-a-dyn], [2.7], [https://github.com/troglobit/inadyn/issues],
AC_INIT([In-a-dyn], [2.8.1], [https://github.com/troglobit/inadyn/issues],
[inadyn], [https://troglobit.com/projects/inadyn/])
AC_CONFIG_AUX_DIR(aux)
AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
Expand Down Expand Up @@ -167,7 +167,7 @@ AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemd" != "xno"])
# Expand $sbindir early, into $SBINDIR, for systemd unit file
# NOTE: This does *not* take prefix/exec_prefix override at "make
# install" into account, unfortunately.
test "x$prefix" = xNONE && prefix=
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
SYSCONFDIR=`eval echo $sysconfdir`
SYSCONFDIR=`eval echo $SYSCONFDIR`
Expand Down
14 changes: 9 additions & 5 deletions release/src/router/inadyn/examples/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
examplesdir = $(docdir)/examples

dist_examples_DATA = \
inadyn.conf \
dyndns.conf \
freedns.conf \
custom.conf \
freemyip.conf \
cloudflare-ipv4-ipv6.conf \
cloudflare-ipv4-only.conf \
cloudflare-ipv6-only.conf \
custom.conf \
duckdns.conf \
dyndns.conf \
freedns.conf \
freemyip.conf \
inadyn.conf \
README.md
23 changes: 23 additions & 0 deletions release/src/router/inadyn/examples/cloudflare-ipv4-ipv6.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
allow-ipv6 = true

# ipv4
provider cloudflare.com:1 {
checkip-server = 1.1.1.1
checkip-path = /cdn-cgi/trace
username = zone.name
password = api_token # Create a unique custom api token with the following permissions: Zone.Zone - Read, Zone.DNS - Edit.
hostname = hostname.zone.name
ttl = 1 # optional, value of 1 is 'automatic'.
proxied = false # optional.
}

# ipv6
provider cloudflare.com:2 {
checkip-server = dns64.cloudflare-dns.com
checkip-path = /cdn-cgi/trace
username = zone.name
password = api_token # Use the same api token as above.
hostname = hostname.zone.name
ttl = 1 # optional, value of 1 is 'automatic'.
proxied = false # optional.
}
7 changes: 7 additions & 0 deletions release/src/router/inadyn/examples/cloudflare-ipv4-only.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
provider cloudflare.com {
username = zone.name
password = api_token # Create a unique custom api token with the following permissions: Zone.Zone - Read, Zone.DNS - Edit.
hostname = hostname.zone.name
ttl = 1 # optional, value of 1 is 'automatic'.
proxied = false # optional.
}
11 changes: 11 additions & 0 deletions release/src/router/inadyn/examples/cloudflare-ipv6-only.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
allow-ipv6 = true

provider cloudflare.com {
checkip-server = dns64.cloudflare-dns.com
checkip-path = /cdn-cgi/trace
username = zone.name
password = api_token # Create a unique custom api token with the following permissions: Zone.Zone - Read, Zone.DNS - Edit.
hostname = hostname.zone.name
ttl = 1 # optional, value of 1 is 'automatic'.
proxied = false # optional.
}
10 changes: 5 additions & 5 deletions release/src/router/inadyn/examples/inadyn.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@
# hostname = <your_hostname>.freemyip.com
#}

### Custom provider setup for http://twoDNS.de
#custom twoDNS {
### Custom provider example
#custom example {
# username = <username>
# password = <password>
# checkip-server = checkip.two-dns.de
# checkip-server = checkip.example.com
# checkip-path = /
# checkip-ssl = false
# ddns-server = update.twodns.de
# ddns-server = update.example.com
# ddns-path = "/update?hostname=%h"
# ssl = true
# hostname = <hostname>.dd-dns.de
# hostname = <hostname>.example.net
#}
12 changes: 12 additions & 0 deletions release/src/router/inadyn/include/ddns.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ typedef enum {
CMD_CHECK_NOW,
} ddns_cmd_t;

typedef enum {
EXEC_MODE_COMPAT,
EXEC_MODE_EVENT
} ddns_exec_mode_t;

typedef struct {
char username[USERNAME_LEN];
char password[PASSWORD_LEN];
Expand Down Expand Up @@ -155,6 +160,12 @@ typedef struct di {
/* Use wildcard, *.foo.bar */
int wildcard;

/* DNS ttl option */
long int ttl;

/* CDN proxied option */
int proxied;

/*
* Provider specific data, per-conf-entry. E.g., the Cloudflare
* plugin stores zone_id and hostname_id here. Set up by the
Expand Down Expand Up @@ -201,6 +212,7 @@ extern int ignore_errors;
extern int startup_delay;
extern int allow_ipv6;
extern int verify_addr;
extern int exec_mode;
extern char *ident;
extern char *prognm;
extern char *iface;
Expand Down
2 changes: 1 addition & 1 deletion release/src/router/inadyn/include/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

int os_install_signal_handler (void *ctx);
int os_check_perms (void);
int os_shell_execute (char *cmd, char *ip, char *hostname);
int os_shell_execute (char *cmd, char *ip, char *hostname, char *event, int error);

#endif /* INADYN_OS_H_ */

Expand Down

0 comments on commit 36de882

Please sign in to comment.