Closed hinshun closed 2 years ago
@aaronlehmann Also currently this PR doesn't utilize llb.KnownSSHHosts
so its not secure atm.
Earthly for example, loads user's known hosts: https://github.com/earthly/earthly/blob/main/buildcontext/gitlookup.go#L589-L595
And has some hard coded keyscans for popular hosts (github.com, bitbucket.com): https://github.com/earthly/earthly/blob/main/buildcontext/gitlookup.go#L60-L62
Updated description of PR.
~/.ssh/known_hosts
and use of llb.KnownSSHHosts
Supports new schemes for module uris:
file://
or empty scheme are for local filesgit+https://
use httpsgit+ssh://
use sshgit://
autoOn
git://
andgit+ssh://
mode, it relies on env$SSH_AUTH_SOCK
, dials the agent and tests the SSH connection. If it fails ongit+ssh://
, then it failshlb run
. If it fails ongit://
then it falls back togit+https://
.Known hosts from
~/.ssh/known_hosts
are passed tollb.KnownSSHHosts(keys string)
.When running with either new scheme, it treats
local
relative to theast.Directory
the module is in. This means relative to the ref returned from gateway solve. This allows you to run remote hlb modules without cloning the repo.Other commands also work with the new uri:
Including debugging: