1 -- Licensed to the public under the Apache License 2.0.
3 local rad2 = luci.controller.radicale2
4 local fs = require("nixio.fs")
6 local m = Map("radicale2", translate("Radicale 2.x"),
7 translate("A lightweight CalDAV/CardDAV server"))
9 local s = m:section(NamedSection, "storage", "section", translate("Storage"))
13 o = s:option(ListValue, "type", translate("Storage Type"))
14 o:value("", translate("Default (multifilesystem)"))
15 o:value("multifilesystem", translate("Multiple files on filesystem"))
19 o = s:option(Value, "filesystem_folder", translate("Folder"), translate("Folder in which to store collections"))
21 o:depends("type", "multifilesystem")
23 o.placeholder = "/srv/radicale2/data"
25 o = s:option(Flag, "filesystem_locking", translate("Use File Locks"), translate("Prevent other instances or processes from modifying collections while in use"))
27 o:depends("type", "multifilesystem")
31 o = s:option(Value, "max_sync_token_age", translate("Max Sync Token Age"), translate("Delete sync token that are older (seconds)"))
33 o:depends("type", "multifilesystem")
35 o.placeholder = 2592000
36 o.datatype = "uinteger"
38 o = s:option(Flag, "filesystem_close_lock_file", translate("Close Lock File"), translate("Close the lock file when no more clients are waiting"))
40 o:depends("type", "multifilesystem")
42 o.default = o.disabled
44 o = s:option(Value, "hook", translate("Hook"), translate("Command that is run after changes to storage"))
46 o:depends("type", "multifilesystem")
48 o.placeholder = ("Example: ([ -d .git ] || git init) && git add -A && (git diff --cached --quiet || git commit -m \"Changes by \"%(user)s")