rns 1.2.7__tar.gz → 1.2.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rns-1.2.7 → rns-1.2.8}/PKG-INFO +1 -1
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rngit/client.py +41 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rngit/pages.py +10 -6
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rngit/server.py +777 -79
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rngit/util.py +71 -24
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnid.py +92 -13
- rns-1.2.8/RNS/_version.py +1 -0
- rns-1.2.8/RNS/vendor/validate.py +537 -0
- {rns-1.2.7 → rns-1.2.8}/rns.egg-info/PKG-INFO +1 -1
- {rns-1.2.7 → rns-1.2.8}/rns.egg-info/SOURCES.txt +1 -0
- rns-1.2.7/RNS/_version.py +0 -1
- {rns-1.2.7 → rns-1.2.8}/CRNS/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/README.md +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Buffer.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Channel.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/AES.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/Ed25519.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/HKDF.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/HMAC.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/Hashes.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/PKCS7.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/Provider.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/Proxies.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/SHA256.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/SHA512.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/Token.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/X25519.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/aes/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/aes/aes128.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/aes/aes256.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/pure25519/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/pure25519/_ed25519.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/pure25519/basic.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/pure25519/ed25519_oop.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Cryptography/pure25519/eddsa.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Destination.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Discovery.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Identity.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/AX25KISSInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/Android/KISSInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/Android/RNodeInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/Android/SerialInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/Android/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/AutoInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/BackboneInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/I2PInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/Interface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/KISSInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/LocalInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/PipeInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/RNodeInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/RNodeMultiInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/SerialInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/TCPInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/UDPInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/WeaveInterface.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/util/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Interfaces/util/netinfo.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Link.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Packet.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Resolver.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Resource.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Reticulum.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Transport.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rncp.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rngit/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rngit/highlight.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rngit/main.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnir.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnodeconf.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnpath.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnpkg.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnprobe.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsd.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/_version.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/args.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/exception.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/helpers.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/initiator.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/listener.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/loop.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/process.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/protocol.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/retry.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/rnsh.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnsh/session.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnstatus.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/Utilities/rnx.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/configobj.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/i2plib/__init__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/i2plib/__version__.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/i2plib/aiosam.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/i2plib/exceptions.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/i2plib/log.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/i2plib/sam.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/i2plib/tunnel.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/i2plib/utils.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/platformutils.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/RNS/vendor/umsgpack.py +0 -0
- {rns-1.2.7 → rns-1.2.8}/rns.egg-info/dependency_links.txt +0 -0
- {rns-1.2.7 → rns-1.2.8}/rns.egg-info/entry_points.txt +0 -0
- {rns-1.2.7 → rns-1.2.8}/rns.egg-info/requires.txt +0 -0
- {rns-1.2.7 → rns-1.2.8}/rns.egg-info/top_level.txt +0 -0
- {rns-1.2.7 → rns-1.2.8}/setup.cfg +0 -0
- {rns-1.2.7 → rns-1.2.8}/setup.py +0 -0
{rns-1.2.7 → rns-1.2.8}/PKG-INFO
RENAMED
|
@@ -101,6 +101,7 @@ class ReticulumGitClient():
|
|
|
101
101
|
self.config = None
|
|
102
102
|
self.ready = False
|
|
103
103
|
|
|
104
|
+
self.destination_aliases = {}
|
|
104
105
|
self.remote_identity = None
|
|
105
106
|
self.destination = None
|
|
106
107
|
self.link = None
|
|
@@ -170,6 +171,18 @@ class ReticulumGitClient():
|
|
|
170
171
|
section = self.config["client"]
|
|
171
172
|
if "ref_batch_size" in section: self.ref_batch_size = max(0, min(1024, section.as_int("ref_batch_size")))
|
|
172
173
|
|
|
174
|
+
if "aliases" in self.config:
|
|
175
|
+
section = self.config["aliases"]
|
|
176
|
+
for alias in section:
|
|
177
|
+
alias_hexhash = section[alias]
|
|
178
|
+
len_ok = len(alias_hexhash) == RNS.Identity.TRUNCATED_HASHLENGTH//8*2
|
|
179
|
+
try: alias_hash = bytes.fromhex(alias_hexhash)
|
|
180
|
+
except: alias_hash = None
|
|
181
|
+
alias_exists = alias in self.destination_aliases
|
|
182
|
+
if not len_ok or not alias_hash: continue
|
|
183
|
+
if alias_exists: continue
|
|
184
|
+
self.destination_aliases[alias] = RNS.hexrep(alias_hash, delimit=False)
|
|
185
|
+
|
|
173
186
|
if not os.path.isfile(self.identitypath):
|
|
174
187
|
identity = RNS.Identity()
|
|
175
188
|
identity.to_file(self.identitypath)
|
|
@@ -185,6 +198,19 @@ class ReticulumGitClient():
|
|
|
185
198
|
|
|
186
199
|
else: self.identity = identity
|
|
187
200
|
|
|
201
|
+
self.destination_hexhash = self.__resolve_destination_alias(self.destination_hexhash)
|
|
202
|
+
|
|
203
|
+
def __resolve_destination_alias(self, alias):
|
|
204
|
+
def resolve(alias):
|
|
205
|
+
len_match = len(alias) == RNS.Identity.TRUNCATED_HASHLENGTH//8*2
|
|
206
|
+
try: hash_bytes = bytes.fromhex(alias)
|
|
207
|
+
except: hash_bytes = None
|
|
208
|
+
if len_match and hash_bytes: return alias
|
|
209
|
+
else: return self.destination_aliases[alias] if alias in self.destination_aliases else alias
|
|
210
|
+
|
|
211
|
+
resolved = resolve(alias)
|
|
212
|
+
return resolved
|
|
213
|
+
|
|
188
214
|
def abort(self, reason=None, code=255):
|
|
189
215
|
if not reason: reason = "Unknown reason"
|
|
190
216
|
print(f"git-remote-rns failed: {reason}", file=sys.stderr)
|
|
@@ -656,6 +682,21 @@ __default_rngit_config__ = '''# This is the default rngit client config file.
|
|
|
656
682
|
|
|
657
683
|
ref_batch_size = 25
|
|
658
684
|
|
|
685
|
+
|
|
686
|
+
[aliases]
|
|
687
|
+
|
|
688
|
+
# You can define aliases for commonly used destination
|
|
689
|
+
# hashes in this section. Each line must be in the format
|
|
690
|
+
# aliased_name = DESTINATION_HASH
|
|
691
|
+
#
|
|
692
|
+
# These hashes are used for resolving remote destinations.
|
|
693
|
+
# For rngit node permissions and identity resolution,
|
|
694
|
+
# aliases must be defined in ~/.rngit/config.
|
|
695
|
+
|
|
696
|
+
# my_node = 063d38912bffc850af4a1b8a270a9d85
|
|
697
|
+
# bobs_node = 714981d03e41deda0e4468cb274414cc
|
|
698
|
+
|
|
699
|
+
|
|
659
700
|
[logging]
|
|
660
701
|
# Valid log levels are 0 through 7:
|
|
661
702
|
# 0: Log only critical information
|
|
@@ -437,6 +437,10 @@ class NomadNetworkNode():
|
|
|
437
437
|
|
|
438
438
|
repo = self.get_accessible_repository(remote_identity, group_name, repo_name)
|
|
439
439
|
|
|
440
|
+
if not repo:
|
|
441
|
+
content = self.m_heading("Not Found", 1) + "\nThe requested repository was not found.\n"
|
|
442
|
+
return self.render_template(content, nav_content="".join(nav_parts), st=st)
|
|
443
|
+
|
|
440
444
|
repo_source = ""; source_link = None
|
|
441
445
|
if repo["fork"] or repo["mirror"]:
|
|
442
446
|
if repo["fork"]: source_type = "fork"; source_url = repo["fork"]
|
|
@@ -457,15 +461,14 @@ class NomadNetworkNode():
|
|
|
457
461
|
source_link = f"{mu_link}"
|
|
458
462
|
except Exception as e: source_link = ""
|
|
459
463
|
|
|
464
|
+
synced_ago = max(0, time.time()-self.owner.last_upstream_sync(repo["path"]))
|
|
465
|
+
sync_time = RNS.prettytime(synced_ago, compact=True).split(" ")[0]
|
|
466
|
+
sync_str = f" `*{self.CLR_DIM_H}synced {sync_time} ago`f`*\n"
|
|
460
467
|
source_desc = f"{source_type}ed from"
|
|
461
468
|
source_indent = " "*(len(f"Node / {group_name} / {repo_name}")-len(source_desc))
|
|
462
469
|
if source_link: source_url = source_link
|
|
463
|
-
nav_parts.append(f"{self.CLR_DIM}{source_desc.capitalize()}{source_indent} {source_url}`f\n")
|
|
470
|
+
nav_parts.append(f"{self.CLR_DIM}{source_desc.capitalize()}{source_indent} {source_url}`f{sync_str}\n")
|
|
464
471
|
|
|
465
|
-
if not repo:
|
|
466
|
-
content = self.m_heading("Not Found", 1) + "\nThe requested repository was not found.\n"
|
|
467
|
-
return self.render_template(content, nav_content="".join(nav_parts), st=st)
|
|
468
|
-
|
|
469
472
|
description = self.get_repository_description(repo["path"])
|
|
470
473
|
if description: description = f"{description}\n\n"
|
|
471
474
|
else: description = ""
|
|
@@ -702,6 +705,7 @@ class NomadNetworkNode():
|
|
|
702
705
|
content = self.m_heading("Invalid Path", 1) + "\n\nNo file path specified.\n"
|
|
703
706
|
return self.render_template(content, st=st)
|
|
704
707
|
|
|
708
|
+
file_path = file_path.lstrip("./").replace("/./", "/")
|
|
705
709
|
file_ext = os.path.splitext(file_path)[1].lower()
|
|
706
710
|
renderable = file_ext in self.RENDERABLE_EXTS
|
|
707
711
|
if not renderable: raw = True; render = False
|
|
@@ -2571,7 +2575,7 @@ class NomadNetworkNode():
|
|
|
2571
2575
|
first = str(labels[0])[:12]
|
|
2572
2576
|
last = str(labels[-1])[:12]
|
|
2573
2577
|
mid_space = len(bottom) - len(first) - len(last)
|
|
2574
|
-
lines.append(f"{self.CLR_DIM}{first}{
|
|
2578
|
+
lines.append(f"{self.CLR_DIM}{first}{' ' * mid_space}{last}`f\n")
|
|
2575
2579
|
|
|
2576
2580
|
return "".join(lines)
|
|
2577
2581
|
|