Don't require a login for commands operating on local devices

Change-type: patch
Closes: #1195
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-05-28 10:39:30 +01:00 committed by Paulo Castro
parent 1a1861bfcb
commit 0ee73f5164
3 changed files with 10 additions and 5 deletions

View File

@ -1305,8 +1305,9 @@ id of the application to preload
#### --commit, -c &#60;hash&#62;
the commit hash for a specific application release to preload, use "latest" to specify the latest release
(ignored if no appId is given)
The commit hash for a specific application release to preload, use "current" to specify the current
release (ignored if no appId is given). The current release is usually also the latest, but can be
manually pinned using https://github.com/balena-io-projects/staged-releases .
#### --splash-image, -s &#60;splashImage.png&#62;

View File

@ -91,7 +91,6 @@ export const logs: CommandDefinition<
'Only show system logs. This can be used in combination with --service.',
},
],
permission: 'user',
primary: true,
async action(params, options, done) {
normalizeUuidProp(params);
@ -101,7 +100,9 @@ export const logs: CommandDefinition<
'../utils/device/logs'
);
const { validateIPAddress } = await import('../utils/validation');
const { exitWithExpectedError } = await import('../utils/patterns');
const { exitIfNotLoggedIn, exitWithExpectedError } = await import(
'../utils/patterns'
);
const Logger = await import('../utils/logger');
const logger = new Logger();
@ -153,6 +154,7 @@ export const logs: CommandDefinition<
options.service,
);
} else {
exitIfNotLoggedIn();
if (options.tail) {
return balena.logs
.subscribe(params.uuidOrDevice, { count: 100 })

View File

@ -275,7 +275,6 @@ export const ssh: CommandDefinition<
installed in your shell environment. For more information (including Windows
support) please check:
https://github.com/balena-io/balena-cli/blob/master/INSTALL.md#additional-dependencies`,
permission: 'user',
options: [
{
signature: 'port',
@ -304,6 +303,7 @@ export const ssh: CommandDefinition<
const hasbin = require('hasbin');
const { getSubShellCommand } = await import('../utils/helpers');
const { child_process } = await import('mz');
const { exitIfNotLoggedIn } = await import('../utils/patterns');
const { exitWithExpectedError, selectFromList } = await import(
'../utils/patterns'
@ -366,6 +366,7 @@ export const ssh: CommandDefinition<
switch (paramChecks.target) {
case SSHTarget.APPLICATION:
exitIfNotLoggedIn();
// Here what we want to do is fetch all device which
// are part of this application, and online
try {
@ -395,6 +396,7 @@ export const ssh: CommandDefinition<
throw e;
}
case SSHTarget.DEVICE:
exitIfNotLoggedIn();
// We want to do two things here; firstly, check
// that the device exists and is accessible, and
// also convert a short uuid to a long one if