plugins icon indicating copy to clipboard operation
plugins copied to clipboard

os-ddclient needs forced update interval setting

Open olmari opened this issue 2 years ago • 7 comments

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

  • [x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
  • [x] I have searched the existing issues, open and closed, and I'm convinced that mine is new.
  • [x] When the request is meant for an existing plugin, I've added its name to the title.

Is your feature request related to a problem? Please describe. Our dynamic dns (dy.fi) provider expires the domain name "lease" in 7 days if it's not force updated before that. Currently there seems not to be any setting for os-ddclient to make that happen and my dns leases just expire.

Describe the solution you'd like In the ddclient account settings (or global settings if per account is impossible) have "force update interval" field that takes time interval as input, either just seconds, or number and dropdown to choose unit (secs, hours, days), and when time is due, fire the ddns update link unconditionally.

Describe alternatives you've considered I don't think there exist much alternatives for this. Forced update is needed by plenty providers so they don't hold abandonded domain names indefinitely.

Additional context I know similar ticket is https://github.com/opnsense/plugins/issues/2862 by someone else but it was deemed not following template so I decided to make proper one, and also slightly different take, time is factor on mine.

olmari avatar Mar 20 '22 16:03 olmari

I'll plus one this. The setting does exist as the client will update at 25 days if there has not been an IP change. See here for where the settings exist in the upstream under 'service-common-defaults'. It appears the setting just needs to be exposed at the global and item level. In the meantime you can likely hand edit the config.

Bubbgump209 avatar Mar 21 '22 17:03 Bubbgump209

ddclient 1.8 which is available on latest opnsense has now this on changelog:

  • Add a force action available via cron

but at cron in web-ui such option still isn't available on the list, and I think there is no "parameter" to give, as https://github.com/opnsense/plugins/blob/stable/22.1/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf lists force as separate action from restart.

So it seems we're nearly there, but last step is missing (actual defined cron job).

olmari avatar Jul 09 '22 16:07 olmari

System: ->Settings:-> Cron [+]

image

AdSchellevis avatar Jul 09 '22 18:07 AdSchellevis

I see that option, but it doesn't force update anything, neither does applying parameter "force" there.. One can restart the service as many times as one wants to, but it only says "no need to" in logs. There is indeed new "force" directive in mentioned link that defines ddclient daemon "options", but it is separate from restart :)

olmari avatar Jul 09 '22 19:07 olmari

If „ddclient -force“ doesn’t do what you expect I’m not sure what we can do about it.

fichtner avatar Jul 09 '22 19:07 fichtner

Manually running ddclient -force withing ssh console works, so far I haven't managed to make same happen within web-ui, be it stupid PEBKAC or not.

root@router:~ # ddclient -verbose
SUCCESS:  <xxx>.dy.fi: skipped: IP address was already set to <y.y.y.y>.
root@router:~ # ddclient -verbose -force
INFO:     forcing update of <xxx>.dy.fi.
INFO:     setting IP address to <y.y.y.y> for <xxx>.dy.fi
UPDATE:   updating <xxx>.dy.fi
CONNECT:  www.dy.fi
CONNECTED:  using SSL
SENDING:  GET /nic/update?system=dyndns&hostname=<xxx>.dy.fi&myip=<y.y.y.y> HTTP/1.0
SENDING:   Host: www.dy.fi
SENDING:   Authorization: Basic <pw>
SENDING:   User-Agent: ddclient/3.9.1
SENDING:   Connection: close
SENDING:   
SENDING:   
RECEIVE:  HTTP/1.1 200 OK
RECEIVE:  Server: nginx/1.10.3 (Ubuntu)
RECEIVE:  Date: Sat, 09 Jul 2022 21:30:47 GMT
RECEIVE:  Content-Type: text/plain;charset=UTF-8
RECEIVE:  Connection: close
RECEIVE:  Last-Modified: Sat, 09 Jul 2022 21:30:47 GMT
RECEIVE:  Cache-Control: no-cache
RECEIVE:  Pragma: no-cache
RECEIVE:  
RECEIVE:  good <y.y.y.y>
SUCCESS:  updating <xxx>.dy.fi: good: IP address set to <y.y.y.y>

olmari avatar Jul 09 '22 21:07 olmari

Forgotten apply in cron GUI. If you run „configctl ddclient force“ and it works that would show it‘s the cron setup, otherwise another issue.

the no update message probably comes from the other ddclient running in the background.

fichtner avatar Jul 10 '22 05:07 fichtner

This issue has been automatically timed-out (after 180 days of inactivity).

For more information about the policies for this repository, please read https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md for further details.

If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.

OPNsense-bot avatar Sep 16 '22 15:09 OPNsense-bot

Tried to setup cron job for ddclient with force option, which didn't work, but I noticed that it will set following line to cron job for nobody:

59 13 * * * /usr/local/sbin/configctl -d ddclient restart force

So, I think the restart parameter is run first and force will be omitted. Should there be another option in the web UI for setting custom parameters?

uke75 avatar Oct 31 '22 13:10 uke75

Indeed me neither have gotten this to work from WebUI :/

olmari avatar Oct 31 '22 15:10 olmari

The cron job is "Force ddclient update". It's not so complicated really.

fichtner avatar Nov 01 '22 07:11 fichtner

OK, I see. Definitely it would be simple, if that cron job would be available. At least in my system it is not:

Screenshot 2022-11-01 at 9 55 10
Type opnsense  
  Version 22.7.6
  Architecture amd64
  Flavour OpenSSL
  Commit 2eef9015b
  Mirror https://pkg.opnsense.org/FreeBSD:13:amd64/22.7
  Repositories OPNsense
  Updated on Fri Oct 14 19:58:35 EEST 2022

uke75 avatar Nov 01 '22 08:11 uke75

Fair enough, typo then https://github.com/opnsense/plugins/commit/0fff7f0581c

fichtner avatar Nov 01 '22 08:11 fichtner