unitlab 2.3.32__tar.gz → 2.3.33__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 (28) hide show
  1. {unitlab-2.3.32/src/unitlab.egg-info → unitlab-2.3.33}/PKG-INFO +1 -1
  2. {unitlab-2.3.32 → unitlab-2.3.33}/setup.py +1 -1
  3. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/main.py +5 -16
  4. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/persistent_tunnel.py +8 -12
  5. {unitlab-2.3.32 → unitlab-2.3.33/src/unitlab.egg-info}/PKG-INFO +1 -1
  6. {unitlab-2.3.32 → unitlab-2.3.33}/LICENSE.md +0 -0
  7. {unitlab-2.3.32 → unitlab-2.3.33}/README.md +0 -0
  8. {unitlab-2.3.32 → unitlab-2.3.33}/setup.cfg +0 -0
  9. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/__init__.py +0 -0
  10. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/__main__.py +0 -0
  11. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/api_tunnel.py +0 -0
  12. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/auto_tunnel.py +0 -0
  13. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/binary_manager.py +0 -0
  14. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/client.py +0 -0
  15. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/cloudflare_api_tunnel.py +0 -0
  16. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/cloudflare_api_tunnel_backup.py +0 -0
  17. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/dynamic_tunnel.py +0 -0
  18. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/easy_tunnel.py +0 -0
  19. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/exceptions.py +0 -0
  20. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/simple_tunnel.py +0 -0
  21. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/tunnel_config.py +0 -0
  22. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/tunnel_service_token.py +0 -0
  23. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/utils.py +0 -0
  24. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab.egg-info/SOURCES.txt +0 -0
  25. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab.egg-info/dependency_links.txt +0 -0
  26. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab.egg-info/entry_points.txt +0 -0
  27. {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab.egg-info/requires.txt +0 -0
  28. {unitlab-2.3.32 → unitlab-2.3.33}/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.32
3
+ Version: 2.3.33
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.32",
5
+ version="2.3.33",
6
6
  license="MIT",
7
7
  author="Unitlab Inc.",
8
8
  author_email="team@unitlab.ai",
@@ -151,22 +151,11 @@ def run_agent(
151
151
  # Try environment variable first
152
152
  device_id = os.getenv('DEVICE_ID')
153
153
  if not device_id:
154
- # Try to load saved device ID
155
- device_id_file = Path.home() / '.unitlab' / 'device_id'
156
- device_id_file.parent.mkdir(exist_ok=True, parents=True)
157
-
158
- if device_id_file.exists():
159
- device_id = device_id_file.read_text().strip()
160
- print(f"📌 Using saved device ID: {device_id}")
161
- else:
162
- # Generate a unique ID based on hostname and random UUID
163
- hostname = platform.node().replace('.', '-').replace(' ', '-')[:20]
164
- random_suffix = str(uuid.uuid4())[:8]
165
- device_id = f"{hostname}-{random_suffix}"
166
-
167
- # Save for future runs
168
- device_id_file.write_text(device_id)
169
- print(f"📝 Generated and saved device ID: {device_id}")
154
+ # Always generate a unique device ID (no saving/reusing)
155
+ hostname = platform.node().replace('.', '-').replace(' ', '-')[:20]
156
+ random_suffix = str(uuid.uuid4())[:8]
157
+ device_id = f"{hostname}-{random_suffix}"
158
+ print(f"📝 Generated unique device ID: {device_id}")
170
159
 
171
160
 
172
161
  # Create client and initialize device agent
@@ -84,18 +84,14 @@ class PersistentTunnel:
84
84
  print("✅ Found existing tunnel: {}".format(tunnel["id"]))
85
85
  self.tunnel_id = tunnel["id"]
86
86
 
87
- # For persistent device IDs, always recreate to ensure fresh state
88
- print("🔄 Recreating tunnel for persistent device...")
89
- delete_url = "https://api.cloudflare.com/client/v4/accounts/{}/cfd_tunnel/{}".format(
90
- self.cf_account_id, tunnel["id"]
91
- )
92
- del_resp = requests.delete(delete_url, headers=headers)
93
- if del_resp.status_code in [200, 204]:
94
- print("✅ Deleted old tunnel")
95
- time.sleep(2)
96
- else:
97
- print("⚠️ Could not delete old tunnel, trying to create new one anyway")
98
- break
87
+ # Tunnel exists, create a new one with unique name
88
+ print("⚠️ Tunnel with this name already exists")
89
+ import uuid
90
+ unique_suffix = str(uuid.uuid4())[:8]
91
+ self.tunnel_name = "agent-{}-{}".format(self.device_id, unique_suffix)
92
+ print("🔄 Creating new tunnel with unique name: {}".format(self.tunnel_name))
93
+ # Don't break, let it continue to create new tunnel
94
+ return self.create_new_tunnel()
99
95
 
100
96
  # Create new tunnel
101
97
  return self.create_new_tunnel()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unitlab
3
- Version: 2.3.32
3
+ Version: 2.3.33
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