-
/usr/share/acl.d
belongs to ubusd and was introduced later, it is unrelated to LuCI and can be ignored (the defaults are sufficient for LuCI to operate) -
/usr/share/rpcd/acl.d/
controls rpcd's ACL mechanism. Details here: https://openwrt.org/docs/techref/ubus#acls -
/usr/share/luci/menu.d/
is a directory of JSON files describing the LuCI menu nodes.- Name and order of files does not matter
- Contents from all files are merged into one common tree.
- Possible fields here: https://github.com/openwrt/luci/blob/openwrt-22.03/modules/luci-base/luasrc/dispatcher.lua#L1160
-
action
: server side action to invoke; can be one of:-
call
- invoke method in Lua class, example{ "type": "call", "module": "luci.example", "function": "my_method", "parameters": [ "static", "args", "to", "pass" ] }
-
view
- render JavaScript view, example{ "type": "view", "path": "my/view" }
-
template
- render server side Lua template, example{ "type": "template", "path": "my/template" }
-
cbi
- render a server side Lua CBI from, example{ "type": "cbi", "path": "my/cbi", "config": "example-uci" }
-
form
- render a server side Lua non-uci form, example{ "type": "form", "path": "my/form" }
-
firstchild
- redirect to first visible subnode, example{ "type": "firstchild" }
-
arcombine
- legacy action type, don't use -
alias
- redirect to another node, example{ "type": "alias", "path": "somewhere/else" }
-
rewrite
- replace first N URL segments with another path, example{ "type": "rewrite", "path": "somewhere/else", "remove": 3 }
(would rewrite/foo/bar/baz/lala
to/somewhere/else/lala
)
-
-
auth
- authentication required on this node and all subnodes (emptyauth
object to disable authentication on a subtree)-
login
- boolean indicating whether to offer a login form on unauthenticated accesses to this node (true
) or not (false
) -
methods
- array of accepted login methods-
cookie:xxx
- extract session ID from HTTP cookie namedxxx
-
query:xxx
- extract session ID from query string parameterxxx
-
param:xxx
- extract session ID from POST parameterxxx
-
-
-
cors
- boolean indicating whether XHR preflight (HTTP OPTIONS) requests should be handled by this node and its children -
depends
- dependency constraints for this node, node is disabled if unfulfilled-
fs
- object or array of objects containing filesystem related dependencies (directory must exist and be not empty, file must exist, file/directory must be absent) - see https://github.com/openwrt/luci/blob/openwrt-22.03/modules/luci-base/luasrc/dispatcher.lua#L21 -
uci
- object or array of objects containing uci related dependencies (uci config must exist, uci section must exist, at least one uci section of type must exist, uci option must be set, uci option must be set to specific value) - see https://github.com/openwrt/luci/blob/openwrt-22.03/modules/luci-base/luasrc/dispatcher.lua#L119
-
-
order
- sort index for node -
setgroup
- for server side processing,setgid()
to this user when doing node action -
setuser
- for server side processing,setuid()
to this user when doing node action -
title
- human readable menu title, node is hidden from menu but accessible by URL if absent -
wildcard
- boolean indicating whether subsequent URL path segments should be ignored for routing and be passed as arguments to the server side action instead
-
-
firstchild_ineligible
- boolean marking a node as unsuitable for selection byfirstchild
action in parent node (e.g. to prevent a non-visible/non-ui node becoming the default choice of a firstchild parent node)
- Type
view
paths are expanded to/www/luci-static/resources/view/${path}.js
- Type
template
paths are expanded to/usr/lib/lua/luci/view/${path}.htm
- Type
cbi
andform
paths are expanded to/usr/lib/lua/luci/model/cbi/${path}.lua
JavaScript (type view
) views are included by a default server side template /usr/lib/lua/luci/view/view.htm
For dependencies, multiple fields in a dependency object form logical and
expressions, multiple objects in an array form logical or
expressions:
"depends": {
"fs": [
{ "/sys/class/leds": "directory", "/etc/init.d/led": "executable" },
{ "/sbin/ledconfig": "executable" }
]
}
The example above read: require either at least one entry in /sys/class/leds/
as well as an executable /etc/init.d/led
or an /sbin/ledconfig
executable. Otherwise menu node is disabled.