Commit graph

677 commits

Author SHA1 Message Date
John Crisp
e2c3f9dd04 Add support for dinahosting
Fixes #203
2020-07-07 00:00:45 -04:00
Richard Hansen
231306395a Test for definedness or emptiness, not truthiness
Use `//` or `eq ''` for tests to avoid treating the string `'0'` as
false.
2020-07-06 23:58:51 -04:00
Richard Hansen
03dffae74e Honor the ssl option for the web URL 2020-07-06 20:20:01 -04:00
Richard Hansen
7921c53605 Explicitly tell geturl to ignore the global ssl option
Changing behavior based on the identity of the caller is fragile and
makes the code difficult to understand.
2020-07-06 20:19:27 -04:00
Richard Hansen
2e5db5af44 Fix detection of get_ip caller
This was broken in f6f920eb39.
2020-07-06 17:14:08 -04:00
Sandro Jäckel
b7e7d27a24
Remove dtdns 2020-07-06 15:59:55 +02:00
Sandro Jäckel
12a4a10c9c
Remove hammernode1 2020-07-06 15:57:52 +02:00
Richard Hansen
323208e9cc Add geturl connectivity unit tests
Addresses #232
2020-07-05 18:36:46 -04:00
Sandro
b6770a4d9f
Merge pull request #234 from rhansen/url-parsing
Fix URL parsing for IPv6 URLs and pathless URLs
2020-07-06 00:33:22 +02:00
Richard Hansen
06503a483b Fix URL parsing for IPv6 URLs and pathless URLs
Now the following valid URLs are parsed correctly:
  * http://[::1]:123/foo
  * http://localhost?foo=bar

There are still problems with the URL parsing logic but this is enough
to write some unit tests.
2020-07-05 18:21:35 -04:00
Richard Hansen
49c8717420 Silence warning when calling geturl from an anonymous sub 2020-07-05 18:16:08 -04:00
Richard Hansen
a15cec7cd9 Stringify default port numbers
The IO::Socket classes expect strings for the port number because you
can pass service names from `/etc/services`. Numbers work too, but
using strings everywhere makes it easier to write unit tests.
2020-07-05 16:32:41 -04:00
David Kerr
52fdb0bdeb add missing semicolons and fix incorrect debug message 2020-07-03 17:32:27 -04:00
Sandro
d844039e6c
Merge pull request #175 from rhansen/config-file-parse
Improve parsing of config file assignments
2020-07-03 23:24:55 +02:00
Richard Hansen
f7ff1f8259 New options to specify CA certificate location
This is a prerequisite to adding `geturl()` unit tests (we will need
to run a dummy https server).
2020-07-03 16:59:18 -04:00
Richard Hansen
6d7d248f79 Improve parsing of config file assignments
* Ignore empty `key=value` strings in variable assignments. Now the
    following lines are supported with the expected meaning:
      * `a=1 , b=2`
      * `a=1,,b=2`
  * Improve the warning message when there is an unterminated quote.
  * Add a warning if the line ends with a backslash.

Also add unit tests.
2020-07-03 16:56:01 -04:00
Richard Hansen
283f609b28 Update Vim modeline and Emacs file-local variables
Both:
  * Force the file type to Perl
  * Set the tab width to 8 so that people cringe in horror at the
    sight of a tab
  * Set the line with to 99

Emacs:
  * Disable indent-tabs-mode
  * Set the indentation level to 4

Vim:
  * Highlight column 100

Addresses #206
2020-07-01 22:52:29 -04:00
Richard Hansen
8ed93cb576 Move per-service variables to the service definitions
Most of the entries in `%variables` are only used once. Move them down
to their respective service definitions.

Also:
  * Use idiomatic hash merging instead of `merge()`.
  * Sort the variables by name.
2020-06-30 22:14:15 -04:00
Richard Hansen
7a2d065a2d Fix woima protocol implementation for loop 2020-06-30 18:41:40 -04: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
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
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
Renamed from ddclient.template (Browse further)