Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mqtt password in environment variable #2449

Closed
alessandro-gomma opened this issue Mar 27, 2024 · 1 comment
Closed

Mqtt password in environment variable #2449

alessandro-gomma opened this issue Mar 27, 2024 · 1 comment

Comments

@alessandro-gomma
Copy link

Hi!

We are facing a problem while trying to move the password that we use to connect to mqtt to an environment variable.

We feel that the problem might be caused by the presence of the $ character in the password (the password we are using is Benthos1234!$@)

The other parameters (url, user, ecc) are correctly retrieved, so we exclude an issue on that side; we also tried to escape the password parameter (${{MQTT_PASSWORD}}) as suggested in the Interpolation guide

Here's part of the configuration file we are using:

input:
  mqtt:
    urls: ["${MQTT_URL}"]
    client_id: 
    user: "${MQTT_USER}"
    password: "${MQTT_PASSWORD}"
    connect_timeout: 30s
    qos: 1
    topics: ["command/${TENANT_ID}/#"]
@mihaitodor
Copy link
Collaborator

Hey @alessandro-gomma 👋 I think that might be due to the way the shell is handling environment variables. That sequence of characters is causing trouble for me as well in zsh on OSX, so I'm not sure what needs to be escaped or how, but it should work if you create a foo.env file (you can call it whatever you want) containing MQTT_PASSWORD =Benthos1234!$@ and then run benthos -e foo.env -c test.yaml.

PS: Converting this into a discussion as per #2026.

@redpanda-data redpanda-data locked and limited conversation to collaborators Mar 28, 2024
@mihaitodor mihaitodor converted this issue into discussion #2451 Mar 28, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants