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

Add a tok ssh command #194

Open
joshuaboltzmc opened this issue Aug 22, 2019 · 3 comments
Open

Add a tok ssh command #194

joshuaboltzmc opened this issue Aug 22, 2019 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@joshuaboltzmc
Copy link

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
Copy link
Contributor

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:

  • If we have both ssh {project}.tok and tok ssh, new users might be confused as to which they should use in which setting.
  • If we just have tok ssh as a wrapper around docker-compose exec, we lose SSH agent forwarding and scp (which we can regain using files, but it's not a nice user experience and requires additional config), and these are features some users will have come to expect.

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 :)

@ironmike-au ironmike-au added this to the 2.0.0 milestone Aug 22, 2019
@ironmike-au ironmike-au added the enhancement New feature or request label Aug 22, 2019
@fubarhouse
Copy link
Contributor

fubarhouse commented Nov 30, 2019

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
Copy link
Contributor

ironmike-au commented Nov 30, 2019

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

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

No branches or pull requests

3 participants