这是indexloc提供的服务,不要输入任何密码
Skip to content

Surprising shell interpolation messed my config values #4896

@benjamin-thomas

Description

@benjamin-thomas

Description of problem

A surprising change of behavior happened between v0.25.4 and v0.26.3

How reproducible

Prior to v0.26.3, I could inject an env var like this:

dokku config:set my_app VAR='$123*&456$'

And my app would indeed access VAR as $123*&456$

Upgrading to 0.26 caused VAR to be truncated as: *&456$. Note that this value was set months ago so this caused a production failure for me.

Furthermore, if i run this command on 0.26:

dokku config:set my_app VAR='$123'

Then other completely unrelated config values get interpolated

# I'm in my container here
env | grep VAR
VAR=--env=API=AAA

By using a leading backslash, I'm able to once again feed in the proper values to my app

dokku config:set my_app VAR='\$123'
# I'm in my container here
env | grep VAR
VAR=$123

I wouldn't think this change of behavior was intended (surprising!)

It seems $ gets evaluated by the shell somehow.

Let me know if you need more info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions