ironstar-io / tokaido

Zero-conf Drupal Local Development Environments with Docker
https://tokaido.io
BSD 3-Clause "New" or "Revised" License
57 stars 10 forks source link

Add a `tok ssh` command #194

Open joshuaboltzmc opened 5 years ago

joshuaboltzmc commented 5 years ago

Is your feature request related to a problem? Please describe. Just a nice to have, I think.

Describe the solution you'd like Make a tok ssh command for easy SSH access into the Docker container.

Describe alternatives you've considered There is already a way to SSH via tok, ssh <name>.tok, but to follow suit with other tok commands and how other local Drupal environment solutions allow SSH into the container, it would be a nice and easy command, rather than needing to remember the SSH doesn't use a tok command.

Perhaps the reason it's the ssh <site>.tok is so that one can SSH into any container from anywhere, whereas the tok ssh would need to be run from within a specific project directory.

Lando has lando ssh Vagrant has vagrant ssh DDev has ddev ssh

ironmike-au commented 5 years ago

We originally tried to implement this, but the challenge is that as with ddev ssh and lando ssh, these aren't really SSH sessions; These are wrappers around docker-compose exec. This means that ssh-agent forwarding, scp, and possibly some other features are missing.

Vagrant has it a bit easier because it's using the VM engine to get an SSH shell, which is easier than it is with Docker.

My primary concerns with implementing this feature are:

I think if we spend a bit of time on this, we can build a full-featured SSH client with Go (there are examples out there I've seen, but most are incomplete especially around agent-forwarding).

I'm going to leave this request open as I'd really love to include it. I agree it would be really nice to have. But it's probably a big 2.0 feature more than anything else, which we're planning for now but release isn't likely until early next year.

Thanks for the feedback @joshuaboltzmc :)

fubarhouse commented 4 years ago

I'm just looking around at the moment, however... I would like to make a suggestion around the strategy of this one.

these aren't really SSH sessions

Exactly, so why not tok shell or tok terminal, or a shorter version of tok sh?

Maybe Tok could start a trend in being clearer around what the things really are opposed to following examples which don't really hit the mark - at least I definitely feel that way.

Also... liking the native strategy - so maybe considering a really light-weight native client like

ironmike-au commented 4 years ago

The problem (I think) with something like tok shell or tok terminal is that it still leaves ambiguity around which container you're popping a shell in (ie, fpm, nginx, ssh?)

tok ssh is nice and clear that you're going to end up in the ssh environment. Where we could improve here is tok exec, which shares the docker-compose exec command but not the behaviour (it runs commands in the ssh container via ssh). That's definitely something to be tweaked when 2.0 comes around