1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Update luci-base

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-07-26 18:16:18 +02:00
parent bf0a1269dd
commit 86437d902f
5 changed files with 275 additions and 19 deletions

View file

@ -285,6 +285,41 @@ local methods = {
local fs = require "nixio.fs"
return { offload_support = not not fs.access("/sys/module/xt_FLOWOFFLOAD/refcnt") }
end
},
conntrack_helpers = {
call = function()
local fd = io.open("/usr/share/fw3/helpers.conf", "r")
local rv = {}
local line, entry
while true do
line = fd:read("*l")
if not line then
break
end
if line:match("^%s*config%s") then
if entry then
rv[#rv+1] = entry
end
entry = {}
else
local opt, val = line:match("^%s*option%s+(%S+)%s+(%S.*)$")
if opt and val then
opt = opt:gsub("^'(.+)'$", "%1"):gsub('^"(.+)"$', "%1")
val = val:gsub("^'(.+)'$", "%1"):gsub('^"(.+)"$', "%1")
entry[opt] = val
end
end
end
if entry then
rv[#rv+1] = entry
end
return { helpers = rv }
end
}
}

View file

@ -13,7 +13,7 @@
"read": {
"ubus": {
"iwinfo": [ "info" ],
"luci": [ "boardjson", "duid_hints", "host_hints", "ifaddrs", "initList", "getLocaltime", "leases", "leds", "netdevs", "offload_support", "usb" ],
"luci": [ "boardjson", "duid_hints", "host_hints", "ifaddrs", "initList", "getLocaltime", "leases", "leds", "netdevs", "usb" ],
"network.device": [ "status" ],
"network.interface": [ "dump" ],
"network.wireless": [ "status" ],
@ -28,5 +28,17 @@
},
"uci": [ "*" ]
}
},
"luci-app-firewall": {
"description": "Grant access to firewall procedures",
"read": {
"ubus": {
"luci": [ "conntrack_helpers", "offload_support" ]
},
"uci": [ "firewall" ]
},
"write": {
"uci": [ "firewall" ]
}
}
}