unitlab 2.3.36__tar.gz → 2.3.37__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unitlab
3
- Version: 2.3.36
3
+ Version: 2.3.37
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.36",
5
+ version="2.3.37",
6
6
  license="MIT",
7
7
  author="Unitlab Inc.",
8
8
  author_email="team@unitlab.ai",
@@ -32,8 +32,7 @@ class PersistentTunnel:
32
32
  # Cloudflare credentials (hardcoded for simplicity)
33
33
 
34
34
  self.cf_api_key = "RoIAn1t9rMqcGK7_Xja216pxbRTyFafC1jeRKIO3"
35
-
36
- # Account and Zone IDs
35
+
37
36
  self.cf_account_id = "29df28cf48a30be3b1aa344b840400e6" # Your account ID
38
37
  self.cf_zone_id = "eae80a730730b3b218a80dace996535a" # Zone ID for unitlab-ai.com
39
38
 
@@ -201,9 +200,25 @@ class PersistentTunnel:
201
200
  if ssh_response.status_code in [200, 201]:
202
201
  print("✅ SSH DNS record created: {}.{}".format(self.ssh_subdomain, self.domain))
203
202
  elif "already exists" in ssh_response.text:
204
- print("⚠️ SSH DNS record already exists: {}.{}".format(self.ssh_subdomain, self.domain))
203
+ print("⚠️ SSH DNS record already exists, deleting and recreating...")
204
+ # Delete the old record and create new one
205
+ list_url = "{}?name={}.{}".format(url, self.ssh_subdomain, self.domain)
206
+ list_response = requests.get(list_url, headers=headers)
207
+ if list_response.status_code == 200:
208
+ records = list_response.json().get("result", [])
209
+ if records:
210
+ record_id = records[0]["id"]
211
+ delete_url = "{}/{}".format(url, record_id)
212
+ requests.delete(delete_url, headers=headers)
213
+ print("Deleted old SSH DNS record")
214
+ # Try again
215
+ ssh_response = requests.post(url, headers=headers, json=ssh_data)
216
+ if ssh_response.status_code in [200, 201]:
217
+ print("✅ SSH DNS record recreated: {}.{}".format(self.ssh_subdomain, self.domain))
218
+ else:
219
+ print("❌ Failed to recreate SSH DNS: {}".format(ssh_response.text[:200]))
205
220
  else:
206
- print("⚠️ Could not create SSH DNS: {}".format(ssh_response.text[:200]))
221
+ print("Could not create SSH DNS: {}".format(ssh_response.text[:200]))
207
222
  # SSH is optional, so we continue even if SSH DNS fails
208
223
 
209
224
  return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unitlab
3
- Version: 2.3.36
3
+ Version: 2.3.37
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