convert luci.fs users to nixio.fs api
[project/luci.git] / applications / luci-openvpn / luasrc / model / cbi / openvpn-basic.lua
index 964da44..b3e22d4 100644 (file)
@@ -12,7 +12,6 @@ You may obtain a copy of the License at
 $Id$
 ]]--
 
-require("luci.fs")
 require("luci.ip")
 require("luci.model.uci")
 
@@ -42,11 +41,12 @@ local basicParams = {
        { Flag,                 "client_to_client",             0 },
        { DynamicList,  "remote",                               "vpnserver.example.org" },
 
-       { Value,                "secret",                               "/etc/openvpn/secret.key 1" },
-       { Value,                "ca",                                   "/etc/easy-rsa/keys/ca.crt" },
-       { Value,                "dh",                                   "/etc/easy-rsa/keys/dh1024.pem" },
-       { Value,                "cert",                                 "/etc/easy-rsa/keys/some-client.crt" },
-       { Value,                "key",                                  "/etc/easy-rsa/keys/some-client.key" },
+       { FileUpload,   "secret",                               "/etc/openvpn/secret.key 1" },
+       { FileUpload,   "pkcs12",                               "/etc/easy-rsa/keys/some-client.pk12" },
+       { FileUpload,   "ca",                                   "/etc/easy-rsa/keys/ca.crt" },
+       { FileUpload,   "dh",                                   "/etc/easy-rsa/keys/dh1024.pem" },
+       { FileUpload,   "cert",                                 "/etc/easy-rsa/keys/some-client.crt" },
+       { FileUpload,   "key",                                  "/etc/easy-rsa/keys/some-client.key" },
 }
 
 
@@ -61,7 +61,12 @@ p.instance = arg[1]
 local s = m:section( NamedSection, arg[1], "openvpn" )
 
 for _, option in ipairs(basicParams) do
-       local o = s:option(option[1], option[2])
+       local o = s:option(
+               option[1], option[2],
+               translate("openvpn_param_%s" % option[2]),
+               translate("openvpn_param_%s_desc" % option[2])
+       )
+       
        o.optional = true
 
        if option[1] == DummyValue then