luci-proto-wireguard: rewrite protocol handler
authorJo-Philipp Wich <[email protected]>
Tue, 17 May 2022 13:45:20 +0000 (15:45 +0200)
committerJo-Philipp Wich <[email protected]>
Mon, 1 Aug 2022 09:57:42 +0000 (11:57 +0200)
commitde6638b794221f36399f1db35b9723d6f6a6d62e
treeb87a8ad1805e6c2ae109e084dd41041ca8656f2d
parentc1ab5148ccd1a9bf6d47d0e56d8f7a17be2f2b6e
luci-proto-wireguard: rewrite protocol handler

This commit rewrites large chunks of the WireGuard protocol handler in order
to simplify the process of importing and exporting configuration. The major
changes are:

1) The wireguard interface configuration tab (General Settings) gained an
   import assistant which allows dragging or pasting a native WireGuard
   configuration file in order to import required settrings into uci

2) The peer configuration tab gained a similar import assistant which allows
   importing the settings for a WireGuard peer from an existing native
   WireGuard configuration file

3) The QR code export feature has been rewritten to make the resulting codes
   actually useful for importing into a WireGuard client application.
   Additionally the plaintext native WireGuard configuration is displayed
   to allow copy-pasting it for use on a Linux or OS X system

Signed-off-by: Jo-Philipp Wich <[email protected]>
(cherry picked from commit 9ba20645b01aacb391ab8c69f57b3da60db8f630)
protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
protocols/luci-proto-wireguard/root/usr/libexec/rpcd/luci.wireguard
protocols/luci-proto-wireguard/root/usr/share/rpcd/acl.d/luci-wireguard.json