Commit graph

1426 commits

Author SHA1 Message Date
Sandro
7c81627c92
Merge pull request #211 from rhansen/rename-template
Rename `*.template` to `*.in`
2020-06-30 20:51:32 +02:00
Richard Hansen
44eaf653f1 Rename *.template to *.in
Apparently the `.template` extension is commonly used in macOS for a
word processor template file.

See issue #206.
2020-06-30 13:27:08 -04:00
Richard Hansen
38e44ef1fb Tell Git to ignore changes to build-aux/tap-driver.sh 2020-06-30 12:27:11 -04:00
Richard Hansen
5e7683df85 Merge pull request #208 from ddclient/fix-shebang
Fix shebang
2020-06-30 11:59:27 -04:00
Sandro Jäckel
86a3294b0f Fix shebang
cause perl needs a regular shebang even when evoking the script
directly with perl
2020-06-30 11:55:11 -04:00
Sandro
06851b770e
Merge pull request #207 from rhansen/test-improvements 2020-06-30 09:08:50 +02:00
Richard Hansen
a8212a397e Add a test for unexpected warnings 2020-06-30 00:40:26 -04:00
Richard Hansen
0cc83cd5ec Simplify runtime imports in test code
Also use `BAIL_OUT` instead of `die` if `require 'ddclient'` fails.
2020-06-29 17:26:46 -04:00
Richard Hansen
858fe53072
Merge pull request #163 from rhansen/ipv6-design-doc
Design doc for IPv6 support
2020-06-29 17:24:32 -04:00
Richard Hansen
d31d9f8bde Design doc for IPv6 support
Add a document describing a design for comprehensive IPv6 support. The
ddclient maintainers agreed to this design, and it should be used to
guide the implementation of full IPv6 support.
2020-06-29 17:23:51 -04:00
Richard Hansen
58c6570dde
Merge pull request #184 from rhansen/freedns
Redo freedns.afraid.org protocol to fix several bugs
2020-06-29 17:22:56 -04:00
Richard Hansen
566c3c3d5e Redo freedns.afraid.org protocol to fix several bugs
* Support IPv6 addresses.
  * Support updating addresses that aren't the client's own addresses.
  * Set status to 'failed' if the update fails for any reason.
  * Don't skip hosts if a previous update failed.
  * Check for a non-OK code from the update server.
  * Strip headers before processing responses.

This still uses API v1 because API v2 currently has some limitations;
see #180 for details.

Fixes #180
2020-06-29 17:22:09 -04:00
Richard Hansen
d593892c6a Set up GitHub CI
Teach GitHub to run tests for changes to `master` and for pull
requests targeting `master`.
2020-06-29 17:14:21 -04:00
Richard Hansen
c72d128a9e Disable accidental interpolation in regular expression
Without this change, Perl prints the following warning:

> Possible unintended interpolation of `@$` in string at ddclient line 43.
2020-06-29 17:13:06 -04:00
Richard Hansen
dde91fd028 Typo fix (you -> your) 2020-06-29 17:12:01 -04:00
Richard Hansen
f360860378
Merge pull request #161 from rhansen/test-framework
Build system and unit test infrastructure
2020-06-29 11:09:12 -04:00
Richard Hansen
c390e75769 Add unit test infrastructure.
Now all that is needed to add a new unit test is to create a `t/*.pl`
file and list it in the `handwritten_tests` variable.

To run the test suite, run:

    ./autogen && ./configure && make check

Fixes #147
2020-06-29 11:08:32 -04:00
Richard Hansen
f6f920eb39 Use the "modulino" pattern to facilitate unit tests
Now the `ddclient` file can be used as a script or as a module. For
details, see: https://www.drdobbs.com/scripts-as-modules/184416165

Addresses #147
2020-06-29 11:08:28 -04:00
Richard Hansen
8cbcecba99 Add Autotools-based build infrastructure
This makes it easier to package ddclient, especially as enhancements
are made such as unit tests or a man page.

I chose GNU Autoconf and Automake mostly because I'm familiar with
them, but also because I know they are well supported. Unfortunately
they can be difficult to understand/maintain (especially Autoconf), so
we may want to convert to something else later.

Addresses #146, #147
2020-06-29 11:06:34 -04:00
Sandro
bfdf9454f0
Merge pull request #201 from rhansen/group_hosts_by
`group_hosts_by` improvements
2020-06-29 09:40:11 +02:00
Sandro
4f08d77cae
Merge pull request #202 from rhansen/cloudns
Add ClouDNS support
2020-06-29 09:36:44 +02:00
Richard Hansen
0792f9b272 Add ClouDNS support
Fixes #190
2020-06-29 01:15:42 -04:00
Richard Hansen
8fcc9b0e2f group_hosts_by improvements
* Don't modify `$config{$h}{$v}` if variable `$v` for host `$h` is
    `undef`.
  * Tolerate the user passing `wantip` or duplicate keys.
2020-06-29 01:15:28 -04:00
Richard Hansen
b1da99c361 Merge pull request #200 from rhansen/undo-revert
Add is_ipv4() and ipv4_match() functions
2020-06-29 01:13:43 -04:00
David Kerr
00ce8bdeb3 Add is_ipv4() and extract_ipv4() functions 2020-06-29 00:19:32 -04:00
Richard Hansen
8b2ede16c0 Revert "Add is_ipv4() and ipv4_match() functions"
Broke `ip=<IPv4 address>`.

