Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

nix: add config file to NIX_SSHOPTS #141

Merged
merged 1 commit into from
Apr 29, 2021
Merged

nix: add config file to NIX_SSHOPTS #141

merged 1 commit into from
Apr 29, 2021

Conversation

cole-h
Copy link
Contributor

@cole-h cole-h commented Jan 14, 2021

Fixes #140.


I don't actually use Morph (yet?), but I semi-validated that this should work by printing the value of sshOpts, which showed [-o StrictHostkeyChecking=No -o UserKnownHostsFile=/dev/null -F /tmp] when running SSH_SKIP_HOST_KEY_CHECK=true SSH_CONFIG_FILE=/tmp result/bin/morph push ./examples/healthchecks.nix.

@srhb srhb self-requested a review March 25, 2021 20:23
@gilligan
Copy link

I'd really like to see this merged as well 😅

sshOpts = append(sshOpts, fmt.Sprintf("%s", "-o StrictHostkeyChecking=No -o UserKnownHostsFile=/dev/null"))
}
if ctx.ConfigFile != "" {
sshOpts = append(sshOpts, fmt.Sprintf("-F %s", ctx.ConfigFile))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can thing config file be an output of a nix builder or does it have to exist before the deployment is started?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why not. As long as it returns a path and ssh can access that path when passing -F /path, should be fine.

@andir
Copy link
Contributor

andir commented Mar 29, 2021

@srhb Do you have a minute to look at this? :-)

@0xSbock
Copy link

0xSbock commented Apr 16, 2021

I ran into the same bug today and came up with a similar solution (using a string builder). Regardless, i prefer your solution :)

@srhb srhb merged commit 8d5b037 into DBCDK:master Apr 29, 2021
@srhb
Copy link
Contributor

srhb commented Apr 29, 2021

Thanks!

@cole-h cole-h deleted the sshopts branch April 29, 2021 05:56
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSH_CONFIG_FILE is ignored for nix copy
5 participants