Configure OS without CLI

Hello there, :wave:

I am currently setting up a project where I want to generate BalenaOS .img files dynamically server-side and then serve them to user :ok_hand:

To achieve this, I am invoking the CLI
balena login
then balena os configure my-custom.img
then zip my-custom.img.zip my-custom.img
finally serve my-custom.img.zip

However, the process take a lot of time :snail: and since he whole process “only add the config.json in the .img disk file” I was wondering if it was possible (I have a preference for Python) to add it via the SDK or another tool either directly in the .img file on even better in the zipped .img file.

Thanks a lot for your experience sharing :handshake:

Thank you for your message.

Actually this is what balenaCloud does. However you can find the logics how to do it on etcher-sdk. You can download and configure a balenaOS image from s3 with this here etcher-sdk/balena-s3-configure.ts at master · balena-io-modules/etcher-sdk · GitHub

Clone the repo, run npm i then run ./node_modules/.bin/ts-node examples/balena-s3-configure.ts

Let us know if you succeed.