Add enviroment variable for device name


#1

It would be useful to have the device name shown in the UI in some cases.
My use-case for this would be to use it as initial, default username or password for the application, having the benefit of being (at least somewhat) unique, yet easily accessible.

As the default user is created when initializing the device for the first time, setting a random enviromental variable in the UI is impossible (or at least I have to watch the progress of initializing the device very closely).

Another option could of course be the possibility to have an application specific, global variable which would be initialized to a random value on per instance basis.


#2

Bah, now that I checked the environment variables set, turns out I can use the device UUID as such. For reference, it’s set as RESIN_DEVICE_UUID. This works great as a “backdoor” password for the default account, as it cannot be changed and is set at boot :smile:

So from now on I’ll be setting the default account password to UUID when initializing the device and creating a custom account after that. Are there any security concerns related to this, as I understand it’s only shown via UI and API to authenticated users?


#3

Hi.

You’re right, the UUID is normally not exposed / visible to the 3rd parties until you share it yourself.

One case for sharing it is: Public URL feature. If you use the Public URL it includes the UUID so as soon as you share the URL with anybody you disclose your device’s UUID.


#4

Good point, although I haven’t planned on using the feature, at least not yet…
In any case, I think it’s better to revise the password generation to include an application specific, global environment variable. This way I can fairly safely generate unique passwords, without accidentally sharing them.

Thanks for your input :slight_smile:


#5

Hey, would the RESIN_DEVICE_NAME_AT_INIT be good for what you were thinking about originally? (see the docs)