I am looking for testers for the just completed rewrite of LuCI's server (router) side runtime. The corresponding PR can be found here:
Description
Large parts of LuCI have been moved to client side rendering throughout the last few years leaving mostly request routing (dispatcher) as well as ubus request gateway functionality and a few assorted template rendering and session management tasks on router side.
Those remaining bits were still implemented using the Lua 5.1 language and have now been rewritten using the ucode language used by firewall4 introduced with the 22.03 release.
The Lua parts required to retain compatibility with older LuCI apps or apps that already do client side rendering but still rely on Lua code in the backend (e.g. for custom controllers or rpcd exec plugins) were factored out into a new luci-lua-runtime
package.
The aim of the LuCI ucode rewrite is to remain fully compatible with the previous Lua based LuCI.
Motivation
Several considerations led me to the decision to rewrite the LuCI runtime:
-
Storage footprint - since 22.03 now ships with two scripting languages (Lua and ucode) by default I wanted to eliminate the use of Lua in the default images at least to gain back some previously lost space. In early tests here the complete removal of Lua and related libraries saved about 120KB on the x86/64 rootfs after gzip compression.
-
LuCI is stuck on an outdated version 5.1 of Lua and upgrading to the latest version would require significant refactoring of the code, so I figured I could as well spend the extra effort to port it entirely to another environment.
-
Simpler implementation - since ucode has several required functionalities directly built in, mainly templating and JSON support as well as uci, ubus, uloop and filesystem bindings, we require less extra libraries to achieve the same result. Another hope is that the closely JavaScript related syntax will make the code more accessible to future contributors
Implications
Hopefully none LuCI should function just as before. It should behave and look the same but with a smaller storage footprint. It should also seamlessly support existing LuCI applications still using Lua through the optional luci-lua-runtime
package.
Any deviation from the current LuCI would be a bug which need to be addressed.
Building
In order to test this, a very recent OpenWrt master branch including the latest versions of rpcd and ucode is required, as well as the LuCI branch linked in the PR above.
To use it, copy feeds.conf.default
to feeds.conf
in your buildroot and change the LuCI feed entry to:
src-git-full luci https://github.com/jow-/luci.git;ucode
Proceed with ./scripts/feeds update
and ./scripts/feeds install -a -p luci
I advise to start with a fresh .config and just luci
selected as package in order to get rid of implicit Lua dependencies still present in existing build configurations.
Afterwards build as usual and test the resulting image.
Roadmap
Once I got some wider testing coverage and can assert the stability of the implementation I would proceed with merging the rewrite into LuCI mainline and start with converting remaining LuCI application Lua code, beginning with the most popular applications.
Once merged, I will also start working on LuCI precompilation support which allows compiling plain ucode sources to packed bytecode at build time. This speeds up the application startup times and further reduces required storage footprint.