From d4aabc8b89547cceea1b08352e7aaa12c5f73c15 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 26 Feb 2022 21:04:54 +0100 Subject: [PATCH] Added I2P base32 address output to rnstatus utility --- RNS/Interfaces/I2PInterface.py | 4 +++- RNS/Reticulum.py | 6 ++++++ RNS/Utilities/rnsd.py | 1 + RNS/Utilities/rnstatus.py | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/RNS/Interfaces/I2PInterface.py b/RNS/Interfaces/I2PInterface.py index 8c21a87..e1fdf37 100644 --- a/RNS/Interfaces/I2PInterface.py +++ b/RNS/Interfaces/I2PInterface.py @@ -129,6 +129,7 @@ class I2PController: i2p_dest = self.i2plib.Destination(data=prvd, has_private_key=True) i2p_b32 = i2p_dest.base32 + owner.b32 = i2p_b32 self.server_tunnels[i2p_b32] = False @@ -509,8 +510,9 @@ class I2PInterface(Interface): self.connectable = connectable self.i2p_tunneled = True + self.b32 = None self.i2p = I2PController(rns_storagepath) - + self.IN = True self.OUT = False self.name = name diff --git a/RNS/Reticulum.py b/RNS/Reticulum.py index 0a8d42d..712e674 100755 --- a/RNS/Reticulum.py +++ b/RNS/Reticulum.py @@ -669,6 +669,12 @@ class Reticulum: else: ifstats["clients"] = None + if hasattr(interface, "b32"): + if interface.b32 != None: + ifstats["i2p_b32"] = interface.b32+".b32.i2p" + else: + ifstats["i2p_b32"] = None + ifstats["name"] = str(interface) ifstats["rxb"] = interface.rxb ifstats["txb"] = interface.txb diff --git a/RNS/Utilities/rnsd.py b/RNS/Utilities/rnsd.py index 5ee03ee..fb1e110 100755 --- a/RNS/Utilities/rnsd.py +++ b/RNS/Utilities/rnsd.py @@ -216,6 +216,7 @@ loglevel = 4 [[I2P]] type = I2PInterface interface_enabled = yes + connectable = yes peers = 5urvjicpzi7q3ybztsef4i5ow2aq4soktfj7zedz53s47r54jnqq.b32.i2p diff --git a/RNS/Utilities/rnstatus.py b/RNS/Utilities/rnstatus.py index a24ed3e..7715ad9 100644 --- a/RNS/Utilities/rnstatus.py +++ b/RNS/Utilities/rnstatus.py @@ -51,6 +51,10 @@ def program_setup(configdir, dispall=False, verbosity = 0): print(" {n}".format(n=ifstat["name"])) print("\tStatus: {ss}".format(ss=ss)) + + if "i2p_b32" in ifstat: + print("\tI2P B32: {ep}".format(ep=str(ifstat["i2p_b32"]))) + if clients != None: print("\t"+clients_string) print("\tRX: {rxb}\n\tTX: {txb}".format(rxb=size_str(ifstat["rxb"]), txb=size_str(ifstat["txb"])))