mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-12-17 14:54:26 +01:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9bba6fd69 | ||
|
|
4a3c987cef | ||
|
|
026ff7b5c7 | ||
|
|
bcca6be487 | ||
|
|
3181e2124f | ||
|
|
6026f42f34 | ||
|
|
e695cce3ba | ||
|
|
ff45c597f8 | ||
|
|
a4c348529e | ||
|
|
641f326be7 | ||
|
|
014b9faea6 | ||
|
|
ac7eecbd99 | ||
|
|
04376a9f96 | ||
|
|
c004adfb8c | ||
|
|
a5623978a2 |
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: ✨ Feature Request or Idea
|
||||
url: https://github.com/markqvist/Reticulum/discussions/new?category=ideas
|
||||
about: Propose and discuss features and ideas
|
||||
- name: 💬 Questions, Help & Discussion
|
||||
about: Ask anything, or get help
|
||||
url: https://github.com/markqvist/Reticulum/discussions/new/choose
|
||||
- name: 📖 Read the Reticulum Manual
|
||||
url: https://markqvist.github.io/Reticulum/manual/
|
||||
about: The complete documentation for Reticulum
|
||||
35
.github/ISSUE_TEMPLATE/🐛-bug-report.md
vendored
Normal file
35
.github/ISSUE_TEMPLATE/🐛-bug-report.md
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: "\U0001F41B Bug Report"
|
||||
about: Report a reproducible bug
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Read the Contribution Guidelines**
|
||||
Before creating a bug report on this issue tracker, you **must** read the [Contribution Guidelines](https://github.com/markqvist/Reticulum/blob/master/Contributing.md). Issues that do not follow the contribution guidelines **will be deleted without comment**.
|
||||
|
||||
- The issue tracker is used by developers of this project. **Do not use it to ask general questions, or for support requests**.
|
||||
- Ideas and feature requests can be made on the [Discussions](https://github.com/markqvist/Reticulum/discussions). **Only** feature requests accepted by maintainers and developers are tracked and included on the issue tracker. **Do not post feature requests here**.
|
||||
- After reading the [Contribution Guidelines](https://github.com/markqvist/Reticulum/blob/master/Contributing.md), delete this section from your bug report.
|
||||
|
||||
**Describe the Bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Describe in detail how to reproduce the bug.
|
||||
|
||||
**Expected Behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Logs & Screenshots**
|
||||
Please include any relevant log output. If applicable, also add screenshots to help explain your problem.
|
||||
|
||||
**System Information**
|
||||
- OS and version
|
||||
- Python version
|
||||
- Program version
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM python:3.11-rc-alpine3.14 as build
|
||||
FROM python:3.12-alpine as build
|
||||
|
||||
RUN apk add --no-cache build-base linux-headers libffi-dev cargo
|
||||
|
||||
@@ -8,10 +8,10 @@ ENV PATH="/opt/venv/bin:$PATH"
|
||||
RUN pip3 install setuptools-rust pyopenssl cryptography
|
||||
|
||||
COPY . /app/
|
||||
RUN cd /app/ && python3 setup.py install
|
||||
RUN cd /app/ && pip3 install .
|
||||
|
||||
# Use multi-stage build, as we don't need rust compilation on the final image
|
||||
FROM python:3.11-rc-alpine3.14
|
||||
FROM python:3.12-alpine
|
||||
|
||||
LABEL org.opencontainers.image.documentation="https://github.com/markqvist/NomadNet#nomad-network-daemon-with-docker"
|
||||
|
||||
|
||||
32
Dockerfile.build
Normal file
32
Dockerfile.build
Normal file
@@ -0,0 +1,32 @@
|
||||
FROM python:alpine
|
||||
LABEL authors="Petr Blaha petr.blaha@cleverdata.cz"
|
||||
USER root
|
||||
RUN apk update
|
||||
RUN apk add build-base libffi-dev cargo pkgconfig linux-headers py3-virtualenv
|
||||
|
||||
RUN addgroup -S myuser && adduser -S -G myuser myuser
|
||||
USER myuser
|
||||
WORKDIR /home/myuser
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install setuptools-rust pyopenssl cryptography
|
||||
|
||||
|
||||
ENV PATH="/home/myuser/.local/bin:${PATH}"
|
||||
|
||||
################### BEGIN NomadNet ###########################################
|
||||
|
||||
COPY --chown=myuser:myuser requirements.txt requirements.txt
|
||||
|
||||
RUN pip install --user -r requirements.txt
|
||||
|
||||
|
||||
COPY --chown=myuser:myuser . .
|
||||
|
||||
#Python create virtual environment
|
||||
RUN virtualenv /home/myuser/NomadNet/venv
|
||||
RUN source /home/myuser/NomadNet/venv/bin/activate
|
||||
|
||||
RUN make all
|
||||
|
||||
################### END NomadNet ###########################################
|
||||
6
Dockerfile.howto
Normal file
6
Dockerfile.howto
Normal file
@@ -0,0 +1,6 @@
|
||||
# Run docker command one by one(all four), it will build NomadNet artifact and copy to dist directory.
|
||||
# No need to build locally and install dependencies
|
||||
docker build -t nomadnetdockerimage -f Dockerfile.build .
|
||||
docker run -d -it --name nomadnetdockercontainer nomadnetdockerimage /bin/sh
|
||||
docker cp nomadnetdockercontainer:/home/myuser/dist .
|
||||
docker rm -f nomadnetdockercontainer
|
||||
@@ -148,11 +148,11 @@ You can help support the continued development of open, free and private communi
|
||||
```
|
||||
- Ethereum
|
||||
```
|
||||
0x81F7B979fEa6134bA9FD5c701b3501A2e61E897a
|
||||
0xFDabC71AC4c0C78C95aDDDe3B4FA19d6273c5E73
|
||||
```
|
||||
- Bitcoin
|
||||
```
|
||||
3CPmacGm34qYvR6XWLVEJmi2aNe3PZqUuq
|
||||
35G9uWVzrpJJibzUwpNUQGQNFzLirhrYAH
|
||||
```
|
||||
- Ko-Fi: https://ko-fi.com/markqvist
|
||||
|
||||
|
||||
@@ -125,6 +125,10 @@ class NomadNetworkApp:
|
||||
self.peer_announce_at_start = True
|
||||
self.try_propagation_on_fail = True
|
||||
self.disable_propagation = False
|
||||
self.notify_on_new_message = True
|
||||
|
||||
self.lxmf_max_propagation_size = None
|
||||
self.lxmf_max_incoming_size = None
|
||||
|
||||
self.periodic_lxmf_sync = True
|
||||
self.lxmf_sync_interval = 360*60
|
||||
@@ -282,7 +286,11 @@ class NomadNetworkApp:
|
||||
|
||||
self.directory = nomadnet.Directory(self)
|
||||
|
||||
self.message_router = LXMF.LXMRouter(identity = self.identity, storagepath = self.storagepath, autopeer = True)
|
||||
self.message_router = LXMF.LXMRouter(
|
||||
identity = self.identity, storagepath = self.storagepath, autopeer = True,
|
||||
propagation_limit = self.lxmf_max_propagation_size, delivery_limit = self.lxmf_max_incoming_size,
|
||||
)
|
||||
|
||||
self.message_router.register_delivery_callback(self.lxmf_delivery)
|
||||
|
||||
for destination_hash in self.ignored_list:
|
||||
@@ -546,6 +554,9 @@ class NomadNetworkApp:
|
||||
|
||||
nomadnet.Conversation.ingest(message, self)
|
||||
|
||||
if self.notify_on_new_message:
|
||||
self.notify_message_recieved()
|
||||
|
||||
if self.should_print(message):
|
||||
self.print_message(message)
|
||||
|
||||
@@ -649,6 +660,11 @@ class NomadNetworkApp:
|
||||
if os.path.isfile(self.conversationpath + "/" + source_hash + "/unread"):
|
||||
os.unlink(self.conversationpath + "/" + source_hash + "/unread")
|
||||
|
||||
def notify_message_recieved(self):
|
||||
if self.uimode == nomadnet.ui.UI_TEXT:
|
||||
sys.stdout.write("\a")
|
||||
sys.stdout.flush()
|
||||
|
||||
def clear_tmp_dir(self):
|
||||
if os.path.isdir(self.tmpfilespath):
|
||||
for file in os.listdir(self.tmpfilespath):
|
||||
@@ -722,10 +738,22 @@ class NomadNetworkApp:
|
||||
else:
|
||||
self.lxmf_sync_limit = None
|
||||
|
||||
if option == "max_accepted_size":
|
||||
value = self.config["client"].as_float(option)
|
||||
|
||||
if value > 0:
|
||||
self.lxmf_max_incoming_size = value
|
||||
else:
|
||||
self.lxmf_max_incoming_size = 500
|
||||
|
||||
if option == "compact_announce_stream":
|
||||
value = self.config["client"].as_bool(option)
|
||||
self.compact_stream = value
|
||||
|
||||
if option == "notify_on_new_message":
|
||||
value = self.config["client"].as_bool(option)
|
||||
self.notify_on_new_message = value
|
||||
|
||||
if option == "user_interface":
|
||||
value = value.lower()
|
||||
if value == "none":
|
||||
@@ -816,6 +844,14 @@ class NomadNetworkApp:
|
||||
else:
|
||||
self.disable_propagation = self.config["node"].as_bool("disable_propagation")
|
||||
|
||||
if not "max_transfer_size" in self.config["node"]:
|
||||
self.lxmf_max_propagation_size = 256
|
||||
else:
|
||||
value = self.config["node"].as_float("max_transfer_size")
|
||||
if value < 1:
|
||||
value = 1
|
||||
self.lxmf_max_propagation_size = value
|
||||
|
||||
if not "announce_at_start" in self.config["node"]:
|
||||
self.node_announce_at_start = False
|
||||
else:
|
||||
@@ -953,6 +989,7 @@ destination = file
|
||||
enable_client = yes
|
||||
user_interface = text
|
||||
downloads_path = ~/Downloads
|
||||
notify_on_new_message = yes
|
||||
|
||||
# By default, the peer is announced at startup
|
||||
# to let other peers reach it immediately.
|
||||
@@ -980,6 +1017,13 @@ lxmf_sync_interval = 360
|
||||
# the limit, and download everything every time.
|
||||
lxmf_sync_limit = 8
|
||||
|
||||
# The maximum accepted unpacked size for mes-
|
||||
# sages received directly from other peers,
|
||||
# specified in kilobytes. Messages larger than
|
||||
# this will be rejected before the transfer
|
||||
# begins.
|
||||
max_accepted_size = 500
|
||||
|
||||
# The announce stream will only show one entry
|
||||
# per destination or node by default. You can
|
||||
# change this to show as many announces as have
|
||||
@@ -1068,6 +1112,18 @@ announce_at_start = Yes
|
||||
# and defaults to 2 gigabytes.
|
||||
# message_storage_limit = 2000
|
||||
|
||||
# The maximum accepted transfer size per in-
|
||||
# coming propagation transfer, in kilobytes.
|
||||
# This also sets the upper limit for the size
|
||||
# of single messages accepted onto this node.
|
||||
#
|
||||
# If a node wants to propagate a larger number
|
||||
# of messages to this node, than what can fit
|
||||
# within this limit, it will prioritise sending
|
||||
# the smallest, newest messages first, and try
|
||||
# with any remaining messages at a later point.
|
||||
max_transfer_size = 256
|
||||
|
||||
# You can tell the LXMF message router to
|
||||
# prioritise storage for one or more
|
||||
# destinations. If the message store reaches
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.4.6"
|
||||
__version__ = "0.4.7"
|
||||
|
||||
@@ -664,6 +664,8 @@ class Browser:
|
||||
self.delegate.columns.focus_position = 1
|
||||
|
||||
def save_node_dialog(self):
|
||||
if self.destination_hash != None:
|
||||
try:
|
||||
def dismiss_dialog(sender):
|
||||
self.close_dialogs()
|
||||
|
||||
@@ -710,6 +712,8 @@ class Browser:
|
||||
self.delegate.columns.contents[1] = (overlay, options)
|
||||
self.delegate.columns.focus_position = 1
|
||||
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
def load_page(self):
|
||||
if self.request_data == None:
|
||||
|
||||
@@ -300,7 +300,7 @@ To learn how to host your own node, read the `*Hosting a Node`* section of this
|
||||
|
||||
TOPIC_HOSTING = '''>Hosting a Node
|
||||
|
||||
To host a node on the network, you must enable it in the configuration file, by setting `*enable_node`* directive to `*yes`*. You should also configure the other node-related parameters such as the node name and announce interval settings. Once node hosting has been enabled in the configuration, Nomad Network will start hosting your node as soon as the program is launched, and other peers on the network will be able to connect and interact with content on your node.
|
||||
To host a node on the network, you must enable it in the configuration file, by setting the `*enable_node`* directive to `*yes`*. You should also configure the other node-related parameters such as the node name and announce interval settings. Once node hosting has been enabled in the configuration, Nomad Network will start hosting your node as soon as the program is launched, and other peers on the network will be able to connect and interact with content on your node.
|
||||
|
||||
By default, no content is defined, apart from a short placeholder home page. To learn how to add your own content, read on.
|
||||
|
||||
@@ -310,9 +310,12 @@ All nodes on the network will automatically participate in a distributed message
|
||||
|
||||
When Nomad Network is configured to host a node, by default it also configures itself as an LXMF Propagation Node, and automatically discovers and peers with other propagation nodes on the network. This process is completely automatic and requires no configuration from the node operator.
|
||||
|
||||
If there is already an abundance of Propagation Nodes on the network, or the operator simply wishes to host a pageserving-only node, Propagation Node hosting can be disabled in the configuration file.
|
||||
`!However`!, if there is already an abundance of Propagation Nodes on the network, or the operator simply wishes to host a pageserving-only node, Propagation Node hosting can be disabled in the configuration file.
|
||||
|
||||
To view LXMF Propagation nodes that are currently peered with your node, go to the `![ Network ]`! part of the program and press `!Ctrl-P`!. In the list of peered Propagation Nodes, it is possible to break peering with a node by pressing `!Ctrl-X`!. It is also possible to request an immediate delivery sync of all unhandled messages for a node, by pressing `!Ctrl-R`!.
|
||||
To view LXMF Propagation nodes that are currently peered with your node, go to the `![ Network ]`! part of the program and press `!Ctrl-P`!. In the list of peered Propagation Nodes, it is possible to:
|
||||
|
||||
- Immediately break peering with a node by pressing `!Ctrl-X`!
|
||||
- Request an immediate delivery sync of all unhandled messages for a node, by pressing `!Ctrl-R`!
|
||||
|
||||
The distributed message store is resilient to intermittency, and will remain functional as long as at least one node remains on the network. Nodes that were offline for a time will automatically be synced up to date when they regain connectivity.
|
||||
|
||||
@@ -326,9 +329,9 @@ You can control how long a peer will cache your pages by including the cache hea
|
||||
|
||||
>> Dynamic Pages
|
||||
|
||||
You can use a preprocessor such as PHP, bash, Python (or whatever you prefer) to generate dynamic pages. To do so, just set executable permissions on the relevant page file, and be sure to include the interpreter at the beginning of the file, for example `!#!/usr/bin/python3`!.
|
||||
You can use a preprocessor such as PHP, bash, Python (or whatever you prefer) to generate dynamic pages and fully interactive applications running over Nomad Network. To do so, just set executable permissions on the relevant page file, and be sure to include the interpreter at the beginning of the file, for example `!#!/usr/bin/python3`!.
|
||||
|
||||
Data from fields and link variables will be passed to these scipts or programs as environment variables, and can simply be read by any method for acessing such.
|
||||
Data from fields and link variables will be passed to these scipts or programs as environment variables, and can simply be read by any method for accessing such.
|
||||
|
||||
In the `!examples`! directory, you can find various small examples for the use of this feature. The currently included examples are:
|
||||
|
||||
@@ -512,6 +515,12 @@ 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.
|
||||
<
|
||||
|
||||
>>>
|
||||
`!max_accepted_size = 500`!
|
||||
>>>>
|
||||
The maximum accepted unpacked size for messages received directly from other peers, specified in kilobytes. Messages larger than this will be rejected before the transfer begins.
|
||||
<
|
||||
|
||||
>>>
|
||||
`!compact_announce_stream = yes`!
|
||||
>>>>
|
||||
@@ -650,6 +659,12 @@ By default, when Nomad Network is hosting a node, it will also run an LXMF propa
|
||||
Configures the maximum amount of storage, in megabytes, that the LXMF Propagation Node will use to store messages.
|
||||
<
|
||||
|
||||
>>>
|
||||
`!max_transfer_size = 256`!
|
||||
>>>>
|
||||
The maximum accepted transfer size per incoming propagation transfer, in kilobytes. This also sets the upper limit for the size of single messages accepted onto this propagation node. If a node wants to propagate a larger number of messages to this node, than what can fit within this limit, it will prioritise sending the smallest, newest messages first, and try with any remaining messages at a later point.
|
||||
<
|
||||
|
||||
>>>
|
||||
`!prioritise_destinations = 41d20c727598a3fbbdf9106133a3a0ed, d924b81822ca24e68e2effea99bcb8cf`!
|
||||
>>>>
|
||||
|
||||
6
requirements.txt
Normal file
6
requirements.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
compiler==0.2.0
|
||||
configobj==5.0.8
|
||||
lxmf==0.3.2
|
||||
rns==0.5.7
|
||||
setuptools==68.0.0
|
||||
urwid==2.1.2
|
||||
2
setup.py
2
setup.py
@@ -30,6 +30,6 @@ setuptools.setup(
|
||||
entry_points= {
|
||||
'console_scripts': ['nomadnet=nomadnet.nomadnet:main']
|
||||
},
|
||||
install_requires=["rns>=0.7.0", "lxmf>=0.3.9", "urwid>=2.4.2,!=2.4.3", "qrcode"],
|
||||
install_requires=["rns>=0.7.2", "lxmf>=0.4.0", "urwid>=2.4.2,!=2.4.3", "qrcode"],
|
||||
python_requires=">=3.6",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user