unitlab 2.3.27__tar.gz → 2.3.28__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.
Files changed (23) hide show
  1. {unitlab-2.3.27/src/unitlab.egg-info → unitlab-2.3.28}/PKG-INFO +1 -1
  2. {unitlab-2.3.27 → unitlab-2.3.28}/setup.py +1 -1
  3. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/simple_tunnel.py +48 -1
  4. {unitlab-2.3.27 → unitlab-2.3.28/src/unitlab.egg-info}/PKG-INFO +1 -1
  5. {unitlab-2.3.27 → unitlab-2.3.28}/LICENSE.md +0 -0
  6. {unitlab-2.3.27 → unitlab-2.3.28}/README.md +0 -0
  7. {unitlab-2.3.27 → unitlab-2.3.28}/setup.cfg +0 -0
  8. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/__init__.py +0 -0
  9. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/__main__.py +0 -0
  10. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/binary_manager.py +0 -0
  11. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/client.py +0 -0
  12. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/cloudflare_api_tunnel.py +0 -0
  13. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/cloudflare_api_tunnel_backup.py +0 -0
  14. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/exceptions.py +0 -0
  15. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/main.py +0 -0
  16. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/tunnel_config.py +0 -0
  17. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/tunnel_service_token.py +0 -0
  18. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab/utils.py +0 -0
  19. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab.egg-info/SOURCES.txt +0 -0
  20. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab.egg-info/dependency_links.txt +0 -0
  21. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab.egg-info/entry_points.txt +0 -0
  22. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab.egg-info/requires.txt +0 -0
  23. {unitlab-2.3.27 → unitlab-2.3.28}/src/unitlab.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unitlab
3
- Version: 2.3.27
3
+ Version: 2.3.28
4
4
  Home-page: https://github.com/teamunitlab/unitlab-sdk
5
5
  Author: Unitlab Inc.
6
6
  Author-email: team@unitlab.ai
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
4
  name="unitlab",
5
- version="2.3.27",
5
+ version="2.3.28",
6
6
  license="MIT",
7
7
  author="Unitlab Inc.",
8
8
  author_email="team@unitlab.ai",
@@ -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
- "cloudflared", # Use system cloudflared
117
+ cloudflared,
71
118
  "tunnel",
72
119
  "run",
73
120
  "--url", "http://127.0.0.1:{}".format(local_port),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unitlab
3
- Version: 2.3.27
3
+ Version: 2.3.28
4
4
  Home-page: https://github.com/teamunitlab/unitlab-sdk
5
5
  Author: Unitlab Inc.
6
6
  Author-email: team@unitlab.ai
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes