unitlab 2.3.14__tar.gz → 2.3.15__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.14/src/unitlab.egg-info → unitlab-2.3.15}/PKG-INFO +1 -1
- {unitlab-2.3.14 → unitlab-2.3.15}/setup.py +1 -1
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/main.py +18 -4
- {unitlab-2.3.14 → unitlab-2.3.15/src/unitlab.egg-info}/PKG-INFO +1 -1
- {unitlab-2.3.14 → unitlab-2.3.15}/LICENSE.md +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/README.md +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/setup.cfg +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/__init__.py +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/__main__.py +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/binary_manager.py +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/client.py +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/cloudflare_api_tunnel.py +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/exceptions.py +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/tunnel_config.py +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/tunnel_service_token.py +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab/utils.py +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab.egg-info/SOURCES.txt +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab.egg-info/dependency_links.txt +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab.egg-info/entry_points.txt +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab.egg-info/requires.txt +0 -0
- {unitlab-2.3.14 → unitlab-2.3.15}/src/unitlab.egg-info/top_level.txt +0 -0
@@ -146,13 +146,27 @@ def run_agent(
|
|
146
146
|
if not device_id:
|
147
147
|
import uuid
|
148
148
|
import platform
|
149
|
+
from pathlib import Path
|
150
|
+
|
149
151
|
# Try environment variable first
|
150
152
|
device_id = os.getenv('DEVICE_ID')
|
151
153
|
if not device_id:
|
152
|
-
#
|
153
|
-
|
154
|
-
|
155
|
-
|
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}")
|
156
170
|
|
157
171
|
|
158
172
|
# Create client and initialize device agent
|
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
|