cloudx-proxy 0.4.2__tar.gz → 0.4.3__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.4.2 → cloudx_proxy-0.4.3}/CHANGELOG.md +7 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/PKG-INFO +47 -16
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/README.md +46 -15
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy/_version.py +2 -2
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy/setup.py +42 -35
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy.egg-info/PKG-INFO +47 -16
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/.github/workflows/release.yml +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/.gitignore +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/.releaserc +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/CONTRIBUTING.md +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/LICENSE +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy/_1password.py +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy/__init__.py +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy/cli.py +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy/core.py +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy.egg-info/SOURCES.txt +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy.egg-info/dependency_links.txt +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy.egg-info/entry_points.txt +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy.egg-info/requires.txt +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/cloudx_proxy.egg-info/top_level.txt +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/package.json +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/pyproject.toml +0 -0
- {cloudx_proxy-0.4.2 → cloudx_proxy-0.4.3}/setup.cfg +0 -0
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.4.3](https://github.com/easytocloud/cloudX-proxy/compare/v0.4.2...v0.4.3) (2025-03-06)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* improved documentation and simplified ssh config output ([5b5d9a4](https://github.com/easytocloud/cloudX-proxy/commit/5b5d9a496bcba440e4863e8285673e8f97d3c684))
|
7
|
+
|
1
8
|
## [0.4.2](https://github.com/easytocloud/cloudX-proxy/compare/v0.4.1...v0.4.2) (2025-03-06)
|
2
9
|
|
3
10
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: cloudx-proxy
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.3
|
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
|
@@ -112,6 +112,15 @@ uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
|
|
112
112
|
|
113
113
|
# Setup with AWS environment
|
114
114
|
uvx cloudx-proxy setup --aws-env prod
|
115
|
+
|
116
|
+
# Setup with custom SSH config location
|
117
|
+
uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config
|
118
|
+
|
119
|
+
# Setup with 1Password integration
|
120
|
+
uvx cloudx-proxy setup --1password
|
121
|
+
|
122
|
+
# Combine options
|
123
|
+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
|
115
124
|
```
|
116
125
|
|
117
126
|
The setup command will:
|
@@ -123,13 +132,16 @@ The setup command will:
|
|
123
132
|
|
124
133
|
2. Manage SSH Keys:
|
125
134
|
- Creates new SSH key pair if needed
|
126
|
-
-
|
127
|
-
* Using 1Password SSH agent
|
128
|
-
*
|
135
|
+
- Fully supports 1Password integration:
|
136
|
+
* Using 1Password SSH agent via `--1password` flag
|
137
|
+
* Creates keys directly in 1Password's secure vault
|
138
|
+
* Only public keys are exported to the filesystem
|
139
|
+
* Follows SSH best practices using public keys to limit authentication attempts
|
129
140
|
|
130
141
|
3. Configure SSH:
|
131
|
-
- Creates ~/.ssh/vscode/config
|
132
|
-
-
|
142
|
+
- Creates SSH configs with proper settings (default: ~/.ssh/vscode/config)
|
143
|
+
- Custom config location can be specified with `--ssh-config`
|
144
|
+
- Sets up optimized environment-specific configurations
|
133
145
|
- Configures ProxyCommand with all necessary parameters
|
134
146
|
- Ensures main ~/.ssh/config includes the configuration
|
135
147
|
|
@@ -150,12 +162,18 @@ Will create a configuration like this:
|
|
150
162
|
|
151
163
|
```
|
152
164
|
# Base environment config (created once per environment)
|
165
|
+
# Environment-wide configuration
|
153
166
|
Host cloudx-dev-*
|
154
167
|
User ec2-user
|
155
168
|
IdentityFile ~/.ssh/vscode/mykey
|
169
|
+
IdentitiesOnly yes
|
156
170
|
ProxyCommand uvx cloudx-proxy connect %h %p --profile myprofile --ssh-key mykey
|
171
|
+
TCPKeepAlive yes
|
172
|
+
ControlMaster auto
|
173
|
+
ControlPath ~/.ssh/control/%r@%h:%p
|
174
|
+
ControlPersist 4h
|
157
175
|
|
158
|
-
#
|
176
|
+
# Minimal host entry (inherits all settings from environment config)
|
159
177
|
Host cloudx-dev-myserver
|
160
178
|
HostName i-0123456789abcdef0
|
161
179
|
```
|
@@ -173,17 +191,19 @@ In these examples, ssh will use cloudx-proxy to connect to AWS with the `myprofi
|
|
173
191
|
VSCode will be able to connect to the instance using the same SSH configuration.
|
174
192
|
|
175
193
|
### SSH Configuration Details
|
176
|
-
The setup command creates:
|
194
|
+
The setup command creates an optimized SSH configuration structure:
|
177
195
|
|
178
196
|
1. A base configuration for each environment (cloudx-{env}-*) with:
|
179
197
|
- User and key settings
|
180
|
-
- 1Password integration if selected
|
198
|
+
- 1Password SSH agent integration if selected
|
181
199
|
- ProxyCommand with appropriate parameters
|
200
|
+
- SSH multiplexing for better performance
|
201
|
+
- TCP keepalive for connection stability
|
182
202
|
|
183
|
-
2.
|
203
|
+
2. Minimal host entries for each instance:
|
184
204
|
- Uses consistent naming (cloudx-{env}-hostname)
|
185
|
-
-
|
186
|
-
- Inherits environment-level settings
|
205
|
+
- Only contains the HostName directive for the instance ID
|
206
|
+
- Inherits all environment-level settings automatically
|
187
207
|
|
188
208
|
When adding new instances to an existing environment, you can choose to:
|
189
209
|
- Override the environment configuration with new settings
|
@@ -211,7 +231,9 @@ uvx cloudx-proxy setup [OPTIONS]
|
|
211
231
|
|
212
232
|
Options:
|
213
233
|
- `--profile` (default: vscode): AWS profile to use. The profile's IAM user should follow the format cloudX-{env}-{user}. The environment part will be used as the default environment during setup.
|
214
|
-
- `--ssh-key` (default: vscode): Name of the SSH key to create/use. The key will be stored in
|
234
|
+
- `--ssh-key` (default: vscode): Name of the SSH key to create/use. The key will be stored in the SSH config directory. This same name can be used in the connect command.
|
235
|
+
- `--ssh-config` (optional): Path to the SSH config file to use. If specified, configuration and keys will be stored in this location. Default is ~/.ssh/vscode/config.
|
236
|
+
- `--1password` (flag): Enable 1Password SSH agent integration. Creates keys directly in 1Password and configures SSH to use the 1Password SSH agent.
|
215
237
|
- `--aws-env` (optional): AWS environment directory to use. If specified, AWS configuration and credentials will be read from ~/.aws/aws-envs/{env}/.
|
216
238
|
|
217
239
|
Example usage:
|
@@ -222,8 +244,11 @@ uvx cloudx-proxy setup
|
|
222
244
|
# Setup with custom profile and key
|
223
245
|
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
|
224
246
|
|
225
|
-
# Setup with
|
226
|
-
uvx cloudx-proxy setup --
|
247
|
+
# Setup with custom SSH config and 1Password integration
|
248
|
+
uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config --1password
|
249
|
+
|
250
|
+
# Complete setup with all options
|
251
|
+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
|
227
252
|
```
|
228
253
|
|
229
254
|
#### Connect Command
|
@@ -238,6 +263,7 @@ Arguments:
|
|
238
263
|
Options:
|
239
264
|
- `--profile` (default: vscode): AWS profile to use. Should match the profile used in setup.
|
240
265
|
- `--ssh-key` (default: vscode): Name of the SSH key to use. Should match the key name used in setup.
|
266
|
+
- `--ssh-config` (optional): Path to the SSH config file to use. If provided during setup, should match here.
|
241
267
|
- `--region` (optional): AWS region to use. If not specified, uses the region from the AWS profile.
|
242
268
|
- `--aws-env` (optional): AWS environment directory to use. Should match the environment used in setup.
|
243
269
|
|
@@ -303,12 +329,17 @@ These permissions are required to bootstrap the instance, so that after creation
|
|
303
329
|
- Check that your AWS credentials have the required permissions
|
304
330
|
- Verify the instance ID is correct
|
305
331
|
- Increase the VSCode SSH timeout if needed
|
332
|
+
- Check if the instance is starting up (can take several minutes)
|
306
333
|
|
307
334
|
3. **SSH Key Issues**
|
308
335
|
- If using 1Password SSH agent, verify agent is running (~/.1password/agent.sock exists)
|
309
336
|
- Check file permissions (600 for private key, 644 for public key)
|
310
337
|
- Verify the public key is being successfully pushed to the instance
|
311
|
-
- For
|
338
|
+
- For 1Password-managed keys, make sure:
|
339
|
+
* 1Password CLI is installed and authenticated (`op account list` works)
|
340
|
+
* SSH agent is enabled in 1Password settings
|
341
|
+
* Keys are added to the SSH agent in 1Password
|
342
|
+
* The key is visible with `op item list --categories "SSH Key"`
|
312
343
|
|
313
344
|
4. **AWS Configuration**
|
314
345
|
- Confirm AWS CLI is configured with valid credentials
|
@@ -62,6 +62,15 @@ uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
|
|
62
62
|
|
63
63
|
# Setup with AWS environment
|
64
64
|
uvx cloudx-proxy setup --aws-env prod
|
65
|
+
|
66
|
+
# Setup with custom SSH config location
|
67
|
+
uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config
|
68
|
+
|
69
|
+
# Setup with 1Password integration
|
70
|
+
uvx cloudx-proxy setup --1password
|
71
|
+
|
72
|
+
# Combine options
|
73
|
+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
|
65
74
|
```
|
66
75
|
|
67
76
|
The setup command will:
|
@@ -73,13 +82,16 @@ The setup command will:
|
|
73
82
|
|
74
83
|
2. Manage SSH Keys:
|
75
84
|
- Creates new SSH key pair if needed
|
76
|
-
-
|
77
|
-
* Using 1Password SSH agent
|
78
|
-
*
|
85
|
+
- Fully supports 1Password integration:
|
86
|
+
* Using 1Password SSH agent via `--1password` flag
|
87
|
+
* Creates keys directly in 1Password's secure vault
|
88
|
+
* Only public keys are exported to the filesystem
|
89
|
+
* Follows SSH best practices using public keys to limit authentication attempts
|
79
90
|
|
80
91
|
3. Configure SSH:
|
81
|
-
- Creates ~/.ssh/vscode/config
|
82
|
-
-
|
92
|
+
- Creates SSH configs with proper settings (default: ~/.ssh/vscode/config)
|
93
|
+
- Custom config location can be specified with `--ssh-config`
|
94
|
+
- Sets up optimized environment-specific configurations
|
83
95
|
- Configures ProxyCommand with all necessary parameters
|
84
96
|
- Ensures main ~/.ssh/config includes the configuration
|
85
97
|
|
@@ -100,12 +112,18 @@ Will create a configuration like this:
|
|
100
112
|
|
101
113
|
```
|
102
114
|
# Base environment config (created once per environment)
|
115
|
+
# Environment-wide configuration
|
103
116
|
Host cloudx-dev-*
|
104
117
|
User ec2-user
|
105
118
|
IdentityFile ~/.ssh/vscode/mykey
|
119
|
+
IdentitiesOnly yes
|
106
120
|
ProxyCommand uvx cloudx-proxy connect %h %p --profile myprofile --ssh-key mykey
|
121
|
+
TCPKeepAlive yes
|
122
|
+
ControlMaster auto
|
123
|
+
ControlPath ~/.ssh/control/%r@%h:%p
|
124
|
+
ControlPersist 4h
|
107
125
|
|
108
|
-
#
|
126
|
+
# Minimal host entry (inherits all settings from environment config)
|
109
127
|
Host cloudx-dev-myserver
|
110
128
|
HostName i-0123456789abcdef0
|
111
129
|
```
|
@@ -123,17 +141,19 @@ In these examples, ssh will use cloudx-proxy to connect to AWS with the `myprofi
|
|
123
141
|
VSCode will be able to connect to the instance using the same SSH configuration.
|
124
142
|
|
125
143
|
### SSH Configuration Details
|
126
|
-
The setup command creates:
|
144
|
+
The setup command creates an optimized SSH configuration structure:
|
127
145
|
|
128
146
|
1. A base configuration for each environment (cloudx-{env}-*) with:
|
129
147
|
- User and key settings
|
130
|
-
- 1Password integration if selected
|
148
|
+
- 1Password SSH agent integration if selected
|
131
149
|
- ProxyCommand with appropriate parameters
|
150
|
+
- SSH multiplexing for better performance
|
151
|
+
- TCP keepalive for connection stability
|
132
152
|
|
133
|
-
2.
|
153
|
+
2. Minimal host entries for each instance:
|
134
154
|
- Uses consistent naming (cloudx-{env}-hostname)
|
135
|
-
-
|
136
|
-
- Inherits environment-level settings
|
155
|
+
- Only contains the HostName directive for the instance ID
|
156
|
+
- Inherits all environment-level settings automatically
|
137
157
|
|
138
158
|
When adding new instances to an existing environment, you can choose to:
|
139
159
|
- Override the environment configuration with new settings
|
@@ -161,7 +181,9 @@ uvx cloudx-proxy setup [OPTIONS]
|
|
161
181
|
|
162
182
|
Options:
|
163
183
|
- `--profile` (default: vscode): AWS profile to use. The profile's IAM user should follow the format cloudX-{env}-{user}. The environment part will be used as the default environment during setup.
|
164
|
-
- `--ssh-key` (default: vscode): Name of the SSH key to create/use. The key will be stored in
|
184
|
+
- `--ssh-key` (default: vscode): Name of the SSH key to create/use. The key will be stored in the SSH config directory. This same name can be used in the connect command.
|
185
|
+
- `--ssh-config` (optional): Path to the SSH config file to use. If specified, configuration and keys will be stored in this location. Default is ~/.ssh/vscode/config.
|
186
|
+
- `--1password` (flag): Enable 1Password SSH agent integration. Creates keys directly in 1Password and configures SSH to use the 1Password SSH agent.
|
165
187
|
- `--aws-env` (optional): AWS environment directory to use. If specified, AWS configuration and credentials will be read from ~/.aws/aws-envs/{env}/.
|
166
188
|
|
167
189
|
Example usage:
|
@@ -172,8 +194,11 @@ uvx cloudx-proxy setup
|
|
172
194
|
# Setup with custom profile and key
|
173
195
|
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
|
174
196
|
|
175
|
-
# Setup with
|
176
|
-
uvx cloudx-proxy setup --
|
197
|
+
# Setup with custom SSH config and 1Password integration
|
198
|
+
uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config --1password
|
199
|
+
|
200
|
+
# Complete setup with all options
|
201
|
+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
|
177
202
|
```
|
178
203
|
|
179
204
|
#### Connect Command
|
@@ -188,6 +213,7 @@ Arguments:
|
|
188
213
|
Options:
|
189
214
|
- `--profile` (default: vscode): AWS profile to use. Should match the profile used in setup.
|
190
215
|
- `--ssh-key` (default: vscode): Name of the SSH key to use. Should match the key name used in setup.
|
216
|
+
- `--ssh-config` (optional): Path to the SSH config file to use. If provided during setup, should match here.
|
191
217
|
- `--region` (optional): AWS region to use. If not specified, uses the region from the AWS profile.
|
192
218
|
- `--aws-env` (optional): AWS environment directory to use. Should match the environment used in setup.
|
193
219
|
|
@@ -253,12 +279,17 @@ These permissions are required to bootstrap the instance, so that after creation
|
|
253
279
|
- Check that your AWS credentials have the required permissions
|
254
280
|
- Verify the instance ID is correct
|
255
281
|
- Increase the VSCode SSH timeout if needed
|
282
|
+
- Check if the instance is starting up (can take several minutes)
|
256
283
|
|
257
284
|
3. **SSH Key Issues**
|
258
285
|
- If using 1Password SSH agent, verify agent is running (~/.1password/agent.sock exists)
|
259
286
|
- Check file permissions (600 for private key, 644 for public key)
|
260
287
|
- Verify the public key is being successfully pushed to the instance
|
261
|
-
- For
|
288
|
+
- For 1Password-managed keys, make sure:
|
289
|
+
* 1Password CLI is installed and authenticated (`op account list` works)
|
290
|
+
* SSH agent is enabled in 1Password settings
|
291
|
+
* Keys are added to the SSH agent in 1Password
|
292
|
+
* The key is visible with `op item list --categories "SSH Key"`
|
262
293
|
|
263
294
|
4. **AWS Configuration**
|
264
295
|
- Confirm AWS CLI is configured with valid credentials
|
@@ -383,38 +383,56 @@ class CloudXSetup:
|
|
383
383
|
IdentitiesOnly yes
|
384
384
|
"""
|
385
385
|
|
386
|
-
def
|
387
|
-
"""Build
|
386
|
+
def _build_environment_config(self, cloudx_env: str) -> str:
|
387
|
+
"""Build an environment-wide configuration block with all common settings.
|
388
388
|
|
389
389
|
Args:
|
390
390
|
cloudx_env: CloudX environment
|
391
|
-
hostname: Hostname for the instance
|
392
|
-
instance_id: EC2 instance ID (None for wildcard entries)
|
393
|
-
include_proxy: Whether to include the ProxyCommand (default: True)
|
394
391
|
|
395
392
|
Returns:
|
396
|
-
str: Complete
|
393
|
+
str: Complete environment configuration block
|
397
394
|
"""
|
398
|
-
host_pattern = hostname if hostname else "*"
|
399
395
|
host_entry = f"""
|
400
|
-
Host cloudx-{cloudx_env}
|
401
|
-
|
402
|
-
# Add HostName only for specific hosts, not for wildcard entries
|
403
|
-
if instance_id:
|
404
|
-
host_entry += f""" HostName {instance_id}
|
405
|
-
"""
|
406
|
-
host_entry += """ User ec2-user
|
396
|
+
Host cloudx-{cloudx_env}-*
|
397
|
+
User ec2-user
|
407
398
|
"""
|
408
399
|
# Add authentication configuration
|
409
400
|
host_entry += self._build_auth_config()
|
410
401
|
|
411
|
-
# Add
|
412
|
-
|
413
|
-
|
402
|
+
# Add ProxyCommand
|
403
|
+
host_entry += f""" ProxyCommand {self._build_proxy_command()}
|
404
|
+
"""
|
405
|
+
|
406
|
+
# Add SSH multiplexing configuration
|
407
|
+
control_path = "~/.ssh/control/%r@%h:%p"
|
408
|
+
if platform.system() == 'Windows':
|
409
|
+
# Use forward slashes for Windows as well, SSH client will handle conversion
|
410
|
+
control_path = "~/.ssh/control/%r@%h:%p"
|
411
|
+
|
412
|
+
host_entry += f""" TCPKeepAlive yes
|
413
|
+
ControlMaster auto
|
414
|
+
ControlPath {control_path}
|
415
|
+
ControlPersist 4h
|
414
416
|
"""
|
415
417
|
|
416
418
|
return host_entry
|
417
419
|
|
420
|
+
def _build_host_config(self, cloudx_env: str, hostname: str, instance_id: str) -> str:
|
421
|
+
"""Build a minimal host configuration block that inherits from the environment.
|
422
|
+
|
423
|
+
Args:
|
424
|
+
cloudx_env: CloudX environment
|
425
|
+
hostname: Hostname for the instance
|
426
|
+
instance_id: EC2 instance ID
|
427
|
+
|
428
|
+
Returns:
|
429
|
+
str: Minimal host configuration block with only hostname
|
430
|
+
"""
|
431
|
+
return f"""
|
432
|
+
Host cloudx-{cloudx_env}-{hostname}
|
433
|
+
HostName {instance_id}
|
434
|
+
"""
|
435
|
+
|
418
436
|
def _add_host_entry(self, cloudx_env: str, instance_id: str, hostname: str, current_config: str) -> bool:
|
419
437
|
"""Add settings to a specific host entry.
|
420
438
|
|
@@ -566,24 +584,13 @@ Host cloudx-{cloudx_env}-{host_pattern}
|
|
566
584
|
|
567
585
|
# Build base configuration with wildcard hostname pattern
|
568
586
|
# Start with a header comment
|
569
|
-
base_config = "# cloudx-proxy SSH Configuration
|
570
|
-
|
571
|
-
# Add base host pattern with wildcard
|
572
|
-
base_config += self._build_host_config(cloudx_env, None, None, include_proxy=True)
|
573
|
-
|
574
|
-
# Add SSH multiplexing configuration
|
575
|
-
control_path = "~/.ssh/control/%r@%h:%p"
|
576
|
-
if platform.system() == 'Windows':
|
577
|
-
# Use forward slashes for Windows as well, SSH client will handle conversion
|
578
|
-
control_path = "~/.ssh/control/%r@%h:%p"
|
579
|
-
|
580
|
-
base_config += f""" TCPKeepAlive yes
|
581
|
-
ControlMaster auto
|
582
|
-
ControlPath {control_path}
|
583
|
-
ControlPersist 4h
|
584
|
-
|
587
|
+
base_config = """# cloudx-proxy SSH Configuration
|
588
|
+
# Environment configuration with settings applied to all hosts in this environment
|
585
589
|
"""
|
586
590
|
|
591
|
+
# Add environment-wide configuration with all common settings
|
592
|
+
base_config += self._build_environment_config(cloudx_env)
|
593
|
+
|
587
594
|
# If file exists, append the new config, otherwise create it
|
588
595
|
if self.ssh_config_file.exists():
|
589
596
|
with open(self.ssh_config_file, 'a') as f:
|
@@ -598,9 +605,9 @@ Host cloudx-{cloudx_env}-{host_pattern}
|
|
598
605
|
self.ssh_config_file.chmod(stat.S_IRUSR | stat.S_IWUSR) # 600 permissions (owner read/write)
|
599
606
|
self.print_status("Set config file permissions to 600", True, 2)
|
600
607
|
|
601
|
-
# Add specific host entry
|
608
|
+
# Add specific host entry - only specifying the hostname
|
602
609
|
self.print_status(f"Adding host entry for cloudx-{cloudx_env}-{hostname}", None, 2)
|
603
|
-
host_entry = self._build_host_config(cloudx_env, hostname, instance_id
|
610
|
+
host_entry = self._build_host_config(cloudx_env, hostname, instance_id)
|
604
611
|
with open(self.ssh_config_file, 'a') as f:
|
605
612
|
f.write(host_entry)
|
606
613
|
self.print_status("Host entry added", True, 2)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: cloudx-proxy
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.3
|
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
|
@@ -112,6 +112,15 @@ uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
|
|
112
112
|
|
113
113
|
# Setup with AWS environment
|
114
114
|
uvx cloudx-proxy setup --aws-env prod
|
115
|
+
|
116
|
+
# Setup with custom SSH config location
|
117
|
+
uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config
|
118
|
+
|
119
|
+
# Setup with 1Password integration
|
120
|
+
uvx cloudx-proxy setup --1password
|
121
|
+
|
122
|
+
# Combine options
|
123
|
+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
|
115
124
|
```
|
116
125
|
|
117
126
|
The setup command will:
|
@@ -123,13 +132,16 @@ The setup command will:
|
|
123
132
|
|
124
133
|
2. Manage SSH Keys:
|
125
134
|
- Creates new SSH key pair if needed
|
126
|
-
-
|
127
|
-
* Using 1Password SSH agent
|
128
|
-
*
|
135
|
+
- Fully supports 1Password integration:
|
136
|
+
* Using 1Password SSH agent via `--1password` flag
|
137
|
+
* Creates keys directly in 1Password's secure vault
|
138
|
+
* Only public keys are exported to the filesystem
|
139
|
+
* Follows SSH best practices using public keys to limit authentication attempts
|
129
140
|
|
130
141
|
3. Configure SSH:
|
131
|
-
- Creates ~/.ssh/vscode/config
|
132
|
-
-
|
142
|
+
- Creates SSH configs with proper settings (default: ~/.ssh/vscode/config)
|
143
|
+
- Custom config location can be specified with `--ssh-config`
|
144
|
+
- Sets up optimized environment-specific configurations
|
133
145
|
- Configures ProxyCommand with all necessary parameters
|
134
146
|
- Ensures main ~/.ssh/config includes the configuration
|
135
147
|
|
@@ -150,12 +162,18 @@ Will create a configuration like this:
|
|
150
162
|
|
151
163
|
```
|
152
164
|
# Base environment config (created once per environment)
|
165
|
+
# Environment-wide configuration
|
153
166
|
Host cloudx-dev-*
|
154
167
|
User ec2-user
|
155
168
|
IdentityFile ~/.ssh/vscode/mykey
|
169
|
+
IdentitiesOnly yes
|
156
170
|
ProxyCommand uvx cloudx-proxy connect %h %p --profile myprofile --ssh-key mykey
|
171
|
+
TCPKeepAlive yes
|
172
|
+
ControlMaster auto
|
173
|
+
ControlPath ~/.ssh/control/%r@%h:%p
|
174
|
+
ControlPersist 4h
|
157
175
|
|
158
|
-
#
|
176
|
+
# Minimal host entry (inherits all settings from environment config)
|
159
177
|
Host cloudx-dev-myserver
|
160
178
|
HostName i-0123456789abcdef0
|
161
179
|
```
|
@@ -173,17 +191,19 @@ In these examples, ssh will use cloudx-proxy to connect to AWS with the `myprofi
|
|
173
191
|
VSCode will be able to connect to the instance using the same SSH configuration.
|
174
192
|
|
175
193
|
### SSH Configuration Details
|
176
|
-
The setup command creates:
|
194
|
+
The setup command creates an optimized SSH configuration structure:
|
177
195
|
|
178
196
|
1. A base configuration for each environment (cloudx-{env}-*) with:
|
179
197
|
- User and key settings
|
180
|
-
- 1Password integration if selected
|
198
|
+
- 1Password SSH agent integration if selected
|
181
199
|
- ProxyCommand with appropriate parameters
|
200
|
+
- SSH multiplexing for better performance
|
201
|
+
- TCP keepalive for connection stability
|
182
202
|
|
183
|
-
2.
|
203
|
+
2. Minimal host entries for each instance:
|
184
204
|
- Uses consistent naming (cloudx-{env}-hostname)
|
185
|
-
-
|
186
|
-
- Inherits environment-level settings
|
205
|
+
- Only contains the HostName directive for the instance ID
|
206
|
+
- Inherits all environment-level settings automatically
|
187
207
|
|
188
208
|
When adding new instances to an existing environment, you can choose to:
|
189
209
|
- Override the environment configuration with new settings
|
@@ -211,7 +231,9 @@ uvx cloudx-proxy setup [OPTIONS]
|
|
211
231
|
|
212
232
|
Options:
|
213
233
|
- `--profile` (default: vscode): AWS profile to use. The profile's IAM user should follow the format cloudX-{env}-{user}. The environment part will be used as the default environment during setup.
|
214
|
-
- `--ssh-key` (default: vscode): Name of the SSH key to create/use. The key will be stored in
|
234
|
+
- `--ssh-key` (default: vscode): Name of the SSH key to create/use. The key will be stored in the SSH config directory. This same name can be used in the connect command.
|
235
|
+
- `--ssh-config` (optional): Path to the SSH config file to use. If specified, configuration and keys will be stored in this location. Default is ~/.ssh/vscode/config.
|
236
|
+
- `--1password` (flag): Enable 1Password SSH agent integration. Creates keys directly in 1Password and configures SSH to use the 1Password SSH agent.
|
215
237
|
- `--aws-env` (optional): AWS environment directory to use. If specified, AWS configuration and credentials will be read from ~/.aws/aws-envs/{env}/.
|
216
238
|
|
217
239
|
Example usage:
|
@@ -222,8 +244,11 @@ uvx cloudx-proxy setup
|
|
222
244
|
# Setup with custom profile and key
|
223
245
|
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
|
224
246
|
|
225
|
-
# Setup with
|
226
|
-
uvx cloudx-proxy setup --
|
247
|
+
# Setup with custom SSH config and 1Password integration
|
248
|
+
uvx cloudx-proxy setup --ssh-config ~/.ssh/cloudx/config --1password
|
249
|
+
|
250
|
+
# Complete setup with all options
|
251
|
+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey --ssh-config ~/.ssh/cloudx/config --1password --aws-env prod
|
227
252
|
```
|
228
253
|
|
229
254
|
#### Connect Command
|
@@ -238,6 +263,7 @@ Arguments:
|
|
238
263
|
Options:
|
239
264
|
- `--profile` (default: vscode): AWS profile to use. Should match the profile used in setup.
|
240
265
|
- `--ssh-key` (default: vscode): Name of the SSH key to use. Should match the key name used in setup.
|
266
|
+
- `--ssh-config` (optional): Path to the SSH config file to use. If provided during setup, should match here.
|
241
267
|
- `--region` (optional): AWS region to use. If not specified, uses the region from the AWS profile.
|
242
268
|
- `--aws-env` (optional): AWS environment directory to use. Should match the environment used in setup.
|
243
269
|
|
@@ -303,12 +329,17 @@ These permissions are required to bootstrap the instance, so that after creation
|
|
303
329
|
- Check that your AWS credentials have the required permissions
|
304
330
|
- Verify the instance ID is correct
|
305
331
|
- Increase the VSCode SSH timeout if needed
|
332
|
+
- Check if the instance is starting up (can take several minutes)
|
306
333
|
|
307
334
|
3. **SSH Key Issues**
|
308
335
|
- If using 1Password SSH agent, verify agent is running (~/.1password/agent.sock exists)
|
309
336
|
- Check file permissions (600 for private key, 644 for public key)
|
310
337
|
- Verify the public key is being successfully pushed to the instance
|
311
|
-
- For
|
338
|
+
- For 1Password-managed keys, make sure:
|
339
|
+
* 1Password CLI is installed and authenticated (`op account list` works)
|
340
|
+
* SSH agent is enabled in 1Password settings
|
341
|
+
* Keys are added to the SSH agent in 1Password
|
342
|
+
* The key is visible with `op item list --categories "SSH Key"`
|
312
343
|
|
313
344
|
4. **AWS Configuration**
|
314
345
|
- Confirm AWS CLI is configured with valid credentials
|
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
|