When the configuration used the legacy 'use' parameter, we already
populated the new internal 'wantipv*' field alongside the legacy
'wantip' field. This allows both old and new providers to work.
The legacy providers set 'status'/'ip'.
The new providers then set 'status-ipv*'/'ipv*'.
The caching logic would look for 'status' and 'ip' when encountering a
'use' parameter in the config. We previously already changed ddclient to
set 'status' when 'status-ipv*' was set. Now we also set 'ip' from
'ipv*'. This ensures caching correctly works.
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
- Support wantipv4 and wantipv6 configs automatically
- Remove manual record type setting
- Add support for hosts on your zone (subdomain)
- Update config examples
- Code/logic improvements
This fixes caching issues when using the 'usev4' or 'usev6' parameters.
Without this, the "min-interval" and "warned-min-interval" limits will
not work.
For the legacy 'use' parameter, the wrapping code takes care of
translating 'status-ipv*' to 'status'.
With this change, any config value may be set through an environment
variable by appending '_env' to the keyword (i.e. 'password_env' instead
of 'password') and setting the value to the name of the environment
variable that contains the actual configuration value.
This allows keeping sensitive info (i.e. login and password)
out of the configuration file.
Example configuration snippet:
protocol=namecheap, \
server=dynamicdns.park-your-domain.com, \
login_env=DD_LOGIN, \
password_env=DD_PASSWORD \
@
With this configuration snippet, ddclient will use the contents of
DD_LOGIN as the login value and the contents of DD_PASSWORD as the
password value.
These can in turn be supplied via the command line, .env files or any
other mechanism to safeguard sensitive information.
The password regex searches for password assignments, extracts the
password and replaces it with a dummy value to prevent it being logged.
This change adjusts the password regex to no longer accept trailing
characters behind the password string
Looks like there is a bug in line 542 in ddclient.in. The syntax of how the server URL is being set is different to all the other dynamic DNS services. To be precise there is one additional parameter. Instead of handing over the URL, the server variable receives the second "1" in the code below.
$globals{postscript} can now contain a full command string including
arguments. In order to facilitate this, the file executability check
(-x) has been modified such that the first substring up to the first
space (if it exists) is what is checked, rather than the whole string.
Example bodies I've seen:
```
0013
good 127.0.0.1
0
```
```
0013
nochg 127.0.0.1
0
```
```
007
nohost
0
```
Seems like the trailing zero was not there before as the code relied
on `pop`. Instead, we find the first line that matches `good`/`nochg`.
From doc in IO::Socket::IP in "IO::Socket::INET" INCOMPATIBILITES
section:
-----
The behaviour enabled by "MultiHomed" is in fact implemented by
"IO::Socket::IP" as it is required to correctly support searching for a
useable address from the results of the getaddrinfo(3) call. The
constructor will ignore the value of this argument, except if it is
defined but false. An exception is thrown in this case, because that
would request it disable the getaddrinfo(3) search behaviour in the
first place.
-----
Module IO::Socket::INET6 is deprecated.
There is common IO::Socket::IP module, which is working with ipv4 and
ipv6 in same way. There is backward compatibility with IO::Socket::INET6
This is no longer used since commit 6c951a0395 ("Add files via
upload"), which updated to the Cloudflare API v4. The new API does not
require any preprocessing of the domain name.
This will make it possible for the Debian package to fetch the list of
supported firewall/router devices and prompt the user to choose one
upon installation.
This will make it possible for the Debian package to fetch the list of
supported built-in web-based IP discovery services and prompt the user
to choose one upon installation.
The new code will always warn if ddclient.conf is accessible by others,
warn if it is owned by ddclient and accessible by the group,
and otherwise warn if it is writable but not owned by ddclient.
This primarily allows two permission modes for ddclient.conf:
First, the classic `ddclient:ddclient mode 0600` as well as the
more restrictive `root:ddclient mode 0640` which previously
warned unnecessarily.
Cloudflare was returning values not being matched properly by the regex expression.
Numbers that were not Headers.
This fix or patch should resolve that issue, by only collecting one match to JSON relevant data.
* Redact login and password when printing out internal hash values
* Remove from debug message in geturl() parameters sent as part of a URL
* Update comment with password redaction
Making it clearer that all parameters are redacted, not just password related ones.
Co-authored-by: DaveSophoServices <dave@sophoservices.com>
* Fix geturl function call
The function should be called without the brackets
* Update ci.yml
Removed Cento6 & 8
Co-authored-by: DaveSophoServices <dave@sophoservices.com>
There is no way the user can meaningfully set `if-skip` because the
user doesn't have control over how ddclient reads an interface's
settings (ddclient could theoretically run `ip addr show`, run
`ifconfig`, read a file in `/dev`, make a system call, use a Perl
library, etc.).
Allow update of a DNS record hosted by the Gandi LiveDNS service.
Signed-off-by: Jimmy Thrasibule <jimmy.thrasibule@orange.com>
Reviewed-by: Richard Hansen <rhansen@rhansen.org>
Adapt `header_ok` to return success for any HTTP 2xx code.
Signed-off-by: Jimmy Thrasibule <jimmy.thrasibule@orange.com>
Reviewed-by: Richard Hansen <rhansen@rhansen.org>
Apparently it is enough to simply import Socket or IO::Socket to use
AF_INET and friends, but all examples in official documentation show
them in the import list. Because I do not fully understand the
intricacies of Perl import logic, I do the same thing here, fully
aware that I might have joined a cargo cult. Regardless of its
correctness or necessity, listing the constants in the import list has
the advantage of making it clear why the `use` statement exists.
I chose to import the constants from Socket instead of IO::Socket
because that module's documentation explicitly documents the
constants.
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.
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.
* 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.
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
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.