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

Read Environment variables into Matomo config #10914

Closed
pierreozoux opened this issue Nov 26, 2016 · 16 comments
Closed

Read Environment variables into Matomo config #10914

pierreozoux opened this issue Nov 26, 2016 · 16 comments
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@pierreozoux
Copy link

Modern web application read their config from env variables.

https://12factor.net/config

it would be a really nice to have :)

@tsteur
Copy link
Member

tsteur commented Nov 27, 2016

This would be useful for passwords etc. For other config there is some "danger" that config is not the same on all servers which causes Piwik to not work properly etc but for passwords it would be useful for sure

@mattab mattab added this to the Backlog (Help wanted) milestone Dec 6, 2016
@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Dec 6, 2016
@SonOfBytes
Copy link

Yes 12 factor support (environment var injection) for all the variables that happen at config would be really useful. That would allow us to run dev/staging piwik containers on the same hosts pointing to separate DBs etc.

@webwurst
Copy link

For configuration env variables are great, but it is discouraged to use them for secrets: moby/moby#9176 (comment)

@SonOfBytes
Copy link

Secrets are not a clear definition, because the domain of trust needs to be known. Often secrets contained to the environment is good enough so trying to protect processes from each other is overkill. Other times not leaking to the underlying system is critical. The solution and the controls it offers needs to be assessed with the risk and against relevant attack trees.

So for example using something like credstash in the container runtime to inject sensitive vars is good enough for many use cases as it is separating the management of the app from the management of the environment it is running in.

@butzopower
Copy link

This would specifically be useful for deploying Piwik on cloud-based platforms with ephemeral filesystems that don't persist file changes across deploys / restarts, such as Cloud Foundry or Heroku.

@vfbsilva
Copy link

Any advance regarding this?

@mattab
Copy link
Member

mattab commented Jun 21, 2017

Not yet

Update Oct 29th: scheduling this issue

@mattab mattab modified the milestones: Backlog (Help wanted), 3.7.0 Oct 28, 2018
@mattab mattab changed the title Read env vars to config piwik Read Enrionment variables into Matomo config Oct 28, 2018
@mattab mattab changed the title Read Enrionment variables into Matomo config Read Environment variables into Matomo config Oct 28, 2018
@mattab
Copy link
Member

mattab commented Oct 31, 2018

Hi @pierreozoux @vfbsilva @SonOfBytes
We are considering implementing this feature in a plugin.
Could you maybe confirm if reading ENV variables was for database information (host, name, password,...) only if if you had other use cases of ENV variables for Matomo?

@bbodenmiller
Copy link

bbodenmiller commented Nov 6, 2018

I think it could be useful for pretty much all settings. Take Grafana for instance... all settings can be set by env variable: http://docs.grafana.org/installation/configuration/#using-environment-variables

@tsteur
Copy link
Member

tsteur commented Nov 7, 2018

FYI: I've implemented to read database config from environment variables optionally during installation see #13676

To read any other variables during runtime basically I suggest someone could work on a plugin. I might quickly have a look if that plugin can be easily developed.

@tsteur
Copy link
Member

tsteur commented Nov 7, 2018

Was quick to build... maybe someone give https://github.com/matomo-org/plugin-EnvironmentVariables a test and then we could publish it on the marketplace. I haven't really tested it myself.

@tsteur tsteur self-assigned this Nov 7, 2018
@pierreozoux
Copy link
Author

Wow :) amazing ;)

Https://12factor.net ftw!

@mattab
Copy link
Member

mattab commented Dec 24, 2018

Hi @pierreozoux
Did you maybe have a chance to test the new plugin at https://github.com/matomo-org/plugin-EnvironmentVariables ?

I'm closing this as done as AFAIK @baywet is using it for a private project and it was working 🎉

@mattab mattab closed this as completed Dec 24, 2018
@ZuSe
Copy link

ZuSe commented Dec 25, 2018

Hey @mattab

I am testing this just know as I want to get matomo running in a cloud foundry environment (on bluemix).

I added the Plugin to my project and installed it to my plugin folder. For now the default CF variable names seem not to be supported so I set them on my own with the app. However the first deployment shows me now:

SQLSTATE[HY000] [2002] No such file or directory

Not sure if really works. I will dig deeper into it.

Best
Patrick

@toredash
Copy link
Contributor

@ZuSe
I've got the same issue, matomo-org/plugin-EnvironmentVariables#1

@mingfang
Copy link

we need matomo to support env variables natively, not using another plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests