summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-12-17 15:00:24 +0100
committerJo-Philipp Wich <jo@mein.io>2022-12-17 15:01:46 +0100
commita27d2dbc32785c3389ea77a26714e7f6c67c9185 (patch)
tree578eed51469131c4ca9bdfe16894f964fc636453 /modules/luci-base
parent05194712bb2119b79041f256c44e35a044594f75 (diff)
luci-base, luci-mod-status: expose LuCI version via ubus
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>
Diffstat (limited to 'modules/luci-base')
-rw-r--r--modules/luci-base/root/usr/share/rpcd/ucode/luci7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/luci-base/root/usr/share/rpcd/ucode/luci b/modules/luci-base/root/usr/share/rpcd/ucode/luci
index e237979352..a30e276b80 100644
--- a/modules/luci-base/root/usr/share/rpcd/ucode/luci
+++ b/modules/luci-base/root/usr/share/rpcd/ucode/luci
@@ -7,6 +7,7 @@ import { stdin, access, dirname, basename, open, popen, glob, lsdir, readfile, r
import { cursor } from 'uci';
import { init_list, init_index, init_enabled, init_action, conntrack_list, process_list } from 'luci.sys';
+import { revision, branch } from 'luci.version';
import { statvfs } from 'luci.core';
import timezones from 'luci.zoneinfo';
@@ -17,6 +18,12 @@ function shellquote(s) {
}
const methods = {
+ getVersion: {
+ call: function(request) {
+ return { revision, branch };
+ }
+ },
+
getInitList: {
args: { name: 'name' },
call: function(request) {