unitlab 2.3.27__py3-none-any.whl → 2.3.28__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/simple_tunnel.py +48 -1
- {unitlab-2.3.27.dist-info → unitlab-2.3.28.dist-info}/METADATA +1 -1
- {unitlab-2.3.27.dist-info → unitlab-2.3.28.dist-info}/RECORD +7 -7
- {unitlab-2.3.27.dist-info → unitlab-2.3.28.dist-info}/LICENSE.md +0 -0
- {unitlab-2.3.27.dist-info → unitlab-2.3.28.dist-info}/WHEEL +0 -0
- {unitlab-2.3.27.dist-info → unitlab-2.3.28.dist-info}/entry_points.txt +0 -0
- {unitlab-2.3.27.dist-info → unitlab-2.3.28.dist-info}/top_level.txt +0 -0
unitlab/simple_tunnel.py
CHANGED
@@ -61,13 +61,60 @@ class SimpleTunnel:
|
|
61
61
|
print("✅ Jupyter started on port {}".format(port))
|
62
62
|
return True
|
63
63
|
|
64
|
+
def get_cloudflared_path(self):
|
65
|
+
"""Get cloudflared binary, download if needed"""
|
66
|
+
import os
|
67
|
+
import platform
|
68
|
+
|
69
|
+
# Check if cloudflared exists in system
|
70
|
+
try:
|
71
|
+
import shutil
|
72
|
+
if shutil.which("cloudflared"):
|
73
|
+
print("✅ Using system cloudflared")
|
74
|
+
return "cloudflared"
|
75
|
+
except:
|
76
|
+
pass
|
77
|
+
|
78
|
+
# Check local binary
|
79
|
+
local_bin = os.path.expanduser("~/.local/bin/cloudflared")
|
80
|
+
if os.path.exists(local_bin):
|
81
|
+
print("✅ Using existing cloudflared from ~/.local/bin")
|
82
|
+
return local_bin
|
83
|
+
|
84
|
+
# Download it
|
85
|
+
print("📦 Downloading cloudflared (this may take a moment)...")
|
86
|
+
system = platform.system().lower()
|
87
|
+
if system == "linux":
|
88
|
+
arch = "amd64" if "x86" in platform.machine() else "arm64"
|
89
|
+
url = "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-{}".format(arch)
|
90
|
+
|
91
|
+
os.makedirs(os.path.expanduser("~/.local/bin"), exist_ok=True)
|
92
|
+
result = subprocess.run("curl -L {} -o {}".format(url, local_bin), shell=True, capture_output=True)
|
93
|
+
if result.returncode == 0:
|
94
|
+
subprocess.run("chmod +x {}".format(local_bin), shell=True)
|
95
|
+
print("✅ cloudflared downloaded successfully")
|
96
|
+
return local_bin
|
97
|
+
else:
|
98
|
+
print("❌ Failed to download cloudflared")
|
99
|
+
raise Exception("Could not download cloudflared")
|
100
|
+
|
101
|
+
raise Exception("Could not find or download cloudflared")
|
102
|
+
|
64
103
|
def start_tunnel(self, local_port=8888):
|
65
104
|
"""Start cloudflared tunnel - simple and direct"""
|
66
105
|
print("🔧 Starting Cloudflare tunnel...")
|
67
106
|
|
107
|
+
# Get cloudflared (downloads if needed)
|
108
|
+
try:
|
109
|
+
cloudflared = self.get_cloudflared_path()
|
110
|
+
except Exception as e:
|
111
|
+
print("⚠️ Error getting cloudflared: {}".format(e))
|
112
|
+
# Fallback - try to use system cloudflared anyway
|
113
|
+
cloudflared = "cloudflared"
|
114
|
+
|
68
115
|
# Simple command - just run the tunnel
|
69
116
|
cmd = [
|
70
|
-
|
117
|
+
cloudflared,
|
71
118
|
"tunnel",
|
72
119
|
"run",
|
73
120
|
"--url", "http://127.0.0.1:{}".format(local_port),
|
@@ -6,13 +6,13 @@ unitlab/cloudflare_api_tunnel.py,sha256=XgDOQ-ISNDAJOlbKp96inGix3An_eBnAQ2pORcGB
|
|
6
6
|
unitlab/cloudflare_api_tunnel_backup.py,sha256=dG5Vax0JqrF2i-zxAFB-kNGyVSFR01-ovalwuJELqpo,28489
|
7
7
|
unitlab/exceptions.py,sha256=68Tr6LreEzjQ3Vns8HAaWdtewtkNUJOvPazbf6NSnXU,950
|
8
8
|
unitlab/main.py,sha256=7gPZ_2n90sxDnq9oGZVKOkuifr-k7w2Tq3ZIldAUE8I,5877
|
9
|
-
unitlab/simple_tunnel.py,sha256=
|
9
|
+
unitlab/simple_tunnel.py,sha256=vWgVYFEbPoGCHmumujNrfBnDPuUCZgQJkVO3IvdygQA,6812
|
10
10
|
unitlab/tunnel_config.py,sha256=7CiAqasfg26YQfJYXapCBQPSoqw4jIx6yR64saybLLo,8312
|
11
11
|
unitlab/tunnel_service_token.py,sha256=ji96a4s4W2cFJrHZle0zBD85Ac_T862-gCKzBUomrxM,3125
|
12
12
|
unitlab/utils.py,sha256=83ekAxxfXecFTg76Z62BGDybC_skKJHYoLyawCD9wGM,1920
|
13
|
-
unitlab-2.3.
|
14
|
-
unitlab-2.3.
|
15
|
-
unitlab-2.3.
|
16
|
-
unitlab-2.3.
|
17
|
-
unitlab-2.3.
|
18
|
-
unitlab-2.3.
|
13
|
+
unitlab-2.3.28.dist-info/LICENSE.md,sha256=Gn7RRvByorAcAaM-WbyUpsgi5ED1-bKFFshbWfYYz2Y,1069
|
14
|
+
unitlab-2.3.28.dist-info/METADATA,sha256=Ig_y0Z7LQzzQkeE2NIKX6lq46EuKP1VVd1TqURBqfDI,844
|
15
|
+
unitlab-2.3.28.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
16
|
+
unitlab-2.3.28.dist-info/entry_points.txt,sha256=ig-PjKEqSCj3UTdyANgEi4tsAU84DyXdaOJ02NHX4bY,45
|
17
|
+
unitlab-2.3.28.dist-info/top_level.txt,sha256=Al4ZlTYE3fTJK2o6YLCDMH5_DjuQkffRBMxgmWbKaqQ,8
|
18
|
+
unitlab-2.3.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|