diff --git a/Dockerfile b/Dockerfile index 8921798..63bf3d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM matomo:5.1.1 +FROM matomo:5.1.2 # Add the EnvironmentVariables plugin -COPY ./files/plugin-EnvironmentVariables-5.0.0/ /var/www/html/plugins/EnvironmentVariables +COPY ./files/plugin-EnvironmentVariables-5.0.2/ /var/www/html/plugins/EnvironmentVariables # Add the CustomVariables plugin COPY ./files/plugin-CustomVariables-5.0.2/ /var/www/html/plugins/CustomVariables diff --git a/README.md b/README.md index a12417e..1096760 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Merge a PR to `main` to build, tag, and push the container to Stage-Workloads. A ## Implementation notes -For detailed instructions on initial setup, migration, database upgrades, and application upgrades, see [docs/HOWTO.md](./docs/HOWTO.md). +For detailed instructions on initial setup, migration, database upgrades, and application upgrades, check the [HowTos](./docs/HowTos/) folder. ### Configuration Management diff --git a/files/plugin-EnvironmentVariables-5.0.2/CHANGELOG.md b/files/plugin-EnvironmentVariables-5.0.2/CHANGELOG.md new file mode 100644 index 0000000..7954ee0 --- /dev/null +++ b/files/plugin-EnvironmentVariables-5.0.2/CHANGELOG.md @@ -0,0 +1,19 @@ +## Changelog + +### 5.0.2 - 2024-10-21 +- Documentation updated to hard code config + +### 5.0.1 +- Added plugin category for Marketplace + +### 5.0.0 +- Compatibility with Matomo 5 + +### 4.0.1 +- Compatibility with PHP DI 6 + +### 4.0.0 +- Compatibility with Matomo 4 + +### 3.0.0 + * Initial version diff --git a/files/plugin-EnvironmentVariables-5.0.2/EnvironmentVariables.php b/files/plugin-EnvironmentVariables-5.0.2/EnvironmentVariables.php new file mode 100644 index 0000000..c360861 --- /dev/null +++ b/files/plugin-EnvironmentVariables-5.0.2/EnvironmentVariables.php @@ -0,0 +1,44 @@ +.conf`. +* When defining the database credentials as environment variables, you may have to hard code the configs indicating that this plugin is activated, like the following: +``` +[PluginsInstalled] +PluginsInstalled[] = "EnvironmentVariables" + +[Plugins] +Plugins[] = "EnvironmentVariables" +``` +Another option is to use the following console commands during the deployment process: +``` +./console config:set 'Plugins.Plugins[]="EnvironmentVariables"' +./console config:set 'PluginsInstalled.PluginsInstalled[]="EnvironmentVariables"' +``` + diff --git a/files/plugin-EnvironmentVariables-5.0.2/config/config.php b/files/plugin-EnvironmentVariables-5.0.2/config/config.php new file mode 100644 index 0000000..413df30 --- /dev/null +++ b/files/plugin-EnvironmentVariables-5.0.2/config/config.php @@ -0,0 +1,32 @@ + \Piwik\DI::decorate(function ($previous, \Piwik\Container\Container $c) { + $settings = $c->get(\Piwik\Application\Kernel\GlobalSettingsProvider::class); + + $ini = $settings->getIniFileChain(); + $all = $ini->getAll(); + foreach ($all as $category => $settings) { + $categoryEnvName = 'MATOMO_' . strtoupper($category); + foreach ($settings as $settingName => $value) { + $settingEnvName = $categoryEnvName . '_' .strtoupper($settingName); + + $envValue = getenv($settingEnvName); + if ($envValue !== false) { + $general = $previous->$category; + $general[$settingName] = $envValue; + $previous->$category = $general; + } + } + } + + return $previous; + }), +]; \ No newline at end of file diff --git a/files/plugin-EnvironmentVariables-5.0.2/plugin.json b/files/plugin-EnvironmentVariables-5.0.2/plugin.json new file mode 100644 index 0000000..c5ca27e --- /dev/null +++ b/files/plugin-EnvironmentVariables-5.0.2/plugin.json @@ -0,0 +1,25 @@ +{ + "name": "EnvironmentVariables", + "description": "Allows you to specify Matomo config in environment variables instead of the config file.", + "version": "5.0.2", + "theme": false, + "require": { + "matomo": ">=5.0.0-b1,<6.0.0-b1" + }, + "authors": [ + { + "name": "Matomo", + "email": "hello@matomo.org", + "homepage": "https://matomo.org" + } + ], + "support": { + "email": "", + "issues": "https://github.com/matomo-org/plugin-EnvironmentVariables/issues/", + "forum": "https://forum.matomo.org" + }, + "homepage": "https://matomo.org", + "license": "GPL v3+", + "keywords": ["php", "environment", "variables", "configuration"], + "category": "database" +}