-
Notifications
You must be signed in to change notification settings - Fork 70
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
initial ssh (client) support using awa-ssh #362
Conversation
That looks great! Do you think we can avoid duplicating some much code in tcp.ml/ssh.ml. The protocols are mostly similar (apart the message prefixes if I remember correctly) so I hope there is a way to share more code :-) |
@samoht I'd hope so, yes. I don't expect this PR to be merged as is, but would appreciate if someone could think about the code and come up with the right abstractions. please take also the dual PR for conduit/mirage-conduit mirage/ocaml-conduit#296 into consideration. |
How to use this code in an application? This PR adds
For your convenience, the opam repository https://github.com/roburio/git-ssh-dns-mirage3-repo acts as an overlay for git+ssh support ( As application, the primary DNS unikernel is an example, TL;DR: in config.ml it has two new command-line parameters "seed" and "authenticator", in unikernel.ml it stitches this together into a "HTTP header" (that's what irmin and git and conduit API allowed) see here and passes this to For a non-MirageOS application, it is likely that a similar patch, as done for conduit-mirage, has to be applied to conduit-lwt-unix. |
Close by #395 which integrate properly SSH. |
ssh.ml is mainly a copy of tcp.ml, some adjustment were needed since in the tcp protocol the client first sends a request, while in ssh a command (git-receive-pack or git-upload-pack) is executed (with the path to the repository as argument) which starts by emitting data.
this means that git-receive/upload-pack needs to be passed while the connection is established (as done with
?cmd
here), i.e. before there's a FLOW (or NET as it is called here).