Skip to content

Commit d4aabc8

Browse files
committed
Added I2P base32 address output to rnstatus utility
1 parent d487609 commit d4aabc8

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

RNS/Interfaces/I2PInterface.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def server_tunnel(self, owner):
129129
i2p_dest = self.i2plib.Destination(data=prvd, has_private_key=True)
130130

131131
i2p_b32 = i2p_dest.base32
132+
owner.b32 = i2p_b32
132133

133134
self.server_tunnels[i2p_b32] = False
134135

@@ -509,8 +510,9 @@ def __init__(self, owner, name, rns_storagepath, peers, connectable = True):
509510
self.connectable = connectable
510511
self.i2p_tunneled = True
511512

513+
self.b32 = None
512514
self.i2p = I2PController(rns_storagepath)
513-
515+
514516
self.IN = True
515517
self.OUT = False
516518
self.name = name

RNS/Reticulum.py

+6
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,12 @@ def get_interface_stats(self):
669669
else:
670670
ifstats["clients"] = None
671671

672+
if hasattr(interface, "b32"):
673+
if interface.b32 != None:
674+
ifstats["i2p_b32"] = interface.b32+".b32.i2p"
675+
else:
676+
ifstats["i2p_b32"] = None
677+
672678
ifstats["name"] = str(interface)
673679
ifstats["rxb"] = interface.rxb
674680
ifstats["txb"] = interface.txb

RNS/Utilities/rnsd.py

+1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ def main():
216216
[[I2P]]
217217
type = I2PInterface
218218
interface_enabled = yes
219+
connectable = yes
219220
peers = 5urvjicpzi7q3ybztsef4i5ow2aq4soktfj7zedz53s47r54jnqq.b32.i2p
220221
221222

RNS/Utilities/rnstatus.py

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def program_setup(configdir, dispall=False, verbosity = 0):
5151

5252
print(" {n}".format(n=ifstat["name"]))
5353
print("\tStatus: {ss}".format(ss=ss))
54+
55+
if "i2p_b32" in ifstat:
56+
print("\tI2P B32: {ep}".format(ep=str(ifstat["i2p_b32"])))
57+
5458
if clients != None:
5559
print("\t"+clients_string)
5660
print("\tRX: {rxb}\n\tTX: {txb}".format(rxb=size_str(ifstat["rxb"]), txb=size_str(ifstat["txb"])))

0 commit comments

Comments
 (0)