Commit graph

739 commits

Author SHA1 Message Date
Richard Hansen
7a2d065a2d Fix woima protocol implementation for loop 2020-06-30 18:41:40 -04:00
Sandro
43c0581334
Merge pull request #213 from rhansen/regex-flag-compat
Remove the `/a` regex flag
2020-07-01 00:37:13 +02:00
Richard Hansen
ccc876c160 Remove the /a regex flag
This flag was added in Perl 5.14 so we can't use it.
2020-06-30 18:34:41 -04:00
Sandro
05e5759aa1
Merge pull request #212 from rhansen/automake-parallel-tests
Enable Automake's parallel-tests feature
2020-07-01 00:27:17 +02:00
Richard Hansen
65bc4cd986 Enable Automake's parallel-tests feature
Apparently it's off by default in Automake 1.11.
2020-06-30 18:22:22 -04:00
Richard Hansen
034e6501ed
Merge pull request #196 from dkerr64/Cleanup-extract_ipv4-and-is_ipv6-and-usage
Cleanup extract ipv4 and is ipv6 and usage
2020-06-30 15:54:25 -04:00
David Kerr
36d8b511b3 Move un_zero_pad into extract_ipv4, extract_ipv6
This also causes `is_ipv4` to reject IPv4 addresses with leading
zeros.
2020-06-30 15:44:24 -04:00
David Kerr
0a999577c7 Simplify the IPv4 regular expression 2020-06-30 15:43:07 -04:00
David Kerr
5da22a8a69 Implement is_ipv6 in terms of extract_ivp6 2020-06-30 15:26:40 -04:00
David Kerr
ab0a4597ce Validate the ip setting 2020-06-30 15:22:13 -04:00
David Kerr
fe513f733d Use is_ipv6, not extract_ipv6, to validate IPv6 address 2020-06-30 15:19:38 -04:00
David Kerr
af1332264f Delete unnecessary address check
`get_ip` is guaranteed to return a valid IP address or `undef`.
2020-06-30 15:16:55 -04:00
Sandro
7e0f696c87
Merge pull request #210 from rhansen/tap-driver.sh
Tell Git to ignore changes to build-aux/tap-driver.sh
2020-06-30 21:00:36 +02:00
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