Is it possible for a service itself to change the value of environment variables (or create new ones) through the supervisor API? We have a some settings that we would like the user to control through our embedded UI (e.g., specify access keys), and that we want to be persistent through resets, but that we would also like to be able to view and modify ourselves through Balena Dashboard for support purposes.
Right now we’re using environment/service variables to do this, which works quite well from the back-end through the dashboard, but doesn’t give us a way to let the user control them through the UI. Similarly, we can change and store settings through the UI by storing the values in persistent storage on the device, but then they are much more complicated to access through the dashboard (ssh into a running service, locate the config file on the device, use
vi or similar to edit it, manually restart the service or application).
Ideally, we would like to restrict which variables could be changed, but that’s less critical since the actual supervisor calls would be performed within our own code.