diff options
Diffstat (limited to 'applications/luci-app-wireguard/root/usr')
-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.json | 2 |
2 files changed, 9 insertions, 1 deletions
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" ] } |