Skip to content

Update MQTT connection parameters to use environment variables#91

Open
mietzen wants to merge 3 commits intomiaucl:masterfrom
mietzen:patch-1
Open

Update MQTT connection parameters to use environment variables#91
mietzen wants to merge 3 commits intomiaucl:masterfrom
mietzen:patch-1

Conversation

@mietzen
Copy link

@mietzen mietzen commented Feb 23, 2026

This PR adds the ability to use connection parameters from environment variables.

Currently /proc/pid/cmdline will leak our user credentials. This PR enables us to use a environment file when starting the process via e.g. a systemd service:

EnvironmentFile=/opt/linux2mqtt/.env

The changes are non breaking, if no environment variables are set linux2mqtt will behave the same as before with or without --username / --password.

@github-actions github-actions bot added the 📖 documentation Improvements or additions to documentation label Feb 23, 2026
Corrected spelling of 'Environment' in README.
@miaucl
Copy link
Owner

miaucl commented Feb 26, 2026

Hey, thanks for the PR. In this case, I can understand the problem with the passwords. Why not allow to set all the parameters with via a .env? Might be worth to be considered.

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

Labels

📖 documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants