Closed mwarning closed 5 years ago
@jow- I could fix that with the "unsafeupload" property but it looks like some css magic is needed (at least in bootstrap theme): OpenWrt theme:
Bootstrap theme:
Thanks!
Would that help? I think this fixes some things.
--- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua
+++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua
@@ -247,6 +247,10 @@ for _, option in ipairs(params) do
o.optional = true
+ if option[1] == FileUpload then
+ o.datatype = "file"
+ end
@mwarning No, that will already checked by the used FileUpload function. Appropriate changes for your issue are in #2307
As a heads up, I applied the changes from #2307 to the current nightly build of OpenWrt and it did not seem to work yet.
@mwarning maybe you could elaborate what "did not seem to work" mean?
Sorry, I meant that FileUpload settings from the template, like dh
and ca
, are not shown despite being preset with dummy values.
I thought you meant that this problem was fixed in #2307.
That's a feature, not a bug. The FileUpload types are only visible if they reference a valid file (typically uploaded by the user in /etc/luci-uploads/....)
I tried to set secret
and thought that would work. But OpenVPN did not start because the ca
field etc. contains a dummy file path. But since I do not see that field, I do not know that I have to add (to make it visible) and then remove that field.
@mwarning Ah OK, I think I've got it ... please test latest #2307, all FileUpload entries should be shown (even with default values).
@dibdot looks good. I can see all fields that are set now. When I clear the dh
filed and hit "Save & Apply", the field is removed. (But hitting the "Save" button does not remove an empty field - is that intentional?)
Yes, that's the usual behaviour - only "apply" will finally update/commit the changes to the uci file itself.
Alright. And is it intentional that luci-app-openvpn does not depend on package openvpn?
yep - I will merge #2307 now. Thanks for your input & testing efforts.
ok, thanks for your efforts.
In the OpenVPN LuCI interface, an instance created from a template has many FileUpload fields that are not shown despite being present in the uci config object (e.g.
dh
orca
). They can be added explicitly so that they appear. But removal does not seem to be possible.