summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-radicale2/luasrc/controller/radicale2.lua
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2019-01-13 13:21:01 +0200
committerGitHub <noreply@github.com>2019-01-13 13:21:01 +0200
commit80ac438857ae713c6f58db64b91b196e9df5f31a (patch)
treed3ee74bc26c96f184cee4c9884bef6b1b08fa3e0 /applications/luci-app-radicale2/luasrc/controller/radicale2.lua
parent47d9205fe9b82d3a434def60e479c23ef491a06d (diff)
parent29e01e0e5b4bf9a25e88de7309637b0f461ef6a9 (diff)
Merge pull request #2426 from cshoredaniel/pr-luci-app-radicale2
luci-app-radicale2: Add CalDAV/CardDAV server Radicale 2.x
Diffstat (limited to 'applications/luci-app-radicale2/luasrc/controller/radicale2.lua')
-rw-r--r--applications/luci-app-radicale2/luasrc/controller/radicale2.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/applications/luci-app-radicale2/luasrc/controller/radicale2.lua b/applications/luci-app-radicale2/luasrc/controller/radicale2.lua
new file mode 100644
index 000000000..7b94552ed
--- /dev/null
+++ b/applications/luci-app-radicale2/luasrc/controller/radicale2.lua
@@ -0,0 +1,38 @@
+-- Licensed to the public under the Apache License 2.0.
+
+module("luci.controller.radicale2", package.seeall)
+
+function index()
+ local page
+
+ -- no config create an empty one
+ if not nixio.fs.access("/etc/config/radicale2") then
+ nxfs.writefile("/etc/config/radicale2", "")
+ end
+
+ page = entry({"admin", "services", "radicale2"}, alias("admin", "services", "radicale2", "server"), _("Radicale 2.x"))
+ page.leaf = false
+
+ page = entry({"admin", "services", "radicale2", "server"}, cbi("radicale2/server"), _("Server Settings"))
+ page.leaf = true
+ page.order = 10
+
+ page = entry({"admin", "services", "radicale2", "auth"}, cbi("radicale2/auth"), _("Authentication / Users"))
+ page.leaf = true
+ page.order = 20
+
+ page = entry({"admin", "services", "radicale2", "storage"}, cbi("radicale2/storage"), _("Storage"))
+ page.leaf = true
+ page.order = 30
+
+ page = entry({"admin", "services", "radicale2", "logging"}, cbi("radicale2/logging"), _("Logging"))
+ page.leaf = true
+ page.order = 40
+end
+
+function pymodexists(module)
+ retfun = luci.util.execi('python3 -c \'import importlib.util as util;found_module = util.find_spec("' .. module .. '");print(found_module is not None);print("\\n")\'')
+ retval = retfun() == "True"
+ while retfun() do end
+ return retval
+end