akashcli 4.5.1__tar.gz → 4.5.2__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.
- {akashcli-4.5.1 → akashcli-4.5.2}/PKG-INFO +1 -1
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/relay.py +20 -6
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli.egg-info/PKG-INFO +1 -1
- {akashcli-4.5.1 → akashcli-4.5.2}/pyproject.toml +1 -1
- {akashcli-4.5.1 → akashcli-4.5.2}/README.md +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/__init__.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/auth.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/cli.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/client.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/config.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/crypto.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/env_manager.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/exceptions.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/exec.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/integrity.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/logger.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/models.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/p2p.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/packages.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/restore.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/snapshot_crypto.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/storage.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/terminal.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/uploader.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli/utils.py +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli.egg-info/SOURCES.txt +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli.egg-info/dependency_links.txt +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli.egg-info/entry_points.txt +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli.egg-info/requires.txt +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/akashcli.egg-info/top_level.txt +0 -0
- {akashcli-4.5.1 → akashcli-4.5.2}/setup.cfg +0 -0
|
@@ -558,17 +558,31 @@ def guest_serve(base_url: str) -> None:
|
|
|
558
558
|
Security: every incoming connection shows the guest IP + fingerprint
|
|
559
559
|
and asks the host to approve before the shell is bridged.
|
|
560
560
|
"""
|
|
561
|
-
import httpx
|
|
562
561
|
import websockets.sync.client as _ws
|
|
563
562
|
|
|
564
|
-
# 1. Get a pairing code
|
|
563
|
+
# 1. Get a pairing code — try httpx first, fall back to urllib (system certs)
|
|
564
|
+
def _post_code(url: str) -> dict:
|
|
565
|
+
try:
|
|
566
|
+
import httpx as _hx
|
|
567
|
+
r = _hx.post(url, timeout=10)
|
|
568
|
+
r.raise_for_status()
|
|
569
|
+
return r.json()
|
|
570
|
+
except Exception:
|
|
571
|
+
pass
|
|
572
|
+
# urllib fallback — uses system CA bundle, works on Android/Termux
|
|
573
|
+
import urllib.request as _ur, urllib.error as _ue
|
|
574
|
+
req = _ur.Request(url, data=b"", method="POST")
|
|
575
|
+
with _ur.urlopen(req, timeout=10) as resp:
|
|
576
|
+
import json as _j
|
|
577
|
+
return _j.loads(resp.read())
|
|
578
|
+
|
|
565
579
|
try:
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
ttl = r.json().get("expires_in", 600)
|
|
580
|
+
data = _post_code(_guest_code_url(base_url))
|
|
581
|
+
code = data["code"]
|
|
582
|
+
ttl = data.get("expires_in", 600)
|
|
570
583
|
except Exception as e:
|
|
571
584
|
print(f" {_R}✗{_RS} could not get pairing code: {e}", file=sys.stderr)
|
|
585
|
+
print(f" {_DM}Make sure you can reach {base_url}{_RS}", file=sys.stderr)
|
|
572
586
|
return
|
|
573
587
|
|
|
574
588
|
print()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|