From 425862b882391ae647fa488cf61417f4ab073020 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Oct 2020 19:32:00 +0200 Subject: [PATCH 1/7] Upgrade to 20.0.0 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 6 +++--- scripts/upgrade.d/upgrade.19.sh | 7 +++++++ scripts/upgrade.d/upgrade.last.sh | 4 ++-- 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 scripts/upgrade.d/upgrade.19.sh diff --git a/README.md b/README.md index b4b939b..40dbcbe 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 19.0.3 +**Shipped version:** 20.0.0 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 404ef69..26f200f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 19.0.3 +**Version incluse :** 20.0.0 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 75aa560..75881e2 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "name": "Nextcloud", "packaging_format": 1, "description": { - "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", - "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" + "en": "Online storage, file sharing platform and various other applications", + "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "19.0.3~ynh1", + "version": "20.0.0~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.19.sh b/scripts/upgrade.d/upgrade.19.sh new file mode 100644 index 0000000..f62a916 --- /dev/null +++ b/scripts/upgrade.d/upgrade.19.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Last available nextcloud version +next_version="20.0.0" + +# Nextcloud tarball checksum sha256 +nextcloud_source_sha256="" diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 569c56e..f62a916 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Last available nextcloud version -next_version="19.0.3" +next_version="20.0.0" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="fc503985e8aa4ed795d882e35679e0e1b7670181768e7820307222d8b4658969" +nextcloud_source_sha256="" From 6e5449def94bb421d6dfc0e7daa7180e779eafca Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 10:44:39 +0200 Subject: [PATCH 2/7] Add shasum --- scripts/upgrade.d/upgrade.19.sh | 2 +- scripts/upgrade.d/upgrade.last.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade.d/upgrade.19.sh b/scripts/upgrade.d/upgrade.19.sh index f62a916..c44f02b 100644 --- a/scripts/upgrade.d/upgrade.19.sh +++ b/scripts/upgrade.d/upgrade.19.sh @@ -4,4 +4,4 @@ next_version="20.0.0" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="" +nextcloud_source_sha256="a273e0151f68567f729d9a82a7e3f124ff0f0471aa17bae6bfd83c5362d84cd8" diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index f62a916..c44f02b 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -4,4 +4,4 @@ next_version="20.0.0" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="" +nextcloud_source_sha256="a273e0151f68567f729d9a82a7e3f124ff0f0471aa17bae6bfd83c5362d84cd8" From 7e638dbaa8c67e9032077200009a2a9547735d3d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 11:12:35 +0200 Subject: [PATCH 3/7] Update install --- scripts/install | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index cfe9d5b..c106a4f 100755 --- a/scripts/install +++ b/scripts/install @@ -187,8 +187,8 @@ ynh_secure_remove --file="$nc_conf" #================================================= # Check LDAP configuration to see if everything worked well -exec_occ ldap:test-config \'\' \ - || ynh_die --message="An error occured during LDAP configuration" +# exec_occ ldap:test-config \'\' \ +# || ynh_die --message="An error occured during LDAP configuration" #================================================= # MOUNT HOME FOLDERS AS EXTERNAL STORAGE @@ -273,12 +273,9 @@ exec_occ background:cron # POST-INSTALL MAINTENANCE #================================================= -( - cd $final_path - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns - sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n -) +exec_occ db:add-missing-indices +exec_occ db:add-missing-columns +exec_occ db:convert-filecache-bigint -n #================================================= # CONFIGURE THE HOOK FILE FOR USER CREATE From 8a52c9d4016f70995bf8632314617ae6b2d66122 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 12:11:28 +0200 Subject: [PATCH 4/7] Small typos --- README.md | 41 ++++++++++++----------------------------- README_fr.md | 9 ++++----- scripts/install | 10 +++++----- scripts/remove | 4 ++-- scripts/restore | 2 +- scripts/upgrade | 25 +++++++++++-------------- 6 files changed, 35 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 40dbcbe..e7c85fb 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview -[Nextcloud](https://nextcloud.com) gives you freedom and control over your -own data. A personal cloud which runs on your own server. With Nextcloud -you can synchronize your files over your devices. +[Nextcloud](https://nextcloud.com) gives you freedom and control over your own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. **Shipped version:** 20.0.0 @@ -41,7 +39,7 @@ To install and configure it: - Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. -*NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi, …) is **not** supported* +*NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi...) is **not** supported* ## YunoHost specific features @@ -51,10 +49,8 @@ this package: * Integrate with YunoHost users and SSO - i.e. logout button * Allow one user to be the administrator (set at the installation) * Allow multiple instances of this application - * Optionally access the user home folder from Nextcloud files (set at the - installation, the sharing is enabled by default) - * Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's - not already served - i.e. by Baïkal + * Optionally access the user home folder from Nextcloud files (set at the installation, the sharing is enabled by default) + * Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal #### Multi-users support @@ -65,13 +61,9 @@ this package: ## Limitations -To integrate the logout button to the SSO, we have to patch Nextcloud sources. -In waiting an upstream integration, the source code integrity checking has been -disabled to prevent the warning message. +To integrate the logout button to the SSO, we have to patch Nextcloud sources. In waiting an upstream integration, the source code integrity checking has been disabled to prevent the warning message. -Also, note we made the choice to disable third-parties applications at the -upgrade. It allows to prevent an unstable - and sometimes broken - Nextcloud -installation. You will just have to manually activate them after the upgrade. +Also, note we made the choice to disable third-parties applications at the upgrade. It allows to prevent an unstable - and sometimes broken - Nextcloud installation. You will just have to manually activate them after the upgrade. Finally, the following error message in Nextcloud logs can be safely ignored: ``` @@ -91,15 +83,11 @@ If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/n #### Migrate from ownCloud -**This is not considered as stable yet, please do it with care and only for -testing!** +**This is not considered as stable yet, please do it with care and only for testing!** -This package handles the migration from ownCloud to Nextcloud. For that, your -ownCloud application must be **up-to-date** in YunoHost. +This package handles the migration from ownCloud to Nextcloud. For that, your ownCloud application must be **up-to-date** in YunoHost. -You will then have to upgrade your ownCloud application with this repository. -This can only be done from the command-line interface - e.g. through SSH. Once -you're connected, you simply have to execute the following: +You will then have to upgrade your ownCloud application with this repository. This can only be done from the command-line interface - e.g. through SSH. Once you're connected, you simply have to execute the following: ```bash sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh owncloud --debug @@ -108,13 +96,9 @@ sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh ownc The `--debug` option will let you see the full output. If you encounter any issue, please paste it. -Note that a cron job will be executed at some time after the end of this -command. You must wait that before doing any other application operations! -You should see that Nextcloud is installed after that. +Note that a cron job will be executed at some time after the end of this command. You must wait that before doing any other application operations! You should see that Nextcloud is installed after that. -Note that it does not change the application label nor the URL. To rename -the label, you can execute the following - replace `Nextcloud` with whatever -you want: +Note that it does not change the application label nor the URL. To rename the label, you can execute the following - replace `Nextcloud` with whatever you want: ```bash sudo yunohost app setting nextcloud label -v "Nextcloud" @@ -130,8 +114,7 @@ sudo yunohost app ssowatconf --- -Developers infos ----------------- +## Developers infos Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). diff --git a/README_fr.md b/README_fr.md index 26f200f..3b76b23 100644 --- a/README_fr.md +++ b/README_fr.md @@ -41,7 +41,7 @@ Pour l'installer et le configurer : - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice. - Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. - *NB : OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi, …) n'est **pas** supporté* + *NB : OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi...) n'est **pas** supporté* ## Caractéristiques spécifiques YunoHost @@ -79,9 +79,9 @@ Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/h **La migration n'est pas encore considérée comme stable, merci de la faire prudemment et uniquement pour tester !** -Ce package gère la migration de OwnCloud vers Nextcloud. Pour ça, l'application OwnCloud doit **être à jour** dans YunoHost. +Ce package gère la migration de ownCloud vers Nextcloud. Pour ça, l'application ownCloud doit **être à jour** dans YunoHost. -Vous allez ensuite mettre à niveau votre OwnCloud avec ce dépôt. +Vous allez ensuite mettre à niveau votre ownCloud avec ce dépôt. Ça ne peut être fait qu'en ligne de commande - par exemple via SSH. Une fois connecté, vous n'avez plus qu'à exécuter la commande suivante : ```bash sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh owncloud --debug @@ -107,8 +107,7 @@ sudo yunohost app ssowatconf --- -Informations pour les développeurs ----------------- +## Informations pour les développeurs Merci de faire votre « pull request » sur la [branche testing](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). Pour tester la branche testing, faites comme ceci. diff --git a/scripts/install b/scripts/install index c106a4f..bacc853 100755 --- a/scripts/install +++ b/scripts/install @@ -158,7 +158,7 @@ ynh_script_progression --message="Configuring Nextcloud..." --weight=8 # Ensure that UpdateNotification app is disabled exec_occ app:disable updatenotification -# Enable ldap plugin +# Enable LDAP plugin exec_occ app:enable user_ldap exec_occ ldap:create-empty-config @@ -187,8 +187,8 @@ ynh_secure_remove --file="$nc_conf" #================================================= # Check LDAP configuration to see if everything worked well -# exec_occ ldap:test-config \'\' \ -# || ynh_die --message="An error occured during LDAP configuration" +exec_occ ldap:test-config \'\' \ + || ynh_die --message="An error occured during LDAP configuration" #================================================= # MOUNT HOME FOLDERS AS EXTERNAL STORAGE @@ -324,9 +324,9 @@ ynh_use_logrotate --logfile="$datadir/nextcloud.log" #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Configuring Fail2ban..." --weight=8 +ynh_script_progression --message="Configuring Fail2Ban..." --weight=8 -# Create a dedicated Fail2ban config +# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: ''.*$" --max_retry=5 #================================================= diff --git a/scripts/remove b/scripts/remove index ebf87d2..b84d5bf 100755 --- a/scripts/remove +++ b/scripts/remove @@ -73,9 +73,9 @@ ynh_remove_logrotate #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Removing Fail2ban configuration..." --weight=8 +ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=8 -# Remove the dedicated Fail2ban config +# Remove the dedicated Fail2Ban config ynh_remove_fail2ban_config #================================================= diff --git a/scripts/restore b/scripts/restore index daa51e9..764c229 100755 --- a/scripts/restore +++ b/scripts/restore @@ -156,7 +156,7 @@ ynh_multimedia_addaccess $app #================================================= # RESTORE THE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the Fail2ban configuration..." --weight=7 +ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=7 ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 6c76b8f..5325faf 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -147,11 +147,11 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf" -# Delete current nginx configuration to be able to check if .well-known is already served. +# Delete current NGINX configuration to be able to check if .well-known is already served. ynh_remove_nginx_config ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$app.conf" -# Wait untils nginx has fully reloaded +# Wait untils NGINX has fully reloaded ynh_systemd_action --service_name=nginx --action=reload --line_match="Reloaded" --log_path="systemd" # Check if .well-known is available for this domain @@ -163,7 +163,7 @@ then sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" fi -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config YNH_PHP_VERSION #================================================= @@ -179,7 +179,7 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 -# Recreate a dedicated php-fpm config +# Recreate a dedicated PHP-FPM config ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" # Delete existing ini configuration file (backward compatibility) @@ -309,12 +309,9 @@ then exec_occ -V done - ( - cd $final_path - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns - sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n - ) + exec_occ db:add-missing-indices + exec_occ db:add-missing-columns + exec_occ db:convert-filecache-bigint -n #================================================= # CONFIGURE NEXTCLOUD @@ -333,7 +330,7 @@ then # Ensure that UpdateNotification app is disabled exec_occ app:disable updatenotification - # Enable plugins + # Enable LDAP plugin exec_occ app:enable user_ldap # Load the config file in nextcloud @@ -445,9 +442,9 @@ ynh_use_logrotate --non-append #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Reconfiguring Fail2ban..." --weight=7 +ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=7 -# Create a dedicated Fail2ban config +# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: ''.*$" --max_retry=5 #================================================= @@ -474,7 +471,7 @@ ynh_systemd_action --service_name=nginx --action=reload if [ $migration_process -eq 1 ] then - ynh_print_info --message="OwnCloud has been successfully migrated to Nextcloud! \ + ynh_print_info --message="ownCloud has been successfully migrated to Nextcloud! \ A last scheduled operation will run in a couple of minutes to finish the \ migration in YunoHost side. Do not proceed any application operation while \ you don't see Nextcloud as installed." From 6038e9c5ce2e4d808ef3a5cefdbbc68e75e0c046 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 14:03:01 +0200 Subject: [PATCH 5/7] small typos --- README.md | 6 +++--- README_fr.md | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e7c85fb..5482848 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,11 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an online rich text document editor) through a Nextcloud app. To install and configure it: - Install *Community Document Server* application in your Nextcloud. That's the part that runs OnlyOffice server. -- Install OnlyOffice application. That's the client part that will connect to an OnlyOffice server. -- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice. +- Install *ONLYOFFICE* application. That's the client part that will connect to an OnlyOffice server. +- Then in Settings -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. -*NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi...) is **not** supported* +*NB: OnlyOffice is only available for x86 architecture - **ARM** architecture is **not** supported (Raspberry Pi, OLinuXino...)* ## YunoHost specific features diff --git a/README_fr.md b/README_fr.md index 3b76b23..5b9eecf 100644 --- a/README_fr.md +++ b/README_fr.md @@ -34,14 +34,14 @@ Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. #### Configurer l'intégration d'OnlyOffice -À partir de sa version 18, Nextcloud intégre une intégration directe de OnlyOffice (un éditeur de texte enrichi en ligne) via une application Nextcloud. -Pour l'installer et le configurer : - - Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice. - - Installez l'application *OnlyOffice*. C'est la partie cliente qui va se connecter au serveur OnlyOffice. - - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice. - - Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. +À partir de sa version 18, Nextcloud inclut une intégration directe de OnlyOffice (un éditeur de texte enrichi en ligne) via une application Nextcloud. +Pour l'installer et la configurer : +- Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice. +- Installez l'application *ONLYOFFICE*. C'est la partie cliente qui va se connecter au serveur OnlyOffice. +- Ensuite dans les Paramètres -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice. +- Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. - *NB : OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi...) n'est **pas** supporté* +*NB : OnlyOffice n'est disponible que sous architecture x86 - L'architecture **ARM** n'est **pas** supporté (Raspberry Pi, OLinuXino...)* ## Caractéristiques spécifiques YunoHost From 30759821eca72a1d636ec36c136b9018b239eb0b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 15:36:48 +0200 Subject: [PATCH 6/7] Fix Invalid configID --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index bacc853..abcedb4 100755 --- a/scripts/install +++ b/scripts/install @@ -187,7 +187,7 @@ ynh_secure_remove --file="$nc_conf" #================================================= # Check LDAP configuration to see if everything worked well -exec_occ ldap:test-config \'\' \ +exec_occ ldap:test-config '' \ || ynh_die --message="An error occured during LDAP configuration" #================================================= From 3735ac2ad2632cf6fff681b5808eb5a6824641ea Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 13 Oct 2020 14:52:32 +0200 Subject: [PATCH 7/7] fix upgrade for new major version --- scripts/upgrade | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5325faf..c9faaae 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -212,8 +212,8 @@ exec_occ() { create_external_storage() { local datadir="$1" local mount_name="$2" -local mount_id=`exec_occ files_external:create --output=json \ - "$mount_name" 'local' 'null::null' -c "datadir=$datadir" || true` +local mount_id=$(exec_occ files_external:create --output=json \ + "$mount_name" 'local' 'null::null' -c "datadir=$datadir" || true) ! [[ $mount_id =~ ^[0-9]+$ ]] \ && ynh_print_warn --message="Unable to create external storage" \ || exec_occ files_external:option "$mount_id" enable_sharing true @@ -244,9 +244,17 @@ then # The major version is the first part of the version number current_major_version=${current_version%%.*} + if [ ! -f upgrade.d/upgrade.$current_major_version.sh ]; then + source upgrade.d/upgrade.last.sh + else + source upgrade.d/upgrade.$current_major_version.sh + fi + # If the current version has the same major version than the next one, # then it's the last upgrade to do - if [ "$last_major_version" -eq "$current_major_version" ]; then + # We also cover the case where the last version is the first of the current major version series + # (e.g. 20.0.0 is the latest version) + if [[ ("$last_major_version" -eq "$current_major_version") || ( ("$last_major_version" -eq "$((current_major_version+1))") && ("$next_version" == "$last_version") ) ]]; then current_major_version=last # Enable YunoHost patches on Nextcloud sources cp -a ../sources/patches_last_version/* ../sources/patches