some fixes

This commit is contained in:
Eugene Mirotin 2017-05-18 15:12:52 +03:00
parent fa71df7c70
commit 880fb43fd9
4 changed files with 21 additions and 8 deletions

View File

@ -14,7 +14,7 @@ Requisites
- [Git](https://git-scm.com)
- The following executables should be correctly installed in your shell environment:
- `ssh`: Any recent version of the OpenSSH ssh client (required by `resin sync` and `resin ssh`)
- if you need `ssh` to work behind the proxy you also need `proxytunnel`[http://proxytunnel.sourceforge.net/] installed (available as `proxytunnel` package for Ubuntu, for example)
- if you need `ssh` to work behind the proxy you also need [`proxytunnel`](http://proxytunnel.sourceforge.net/) installed (available as `proxytunnel` package for Ubuntu, for example)
- `rsync`: >= 2.6.9 (required by `resin sync`)
##### Windows Support
@ -27,7 +27,7 @@ If you still want to use `cmd.exe` you will have to use a package manager like M
2. Install the `msys-rsync` and `msys-openssh` packages.
3. Add MinGW to the `%PATH%` if this hasn't been done by the installer already. The location where the binaries are places is usually `C:\MinGW\msys\1.0\bin`, but it can vary if you selected a different location in the installer.
4. Copy your SSH keys to `%homedrive%%homepath\.ssh`.
5. Install [proxytunnel](http://proxytunnel.sourceforge.net/)
5. If you need `ssh` to work behind the proxy you also need to install [proxytunnel](http://proxytunnel.sourceforge.net/)
Getting Started
---------------

View File

@ -46,6 +46,11 @@ module.exports =
boolean: true
description: 'increase verbosity'
alias: 'v'
,
signature: 'noproxy'
parameter: 'noproxy'
boolean: true
description: "don't use the proxy configuration for this connection. Only makes sense if you've configured proxy globally."
]
action: (params, options, done) ->
child_process = require('child_process')
@ -79,13 +84,21 @@ module.exports =
throw new Error('Did not find running application container') if not containerId?
Promise.try ->
sshProxyCommand = ''
proxyConfig = global.PROXY_CONFIG
if proxyConfig
if proxyConfig and not options.noproxy
{ proxyAuth } = proxyConfig
proxyHost = "-p #{proxyConfig.host}:#{proxyConfig.port}"
proxyAuth = if proxyAuth then "-P #{proxyAuth}" else ''
proxytunnelCommand = "proxytunnel #{proxyHost} #{proxyAuth} -d %h:%p"
proxyHost = "#{proxyConfig.host}:#{proxyConfig.port}"
if proxyAuth
i = proxyAuth.indexOf(':')
proxyUser = proxyAuth.substring(0, i)
proxyPassword = proxyAuth.substring(i + 1)
proxyAuth = "--user=#{proxyUser} --pass=#{proxyPassword}"
else
proxyAuth = ''
proxytunnelCommand = "proxytunnel --proxy=#{proxyHost} #{proxyAuth} --dest=%h:%p"
sshProxyCommand = "-o ProxyCommand='#{proxytunnelCommand}'"
command = "ssh #{verbose} -t \
-o LogLevel=ERROR \
-o StrictHostKeyChecking=no \

View File

@ -38,7 +38,7 @@ catch
# If that is not set as well the initialize will do nothing
globalTunnel.initialize(proxy)
# TODO: make this a feature of capitano
# TODO: make this a feature of capitano https://github.com/resin-io/capitano/issues/48
global.PROXY_CONFIG = globalTunnel.proxyConfig
_ = require('lodash')

View File

@ -47,7 +47,7 @@
"dockerode": "^2.4.2",
"drivelist": "^5.0.16",
"etcher-image-write": "^9.0.3",
"global-tunnel-ng": "np-maintain/global-tunnel",
"global-tunnel-ng": "^2.1.0",
"inquirer": "^3.0.6",
"is-root": "^1.0.0",
"js-yaml": "^3.7.0",