Merge pull request #5193 from zhoreeq/luci_yggdrasil_update
authorJo-Philipp Wich <jo@mein.io>
Wed, 11 Aug 2021 17:09:58 +0000 (19:09 +0200)
committerGitHub <noreply@github.com>
Wed, 11 Aug 2021 17:09:58 +0000 (19:09 +0200)
applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/keys.js
applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/session_firewall.js [deleted file]
applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/settings.js
applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/status.js
applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/tunnel_routing.js [deleted file]
applications/luci-app-yggdrasil/root/usr/share/luci/menu.d/luci-app-yggdrasil.json

index 44acaa22d662d35a59514b59888b506a5286ddde..7e9bef46e4da7f3dc4c3f83a8b08e40dd8a02d14 100644 (file)
@@ -11,11 +11,8 @@ return view.extend({
                s = m.section(form.TypedSection, "yggdrasil", _("Encryption keys")); 
                s.anonymous = true;
 
-               s.option(form.Value, "EncryptionPublicKey", _("Encryption public key"));
-               s.option(form.Value, "EncryptionPrivateKey", _("Encryption private key"),
-                       _("Keep this private. When compromised, generate a new keypair and IPv6."));
-               s.option(form.Value, "SigningPublicKey", _("Signing public key"));
-               s.option(form.Value, "SigningPrivateKey", _("Signing private key"),
+               s.option(form.Value, "PublicKey", _("Encryption public key"));
+               s.option(form.Value, "PrivateKey", _("Encryption private key"),
                        _("Keep this private. When compromised, generate a new keypair and IPv6."));
 
                return m.render();
diff --git a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/session_firewall.js b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/session_firewall.js
deleted file mode 100644 (file)
index 45fe220..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-'require view';
-'require form';
-
-return view.extend({
-       render: function() {
-               var m, s, o;
-
-               m = new form.Map('yggdrasil', 'Yggdrasil');
-
-               s = m.section(form.TypedSection, "yggdrasil", _("Session firewall settings"));
-               s.anonymous = true;
-
-               s.option(form.Flag, "SessionFirewall_Enable", _("Enable session firewall"),
-                       _("If disabled, network traffic from any node will be allowed. If enabled, the below rules apply"));
-               s.option(form.Flag, "SessionFirewall_AllowFromDirect", _("Allow from direct"), 
-                       _("Allow network traffic from directly connected peers"));
-               s.option(form.Flag, "SessionFirewall_AllowFromRemote", _("Allow from remote"), 
-                       _("Allow network traffic from remote nodes on the network that you are not directly peered with"));
-               s.option(form.Flag, "SessionFirewall_AlwaysAllowOutbound", 
-                       _("Always allow outbound"), _("Allow outbound network traffic regardless of AllowFromDirect or AllowFromRemote"));
-
-               s = m.section(form.TableSection, "whitelisted_encryption_public_key", 
-                       _("Whitelisted public keys"),
-                       _("Network traffic is always accepted from those peers, regardless of AllowFromDirect or AllowFromRemote"));
-               s.option(form.Value, "key", _("Public key"));
-               s.anonymous = true;
-               s.addremove = true;
-
-               s = m.section(form.TableSection, "blacklisted_encryption_public_key", 
-                       _("Blacklisted public keys"), 
-                       _("Network traffic is always rejected from those peers, regardless of AllowFromDirect or AllowFromRemote"));
-               s.option(form.Value, "key", _("Public key"));
-               s.anonymous = true;
-               s.addremove = true;
-
-               return m.render();
-       }
-});
index 4278386f53af1a885dd74211284cd60c3992c211..8bc63dadc25d5c6121ad094cc60fae001009c997 100644 (file)
@@ -12,12 +12,6 @@ return view.extend({
                s.anonymous = true;
 
                s.option(form.Value, "IfName", _("Yggdrasil's network interface name"));
-               s.option(form.Value, "LinkLocalTCPPort", _("Link-local TCP port"),
-                       _("The port number to be used for the link-local TCP listeners for the "+
-                               "configured MulticastInterfaces. This option does not affect listeners" +
-                               "specified in the Listen option. Unless you plan to firewall link-local" +
-                               "traffic, it is best to leave this as the default value of 0. This " +
-                               "option cannot currently be changed by reloading config during runtime."));
 
                s.option(form.Flag, "NodeInfoPrivacy", _("Enable NodeInfo privacy"),
                  _("By default, nodeinfo contains some defaults including the platform," +
@@ -35,17 +29,6 @@ return view.extend({
                }
 
                s.option(form.Value, "IfMTU", _("MTU size for the interface"));
-               s.option(form.Value, "SwitchOptions_MaxTotalQueueSize", 
-                       _("Maximum size of all switch queues combined"));
-
-               o = m.section(form.TableSection, "multicast_interface", _("Multicast interfaces"),
-                       _("Regular expressions for which interfaces multicast peer discovery " +
-                               "should be enabled on. If none specified, multicast peer discovery is " +
-                               "disabled. The default value is .* which uses all interfaces."));
-               o.option(form.Value, "name", _("Interface name"), 
-                       _("Set .* to multicast on all interfaces"));
-               o.anonymous = true;
-               o.addremove = true;
 
                o = m.section(form.TableSection, "listen_address", _("Listen addresses"), 
                        _("Listen addresses for incoming connections. You will need to add " +
@@ -53,12 +36,23 @@ return view.extend({
                                "Multicast peer discovery will work regardless of any listeners set " +
                                "here. Each listener should be specified in URI format as above, e.g. " +
                                "tcp://0.0.0.0:0 or tcp://[::]:0 to listen on all interfaces."));
-                       _("Address to listen for incoming connections"), 
                o.option(form.Value, "uri",
                        _("e.g. tcp://0.0.0.0:0 or tcp://[::]:0"));
                o.anonymous = true;
                o.addremove = true;
 
+               o = m.section(form.TableSection, "multicast_interface", _("Multicast interface"), 
+                       _("Configuration for which interfaces multicast peer discovery should be enabled on. " + 
+                               "Regex is a regular expression which is matched against an interface name, and interfaces use the first configuration that they match gainst. " +
+                               "Beacon configures whether or not the node should send link-local multicast beacons to advertise their presence, while listening for incoming connections on Port. " +
+                               "Listen controls whether or not the node listens for multicast beacons and opens outgoing connections."));
+               o.option(form.Value, "regex", _("Regular expression"));
+               o.option(form.Flag, "beacon", _("Send beacons"));
+               o.option(form.Flag, "listen", _("Listen for beacons"));
+               o.option(form.Value, "port", _("Link-local port"));
+               o.anonymous = true;
+               o.addremove = true;
+
                return m.render();
        }
 });
index 35078a511b9936d50ce7656c1442851726b57ca9..d47ccb2f5de22f315da567fa8fd17071f2cd1143 100644 (file)
@@ -11,7 +11,7 @@ function init_view() {
                "IPv6 address": "self-address",
                "IPv6 subnet": "self-subnet",
                "Coords": "self-coords",
-               "Public key": "self-boxpubkey",
+               "Public key": "self-key",
                "Build name": "self-buildname",
                "Build version": "self-version"
        };
@@ -37,7 +37,7 @@ function init_view() {
        peerings.setAttribute("class", "table"); peerings.id = "yggdrasil-peerings";
        var tr = document.createElement("tr");
        tr.setAttribute("class", "tr table-titles");
-       ["Endpoint", "Address", "Proto", "Uptime", "Received", "Transmitted"].forEach(function(t) {
+       ["Endpoint", "Address", "Coords", "Key", "Port"].forEach(function(t) {
                var th = document.createElement("th"); th.setAttribute("class", "th nowrap left");
                th.innerText = t;
                tr.appendChild(th);
@@ -55,14 +55,15 @@ function update_active_peers() {
                        while (table.rows.length > 1) { table.deleteRow(1); }
                        Object.keys(peers).forEach(function(address) {
                                var row = table.insertRow(-1);
-                               row.insertCell(-1).textContent = peers[address].endpoint;
+                               row.style.fontSize = "xx-small";
+                               row.insertCell(-1).textContent = peers[address].remote;
                                row.insertCell(-1).textContent = address;
-                               row.insertCell(-1).textContent = peers[address].proto;
-                               row.insertCell(-1).textContent = '%t'.format(peers[address].uptime);
-                               row.insertCell(-1).textContent = '%1024.2mB'.format(peers[address].bytes_recvd);
-                               row.insertCell(-1).textContent = '%1024.2mB'.format(peers[address].bytes_sent);
+                               row.insertCell(-1).textContent = "[" + peers[address].coords.toString() + "]";
+                               row.insertCell(-1).textContent = peers[address].key;
+                               row.insertCell(-1).textContent = peers[address].port;
                        });
                }
+               setTimeout(update_active_peers, 5000);
        });
 }
 
@@ -85,23 +86,12 @@ return view.extend({
                        var r = obj[address];
                        view.querySelector('#self-address').innerText = address;
                        view.querySelector('#self-subnet').innerText = r.subnet;
-                       view.querySelector('#self-coords').innerText = r.coords;
-                       view.querySelector('#self-boxpubkey').innerText = r.box_pub_key;
+                       view.querySelector('#self-coords').innerText = "[" + r.coords + "]";
+                       view.querySelector('#self-key').innerText = r.key;
                        view.querySelector('#self-buildname').innerText = r.build_name;
                        view.querySelector('#self-version').innerText = r.build_version;
 
-                       var table = view.querySelector('#yggdrasil-peerings');
-                       Object.keys(peers).forEach(function(address) {
-                               var row = table.insertRow(-1);
-                               row.insertCell(-1).textContent = peers[address].endpoint;
-                               row.insertCell(-1).textContent = address;
-                               row.insertCell(-1).textContent = peers[address].proto;
-                               row.insertCell(-1).textContent = '%t'.format(peers[address].uptime);
-                               row.insertCell(-1).textContent = '%1024.2mB'.format(peers[address].bytes_recvd);
-                               row.insertCell(-1).textContent = '%1024.2mB'.format(peers[address].bytes_sent);
-
-                       });
-                       setInterval(update_active_peers, 5000);
+                       update_active_peers();
                } else {
                        view.innerHTML = "<h2>Yggdrasil is not running</h2>";
                }
diff --git a/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/tunnel_routing.js b/applications/luci-app-yggdrasil/htdocs/luci-static/resources/view/yggdrasil/tunnel_routing.js
deleted file mode 100644 (file)
index 0b4ac6e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-'use strict';
-'require view';
-'require form';
-
-return view.extend({
-       render: function() {
-               var m, s, o;
-
-               m = new form.Map('yggdrasil', 'Yggdrasil');
-
-               s = m.section(form.TypedSection, "yggdrasil", _("Tunnel Routing")); 
-               s.anonymous = true;
-               s.option(form.Flag, "TunnelRouting_Enable", "Enable tunnel routing",
-                       _("Allow tunneling non-Yggdrasil traffic over Yggdrasil. This effectively " +
-                               "allows you to use Yggdrasil to route to, or to bridge other networks, " +
-                               "similar to a VPN tunnel. Tunnelling works between any two nodes and " +
-                               "does not require them to be directly peered."));
-
-               o = m.section(form.TableSection, "ipv4_remote_subnet", _("IPv4 remote subnet"),
-                       _("IPv4 subnets belonging to remote nodes, mapped to the node's public"));
-               o.option(form.Value, "key", _("Key"), _("Public encryption key"));
-               o.option(form.Value, "subnet", _("Subnet"), _("IPv4 subnet"));
-               o.anonymous = true;
-               o.addremove = true;
-
-               o = m.section(form.TableSection, "ipv4_local_subnet", _("IPv4 local subnet"),
-                       _("IPv4 subnets belonging to this node's end of the tunnels. Only traffic "  +
-                               "from these ranges will be tunnelled."));
-               o.option(form.Value, "subnet", _("Subnet"), _("IPv4 subnet"));
-               o.anonymous = true;
-               o.addremove = true;
-
-               o = m.section(form.TableSection, "ipv6_remote_subnet", _("IPv6 remote subnet"),
-                       _("IPv6 subnets belonging to remote nodes, mapped to the node's public"));
-               o.option(form.Value, "key", _("Key"), _("Public encryption key"));
-               o.option(form.Value, "subnet", _("Subnet"), _("IPv6 subnet"));
-               o.anonymous = true;
-               o.addremove = true;
-
-               o = m.section(form.TableSection, "ipv6_local_subnet", _("IPv6 local subnet"),
-                       _("IPv6 subnets belonging to this node's end of the tunnels. Only traffic " +
-                               "from these ranges (or the Yggdrasil node's IPv6 address/subnet) " +
-                               "will be tunnelled."));
-               o.option(form.Value, "subnet", _("Subnet"), _("IPv6 subnet"));
-               o.anonymous = true;
-               o.addremove = true;
-
-               return m.render();
-       }
-});
index 2947461e58f80245055d573313b978782e0f987b..da4e4acef9ea608dc01050d6e79d99141e6a9ef1 100644 (file)
                        "type": "view",
                        "path": "yggdrasil/keys"
                }
-       },
-
-       "admin/network/yggdrasil/session_firewall": {
-               "title": "Session firewall",
-               "order": 5,
-               "action": {
-                       "type": "view",
-                       "path": "yggdrasil/session_firewall"
-               }
-       },
-
-       "admin/network/yggdrasil/tunnel_routing": {
-               "title": "Tunnel routing",
-               "order": 6,
-               "action": {
-                       "type": "view",
-                       "path": "yggdrasil/tunnel_routing"
-               }
        }
 }