cloudx-proxy 0.3.12__py3-none-any.whl → 0.3.13__py3-none-any.whl

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.
cloudx_proxy/_version.py CHANGED
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '0.3.12'
16
- __version_tuple__ = version_tuple = (0, 3, 12)
20
+ __version__ = version = '0.3.13'
21
+ __version_tuple__ = version_tuple = (0, 3, 13)
cloudx_proxy/setup.py CHANGED
@@ -210,6 +210,39 @@ Host cloudx-{cloudx_env}-{hostname}
210
210
  return True
211
211
  return False
212
212
 
213
+ def _ensure_control_dir(self) -> bool:
214
+ """Create SSH control directory with proper permissions.
215
+
216
+ Creates ~/.ssh/control directory with 700 permissions on Unix-like systems,
217
+ or appropriate permissions on Windows.
218
+
219
+ Returns:
220
+ bool: True if directory was created or exists with proper permissions
221
+ """
222
+ try:
223
+ # Create path based on platform
224
+ if platform.system() == 'Windows':
225
+ control_dir = Path(self.home_dir) / ".ssh" / "control"
226
+ else:
227
+ control_dir = Path(self.home_dir) / ".ssh" / "control"
228
+
229
+ # Create directory if it doesn't exist
230
+ if not control_dir.exists():
231
+ control_dir.mkdir(parents=True, exist_ok=True)
232
+ self.print_status(f"Created control directory: {control_dir}", True, 2)
233
+
234
+ # Set proper permissions on Unix-like systems
235
+ if platform.system() != 'Windows':
236
+ import stat
237
+ control_dir.chmod(stat.S_IRWXU) # 700 permissions (owner read/write/execute)
238
+ self.print_status("Set directory permissions to 700", True, 2)
239
+
240
+ return True
241
+
242
+ except Exception as e:
243
+ self.print_status(f"Error creating control directory: {str(e)}", False, 2)
244
+ return False
245
+
213
246
  def setup_ssh_config(self, cloudx_env: str, instance_id: str, hostname: str) -> bool:
214
247
  """Set up SSH config for the instance.
215
248
 
@@ -219,6 +252,7 @@ Host cloudx-{cloudx_env}-{hostname}
219
252
  - User and key configuration
220
253
  - 1Password SSH agent integration if selected
221
254
  - ProxyCommand using uvx cloudx-proxy with proper parameters
255
+ - SSH multiplexing configuration (ControlMaster, ControlPath, ControlPersist)
222
256
 
223
257
  2. For an existing environment:
224
258
  - Skips creating duplicate environment config
@@ -232,6 +266,10 @@ Host cloudx-{cloudx_env}-{hostname}
232
266
  IdentityAgent ~/.1password/agent.sock # If using 1Password
233
267
  IdentityFile ~/.ssh/vscode/key.pub # .pub for 1Password, no .pub otherwise
234
268
  IdentitiesOnly yes # If using 1Password
269
+ TCPKeepAlive yes
270
+ ControlMaster auto
271
+ ControlPath ~/.ssh/control/%r@%h:%p
272
+ ControlPersist 4h
235
273
  ProxyCommand uvx cloudx-proxy connect %h %p --profile profile --aws-env env
236
274
 
237
275
  # Host entries (added for each instance)
@@ -258,7 +296,7 @@ Host cloudx-{cloudx_env}-{hostname}
258
296
  if f"Host cloudx-{cloudx_env}-*" in current_config:
259
297
  self.print_status(f"Found existing config for cloudx-{cloudx_env}-*", True, 2)
260
298
  choice = self.prompt(
261
- "Would you like to (1) override the existing config or "
299
+ "Would you like to \n(1) override the existing config\n "
262
300
  "(2) add settings to the specific host entry?",
263
301
  "1"
264
302
  )
@@ -294,6 +332,10 @@ Host cloudx-{cloudx_env}-{hostname}
294
332
  if self.ssh_key != "vscode":
295
333
  proxy_command += f" --ssh-key {self.ssh_key}"
296
334
 
335
+ # Ensure control directory exists with proper permissions
336
+ if not self._ensure_control_dir():
337
+ return False
338
+
297
339
  # Build base configuration
298
340
  base_config = f"""# cloudx-proxy SSH Configuration
299
341
  Host cloudx-{cloudx_env}-*
