Request ENV variables to also be shown in the context menu

In the edit screen on the right there are options for showing either:
information
help
debug
config
dashboard
context
and others.

In the context menu you can select/see
node
flow
and
global
values.

But with the option to have env variables in/on tabs it may be nice to see them listed here also.

That might be sensible.

You might not want to see external environment variables though as they are used by some to hold sensitive information (in the mistaken belief that they are somehow "secure" since they are not obviously visible - of course, since they are held in the OS memory, that isn't actually true).

I do agree in a lot of ways.

But I am really getting dizzy with env things just now and not being able to easily see them it became a bit of an unanswered question.

Like so many things in computing where do you draw the line.

But what's the difference between env and global then?
Only in that if env is also seen globally, I am not quite getting their exact meaning.

Ok, certain nodes need a key to use them.
That is - I'm guessing - stored in their env.
But then that gets into a grey area for me to where is that different to node context?
(Only that one is privte and one is public)

could you elaborate on where/how it fits in?
Is there flow, global and nodee env variables?
Would that be complicating things in that way?

That's a good question that has become a little blurred by how they are being used in sub-flows, tabs and groups.

Environment variables are just that, they exist in the Operating System environment, not strictly in Node-RED - or at least, that is the definition, whether that is how they are actually being implemented in sub-flows, tabs and groups is a matter that I've not looked into.

It would have been feasible in theory to implement more different types of context variable for those contexts.

However, the difference from a Node-RED perspective is that env variables can be incorporated into other inputs. So you can do this:

image

Which you cannot do with a context/flow/global variable. In other words, they can be used even if someone has not allowed the specific use in the typed input field. They can also be used like this:

image

Which again cannot be done another way without using JSONata.

No, you cannot really have a node environment variable and there wouldn't be much point since you can simply use use a node's context store to do that (well, you can't do that in anything other than a function node - see the other thread on requesting context support in typed input for more on that subject).

Again, the real point of an environment variable is that they normally live in the Operating Systems memory space and not in Node-RED/node.js - it is simply that Node-RED's use of them in tabs, groups and sub-flows somewhat confuses that concept since those environment variables only live in Node-RED's memory space (which doesn't make it wrong or less useful, just confusing). A context/flow/global variable always lives in Node-RED's memory space (though it may ALSO live in a permanent store as well if you have defined one in settings.js).

Yes. :grin:

Ok.

Thanks.

I may leave well enough alone then.

Thanks.

Not worth any more action.

Just so you would get an idea of what you are asking for, run this in a command window to see all the env vars.
printenv

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.