diff options
author | Hannu Nyman <hannu.nyman@iki.fi> | 2022-09-06 23:46:14 +0300 |
---|---|---|
committer | Hannu Nyman <hannu.nyman@iki.fi> | 2022-09-06 23:48:56 +0300 |
commit | 38ce475bc9143f2f5e0446b1db92f6a07005ddb4 (patch) | |
tree | 48ab9cebb5522451774282eb72ddcb6e485823e0 /protocols/luci-proto-unet | |
parent | 10bcb228a7fc02a8e9ecb1ff584fd63b77a55afd (diff) |
luci-proto-unet: initial support
Initial support for the new unetd VPN daemon.
Currently this just enables seeing the VPN interface
in the LuCI network overview, plus the keys used.
No relevant config change possibilities, yet.
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Diffstat (limited to 'protocols/luci-proto-unet')
-rw-r--r-- | protocols/luci-proto-unet/Makefile | 15 | ||||
-rw-r--r-- | protocols/luci-proto-unet/htdocs/luci-static/resources/protocol/unet.js | 48 |
2 files changed, 63 insertions, 0 deletions
diff --git a/protocols/luci-proto-unet/Makefile b/protocols/luci-proto-unet/Makefile new file mode 100644 index 0000000000..8cf94b309d --- /dev/null +++ b/protocols/luci-proto-unet/Makefile @@ -0,0 +1,15 @@ +# +# Copyright (C) 2022 Hannu Nyman <hannu.nyman@iki.fi> +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=Support for unetd VPN +LUCI_DEPENDS:=+unetd +unet-cli +LUCI_PKGARCH:=all + +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/protocols/luci-proto-unet/htdocs/luci-static/resources/protocol/unet.js b/protocols/luci-proto-unet/htdocs/luci-static/resources/protocol/unet.js new file mode 100644 index 0000000000..ea9d9c50e2 --- /dev/null +++ b/protocols/luci-proto-unet/htdocs/luci-static/resources/protocol/unet.js @@ -0,0 +1,48 @@ +'use strict'; +'require form'; +'require network'; +'require tools.widgets as widgets'; + +return network.registerProtocol('unet', { + getI18n: function() { + return _('Unet'); + }, + + getIfname: function() { + return this._ubus('l3_device') || this.sid; + }, + + getOpkgPackage: function() { + return 'unetd'; + }, + + isFloating: function() { + return true; + }, + + isVirtual: function() { + return true; + }, + + getDevices: function() { + return null; + }, + + containsDevice: function(ifname) { + return (network.getIfnameOf(ifname) == this.getIfname()); + }, + + renderFormOptions: function(s) { + var o; + + o = s.taboption('general', form.DummyValue, 'device', _('Name of the tunnel device')); + o.optional = false; + + o = s.taboption('general', form.DummyValue, 'key', _('Local wireguard key')); + o.optional = false; + + o = s.taboption('general', form.DummyValue, 'auth_key', _('Key used to sign network config')); + o.optional = false; + + } +}); |