Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ $ iofog-controller tunnel <*command*> <*options*>
-u, --username string (Tunnel username) <br>
-p, --password string (Tunnel password) <br>
-s, --host string (Tunnel host address) <br>
-k, --rsa-key string (Tunnel RSA key) <br>
-k, --rsa-key string (Path to tunnel RSA key) <br>
-o, --port number (Tunnel port) <br>
-f, --iofogUuid string (Fog UUID) <br>

Expand Down
2 changes: 1 addition & 1 deletion src/cli/tunnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
},
{
Expand Down
7 changes: 6 additions & 1 deletion src/helpers/app-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down