summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-rosy-file-server
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-rosy-file-server')
-rw-r--r--applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua37
-rw-r--r--applications/luci-app-rosy-file-server/po/templates/rosy-file-server.pot10
-rw-r--r--applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json35
-rw-r--r--applications/luci-app-rosy-file-server/root/usr/share/rpcd/acl.d/luci-app-rosy-file-server.json11
4 files changed, 53 insertions, 40 deletions
diff --git a/applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua b/applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua
deleted file mode 100644
index dd5598a689..0000000000
--- a/applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua
+++ /dev/null
@@ -1,37 +0,0 @@
--- Copyright 2018 Rosy Song <rosysong@rosinson.com>
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.rosy-file-server.rosy-file-server", package.seeall)
-
-function index()
- if not nixio.fs.access("/etc/config/rosyfs") then
- return
- end
-
- local root = node()
- if not root.target then
- root.target = alias("httpfs")
- root.index = true
- end
-
- page = node()
- page.lock = true
- page.target = alias("httpfs")
- page.subindex = true
- page.index = false
-
- page = node("httpfs")
- page.title = _("Rosy File Server")
- page.target = alias("httpfs", "rosy-file-server")
- page.order = 5
- page.setuser = "root"
- page.setgroup = "root"
- page.index = true
-
- entry({"httpfs", "rosy-file-server"},
- form("rosy-file-server/rosy-file-server"), _("Rosy File Server"), 10)
-
- entry({"admin", "services", "rosyfs"},
- cbi("rosy-file-server/rosyfs"), _("Rosy File Server"), 61)
-end
-
diff --git a/applications/luci-app-rosy-file-server/po/templates/rosy-file-server.pot b/applications/luci-app-rosy-file-server/po/templates/rosy-file-server.pot
index 9f4c775c86..b8f4b1ae05 100644
--- a/applications/luci-app-rosy-file-server/po/templates/rosy-file-server.pot
+++ b/applications/luci-app-rosy-file-server/po/templates/rosy-file-server.pot
@@ -21,6 +21,10 @@ msgstr ""
msgid "Disable Rosy File Server"
msgstr ""
+#: applications/luci-app-rosy-file-server/root/usr/share/rpcd/acl.d/luci-app-rosy-file-server.json:3
+msgid "Grant UCI access for luci-app-rosy-file-server"
+msgstr ""
+
#: applications/luci-app-rosy-file-server/luasrc/model/cbi/rosy-file-server/rosy-file-server.lua:69
msgid "Last Modified"
msgstr ""
@@ -29,10 +33,10 @@ msgstr ""
msgid "Name"
msgstr ""
-#: applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua:24
-#: applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua:32
-#: applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua:35
#: applications/luci-app-rosy-file-server/luasrc/model/cbi/rosy-file-server/rosy-file-server.lua:31
+#: applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json:3
+#: applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json:17
+#: applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json:27
msgid "Rosy File Server"
msgstr ""
diff --git a/applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json b/applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json
new file mode 100644
index 0000000000..c0a466576d
--- /dev/null
+++ b/applications/luci-app-rosy-file-server/root/usr/share/luci/menu.d/luci-app-rosy-file-server.json
@@ -0,0 +1,35 @@
+{
+ "httpfs": {
+ "title": "Rosy File Server",
+ "order": 5,
+ "setuser": "root",
+ "setgroup": "root",
+ "action": {
+ "type": "firstchild"
+ },
+ "depends": {
+ "acl": [ "luci-app-rosy-file-server" ],
+ "uci": { "rosyfs": true }
+ }
+ },
+
+ "httpfs/rosy-file-server": {
+ "title": "Rosy File Server",
+ "order": 1,
+ "action": {
+ "type": "form",
+ "path": "rosy-file-server/rosy-file-server",
+ "post": { "cbi.submit": true }
+ }
+ },
+
+ "admin/services/rosyfs": {
+ "title": "Rosy File Server",
+ "order": 61,
+ "action": {
+ "type": "cbi",
+ "path": "rosy-file-server/rosyfs",
+ "post": { "cbi.submit": true }
+ }
+ }
+}
diff --git a/applications/luci-app-rosy-file-server/root/usr/share/rpcd/acl.d/luci-app-rosy-file-server.json b/applications/luci-app-rosy-file-server/root/usr/share/rpcd/acl.d/luci-app-rosy-file-server.json
new file mode 100644
index 0000000000..b5ce1ffa16
--- /dev/null
+++ b/applications/luci-app-rosy-file-server/root/usr/share/rpcd/acl.d/luci-app-rosy-file-server.json
@@ -0,0 +1,11 @@
+{
+ "luci-app-rosy-file-server": {
+ "description": "Grant UCI access for luci-app-rosy-file-server",
+ "read": {
+ "uci": [ "rosyfs" ]
+ },
+ "write": {
+ "uci": [ "rosyfs" ]
+ }
+ }
+}