luci-app-openvpn: Handle missing openvpn config file.
authorMilad Mohtashamirad <[email protected]>
Mon, 18 Nov 2024 03:09:53 +0000 (14:09 +1100)
committerPaul Donald <[email protected]>
Sat, 30 Nov 2024 04:00:38 +0000 (05:00 +0100)
commit068fa4abe04fa6d71fba780dc985f5239cff44b5
tree70d3c0a37c574ec914e21f586510bbddacf05aab
parentd4a986df99b2596b261dd2327eef716542f34b4b
luci-app-openvpn: Handle missing openvpn config file.

With this change if the specified config file (from UCI) doesn't exist,
it won't error out. instead it treats it as an empty file.
Previously, when clicking edit on the custom_config option in the UI, it
will show an error because the file doesn't exist there by default. As a
result, a user can't easily add (paste) a config file content.

Signed-off-by: Milad Mohtashamirad <[email protected]>
(cherry picked from commit a30ae19006cad444e18b10a5e42a35436a59133e)
applications/luci-app-openvpn/luasrc/model/cbi/openvpn-file.lua