cloudx-proxy 0.3.12__tar.gz → 0.3.13__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.
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/CHANGELOG.md +7 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/PKG-INFO +1 -1
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy/_version.py +9 -4
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy/setup.py +55 -1
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy.egg-info/PKG-INFO +1 -1
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/.github/workflows/release.yml +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/.gitignore +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/.releaserc +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/CONTRIBUTING.md +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/LICENSE +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/README.md +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy/__init__.py +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy/cli.py +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy/core.py +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy.egg-info/SOURCES.txt +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy.egg-info/dependency_links.txt +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy.egg-info/entry_points.txt +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy.egg-info/requires.txt +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/cloudx_proxy.egg-info/top_level.txt +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/package.json +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/pyproject.toml +0 -0
- {cloudx_proxy-0.3.12 → cloudx_proxy-0.3.13}/setup.cfg +0 -0
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.3.13](https://github.com/easytocloud/cloudX-proxy/compare/v0.3.12...v0.3.13) (2025-03-06)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* create more stable ssh connection ([606f196](https://github.com/easytocloud/cloudX-proxy/commit/606f196e10b5c3237ea07e45ef80cacdd36af12b))
|
7
|
+
|
1
8
|
## [0.3.12](https://github.com/easytocloud/cloudX-proxy/compare/v0.3.11...v0.3.12) (2025-02-14)
|
2
9
|
|
3
10
|
|
@@ -1,8 +1,13 @@
|
|
1
|
-
# file generated by
|
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
|
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.
|
16
|
-
__version_tuple__ = version_tuple = (0, 3,
|
20
|
+
__version__ = version = '0.3.13'
|
21
|
+
__version_tuple__ = version_tuple = (0, 3, 13)
|
@@ -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
|
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}
|
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
|