Renamed reworked UCI API to uci2 to allow a peaceful coexistence with the old one
[project/luci.git] / libs / httpd / host / runluci
index 1d58126..f150cae 100755 (executable)
@@ -4,19 +4,28 @@ require("luci.httpd.server")
 require("luci.httpd.handler.file")
 require("luci.httpd.handler.luci")
 
-DOCROOT = arg[1]
+SYSROOT = arg[1]
+DOCROOT = SYSROOT .. arg[2]
 PORT = 8080
 
 collectgarbage("setpause", 150)
 
 serversocket = luci.httpd.Socket("0.0.0.0", PORT)
 
-
 server  = luci.httpd.server.Server()
 vhost   = luci.httpd.server.VHost()
 
 server:set_default_vhost(vhost)
 
+if pcall(require, "uci2") and pcall(require, "luci.model.uci") then
+       luci.model.uci.cursor = function(config, save)
+               return uci2.cursor(config or SYSROOT .. "/etc/config", save or SYSROOT .. "/tmp/.uci")
+       end
+end
+
+require("luci.sys")
+luci.sys.user.checkpasswd = function() return true end
+
 
 filehandler = luci.httpd.handler.file.Simple(DOCROOT)
 vhost:set_default_handler(filehandler)