luci-app-openvpn: allow and restrict file uploads to /etc/openvpn/

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-01-20 19:16:59 +01:00
parent 878d662282
commit cc01770fa1
3 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,11 @@
{
"luci-app-openvpn": {
"description": "Grant file upload access to /etc/openvpn",
"write": {
"cgi-io": [ "upload" ],
"file": {
"/etc/openvpn/*": [ "write" ]
}
}
}
}

View file

@ -838,6 +838,8 @@ for _, option in ipairs(params) do
o.value = option[3]
elseif option[1] == FileUpload then
o.initial_directory = "/etc/openvpn"
function o.cfgvalue(self, section)
local cfg_val = AbstractValue.cfgvalue(self, section)

View file

@ -128,6 +128,8 @@ for _, option in ipairs(basicParams) do
o.value = option[3]
elseif option[1] == FileUpload then
o.initial_directory = "/etc/openvpn"
function o.cfgvalue(self, section)
local cfg_val = AbstractValue.cfgvalue(self, section)