Age | Commit message (Collapse) | Author |
|
Existing legacy Lua controllers still use the `post_on()` node dispatch
action, so restore this functionality.
Fixes: #6531
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
While no LuCI code utilizes this function anymore, some existing legacy
Lua controllers expect the function to exist, so restore it.
Fixes: #6532
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
The legacy RPC module authentication fixup was improperly ported into the
Lua dispatcher stub module, rendering legacy RPC authentication broken.
Additionally, the split of the former `sysauth` cookie into `sysauth_http`
and `sysauth_https` ones was also imposed upon the RPC module, without
leaving the option to use just `sysauth` in place, so allow this cookie
name again for the legacy RPC logins.
Fixes: #6333
Fixes: e1932592c3 ("luci-base: use different cookie names for HTTP and HTTPS")
Fixes: ded8ccf93e ("luci-base-ucode: add initial ucode based LuCI runtime")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
To maintain full compatibility with the old Lua runtime, templates
rendered from a menu `template()` action must implicitly inherit the
`luci.dispatcher` namespace as scope while other indirectly included
templates must not.
Fixes: #6105
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Ensure to properly emulate the "dispatched" and "requested" properties
which refer to the executed and initially resolved menu node respectivey.
Also stop exposing a `node` property in Lua context to maintain full
compatibility with the old Lua runtime.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
The ucode side dispatcher environment might not be fully populated yet
when the emulated Lua dispatcher is loaded, leading to `context.requested`
and some other properties to be `nil`.
Expose all properties through metatable `__index` lookups instead to
ensure that the Lua side dispatcher always sees the latest values.
Fixes: #6100
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Some existing legacy code expects the luci.ltn12 namespace to be implicitly
available, even without requiring it beforehand.
Fixes: #6091
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Some legacy Lua controllers declare menu entries by first invoking `node()`
and then setting the `.target` property on the resulting object.
Make sure to properly translate such menu nodes into the internal menu
JSON representation.
Fixes: #6090
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Some legacy templates access dispatcher functions such as `build_url()`
without explicit scope, which worked in the old runtime since the template
view namespace was instantiated from the dispatcher.
Ensure that this continues to function in the emulated runtime.
Fixes: #6082
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
This fixes crashes on "tpl" being undefined.
Signed-off-by: Karl Palsson <karlp@etactica.com>
|
|
Trigger rendering of CBI header and footer templates via the ucode runtime
`include()` in order to ensure that scope data is properly inherited from
Lua templates (`cbi/header`) including ucode templates (`header`).
This fixes automatic triggering of the config apply flow on legacy Lua CBI
forms.
Ref: https://github.com/openwrt/luci/pull/6056#issuecomment-1292396588
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Fixes: #6054
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Ensure that the optional cbi() `config` argument is set to an empty table
if unspecified to ensure that the static call argument array is exactly
two elements long, otherwise call arguments are shifted and the invoked
method might not receive the expected parameter.
This fixes, among others, the dispatching of `arcombine()` targets.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Remove the uhttpd and CGI gateway modules as they're not compatible with
the Lua compat stub runtime anymore.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Some existing model code expects the luci.sys namespace to be implicitly
available, even without requiring it beforehand.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Add a compatibility template containing legacy Lua logic extracted from
the luci-mod-status main status page in order to free the status module
from any explicit or implicit Lua dependencies.
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>
|