Previously, `nochg` responses were treated as failures and the logged
message for all responses was incorrect (either `undef` or "Unknown
reply from Infomaniak").
Background: Hash values are always scalars, so lists of values can
only be stored in hashes in arrayref form.
The following is legal but does not do what one might expect:
my %h = (
a => (1, 2),
b => (3, 4),
);
The `=>` operator is just a variant of the comma operator, and lists
in list context are flattened, so the above is equivalent to:
my %h = ('a', 1, 2, 'b', 3, 4);
which is equivalent to:
my %h = (
a => 1,
2 => 'b',
3 => 4,
);
which is obviously not what was intended.
Before, the returned JSON wasn't even parsed -- the error handling
code was reusing the parsed response from the earlier `GET`. Also, it
was reading object properties that were not documented in the Gandi
API documentation.
Before, the first line of a multi-line log message was prefixed with a
space while all subsequent messages were prefixed with `|`. Now the
first line is prefixed with `>` and all subsequent lines with a space.
This makes it easier to quickly discern message boundaries.
https://kb.easydns.com/knowledge/dynamic-dns/ doesn't say anything
about repeating the `myip` parameter, or that both IPv4 and IPv6
addresses can be included in the same `myip` parameter.
Unfortunately it also doesn't say whether updating the IPv4 address
alone will nuke the IPv6 AAAA record, or whether updating the IPv6
address alone will nuke the IPv4 A record (like Google Domains used to
do). Here's hoping that the A and AAAA records are truly independent.
The implementation is based on the existing
dyndns2 protocol with a few differences:
- The IPv4 and IPv6 addresses must be updated in
separate calls. This is different from most of
the other providers where both IPv4 and IPv6
addresses can be updated in a single call. Thus
the existing dyndns2 protocol implementation
cannot be reused for dns.he.net.
- Multiple hosts are not supported by the provider.
See: https://dns.he.net/docs.html
This adds a protocol to email IP address changes without needing a
dynamic DNS service. This is useful if you don't use a DDNS service
but want to be notified when the IP of a machine changes.
Rationale:
* Logging to STDERR enables separation of processable output (e.g.,
`--version` or `--help`) and ephemeral status/error messages.
* A single file descriptor for all log messages makes it easier for
users to capture all log messages.
* Consistency: it's what most utilities do.
`$config{$h}{'status'}` was always initialized to a non-`undef` value,
so the `//` fallbacks never did anything. Instead, any protocol that
does not explicitly update the legacy `status` variable (such as
`godaddy`) would always appear to have failed even if it had
succeeded.
Change the `status*` variables to `undef` by default, and only set
them when an attempt is made so that the legacy `//` fallback works as
expected.
This reverts the changes from 36744e5. This will be reimplemented once
the build process is better documented and properly implemented
by any downstream not yet using it (as of now linuxserver.io).
See https://github.com/linuxserver/docker-ddclient/issues/77