This is my fourth or fifth pass implementing the functionality included in this gem... I first did it directly in an app, then in Capistrano, then in SSHKit, then finally (after taking the "don't push your pull request" advice to heart) as a standalone gem 😅
Backstory
The problem stemmed from wanting to open a Rails console on the server, without me (and all of my teammates) having to manually set up my SSH config. I created a Rake task to generate an SSH config via the AWS API, but figured "hey, there are a bunch of remote commands I want to be able to run... this sounds like a job for Capistrano."
I assumed this would be easy, buuuuut our deployment setup has the complication of a gateway/NAT/proxy/jump server (those are all synonyms, right?) in front of it. All of the examples I could find only handle the most basic of SSH connections:
"Ok," I thought, "well maybe it's something I can easily initiate from SSHKit..." but apparently that's not the case. The capistrano/console approach of an endless loop around an execute didn't seem like it would work, either. It seemed that shelling out to ssh was the way to go, but I wanted a way to generate the command automatically from the Capistrano::Configuration::Server. That's where this gem came in.
Halp?
I would love feedback on the overall approach, code, documentation, etc. The gem is far from comprehensive (particularly in covering all possible ssh_options), but I'm logging issues as I go. My thinking is that SSHKit::Interactive can be integrated into other Capistrano plugins, using shared logic for generating the ssh command.
CCing people who I saw in various threads who may be interested (no particular order) – #sorrynotsorry for the spam 😉 Thanks!
/cc @leehambley @jgrevich @miry @ydkn @toobulkeh @phstc @Haihappen @chrisbloom7 @col @joost
This is my fourth or fifth pass implementing the functionality included in this gem... I first did it directly in an app, then in Capistrano, then in SSHKit, then finally (after taking the "don't push your pull request" advice to heart) as a standalone gem 😅
Backstory
The problem stemmed from wanting to open a Rails console on the server, without me (and all of my teammates) having to manually set up my SSH config. I created a Rake task to generate an SSH config via the AWS API, but figured "hey, there are a bunch of remote commands I want to be able to run... this sounds like a job for Capistrano."
I assumed this would be easy, buuuuut our deployment setup has the complication of a gateway/NAT/proxy/jump server (those are all synonyms, right?) in front of it. All of the examples I could find only handle the most basic of SSH connections:
"Ok," I thought, "well maybe it's something I can easily initiate from SSHKit..." but apparently that's not the case. The
capistrano/consoleapproach of an endless loop around anexecutedidn't seem like it would work, either. It seemed that shelling out tosshwas the way to go, but I wanted a way to generate the command automatically from theCapistrano::Configuration::Server. That's where this gem came in.Halp?
I would love feedback on the overall approach, code, documentation, etc. The gem is far from comprehensive (particularly in covering all possible
ssh_options), but I'm logging issues as I go. My thinking is that SSHKit::Interactive can be integrated into other Capistrano plugins, using shared logic for generating thesshcommand.CCing people who I saw in various threads who may be interested (no particular order) – #sorrynotsorry for the spam 😉 Thanks!
/cc @leehambley @jgrevich @miry @ydkn @toobulkeh @phstc @Haihappen @chrisbloom7 @col @joost