Shared configuration settings for bootstrapping

I’ve been writing agent/device code to enable my imps to be configured from settings stored in an online database (Firebase). The idea is to make the initialization of each device as parameterized as possible, so there’s no need for hardcoded configuration values directly in the code files. In this way all imps can use identical versions of common boilerplate code (for mail notification, logging and posting to IoT channels, etc.). On start-up each device then just has to fetch it’s own configuration settings from the database (basically by doing a look-up on some hash of the device identifier).

It works pretty well now. However, there’s one last hardcoded piece left, and that’s the connection string for the Firebase database (URL and stuff). It is needed for bootstrapping everything else and obviously has to go somewhere Currently, the only option is to embed it directly in the code. Instead, it would be nice if this information could be saved in some kind of environment variable in the IDE to be shared among all running agents within the same account/group/model. Any thoughts on this from the Imp team? Perhaps it’s already on the list - or maybe something similar is available to commercial users?

Thats a good idea. I will suggest it to the team.


I’m still hoping for some qualified feedback…
It would be interesting to know if there are any plans of supporting environment variables within the IDE - and also if anybody else has been working on some kind of bootstrapping mechanism for the Imp?

Generally, commercial customers bootstrap agents from the app that blinks them up - this can then populate the server.load/save storage with information for that device.

You can do this with a one-time curl to the agent URL, but it doesn’t get more automatic than that. Currently no plans for environment variables, though your original request is filed in our system as a request.

Thanks for the feedback, Hugo.
Configuring the agents from the outside with curl is an interesting idea, however, it would still be an “per agent” thing to do, and I’m more looking for a solution where all agents/devices would be able to configure themselves. Without something like environment variables this is still (almost) possible; it just requires that extra configuration setting to be embedded in the code (in my case the Firebase URL). That’s okay.