peterprib / node-red-contrib-kafka-manager

Implement
GNU General Public License v3.0
22 stars 12 forks source link

Set process.env Kafka Broker #51

Closed safikka closed 1 year ago

safikka commented 1 year ago

Hello Prib,

Thanks for your contribution for the Kafka-manager package. I have a problem setting the host broker using process.env Previously, I didn't really understand Javascript and I was a beginner. Where should I put process.env.name in settings.js? I've tried putting it outside of module.export, but on Node-RED a warning appears that it can't find process.env which I have set.

I’m eager to receive your feedback, thank you

peterprib commented 1 year ago

Its not clear of your expectation. Do I assume you want to set a shell variable for name and then consume such in the configuring of a node as that is the only way I can make sense of the use of "process.env". If so I haven't added this ability on many values however if I could readily implement if I thought sufficient demand. That is, allow a value to be set at node level, settings level or shell level. Can see this being useful for automated deployment.

safikka commented 1 year ago

image

How do I manually set the host using process.env as in the documentation? Where should I put the process.env.name in settings.js?

peterprib commented 1 year ago

This is a shell value. see https://nodejs.org/dist/latest-v8.x/docs/api/process.html#process_process_env

Basically set the value before starting node-red in command processor or set in profile. Varies depending on where node.js is executed (linux, windows, ....). One can set in node.js shell and could be placed in setting,js as should be actioned thus consumable and they are process based,