-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add database structure check in SettingsPiwik #23812
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
base: 5.x-dev
Are you sure you want to change the base?
Conversation
Added a check to verify if the database structure is installed. So the installer can run when the config file is pre-configured, or in conjunction with plugin-EnvironmentVariables
|
@kumy Wouldn't it be enough if you set |
|
@sgiehl having to do I can look to add a cache on that check, any tip on an example somewhere else in the base code? |
|
The installation process should normally modify the config file anyway (and also remove |
yeah we saw that :/ and fight a bit with it. On first time install, we only need to do a service restart (not a full chain of commit + deploy) to restore the config as we expect it to be.
This is exactly what we tried to achieve in our "GitOps world". What issue do you think we will encounter? I quickly had a look at caching and found usage of // Check the database structure
$cacheId = 'isInstalled';
$cache = PiwikCache::getTransientCache();
if ($cache->contains($cacheId)) {
return $cache->fetch($cacheId);
}
if (!DbHelper::isInstalled()) {
return false;
}
$cache->save($cacheId, true);
return true;
} |
There are a couple of configurations and actions within the Matomo admin that may result in changing config flags in the config. If writing the config file doesn't work it may display errors accordingly.
The transient cache is only for that one request, but it won't prevent other requests to do the table checks again. We may need to check if there is a better way to achieve that in general. 🤔 I guess what you actually would need is a command to execute the installation (or parts of it) in general, as requested in #10257, right? |
|
Reading #10257 and effectively the first posts look close to what we need... Will continue reading... Thanks
I'll not be the best one to do that :/ |
Description
Added a check to verify if the database structure is installed. So the installer can run when the config file is pre-configured, or in conjunction with plugin-EnvironmentVariables.
We're trying to deploy a matomo as a stateless container, for that we preconfigure the config.ini.php using docker configs., But as the the
usernameis set in the config that prevent the installer from running the initial wizard.Checklist
Review