Skip to content

Config file support instead of requiring environment variables. #5

Open
BrettSheleski wants to merge 4 commits into
petkov:masterfrom
BrettSheleski:master
Open

Config file support instead of requiring environment variables. #5
BrettSheleski wants to merge 4 commits into
petkov:masterfrom
BrettSheleski:master

Conversation

@BrettSheleski
Copy link
Copy Markdown
Collaborator

I made these changes a while ago. I just thought I'd share.

Comment thread index.js
password: process.env.MQTT_PASS || '',
clientId: process.env.MQTT_CLIENT_ID || null
clientId: process.env.MQTT_CLIENT_ID || null,
protocol: process.env.MQTT_PROTOCOL || 'mqtt'
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to set protocol. I usually set it using host like mqtts://mqtt.com:123456. Also I don't like to have mqtt as default, this might be a security bridge. I think mqtts is better.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to set the protocol if the host is anything but null. Otherwise the mqtt library throws an exception.

Default to mqtts if you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants