From bb1320913ac670a06e4a86a0b02e6febfdc56310 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 29 Sep 2026 17:54:49 +0200 Subject: [PATCH] Added discovered interface auto-connect criteria constants --- RNS/Discovery.py | 3 +++ RNS/Reticulum.py | 9 +++++++++ docs/source/using.rst | 2 ++ 3 files changed, 14 insertions(+) diff --git a/RNS/Discovery.py b/RNS/Discovery.py index 9b17f613..6c00b1e4 100644 --- a/RNS/Discovery.py +++ b/RNS/Discovery.py @@ -483,6 +483,9 @@ class InterfaceDiscovery(): AUTOCONNECT_TYPES = ["BackboneInterface", "TCPServerInterface"] DISCOVERABLE_TYPES = ["BackboneInterface", "TCPServerInterface", "I2PInterface", "RNodeInterface", "WeaveInterface", "KISSInterface"] + AUTOCONNECT_IMPLS = ["RNS"] + AUTOCONNECT_MIN_V = "1.5.2" + AC_TRANSPORT_MODE = RNS.Interfaces.Interface.Interface.MODE_GATEWAY AC_GRAVITY = 0 diff --git a/RNS/Reticulum.py b/RNS/Reticulum.py index 172c4f1e..7b11a351 100755 --- a/RNS/Reticulum.py +++ b/RNS/Reticulum.py @@ -263,6 +263,7 @@ class Reticulum: Reticulum.__discovery_enabled = False Reticulum.__discover_interfaces = False Reticulum.__autoconnect_discovered_interfaces = False + Reticulum.__autoconnect_unverified = False Reticulum.__autoconnect_interface_mode = None Reticulum.__autoconnect_interface_gravity = None Reticulum.__autoconnect_announces_to_internal = None @@ -628,6 +629,10 @@ class Reticulum: v = self.config["reticulum"].as_int(option) if v > 0: Reticulum.__autoconnect_discovered_interfaces = v + if option == "autoconnect_unverified_implementations": + v = self.config["reticulum"].as_bool(option) + Reticulum.__autoconnect_unverified = v + if option == "autoconnect_interface_mode": v = None; dmode = str(self.config["reticulum"]["autoconnect_interface_mode"]).lower() if dmode == "full": v = Interface.Interface.MODE_FULL @@ -2142,6 +2147,10 @@ class Reticulum: def should_autoconnect_discovered_interfaces(): return Reticulum.__autoconnect_discovered_interfaces > 0 + @staticmethod + def should_autoconnect_unverified_implementations(): + return Reticulum.__autoconnect_unverified + @staticmethod def autoconnect_interface_mode(): return Reticulum.__autoconnect_interface_mode diff --git a/docs/source/using.rst b/docs/source/using.rst index 3abb4734..77c86c0d 100644 --- a/docs/source/using.rst +++ b/docs/source/using.rst @@ -1234,6 +1234,8 @@ For more fine-grained control over how discovered interfaces are auto-connected, * The ``autoconnect_announces_to_internal`` option allows you to specify that auto-connected interfaces should propagate announces to ``internal`` mode interfaces, even if the auto-connected interface's mode would normally not allow for this. +* The ``autoconnect_unverified_implementations`` option will allow the interface discovery system to auto-connect to *any* announced interface, even those coming from unverified, experimental or potentially broken implementations. Be very careful with this option. + Remote Management -----------------