Do not export the function for use elsewhere - it shall only be used within
the luci script (to determine netifd version).
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Remodeled the CBILogreadBox after the syslog viewer. Also
updated to use ubus log read, and drops the use of the logread binary
(logread is broken on snapshots). The JSON output from ubus is nice
enough to work with.
One potential drawback is that all log entries are sent to the browser
(as it always has been), and no on-device pre-filtering is available yet
except for line count.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
There appear to be no consumers of getLocaltime. One instance of a
callGetLocaltime uses the system info call whose localtime property uses
tm->tm_gmtoff which is "Seconds East of UTC" i.e. a unixtime value
with the timezone baked in to the value.
Sometimes we actually want Unixtime. So rename to clarify what this
function actually returns.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Right now, the checkUfpInstalled RPC call is performed first, and only after
that can the other Promises be called. Simplify this by adding a single check
for /usr/sbin/ufpd in the rpcd ucode, and replace calls to checkUfpInstalled()
with simple L.hasSystemFeature('ufpd') check (which is only done once, and
cached).
This also allows the 'stat' permission to be removed from a couple of acls.
Signed-off-by: David Härdeman <david@hardeman.nu>
For dnsmasq, feature detection is currently supported like this:
L.hasSystemFeature('dnsmasq', 'dhcpv6')
while for odhcpd, only a basic check is supported:
L.hasSystemFeature('odhcpd')
With this patch, a similar feature check is also possible for odhcpd,
e.g.:
L.hasSystemFeature('odhcpd', 'dhcpv6')
Signed-off-by: David Härdeman <david@hardeman.nu>
otherwise ucode function call breaks with:
RPC call to luci/getInitList failed with error -32000: Object not found
Follow-up fix to ab15b5e379
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
The kmod install link only displays in new device dialogues so as not
to be too prominent.
Closes#6996Closes#7086
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Add APK as detectable feature so that generic luci-app-pkg can detect
OPKG or APK package manager.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Required for luci to check whether installed hostapd or wpa_supplicant is
built with the Operating Channel Validation feature.
Signed-off-by: Michael Yartys <mail@yartys.no>
It is possible that the uci configuration file will be added to the system
later. Therefore, ucitrack json definitions are always added to ucitrack
triggers and it is not checked whether the uci configuration file exists.
Reported-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
In the whole OpenWrt there is no ntpclient uci config, this must be a
leftover and can therefore be deleted.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
In the whole OpenWrt there is no httpd uci config, this must be a leftover
from before uhttpd and can therefore be deleted.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
The 'ucitrack' configuration under '/etc/config' defines which service must
be restarted on a LuCI change. This uci file defines how all this works
together. Additionally there are 'uci-defaults' scripts in the various
applications that add additional configurations parameters to this ucitrack
file if a service must be reloaded/restarted on a LuCI change.
There are some problems with the current implementation:
* The uci should be used to configure the system and not for this kind of
reload/restart dependency handling on LuCI changes.
* On a system update with configuration restore of the 'ucitrack' file
the new behavior on LuCI reload/restart could not take into account
because the new file is *not* used.
This commit converts the handling from uci to json.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Add a new luci/getBuiltinEthernetPorts RPC call which returns a consolidated
list of known ethernet ports found in `/etc/board.json`.
Add an x86/64 specific workaround which attempts to enumerate missing
ethernet devices too.
Ref: #6534, #6538
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Add entries from `/proc/swaps` to the result array as well in order to
let the ui properly deal with swap files.
Fixes: #6350
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This feature flag doesn't exist anymore, see this commit on the main repo:
7c63295bf4 "treewide: remove DRIVER_11N_SUPPORT"
Signed-off-by: Andre Heider <a.heider@gmail.com>
Instead of scraping the LuCI version from Lua sources, fetch it via ubus
in order to be independent from the Lua runtime.
Fixes: #6154
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Move classes required for Lua runtime support into a new `luci-lua-runtime`
package. Also replace the `luci.http` and `luci.util` classes in
`luci-lib-base` with stubbed versions interacting with the ucode based
runtime environment.
Finally merge `luci-base-ucode` into the remainders of `luci-base`.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Added more meta headers to ensure proper cache control in Firefox.
Before this patch, the `/` url hasn't even been requested when opened in Firefox.
Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
Since HTTP cookies may not overwrite HTTPS ("secure") ones, users are
frequently unable to log into LuCI when a stale, "secure" `sysauth` cookie
is still present in the browser as it commonly happens after e.g. a
sysupgrade operation or when frequently jumping between HTTP and HTTPS
access.
Rework the dispatcher to set either a `sysauth_http` or `sysauth_https`
cookie, depending on the HTTPS state of the server connection and accept
both cookie names when verifying the session ID.
This allows users to log into a HTTP-only LuCI instance while a stale,
"secure" HTTPS cookie is still present.
Requires commit 2b0539ef9d ("lucihttp: update to latest Git HEAD") to
function properly.
Fixes: #5843
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
On boards with ADSL instead of VDSL support we need to expect an
`/sbin/dsl_cpe_control` instead of an `/sbin/vdsl_cpe_control` executable.
Ref: https://forum.openwrt.org/t/dsl-line-stats/126580
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Changes on a given configuration should trigger change events on affected
configurations, not the other way around.
Fixes: #5745
Signed-off-by: Jo-Philipp Wich <jo@mein.io>