From 425862b882391ae647fa488cf61417f4ab073020 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Oct 2020 19:32:00 +0200 Subject: [PATCH 01/46] 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 02/46] 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 03/46] 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 04/46] 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 05/46] 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 06/46] 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 fe62ab987a88a5c2540c248f80ec08122fbadb31 Mon Sep 17 00:00:00 2001 From: Sebastien Mennetrier Date: Wed, 7 Oct 2020 17:38:32 +0200 Subject: [PATCH 07/46] Fix issues with Element (Riotchat) app --- conf/nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 0cf3732..462d900 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -121,6 +121,10 @@ location ^~ __PATH__/ { rewrite ^ __PATH__/index.php$request_uri; } + location ~* ^__PATH__/apps/riotchat/riot/ { + rewrite ^ __PATH__/index.php$request_uri; + } + # Adding the cache control header for js, css and map files location ~ ^__PATH__/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { try_files $uri __PATH__/index.php$request_uri; From 9717e59557a2c746ed29ad9d405a783dcbf2fceb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 8 Oct 2020 09:51:32 +0200 Subject: [PATCH 08/46] upgrade to v19.0.4 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/install | 9 +++------ scripts/upgrade | 9 +++------ scripts/upgrade.d/upgrade.last.sh | 4 ++-- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b4b939b..fd10c0f 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:** 19.0.4 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 404ef69..d9e3dc2 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 :** 19.0.4 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 75aa560..f2746de 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "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" }, - "version": "19.0.3~ynh1", + "version": "19.0.4~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/install b/scripts/install index cfe9d5b..0ad4cde 100755 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 6c76b8f..e3ec094 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 569c56e..7a8f7df 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="19.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="fc503985e8aa4ed795d882e35679e0e1b7670181768e7820307222d8b4658969" +nextcloud_source_sha256="" From de251cebfcba1f7da2bf427f168a0edb397d6524 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 8 Oct 2020 10:57:22 +0200 Subject: [PATCH 09/46] Update upgrade.last.sh --- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 7a8f7df..f05cba2 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 +# Last available Nextcloud version next_version="19.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="" +nextcloud_source_sha256="465711715d64cbdf0465fcb4405f23b6f0947b85bbe12b6577c9e1602c63ae78" From 3735ac2ad2632cf6fff681b5808eb5a6824641ea Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 13 Oct 2020 14:52:32 +0200 Subject: [PATCH 10/46] 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 From 0207a89fe6781a1db59d2df57189564053e70b74 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 26 Oct 2020 12:03:17 +0100 Subject: [PATCH 11/46] 20.0.1 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5482848..35e444d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [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 +**Shipped version:** 20.0.1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 5b9eecf..d2c8ff3 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 :** 20.0.0 +**Version incluse :** 20.0.1 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 75881e2..ca9bab0 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.0~ynh1", + "version": "20.0.1~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index c44f02b..5ab466b 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="20.0.0" +next_version="20.0.1" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="a273e0151f68567f729d9a82a7e3f124ff0f0471aa17bae6bfd83c5362d84cd8" +nextcloud_source_sha256="96c6b50e1e676e46cec82d8f8ff1abd5eef9dfa00580081b6c640612c3ff2efc" From 0bd857d7620310be09d70f2a7e48b10a7827be48 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 3 Nov 2020 18:13:11 +0100 Subject: [PATCH 12/46] Fix last warning in linter about sudo ? --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 2b9a766..84a4b01 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -341,7 +341,7 @@ ynh_smart_mktemp () { ynh_die "Insufficient free space to continue..." fi - echo "$(sudo mktemp --directory --tmpdir="$tmpdir")" + echo "$(mktemp --directory --tmpdir="$tmpdir")" } #================================================= From 1be264d94daf6d8dba31210c799708d24f9de6dc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 18 Nov 2020 20:58:57 +0100 Subject: [PATCH 13/46] Upgrade to version 20.0.2 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5482848..6b0e808 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [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 +**Shipped version:** 20.0.2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 5b9eecf..2d36ec8 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 :** 20.0.0 +**Version incluse :** 20.0.2 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 75881e2..f96496f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.0~ynh1", + "version": "20.0.2~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index c44f02b..682e66e 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="20.0.0" +next_version="20.0.2" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="a273e0151f68567f729d9a82a7e3f124ff0f0471aa17bae6bfd83c5362d84cd8" +nextcloud_source_sha256="be84c2ac7fba066ddc0637a4672b39628bbbd200dad8c00a0437a4765007dd21" From d5f703f47a27676b3188d1914d5d9740f56d6a0f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Nov 2020 08:10:43 +0100 Subject: [PATCH 14/46] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 462d900..adc69c3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -91,7 +91,7 @@ location ^~ __PATH__/ { fastcgi_param modHeadersAvailable true; # Enable pretty urls fastcgi_param front_controller_active true; - fastcgi_pass unix:/var/run/php/php__YNH_PHP_VERSION__-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; } From 7d09e4b1978e74318b468c0da08bec48d3dc3a86 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Nov 2020 08:16:17 +0100 Subject: [PATCH 15/46] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 462d900..4508d5a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -91,7 +91,7 @@ location ^~ __PATH__/ { fastcgi_param modHeadersAvailable true; # Enable pretty urls fastcgi_param front_controller_active true; - fastcgi_pass unix:/var/run/php/php__YNH_PHP_VERSION__-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; } From 3502b84407491cbae5654dfe52380b47c616f517 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Nov 2020 08:33:00 +0100 Subject: [PATCH 16/46] Small typos --- README.md | 1 + README_fr.md | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51ad16a..a1eeaef 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) *[Lire ce readme en français.](./README_fr.md)* + > *This package allow you to install Nextcloud quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* diff --git a/README_fr.md b/README_fr.md index 2d36ec8..37b5691 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,6 @@ *[Read this readme in english.](./README.md)* - > *Ce package vous permet d'installer Nextcloud rapidement et simplement sur un serveur YunoHost. Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* @@ -98,7 +97,7 @@ sudo yunohost app setting nextcloud label -v "Nextcloud" sudo yunohost app ssowatconf ``` -## Links +## Liens * Signaler un bug : https://github.com/YunoHost-Apps/nextcloud_ynh/issues * Site web de Nextcloud : https://nextcloud.com/ From a9559aeac4f75332c3fd12a603e45540f41beb57 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 19 Nov 2020 11:39:57 +0100 Subject: [PATCH 17/46] use phpversion for nginx helper --- scripts/change_url | 5 +++-- scripts/install | 36 +++++++++++++++++++----------------- scripts/upgrade | 46 ++++++++++++++++++++++++---------------------- 3 files changed, 46 insertions(+), 41 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 2aa5f36..c779071 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..." # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED @@ -63,7 +64,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config YNH_PHP_VERSION + ynh_add_nginx_config fi # Change the domain for NGINX @@ -84,7 +85,7 @@ ynh_script_progression --message="Applying Nextcloud specific modifications..." # Define a function to execute commands with `occ` exec_occ() { (cd "$final_path" && exec_as "$app" \ - php${YNH_PHP_VERSION} occ --no-interaction --no-ansi "$@") + php${phpversion} occ --no-interaction --no-ansi "$@") } if [ $change_domain -eq 1 ] diff --git a/scripts/install b/scripts/install index abcedb4..692f594 100755 --- a/scripts/install +++ b/scripts/install @@ -84,23 +84,6 @@ cp -a ../sources/patches_last_version/* ../sources/patches # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - -# Check if .well-known is available for this domain -if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" -then - ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." - - # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" -fi - -# Create a dedicated NGINX config -ynh_add_nginx_config YNH_PHP_VERSION - #================================================= # CREATE DEDICATED USER #================================================= @@ -116,6 +99,25 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=50 # Create a dedicated php-fpm config ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +# Used by ynh_add_nginx_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 + +# Check if .well-known is available for this domain +if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" +then + ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." + + # Remove lines about .well-known/carddav and caldav with sed. + sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" +fi + +# Create a dedicated NGINX config +ynh_add_nginx_config #================================================= # SPECIFIC SETUP diff --git a/scripts/upgrade b/scripts/upgrade index d3f647e..24fa8d3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -140,6 +140,29 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # STANDARD UPGRADE STEPS +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app + +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 + +# 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) +if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then + ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini +fi +# Used by ynh_add_nginx_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + #================================================= # NGINX CONFIGURATION #================================================= @@ -164,28 +187,7 @@ then fi # Create a dedicated NGINX config -ynh_add_nginx_config YNH_PHP_VERSION - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 - -# 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) -if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then - ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini -fi +ynh_add_nginx_config #================================================= # SPECIFIC UPGRADE From dfe0624a71bd39c63385ee242d764a6f69c9e7df Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Nov 2020 21:36:22 +0100 Subject: [PATCH 18/46] fix --- scripts/backup | 3 ++- scripts/config | 2 +- scripts/install | 4 ++-- scripts/restore | 5 +++-- scripts/upgrade | 13 ++++++------- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/scripts/backup b/scripts/backup index bb92dda..7ed3c7f 100755 --- a/scripts/backup +++ b/scripts/backup @@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -48,7 +49,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/config b/scripts/config index 1d774dd..85769fc 100644 --- a/scripts/config +++ b/scripts/config @@ -77,7 +77,7 @@ apply_config() { if [ "$fpm_footprint" != "0" ] then - ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION + ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint else ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." fi diff --git a/scripts/install b/scripts/install index 692f594..70e89f4 100755 --- a/scripts/install +++ b/scripts/install @@ -138,7 +138,7 @@ ynh_script_progression --message="Installing Nextcloud..." --weight=30 # Define a function to execute commands with `occ` exec_occ() { (cd "$final_path" && exec_as "$app" \ - php$YNH_PHP_VERSION occ --no-interaction --no-ansi "$@") + php${phpversion} occ --no-interaction --no-ansi "$@") } # Set write access for the following commands @@ -267,7 +267,7 @@ chmod 644 "$cron_path" ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$cron_path" ynh_replace_string --match_string="__DESTDIR__" --replace_string="$final_path" --target_file="$cron_path" -ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$cron_path" +ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$phpversion" --target_file="$cron_path" exec_occ background:cron diff --git a/scripts/restore b/scripts/restore index 764c229..3cc1584 100755 --- a/scripts/restore +++ b/scripts/restore @@ -27,6 +27,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) @@ -98,10 +99,10 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=50 # Restore the file first, so it can have a backup if different -ynh_restore_file --origin_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" #================================================= # RESTORE THE CRON FILE diff --git a/scripts/upgrade b/scripts/upgrade index 24fa8d3..a88a455 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) user_home=$(ynh_app_setting_get --app=$app --key=user_home) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) @@ -154,14 +155,12 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Recreate a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" # Delete existing ini configuration file (backward compatibility) -if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then - ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini +if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then + ynh_secure_remove --file=/etc/php/$phpversion/fpm/conf.d/20-$app.ini fi -# Used by ynh_add_nginx_config -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -201,7 +200,7 @@ exec_occ() { # Backward compatibility to upgrade from NC14 or older version if [ $current_major_version = "last" ] || [ $current_major_version -ge 15 ] then - NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION + NEXTCLOUD_PHP_VERSION=$phpversion else NEXTCLOUD_PHP_VERSION="7.0" fi @@ -404,7 +403,7 @@ chmod 644 "$cron_path" ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$cron_path" ynh_replace_string --match_string="__DESTDIR__" --replace_string="$final_path" --target_file="$cron_path" -ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$cron_path" +ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$phpversion" --target_file="$cron_path" exec_occ background:cron From 00c90826df2eb0d7812234227252656a959ba6c2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 24 Nov 2020 03:55:50 +0100 Subject: [PATCH 19/46] Moar linter warning fixes --- scripts/_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 84a4b01..ebffb0e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -154,7 +154,7 @@ ynh_handle_app_migration () { # TODO Handle multi instance apps... # Check that there is not already an app installed for this id. - (yunohost app list --installed -f "$new_app" | grep -q id) \ + yunohost app list | grep -q 'id: $appname' \ && ynh_die "$new_app is already installed" #================================================= @@ -360,7 +360,7 @@ ynh_multimedia_build_main_dir () { local checksum="806a827ba1902d6911095602a9221181" # Download yunohost.multimedia scripts - wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz + wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz 2>&1 # Check the control sum echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \ From ba559194376963fad2884e9dfc598b529de7be27 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 30 Nov 2020 17:39:20 +0100 Subject: [PATCH 20/46] Update nginx conf for nextcloud 20 --- conf/nginx.conf | 173 +++++++++++++++++++++--------------------------- 1 file changed, 74 insertions(+), 99 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index adc69c3..d4581c2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,27 +1,20 @@ -location = /.well-known/carddav { - return 301 https://$server_name__PATH__/remote.php/dav; -} -location = /.well-known/caldav { - return 301 https://$server_name__PATH__/remote.php/dav; -} +location ^~ /.well-known { + # The following 6 rules are borrowed from `.htaccess` -# The following 2 rules are only needed for the user_webfinger app. -# Uncomment it if you're planning to use this app. -#location = /.well-known/host-meta { -# return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta; -#} -#location = /.well-known/host-meta.json { -# return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta-json; -#} + # The following 2 rules are only needed for the user_webfinger app. + # Uncomment it if you're planning to use this app. + #rewrite ^/\.well-known/host-meta\.json __PATH__/public.php?service=host-meta-json last; + #rewrite ^/\.well-known/host-meta __PATH__/public.php?service=host-meta last; + # The following 2 rules are only needed for the Social app. + # Uncomment it if you're planning to use this app. + #rewrite ^/\.well-known/webfinger __PATH__/public.php?service=webfinger last; + #rewrite ^/\.well-known/nodeinfo __PATH__/public.php?service=nodeinfo last; -# The following 2 rules are only needed for the Social app. -# Uncomment it if you're planning to use this app. -#location = /.well-known/webfinger { -# return 301 $scheme://$host:$server_port__PATH__/public.php?service=webfinger; -#} -#location = /.well-known/nodeinfo { -# return 301 $scheme://$host:$server_port__PATH__/public.php?service=nodeinfo; -#} + location = /.well-known/carddav { return 301 __PATH__/remote.php/dav/; } + location = /.well-known/caldav { return 301 __PATH__/remote.php/dav/; } + + try_files $uri $uri/ =404; +} #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location ^~ __PATH__/ { @@ -36,33 +29,53 @@ location ^~ __PATH__/ { # Add headers to serve security related headers more_set_headers "Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;"; - more_set_headers "X-Content-Type-Options: nosniff"; - more_set_headers "X-XSS-Protection: 1; mode=block"; - more_set_headers "X-Robots-Tag: none"; - more_set_headers "X-Download-Options: noopen"; - more_set_headers "X-Permitted-Cross-Domain-Policies: none"; more_set_headers "Referrer-Policy: no-referrer"; + more_set_headers "X-Content-Type-Options: nosniff"; + more_set_headers "X-Download-Options: noopen"; + more_set_headers "X-Frame-Options: SAMEORIGIN"; + more_set_headers "X-Permitted-Cross-Domain-Policies: none"; + more_set_headers "X-Robots-Tag: none"; + more_set_headers "X-XSS-Protection: 1; mode=block"; # Set max upload size client_max_body_size 10G; fastcgi_buffers 64 4K; - # Extend timeouts - client_body_timeout 60m; - proxy_read_timeout 60m; - fastcgi_read_timeout 60m; + # Enable gzip but do not remove ETag headers + gzip on; + gzip_vary on; + gzip_comp_level 4; + gzip_min_length 256; + gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; + gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; - # Disable gzip to avoid the removal of the ETag header - gzip off; + # Pagespeed is not supported by Nextcloud, so if your server is built + # with the `ngx_pagespeed` module, uncomment this line to disable it. + #pagespeed off; - # Errors pages - error_page 403 __PATH__/core/templates/403.php; - # Don't set custom 404 error page, as nextcloud uses 404 codes with meaningful payload. - # Setting custom 404 page clears the payload and creates UI bugs - # error_page 404 __PATH__/core/templates/404.php; + # Remove X-Powered-By, which is an information leak + fastcgi_hide_header X-Powered-By; - location __PATH__/ { - rewrite ^ __PATH__/index.php; + # Specify how to handle directories -- specifying `/nextcloud/index.php$request_uri` + # here as the fallback means that Nginx always exhibits the desired behaviour + # when a client requests a path that corresponds to a directory that exists + # on the server. In particular, if that directory contains an index.php file, + # that file is correctly served; if it doesn't, then the request is passed to + # the front-end controller. This consistent behaviour means that we don't need + # to specify custom rules for certain paths (e.g. images and other assets, + # `/updater`, `/ocm-provider`, `/ocs-provider`), and thus + # `try_files $uri $uri/ /nextcloud/index.php$request_uri` + # always provides the desired behaviour. + index index.php index.html __PATH__/index.php$request_uri; + + # Default Cache-Control policy + expires 1m; + + # Rule borrowed from `.htaccess` to handle Microsoft DAV clients + location = __PATH__/ { + if ( $http_user_agent ~ ^DavClnt ) { + return 302 __PATH__/remote.php/webdav/$is_args$args; + } } location = __PATH__/robots.txt { @@ -71,15 +84,16 @@ location ^~ __PATH__/ { access_log off; } - location ~ ^__PATH__/(?:build|tests|config|lib|3rdparty|templates|data)\/ { - deny all; - } - location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { - deny all; - } + # Rules borrowed from `.htaccess` to hide certain paths from clients + location ~ ^__PATH__/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } + location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } - location ~ ^__PATH__/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { - fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; + # Ensure this block, which passes PHP files to the PHP process, is above the blocks + # which handle static assets (as seen below). If this block is not declared first, + # then Nginx will encounter an infinite rewriting loop when it prepends + # `/nextcloud/index.php` to the URI, resulting in a HTTP 500 error response. + location ~ \.php(?:$|/) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; include fastcgi_params; @@ -87,66 +101,27 @@ location ^~ __PATH__/ { fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param PATH_INFO $path_info; fastcgi_param HTTPS on; - # Avoid sending the security headers twice - fastcgi_param modHeadersAvailable true; - # Enable pretty urls - fastcgi_param front_controller_active true; + fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice + fastcgi_param front_controller_active true; # Enable pretty urls fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; } - location ~ ^__PATH__/(?:updater|oc[ms]-provider)(?:$|\/) { - try_files $uri/ =404; - index index.php; + location ~ \.(?:css|js|svg|gif)$ { + try_files $uri / __PATH__/index.php$request_uri; + expires 6M; # Cache-Control policy borrowed from `.htaccess` + access_log off; # Optional: Don't log access to assets } - location = __PATH__/core/js/oc.js { - rewrite ^ __PATH__/index.php$request_uri; + location ~ \.woff2?$ { + try_files $uri / __PATH__/index.php$request_uri; + expires 7d; # Cache-Control policy borrowed from `.htaccess` + access_log off; # Optional: Don't log access to assets } - location = __PATH__/core/preview.png { - rewrite ^ __PATH__/index.php$request_uri; - } - - location ~* ^__PATH__/(?:css|js)/ { - rewrite ^ __PATH__/index.php$request_uri; - } - - location ~* ^__PATH__/apps/theming/img/core/filetypes/ { - rewrite ^ __PATH__/index.php$request_uri; - } - - location ~* ^__PATH__/apps/documentserver_community/ { - rewrite ^ __PATH__/index.php$request_uri; - } - - location ~* ^__PATH__/apps/riotchat/riot/ { - rewrite ^ __PATH__/index.php$request_uri; - } - - # Adding the cache control header for js, css and map files - location ~ ^__PATH__/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { - try_files $uri __PATH__/index.php$request_uri; - more_set_headers "Cache-Control: public, max-age=15778463"; - # Add headers to serve security related headers - more_set_headers "Strict-Transport-Security: max-age=15768000"; - more_set_headers "X-Content-Type-Options: nosniff"; - more_set_headers "X-XSS-Protection: 1; mode=block"; - more_set_headers "X-Robots-Tag: none"; - more_set_headers "X-Download-Options: noopen"; - more_set_headers "X-Permitted-Cross-Domain-Policies: none"; - more_set_headers "X-Frame-Options: SAMEORIGIN"; - more_set_headers "Referrer-Policy: no-referrer"; - - # Optional: Don't log access to assets - access_log off; - } - - location ~ ^__PATH__/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ { - try_files $uri __PATH__/index.php$request_uri; - # Optional: Don't log access to other assets - access_log off; + location ~ / { + try_files $uri / __PATH__/index.php$request_uri; } # show YunoHost panel access From 50ece34da7f88d78452e0ba6326b544e4a5da85b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 12:48:15 +0100 Subject: [PATCH 21/46] Fix linter --- check_process | 2 -- scripts/install | 2 +- scripts/upgrade | 7 ------- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/check_process b/check_process index 0ee0bab..440eb43 100644 --- a/check_process +++ b/check_process @@ -18,8 +18,6 @@ incorrect_path=1 port_already_use=0 change_url=1 -;;; Levels - Level 5=auto ;;; Options Email= Notification=none diff --git a/scripts/install b/scripts/install index 70e89f4..59e590f 100755 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." --weight=50 # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=medium --footprint=high --package="$extra_php_dependencies" # Used by ynh_add_nginx_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) diff --git a/scripts/upgrade b/scripts/upgrade index a88a455..fc701c9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -125,13 +125,6 @@ then ynh_replace_string "\('datadirectory' =>.*\)$old_app" "\1$app" "$final_path/config/config.php" fi -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # UPGRADE DEPENDENCIES #================================================= From 6c6199d48d596834907597bd03d0f361d90ea154 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 12:51:57 +0100 Subject: [PATCH 22/46] Upgrade to 20.0.3 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 4 ++-- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a1eeaef..43a565c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [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.2 +**Shipped version:** 20.0.3 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 37b5691..d6665be 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,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 :** 20.0.2 +**Version incluse :** 20.0.3 ## Captures d'écran diff --git a/manifest.json b/manifest.json index f96496f..01b529b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.2~ynh1", + "version": "20.0.3~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { @@ -14,7 +14,7 @@ "email": "apps@yunohost.org" }, "requirements": { - "yunohost": ">= 3.8.0" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 682e66e..433d812 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="20.0.2" +next_version="20.0.3" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="be84c2ac7fba066ddc0637a4672b39628bbbd200dad8c00a0437a4765007dd21" +nextcloud_source_sha256="e0f64504d338f64d3c677357f0012cf8b0ed0dc42ec08f958b6dc4ff70edf175" From 00b04039ea802e73a191fbacbd10bde114f255e8 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 14 Dec 2020 12:28:30 +0100 Subject: [PATCH 23/46] fix 405 error --- conf/nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index d4581c2..e9f864a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -121,6 +121,12 @@ location ^~ __PATH__/ { } location ~ / { + if ($request_method ~ ^PUT$) { + rewrite ^ __PATH__/index.php$request_uri last; + } + if ($request_method ~ ^DELETE$) { + rewrite ^ __PATH__/index.php$request_uri last; + } try_files $uri / __PATH__/index.php$request_uri; } From ff7c25c12556f445c85a8a153b917657e749c627 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 14 Dec 2020 21:41:44 +0100 Subject: [PATCH 24/46] Upgrade to version 20.0.4 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 43a565c..6758018 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [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.3 +**Shipped version:** 20.0.4 ## Screenshots diff --git a/README_fr.md b/README_fr.md index d6665be..82c5b08 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,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 :** 20.0.3 +**Version incluse :** 20.0.4 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 01b529b..5e3ec17 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.3~ynh1", + "version": "20.0.4~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 433d812..3515c1b 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="20.0.3" +# Last available Nextcloud version +next_version="20.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="e0f64504d338f64d3c677357f0012cf8b0ed0dc42ec08f958b6dc4ff70edf175" +nextcloud_source_sha256="4c2857d328b64d12fe283ec2f7030131ebe6e467dd4a033cf602fd07984a28a3" From 70e7030a37b32e37965472def2ac7e88e3ce225d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 16 Dec 2020 11:16:00 +0100 Subject: [PATCH 25/46] Add $phpversion --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 59e590f..70e89f4 100755 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." --weight=50 # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=medium --footprint=high --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" # Used by ynh_add_nginx_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) diff --git a/scripts/restore b/scripts/restore index 3cc1584..48fe654 100755 --- a/scripts/restore +++ b/scripts/restore @@ -102,7 +102,7 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=50 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion --package="$extra_php_dependencies" #================================================= # RESTORE THE CRON FILE diff --git a/scripts/upgrade b/scripts/upgrade index fc701c9..057b9f1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -148,7 +148,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Recreate a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" +ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" # Delete existing ini configuration file (backward compatibility) if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then From dc3590aa78a07d0aa3f776f516d037564e9273d9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 16 Dec 2020 13:13:57 +0100 Subject: [PATCH 26/46] Fix shasum ... :/ --- scripts/upgrade.d/upgrade.last.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 3515c1b..f4b01b4 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -4,4 +4,4 @@ next_version="20.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="4c2857d328b64d12fe283ec2f7030131ebe6e467dd4a033cf602fd07984a28a3" +nextcloud_source_sha256="269f1622e326f5d11e387d3861aad4e2b0e79334ae97eed5a7b3352ba7661420" From f1a848900f23807132efde9749af19f504225598 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 13:56:15 +0100 Subject: [PATCH 27/46] fix config --- scripts/config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 85769fc..0c14bca 100644 --- a/scripts/config +++ b/scripts/config @@ -15,6 +15,8 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + #================================================= # LOAD VALUES #================================================= @@ -77,7 +79,7 @@ apply_config() { if [ "$fpm_footprint" != "0" ] then - ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint + ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" else ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." fi From c835aea17826b0debdbb586cb159a2ddad0b9a95 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 13:59:58 +0100 Subject: [PATCH 28/46] allow Symlinks --- scripts/install | 3 +++ scripts/upgrade | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/install b/scripts/install index 70e89f4..d9a539a 100755 --- a/scripts/install +++ b/scripts/install @@ -84,6 +84,9 @@ cp -a ../sources/patches_last_version/* ../sources/patches # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +# Allow Symlinks for multimedia folder +ynh_replace_string --match_string="protected \$allowSymlinks = false;" --replace_string="protected \$allowSymlinks = true;" --target_file="$final_path/lib/private/Files/Storage/Local.php" + #================================================= # CREATE DEDICATED USER #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 057b9f1..84cbebf 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -270,6 +270,9 @@ then # Install the next nextcloud version in $tmpdir ynh_setup_source --dest_dir="$tmpdir" + # Allow Symlinks for multimedia folder + ynh_replace_string --match_string="protected \$allowSymlinks = false;" --replace_string="protected \$allowSymlinks = true;" --target_file="$tmpdir/lib/private/Files/Storage/Local.php" + # Enable maintenance mode exec_occ maintenance:mode --on From f12db573bfb9a849c2afc63700c70166fd781698 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 14:08:35 +0100 Subject: [PATCH 29/46] add missing primary keys --- scripts/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 84cbebf..cf4cfd8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -314,8 +314,9 @@ then exec_occ -V done - exec_occ db:add-missing-indices - exec_occ db:add-missing-columns + exec_occ db:add-missing-indices -n + exec_occ db:add-missing-columns -n + exec_occ db:add-missing-primary-keys -n exec_occ db:convert-filecache-bigint -n #================================================= From d01cb9826ab6efd8ba4bd882f58eb40b7b299afe Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 15:38:07 +0100 Subject: [PATCH 30/46] Upgrade php version --- scripts/upgrade | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index cf4cfd8..c85d5fe 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -147,12 +147,23 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 +# If php has changed, remove the old fpm config file +if [ "$phpversion" != $YNH_PHP_VERSION ] +then + ynh_backup_if_checksum_is_different --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" + ynh_secure_remove --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" + ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload + ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini" + + phpversion="$YNH_PHP_VERSION" +fi + # Recreate a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" # Delete existing ini configuration file (backward compatibility) if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then - ynh_secure_remove --file=/etc/php/$phpversion/fpm/conf.d/20-$app.ini + ynh_secure_remove --file=/etc/php/$phpversion/fpm/conf.d/20-$app.ini fi #================================================= From 001a2b6a1a15eddc98346de48f8c10228d0ba122 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 16:16:34 +0100 Subject: [PATCH 31/46] reload php-fpm --- scripts/upgrade | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index c85d5fe..a1aeb06 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -153,7 +153,9 @@ then ynh_backup_if_checksum_is_different --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_secure_remove --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload - ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini" + if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then + ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini" + fi phpversion="$YNH_PHP_VERSION" fi @@ -478,9 +480,10 @@ ynh_app_setting_set --app=$app --key=skipped_regex \ #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload #================================================= # FINISH MIGRATION PROCESS From 9f056198d512447502acdf94ea20d8721cf0fbb1 Mon Sep 17 00:00:00 2001 From: Kayou Date: Thu, 17 Dec 2020 12:00:56 +0100 Subject: [PATCH 32/46] Apply suggestions from code review --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a1aeb06..8c07855 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -152,11 +152,11 @@ if [ "$phpversion" != $YNH_PHP_VERSION ] then ynh_backup_if_checksum_is_different --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_secure_remove --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" - ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini" fi - + ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload + phpversion="$YNH_PHP_VERSION" fi From 85cffbbe6506150b0a38a7cbf83b54d73a2239d8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 17 Dec 2020 23:30:34 +0100 Subject: [PATCH 33/46] Set badge Install-Nextcloud-with-YunoHost to use SVG --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6758018..3c528e5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Nextcloud for YunoHost [![Integration level](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) -[![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) +[![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=nextcloud) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index 82c5b08..baf3cdd 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # Nextcloud pour YunoHost [![Niveau d'integration](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) -[![Installer Nextcloud avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) +[![Installer Nextcloud avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=nextcloud) *[Read this readme in english.](./README.md)* From d0552650f1acb3210d9ea7b9b50e571c6e98c634 Mon Sep 17 00:00:00 2001 From: Kayou Date: Fri, 18 Dec 2020 11:39:00 +0100 Subject: [PATCH 34/46] Fix the caldav regex --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8c07855..12c9b11 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -188,7 +188,7 @@ then ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" + sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "../conf/nginx.conf" fi # Create a dedicated NGINX config From e9e7015ed7667352c1c191fc632a9f6f382dd9d2 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 18 Dec 2020 12:32:24 +0100 Subject: [PATCH 35/46] Fix the caldav regex --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c779071..5cb1cb9 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -105,7 +105,7 @@ then ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "/etc/nginx/conf.d/$new_domain.d/$app.conf" + sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi fi diff --git a/scripts/install b/scripts/install index d9a539a..1e1621d 100755 --- a/scripts/install +++ b/scripts/install @@ -116,7 +116,7 @@ then ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" + sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "../conf/nginx.conf" fi # Create a dedicated NGINX config diff --git a/scripts/restore b/scripts/restore index 48fe654..44f8384 100755 --- a/scripts/restore +++ b/scripts/restore @@ -56,7 +56,7 @@ then ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "/etc/nginx/conf.d/$domain.d/$app.conf" + sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "/etc/nginx/conf.d/$domain.d/$app.conf" fi #================================================= From 23d2629be9d6edced6a150f8a0f6eb11b004a3ec Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 30 Dec 2020 00:22:48 +0100 Subject: [PATCH 36/46] disable mail app to fix the upgrade from 19 to 20 --- scripts/upgrade | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 12c9b11..9e77108 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -244,6 +244,15 @@ then # Print the current version number of Nextcloud exec_occ -V + # Upgrade may fail if this app is enabled + exec_occ app:list | grep -q -w mail + mail_app_is_active=$? + + # Temporary disable the mail app + if [ $mail_app_is_active -eq 0 ]; then + exec_occ app:disable mail + fi + # While the current version is not the last version, do an upgrade while [ "$last_version" != "$current_version" ] do @@ -346,6 +355,11 @@ then ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$nc_conf" ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$nc_conf" + # Reneable the mail app + if [ $mail_app_is_active -eq 0 ]; then + exec_occ app:enable mail + fi + # Ensure that UpdateNotification app is disabled exec_occ app:disable updatenotification From 1fe41e5570ec4306f1bae8d5a318c46ff292e246 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 31 Dec 2020 00:59:45 +0100 Subject: [PATCH 37/46] Fix detection of mail app enabled --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9e77108..e2d1b8c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -245,7 +245,8 @@ then exec_occ -V # Upgrade may fail if this app is enabled - exec_occ app:list | grep -q -w mail + # Take all apps enabled, and check if mail is one of them + exec_occ app:list | awk '/Enabled/{f=1;next} /Disabled/{f=0} f' | grep -q -w mail mail_app_is_active=$? # Temporary disable the mail app From 8e98a6d6aedcd5571d656a84181437349023fe29 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 11 Jan 2021 19:07:45 +0100 Subject: [PATCH 38/46] Fix upgrde/disable mail --- scripts/upgrade | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e2d1b8c..18e0b49 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -244,16 +244,17 @@ then # Print the current version number of Nextcloud exec_occ -V + # Upgrade may fail if this app is enabled # Take all apps enabled, and check if mail is one of them - exec_occ app:list | awk '/Enabled/{f=1;next} /Disabled/{f=0} f' | grep -q -w mail - mail_app_is_active=$? + # Then temporary disable the mail app + mail_app_must_be_reactived=0 - # Temporary disable the mail app - if [ $mail_app_is_active -eq 0 ]; then + if exec_occ app:list | awk '/Enabled/{f=1;next} /Disabled/{f=0} f' | grep -q -w mail; then exec_occ app:disable mail + mail_app_must_be_reactived=1 fi - + # While the current version is not the last version, do an upgrade while [ "$last_version" != "$current_version" ] do @@ -357,7 +358,7 @@ then ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$nc_conf" # Reneable the mail app - if [ $mail_app_is_active -eq 0 ]; then + if [ $mail_app_must_be_reactived -eq 1 ]; then exec_occ app:enable mail fi From 7561fb4bec6580abc4bddae366539a44a53efcc1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 11 Jan 2021 19:54:45 +0100 Subject: [PATCH 39/46] Remove ownCloud migration --- README.md | 24 --------------- README_fr.md | 25 --------------- conf/owncloud_migration | 13 -------- conf/owncloud_post_migration.sh | 45 --------------------------- scripts/upgrade | 54 --------------------------------- 5 files changed, 161 deletions(-) delete mode 100644 conf/owncloud_migration delete mode 100644 conf/owncloud_post_migration.sh diff --git a/README.md b/README.md index 3c528e5..2d6e375 100644 --- a/README.md +++ b/README.md @@ -81,30 +81,6 @@ If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/n ¹ See https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html Use this only if you know what you're doing :) -#### Migrate from ownCloud - -**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. - -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 -``` - -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 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" -sudo yunohost app ssowatconf -``` - ## Links * Report a bug: https://github.com/YunoHost-Apps/nextcloud_ynh/issues diff --git a/README_fr.md b/README_fr.md index baf3cdd..0b4b066 100644 --- a/README_fr.md +++ b/README_fr.md @@ -72,31 +72,6 @@ Et enfin, le message d'erreur suivant dans les logs de Nextcloud peut être igno Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/home/yunohost.multimedia/share/' not inside '/home/yunohost.multimedia/user/') ``` -## Informations supplémentaires - -#### Migrer depuis ownCloud - -**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. - -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 -``` - -L'option `--debug` va vous permettre de visualiser entièrement les retours de la mise à niveau. Si vous rencontrez un problème, merci de nous le transmettre. - -Notez qu'une tâche cron va être exécutée une fois la fin de cette commande. Vous devez attendre qu'elle se fasse avant de faire une autre opération liée aux applications. -Vous devriez constater que Nextcloud sera installé après ça. - -Notez que ça ne changera pas le label ni l'URL. Pour renommer le label, vous pouvez exécuter la commande suivante (en remplaçant `Nextcloud` par ce que vous voulez) : -```bash -sudo yunohost app setting nextcloud label -v "Nextcloud" -sudo yunohost app ssowatconf -``` - ## Liens * Signaler un bug : https://github.com/YunoHost-Apps/nextcloud_ynh/issues diff --git a/conf/owncloud_migration b/conf/owncloud_migration deleted file mode 100644 index 4c1be85..0000000 --- a/conf/owncloud_migration +++ /dev/null @@ -1,13 +0,0 @@ -# File to migrate from Owncloud - -# Final path -/var/www/$app - -# Data directory -/home/yunohost.app/$app - -# Nginx config -/etc/nginx/conf.d/$domain.d/$app.conf - -# php-fpm config -/etc/php5/fpm/pool.d/$app.conf diff --git a/conf/owncloud_post_migration.sh b/conf/owncloud_post_migration.sh deleted file mode 100644 index 952baac..0000000 --- a/conf/owncloud_post_migration.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# Ending the migration process from Owncloud to Nextcloud - -set -u - -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source /usr/share/yunohost/helpers - -#================================================= -# SET VARIABLES -#================================================= - -old_app="__OLD_APP__" -new_app="__NEW_APP__" -script_name="$0" - -#================================================= -# MOVE HOOKS -#================================================= - -hooks_dir="/etc/yunohost/hooks.d/" -mv "$hooks_dir/post_user_create/50-$old_app" "$hooks_dir/post_user_create/50-$new_app" - -#================================================= -# DELETE OLD APP'S SETTINGS -#================================================= - -ynh_secure_remove "/etc/yunohost/apps/$old_app" -yunohost app ssowatconf - -#================================================= -# REMOVE THE OLD USER -#================================================= - -ynh_system_user_delete $old_app - -#================================================= -# DELETE THIS SCRIPT -#================================================= - -echo "rm $script_name" | at now + 1 minutes diff --git a/scripts/upgrade b/scripts/upgrade index 18e0b49..ba025f6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -87,44 +87,11 @@ then # Remove the option backup_core_only after the backup. ynh_app_setting_delete $app backup_core_only - - ynh_clean_setup () { - # Remove the post migration script before its execution ! - ynh_exec_warn_less ynh_secure_remove --file="/tmp/owncloud_post_migration.sh" - - # restore it if the upgrade fails - ynh_restore_upgradebackup - } fi # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# HANDLE MIGRATION FROM OWNCLOUD -#================================================= - -ynh_handle_app_migration "owncloud" "owncloud_migration" -if [ $migration_process -eq 1 ] -then - # If a migration has been performed - # Reload some values changed by the migration process - final_path=$(ynh_app_setting_get --app=$app --key=final_path) - db_name=$(ynh_app_setting_get --app=$app --key=db_name) - - # Remove the old fake package for owncloud. - # Its name is specific, so the migration process can't remove it - ynh_package_autopurge owncloud-deps - - # Change the database access in the config - ynh_replace_string "\('dbname' =>\).*" "\1 '$db_name'," "$final_path/config/config.php" - ynh_replace_string "\('dbuser' =>\).*" "\1 '$db_name'," "$final_path/config/config.php" - - # Change the path of the data directory - ynh_replace_string "\('dbuser' =>\).*" "\1 '$db_name'," "$final_path/config/config.php" - ynh_replace_string "\('datadirectory' =>.*\)$old_app" "\1$app" "$final_path/config/config.php" -fi - #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -501,27 +468,6 @@ ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload -#================================================= -# FINISH MIGRATION PROCESS -#================================================= - -if [ $migration_process -eq 1 ] -then - 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." - - # Execute a post migration script after the end of this upgrade. - # Mainly for some cleaning - script_post_migration=owncloud_post_migration.sh - ynh_replace_string --match_string="__OLD_APP__" --replace_string="$old_app" --target_file=../conf/$script_post_migration - ynh_replace_string --match_string="__NEW_APP__" --replace_string="$app" --target_file=../conf/$script_post_migration - cp ../conf/$script_post_migration /tmp - chmod +x /tmp/$script_post_migration - (cd /tmp; echo "/tmp/$script_post_migration > /tmp/$script_post_migration.log 2>&1" | at now + 2 minutes) -fi - #================================================= # END OF SCRIPT #================================================= From ca1c1039d0f9374e1cf692502b680e6c975b0f74 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 14 Jan 2021 11:56:12 +0100 Subject: [PATCH 40/46] Upgrade to version 20.0.5 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 4 ++-- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3c528e5..d70d922 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [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.4 +**Shipped version:** 20.0.5 ## Screenshots diff --git a/README_fr.md b/README_fr.md index baf3cdd..578bba4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,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 :** 20.0.4 +**Version incluse :** 20.0.5 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 5e3ec17..5543e9a 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.4~ynh1", + "version": "20.0.5~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { @@ -19,7 +19,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.0-fpm", + "php7.3-fpm", "mysql" ], "arguments": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index f4b01b4..f8f4d7f 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="20.0.4" +next_version="20.0.5" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="269f1622e326f5d11e387d3861aad4e2b0e79334ae97eed5a7b3352ba7661420" +nextcloud_source_sha256="5c70dd33024012a1651fd099133d052d129a4dadc6935f44bb9c3e2b360befe3" From 6d041fda5f1d43c749b307fbe0d3698eb0b100f8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 16 Jan 2021 14:12:15 +0100 Subject: [PATCH 41/46] Put back ynh_clean_setup --- scripts/upgrade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index ba025f6..24cfe02 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -87,6 +87,11 @@ then # Remove the option backup_core_only after the backup. ynh_app_setting_delete $app backup_core_only + + ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup + } fi # Exit if an error occurs during the execution of the script From 504c04be575b7bccc282e0a42802fb7826055019 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 21 Jan 2021 17:16:43 +0100 Subject: [PATCH 42/46] If phpversion doesn't exist, create it --- scripts/upgrade | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 18e0b49..8caf739 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -65,6 +65,11 @@ if [ -z "$fpm_usage" ]; then ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi +# If phpversion doesn't exist, create it +if [ -z "$phpversion" ]; then + phpversion="$YNH_PHP_VERSION" +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= From 82898379b367e6f49005b4624842c279ea760ddd Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 21 Jan 2021 17:23:04 +0100 Subject: [PATCH 43/46] Set requirements to latest YNH version for a bugfix --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 5543e9a..e8b5f81 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "apps@yunohost.org" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.6" }, "multi_instance": true, "services": [ From 3792526169da3fe0bac6b89b3477577baa53d97a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 24 Jan 2021 13:49:55 +0100 Subject: [PATCH 44/46] Upgrade doc link --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1584d4c..a455b85 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Documentation - * Official documentation: https://docs.nextcloud.com/server/19/user_manual/ + * Official documentation: https://docs.nextcloud.com/server/20/user_manual/en/ * YunoHost documentation: https://github.com/YunoHost/doc/blob/master/app_nextcloud.md ## Configuration diff --git a/README_fr.md b/README_fr.md index b5119e2..9992659 100644 --- a/README_fr.md +++ b/README_fr.md @@ -26,7 +26,7 @@ Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. ## Documentation - * Documentation officielle : https://docs.nextcloud.com/server/19/user_manual/ + * Documentation officielle : https://docs.nextcloud.com/server/20/user_manual/fr/ * Documentation YunoHost : https://github.com/YunoHost/doc/blob/master/app_nextcloud_fr.md ## Configuration From 7ef18bdbc05f744fba6caa2b64155391a20fdb69 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 25 Jan 2021 17:29:34 +0100 Subject: [PATCH 45/46] Upgrade to 2.0.6 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- pull_request_template.md | 8 ++++---- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a455b85..b828e47 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [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.5 +**Shipped version:** 20.0.6 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 9992659..c3c5a95 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,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 :** 20.0.5 +**Version incluse :** 20.0.6 ## Captures d'écran diff --git a/manifest.json b/manifest.json index e8b5f81..2badd9f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.5~ynh1", + "version": "20.0.6~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/pull_request_template.md b/pull_request_template.md index da30b7b..f501dd4 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -18,7 +18,7 @@ - [ ] **Code review** : - [ ] **Approval (LGTM)** : - [ ] **Approval (LGTM)** : -- **CI succeeded** : -[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/nextcloud_ynh%20PR-NUM-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/nextcloud_ynh%20PR-NUM-/) -*Please replace '-NUM-' in this link by the PR number.* -When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. + +## Package_check results +--- +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index f8f4d7f..dd64272 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="20.0.5" +next_version="20.0.6" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="5c70dd33024012a1651fd099133d052d129a4dadc6935f44bb9c3e2b360befe3" +nextcloud_source_sha256="859167170402b876b6ef1a37fa4aaa5617b6bf847bb5d50a94f636bae65a34b9" From ad61ac01c45dc8ef1618aa61a76c371334bf1222 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 2 Feb 2021 22:25:35 +0100 Subject: [PATCH 46/46] Upgrade to version 20.0.7 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b828e47..e439bda 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [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.6 +**Shipped version:** 20.0.7 ## Screenshots diff --git a/README_fr.md b/README_fr.md index c3c5a95..a949264 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,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 :** 20.0.6 +**Version incluse :** 20.0.7 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 2badd9f..9bb361f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.6~ynh1", + "version": "20.0.7~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index dd64272..1e8134f 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="20.0.6" +next_version="20.0.7" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="859167170402b876b6ef1a37fa4aaa5617b6bf847bb5d50a94f636bae65a34b9" +nextcloud_source_sha256="8ced82b772bf0af67d5be1323e40f977429bc0a2bcc864095efc78767500b72b"