docker
docker copied to clipboard
fix version check without volume var/www/html
it fixes https://github.com/nextcloud/docker/issues/489
At the moment the upgrade does not work if there is no volume for /var/www/html/ as it checks /var/www/html/version.php to compare versions. This PR make it so it checks for the version in var/www/html/config which must be persisted and everyone is happy :)
This duplicates a lot of code from version_greater. Maybe a "greater or equal" function could cover both cases?
@J0WI I agree that it looks like there are some duplicated code but the procedure is not the same if the version is equal or greater.
If version is equal I just rsync the php code and do nothing whereas if the version is greater I rsync the php code and upgrade.
What would you recommend to refactor it?
You can move the duplicated part to a new function that can be called in both cases.
Has there been any update on this, it is sorely needed when running in a kubernetes environment where I would like to avoid mounting the php codebase on a remote share.
If @unteem is not responding you're welcome to continue here.
Does this really work?
If I I start the apache docker container with a NEXTCLOUD_CONFIG_DIR set, how does this check for the version then?
As far as I can tell new script only checks for the config.php in the default config directory?
And my second problem ist: even if I change the script to check in the NEXTCLOUD_CONFIG_DIR, there is no version number set in my config.php
it looks like this:
<?php
$CONFIG = array (
'passwordsalt' => 'xxxxx',
'secret' => 'xxxx',
'trusted_domains' =>
array (
0 => 'localhost',
),
'datadirectory' => '/mnt/nextcloudFiles/data',
'dbtype' => 'mysql',
'version' => '16.0.1.1',
'overwrite.cli.url' => 'http://localhost',
'dbname' => 'nextcloud',
'dbhost' => '127.0.0.1',
'dbport' => '',
'dbtableprefix' => '',
'dbuser' => 'nextclouduser',
'dbpassword' => 'xxxxx',
'installed' => true,
'instanceid' => 'ocyldeyn9lq3',
);
there is no version number set in my config.php
'version' => '16.0.1.1', :wink:
:flushed: how blind I am. sorry..
but I stand by my first point. A custom config dir does not seem to be handled.
Is it planned to fix this issue also for v16?
Once this is ready we will apply it to all maintained versions.
@unteem: Thank you very much for this patch. Saved me a lot of time
Is there any reason why this PR is not merged yet?
Is there any reason why this PR is not merged yet?
The review comments above have not yet been resolved.
closing stale PR