luci-proto-wireguard: handle multiple peers in imported configuration
authorJo-Philipp Wich <jo@mein.io>
Mon, 1 Aug 2022 11:00:31 +0000 (13:00 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 1 Aug 2022 11:00:31 +0000 (13:00 +0200)
commit94bfa33452ad7db683e9f47ea9921e92b5175558
treef5158b0fea062f11df8f18d84e00b7e67bbe1f8c
parentabd9125fbf5e2fadc0c5ae293496680df08e6e1b
luci-proto-wireguard: handle multiple peers in imported configuration

When importing a fully configuration, import all peer entries from it
instead of non-deterministically merging all peer keys into one.

When importing a remote configuration as peer, only use the setting from
the peer section matching our local interface pubkey.

Also relabel the `Import peer configuration` button to
`Import configuration as peer` in order to be more explicit.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js