luci-app-lxc: small fixes & cosmetics
[project/luci.git] / applications / luci-app-lxc / luasrc / model / cbi / lxc.lua
index ac0fdff332b529eac2c16999781bce011b3bc90a..db7d19eb26d0f3b153be6505286e641958b82fdd 100644 (file)
@@ -14,18 +14,35 @@ Author: Petar Koretic <petar.koretic@sartura.hr>
 
 ]]--
 
-local fs = require "nixio.fs"
-
-m = Map("lxc", translate("LXC Containers"))
-
-if fs.access("/etc/config/lxc") then
-       m:section(SimpleSection).template = "lxc"
-
-       s = m:section(TypedSection, "lxc", translate("Options"))
-       s.anonymous = true
-       s.addremove = false
-
-       s:option(Value, "url", translate("Containers URL"))
-end
+m = Map("lxc", translate("LXC Containers"),
+       translate("<b>Please note:</b> For LXC Containers you need a custom OpenWrt image.<br />")
+       .. translate("The image should include at least support for 'kernel cgroups', 'kernel namespaces' and 'miscellaneous LXC related options' plus 'kmod-veth' for optional network support."))
+m:section(SimpleSection).template = "lxc"
+
+s = m:section(TypedSection, "lxc", translate("Options"))
+s.anonymous = true
+
+o1 = s:option(Value, "url", translate("Containers URL"))
+o1:value("images.linuxcontainers.org")
+o1:value("repo.turris.cz/lxc", "repo.turris.cz/lxc (SSL req.)")
+o1.default = "images.linuxcontainers.org"
+o1.rmempty = false
+
+o2 = s:option(Flag, "ssl_enabled", translate("Enable SSL"),
+       translate("Enable optional SSL encryption support. This requires additional packages like 'wget', 'ca-certificates', 'gnupg' and 'gnupg-utils'."))
+o2.default = o2.disabled
+o2.rmempty = false
+
+o3 = s:option(Value, "min_space", translate("Free Space Threshold"),
+       translate("Minimum required free space for LXC Container creation in KB"))
+o3.default = "100000"
+o3.datatype = "min(50000)"
+o3.rmempty = false
+
+o4 = s:option(Value, "min_temp", translate("Free Temp Threshold"),
+       translate("Minimum required free temp space for LXC Container creation in KB"))
+o4.default = "100000"
+o4.datatype = "min(50000)"
+o4.rmempty = false
 
 return m