mirror of
https://github.com/markqvist/NomadNet.git
synced 2026-11-20 06:56:21 -05:00
Compare commits
No commits in common. "master" and "1.4.4" have entirely different histories.
7 changed files with 5 additions and 73 deletions
|
|
@ -21,8 +21,6 @@ class Node:
|
||||||
self.app = app
|
self.app = app
|
||||||
self.identity = self.app.identity
|
self.identity = self.app.identity
|
||||||
self.destination = RNS.Destination(self.identity, RNS.Destination.IN, RNS.Destination.SINGLE, "nomadnetwork", "node")
|
self.destination = RNS.Destination(self.identity, RNS.Destination.IN, RNS.Destination.SINGLE, "nomadnetwork", "node")
|
||||||
self.destination.set_link_cost(self.app.node_link_cost)
|
|
||||||
if self.app.node_stamp_value: self.destination.set_value(self.app.node_stamp_value)
|
|
||||||
self.last_announce = time.time()
|
self.last_announce = time.time()
|
||||||
self.last_file_refresh = time.time()
|
self.last_file_refresh = time.time()
|
||||||
self.last_page_refresh = time.time()
|
self.last_page_refresh = time.time()
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,6 @@ class NomadNetworkApp:
|
||||||
|
|
||||||
START_ANNOUNCE_DELAY = 3
|
START_ANNOUNCE_DELAY = 3
|
||||||
|
|
||||||
REQUIRED_DESTINATION_TYPES = ["nomadnetwork.node", "rrc.hub"]
|
|
||||||
DEFAULT_LINK_COST = 17.8
|
|
||||||
|
|
||||||
def exit_handler(self):
|
def exit_handler(self):
|
||||||
self.should_run_jobs = False
|
self.should_run_jobs = False
|
||||||
|
|
||||||
|
|
@ -106,9 +103,6 @@ class NomadNetworkApp:
|
||||||
NomadNetworkApp._shared_instance = self
|
NomadNetworkApp._shared_instance = self
|
||||||
|
|
||||||
self.rns = RNS.Reticulum(configdir = rnsconfigdir)
|
self.rns = RNS.Reticulum(configdir = rnsconfigdir)
|
||||||
# self.rns.required_announces_only(True)
|
|
||||||
for full_name in self.REQUIRED_DESTINATION_TYPES:
|
|
||||||
self.rns.wants_destination_type(full_name)
|
|
||||||
|
|
||||||
self.configpath = self.configdir+"/config"
|
self.configpath = self.configdir+"/config"
|
||||||
self.ignoredpath = self.configdir+"/ignored"
|
self.ignoredpath = self.configdir+"/ignored"
|
||||||
|
|
@ -150,13 +144,10 @@ class NomadNetworkApp:
|
||||||
self.notify_on_new_message = True
|
self.notify_on_new_message = True
|
||||||
self.compose_markdown = True
|
self.compose_markdown = True
|
||||||
|
|
||||||
self.lxmf_stamp_value = None
|
|
||||||
self.lxmf_max_propagation_size = None
|
self.lxmf_max_propagation_size = None
|
||||||
self.lxmf_max_sync_size = None
|
self.lxmf_max_sync_size = None
|
||||||
self.lxmf_max_incoming_size = None
|
self.lxmf_max_incoming_size = None
|
||||||
self.node_propagation_cost = LXMF.LXMRouter.PROPAGATION_COST
|
self.node_propagation_cost = LXMF.LXMRouter.PROPAGATION_COST
|
||||||
self.node_link_cost = self.DEFAULT_LINK_COST
|
|
||||||
self.node_stamp_value = None
|
|
||||||
|
|
||||||
self.periodic_lxmf_sync = True
|
self.periodic_lxmf_sync = True
|
||||||
self.lxmf_sync_interval = 360*60
|
self.lxmf_sync_interval = 360*60
|
||||||
|
|
@ -390,7 +381,7 @@ class NomadNetworkApp:
|
||||||
for destination_hash in self.ignored_list:
|
for destination_hash in self.ignored_list:
|
||||||
self.message_router.ignore_destination(destination_hash)
|
self.message_router.ignore_destination(destination_hash)
|
||||||
|
|
||||||
self.lxmf_destination = self.message_router.register_delivery_identity(self.identity, display_name=self.peer_settings["display_name"], stamp_cost=self.required_stamp_cost, stamp_value=self.lxmf_stamp_value)
|
self.lxmf_destination = self.message_router.register_delivery_identity(self.identity, display_name=self.peer_settings["display_name"], stamp_cost=self.required_stamp_cost)
|
||||||
if not self.accept_invalid_stamps:
|
if not self.accept_invalid_stamps:
|
||||||
self.message_router.enforce_stamps()
|
self.message_router.enforce_stamps()
|
||||||
|
|
||||||
|
|
@ -871,11 +862,6 @@ class NomadNetworkApp:
|
||||||
value = self.config["client"].as_bool(option)
|
value = self.config["client"].as_bool(option)
|
||||||
self.enable_client = value
|
self.enable_client = value
|
||||||
|
|
||||||
if option == "stamp_value":
|
|
||||||
value = self.config["client"].as_float("stamp_value")
|
|
||||||
if value < 1: value = 1
|
|
||||||
self.lxmf_stamp_value = RNS.Stamps.quantize_cost(value)
|
|
||||||
|
|
||||||
if option == "downloads_path":
|
if option == "downloads_path":
|
||||||
value = self.config["client"]["downloads_path"]
|
value = self.config["client"]["downloads_path"]
|
||||||
self.downloads_path = os.path.expanduser(value)
|
self.downloads_path = os.path.expanduser(value)
|
||||||
|
|
@ -1154,16 +1140,6 @@ class NomadNetworkApp:
|
||||||
else:
|
else:
|
||||||
self.node_name = self.config["node"]["node_name"]
|
self.node_name = self.config["node"]["node_name"]
|
||||||
|
|
||||||
if "link_cost" in self.config["node"]:
|
|
||||||
value = self.config["node"].as_float("link_cost")
|
|
||||||
if value < 1: value = 1
|
|
||||||
self.node_link_cost = RNS.Stamps.quantize_cost(value)
|
|
||||||
|
|
||||||
if "stamp_value" in self.config["node"]:
|
|
||||||
value = self.config["node"].as_float("stamp_value")
|
|
||||||
if value < 1: value = 1
|
|
||||||
self.node_stamp_value = RNS.Stamps.quantize_cost(value)
|
|
||||||
|
|
||||||
if not "disable_propagation" in self.config["node"]:
|
if not "disable_propagation" in self.config["node"]:
|
||||||
self.disable_propagation = True
|
self.disable_propagation = True
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -223,9 +223,6 @@ class RRCHub:
|
||||||
self.dest_name = dest_name or DEFAULT_DEST_NAME
|
self.dest_name = dest_name or DEFAULT_DEST_NAME
|
||||||
self.name = name or RNS.prettyhexrep(hub_hash)
|
self.name = name or RNS.prettyhexrep(hub_hash)
|
||||||
|
|
||||||
if not self.dest_name == DEFAULT_DEST_NAME:
|
|
||||||
RNS.Reticulum.get_instance().wants_destination_type(self.dest_name)
|
|
||||||
|
|
||||||
self.link = None
|
self.link = None
|
||||||
self.status = RRCHub.STATUS_DISCONNECTED
|
self.status = RRCHub.STATUS_DISCONNECTED
|
||||||
self.status_text = "Disconnected"
|
self.status_text = "Disconnected"
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "1.5.1"
|
__version__ = "1.4.4"
|
||||||
|
|
|
||||||
|
|
@ -1018,12 +1018,6 @@ The number of minutes between each automatic sync. The default is equal to 6 hou
|
||||||
On low-bandwidth networks, it can be useful to limit the amount of messages downloaded in each sync. The default is 8. Set to 0 to download all available messages every time a sync occurs.
|
On low-bandwidth networks, it can be useful to limit the amount of messages downloaded in each sync. The default is 8. Set to 0 to download all available messages every time a sync occurs.
|
||||||
<
|
<
|
||||||
|
|
||||||
>>>
|
|
||||||
`!stamp_value = 25.0`!
|
|
||||||
>>>>
|
|
||||||
The target stamp value for your LXMF destination can be configured with this option. Defaults to 25.0. Each increase of 1.0 doubles the generation difficulty. Destination stamps are one-time generations, so it can be worth targeting a high value here, to ensure that other transport nodes will accept your announces. The default should be sufficient for most cases, though.
|
|
||||||
<
|
|
||||||
|
|
||||||
>>>
|
>>>
|
||||||
`!required_stamp_cost = None`!
|
`!required_stamp_cost = None`!
|
||||||
>>>>
|
>>>>
|
||||||
|
|
@ -1221,18 +1215,6 @@ Determines whether the node server should be started on launch. Must be a boolea
|
||||||
Defines what the announced name of the node should be.
|
Defines what the announced name of the node should be.
|
||||||
<
|
<
|
||||||
|
|
||||||
>>>
|
|
||||||
`!stamp_value = 25.0`!
|
|
||||||
>>>>
|
|
||||||
The target stamp value for your node destination can be configured with this option. Defaults to 25.0. Each increase of 1.0 doubles the generation difficulty. Destination stamps are one-time generations, so it can be worth targeting a high value here, to ensure that other transport nodes will accept your announces. The default should be sufficient for most cases, though.
|
|
||||||
<
|
|
||||||
|
|
||||||
>>>
|
|
||||||
`!link_cost = 17.8`!
|
|
||||||
>>>>
|
|
||||||
The link stamp cost required for other peers to connect to your node. The default is a relatively high value, that should deter most automated scraping and misuse, but you can set it even higher, if you wish, or lower it to allow connecting more easily.
|
|
||||||
<
|
|
||||||
|
|
||||||
>>>
|
>>>
|
||||||
`!announce_at_start = yes`!
|
`!announce_at_start = yes`!
|
||||||
>>>>
|
>>>>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ from nomadnet.Directory import DirectoryEntry
|
||||||
from nomadnet.vendor.additional_urwid_widgets import IndicativeListBox, MODIFIER_KEY
|
from nomadnet.vendor.additional_urwid_widgets import IndicativeListBox, MODIFIER_KEY
|
||||||
from nomadnet.util import strip_modifiers
|
from nomadnet.util import strip_modifiers
|
||||||
from nomadnet.util import sanitize_name
|
from nomadnet.util import sanitize_name
|
||||||
from LXMF import pn_stamp_cost_from_app_data
|
|
||||||
|
|
||||||
from .Browser import Browser
|
from .Browser import Browser
|
||||||
from .ReadlineEdit import ReadlineEdit
|
from .ReadlineEdit import ReadlineEdit
|
||||||
|
|
@ -242,25 +241,13 @@ class AnnounceInfo(urwid.WidgetWrap):
|
||||||
type_button,
|
type_button,
|
||||||
])
|
])
|
||||||
|
|
||||||
dst_value = RNS.Identity.recall_stamp_value(source_hash)
|
pile_widgets = []
|
||||||
link_cost = RNS.Identity.recall_link_cost(source_hash)
|
|
||||||
dst_val_str = f"{RNS.prettycost(dst_value)}" if dst_value else "None"
|
|
||||||
link_cost_str = f"{RNS.prettycost(link_cost)}" if link_cost else "None"
|
|
||||||
|
|
||||||
pile_widgets = []
|
|
||||||
|
|
||||||
if is_pn:
|
if is_pn:
|
||||||
pn_app_data = RNS.Identity.recall_app_data(source_hash)
|
|
||||||
prop_cost = pn_stamp_cost_from_app_data(pn_app_data)
|
|
||||||
|
|
||||||
prop_cost_str = f"{RNS.prettycost(prop_cost)}" if prop_cost else "None"
|
|
||||||
pile_widgets = [
|
pile_widgets = [
|
||||||
urwid.Text("Time : "+ts_string, align=urwid.LEFT),
|
urwid.Text("Time : "+ts_string, align=urwid.LEFT),
|
||||||
urwid.Text("Addr : "+addr_str, align=urwid.LEFT),
|
urwid.Text("Addr : "+addr_str, align=urwid.LEFT),
|
||||||
urwid.Text("Type : "+type_string, align=urwid.LEFT),
|
urwid.Text("Type : "+type_string, align=urwid.LEFT),
|
||||||
urwid.Text("D.Val : "+dst_val_str, align=urwid.LEFT),
|
|
||||||
urwid.Text("L.Cst : "+link_cost_str, align=urwid.LEFT),
|
|
||||||
urwid.Text("P.Cst : "+prop_cost_str, align=urwid.LEFT),
|
|
||||||
urwid.Divider(g["divider1"]),
|
urwid.Divider(g["divider1"]),
|
||||||
button_columns
|
button_columns
|
||||||
]
|
]
|
||||||
|
|
@ -271,8 +258,6 @@ class AnnounceInfo(urwid.WidgetWrap):
|
||||||
urwid.Text("Addr : "+addr_str, align=urwid.LEFT),
|
urwid.Text("Addr : "+addr_str, align=urwid.LEFT),
|
||||||
urwid.Text("Type : "+type_string, align=urwid.LEFT),
|
urwid.Text("Type : "+type_string, align=urwid.LEFT),
|
||||||
urwid.Text("Name : "+display_str, align=urwid.LEFT),
|
urwid.Text("Name : "+display_str, align=urwid.LEFT),
|
||||||
urwid.Text("D.Val : "+dst_val_str, align=urwid.LEFT),
|
|
||||||
urwid.Text("L.Cst : "+link_cost_str, align=urwid.LEFT),
|
|
||||||
urwid.Text(["Trust : ", (style, trust_str)], align=urwid.LEFT),
|
urwid.Text(["Trust : ", (style, trust_str)], align=urwid.LEFT),
|
||||||
urwid.Divider(g["divider1"]),
|
urwid.Divider(g["divider1"]),
|
||||||
urwid.Text(["Announce Data: \n", (data_style, data_str)], align=urwid.LEFT),
|
urwid.Text(["Announce Data: \n", (data_style, data_str)], align=urwid.LEFT),
|
||||||
|
|
@ -641,8 +626,6 @@ class KnownNodeInfo(urwid.WidgetWrap):
|
||||||
|
|
||||||
source_hash = node_hash
|
source_hash = node_hash
|
||||||
node_ident = RNS.Identity.recall(node_hash)
|
node_ident = RNS.Identity.recall(node_hash)
|
||||||
dst_value = RNS.Identity.recall_stamp_value(node_hash)
|
|
||||||
link_cost = RNS.Identity.recall_link_cost(node_hash)
|
|
||||||
time_format = self.app.time_format
|
time_format = self.app.time_format
|
||||||
trust_level = self.app.directory.trust_level(source_hash)
|
trust_level = self.app.directory.trust_level(source_hash)
|
||||||
trust_str = ""
|
trust_str = ""
|
||||||
|
|
@ -658,9 +641,7 @@ class KnownNodeInfo(urwid.WidgetWrap):
|
||||||
else:
|
else:
|
||||||
display_str = strip_modifiers(node_entry.display_name)
|
display_str = strip_modifiers(node_entry.display_name)
|
||||||
|
|
||||||
addr_str = "<"+RNS.hexrep(source_hash, delimit=False)+">"
|
addr_str = "<"+RNS.hexrep(source_hash, delimit=False)+">"
|
||||||
dst_val_str = f"{RNS.prettycost(dst_value)}" if dst_value else "None"
|
|
||||||
link_cost_str = f"{RNS.prettycost(link_cost)}" if link_cost else "None"
|
|
||||||
|
|
||||||
if display_str == None:
|
if display_str == None:
|
||||||
display_str = addr_str
|
display_str = addr_str
|
||||||
|
|
@ -810,8 +791,6 @@ class KnownNodeInfo(urwid.WidgetWrap):
|
||||||
urwid.Text("Type : "+type_string, align=urwid.LEFT),
|
urwid.Text("Type : "+type_string, align=urwid.LEFT),
|
||||||
e_name,
|
e_name,
|
||||||
urwid.Text("Node Addr : "+addr_str, align=urwid.LEFT),
|
urwid.Text("Node Addr : "+addr_str, align=urwid.LEFT),
|
||||||
urwid.Text("Dst Value : "+dst_val_str, align=urwid.LEFT),
|
|
||||||
urwid.Text("Link Cost : "+link_cost_str, align=urwid.LEFT),
|
|
||||||
e_sort,
|
e_sort,
|
||||||
urwid.Divider(g["divider1"]),
|
urwid.Divider(g["divider1"]),
|
||||||
urwid.Text(lxmf_addr_str, align=urwid.CENTER),
|
urwid.Text(lxmf_addr_str, align=urwid.CENTER),
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -36,6 +36,6 @@ setuptools.setup(
|
||||||
entry_points= {
|
entry_points= {
|
||||||
'console_scripts': ['nomadnet=nomadnet.nomadnet:main']
|
'console_scripts': ['nomadnet=nomadnet.nomadnet:main']
|
||||||
},
|
},
|
||||||
install_requires=["rns>=1.6.1", "lxmf>=1.3.1", "urwid>=3.0.5", "qrcode"],
|
install_requires=["rns>=1.5.5", "lxmf>=1.2.0", "urwid>=3.0.5", "qrcode"],
|
||||||
python_requires=">=3.8",
|
python_requires=">=3.8",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue