diff --git a/README.md b/README.md index 62f660fd8..ac9ca2304 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ $ iofog-controller tunnel <*command*> <*options*> -u, --username string (Tunnel username)
-p, --password string (Tunnel password)
-s, --host string (Tunnel host address)
- -k, --rsa-key string (Tunnel RSA key)
+ -k, --rsa-key string (Path to tunnel RSA key)
-o, --port number (Tunnel port)
-f, --iofogUuid string (Fog UUID)
diff --git a/src/cli/tunnel.js b/src/cli/tunnel.js index 2bc3906b5..01759a1d3 100644 --- a/src/cli/tunnel.js +++ b/src/cli/tunnel.js @@ -50,7 +50,7 @@ class Tunnel extends BaseCLIHandler { }, { name: 'rsa-key', alias: 'k', type: String, - description: 'Tunnel RSA key', + description: 'Path to tunnel RSA key', group: [constants.CMD_UPDATE] }, { diff --git a/src/helpers/app-helper.js b/src/helpers/app-helper.js index b0f7d3ad1..a53453f43 100644 --- a/src/helpers/app-helper.js +++ b/src/helpers/app-helper.js @@ -59,7 +59,12 @@ async function checkPortAvailability(port) { } const findAvailablePort = async function (hostname) { - let portBounds = Config.get("Tunnel:PortRange").split("-").map(i => parseInt(i)); + let portRange = Config.get("Tunnel:PortRange"); + if (!portRange) { + logger.warn('Port range was\'n specified in config. Default range (2000-10000) will be used'); + portRange = '2000-10000'; + } + let portBounds = portRange.split("-").map(i => parseInt(i)); return await portscanner.findAPortNotInUse(portBounds[0], portBounds[1], hostname); }