unitlab 2.3.10__tar.gz → 2.3.12__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.10/src/unitlab.egg-info → unitlab-2.3.12}/PKG-INFO +1 -1
- {unitlab-2.3.10 → unitlab-2.3.12}/setup.py +1 -1
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/binary_manager.py +23 -6
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/client.py +8 -5
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/cloudflare_api_tunnel.py +25 -2
- {unitlab-2.3.10 → unitlab-2.3.12/src/unitlab.egg-info}/PKG-INFO +1 -1
- {unitlab-2.3.10 → unitlab-2.3.12}/LICENSE.md +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/README.md +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/setup.cfg +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/__init__.py +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/__main__.py +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/exceptions.py +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/main.py +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/tunnel_config.py +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/tunnel_service_token.py +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab/utils.py +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab.egg-info/SOURCES.txt +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab.egg-info/dependency_links.txt +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab.egg-info/entry_points.txt +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab.egg-info/requires.txt +0 -0
- {unitlab-2.3.10 → unitlab-2.3.12}/src/unitlab.egg-info/top_level.txt +0 -0
@@ -89,6 +89,12 @@ class CloudflaredBinaryManager:
|
|
89
89
|
|
90
90
|
def _download_binary(self, info, target_path):
|
91
91
|
"""Download and verify binary"""
|
92
|
+
|
93
|
+
# Create SSL context to handle certificate issues
|
94
|
+
import ssl
|
95
|
+
ssl_context = ssl.create_default_context()
|
96
|
+
ssl_context.check_hostname = False
|
97
|
+
ssl_context.verify_mode = ssl.CERT_NONE
|
92
98
|
|
93
99
|
# Download with progress bar
|
94
100
|
def download_progress(block_num, block_size, total_size):
|
@@ -102,12 +108,23 @@ class CloudflaredBinaryManager:
|
|
102
108
|
temp_file = target_path.with_suffix('.tmp')
|
103
109
|
|
104
110
|
try:
|
105
|
-
# Download file
|
106
|
-
urllib.request.
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
+
# Download file with SSL context
|
112
|
+
req = urllib.request.Request(info['url'], headers={'User-Agent': 'Mozilla/5.0'})
|
113
|
+
with urllib.request.urlopen(req, context=ssl_context) as response:
|
114
|
+
total_size = int(response.headers.get('Content-Length', 0))
|
115
|
+
|
116
|
+
with open(temp_file, 'wb') as f:
|
117
|
+
downloaded = 0
|
118
|
+
block_size = 8192
|
119
|
+
while True:
|
120
|
+
chunk = response.read(block_size)
|
121
|
+
if not chunk:
|
122
|
+
break
|
123
|
+
f.write(chunk)
|
124
|
+
downloaded += len(chunk)
|
125
|
+
if total_size > 0:
|
126
|
+
percent = min(downloaded * 100 / total_size, 100)
|
127
|
+
print(f"Downloading: {percent:.0f}%", end='\r')
|
111
128
|
print("\n✓ Download complete")
|
112
129
|
|
113
130
|
# Handle compressed files (macOS .tgz)
|
@@ -354,14 +354,17 @@ class UnitlabClient:
|
|
354
354
|
try:
|
355
355
|
logger.info("Starting Jupyter notebook...")
|
356
356
|
|
357
|
+
# Use NotebookApp for jupyter notebook (not jupyter-server)
|
357
358
|
cmd = [
|
358
359
|
"jupyter", "notebook",
|
359
360
|
"--no-browser",
|
360
|
-
"--
|
361
|
-
"--
|
362
|
-
"--
|
363
|
-
"--
|
364
|
-
"--
|
361
|
+
"--NotebookApp.token=''",
|
362
|
+
"--NotebookApp.password=''",
|
363
|
+
"--NotebookApp.allow_origin='*'",
|
364
|
+
"--NotebookApp.ip='0.0.0.0'", # Listen on all interfaces
|
365
|
+
"--NotebookApp.port=8888",
|
366
|
+
"--NotebookApp.allow_root=True", # Allow root if needed
|
367
|
+
"--NotebookApp.disable_check_xsrf=True" # For Cloudflare proxy
|
365
368
|
]
|
366
369
|
|
367
370
|
self.jupyter_proc = subprocess.Popen(
|
@@ -297,6 +297,12 @@ class CloudflareAPITunnel:
|
|
297
297
|
# Direct download fallback - simplified version
|
298
298
|
import platform
|
299
299
|
import urllib.request
|
300
|
+
import ssl
|
301
|
+
|
302
|
+
# Create SSL context that handles certificate issues
|
303
|
+
ssl_context = ssl.create_default_context()
|
304
|
+
ssl_context.check_hostname = False
|
305
|
+
ssl_context.verify_mode = ssl.CERT_NONE
|
300
306
|
|
301
307
|
cache_dir = Path.home() / '.unitlab' / 'bin'
|
302
308
|
cache_dir.mkdir(parents=True, exist_ok=True)
|
@@ -331,8 +337,25 @@ class CloudflareAPITunnel:
|
|
331
337
|
raise RuntimeError(f"Unsupported platform: {system}")
|
332
338
|
|
333
339
|
try:
|
334
|
-
# Download the file
|
335
|
-
urllib.request.
|
340
|
+
# Download the file with SSL context
|
341
|
+
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
|
342
|
+
|
343
|
+
# Special handling for macOS .tgz files
|
344
|
+
if system == 'darwin':
|
345
|
+
import tarfile
|
346
|
+
import io
|
347
|
+
|
348
|
+
with urllib.request.urlopen(req, context=ssl_context) as response:
|
349
|
+
data = response.read()
|
350
|
+
|
351
|
+
# Extract from tar.gz
|
352
|
+
with tarfile.open(fileobj=io.BytesIO(data), mode='r:gz') as tar:
|
353
|
+
tar.extract('cloudflared', cache_dir)
|
354
|
+
else:
|
355
|
+
# Direct binary download for Linux/Windows
|
356
|
+
with urllib.request.urlopen(req, context=ssl_context) as response:
|
357
|
+
with open(cloudflared_path, 'wb') as out_file:
|
358
|
+
out_file.write(response.read())
|
336
359
|
|
337
360
|
# Make executable on Unix
|
338
361
|
if system != 'windows':
|
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
|