From 941c36525951f41f1c8b5933dc76d64b9e16a205 Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Fri, 22 Jan 2021 15:06:18 +0000 Subject: [PATCH] tunnel: Add note re openBalena version compatibility Change-type: patch --- doc/cli.markdown | 20 ++++++++++++++------ lib/commands/tunnel.ts | 20 ++++++++++++++------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/doc/cli.markdown b/doc/cli.markdown index ec9faf3d..7aa561d5 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -1830,17 +1830,25 @@ bypass global proxy configuration for the ssh connection ## tunnel <deviceOrApplication> -Use this command to open local ports which tunnel to listening ports on your balenaOS device. +Use this command to open local TCP ports that tunnel to listening sockets in a +balenaOS device. -For example, you could open port 8080 on your local machine to connect to your managed balenaOS -device running a web server listening on port 3000. +For example, this command could be used to expose the ssh server of a balenaOS +device (port number 22222) on the local machine, or to expose a web server +running on the device. The port numbers do not have be the same between the +device and the local machine, and multiple ports may be tunneled in a single +command line. Port mappings are specified in the format: [:[localIP:]localPort] -localIP defaults to 'localhost', and localPort defaults to the specified remotePort value. +localIP defaults to 'localhost', and localPort defaults to the specified +remotePort value. -You can tunnel multiple ports at any given time. +Note: the -p (--port) flag must be provided at the end of the command line, +as per examples. -Note: Port mappings must come after the deviceOrApplication parameter, as per examples. +In the case of openBalena, the tunnel command in CLI v12.38.5 or later requires +openBalena v3.1.2 or later. Older CLI versions work with older openBalena +versions. Examples: diff --git a/lib/commands/tunnel.ts b/lib/commands/tunnel.ts index 84f17676..a7f209ec 100644 --- a/lib/commands/tunnel.ts +++ b/lib/commands/tunnel.ts @@ -39,17 +39,25 @@ export default class TunnelCmd extends Command { public static description = stripIndent` Tunnel local ports to your balenaOS device. - Use this command to open local ports which tunnel to listening ports on your balenaOS device. + Use this command to open local TCP ports that tunnel to listening sockets in a + balenaOS device. - For example, you could open port 8080 on your local machine to connect to your managed balenaOS - device running a web server listening on port 3000. + For example, this command could be used to expose the ssh server of a balenaOS + device (port number 22222) on the local machine, or to expose a web server + running on the device. The port numbers do not have be the same between the + device and the local machine, and multiple ports may be tunneled in a single + command line. Port mappings are specified in the format: [:[localIP:]localPort] - localIP defaults to 'localhost', and localPort defaults to the specified remotePort value. + localIP defaults to 'localhost', and localPort defaults to the specified + remotePort value. - You can tunnel multiple ports at any given time. + Note: the -p (--port) flag must be provided at the end of the command line, + as per examples. - Note: Port mappings must come after the deviceOrApplication parameter, as per examples. + In the case of openBalena, the tunnel command in CLI v12.38.5 or later requires + openBalena v3.1.2 or later. Older CLI versions work with older openBalena + versions. `; public static examples = [