Skip to content
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

Control the entire configuration with an ENV variable #192

Closed
spawnia opened this issue Sep 13, 2018 · 0 comments
Closed

Control the entire configuration with an ENV variable #192

spawnia opened this issue Sep 13, 2018 · 0 comments
Assignees

Comments

@spawnia
Copy link
Contributor

spawnia commented Sep 13, 2018

Motivation

I frequently need to change configuration values other then the ones that are currently provided via ENV variables. However, mounting a volume is very inconvenient when deploying the container to a cluster. My solution so far has been to build a seperate image with the configuration baked in.

Idea

How about we just allow the user to put in any configuration in a new ENV variable called PMA_CONFIG and then just do the following in config.inc.php:

if (isset($_ENV['PMA_CONFIG'])) {
    eval($_ENV['PMA_CONFIG']);
}

So the container could be run like this:

docker run -p 80:80 -e PMA_CONFIG='$cfg["SomeObscureConfig"] = "foobar";' phpmyadmin

That would allow the user to use any configuration option, without supplying a file - and without us having to do mapping for each and every single option.

Caveats

We would have to provide a section on how to properly escape code in env variables. I did
not get to do much experimentation yet, because the local docker build is failing for me.
But i foresee that some special chars like $'"& might be troublesome.

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

Successfully merging a pull request may close this issue.

2 participants