unitlab 2.3.35__py3-none-any.whl → 2.3.36__py3-none-any.whl
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/persistent_tunnel.py +11 -38
- {unitlab-2.3.35.dist-info → unitlab-2.3.36.dist-info}/METADATA +1 -1
- {unitlab-2.3.35.dist-info → unitlab-2.3.36.dist-info}/RECORD +7 -7
- {unitlab-2.3.35.dist-info → unitlab-2.3.36.dist-info}/WHEEL +0 -0
- {unitlab-2.3.35.dist-info → unitlab-2.3.36.dist-info}/entry_points.txt +0 -0
- {unitlab-2.3.35.dist-info → unitlab-2.3.36.dist-info}/licenses/LICENSE.md +0 -0
- {unitlab-2.3.35.dist-info → unitlab-2.3.36.dist-info}/top_level.txt +0 -0
unitlab/persistent_tunnel.py
CHANGED
@@ -487,34 +487,7 @@ class PersistentTunnel:
|
|
487
487
|
self.stop()
|
488
488
|
return False
|
489
489
|
|
490
|
-
|
491
|
-
"""Fallback to quick tunnel"""
|
492
|
-
print("🔧 Using quick tunnel (temporary URL)...")
|
493
|
-
|
494
|
-
# Start Jupyter first
|
495
|
-
self.start_jupyter()
|
496
|
-
|
497
|
-
# Start quick tunnel
|
498
|
-
cloudflared = self.get_cloudflared_path()
|
499
|
-
cmd = [cloudflared, "tunnel", "--url", "http://localhost:8888"]
|
500
|
-
|
501
|
-
self.tunnel_process = subprocess.Popen(
|
502
|
-
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True
|
503
|
-
)
|
504
|
-
|
505
|
-
# Get URL from output
|
506
|
-
for _ in range(30):
|
507
|
-
line = self.tunnel_process.stdout.readline()
|
508
|
-
if "trycloudflare.com" in line:
|
509
|
-
import re
|
510
|
-
match = re.search(r'https://[a-zA-Z0-9-]+\.trycloudflare\.com', line)
|
511
|
-
if match:
|
512
|
-
self.jupyter_url = match.group(0)
|
513
|
-
print("✅ Quick tunnel: {}".format(self.jupyter_url))
|
514
|
-
return True
|
515
|
-
time.sleep(0.5)
|
516
|
-
|
517
|
-
return False
|
490
|
+
|
518
491
|
|
519
492
|
def stop(self):
|
520
493
|
"""Stop everything"""
|
@@ -523,16 +496,16 @@ class PersistentTunnel:
|
|
523
496
|
if self.tunnel_process:
|
524
497
|
self.tunnel_process.terminate()
|
525
498
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
499
|
+
# # Optionally delete tunnel when stopping
|
500
|
+
# if self.tunnel_id:
|
501
|
+
# try:
|
502
|
+
# url = "https://api.cloudflare.com/client/v4/accounts/{}/cfd_tunnel/{}".format(
|
503
|
+
# self.cf_account_id, self.tunnel_id
|
504
|
+
# )
|
505
|
+
# requests.delete(url, headers=self._get_headers())
|
506
|
+
# print("🗑️ Tunnel deleted")
|
507
|
+
# except Exception:
|
508
|
+
# pass # Ignore cleanup errors
|
536
509
|
|
537
510
|
def run(self):
|
538
511
|
"""Run and keep alive"""
|
@@ -3,11 +3,11 @@ unitlab/__main__.py,sha256=6Hs2PV7EYc5Tid4g4OtcLXhqVHiNYTGzSBdoOnW2HXA,29
|
|
3
3
|
unitlab/client.py,sha256=wqREtDuYc5ixeloPEGm0hp1sdUtB59sB1bIJjBcO1y0,25983
|
4
4
|
unitlab/exceptions.py,sha256=68Tr6LreEzjQ3Vns8HAaWdtewtkNUJOvPazbf6NSnXU,950
|
5
5
|
unitlab/main.py,sha256=kazASmzhPaAcf9hsPZdewcry_vplsrRLfziPxKlPT70,4425
|
6
|
-
unitlab/persistent_tunnel.py,sha256=
|
6
|
+
unitlab/persistent_tunnel.py,sha256=MRbfdxfP8ceY-25zbVD-29W3U1rs7XcFHZDHoqBlkSU,22401
|
7
7
|
unitlab/utils.py,sha256=9gPRu-d6pbhSoVdll1GXe4eoz_uFYOSbYArFDQdlUZs,1922
|
8
|
-
unitlab-2.3.
|
9
|
-
unitlab-2.3.
|
10
|
-
unitlab-2.3.
|
11
|
-
unitlab-2.3.
|
12
|
-
unitlab-2.3.
|
13
|
-
unitlab-2.3.
|
8
|
+
unitlab-2.3.36.dist-info/licenses/LICENSE.md,sha256=Gn7RRvByorAcAaM-WbyUpsgi5ED1-bKFFshbWfYYz2Y,1069
|
9
|
+
unitlab-2.3.36.dist-info/METADATA,sha256=JgMYM-Z3mqgMcEEqCgS1AOwIOGFIBPXrzAu3mCAvJsY,1046
|
10
|
+
unitlab-2.3.36.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
11
|
+
unitlab-2.3.36.dist-info/entry_points.txt,sha256=ig-PjKEqSCj3UTdyANgEi4tsAU84DyXdaOJ02NHX4bY,45
|
12
|
+
unitlab-2.3.36.dist-info/top_level.txt,sha256=Al4ZlTYE3fTJK2o6YLCDMH5_DjuQkffRBMxgmWbKaqQ,8
|
13
|
+
unitlab-2.3.36.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|