@@ -303,6 +345,18 @@ Host cloudx-{cloudx_env}-*
303
345
  base_config += f""" IdentityFile {self.ssh_key_file}
304
346
  IdentitiesOnly yes
305
347
 
348
+ """
349
+ # Add SSH multiplexing configuration
350
+ control_path = "~/.ssh/control/%r@%h:%p"
351
+ if platform.system() == 'Windows':
352
+ # Use forward slashes for Windows as well, SSH client will handle conversion
353
+ control_path = "~/.ssh/control/%r@%h:%p"
354
+
355
+ base_config += f""" TCPKeepAlive yes
356
+ ControlMaster auto
357
+ ControlPath {control_path}
358
+ ControlPersist 4h
359
+
306
360
  """
307
361
  # Add ProxyCommand
308
362
  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.12
3
+ Version: 0.3.13
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
@@ -0,0 +1,11 @@
1
+ cloudx_proxy/__init__.py,sha256=ZZ2O_m9OFJm18AxMSuYJt4UjSuSqyJlYRaZMoets498,61
2
+ cloudx_proxy/_version.py,sha256=EwvT0-VckFIV9s9wWIrrcCCLDLz10Bn0_zRsokqxmZs,513
3
+ cloudx_proxy/cli.py,sha256=7wi00p5CUl0Dt8huMEkP85SWgA_vzcoCzch0wctvqHk,3488
4
+ cloudx_proxy/core.py,sha256=XQbVlPaqQQ352Ao_JJlN-PpqIdQtSBec0lNRB1s0JSk,7288
5
+ cloudx_proxy/setup.py,sha256=93elRbfBUCUJ9Yj8uyMki8FUyt7YZCNODICKqYDA1j0,20917
6
+ cloudx_proxy-0.3.13.dist-info/LICENSE,sha256=i7P2OR4zsJYsMWcCUDe_B9ZfGi9bU0K5I2nKfDrW_N8,1068
7
+ cloudx_proxy-0.3.13.dist-info/METADATA,sha256=Pr1JQOxTtIhjqHitm9ekmQjeBorMwKkMdAbpe2jehrY,14038
8
+ cloudx_proxy-0.3.13.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
9
+ cloudx_proxy-0.3.13.dist-info/entry_points.txt,sha256=HGt743N2lVlKd7O1qWq3C0aEHyS5PjPnxzDHh7hwtSg,54
10
+ cloudx_proxy-0.3.13.dist-info/top_level.txt,sha256=2wtEote1db21j-VvkCJFfT-dLlauuG5indjggYh3xDg,13
11
+ cloudx_proxy-0.3.13.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,11 +0,0 @@
1
- cloudx_proxy/__init__.py,sha256=ZZ2O_m9OFJm18AxMSuYJt4UjSuSqyJlYRaZMoets498,61
2
- cloudx_proxy/_version.py,sha256=KKAn9DIKrkf9v6mAp59Mf9qI6ZEjCmBhMjuc_1u5SFI,413
3
- cloudx_proxy/cli.py,sha256=7wi00p5CUl0Dt8huMEkP85SWgA_vzcoCzch0wctvqHk,3488
4
- cloudx_proxy/core.py,sha256=XQbVlPaqQQ352Ao_JJlN-PpqIdQtSBec0lNRB1s0JSk,7288
5
- cloudx_proxy/setup.py,sha256=GNgZcUnnJG7q7npUl4QW_4mWfJT0gKZ_i1fwmxj3pmI,18672
6
- cloudx_proxy-0.3.12.dist-info/LICENSE,sha256=i7P2OR4zsJYsMWcCUDe_B9ZfGi9bU0K5I2nKfDrW_N8,1068
7
- cloudx_proxy-0.3.12.dist-info/METADATA,sha256=_RhoHyOJKYPCixp2of61kt5qaYRCebFaQB89L2hlZ00,14038
8
- cloudx_proxy-0.3.12.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
- cloudx_proxy-0.3.12.dist-info/entry_points.txt,sha256=HGt743N2lVlKd7O1qWq3C0aEHyS5PjPnxzDHh7hwtSg,54
10
- cloudx_proxy-0.3.12.dist-info/top_level.txt,sha256=2wtEote1db21j-VvkCJFfT-dLlauuG5indjggYh3xDg,13
11
- cloudx_proxy-0.3.12.dist-info/RECORD,,