unitlab 2.3.18__tar.gz → 2.3.20__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.
- {unitlab-2.3.18/src/unitlab.egg-info → unitlab-2.3.20}/PKG-INFO +1 -1
- {unitlab-2.3.18 → unitlab-2.3.20}/setup.py +1 -1
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/cloudflare_api_tunnel.py +34 -24
- {unitlab-2.3.18 → unitlab-2.3.20/src/unitlab.egg-info}/PKG-INFO +1 -1
- {unitlab-2.3.18 → unitlab-2.3.20}/LICENSE.md +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/README.md +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/setup.cfg +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/__init__.py +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/__main__.py +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/binary_manager.py +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/client.py +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/exceptions.py +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/main.py +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/tunnel_config.py +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/tunnel_service_token.py +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab/utils.py +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab.egg-info/SOURCES.txt +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab.egg-info/dependency_links.txt +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab.egg-info/entry_points.txt +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab.egg-info/requires.txt +0 -0
- {unitlab-2.3.18 → unitlab-2.3.20}/src/unitlab.egg-info/top_level.txt +0 -0
@@ -382,7 +382,6 @@ class CloudflareAPITunnel:
|
|
382
382
|
if delete_response.status_code in [200, 204, 404]:
|
383
383
|
print(f" ✅ Deleted old tunnel")
|
384
384
|
# Try creating a new one with a timestamp suffix
|
385
|
-
import time
|
386
385
|
self.clean_device_id = f"{self.device_id.replace(' ', '').replace('-', '').replace('.', '').replace('_', '')[:24]}-{int(time.time())}"
|
387
386
|
device_tunnel = self.create_device_tunnel(retry_on_fail=False)
|
388
387
|
if device_tunnel:
|
@@ -464,10 +463,11 @@ class CloudflareAPITunnel:
|
|
464
463
|
|
465
464
|
# If 404, tunnel doesn't exist or we don't have access
|
466
465
|
if token_response.status_code == 404:
|
467
|
-
print(f"🔄 Tunnel not accessible (404), will
|
468
|
-
# Mark for recreation
|
466
|
+
print(f"🔄 Tunnel not accessible (404), will recreate...")
|
467
|
+
# Mark for recreation and continue
|
469
468
|
device_tunnel['needs_recreation'] = True
|
470
|
-
|
469
|
+
# Set cmd to None to skip the rest of this block
|
470
|
+
cmd = None
|
471
471
|
else:
|
472
472
|
print(f" ℹ️ Token endpoint returned {token_response.status_code}")
|
473
473
|
print(f" This might mean the tunnel needs to be recreated manually")
|
@@ -496,27 +496,37 @@ class CloudflareAPITunnel:
|
|
496
496
|
tunnel_id
|
497
497
|
]
|
498
498
|
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
499
|
+
# Only start the tunnel if we have a valid command
|
500
|
+
if cmd:
|
501
|
+
self.tunnel_process = subprocess.Popen(
|
502
|
+
cmd,
|
503
|
+
stdout=subprocess.PIPE,
|
504
|
+
stderr=subprocess.STDOUT,
|
505
|
+
text=True,
|
506
|
+
bufsize=1
|
507
|
+
)
|
508
|
+
|
509
|
+
print("⏳ Waiting for tunnel to connect...")
|
510
|
+
time.sleep(5)
|
511
|
+
|
512
|
+
if self.tunnel_process.poll() is None:
|
513
|
+
print("✅ Tunnel is running!")
|
514
|
+
print(f"📌 Device ID: {self.clean_device_id}")
|
515
|
+
print(f"📌 Jupyter URL: {self.jupyter_url}")
|
516
|
+
print(f"📌 SSH hostname: {self.ssh_hostname}")
|
517
|
+
print(f"📌 SSH command: ssh -o ProxyCommand='cloudflared access ssh --hostname {self.ssh_hostname}' user@localhost")
|
518
|
+
return self.tunnel_process
|
519
|
+
else:
|
520
|
+
output = self.tunnel_process.stdout.read() if self.tunnel_process.stdout else ""
|
521
|
+
print(f"❌ Tunnel failed to start: {output}")
|
522
|
+
return None
|
517
523
|
else:
|
518
|
-
|
519
|
-
|
524
|
+
# If no cmd, it means we need to handle recreation or other error
|
525
|
+
if device_tunnel and device_tunnel.get('needs_recreation'):
|
526
|
+
# The recreation happens above before this point
|
527
|
+
print("❌ Failed to start tunnel after recreation attempt")
|
528
|
+
else:
|
529
|
+
print("❌ No valid command to start tunnel")
|
520
530
|
return None
|
521
531
|
|
522
532
|
except Exception as e:
|
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
|