summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-wireguard
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-wireguard')
-rw-r--r--applications/luci-app-wireguard/Makefile2
-rw-r--r--applications/luci-app-wireguard/htdocs/luci-static/resources/view/wireguard/status.js2
-rw-r--r--applications/luci-app-wireguard/root/usr/libexec/rpcd/luci.wireguard (renamed from applications/luci-app-wireguard/root/usr/libexec/rpcd/luci.wireguard_status)8
-rw-r--r--applications/luci-app-wireguard/root/usr/share/rpcd/acl.d/luci-app-wireguard.json2
4 files changed, 11 insertions, 3 deletions
diff --git a/applications/luci-app-wireguard/Makefile b/applications/luci-app-wireguard/Makefile
index ee260a982a..fe6a2c66ef 100644
--- a/applications/luci-app-wireguard/Makefile
+++ b/applications/luci-app-wireguard/Makefile
@@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=WireGuard Status
-LUCI_DEPENDS:=+wireguard-tools +luci-proto-wireguard
+LUCI_DEPENDS:=+wireguard-tools
LUCI_PKGARCH:=all
include ../../luci.mk
diff --git a/applications/luci-app-wireguard/htdocs/luci-static/resources/view/wireguard/status.js b/applications/luci-app-wireguard/htdocs/luci-static/resources/view/wireguard/status.js
index ca4ca9fd17..8614db018e 100644
--- a/applications/luci-app-wireguard/htdocs/luci-static/resources/view/wireguard/status.js
+++ b/applications/luci-app-wireguard/htdocs/luci-static/resources/view/wireguard/status.js
@@ -6,7 +6,7 @@
var callGetWgInstances = rpc.declare({
- object: 'luci.wireguard_status',
+ object: 'luci.wireguard',
method: 'getWgInstances'
});
diff --git a/applications/luci-app-wireguard/root/usr/libexec/rpcd/luci.wireguard_status b/applications/luci-app-wireguard/root/usr/libexec/rpcd/luci.wireguard
index 892e74dbf1..7354ad4922 100644
--- a/applications/luci-app-wireguard/root/usr/libexec/rpcd/luci.wireguard_status
+++ b/applications/luci-app-wireguard/root/usr/libexec/rpcd/luci.wireguard
@@ -6,6 +6,14 @@ local io = require "io"
local uci = require "uci"
local methods = {
+ generateKeyPair = {
+ call = function()
+ local prv = sys.exec("wg genkey 2>/dev/null"):sub(1, -2)
+ local pub = sys.exec("echo '" .. prv .. "' | wg pubkey 2>/dev/null"):sub(1, -2)
+
+ return {keys = {priv = prv, pub = pub}}
+ end
+ },
getWgInstances = {
call = function()
local data = {}
diff --git a/applications/luci-app-wireguard/root/usr/share/rpcd/acl.d/luci-app-wireguard.json b/applications/luci-app-wireguard/root/usr/share/rpcd/acl.d/luci-app-wireguard.json
index f0938e5b00..cd38bcf8ec 100644
--- a/applications/luci-app-wireguard/root/usr/share/rpcd/acl.d/luci-app-wireguard.json
+++ b/applications/luci-app-wireguard/root/usr/share/rpcd/acl.d/luci-app-wireguard.json
@@ -3,7 +3,7 @@
"description": "Grant access to LuCI app wireguard",
"read": {
"ubus": {
- "luci.wireguard_status": [
+ "luci.wireguard": [
"getWgInstances"
]
}