wireguard: preshared-key is now an attribute of the peer 1160/head
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 9 May 2017 14:45:42 +0000 (16:45 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 9 May 2017 14:51:40 +0000 (16:51 +0200)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
applications/luci-app-wireguard/luasrc/view/wireguard.htm
protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua

index 5b5d59a9697d2d41ca989fa6a67e4504b586bb28..5af6232ae6f6c5e63538bf9946ef942bd77405cf 100644 (file)
         data[line[1]] = {
           name                 = line[1],
           public_key           = line[3],
-          listen_port          = line[5],
-          fwmark               = line[6],
+          listen_port          = line[4],
+          fwmark               = line[5],
           peers                = { }
         }
       else
         local peer = {
           public_key           = line[2],
-          endpoint             = line[3],
+          endpoint             = line[4],
           allowed_ips          = { },
-          latest_handshake     = line[5],
-          transfer_rx          = line[6],
-          transfer_tx          = line[7],
-          persistent_keepalive = line[8]
+          latest_handshake     = line[6],
+          transfer_rx          = line[7],
+          transfer_tx          = line[8],
+          persistent_keepalive = line[9]
         }
         if not (line[4] == '(none)') then
-          for ipkey, ipvalue in pairs(string.split(line[4], ",")) do
+          for ipkey, ipvalue in pairs(string.split(line[5], ",")) do
             if #ipvalue > 0 then
               table.insert(peer['allowed_ips'], ipvalue)
             end
index 11ef10b5a78b0157c66f709e4c51798681b807f4..bb7674b315be0f43226520c4ce10b27fd6a3c6cf 100644 (file)
@@ -70,21 +70,6 @@ mtu.datatype = "range(1280,1420)"
 mtu.placeholder = "1420"
 mtu.optional = true
 
-
-preshared_key = section:taboption(
-  "advanced",
-  Value,
-  "preshared_key",
-  translate("Preshared Key"),
-  translate("Optional. Base64-encoded preshared key. " ..
-            "Adds in an additional layer of symmetric-key " ..
-            "cryptography for post-quantum resistance.")
-)
-preshared_key.password = true
-preshared_key.datatype = "and(base64,rangelength(44,44))"
-preshared_key.optional = true
-
-
 fwmark = section:taboption(
   "advanced",
   Value,
@@ -121,6 +106,19 @@ public_key.datatype = "and(base64,rangelength(44,44))"
 public_key.optional = false
 
 
+preshared_key = peers:option(
+  Value,
+  "preshared_key",
+  translate("Preshared Key"),
+  translate("Optional. Base64-encoded preshared key. " ..
+            "Adds in an additional layer of symmetric-key " ..
+            "cryptography for post-quantum resistance.")
+)
+preshared_key.password = true
+preshared_key.datatype = "and(base64,rangelength(44,44))"
+preshared_key.optional = true
+
+
 allowed_ips = peers:option(
   DynamicList,
   "allowed_ips",