This reverts commit 0caed7ca2a.
2020-06-28 23:57:58 -04:00
Richard Hansen
1766313397 Sort %builtinfw entries by key 2020-06-28 19:55:57 -04:00
Richard Hansen
3199f791d8 Sort %services entries by key 2020-06-28 19:55:57 -04:00
Sandro
b85d86795e
Merge pull request #193 from rhansen/config
Delete unused `config` entry
2020-06-29 01:37:29 +02:00
Richard Hansen
959c7154ad
Merge pull request #194 from rhansen/ip-extract
Rename `ipv4_match`, `ipv6_match` to `ipv4_extract`, `ipv6_extract`
2020-06-28 17:14:17 -04:00
Richard Hansen
8a63c5b74f Rename ipv4_match, ipv6_match to extract_ipv4, extract_ipv6
"Match" only implies a boolean return value. While these functions can
be used in boolean context, "extract" more closely matches their
intended purpose.
2020-06-28 17:09:36 -04:00
Richard Hansen
dc47afea38 Delete unused config entry 2020-06-26 21:04:01 -04:00
Richard Hansen
7556aaa5e1
Merge pull request #191 from rhansen/deprecate-banlocal
Turn `fw-banlocal` into a no-op and mark it as deprecated
2020-06-26 21:01:40 -04:00
Richard Hansen
4edecf3dc1 Turn fw-banlocal into a no-op and mark it as deprecated
`fw-banlocal` is problematic:
  * There's not much point to it. Regardless of whether it is enabled,
    the end result is a DNS record that is not being updated to a
    useful value. It does cause a warning to be logged, but because it
    is not enabled by default it doesn't help the poor user who is
    trying to figure out why they can't reach their machine. By the
    time they realize that enabling this option would have saved them
    hours of troubleshooting, they no longer need to enable it because
    they already know what the problem is.
  * It's a misnomer: `fw-banlocal` doesn't just filter out local IP
    addresses from `use=fw`, it also filters them out of all other
    address sources except `use=ip`.
  * It doesn't filter out local IPv6 addresses.
  * The resulting warning ("unable to determine IP address") is
    misleading.

We might want to add a warning whenever a non-global address is
discovered (along with an option to silence the warning), but that
should be done in a future commit if at all.
2020-06-25 23:32:58 -04:00
Sandro
08c7e71352
Merge pull request #187 from rhansen/defined-or-op
Use the `//` operator to simplify code
2020-06-24 20:01:19 +02:00
Richard Hansen
a84015015f Use the // operator to simplify code 2020-06-24 13:34:31 -04:00
Sandro
271f277126
Merge pull request #169 from rhansen/geturl-force-ip-version 2020-06-24 15:15:12 +02:00
Richard Hansen
39bd6fce9e New geturl param to force IPv4 or IPv6
This will be used by the upcoming `webv4` and `webv6` options to
ensure that the checkip service returns the desired type of IP
address.

Addresses #172
2020-06-23 11:55:46 -04:00
Richard Hansen
323a873b22 Change geturl to take a hash of parameters
This makes the call sites more readable, and it will be easier to
extend in the future (to add an option to force IPv4 or IPv6, for
example).
2020-06-23 11:55:46 -04:00
Richard Hansen
7fafb8df7e
Merge pull request #186 from dkerr64/is_ipv4-function
Add is_ipv4() and ipv4_match() functions
2020-06-23 11:54:12 -04:00
David Kerr
0caed7ca2a Add is_ipv4() and ipv4_match() functions 2020-06-23 11:52:27 -04:00
Richard Hansen
aeba95aef4
Merge pull request #182 from rhansen/fix-use-ip
Fix `use=ip` when `ip` is set to an IPv4 address
2020-06-17 12:16:35 -04:00
Richard Hansen
99a60995c4 Fix use=ip when ip is set to an IPv4 address
Before, with `use=ip,ip=1.2.3.4`, `get_ip` would return `undef` and
print a warning:

  WARNING:  found neither ipv4 nor ipv6 address
2020-06-17 12:16:05 -04:00
Sandro
2f26ed5969
Merge pull request #183 from rhansen/bool-parsing
Fix parsing of "true" as a boolean value
2020-06-17 09:43:35 +02:00
Richard Hansen
40f355d05e Fix parsing of "true" as a boolean value
Before, "t" and "ttrue" were accepted as true, but not "true".

Also simplify the true and false regular expressions.
2020-06-16 23:23:02 -04:00
Richard Hansen
7cc36539e7 Move Data::Validate::IP removal note to dependency changes section 2020-06-16 14:23:02 -04:00
Richard Hansen
5b251f3802
Merge pull request #178 from dkerr64/RemoveValidateIP
Remove dependency on Data::Validate::IP
2020-06-15 23:19:03 -04:00
David Kerr
d4c55dd0f5 Remove dependency on Data::Validate::IP
This module is not available by default on many systems, and not
available at all on lightweight embedded systems.
2020-06-15 23:17:12 -04:00
Sandro
35eac827e3
Merge pull request #173 from rhansen/request-body-crlf
Don't replace LF with CRLF in body of HTTP request
2020-06-14 15:59:18 +02:00
Sandro
0b60ce3f94
Merge pull request #174 from rhansen/host-opt
Fix global fallback when host-specific setting is undefined
2020-06-14 02:02:33 +02:00