balena-os / balena-supervisor

Balena Supervisor: balena's agent on devices.
https://balena.io
Other
148 stars 63 forks source link

Should return release `raw_version` where possible if returning `commit` #2159

Open myarmolinsky opened 1 year ago

myarmolinsky commented 1 year ago

i.e. https://github.com/balena-os/balena-supervisor/blob/e36060aa293f4a0b7d5d41ddb353c3bcccc110a4/src/device-api/v2.ts#L157 (if possible)

Forums thread: https://jel.ly.fish/support-thread-discourse-367420 Zulip thread: https://balena.zulipchat.com/#narrow/stream/346010-channel.2Fsupport/topic/curl.20supervisor.20endpoint.20with.20params

jellyfish-bot commented 1 year ago

[myarmolinsky] This has attached https://jel.ly.fish/f7466cce-927a-42dd-a31c-e4957ddd6a86

pipex commented 1 year ago

This requires an API change first, as the supervisor does not receive the version information via the target state

rosswesleyporter commented 1 year ago

Another customer requested this, specifically getting release semvar from Supervisor API. See https://balena.zulipchat.com/#narrow/stream/345882-_help/topic/get.20release.20semvar.20from.20Supervisor.20API.3F

bbugh commented 7 months ago

Also requesting this.

The thread on the forum suggests using the web API, but we need this during a runtime startup process. If we can get the information from the device itself rather than potentially derailing our startup process because a web API isn't responding, it would be a lot better for us.

bbugh commented 7 months ago

It looks like calling the web API also requires including the API token on the devices, but our devices are on-site for the customers. Including a web API token opens us up to security issues we'd rather not deal with.

pipex commented 7 months ago

@bbugh regarding security. Using the io.balena.features.balena-api feature label will give a service access to the device API key, which is what the supervisor uses to communicate to the API and has read-only permissions to the release entity.