nkakouros-original / ansible-role-nextcloud

An Ansible role to install Nextcloud
GNU General Public License v3.0
11 stars 5 forks source link

`nextcloud_version` and updating do not work well together #30

Open nkakouros opened 4 years ago

nkakouros commented 4 years ago

nextcloud_version is used to create the url where Nextcloud will be downloaded from. The role also checks if there is an update available and if there is it re-downloads Nextcloud and re-installs it. The problem is that the url will be for the version defined in nextcloud_version and not the newer version.

TODO

simonspa commented 4 years ago

There are more issues with the way we currently upgrade:

Is there a reason for not resetting the file permissions, then directly using the upgrader and then setting file permissions properly again?

nkakouros commented 4 years ago

Extracting the files on top of the old ones is a valid option to upgrade Nextcloud. config.php and manually installed apps will not be removed as the nextcloud archive will not overwrite those when extracted.

But, if we implement checks so that the maximum major version to be installed is that specified in nextcloud_version, then I guess there is not much against the automatic update. It does automatic backups and other stuff that are useful.

simonspa commented 4 years ago

I'm being very petty here, but the manual says:

Rename your current Nextcloud directory, for example nextcloud-old.

Unpacking the new archive creates a new nextcloud directory populated with your new server files. Move this directory and its contents to the original location of your old server. For example /var/www/, so that once again you have /var/www/nextcloud.

So they don't extract on top but replace the whole folder

nkakouros commented 4 years ago

You are right, it is cleaner this way. In any case, let's use the occ utility to upgrade. We should have versions checks though so that the user can "lock" the nextcloud major version.

simonspa commented 4 years ago

This is a bit more annoying than I thought:

$ sudo -u www-data php occ upgrade:check
Nextcloud 16.0.6 is available. Get more information /* ... */
Update for files_rightclick to version 0.15.1 is available.
2 updates available

Cool, so we can simply update and end up at the right place (i.e. not jumping versions)? No!

$ sudo -u www-data updater/updater.phar
Nextcloud Updater - version: v16.0.0beta3-4-gc7a4074

Current version is 16.0.0.

Update to Nextcloud 17.0.1 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-17.0.1.zip
simonspa commented 4 years ago

https://github.com/nextcloud/updater/issues/254

simonspa commented 4 years ago

I will look into proposing a patch to NC to at least get this fixed for future versions.