-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Caching problems with newer providers #10
Conversation
Nice simple fix! |
Thanks, the notes weren't as simple 😄 My first draft of how the functions should behave is below. Note that they mostly don't and that this only covers the
|
Going through the provider list, there's a few anomalies:
|
Good analysis, thanks! I'll just comment on the one I know about, as I wrote it:
Indeed, with |
Now that we've looked deeper into the caching, I would opt to still implement it as part of future cleanups. That keeps the providers more similar and is friendlier towards Mythic. |
I'll try to do this tomorrow. |
Mythic explicitly say they don't care how often you ping their DNS API; I think once every five minutes will be OK under any circumstances. I thought about this quite hard when I implemented the code, and it's quite hard to be absolutely sure what address they used without querying their system after the update to find out what address they have for you, which doesn't really fit the structure of ddclient; and much harder to program correctly. |
Current caching logic The bug with cloudflare and friends meant that if someone configured |
Wow, amazing word @LenardHess! |
Looks good to me, thanks! I made one minor point about English in a comment. |
I don't see a comment anywhere? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just made one small comment.
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'.
How is the mtime in the cache determined? Is that different per protocol? Because for me that mtime is always 0. I am using the dyndns2 protocol with a custom server provider(strato). That causes ddclient to always try to update because we are over the max-interval. |
This fixes the caching issues #3 of new providers such as Cloudflare not respecting the cache and updating at the daemon interval.
With this change we now have the following rules for providers (that want caching).
Old provider implementations shall:
$config{$host}{'wantip'}
and process it.$config{$host}{'status'}
to the resultNew provider implementations shall:
$config{$host}{'wantipv4'}
and process it.$config{$host}{'status-ipv4'}
to the result:$config{$host}{'wantipv6'}
and process it.$config{$host}{'status-ipv6'}
to the resultFor all cases, the 'status*' result shall be set to "good" on success, a readable error otherwise - i.e. "bad" or "failed".
status
, but any modified/newly added ones shouldn't. With this fix, we now take care of setting it based onstatus-ipv*
if its not set for backwards compatibility.The configuration shall either:
use
parameterIn this case, the provider functions will be called with
wantip
set, and (depending on the IP address type) eitherwantipv4
orwantipv6
set.usev4
,usev6
In this case, the provider functions will be called with
wantipv4
and/orwantipv6
set. Additionally for backwards compatibility,wantip
will be set to the value ofwantipv4
(if usev4 is present and valid).Outstanding tasks:
nic_*_update()
functionsCurrent provider behavior
dyndns1
delete wantip
set status
dyndns2
delete wantipv*
set status, status-ipv4, status-ipv6
dnsexit2
delete wantip
set status
noip
delete wantip
set status
dslreports1
delete wantip
set status
domeneshop
delete wantip
set status
zoneedit1
delete wantip
set status
easydns
delete wantipv*
set status (not status-ipv4/status-ipv6 !!!)
EDIT: Updated to set status-ipv4/status-ipv6 instead of status
namecheap
delete wantip
set status
nfsn
delete wantip
set status
njalla
delete wantipv*
does not set status, mtime etc. (!!!)
sitelutions
delete wantip
set status
freedns
delete wantipv*
set status-ipv*
1984
delete wantip
does not set status, mtime etc. (!!!)
changeip
delete wantip
set status
godaddy
delete wantip
set "status"
googledomains
delete wantip
set "status"
mythicdyn
checks ipv6 (not wantipv6 !!!) only for v4 vs v6, service uses connection to determine IP
set "status"
nsupdate
delete wantip
set ip, mtime, but not status
cloudflare
delete wantipv*
set status-ipv*
hetzner
delete wantipv*
set status-ipv*
yandex
delete wantip
set status
duckdns
delete wantip
set status
freemyip
delete wantip
set status
woima
delete wantip
set status
dondominio
delete wantip
set status
dnsmadeeasy
delete wantip
set status
ovh
delete wantip
set status
porkbun
delete wantipv*
set status (not status-ipv4/status-ipv6 !!!)
EDIT: Updated to set status-ipv4/status-ipv6 instead of status
cloudns
delete wantip
set status
dinahosting
delete wantip
set status
gandi
delete wantip
set status
keysystems
delete wantip
set status
regfishde
delete wantip (twice, ipv6 looks broken!!!)
set status
enom
delete wantip
set status
digitalocean
delete wantipv*
set status-ipv*
infomaniak
delete wantipv*
set status
set status-ipv*