balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
453 stars 138 forks source link

balena push incorrectly interprets = in env var values #1705

Open CameronDiver opened 4 years ago

CameronDiver commented 4 years ago

The following command:

balena push --env "POSTGRESQL_DSN=postgres://loraserver_ns:59XTH2995@postgresql/loraserver_ns?sslmode=disable" d19baeb.local

will forward the environment variable to the supervisor as:

{ 'POSTGRESQL_DSN=postgres://loraserver_ns:59XTH2995@postgresql/loraserver_ns?sslmode': 'disable' }

(where the key is the env var name, and the value is the value)


Please note that this issue tracker is used for specific bug reports and feature requests. General and troubleshooting questions are encouraged to be posted to the balena forums, which are monitored by balena's support team and where the community can both contribute and benefit from the answers.

Before submitting this issue please check that this issue is not a duplicate. If there is another issue describing the same problem or feature please add your information to the existing issue's comments.

russellseymour commented 2 years ago

Is there any movement on this at all?

I am running in local mode and trying to send in a DSN as a runtime environment variable on the command line using:

balena push x.x.x.x --env CONNSTR="db://user:password@host/name"

However if the password contains an = symbol it causes issue when the container is pushed to the Raspberry Pi.

image

The situation in which the password contains the = is when using SaaS based database, such as InfluxDB. The password is a token, which is Base64 encoded, and that contains the = character.

If I remove the = from the password (which of course makes it invalid) the service starts properly:

image

I do not want to put this in as a buildArg because I do not want to bake this into the container. Is there a workaround I can use?