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.
- {unitlab-2.3.32/src/unitlab.egg-info → unitlab-2.3.33}/PKG-INFO +1 -1
- {unitlab-2.3.32 → unitlab-2.3.33}/setup.py +1 -1
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/main.py +5 -16
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/persistent_tunnel.py +8 -12
- {unitlab-2.3.32 → unitlab-2.3.33/src/unitlab.egg-info}/PKG-INFO +1 -1
- {unitlab-2.3.32 → unitlab-2.3.33}/LICENSE.md +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/README.md +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/setup.cfg +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/__init__.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/__main__.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/api_tunnel.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/auto_tunnel.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/binary_manager.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/client.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/cloudflare_api_tunnel.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/cloudflare_api_tunnel_backup.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/dynamic_tunnel.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/easy_tunnel.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/exceptions.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/simple_tunnel.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/tunnel_config.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/tunnel_service_token.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab/utils.py +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab.egg-info/SOURCES.txt +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab.egg-info/dependency_links.txt +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab.egg-info/entry_points.txt +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab.egg-info/requires.txt +0 -0
- {unitlab-2.3.32 → unitlab-2.3.33}/src/unitlab.egg-info/top_level.txt +0 -0
@@ -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
|
-
#
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
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
|
-
#
|
88
|
-
print("
|
89
|
-
|
90
|
-
|
91
|
-
)
|
92
|
-
|
93
|
-
|
94
|
-
|
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()
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|