-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
luci-app-ntpc: remove app #6945
Conversation
Great! I didn't even notice we had this app. Could you hint the host name and port fields for when they're empty? Maybe also add in the package description that this is a client. |
Also, would it be interesting to try and calculate the latency between browser and openwrt and attempt to compensate for the offset? Code golf perhaps 😎 Entirely optional. |
That sounds like good additions, I will add that.
Haha, I can give it a shot, but I don't promise anything, if anything I can experiment with it and open a PR later on for it. |
@systemcrash I've updated the code with your suggestions. |
One question: the local Date() clock monotonically increases with time? |
No, once you enter the app, the clock fetches the current timestamp and displays that, with no auto-refresh or anything fancy like that. That is also how the previous implementation in Lua behaved so I didn't change that, but it wouldn't be hard to implement this if we wanted, like how the overview page auto-refreshes the Local Time every 5 seconds. |
OK - I'm trying to reconcile what System -> Time Sync does not do. With such similar data and function, perhaps the two could be merged if they are not already the same. |
I think the biggest difference is that System -> Time Sync is built to support ntpd while this app was built to support ntpclient, so consolidating them would be quite a challenge of the top of my head as we would need to adapt We could of course think of adding UI options of features that ntpclient has that ntpd doesn't but that it currently supports but I think that's entirely separate PR:s to do that work. |
So I just had a look at the ntpclient package. It points to http://doolittle.icarus.com/ntpclient which is dead. Unless a suitable replacement is found, the package can be removed. The existing system can make calls to other ntpd sources to synchronise, which is basically what ntpclient does, right? |
Nice find, I didn't even know that the project was dead. I'm not opposed to just deleting the whole package, I don't know what the processes are regarding that if there's some users that are currently relying on it?
I'm not entirely sure but yes I think so. I created this PR purely to port luci-app-ntpc to JavaScript and what I did to verify was to check that the UCI config values that the Lua implementation wrote to was still updated correctly after the conversion.
|
Not sure how anyone can rely on a package which has no sources any longer. We can check back in a few days and see whether the host comes back. I've made a PR otherwise here openwrt/packages#23569 |
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.
Nice work.
Please become a maintainer and add PKG_MAINTAINER
#: applications/luci-app-ntpc/luasrc/model/cbi/ntpc/ntpcmini.lua:6 | ||
msgid "Synchronizes the system time" | ||
#: applications/luci-app-ntpc/htdocs/luci-static/resources/view/ntpc.js:24 | ||
msgid "Synchronizes the system time." |
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.
Please remove the dot at end and this will keep a translation
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.
Fixed
|
||
return view.extend({ | ||
load: function () { | ||
return Promise.all([ |
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.
Here you have only one promise so you can remove the Promise.all()
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.
Fixed
render: function (data) { | ||
var system_info = data[0]; | ||
|
||
var m, s1, time, interval, count, freq, s2, s3, hostname, port; |
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.
Usually for section and option separate vars aren't created.
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.
Fixed
|
||
m = new form.Map('ntpclient', _('Time Synchronisation'), _('Synchronizes the system time.')); | ||
|
||
s1 = m.section(form.TypedSection, 'ntpclient', _('General')); |
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.
So instead of s1 use:
s = m.section(form.TypedSection, 'ntpclient', _('General'));
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.
Fixed
); | ||
} | ||
|
||
time = s1.option(form.DummyValue, '_time', _('Current system time')); |
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.
o = s.option(form.DummyValue, '_time', _('Current system time'));
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.
Fixed
@systemcrash has a PR open in openwrt/packages#23569 to drop support for ntpclient since the sources seems to be dead (#6945 (comment)), so we may drop the app entirely instead. If the decision is made to drop it, I can just close this PR and create a new one which drops the app. Otherwise I can add myself as a maintainer. |
Interesting, I found that Luci already has NTP config in a System page if the sysntpd from BusyBox was enabled during a compilation. Its settings are stored to /etc/config/system:
So yes, probably the feature may be removed. |
Busybox ntp has been the default server and client at least for a decade, and there has been config for that in System settings (luci-mod-system) all the time. So, I really wonder if somebody is actively using this. This app has not been modified for some 10 years... |
No I don't use it, I basically picked this as a "test platform" to get into developing in LuCI (the whole "we don't develop apps in Lua anymore" seemed a good issue to start with). I'm fine to drop support for the whole app it if we conclude that the ntp functionality in System settings fulfill the same goals. |
OK, we can axe ntpc. @dannil please truncate this PR just to removal. |
As ntpclient package is dead, we can delete the app. Signed-off-by: Daniel Nilsson <daniel.nilsson94@outlook.com>
PR and commit is updated to remove the app instead. |
It needs to be backported to OpenWrt 23.05. |
ntp sources are dead and gone. The most important functionality is now provided by ntpd. Signed-off-by: Paul Donald <newtwen@gmail.com> (cherry picked from commit 2cd10d8)
I've opened #6970 to backport it. |
luci-app-ntpc: remove app (cherry picked from commit 452e813)
luci-app-ntpc: remove app (cherry picked from commit 452e813)
luci-app-ntpc: remove app (cherry picked from commit 452e813)
luci-app-ntpc: remove app (cherry picked from commit 452e813)
As ntpclient package is dead, we can delete the app.
See #6945 (comment) and openwrt/packages#23569
Converted the app to use client-side JavaScript instead of Lua. The only real change to the previous implementation is I changed theCurrent system time
field to match the format inStatus -> System -> Local Time
as I could not get the%c
date format to work with the format function; if this is possible feel free to comment this. Package doesn't have a PKG_VERSION so by definition it hasn't been incremented.Signed-off-by: <my@email.address>
row (viagit commit --signoff
)<package name>: title
first line subject for packagesPKG_VERSION
in the Makefile