Compare commits

...

11 Commits

Author SHA1 Message Date
b616fbdd79 v21.1.5 2025-04-03 13:28:12 +00:00
81edfbbae1 Merge pull request #2930 from balena-io/bump_dockerode_cachefrom
Update dockerode/docker-modem dependencies for cachefrom fix
2025-04-03 09:27:11 -04:00
663e83c3b8 Dedupe dependencies 2025-04-02 18:50:31 -04:00
b650f8ff6d Update dockerode/docker-modem dependencies for fixes
Change-type: patch
Signed-off-by: Ken Bannister <kb2ma@runbox.com>
2025-04-02 18:47:43 -04:00
58234f17e1 v21.1.4 2025-04-02 09:16:30 +00:00
77905f4a74 Merge pull request #2928 from balena-io/comment_sig_file
Add comment with example of signature file in a flasher image
2025-04-02 09:15:23 +00:00
30076fabe6 Dedupe dependencies 2025-04-01 18:25:20 -04:00
28703bb5ae Add comment with secure boot signature file example for preload
Change-type: patch
Signed-off-by: Ken Bannister <kb2ma@runbox.com>
2025-04-01 18:25:16 -04:00
37b3c6abe9 v21.1.3 2025-03-28 16:57:03 +00:00
b4e473e4d4 Merge pull request #2927 from balena-io/fix-ob-device-detail
Fix device detail for open balena
2025-03-28 16:55:56 +00:00
0d4e411777 Fix device detail for open balena
Change-type: patch
2025-03-28 13:29:52 -03:00
7 changed files with 149 additions and 138 deletions

View File

@ -1,3 +1,43 @@
- commits:
- subject: Update dockerode/docker-modem dependencies for fixes
hash: b650f8ff6d01d2144886253f93aa1d1867f51980
body: ""
footer:
Change-type: patch
change-type: patch
Signed-off-by: Ken Bannister <kb2ma@runbox.com>
signed-off-by: Ken Bannister <kb2ma@runbox.com>
author: Ken Bannister
nested: []
version: 21.1.5
title: ""
date: 2025-04-03T13:28:08.855Z
- commits:
- subject: Add comment with secure boot signature file example for preload
hash: 28703bb5ae13539ab4c1c597e6a53a5292a7edde
body: ""
footer:
Change-type: patch
change-type: patch
Signed-off-by: Ken Bannister <kb2ma@runbox.com>
signed-off-by: Ken Bannister <kb2ma@runbox.com>
author: Ken Bannister
nested: []
version: 21.1.4
title: ""
date: 2025-04-02T09:16:27.791Z
- commits:
- subject: Fix device detail for open balena
hash: 0d4e411777dd53d83c475da3653ab94176e07d7d
body: ""
footer:
Change-type: patch
change-type: patch
author: Otavio Jacobi
nested: []
version: 21.1.3
title: ""
date: 2025-03-28T16:57:00.250Z
- commits: - commits:
- subject: Deny preload for an image with secure boot enabled - subject: Deny preload for an image with secure boot enabled
hash: 7f2daeebb0973a59682ba4300e1b00bce6f6aead hash: 7f2daeebb0973a59682ba4300e1b00bce6f6aead

View File

