diff --git a/package/gluon-core/Makefile b/package/gluon-core/Makefile index e90002bb..3b2b7ca9 100644 --- a/package/gluon-core/Makefile +++ b/package/gluon-core/Makefile @@ -16,7 +16,7 @@ define Package/gluon-core CATEGORY:=Gluon TITLE:=Base files of Gluon DEPENDS:= \ - +gluon-site +libgluonutil +lua-platform-info +lua-simple-uci +lua-hash +luci-lib-jsonc +luci-lib-nixio \ + +gluon-site +libgluonutil +lua-platform-info +lua-simple-uci +lua-hash +lua-jsonc +luci-lib-nixio \ +vxlan +odhcp6c +firewall +pretty-hostname endef diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/site.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/site.lua index 56491763..65d38cd8 100644 --- a/package/gluon-core/luasrc/usr/lib/lua/gluon/site.lua +++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/site.lua @@ -1,22 +1,5 @@ -local site = (function() - local config = '/lib/gluon/site.json' - - local json = require 'luci.jsonc' - local decoder = json.new() - local sink = decoder:sink() - - local file = assert(io.open(config)) - - while true do - local chunk = file:read(2048) - if not chunk or chunk:len() == 0 then break end - sink(chunk) - end - - file:close() - - return assert(decoder:get()) -end)() +local json = require 'jsonc' +local site = assert(json.load('/lib/gluon/site.json')) local wrap diff --git a/package/gluon-status-page-api/luasrc/lib/gluon/status-page/www/cgi-bin/interfaces b/package/gluon-status-page-api/luasrc/lib/gluon/status-page/www/cgi-bin/interfaces index d4ea74f8..3410d4a6 100755 --- a/package/gluon-status-page-api/luasrc/lib/gluon/status-page/www/cgi-bin/interfaces +++ b/package/gluon-status-page-api/luasrc/lib/gluon/status-page/www/cgi-bin/interfaces @@ -1,7 +1,7 @@ #!/usr/bin/lua util = require 'gluon.util' fs = require 'nixio.fs' -json = require 'luci.jsonc' +json = require 'jsonc' ubus = require 'ubus' io.write("Access-Control-Allow-Origin: *\n") diff --git a/package/gluon-web/Makefile b/package/gluon-web/Makefile index 57700fc1..eecd0ac0 100644 --- a/package/gluon-web/Makefile +++ b/package/gluon-web/Makefile @@ -16,7 +16,7 @@ define Package/gluon-web SECTION:=gluon CATEGORY:=Gluon TITLE:=Minimal Lua web framework derived from LuCI - DEPENDS:=+luci-lib-jsonc +luci-lib-nixio + DEPENDS:=+lua-jsonc +luci-lib-nixio endef define lang-config diff --git a/package/gluon-web/luasrc/usr/lib/lua/gluon/web/dispatcher.lua b/package/gluon-web/luasrc/usr/lib/lua/gluon/web/dispatcher.lua index de6e6a87..59337213 100644 --- a/package/gluon-web/luasrc/usr/lib/lua/gluon/web/dispatcher.lua +++ b/package/gluon-web/luasrc/usr/lib/lua/gluon/web/dispatcher.lua @@ -4,7 +4,7 @@ -- Licensed to the public under the Apache License 2.0. local fs = require "nixio.fs" -local json = require "luci.jsonc" +local json = require "jsonc" local tpl = require "gluon.web.template" local util = require "gluon.web.util" local proto = require "gluon.web.http.protocol"