这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@u2mejc
Copy link
Contributor

@u2mejc u2mejc commented Aug 25, 2015

Corrects error dialog seen by new users attempting to use the shell's help:

dokku> dokku help
! dokku help is not a dokku command.
! See dokku help for a list of available commands.

Resolves the TTY error when connecting over ssh. Updated ps to use has_tty function.

@josegonzalez
Copy link
Member

I don't understand the help dialog change. Can you explain that a bit more?

@u2mejc
Copy link
Contributor Author

u2mejc commented Aug 25, 2015

Happy to. If you read it literally, just like a brand new user may, it asks you (in quotes) to type 'dokku help'.

Here's a sample interaction before PR:

foo
 !    `foo` is not a dokku command.
 !    See `dokku help` for a list of available commands.
dokku help
 !    `dokku help` is not a dokku command.
 !    See `dokku help` for a list of available commands.

😦 :trollface:
After:

foo
 !    `foo` is not a dokku command.
 !    See `help` for a list of available commands.
help
Usage: dokku [--quiet|--trace|--rm-container|--rm|--force] COMMAND <app> [command-specific-options]

Options:
    apps:cre...

😄

@josegonzalez
Copy link
Member

Wait, are you inside of dokku shell?

@u2mejc
Copy link
Contributor Author

u2mejc commented Aug 25, 2015

Correct, aka $ dokku shell (or ssh dokku@dokku.me shell).

@u2mejc
Copy link
Contributor Author

u2mejc commented Aug 25, 2015

I edited my example above to clarify.

@josegonzalez
Copy link
Member

I think the expectation is that once you are in a dokku shell, you don't need to use the prefix anymore. Can you revert that change in your PR (and squash the commits)?

You can open a second PR adding custom MOTD - telling people to not prefix dokku commands - for dokku shell, which will probably be much more useful than this change. There are other places where we call out the dokku command in help output, so ^ would cover it.

Resolved the TTY error when connecting over ssh.
Updated ps to use has_tty function.
@u2mejc u2mejc changed the title Fix dokku ps <app> over ssh, clarify dokku help in shell Fix dokku ps <app> over ssh Aug 26, 2015
@u2mejc
Copy link
Contributor Author

u2mejc commented Aug 26, 2015

np, just pushed up the change.

@josegonzalez
Copy link
Member

Wait, why did you get a tty error before? Note: I don't seem to have such an error on master. Can you paste the command that results in an error?

@u2mejc
Copy link
Contributor Author

u2mejc commented Aug 26, 2015

Here you go:

$ ssh dokku@dokku.me ps node-js-app
time="2015-08-26T21:58:25Z" level=fatal msg="cannot enable tty mode on non tty input" 

Do you have RequestTTY yes in your ssh config? http://progrium.viewdocs.io/dokku/remote-commands/

If so, you may not see this bug. Because that line is buried in the documentation, this brings up a new question: Should we just bubble up this documentation since this would be bug is probably lurking in other sub-commands in Dokku or should we fix the TTY bugs (since there is an easy function for it already) when we find them?

@josegonzalez
Copy link
Member

Here is my .ssh/config:

Host *
  CheckHostIP yes
  ControlMaster auto
  ControlPath ~/.ssh/master-%r@%h:%p
  SendEnv LANG LC_*
  HashKnownHosts yes
  GSSAPIAuthentication no
  GSSAPIDelegateCredentials no
  RSAAuthentication yes
  PasswordAuthentication yes
  StrictHostKeyChecking no

@u2mejc
Copy link
Contributor Author

u2mejc commented Aug 26, 2015

Hmm somewhere that's being set. Try disabling it with -T, my patch allows you to execute without the pseudo-tty:

$ ssh -T dokku@dokku.me ps node-js-app

@josegonzalez
Copy link
Member

Maybe it's because I'm using contrib/dokku_client.sh? Can you try with that?

@michaelshobbs
Copy link
Member

Given the variance in how different folks might have configured their SSH clients, I like the idea of using has_tty where it makes sense.

@josegonzalez
Copy link
Member

@michaelshobbs I haven't read up about the flag just yet, but if you feel comfortable merging, ship it :)

@michaelshobbs
Copy link
Member

Full disclosure, @u2mejc sits right next to me at work. @u2mejc did you test this change with the dokku_client? If not, would you please? It's probably fine but just want to make sure we don't have some weirdness there.

@u2mejc
Copy link
Contributor Author

u2mejc commented Aug 27, 2015

@michaelshobbs is correct. This patch removes the requirement.

NAME
     ssh -- OpenSSH SSH client (remote login program)
...
     -T      Disable pseudo-tty allocation.

     -t      Force pseudo-tty allocation.  This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services.  Multiple -t options force tty allocation, even if ssh has no local tty.

Yep, I tested dokku_client.sh and it does work with or without the patch.

michaelshobbs added a commit that referenced this pull request Aug 27, 2015
@michaelshobbs michaelshobbs merged commit 84fff1c into dokku:master Aug 27, 2015
@josegonzalez
Copy link
Member

@u2mejc good work! Mind making a PR to add MOTD support to dokku shell?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants