Publish luci.model.ipkg via JSON-RPC
This commit is contained in:
parent
e068351a3f
commit
77756f08b4
1 changed files with 14 additions and 0 deletions
|
@ -45,6 +45,10 @@ function index()
|
||||||
fs.sysauth = "root"
|
fs.sysauth = "root"
|
||||||
fs.sysauth_authenticator = authenticator
|
fs.sysauth_authenticator = authenticator
|
||||||
|
|
||||||
|
fs = entry({"rpc", "ipkg"}, call("rpc_ipkg"))
|
||||||
|
fs.sysauth = "root"
|
||||||
|
fs.sysauth_authenticator = authenticator
|
||||||
|
|
||||||
uci = entry({"rpc", "auth"}, call("rpc_auth"))
|
uci = entry({"rpc", "auth"}, call("rpc_auth"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -135,3 +139,13 @@ function rpc_sys()
|
||||||
http.prepare_content("application/json")
|
http.prepare_content("application/json")
|
||||||
ltn12.pump.all(jsonrpc.handle(sys, http.source()), http.write)
|
ltn12.pump.all(jsonrpc.handle(sys, http.source()), http.write)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function rpc_ipkg()
|
||||||
|
local ipkg = require "luci.model.ipkg"
|
||||||
|
local jsonrpc = require "luci.jsonrpc"
|
||||||
|
local http = require "luci.http"
|
||||||
|
local ltn12 = require "luci.ltn12"
|
||||||
|
|
||||||
|
http.prepare_content("application/json")
|
||||||
|
ltn12.pump.all(jsonrpc.handle(ipkg, http.source()), http.write)
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in a new issue