mirror of
https://github.com/markqvist/LXMF
synced 2026-11-23 15:30:42 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5be161cb1e | ||
|
|
bf924c739c | ||
|
|
044f3d2879 | ||
|
|
312e0a8ded | ||
|
|
575fb7d77d | ||
|
|
2ac2b100ae | ||
|
|
599406ed0f | ||
|
|
55620bf45c | ||
|
|
b53a3ce37d | ||
|
|
764758d185 | ||
|
|
b415a136f3 | ||
|
|
dffbf4dfe1 | ||
|
|
84613f8b44 | ||
|
|
1bef747306 | ||
|
|
d6ec05193b | ||
|
|
7f0e2627d1 | ||
|
|
29c79177a6 | ||
|
|
7b0e702832 | ||
|
|
0cb62ddc36 | ||
|
|
a8505eade9 | ||
|
|
6a00d82b28 | ||
|
|
2c4dfdd50e | ||
|
|
83fbe80497 | ||
|
|
25b7fcf7de | ||
|
|
189f5239a0 | ||
|
|
f9967db3ee | ||
|
|
ad616fc18e | ||
|
|
9d413c0759 | ||
|
|
4ecbdb334e | ||
|
|
727830cefd | ||
|
|
8499729024 | ||
|
|
3f0681fa99 | ||
|
|
eb67b19a5b |
No files matched your search
+13
-1
@@ -18,7 +18,7 @@ class LXMFDeliveryAnnounceHandler:
|
||||
self.lxmrouter.update_stamp_cost(destination_hash, stamp_cost)
|
||||
|
||||
except Exception as e:
|
||||
RNS.log(f"An error occurred while trying to decode announced stamp cost. The contained exception was: {e}", RNS.LOG_ERROR)
|
||||
RNS.log(f"Could not decode stamp cost from announce data. The contained exception was: {e}", RNS.LOG_DEBUG)
|
||||
|
||||
for lxmessage in self.lxmrouter.pending_outbound:
|
||||
if destination_hash == lxmessage.destination_hash:
|
||||
@@ -41,6 +41,18 @@ class LXMFPropagationAnnounceHandler:
|
||||
def received_announce(self, destination_hash, announced_identity, app_data, announce_packet_hash, is_path_response):
|
||||
try:
|
||||
if type(app_data) == bytes:
|
||||
if destination_hash == self.lxmrouter.get_outbound_propagation_node():
|
||||
if pn_announce_data_is_valid(app_data):
|
||||
for lxmessage in self.lxmrouter.pending_outbound:
|
||||
if lxmessage.method == LXMessage.PROPAGATED:
|
||||
lxmessage.next_delivery_attempt = time.time()
|
||||
|
||||
def outbound_trigger():
|
||||
while self.lxmrouter.outbound_processing_lock.locked(): time.sleep(0.1)
|
||||
self.lxmrouter.process_outbound()
|
||||
|
||||
threading.Thread(target=outbound_trigger, daemon=True).start()
|
||||
|
||||
if self.lxmrouter.propagation_node:
|
||||
if pn_announce_data_is_valid(app_data):
|
||||
data = msgpack.unpackb(app_data)
|
||||
|
||||
+39
-6
@@ -12,7 +12,7 @@ FIELD_ICON_APPEARANCE = 0x04
|
||||
FIELD_FILE_ATTACHMENTS = 0x05
|
||||
FIELD_IMAGE = 0x06
|
||||
FIELD_AUDIO = 0x07
|
||||
FIELD_THREAD = 0x08
|
||||
FIELD_THREAD = 0x08 # Bytes, full thread ID hash
|
||||
FIELD_COMMANDS = 0x09
|
||||
FIELD_RESULTS = 0x0A
|
||||
FIELD_GROUP = 0x0B
|
||||
@@ -20,6 +20,16 @@ FIELD_TICKET = 0x0C
|
||||
FIELD_EVENT = 0x0D
|
||||
FIELD_RNR_REFS = 0x0E
|
||||
FIELD_RENDERER = 0x0F
|
||||
FIELD_REPLY_TO = 0x30 # Bytes, full LXMessage.hash
|
||||
FIELD_REPLY_QUOTE = 0x31 # Bytes, quoted content in UTF-8 encoding
|
||||
FIELD_REACTION = 0x40 # Dict, see "Reaction dict indices" below
|
||||
FIELD_COMMENT = 0x41 # Dict, see "Comment dict indices" below
|
||||
FIELD_CONTINUATION = 0x42 # Dict, see "Continuation dict indices" below
|
||||
|
||||
# Unallocated fields between 0x00 and 0x80, both included,
|
||||
# should be considered reserved for future extensibility
|
||||
# For experimental and unstable features, it is recommended
|
||||
# to use fields above 0xFF.
|
||||
|
||||
# For usecases such as including custom data structures,
|
||||
# embedding or encapsulating other data types or protocols
|
||||
@@ -91,6 +101,30 @@ RENDERER_MICRON = 0x01
|
||||
RENDERER_MARKDOWN = 0x02
|
||||
RENDERER_BBCODE = 0x03
|
||||
|
||||
# Clients choose how to handle reaction content, if at all.
|
||||
# While reactions are typically a single unicode emoji or
|
||||
# similar, the exact implementation and sanitization is
|
||||
# left up to the client. When using the FIELD_REACTION
|
||||
# field, the contents is a dict with the following keys:
|
||||
REACTION_TO = 0x00 # Bytes, full LXMessage.hash
|
||||
REACTION_CONTENT = 0x01 # Bytes, the reaction content in UTF-8 encoding
|
||||
|
||||
# Clients choose how to handle messages intended as comments
|
||||
# for other message, if at all. The actual comment content
|
||||
# is carried as the normal LXM content, meaning clients that
|
||||
# do not support comments will display them as normal messages.
|
||||
# When using the FIELD_COMMENT field, the contents is a dict
|
||||
# with the following keys:
|
||||
COMMENT_FOR = 0x00 # Bytes, full LXMessage.hash
|
||||
|
||||
# Clients choose how to handle messages that continue earlier
|
||||
# messages, if at all. The actual continuation content is
|
||||
# carried as the normal LXM content, meaning clients that
|
||||
# do not support continuations will display them as normal.
|
||||
# When using the FIELD_CONTINUATION field, the contents is a
|
||||
# dict with the following keys:
|
||||
CONTINUATION_OF = 0x00 # Bytes, full LXMessage.hash
|
||||
|
||||
# Optional propagation node metadata fields. These
|
||||
# fields may be highly unstable in allocation and
|
||||
# availability until the version 1.0.0 release, so use
|
||||
@@ -128,15 +162,14 @@ def display_name_from_app_data(app_data=None):
|
||||
if dn == None: return None
|
||||
else:
|
||||
try:
|
||||
decoded = dn.decode("utf-8")
|
||||
decoded = dn.decode("utf-8").replace("\x00", "").strip()
|
||||
return decoded
|
||||
except Exception as e:
|
||||
RNS.log(f"Could not decode display name in included announce data. The contained exception was: {e}", RNS.LOG_ERROR)
|
||||
return None
|
||||
|
||||
# Original announce format
|
||||
else:
|
||||
return app_data.decode("utf-8")
|
||||
else: return app_data.decode("utf-8")
|
||||
|
||||
def stamp_cost_from_app_data(app_data=None):
|
||||
if app_data == None or app_data == b"": return None
|
||||
@@ -185,8 +218,8 @@ def pn_stamp_cost_from_app_data(app_data=None):
|
||||
if pn_announce_data_is_valid(app_data):
|
||||
data = msgpack.unpackb(app_data)
|
||||
return data[5][0]
|
||||
else:
|
||||
return None
|
||||
|
||||
else: return None
|
||||
|
||||
def pn_announce_data_is_valid(data):
|
||||
try:
|
||||
|
||||
+13
-14
@@ -97,7 +97,6 @@ class LXMRouter:
|
||||
|
||||
self.pending_inbound = []
|
||||
self.pending_outbound = []
|
||||
self.failed_outbound = []
|
||||
self.direct_links = {}
|
||||
self.backchannel_links = {}
|
||||
self.delivery_destinations = {}
|
||||
@@ -997,7 +996,7 @@ class LXMRouter:
|
||||
stamp_cost = delivery_destination.stamp_cost
|
||||
|
||||
supported_functionality = [SF_COMPRESSION]
|
||||
peer_data = [display_name, stamp_cost]
|
||||
peer_data = [display_name, stamp_cost, supported_functionality]
|
||||
|
||||
return msgpack.packb(peer_data)
|
||||
|
||||
@@ -1645,6 +1644,10 @@ class LXMRouter:
|
||||
def handle_outbound(self, lxmessage):
|
||||
destination_hash = lxmessage.get_destination().hash
|
||||
|
||||
if lxmessage.desired_method == LXMessage.PROPAGATED and not self.outbound_propagation_node:
|
||||
self.fail_message(lxmessage)
|
||||
raise IOError("Attempt to send propagated message with no outbound propagation node configured")
|
||||
|
||||
if lxmessage.stamp_cost == None:
|
||||
if destination_hash in self.outbound_stamp_costs:
|
||||
stamp_cost = self.outbound_stamp_costs[destination_hash][1]
|
||||
@@ -1732,11 +1735,13 @@ class LXMRouter:
|
||||
def lxmf_delivery(self, lxmf_data, destination_type = None, phy_stats = None, ratchet_id = None, method = None, no_stamp_enforcement=False, allow_duplicate=False):
|
||||
try:
|
||||
message = LXMessage.unpack_from_bytes(lxmf_data)
|
||||
if ratchet_id and not message.ratchet_id:
|
||||
message.ratchet_id = ratchet_id
|
||||
|
||||
if method:
|
||||
message.method = method
|
||||
if message.source_blackholed:
|
||||
RNS.log(f"Dropping LXM from blackholed identity {message.source.identity}", RNS.LOG_DEBUG)
|
||||
return False
|
||||
|
||||
if ratchet_id and not message.ratchet_id: message.ratchet_id = ratchet_id
|
||||
if method: message.method = method
|
||||
|
||||
if message.signature_validated and FIELD_TICKET in message.fields:
|
||||
ticket_entry = message.fields[FIELD_TICKET]
|
||||
@@ -2393,14 +2398,8 @@ class LXMRouter:
|
||||
RNS.log(str(lxmessage)+" failed to send", RNS.LOG_DEBUG)
|
||||
|
||||
lxmessage.progress = 0.0
|
||||
if lxmessage in self.pending_outbound:
|
||||
self.pending_outbound.remove(lxmessage)
|
||||
|
||||
self.failed_outbound.append(lxmessage)
|
||||
|
||||
if lxmessage.state != LXMessage.REJECTED:
|
||||
lxmessage.state = LXMessage.FAILED
|
||||
|
||||
if lxmessage in self.pending_outbound: self.pending_outbound.remove(lxmessage)
|
||||
if lxmessage.state != LXMessage.REJECTED: lxmessage.state = LXMessage.FAILED
|
||||
if lxmessage.failed_callback != None and callable(lxmessage.failed_callback):
|
||||
lxmessage.failed_callback(lxmessage)
|
||||
|
||||
|
||||
+24
-9
@@ -8,6 +8,7 @@ import multiprocessing
|
||||
|
||||
import LXMF.LXStamper as LXStamper
|
||||
from .LXMF import APP_NAME, compression_support_from_app_data
|
||||
from threading import Lock
|
||||
|
||||
|
||||
class LXMessage:
|
||||
@@ -168,6 +169,7 @@ class LXMessage:
|
||||
self.paper_packed = None
|
||||
|
||||
self.incoming = False
|
||||
self.source_blackholed = False
|
||||
self.signature_validated = False
|
||||
self.unverified_reason = None
|
||||
self.ratchet_id = None
|
||||
@@ -183,6 +185,7 @@ class LXMessage:
|
||||
self.__delivery_destination = None
|
||||
self.__delivery_callback = None
|
||||
self.__pn_encrypted_data = None
|
||||
self.__persist_lock = Lock()
|
||||
self.failed_callback = None
|
||||
|
||||
self.deferred_stamp_generating = False
|
||||
@@ -668,21 +671,29 @@ class LXMessage:
|
||||
|
||||
return msgpack.packb(container)
|
||||
|
||||
|
||||
def write_to_directory(self, directory_path):
|
||||
file_name = RNS.hexrep(self.hash, delimit=False)
|
||||
file_path = directory_path+"/"+file_name
|
||||
tmp_path = file_path+".tmp."+str(os.getpid() or time.time())+"."+RNS.hexrep(os.urandom(8), delimit=False)
|
||||
|
||||
try:
|
||||
file = open(file_path, "wb")
|
||||
file.write(self.packed_container())
|
||||
file.close()
|
||||
with self.__persist_lock:
|
||||
try:
|
||||
with open(tmp_path, "wb") as file:
|
||||
file.write(self.packed_container())
|
||||
file.flush()
|
||||
try: os.fsync(file.fileno())
|
||||
except OSError as e: RNS.log(f"Error while waiting for persist fsync for {self}: {e}", RNS.LOG_WARNING)
|
||||
|
||||
return file_path
|
||||
os.replace(tmp_path, file_path)
|
||||
return file_path
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Error while writing LXMF message to file \""+str(file_path)+"\". The contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||
return None
|
||||
except Exception as e:
|
||||
try:
|
||||
if os.path.exists(tmp_path): os.unlink(tmp_path)
|
||||
except Exception as e: RNS.log(f"Error while cleaning temporary file {tmp_path} for {self}: {e}", RNS.LOG_ERROR)
|
||||
|
||||
RNS.log(f"Error while writing LXMF message to file \"{file_path}\". The contained exception was: {e}", RNS.LOG_ERROR)
|
||||
return None
|
||||
|
||||
def as_uri(self, finalise=True):
|
||||
if not self.packed:
|
||||
@@ -789,6 +800,10 @@ class LXMessage:
|
||||
message.set_title_from_bytes(title_bytes)
|
||||
message.set_content_from_bytes(content_bytes)
|
||||
|
||||
try:
|
||||
if source_identity != None: message.source_blackholed = RNS.Reticulum.get_instance().is_blackholed(source_identity)
|
||||
except Exception as e: RNS.log(f"Could not determine message source blackhole status: {e}", RNS.LOG_WARNING)
|
||||
|
||||
try:
|
||||
if source:
|
||||
if source.identity.validate(signature, signed_part):
|
||||
|
||||
+148
-20
@@ -2,9 +2,11 @@ import RNS
|
||||
import RNS.vendor.umsgpack as msgpack
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import math
|
||||
import itertools
|
||||
import contextlib
|
||||
import multiprocessing
|
||||
|
||||
WORKBLOCK_EXPAND_ROUNDS = 3000
|
||||
@@ -12,9 +14,38 @@ WORKBLOCK_EXPAND_ROUNDS_PN = 1000
|
||||
WORKBLOCK_EXPAND_ROUNDS_PEERING = 25
|
||||
STAMP_SIZE = RNS.Identity.HASHLENGTH//8
|
||||
PN_VALIDATION_POOL_MIN_SIZE = 256
|
||||
USE_WORKER_MANAGER = False
|
||||
|
||||
active_jobs = {}
|
||||
|
||||
if sys.version_info[0] >= 3 and sys.version_info[1] >= 14:
|
||||
USE_WORKER_MANAGER = True
|
||||
|
||||
@contextlib.contextmanager
|
||||
def worker_context(ctx, stamp_cost, workblock, message_id):
|
||||
stop_event = ctx.Event()
|
||||
result_queue = ctx.Queue(1)
|
||||
rounds_queue = ctx.Queue()
|
||||
|
||||
active_jobs[message_id] = [stop_event, result_queue]
|
||||
job_procs = []
|
||||
|
||||
try: yield stop_event, result_queue, rounds_queue, job_procs
|
||||
finally:
|
||||
if message_id in active_jobs: del active_jobs[message_id]
|
||||
stop_event.set()
|
||||
|
||||
for p in job_procs:
|
||||
if p.is_alive(): p.terminate()
|
||||
|
||||
for p in job_procs: p.join(timeout=0.5)
|
||||
|
||||
result_queue.close()
|
||||
result_queue.join_thread()
|
||||
rounds_queue.close()
|
||||
rounds_queue.join_thread()
|
||||
stop_event.clear()
|
||||
|
||||
def stamp_workblock(material, expand_rounds=WORKBLOCK_EXPAND_ROUNDS):
|
||||
wb_st = time.time()
|
||||
workblock = b""
|
||||
@@ -100,7 +131,9 @@ def generate_stamp(message_id, stamp_cost, expand_rounds=WORKBLOCK_EXPAND_ROUNDS
|
||||
|
||||
if RNS.vendor.platformutils.is_windows() or RNS.vendor.platformutils.is_darwin(): stamp, rounds = job_simple(stamp_cost, workblock, message_id)
|
||||
elif RNS.vendor.platformutils.is_android(): stamp, rounds = job_android(stamp_cost, workblock, message_id)
|
||||
else: stamp, rounds = job_linux(stamp_cost, workblock, message_id)
|
||||
else:
|
||||
if USE_WORKER_MANAGER: stamp, rounds = job_linux_managed(stamp_cost, workblock, message_id)
|
||||
else: stamp, rounds = job_linux(stamp_cost, workblock, message_id)
|
||||
|
||||
duration = time.time() - start_time
|
||||
speed = rounds/duration
|
||||
@@ -176,6 +209,90 @@ def job_simple(stamp_cost, workblock, message_id):
|
||||
|
||||
return pstamp, rounds
|
||||
|
||||
def job_linux_managed(stamp_cost, workblock, message_id):
|
||||
ctx = multiprocessing.get_context("fork")
|
||||
cores = multiprocessing.cpu_count()
|
||||
jobs = cores if cores <= 12 else int(cores/2)
|
||||
|
||||
allow_kill = True
|
||||
stamp = None
|
||||
total_rounds = 0
|
||||
|
||||
with worker_context(ctx, stamp_cost, workblock, message_id) as (stop_event, result_queue, rounds_queue, job_procs):
|
||||
RNS.log(f"Starting {jobs} stamp generation workers", RNS.LOG_DEBUG)
|
||||
|
||||
def job(stop_event, sc, wb, worker_id):
|
||||
terminated = False
|
||||
rounds = 0
|
||||
pstamp = os.urandom(256//8)
|
||||
|
||||
def sv(s, c, w):
|
||||
target = 0b1<<256-c; m = w+s
|
||||
result = RNS.Identity.full_hash(m)
|
||||
if int.from_bytes(result, byteorder="big") > target: return False
|
||||
else: return True
|
||||
|
||||
while not stop_event.is_set() and not sv(pstamp, sc, wb):
|
||||
pstamp = os.urandom(256//8); rounds += 1
|
||||
|
||||
if not stop_event.is_set():
|
||||
stop_event.set()
|
||||
try: result_queue.put_nowait(pstamp)
|
||||
except: pass
|
||||
|
||||
try: rounds_queue.put_nowait(rounds)
|
||||
except: pass
|
||||
|
||||
for jpn in range(jobs):
|
||||
p = ctx.Process(target=job, args=(stop_event, stamp_cost, workblock, jpn), daemon=True)
|
||||
job_procs.append(p)
|
||||
p.start()
|
||||
|
||||
try: stamp = result_queue.get(timeout=None)
|
||||
except Exception as e:
|
||||
RNS.log(f"Failed to get result from workers: {e}", RNS.LOG_ERROR)
|
||||
stamp = None
|
||||
|
||||
# Collect any potential spurious
|
||||
# results from worker queue.
|
||||
try:
|
||||
while True: result_queue.get_nowait()
|
||||
except: pass
|
||||
|
||||
for j in range(jobs):
|
||||
nrounds = 0
|
||||
try:
|
||||
nrounds = rounds_queue.get(timeout=2)
|
||||
except Exception as e:
|
||||
RNS.log(f"Failed to get round stats part {j}: {e}", RNS.LOG_ERROR)
|
||||
total_rounds += nrounds
|
||||
|
||||
all_exited = False
|
||||
exit_timeout = time.time() + 5
|
||||
while time.time() < exit_timeout:
|
||||
if not any(p.is_alive() for p in job_procs):
|
||||
all_exited = True
|
||||
break
|
||||
time.sleep(0.1)
|
||||
|
||||
if not all_exited:
|
||||
RNS.log("Stamp generation IPC timeout, possible worker deadlock. Terminating remaining processes.", RNS.LOG_ERROR)
|
||||
if allow_kill:
|
||||
for j in range(jobs):
|
||||
process = job_procs[j]
|
||||
process.kill()
|
||||
else:
|
||||
return None
|
||||
|
||||
else:
|
||||
for j in range(jobs):
|
||||
process = job_procs[j]
|
||||
process.join()
|
||||
# RNS.log(f"Joined {j} / {process}", RNS.LOG_DEBUG) # TODO: Remove
|
||||
|
||||
return stamp, total_rounds
|
||||
|
||||
|
||||
def job_linux(stamp_cost, workblock, message_id):
|
||||
allow_kill = True
|
||||
stamp = None
|
||||
@@ -366,30 +483,41 @@ if __name__ == "__main__":
|
||||
RNS.log("No cost argument provided", RNS.LOG_ERROR)
|
||||
exit(1)
|
||||
else:
|
||||
try:
|
||||
cost = int(sys.argv[1])
|
||||
try: cost = int(sys.argv[1])
|
||||
except Exception as e:
|
||||
RNS.log(f"Invalid cost argument provided: {e}", RNS.LOG_ERROR)
|
||||
exit(1)
|
||||
|
||||
rounds = 1
|
||||
if len(sys.argv) > 2:
|
||||
try: rounds = int(sys.argv[2])
|
||||
except Exception as e:
|
||||
RNS.log(f"Invalid rounds argument provided: {e}", RNS.LOG_ERROR)
|
||||
exit(1)
|
||||
|
||||
RNS.loglevel = RNS.LOG_DEBUG
|
||||
RNS.log("Testing LXMF stamp generation", RNS.LOG_DEBUG)
|
||||
message_id = os.urandom(32)
|
||||
generate_stamp(message_id, cost)
|
||||
|
||||
for i in range(rounds):
|
||||
RNS.log("", RNS.LOG_DEBUG)
|
||||
RNS.log(f"Round {i+1} of {rounds}", RNS.LOG_DEBUG)
|
||||
|
||||
RNS.log("", RNS.LOG_DEBUG)
|
||||
RNS.log("Testing propagation stamp generation", RNS.LOG_DEBUG)
|
||||
message_id = os.urandom(32)
|
||||
generate_stamp(message_id, cost, expand_rounds=WORKBLOCK_EXPAND_ROUNDS_PN)
|
||||
RNS.log("Testing LXMF stamp generation", RNS.LOG_DEBUG)
|
||||
message_id = os.urandom(32)
|
||||
generate_stamp(message_id, cost)
|
||||
|
||||
RNS.log("", RNS.LOG_DEBUG)
|
||||
RNS.log("Testing peering key generation", RNS.LOG_DEBUG)
|
||||
message_id = os.urandom(32)
|
||||
generate_stamp(message_id, cost, expand_rounds=WORKBLOCK_EXPAND_ROUNDS_PEERING)
|
||||
RNS.log("", RNS.LOG_DEBUG)
|
||||
RNS.log("Testing propagation stamp generation", RNS.LOG_DEBUG)
|
||||
message_id = os.urandom(32)
|
||||
generate_stamp(message_id, cost, expand_rounds=WORKBLOCK_EXPAND_ROUNDS_PN)
|
||||
|
||||
transient_list = []
|
||||
st = time.time(); count = 10000
|
||||
for i in range(count): transient_list.append(os.urandom(256))
|
||||
validate_pn_stamps(transient_list, 5)
|
||||
dt = time.time()-st; mps = count/dt
|
||||
RNS.log(f"Validated {count} PN stamps in {RNS.prettytime(dt)}, {round(mps,1)} m/s", RNS.LOG_DEBUG)
|
||||
RNS.log("", RNS.LOG_DEBUG)
|
||||
RNS.log("Testing peering key generation", RNS.LOG_DEBUG)
|
||||
message_id = os.urandom(32)
|
||||
generate_stamp(message_id, cost, expand_rounds=WORKBLOCK_EXPAND_ROUNDS_PEERING)
|
||||
|
||||
# transient_list = []
|
||||
# st = time.time(); count = 10000
|
||||
# for i in range(count): transient_list.append(os.urandom(256))
|
||||
# validate_pn_stamps(transient_list, 5)
|
||||
# dt = time.time()-st; mps = count/dt
|
||||
# RNS.log(f"Validated {count} PN stamps in {RNS.prettytime(dt)}, {round(mps,1)} m/s", RNS.LOG_DEBUG)
|
||||
@@ -307,7 +307,7 @@ def program_setup(configdir = None, rnsconfigdir = None, run_pn = False, on_inbo
|
||||
if configdir == None:
|
||||
if os.path.isdir("/etc/lxmd") and os.path.isfile("/etc/lxmd/config"):
|
||||
configdir = "/etc/lxmd"
|
||||
elif os.path.isdir(RNS.Reticulum.userdir+"/.config/lxmd") and os.path.isfile(Reticulum.userdir+"/.config/lxmd/config"):
|
||||
elif os.path.isdir(RNS.Reticulum.userdir+"/.config/lxmd") and os.path.isfile(RNS.Reticulum.userdir+"/.config/lxmd/config"):
|
||||
configdir = RNS.Reticulum.userdir+"/.config/lxmd"
|
||||
else:
|
||||
configdir = RNS.Reticulum.userdir+"/.lxmd"
|
||||
@@ -822,7 +822,7 @@ def _remote_init(configdir=None, rnsconfigdir=None, verbosity=0, quietness=0, id
|
||||
if identity_path == None:
|
||||
if configdir == None:
|
||||
if os.path.isdir("/etc/lxmd") and os.path.isfile("/etc/lxmd/config"): configdir = "/etc/lxmd"
|
||||
elif os.path.isdir(RNS.Reticulum.userdir+"/.config/lxmd") and os.path.isfile(Reticulum.userdir+"/.config/lxmd/config"): configdir = RNS.Reticulum.userdir+"/.config/lxmd"
|
||||
elif os.path.isdir(RNS.Reticulum.userdir+"/.config/lxmd") and os.path.isfile(RNS.Reticulum.userdir+"/.config/lxmd/config"): configdir = RNS.Reticulum.userdir+"/.config/lxmd"
|
||||
else: configdir = RNS.Reticulum.userdir+"/.lxmd"
|
||||
|
||||
configpath = configdir+"/config"
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
__version__ = "0.9.5"
|
||||
__version__ = "1.0.0"
|
||||
@@ -23,8 +23,8 @@ build_sdist:
|
||||
|
||||
build_spkg: remove_symlinks build_sdist create_symlinks
|
||||
|
||||
release: remove_symlinks build_wheel create_symlinks
|
||||
release: remove_symlinks build_wheel build_spkg create_symlinks
|
||||
|
||||
upload:
|
||||
@echo Uploading to PyPi...
|
||||
twine upload dist/*
|
||||
twine upload dist/*.whl dist/*.tar.gz
|
||||
@@ -1,8 +1,6 @@
|
||||
# Lightweight Extensible Message Format
|
||||
|
||||
*This repository is [a public mirror](./MIRROR.md). All development is happening elsewhere.*
|
||||
|
||||
LXMF is a simple and flexible messaging format and delivery protocol that allows a wide variety of implementations, while using as little bandwidth as possible. It is built on top of [Reticulum](https://reticulum.network) and offers zero-conf message routing, end-to-end encryption and Forward Secrecy, and can be transported over any kind of medium that Reticulum supports.
|
||||
LXMF is a simple and flexible messaging format and delivery protocol that allows a wide variety of implementations, while using as little bandwidth as possible. It is built on top of [Reticulum](a8d24177d946de4f1f0a0fe1af9a1338:/page/repo.mu`g=reticulum|r=reticulum) and offers zero-conf message routing, end-to-end encryption and Forward Secrecy, and can be transported over any kind of medium that Reticulum supports.
|
||||
|
||||
LXMF is efficient enough that it can deliver messages over extremely low-bandwidth systems such as packet radio or LoRa. Encrypted LXMF messages can also be encoded as QR-codes or text-based URIs, allowing completely analog *paper message* transport.
|
||||
|
||||
@@ -87,7 +85,6 @@ lxm_router = LXMF.LXMRouter()
|
||||
message = LXMF.LXMessage(destination, source, "This is a short, simple message.")
|
||||
|
||||
lxm_router.handle_outbound(message)
|
||||
|
||||
```
|
||||
|
||||
The LXM Router then handles the heavy lifting, such as message packing, encryption, delivery confirmation, path lookup, routing, retries and failure notifications.
|
||||
@@ -125,11 +122,13 @@ You can try out the paper messaging functionality by using the following QR code
|
||||
|
||||
The [Sideband](https://unsigned.io/sideband) application allows you to do this easily. After you have imported the identity into an app of your choice, you can scan the following QR code and open it in the app, where it will be decrypted and added as a message.
|
||||
|
||||
<p align="center"><img width="50%" src="./docs/paper_msg_test.png"/></p>
|
||||
[Paper message QR code](a8d24177d946de4f1f0a0fe1af9a1338:/page/blob.mu`g=reticulum|r=lxmf|ref=HEAD|path=docs/paper_msg_test.png)
|
||||
|
||||
You can also find the entire message in <a href="lxm://azNivSwdv4e2aoX3mo2MdTAozuI7BlzrLlHULmnVgpz3dNT9CMPVwgywzCJP8FVogj5j_kU7j7ywuvBNcr45kRTrd19c3iHenmnSDe4VEd6FuGsAiT0Khzl7T81YZHPTDhRNp0FdhDE9AJ7uphw7zKMyqhHHxOxqrYeBeKF66gpPxDceqjsOApvsSwggjcuHBx9OxOBy05XmnJxA1unCKgvNfOFYc1T47luxoY3c0dLOJnJPwZuFRytx2TXlQNZzOJ28yTEygIfkDqEO9mZi5lgev7XZJ0DvgioQxMIyoCm7lBUzfq66zW3SQj6vHHph7bhr36dLOCFgk4fZA6yia2MlTT9KV66Tn2l8mPNDlvuSAJhwDA_xx2PN9zKadCjo9sItkAp8r-Ss1CzoUWZUAyT1oDw7ly6RrzGBG-e3eM3CL6u1juIeFiHby7_3cON-6VTUuk4xR5nwKlFTu5vsYMVXe5H3VahiDSS4Q1aqX7I">this link</a>:
|
||||
You can also find the entire message in this link:
|
||||
|
||||
`lxm://azNivSwdv4e2aoX3mo2MdTAozuI7BlzrLlHULmnVgpz3dNT9CMPVwgywzCJP8FVogj5j_kU7j7ywuvBNcr45kRTrd19c3iHenmnSDe4VEd6FuGsAiT0Khzl7T81YZHPTDhRNp0FdhDE9AJ7uphw7zKMyqhHHxOxqrYeBeKF66gpPxDceqjsOApvsSwggjcuHBx9OxOBy05XmnJxA1unCKgvNfOFYc1T47luxoY3c0dLOJnJPwZuFRytx2TXlQNZzOJ28yTEygIfkDqEO9mZi5lgev7XZJ0DvgioQxMIyoCm7lBUzfq66zW3SQj6vHHph7bhr36dLOCFgk4fZA6yia2MlTT9KV66Tn2l8mPNDlvuSAJhwDA_xx2PN9zKadCjo9sItkAp8r-Ss1CzoUWZUAyT1oDw7ly6RrzGBG-e3eM3CL6u1juIeFiHby7_3cON-6VTUuk4xR5nwKlFTu5vsYMVXe5H3VahiDSS4Q1aqX7I`
|
||||
```
|
||||
lxm://azNivSwdv4e2aoX3mo2MdTAozuI7BlzrLlHULmnVgpz3dNT9CMPVwgywzCJP8FVogj5j_kU7j7ywuvBNcr45kRTrd19c3iHenmnSDe4VEd6FuGsAiT0Khzl7T81YZHPTDhRNp0FdhDE9AJ7uphw7zKMyqhHHxOxqrYeBeKF66gpPxDceqjsOApvsSwggjcuHBx9OxOBy05XmnJxA1unCKgvNfOFYc1T47luxoY3c0dLOJnJPwZuFRytx2TXlQNZzOJ28yTEygIfkDqEO9mZi5lgev7XZJ0DvgioQxMIyoCm7lBUzfq66zW3SQj6vHHph7bhr36dLOCFgk4fZA6yia2MlTT9KV66Tn2l8mPNDlvuSAJhwDA_xx2PN9zKadCjo9sItkAp8r-Ss1CzoUWZUAyT1oDw7ly6RrzGBG-e3eM3CL6u1juIeFiHby7_3cON-6VTUuk4xR5nwKlFTu5vsYMVXe5H3VahiDSS4Q1aqX7I
|
||||
```
|
||||
|
||||
On operating systems that allow for registering custom URI-handlers, you can click the link, and it will be decoded directly in your LXMF client. This works with Sideband on Android.
|
||||
|
||||
@@ -213,8 +212,6 @@ LXMF is beta software, and should be considered experimental. While it has been
|
||||
|
||||
LXMF is actively being developed, and the following improvements and features are currently planned for implementation:
|
||||
|
||||
- ~~Update examples in readme to actually work~~
|
||||
- ~~Sync affinity based on link speeds and distances, for more intelligently choosing peer sync order~~
|
||||
- Sneakernet and physical transport functionality
|
||||
- Content Destinations, and easy to use API for group messaging and discussion threads
|
||||
- Write and release full API and protocol documentation
|
||||
|
||||
Reference in new issue
Block a user