-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add proxy/bastion for connection #48
Conversation
lib/common/remote.sh
Outdated
@@ -94,16 +103,19 @@ scp_from_cmd () { | |||
# Generate SSH command | |||
ssh_cmd () { | |||
cmd="" | |||
if [[ ! -z "${TARGET_HOST_KEY_PATH+x}" ]]; then | |||
if [[ -n "${PROXY_HOST}" && -n "${PROXY_USERNAME}" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
lib/common/remote.sh
Outdated
|
||
# Generate SCP command | ||
# $1 local path | ||
# $2 remote path | ||
scp_to_cmd () { | ||
if [[ ! -z "${TARGET_HOST_KEY_PATH+x}" ]]; then | ||
if [[ -n "${PROXY_HOST}" && -n "${PROXY_USERNAME}" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the if [[ -n "${PROXY_HOST}" && -n "${PROXY_USERNAME}" ]]; then
should have its own if...
As one thing is the proxy settings which would be added on the scp part, also here I am just seeing the proxy host and username but it probably would require a private key.
The second part is the if for the target host, if it uses a private key it directly uses the scp -i option if not and it will connect though a pass it uses the sshpass.
But as you see in both cases if we set proxy those settings should be there
lib/common/remote.sh
Outdated
@@ -84,7 +91,9 @@ scp_to_cmd () { | |||
# $1 remote path | |||
# $2 local path | |||
scp_from_cmd () { | |||
if [[ ! -z "${TARGET_HOST_KEY_PATH+x}" ]]; then | |||
if [[ -n "${PROXY_HOST}" && -n "${PROXY_USERNAME}" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before
Only see Unfortunately do not see an easy option (i.e for target host And template it with the envs: Host proxy_host
HostName proxy_host
User proxy_user
IdentityFile /path/to/private_key_for_proxy
Host target_host
HostName target_host
User target_user
IdentityFile /path/to/private_key_for_target
ProxyJump proxy_host |
When you add the private key, I would ask you to test this and comment on the test is successful here 🙏 If you want for testing this without the testing farm stuff as that may complicate things we can use |
@adrianriobo , I designed that deliverset offers two options for SSH connection: |
I am fine with it, but still if user pass an private key for target host and a private key for proxy you probably would need to compose the conf file no? |
@adrianriobo my plan is the user pass the config file to deliverset, instead of deliverset compose the config file. What do you think? |
@lilyLuLiu I would prefer the other way around, here are some thoughts on why:
|
f69d62b
to
37f0453
Compare
@adrianriobo Thanks for the explanation. |
Sure let me go through it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try this with mapt on airgap scenario?
In general and just if testing was ok LGTM |
@adrianriobo verified with mapt arigap scenario. |
https://github.com/adrianriobo/deliverest/issues/9