balena-labs-projects / balena-node-red

a node-red application with balena-supervisor support, can be managed remotely via balena publicURL
Apache License 2.0
60 stars 59 forks source link

node-red env variables in development mode #9

Closed esaheiskanen closed 4 years ago

esaheiskanen commented 6 years ago

Hi!

How can I define USERNAME and PASSWORD env variables when developing in local mode? I tried to add them to docker file without success

ENV PASSWORD="YYYY" \
        USERNAME="XXX"
esaheiskanen commented 6 years ago

Ok, I think i found solution from resin-cli: https://docs.resin.io/tools/cli/#envs

esaheiskanen commented 6 years ago

Added USERNAME and PASSWORD as envs but still no go, login failed. Maybe because of dollar sign at the beginning of the hash?

sudo resin envs --device XYZ       
ID    NAME     VALUE
56468 PASSWORD $xxxxxxxxxxxxxxxx
50925 PORT     80
56469 USERNAME yyyyyyyyy
curcuz commented 6 years ago

hi @esaheiskanen do you mean Local Mode?

curcuz commented 6 years ago

if so, please refer to this: https://docs.resin.io/development/local-mode/

In your code you will still have access to most of the regular resin.io device features. For example, you will still be able to query and use the supervisor API. However, you will notice that your local mode device will not push logs back to the resin.io dashboard and you won't be able to set environment variables from the dashboard, but you can set them in your .resin-sync.yml.