@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY! automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/). This project adheres to [Semantic Versioning](http://semver.org/).
## 21.1.5 - 2025-04-03
* Update dockerode/docker-modem dependencies for fixes [Ken Bannister]
## 21.1.4 - 2025-04-02
* Add comment with secure boot signature file example for preload [Ken Bannister]
## 21.1.3 - 2025-03-28
* Fix device detail for open balena [Otavio Jacobi]
## 21.1.2 - 2025-03-27 ## 21.1.2 - 2025-03-27
* Deny preload for an image with secure boot enabled [Ken Bannister] * Deny preload for an image with secure boot enabled [Ken Bannister]

64
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "balena-cli", "name": "balena-cli",
"version": "21.1.2", "version": "21.1.5",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "balena-cli", "name": "balena-cli",
"version": "21.1.2", "version": "21.1.5",
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
@ -34,9 +34,9 @@
"common-tags": "^1.7.2", "common-tags": "^1.7.2",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"denymount": "^2.3.0", "denymount": "^2.3.0",
"docker-modem": "5.0.5", "docker-modem": "^5.0.6",
"docker-progress": "^5.1.3", "docker-progress": "^5.1.3",
"dockerode": "4.0.3", "dockerode": "^4.0.5",
"ejs": "^3.1.6", "ejs": "^3.1.6",
"etcher-sdk": "9.1.0", "etcher-sdk": "9.1.0",
"express": "^4.17.2", "express": "^4.17.2",
@ -2682,13 +2682,13 @@
} }
}, },
"node_modules/@inquirer/core/node_modules/@types/node": { "node_modules/@inquirer/core/node_modules/@types/node": {
"version": "22.13.13", "version": "22.14.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz",
"integrity": "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==", "integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~6.20.0" "undici-types": "~6.21.0"
} }
}, },
"node_modules/@inquirer/core/node_modules/ansi-escapes": { "node_modules/@inquirer/core/node_modules/ansi-escapes": {
@ -2749,10 +2749,11 @@
} }
}, },
"node_modules/@inquirer/core/node_modules/undici-types": { "node_modules/@inquirer/core/node_modules/undici-types": {
"version": "6.20.0", "version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"dev": true "dev": true,
"license": "MIT"
}, },
"node_modules/@inquirer/core/node_modules/wrap-ansi": { "node_modules/@inquirer/core/node_modules/wrap-ansi": {
"version": "6.2.0", "version": "6.2.0",
@ -5829,9 +5830,9 @@
} }
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.17.27", "version": "20.17.30",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.27.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.30.tgz",
"integrity": "sha512-U58sbKhDrthHlxHRJw7ZLiLDZGmAUOZUbpw0S6nL27sYUdhvgBLCRu/keSd6qcTsfArd1sRFCCBxzWATGr/0UA==", "integrity": "sha512-7zf4YyHA+jvBNfVrk2Gtvs6x7E8V+YDW05bNfG2XkWDJfYRXrTiP/DsB2zSYTaHX0bGIujTBQdMVAhb+j7mwpg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~6.19.2" "undici-types": "~6.19.2"
@ -9466,9 +9467,9 @@
"integrity": "sha512-6+VnnhZpxwWvvKwjkRnuqlTtlBRJuM+3cCSXmZoYhyXcdgxx6l/3lwYpqmJ9qmhzgWVeATkpVsTua92BsObJjw==" "integrity": "sha512-6+VnnhZpxwWvvKwjkRnuqlTtlBRJuM+3cCSXmZoYhyXcdgxx6l/3lwYpqmJ9qmhzgWVeATkpVsTua92BsObJjw=="
}, },
"node_modules/docker-modem": { "node_modules/docker-modem": {
"version": "5.0.5", "version": "5.0.6",
"resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.5.tgz", "resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.6.tgz",
"integrity": "sha512-Cxw8uEcvNTRmsQuGqzzfiCnfGgf96tVJItLh8taOX0miTcIBALKH5TckCSuZbpbjP7uhAl81dOL9sxfa6HgCIg==", "integrity": "sha512-ens7BiayssQz/uAxGzH8zGXCtiV24rRWXdjNha5V4zSOcxmAZsfGVm/PPFbwQdqEkDnhG+SyR9E3zSHUbOKXBQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"debug": "^4.1.1", "debug": "^4.1.1",
@ -9515,34 +9516,23 @@
} }
}, },
"node_modules/dockerode": { "node_modules/dockerode": {
"version": "4.0.3", "version": "4.0.5",
"resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.3.tgz", "resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.5.tgz",
"integrity": "sha512-QSXJFcBQNaGZO6U3qWW4B7p8yRIJn/dWmvL2AQWfO/bjptBBO6QYdVkYSYFz9qoivP2jsOHZfmXMAfrK0BMKyg==", "integrity": "sha512-ZPmKSr1k1571Mrh7oIBS/j0AqAccoecY2yH420ni5j1KyNMgnoTh4Nu4FWunh0HZIJmRSmSysJjBIpa/zyWUEA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@balena/dockerignore": "^1.0.2", "@balena/dockerignore": "^1.0.2",
"@grpc/grpc-js": "^1.11.1", "@grpc/grpc-js": "^1.11.1",
"@grpc/proto-loader": "^0.7.13", "@grpc/proto-loader": "^0.7.13",
"docker-modem": "^5.0.5", "docker-modem": "^5.0.6",
"protobufjs": "^7.3.2", "protobufjs": "^7.3.2",
"tar-fs": "~2.0.1", "tar-fs": "~2.1.2",
"uuid": "^10.0.0" "uuid": "^10.0.0"
}, },
"engines": { "engines": {
"node": ">= 8.0" "node": ">= 8.0"
} }
}, },
"node_modules/dockerode/node_modules/tar-fs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.1.tgz",
"integrity": "sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==",
"dependencies": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.0.0"
}
},
"node_modules/dockerode/node_modules/uuid": { "node_modules/dockerode/node_modules/uuid": {
"version": "10.0.0", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz",
@ -16338,9 +16328,9 @@
} }
}, },
"node_modules/patch-package/node_modules/yaml": { "node_modules/patch-package/node_modules/yaml": {
"version": "2.7.0", "version": "2.7.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz",
"integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==",
"license": "ISC", "license": "ISC",
"bin": { "bin": {
"yaml": "bin.mjs" "yaml": "bin.mjs"

View File

@ -1,6 +1,6 @@
{ {
"name": "balena-cli", "name": "balena-cli",
"version": "21.1.2", "version": "21.1.5",
"description": "The official balena Command Line Interface", "description": "The official balena Command Line Interface",
"main": "./build/app.js", "main": "./build/app.js",
"homepage": "https://github.com/balena-io/balena-cli", "homepage": "https://github.com/balena-io/balena-cli",
@ -214,9 +214,9 @@
"common-tags": "^1.7.2", "common-tags": "^1.7.2",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"denymount": "^2.3.0", "denymount": "^2.3.0",
"docker-modem": "5.0.5", "docker-modem": "^5.0.6",
"docker-progress": "^5.1.3", "docker-progress": "^5.1.3",
"dockerode": "4.0.3", "dockerode": "^4.0.5",
"ejs": "^3.1.6", "ejs": "^3.1.6",
"etcher-sdk": "9.1.0", "etcher-sdk": "9.1.0",
"express": "^4.17.2", "express": "^4.17.2",
@ -276,6 +276,6 @@
} }
}, },
"versionist": { "versionist": {
"publishedAt": "2025-03-27T12:20:23.852Z" "publishedAt": "2025-04-03T13:28:09.802Z"
} }
} }

