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:04 +0000 (05:00 +0100)
commita30ae19006cad444e18b10a5e42a35436a59133e
treeb609c69b37f06a7dffee80da1737a8665437dc5c
parent63b7e637c94a57973cf889b699be42198af19d49
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]>
applications/luci-app-openvpn/luasrc/model/cbi/openvpn-file.lua