cloudx-proxy 0.3.4__tar.gz → 0.3.5__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 (22) hide show
  1. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/CHANGELOG.md +7 -0
  2. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/PKG-INFO +1 -1
  3. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy/_version.py +2 -2
  4. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy/setup.py +81 -33
  5. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy.egg-info/PKG-INFO +1 -1
  6. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/.github/workflows/release.yml +0 -0
  7. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/.gitignore +0 -0
  8. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/.releaserc +0 -0
  9. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/CONTRIBUTING.md +0 -0
  10. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/LICENSE +0 -0
  11. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/README.md +0 -0
  12. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy/__init__.py +0 -0
  13. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy/cli.py +0 -0
  14. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy/core.py +0 -0
  15. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy.egg-info/SOURCES.txt +0 -0
  16. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy.egg-info/dependency_links.txt +0 -0
  17. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy.egg-info/entry_points.txt +0 -0
  18. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy.egg-info/requires.txt +0 -0
  19. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/cloudx_proxy.egg-info/top_level.txt +0 -0
  20. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/package.json +0 -0
  21. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/pyproject.toml +0 -0
  22. {cloudx_proxy-0.3.4 → cloudx_proxy-0.3.5}/setup.cfg +0 -0
@@ -1,3 +1,10 @@
1
+ ## [0.3.5](https://github.com/easytocloud/cloudX-proxy/compare/v0.3.4...v0.3.5) (2025-02-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * repaired 1Password integration and ssh perms ([69f6a24](https://github.com/easytocloud/cloudX-proxy/commit/69f6a249c941044c4dc689c787c12c1a0d0e093a))
7
+
1
8
  ## [0.3.4](https://github.com/easytocloud/cloudX-proxy/compare/v0.3.3...v0.3.4) (2025-02-09)
2
9
 
3
10
  ## [0.3.3](https://github.com/easytocloud/cloudX-proxy/compare/v0.3.2...v0.3.3) (2025-02-09)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cloudx-proxy
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: SSH proxy command to connect VSCode with Cloud9/CloudX instance using AWS Systems Manager
5
5
  Author-email: easytocloud <info@easytocloud.com>
6
6
  License: MIT License
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.3.4'
16
- __version_tuple__ = version_tuple = (0, 3, 4)
15
+ __version__ = version = '0.3.5'
16
+ __version_tuple__ = version_tuple = (0, 3, 5)
@@ -2,6 +2,7 @@ import os
2
2
  import time
3
3
  import json
4
4
  import subprocess
5
+ import platform
5
6
  from pathlib import Path
6
7
  from typing import Optional, Tuple
7
8
  import boto3
@@ -142,16 +143,17 @@ class CloudXSetup:
142
143
 
143
144
  if key_exists:
144
145
  self.print_status(f"SSH key '{self.ssh_key}' exists", True, 2)
145
- self.using_1password = self.prompt("Would you like to use 1Password SSH agent?", "N").lower() == 'y'
146
- if self.using_1password:
147
- self.print_status("Using 1Password SSH agent", True, 2)
148
- else:
149
- store_in_1password = self.prompt("Would you like to store the private key in 1Password?", "N").lower() == 'y'
150
- if store_in_1password:
151
- if self._store_key_in_1password():
152
- self.print_status("Private key stored in 1Password", True, 2)
153
- else:
154
- self.print_status("Failed to store private key in 1Password", False, 2)
146
+ if platform.system() != 'Windows':
147
+ self.using_1password = self.prompt("Would you like to use 1Password SSH agent?", "N").lower() == 'y'
148
+ if self.using_1password:
149
+ self.print_status("Using 1Password SSH agent", True, 2)
150
+ else:
151
+ store_in_1password = self.prompt("Would you like to store the private key in 1Password?", "N").lower() == 'y'
152
+ if store_in_1password:
153
+ if self._store_key_in_1password():
154
+ self.print_status("Private key stored in 1Password", True, 2)
155
+ else:
156
+ self.print_status("Failed to store private key in 1Password", False, 2)
155
157
  else:
156
158
  self.print_status(f"Generating new SSH key '{self.ssh_key}'...", None, 2)
157
159
  subprocess.run([
@@ -162,16 +164,17 @@ class CloudXSetup:
162
164
  ], check=True)
163
165
  self.print_status("SSH key generated", True, 2)
164
166
 
165
- self.using_1password = self.prompt("Would you like to use 1Password SSH agent?", "N").lower() == 'y'
166
- if self.using_1password:
167
- self.print_status("Using 1Password SSH agent", True, 2)
168
- else:
169
- store_in_1password = self.prompt("Would you like to store the private key in 1Password?", "N").lower() == 'y'
170
- if store_in_1password:
171
- if self._store_key_in_1password():
172
- self.print_status("Private key stored in 1Password", True, 2)
173
- else:
174
- self.print_status("Failed to store private key in 1Password", False, 2)
167
+ if platform.system() != 'Windows':
168
+ self.using_1password = self.prompt("Would you like to use 1Password SSH agent?", "N").lower() == 'y'
169
+ if self.using_1password:
170
+ self.print_status("Using 1Password SSH agent", True, 2)
171
+ else:
172
+ store_in_1password = self.prompt("Would you like to store the private key in 1Password?", "N").lower() == 'y'
173
+ if store_in_1password:
174
+ if self._store_key_in_1password():
175
+ self.print_status("Private key stored in 1Password", True, 2)
176
+ else:
177
+ self.print_status("Failed to store private key in 1Password", False, 2)
175
178
 