View File

@ -77,103 +77,59 @@ export default class DeviceCmd extends Command {
const balena = getBalenaSdk(); const balena = getBalenaSdk();
const device = (await balena.models.device.get( let device: ExtendedDevice;
params.uuid, if (options.json) {
options.json const [deviceBase, deviceComputed] = await Promise.all([
? { balena.models.device.get(params.uuid, {
$select: [ $expand: {
'id', device_tag: {
'belongs_to__application', $select: ['tag_key', 'value'],
'belongs_to__user',
'actor',
'is_pinned_on__release',
'device_name',
'is_of__device_type',
'uuid',
'is_running__release',
'note',
'local_id',
'status',
'update_status',
'last_update_status_event',
'is_online',
'last_connectivity_event',
'is_connected_to_vpn',
'last_vpn_event',
'ip_address',
'mac_address',
'public_address',
'os_version',
'os_variant',
'supervisor_version',
'should_be_managed_by__release',
'should_be_operated_by__release',
'is_managed_by__service_instance',
'provisioning_progress',
'provisioning_state',
'download_progress',
'is_web_accessible',
'longitude',
'latitude',
'location',
'custom_longitude',
'custom_latitude',
'is_locked_until__date',
'is_accessible_by_support_until__date',
'created_at',
'modified_at',
'is_active',
'api_heartbeat_state',
'changed_api_heartbeat_state_on__date',
'memory_usage',
'memory_total',
'storage_block_device',
'storage_usage',
'storage_total',
'cpu_temp',
'cpu_usage',
'cpu_id',
'is_undervolted',
// explicit read
'overall_status',
'overall_progress',
'should_be_running__release',
],
$expand: {
device_tag: {
$select: ['tag_key', 'value'],
},
...expandForAppName.$expand,
}, },
} ...expandForAppName.$expand,
: {
$select: [
'device_name',
'id',
'overall_status',
'is_online',
'ip_address',
'mac_address',
'last_connectivity_event',
'uuid',
'supervisor_version',
'is_web_accessible',
'note',
'os_version',
'memory_usage',
'memory_total',
'public_address',
'storage_block_device',
'storage_usage',
'storage_total',
'cpu_usage',
'cpu_temp',
'cpu_id',
'is_undervolted',
],
...expandForAppName,
}, },
)) as ExtendedDevice; }),
balena.models.device.get(params.uuid, {
$select: [
'overall_status',
'overall_progress',
'should_be_running__release',
],
}),
]);
device = {
...deviceBase,
...deviceComputed,
} as ExtendedDevice;
} else {
device = (await balena.models.device.get(params.uuid, {
$select: [
'device_name',
'id',
'overall_status',
'is_online',
'ip_address',
'mac_address',
'last_connectivity_event',
'uuid',
'supervisor_version',
'is_web_accessible',
'note',
'os_version',
'memory_usage',
'memory_total',
'public_address',
'storage_block_device',
'storage_usage',
'storage_total',
'cpu_usage',
'cpu_temp',
'cpu_id',
'is_undervolted',
],
...expandForAppName,
})) as ExtendedDevice;
}
if (options.view) { if (options.view) {
const open = await import('open'); const open = await import('open');

View File

@ -162,8 +162,13 @@ Can be repeated to add multiple certificates.\
); );
} }
// Verify that image is not enabled for secure boot. First, confirm it // Verify that image is not enabled for secure boot. First, confirm it is
// is a secure boot image with an /opt/*.sig file in the rootA partition. // a secure boot image with a .sig file in the /opt directory of the rootA
// partition. For example, below are contents for generic-amd64 device type:
// $ ls -l opt
// total 864696
// -rw-r--r-- 1 root root 2378170368 Mar 26 09:14 balena-image-generic-amd64.balenaos-img
// -rw-r--r-- 1 root root 512 Mar 9 2018 balena-image-generic-amd64.balenaos-img.sig
const { explorePartition, BalenaPartition } = await import( const { explorePartition, BalenaPartition } = await import(
'../../utils/image-contents' '../../utils/image-contents'
); );

View File

@ -114,6 +114,14 @@ describe('balena device', function () {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}); });
api.scope
.get(
/^\/v\d+\/device\?.+&\$select=overall_status,overall_progress,should_be_running__release$/,
)
.replyWithFile(200, path.join(apiResponsePath, 'device.json'), {
'Content-Type': 'application/json',
});
const { out, err } = await runCommand('device 27fda508c --json'); const { out, err } = await runCommand('device 27fda508c --json');
expect(err).to.be.empty; expect(err).to.be.empty;
const json = JSON.parse(out.join('')); const json = JSON.parse(out.join(''));