luci-proto-wireguard: fix broken DNS option in peer config generator
authorJo-Philipp Wich <jo@mein.io>
Fri, 16 Feb 2024 15:17:26 +0000 (16:17 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 16 Feb 2024 15:17:26 +0000 (16:17 +0100)
The config generation code was referencing a not existing `dns_servers`
input field.

Fixes: #6921
Fixes: 5b26887c52 ("Adding a DNS option to the wireguard peer config ...")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js

index d05acfbe79cbdae5842062d72f0da85f8a2e21f3..9919687b929b536d2cfdcb88d230e948860e764c 100644 (file)
@@ -794,10 +794,14 @@ return network.registerProtocol('wireguard', {
                                ips.forEach(function(ip) { qro.value(ip) });
                                qro.onchange = handleConfigChange;
 
+                               qro = qrs.option(form.DynamicList, 'dns_servers', _('DNS Servers'), _('DNS servers for the remote clients using this tunnel to your openwrt device. Some wireguard clients require this to be set.'));
+                               qro.datatype = 'ipaddr';
+                               qro.default = dns;
+                               qro.onchange = handleConfigChange;
+
                                qro = qrs.option(form.DynamicList, 'addresses', _('Addresses'), _('IP addresses for the peer to use inside the tunnel. Some clients require this setting.'));
                                qro.datatype = 'ipaddr';
                                qro.default = eips;
-                               qro.default = dns;
                                eips.forEach(function(eip) { qro.value(eip) });
                                qro.onchange = handleConfigChange;