176
179
  return True
177
180
 
@@ -184,20 +187,51 @@ class CloudXSetup:
184
187
  return False
185
188
 
186
189
  def _store_key_in_1password(self) -> bool:
187
- """Store SSH private key in 1Password.
190
+ """Store SSH private key in 1Password and configure SSH agent.
188
191
 
189
192
  Returns:
190
193
  bool: True if key was stored successfully
191
194
  """
192
195
  try:
196
+ # Check if 1Password CLI is available
193
197
  subprocess.run(['op', '--version'], check=True, capture_output=True)
194
- print("Storing private key in 1Password...")
195
- subprocess.run([
196
- 'op', 'document', 'create',
197
- str(self.ssh_key_file),
198
- '--title', f'cloudx-proxy SSH Key - {self.ssh_key}'
199
- ], check=True)
200
- return True
198
+
199
+ # Check if 1Password SSH agent is running
200
+ agent_sock = Path.home() / ".1password" / "agent.sock"
201
+ if platform.system() == 'Darwin':
202
+ agent_sock = Path.home() / "Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
203
+
204
+ if not agent_sock.exists():
205
+ self.print_status("1Password SSH agent not running. Please enable it in 1Password settings.", False, 2)
206
+ return False
207
+
208
+ print("Adding SSH key to 1Password SSH agent...")
209
+ try:
210
+ # First try to add to SSH agent
211
+ subprocess.run([
212
+ 'op', 'ssh-add',
213
+ '--name', f'cloudx-proxy-{self.ssh_key}',
214
+ str(self.ssh_key_file)
215
+ ], check=True)
216
+
217
+ # Read private key content before removing
218
+ with open(self.ssh_key_file, 'r') as f:
219
+ private_key = f.read()
220
+
221
+ # Store private key in 1Password as document for backup
222
+ subprocess.run([
223
+ 'op', 'document', 'create',
224
+ '--title', f'cloudx-proxy SSH Key - {self.ssh_key}',
225
+ ], input=private_key.encode(), check=True)
226
+
227
+ # Remove private key file but keep public key
228
+ os.remove(self.ssh_key_file)
229
+ self.print_status("Private key added to 1Password SSH agent and removed from disk", True, 2)
230
+ self.print_status("Backup copy stored in 1Password documents", True, 2)
231
+ return True
232
+ except subprocess.CalledProcessError as e:
233
+ self.print_status(f"Failed to add key to SSH agent: {e}", False, 2)
234
+ return False
201
235
  except subprocess.CalledProcessError:
202
236
  print("Error: 1Password CLI not installed or not signed in.")
203
237
  return False
@@ -229,13 +263,19 @@ Host cloudx-{cloudx_env}-{hostname}
229
263
  HostName {instance_id}
230
264
  User ec2-user
231
265
  """
232
- if self.using_1password:
233
- host_entry += f""" IdentityAgent ~/.1password/agent.sock
266
+ if self.using_1password and platform.system() != 'Windows':
267
+ # Use platform-specific agent socket path
268
+ if platform.system() == 'Darwin': # macOS
269
+ agent_sock = "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
270
+ else: # Linux
271
+ agent_sock = "~/.1password/agent.sock"
272
+ host_entry += f""" IdentityAgent {agent_sock}
234
273
  IdentityFile {self.ssh_key_file}.pub
235
274
  IdentitiesOnly yes
236
275
  """
237
276
  else:
238
277
  host_entry += f""" IdentityFile {self.ssh_key_file}
278
+ IdentitiesOnly yes
239
279
  """
240
280
  host_entry += f""" ProxyCommand {proxy_command}
241
281
  """
@@ -343,14 +383,22 @@ Host cloudx-{cloudx_env}-{hostname}
343
383
  Host cloudx-{cloudx_env}-*
344
384
  User ec2-user
345
385
  """
346
- # Add 1Password or standard key configuration
347
- if self.using_1password:
348
- base_config += f""" IdentityAgent ~/.1password/agent.sock
386
+ # Add key configuration
387
+ if self.using_1password and platform.system() != 'Windows':
388
+ # Use platform-specific agent socket path
389
+ if platform.system() == 'Darwin': # macOS
390
+ agent_sock = "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
391
+ else: # Linux
392
+ agent_sock = "~/.1password/agent.sock"
393
+ base_config += f""" IdentityAgent {agent_sock}
349
394
  IdentityFile {self.ssh_key_file}.pub
350
395
  IdentitiesOnly yes
396
+
351
397
  """
352
398
  else:
353
399
  base_config += f""" IdentityFile {self.ssh_key_file}
400
+ IdentitiesOnly yes
401
+
354
402
  """
355
403
  # Add ProxyCommand
356
404
  base_config += f""" ProxyCommand {proxy_command}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cloudx-proxy
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: SSH proxy command to connect VSCode with Cloud9/CloudX instance using AWS Systems Manager
5
5
  Author-email: easytocloud <info@easytocloud.com>
6
6
  License: MIT License
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes