Skip to content
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

Support for Podman over ssh remote connection #142

Open
lmtr0 opened this issue Nov 29, 2022 · 7 comments
Open

Support for Podman over ssh remote connection #142

lmtr0 opened this issue Nov 29, 2022 · 7 comments
Labels
C-feature Category: New feature or request

Comments

@lmtr0
Copy link

lmtr0 commented Nov 29, 2022

Hello there, good day!

At work, I use Golang with podman, and they have a way to connect to other machines securely through ssh tcp streams. I think it would be a great addition to this library as well :)

Here is the ssh library I found that supports the stream pass-through.
Here are some connection examples:

// connection examples:
//   - ssh://<user>@<host>[:port]/run/podman/podman.sock?secure=True
//   - unix://tmp/__podman.sock -t 0

Then this library would parse and choose the most appropriate one for the job.

I haven't explored this codebase enough to see how much work It would take, so If you need any help, please let me know

@lmtr0 lmtr0 added the C-feature Category: New feature or request label Nov 29, 2022
@lmtr0
Copy link
Author

lmtr0 commented Nov 29, 2022

Also, the golang library is called bindings and it's in the pkg directory over in https://github.com/containers/podman/tree/main/pkg/bindings

@vv9k
Copy link
Owner

vv9k commented Dec 4, 2022

Thank you for the report, that is indeed an interesting idea. It would probably require creating some sort of compatibility wrapper for ssh connection that would implement the tower::Service trait for integration with hyper, similar to what hyperlocal does for a unix socket but that seems doable. I will look into this when I get some more free time.

@lmtr0
Copy link
Author

lmtr0 commented Dec 5, 2022

I agree, I will explore more the go code and come back with hopefully how they implemented on their side

@lmtr0
Copy link
Author

lmtr0 commented Dec 20, 2022

The way podman does is with a full abstraction of the http client to use ssh https://github.com/containers/podman/blob/main/pkg/bindings/connection.go#L94

@lmtr0
Copy link
Author

lmtr0 commented Dec 20, 2022

there is a stream struct on the ssh2 library https://docs.rs/ssh2/latest/ssh2/struct.Stream.html

@lmtr0
Copy link
Author

lmtr0 commented Dec 20, 2022

A way we could do it is to abstract the hole http client struct and use different clients for different use cases 🤔

@blazzy
Copy link

blazzy commented Jun 17, 2024

I think this is necessary for supporting macOS as I think it works by connecting to a virtual machine over ssh.

$ podman system connection  list
Name                         URI                                                         Identity                                                      Default     ReadWrite
podman-machine-default       ssh://core@127.0.0.1:63169/run/user/501/podman/podman.sock  /Users/blazzy/.local/share/containers/podman/machine/machine  true        true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants