summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-app-firewall/luasrc/controller/firewall.lua19
-rw-r--r--applications/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json50
-rw-r--r--applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua31
-rw-r--r--applications/luci-app-opkg/luasrc/controller/opkg.lua10
-rw-r--r--applications/luci-app-opkg/root/usr/share/luci/menu.d/luci-app-opkg.json44
5 files changed, 100 insertions, 54 deletions
diff --git a/applications/luci-app-firewall/luasrc/controller/firewall.lua b/applications/luci-app-firewall/luasrc/controller/firewall.lua
deleted file mode 100644
index 5f8cb6ef3..000000000
--- a/applications/luci-app-firewall/luasrc/controller/firewall.lua
+++ /dev/null
@@ -1,19 +0,0 @@
-module("luci.controller.firewall", package.seeall)
-
-function index()
- entry({"admin", "network", "firewall"},
- alias("admin", "network", "firewall", "zones"),
- _("Firewall"), 60)
-
- entry({"admin", "network", "firewall", "zones"},
- view("firewall/zones"), _("General Settings"), 10)
-
- entry({"admin", "network", "firewall", "forwards"},
- view("firewall/forwards"), _("Port Forwards"), 20)
-
- entry({"admin", "network", "firewall", "rules"},
- view("firewall/rules"), _("Traffic Rules"), 30)
-
- entry({"admin", "network", "firewall", "custom"},
- view("firewall/custom"), _("Custom Rules"), 40).leaf = true
-end
diff --git a/applications/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json b/applications/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json
new file mode 100644
index 000000000..c414f3691
--- /dev/null
+++ b/applications/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json
@@ -0,0 +1,50 @@
+{
+ "admin/network/firewall": {
+ "title": "Firewall",
+ "order": 60,
+ "action": {
+ "type": "alias",
+ "path": "admin/network/firewall/zones"
+ },
+ "depends": {
+ "fs": { "/sbin/fw3": "executable" },
+ "uci": { "firewall": true }
+ }
+ },
+
+ "admin/network/firewall/zones": {
+ "title": "General Settings",
+ "order": 10,
+ "action": {
+ "type": "view",
+ "path": "firewall/zones"
+ }
+ },
+
+ "admin/network/firewall/forwards": {
+ "title": "Port Forwards",
+ "order": 20,
+ "action": {
+ "type": "view",
+ "path": "firewall/forwards"
+ }
+ },
+
+ "admin/network/firewall/rules": {
+ "title": "Traffic Rules",
+ "order": 30,
+ "action": {
+ "type": "view",
+ "path": "firewall/rules"
+ }
+ },
+
+ "admin/network/firewall/custom": {
+ "title": "Custom Rules",
+ "order": 40,
+ "action": {
+ "type": "view",
+ "path": "firewall/custom"
+ }
+ }
+}
diff --git a/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua b/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua
index 396dedd4a..6194a18dc 100644
--- a/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua
+++ b/applications/luci-app-ocserv/luasrc/model/cbi/ocserv/main.lua
@@ -17,35 +17,14 @@ local e = s:taboption("general", Flag, "enable", translate("Enable server"))
e.rmempty = false
e.default = "1"
-local o_sha = s:taboption("general", DummyValue, "sha_hash", translate("Server's certificate SHA1 hash"),
- translate("That value should be communicated to the client to verify the server's certificate"))
local o_pki = s:taboption("general", DummyValue, "pkid", translate("Server's Public Key ID"),
- translate("An alternative value to be communicated to the client to verify the server's certificate; this value only depends on the public key"))
+ translate("The value to be communicated to the client to verify the server's certificate; this value only depends on the public key"))
-local fd = io.popen("/usr/bin/certtool -i --infile /etc/ocserv/server-cert.pem", "r")
+local fd = io.popen("/usr/bin/certtool --hash sha256 --key-id --infile /etc/ocserv/server-cert.pem", "r")
if fd then local ln
- local found_sha = false
- local found_pki = false
- local complete = 0
- while complete < 2 do
- local ln = fd:read("*l")
- if not ln then
- break
- elseif ln:match("SHA%-?1 fingerprint:") then
- found_sha = true
- elseif found_sha then
- local hash = ln:match("([a-f0-9]+)")
- o_sha.default = hash and hash:upper()
- complete = complete + 1
- found_sha = false
- elseif ln:match("Public Key I[Dd]:") then
- found_pki = true
- elseif found_pki then
- local hash = ln:match("([a-f0-9]+)")
- o_pki.default = hash and "sha1:" .. hash:upper()
- complete = complete + 1
- found_pki = false
- end
+ local ln = fd:read("*l")
+ if ln then
+ o_pki.default = "sha256:" .. ln
end
fd:close()
end
diff --git a/applications/luci-app-opkg/luasrc/controller/opkg.lua b/applications/luci-app-opkg/luasrc/controller/opkg.lua
index 29c9a0864..ebdcf1b09 100644
--- a/applications/luci-app-opkg/luasrc/controller/opkg.lua
+++ b/applications/luci-app-opkg/luasrc/controller/opkg.lua
@@ -3,14 +3,6 @@
module("luci.controller.opkg", package.seeall)
-function index()
- entry({"admin", "system", "opkg"}, template("opkg"), _("Software"), 30)
- entry({"admin", "system", "opkg", "list"}, call("action_list")).leaf = true
- entry({"admin", "system", "opkg", "exec"}, post("action_exec")).leaf = true
- entry({"admin", "system", "opkg", "statvfs"}, call("action_statvfs")).leaf = true
- entry({"admin", "system", "opkg", "config"}, post_on({ data = true }, "action_config")).leaf = true
-end
-
function action_list(mode)
local util = require "luci.util"
local cmd
@@ -26,7 +18,7 @@ function action_list(mode)
fd:close()
end
- if not lists_dir or #lists_dir == "" then
+ if not lists_dir or #lists_dir == 0 then
lists_dir = "/tmp/opkg-lists"
end
diff --git a/applications/luci-app-opkg/root/usr/share/luci/menu.d/luci-app-opkg.json b/applications/luci-app-opkg/root/usr/share/luci/menu.d/luci-app-opkg.json
new file mode 100644
index 000000000..9356b586d
--- /dev/null
+++ b/applications/luci-app-opkg/root/usr/share/luci/menu.d/luci-app-opkg.json
@@ -0,0 +1,44 @@
+{
+ "admin/system/opkg": {
+ "title": "Software",
+ "order": 30,
+ "action": {
+ "type": "template",
+ "path": "opkg"
+ }
+ },
+
+ "admin/system/opkg/list/*": {
+ "action": {
+ "type": "call",
+ "module": "luci.controller.opkg",
+ "function": "action_list"
+ }
+ },
+
+ "admin/system/opkg/exec/*": {
+ "action": {
+ "type": "call",
+ "post": true,
+ "module": "luci.controller.opkg",
+ "function": "action_exec"
+ }
+ },
+
+ "admin/system/opkg/statvfs/*": {
+ "action": {
+ "type": "call",
+ "module": "luci.controller.opkg",
+ "function": "action_statvfs"
+ }
+ },
+
+ "admin/system/opkg/config/*": {
+ "action": {
+ "type": "call",
+ "post": { "data": true },
+ "module": "luci.controller.opkg",
+ "function": "action_config"
+ }
+ }
+}