Fix #1609: luci-proto-wireguard placeholder wrongfully suggests default port
[project/luci.git] / protocols / luci-proto-wireguard / luasrc / model / cbi / admin_network / proto_wireguard.lua
index 11ef10b..46a8f49 100644 (file)
@@ -31,7 +31,7 @@ listen_port = section:taboption(
   translate("Optional. UDP port used for outgoing and incoming packets.")
 )
 listen_port.datatype = "port"
-listen_port.placeholder = "51820"
+listen_port.placeholder = translate("random")
 listen_port.optional = true
 
 addresses = section:taboption(
@@ -52,7 +52,7 @@ metric = section:taboption(
   Value,
   "metric",
   translate("Metric"),
-  translate("Optional.")
+  translate("Optional")
 )
 metric.datatype = "uinteger"
 metric.placeholder = "0"
@@ -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",