mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-12-17 14:54:26 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10501f6712 | ||
|
|
094a604dd6 | ||
|
|
583b4307fc | ||
|
|
6ff01c3e67 | ||
|
|
c999014876 | ||
|
|
4757550626 | ||
|
|
4fa3dbbcd5 | ||
|
|
4da00e57f3 | ||
|
|
4a935cb500 | ||
|
|
7cf6f74d0c | ||
|
|
04c91de485 | ||
|
|
07f6bb8367 | ||
|
|
47d3581b5f | ||
|
|
ebfa6484a2 | ||
|
|
6df7feffe6 | ||
|
|
4b76387f2c | ||
|
|
69c498432d | ||
|
|
30eaadead2 | ||
|
|
fe108a45fa | ||
|
|
ea9460cb8f | ||
|
|
7923cae62d |
13
README.md
13
README.md
@@ -11,6 +11,8 @@ Nomad Network is build on [LXMF](https://github.com/markqvist/LXMF) and [Reticul
|
||||
|
||||
Nomad Network does not need any connections to the public internet to work. In fact, it doesn't even need an IP or Ethernet network. You can use it entirely over packet radio, LoRa or even serial lines. But if you wish, you can bridge islanded networks over the Internet or private ethernet networks, or you can build networks running completely over the Internet. The choice is yours.
|
||||
|
||||
If you'd rather want to use an LXMF client with a graphical user interface, you may want to take a look at [Sideband](https://github.com/markqvist/sideband), which is available for Linux, Android and macOS.
|
||||
|
||||
## Notable Features
|
||||
- Encrypted messaging over packet-radio, LoRa, WiFi or anything else [Reticulum](https://github.com/markqvist/Reticulum) supports.
|
||||
- Zero-configuration, minimal-infrastructure mesh communication
|
||||
@@ -46,13 +48,18 @@ nomadnet --daemon
|
||||
nomadnet --help
|
||||
```
|
||||
|
||||
The first time the program is running, you will be presented with the guide section, which contains all the information you need to start using Nomad Network.
|
||||
**Please Note**: If this is the very first time you use pip to install a program on your system, you might need to reboot your system for the program to become available. If you get a "command not found" error or similar when running the program, reboot your system and try again.
|
||||
|
||||
The first time the program is running, you will be presented with the **Guide section**, which contains all the information you need to start using Nomad Network.
|
||||
|
||||
To use Nomad Network on packet radio or LoRa, you will need to configure your Reticulum installation to use any relevant packet radio TNCs or LoRa devices on your system. See the [Reticulum documentation](https://markqvist.github.io/Reticulum/manual/interfaces.html) for info. For a general introduction on how to set up such a system, take a look at [this post](https://unsigned.io/private-messaging-over-lora/).
|
||||
|
||||
If you want to try Nomad Network without building your own physical network, you can connect to the [Unsigned.io RNS Testnet](https://github.com/markqvist/Reticulum#public-testnet) over the Internet, where there is already some Nomad Network and LXMF activity.
|
||||
If you want to try Nomad Network without building your own physical network, you can connect to the [Unsigned.io RNS Testnet](https://github.com/markqvist/Reticulum#public-testnet) over the Internet, where there is already some Nomad Network and LXMF activity. If you connect to the testnet, you can leave nomadnet running for a while and wait for it to receive announces from other nodes on the network that host pages or services, or you can try connecting directly to some nodes listed here:
|
||||
|
||||
**Please Note**: If this is the very first time you use pip to install a program on your system, you might need to reboot your system for the program to become available. If you get a "command not found" error or similar when running the program, reboot your system and try again.
|
||||
- `464ddc8cd323648ef919a638923b4916` Dublin Hub Testnet Node
|
||||
- `5cda089fc42675bdd904c6d06db87d49` Frankfurt Hub Testnet Node
|
||||
|
||||
To browse pages on a node that is not currently known, open the URL dialog in the `Network` section of the program by pressing `Ctrl+U`, paste or enter the address and select `Go` or press enter. Nomadnet will attempt to discover and connect to the requested node.
|
||||
|
||||
### Install on Android
|
||||
You can install Nomad Network on Android using Termux, but there's a few more commands involved than the above one-liner. The process is documented in the [Android Installation](https://markqvist.github.io/Reticulum/manual/gettingstartedfast.html#reticulum-on-android) section of the Reticulum Manual. Once the Reticulum has been installed according to the linked documentation, Nomad Network can be installed as usual with pip.
|
||||
|
||||
@@ -142,6 +142,9 @@ class Conversation:
|
||||
|
||||
self.__changed_callback = None
|
||||
|
||||
if not RNS.Transport.has_path(bytes.fromhex(source_hash)):
|
||||
RNS.Transport.request_path(bytes.fromhex(source_hash))
|
||||
|
||||
self.source_identity = RNS.Identity.recall(bytes.fromhex(self.source_hash))
|
||||
|
||||
if self.source_identity:
|
||||
|
||||
@@ -47,6 +47,7 @@ class Directory:
|
||||
file = open(self.app.directorypath, "wb")
|
||||
file.write(msgpack.packb(directory))
|
||||
file.close()
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Could not write directory to disk. Then contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||
|
||||
@@ -179,6 +180,8 @@ class Directory:
|
||||
node_entry = self.directory_entries[associated_node]
|
||||
node_entry.trust_level = entry.trust_level
|
||||
|
||||
self.save_to_disk()
|
||||
|
||||
def forget(self, source_hash):
|
||||
if source_hash in self.directory_entries:
|
||||
self.directory_entries.pop(source_hash)
|
||||
|
||||
@@ -25,12 +25,17 @@ class NomadNetworkApp:
|
||||
time_format = "%Y-%m-%d %H:%M:%S"
|
||||
_shared_instance = None
|
||||
|
||||
configdir = os.path.expanduser("~")+"/.nomadnetwork"
|
||||
userdir = os.path.expanduser("~")
|
||||
if os.path.isdir("/etc/nomadnetwork") and os.path.isfile("/etc/nomadnetwork/config"):
|
||||
configdir = "/etc/nomadnetwork"
|
||||
elif os.path.isdir(userdir+"/.config/nomadnetwork") and os.path.isfile(userdir+"/.config/nomadnetwork/config"):
|
||||
configdir = userdir+"/.config/nomadnetwork"
|
||||
else:
|
||||
configdir = userdir+"/.nomadnetwork"
|
||||
|
||||
START_ANNOUNCE_DELAY = 3
|
||||
|
||||
def exit_handler(self):
|
||||
RNS.log("Nomad Network Client exit handler executing...", RNS.LOG_VERBOSE)
|
||||
self.should_run_jobs = False
|
||||
|
||||
RNS.log("Saving directory...", RNS.LOG_VERBOSE)
|
||||
@@ -44,6 +49,14 @@ class NomadNetworkApp:
|
||||
except Exception as e:
|
||||
RNS.log("Could not restore flow control sequences. The contained exception was: "+str(e), RNS.LOG_WARNING)
|
||||
|
||||
if hasattr(self.ui, "restore_palette"):
|
||||
if self.ui.restore_palette:
|
||||
try:
|
||||
self.ui.screen.write("\x1b]104\x07")
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Could not restore terminal color palette. The contained exception was: "+str(e), RNS.LOG_WARNING)
|
||||
|
||||
RNS.log("Nomad Network Client exiting now", RNS.LOG_VERBOSE)
|
||||
|
||||
def exception_handler(self, e_type, e_value, e_traceback):
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.2.1"
|
||||
__version__ = "0.2.4"
|
||||
|
||||
@@ -207,7 +207,10 @@ class TextUI:
|
||||
def set_colormode(self, colormode):
|
||||
self.colormode = colormode
|
||||
self.screen.set_terminal_properties(colormode)
|
||||
self.screen.reset_default_terminal_palette()
|
||||
|
||||
if self.colormode < 256:
|
||||
self.screen.reset_default_terminal_palette()
|
||||
self.restore_palette = True
|
||||
|
||||
def unhandled_input(self, key):
|
||||
if key == "ctrl q":
|
||||
|
||||
@@ -294,6 +294,7 @@ class ConversationsDisplay():
|
||||
self.app.directory.remember(entry)
|
||||
|
||||
new_conversation = nomadnet.Conversation(source_hash_text, nomadnet.NomadNetworkApp.get_shared_instance(), initiator=True)
|
||||
|
||||
self.update_conversation_list()
|
||||
|
||||
self.display_conversation(source_hash_text)
|
||||
|
||||
@@ -400,7 +400,15 @@ Now go out there and explore. This is still early days. See what you can find an
|
||||
|
||||
TOPIC_CONFIG = '''>Configuration Options
|
||||
|
||||
To change the configuration of Nomad Network, you must edit the configuration file. By default, this is located at `!~/.nomadnetwork/config`! on your system. You can open it in any text-editor, and change the options. You can also use the editor built in to this program, under the `![ Config ]`! menu item. The default configuration file contains comments on all the different configuration options present, and explains their possible settings.
|
||||
To change the configuration of Nomad Network, you must edit the configuration file. If you did not manually specify a config path when you started the program, Nomad Net will look for a configuration in the folllowing directories:
|
||||
|
||||
`!/etc/nomadnetwork`!
|
||||
`!~/.config/nomadnetwork`!
|
||||
`!~/.nomadnetwork`!
|
||||
|
||||
If no existing configuration file is found, one will be created at `!~/.nomadnetwork/config`! by default. The default configuration file contains comments on all the different configuration options present, and explains their possible settings.
|
||||
|
||||
You can open the configuration file in any text-editor, and change the options. You can also use the editor built in to this program, under the `![ Config ]`! menu item. If the built-in editor does not gain focus, and your navigation keys are not working, try hitting enter or space, which should focus the editor and let you navigate the text.
|
||||
|
||||
For reference, all the configuration options are listed and explained here as well. The configuration is divided into different sections, each with their own options.
|
||||
|
||||
@@ -675,7 +683,14 @@ The Testnet also runs the latest version of Reticulum, often even a short while
|
||||
outgoing = True
|
||||
target_host = frankfurt.rns.unsigned.io
|
||||
target_port = 4965
|
||||
<
|
||||
|
||||
If you connect to the testnet, you can leave nomadnet running for a while and wait for it to receive announces from other nodes on the network that host pages or services, or you can try connecting directly to some nodes listed here:
|
||||
|
||||
- Dublin Hub Testnet Node : `!`[464ddc8cd323648ef919a638923b4916]`!
|
||||
- Frankfurt Hub Testnet Node : `!`[5cda089fc42675bdd904c6d06db87d49]`!
|
||||
|
||||
To browse pages on a node that is not currently known, open the URL dialog in the `![ Network ]`! section of the program by pressing `!Ctrl+U`!, paste or enter the address and select `!< Go >`! or press enter. Nomadnet will attempt to discover and connect to the requested node. You can save the currently connected node by pressing `!Ctrl+S`!.
|
||||
'''
|
||||
|
||||
TOPIC_DISPLAYTEST = '''>Markup & Color Display Test
|
||||
|
||||
@@ -125,8 +125,6 @@ class MainDisplay():
|
||||
def update_active_sub_display(self):
|
||||
self.frame.contents["body"] = (self.sub_displays.active().widget, None)
|
||||
self.update_active_shortcuts()
|
||||
# TODO: Remove when new mitigation has been tested
|
||||
# self.app.ui.main_display.request_redraw(extra_delay=0.0)
|
||||
|
||||
def update_active_shortcuts(self):
|
||||
self.frame.contents["footer"] = (self.sub_displays.active().shortcuts().widget, None)
|
||||
|
||||
@@ -114,8 +114,6 @@ class AnnounceInfo(urwid.WidgetWrap):
|
||||
self.parent.left_pile.contents[0] = (self.parent.announce_stream_display, options)
|
||||
|
||||
def connect(sender):
|
||||
# TODO: Remove when new mitigation has been tested
|
||||
# self.app.ui.main_display.request_redraw(extra_delay=0.75)
|
||||
self.parent.browser.retrieve_url(RNS.hexrep(source_hash, delimit=False))
|
||||
show_announce_stream(None)
|
||||
|
||||
@@ -127,6 +125,9 @@ class AnnounceInfo(urwid.WidgetWrap):
|
||||
|
||||
if is_node:
|
||||
node_ident = RNS.Identity.recall(source_hash)
|
||||
if not node_ident:
|
||||
raise KeyError("Could not recall identity for selected node")
|
||||
|
||||
op_hash = RNS.Destination.hash_from_name_and_identity("lxmf.delivery", node_ident)
|
||||
op_str = self.app.directory.simplest_display_str(op_hash)
|
||||
|
||||
@@ -215,6 +216,7 @@ class AnnounceStreamEntry(urwid.WidgetWrap):
|
||||
date_time_format = "%Y-%m-%d"
|
||||
time_time_format = "%H:%M:%S"
|
||||
short_time_format = "%Y-%m-%d %H:%M"
|
||||
date_only_format = "%Y-%m-%d"
|
||||
|
||||
timestamp = announce[0]
|
||||
source_hash = announce[1]
|
||||
@@ -229,7 +231,7 @@ class AnnounceStreamEntry(urwid.WidgetWrap):
|
||||
if dt.strftime(date_time_format) == dtn.strftime(date_time_format):
|
||||
ts_string = dt.strftime(time_time_format)
|
||||
else:
|
||||
ts_string = dt.strftime(short_time_format)
|
||||
ts_string = dt.strftime(date_only_format)
|
||||
|
||||
trust_level = self.app.directory.trust_level(source_hash)
|
||||
display_str = self.app.directory.simplest_display_str(source_hash)
|
||||
@@ -607,6 +609,8 @@ class ExceptionHandlingListBox(IndicativeListBox):
|
||||
nomadnet.NomadNetworkApp.get_shared_instance().ui.main_display.frame.set_focus("header")
|
||||
elif key == "down":
|
||||
nomadnet.NomadNetworkApp.get_shared_instance().ui.main_display.sub_displays.network_display.left_pile.set_focus(1)
|
||||
else:
|
||||
RNS.log("An error occurred while processing an interface event. The contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||
|
||||
|
||||
class KnownNodes(urwid.WidgetWrap):
|
||||
|
||||
Reference in New Issue
Block a user