hello
for my students i am preparing iot infrastructure, where balena will be installed on rpi microcomputers as IoT Gateway. the first service, which will start before others, will be a “provisioning” service, which will setup every service (e.g. wifi ssid and password, credentials for local access to mqtt, copy and setup initial configuration files, …). when it will be over, my idea is to publish all this created credentials to balena notes on device summary page, so i will be able to come to them later, e.g. when i will need to pass them to students.
so few questions:
- how am i able to set notes from inside the device? i know it is possible to do it with balenaCloud API Resources with curl, but i need the authentication token for this purpose. is it possible to do it somehow without it? with local supervisor api?
- if the usage of the balenaCloud API Resources is the only way how to do it, then - what is the best practice to pass the authentication token to running service? to pass it as environment variable in docker compoe file? but then it will be exposed in git at least or with the balena secrets?
- do you have any recommendation, how to know, this is the first run of the device/service? i can check the presence of config files, but maybe there is a better way.
i am still new to balena, so any advice will be great.
thanks.
mirek