From 3b16063a827fc22cc3084cc6fa0bcf8936624136 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Tue, 26 Feb 2019 00:33:35 +0100 Subject: [PATCH 01/16] [fix] Copy only app missing in new apps dir --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index d58f4b0..57add37 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -205,6 +205,7 @@ do # Backup 3rd party applications from the current nextcloud # But do not overwrite if there is any upgrade # (apps directory already exists in Nextcloud archive) + touch -t 197001010000 $final_path/apps/* cp -a --update "$final_path/apps" "$tmpdir" # Replace the old nextcloud by the new one From c71a444a946751fd658a4bb25841b617870d3fc4 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 26 Feb 2019 00:57:24 +0100 Subject: [PATCH 02/16] [fix] Use the old owncloud method to copy apps dir --- scripts/upgrade | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 57add37..06ea0ff 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,7 @@ fi current_version=$(grep OC_VersionString "$final_path/version.php" | cut -d\' -f2) current_major_version=${current_version%%.*} -if [ $current_major_version -gt 11 ] +if [ $current_major_version -gt 15 ] then # Inform the backup/restore process that it should not save the data directory ynh_app_setting_set $app backup_core_only 1 @@ -205,8 +205,10 @@ do # Backup 3rd party applications from the current nextcloud # But do not overwrite if there is any upgrade # (apps directory already exists in Nextcloud archive) - touch -t 197001010000 $final_path/apps/* - cp -a --update "$final_path/apps" "$tmpdir" + for nc_app_dir in $(sudo ls "${final_path}/apps"); do + [[ ! -d "${tmpdir}/apps/${nc_app_dir}" ]] \ + && cp -a "${final_path}/apps/${nc_app_dir}" "${tmpdir}/apps/${nc_app_dir}" + done # Replace the old nextcloud by the new one ynh_secure_remove "$final_path" From 15f6eb637f7d413906ae4e149c6313c6226b4ef9 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Tue, 26 Feb 2019 00:58:36 +0100 Subject: [PATCH 03/16] [fix] Reset backup on 12 and later version --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 06ea0ff..2d54c82 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,7 @@ fi current_version=$(grep OC_VersionString "$final_path/version.php" | cut -d\' -f2) current_major_version=${current_version%%.*} -if [ $current_major_version -gt 15 ] +if [ $current_major_version -gt 11 ] then # Inform the backup/restore process that it should not save the data directory ynh_app_setting_set $app backup_core_only 1 From 8bee85518de978e41cec1456dbeb8ac0978708df Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Thu, 28 Feb 2019 18:05:10 +0100 Subject: [PATCH 04/16] [enh] Remove sudo and double brackets --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 2d54c82..e83811c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -205,8 +205,8 @@ do # Backup 3rd party applications from the current nextcloud # But do not overwrite if there is any upgrade # (apps directory already exists in Nextcloud archive) - for nc_app_dir in $(sudo ls "${final_path}/apps"); do - [[ ! -d "${tmpdir}/apps/${nc_app_dir}" ]] \ + for nc_app_dir in $(ls "${final_path}/apps"); do + [ ! -d "${tmpdir}/apps/${nc_app_dir}" ] \ && cp -a "${final_path}/apps/${nc_app_dir}" "${tmpdir}/apps/${nc_app_dir}" done From 567e54289aedcc545d4e4732678e433cbbecf1a6 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 7 Mar 2019 12:04:27 +0100 Subject: [PATCH 05/16] Keep the code clear and simple... --- scripts/upgrade | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e83811c..16e3a74 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -205,9 +205,12 @@ do # Backup 3rd party applications from the current nextcloud # But do not overwrite if there is any upgrade # (apps directory already exists in Nextcloud archive) - for nc_app_dir in $(ls "${final_path}/apps"); do - [ ! -d "${tmpdir}/apps/${nc_app_dir}" ] \ - && cp -a "${final_path}/apps/${nc_app_dir}" "${tmpdir}/apps/${nc_app_dir}" + for nc_app_dir in "$(ls "$final_path/apps")" + do + if [ ! -d "$tmpdir/apps/$nc_app_dir" ] + then + cp -a "$final_path/apps/$nc_app_dir" "$tmpdir/apps/$nc_app_dir" + fi done # Replace the old nextcloud by the new one From e8349d8dc9d919e7577deaf06364f54bb0e14e14 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 17 Mar 2019 12:43:11 +0100 Subject: [PATCH 06/16] Fix apps directory parsing --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 16e3a74..ef3e1e0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -206,6 +206,7 @@ do # But do not overwrite if there is any upgrade # (apps directory already exists in Nextcloud archive) for nc_app_dir in "$(ls "$final_path/apps")" + for nc_app_dir in "$(ls -1 "$final_path/apps")" do if [ ! -d "$tmpdir/apps/$nc_app_dir" ] then From 3e1f3c2bc1dc5cdb2ae4ce0e65285f02d740d279 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 17 Mar 2019 12:53:33 +0100 Subject: [PATCH 07/16] Duplicated 'for' --- scripts/upgrade | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ef3e1e0..e4a97f3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -205,7 +205,6 @@ do # Backup 3rd party applications from the current nextcloud # But do not overwrite if there is any upgrade # (apps directory already exists in Nextcloud archive) - for nc_app_dir in "$(ls "$final_path/apps")" for nc_app_dir in "$(ls -1 "$final_path/apps")" do if [ ! -d "$tmpdir/apps/$nc_app_dir" ] From 6944dac81a382a2ae9aadd094865a03058442919 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 23 Mar 2019 21:27:02 +0100 Subject: [PATCH 08/16] Fix directory parsing --- scripts/upgrade | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e4a97f3..774524c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -205,13 +205,16 @@ do # Backup 3rd party applications from the current nextcloud # But do not overwrite if there is any upgrade # (apps directory already exists in Nextcloud archive) - for nc_app_dir in "$(ls -1 "$final_path/apps")" + ( + cd $final_path/apps + for nc_app_dir in */ do - if [ ! -d "$tmpdir/apps/$nc_app_dir" ] - then - cp -a "$final_path/apps/$nc_app_dir" "$tmpdir/apps/$nc_app_dir" - fi + if [ ! -d "$tmpdir/apps/$nc_app_dir" ] + then + cp -a "$nc_app_dir" "$tmpdir/apps/$nc_app_dir" + fi done + ) # Replace the old nextcloud by the new one ynh_secure_remove "$final_path" From 33c2c7f8740307b6fbb79c1252c158cd84fb7461 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 6 Jul 2019 22:41:03 +0200 Subject: [PATCH 09/16] Upgrade to upstream version 15.0.9 --- README.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 +- .../app-00-add-logout_url-conf.patch | 58 ++----------------- 4 files changed, 10 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 16a8a7c..2ee59a9 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 own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 15.0.7 +**Shipped version:** 15.0.9 ## Screenshots diff --git a/manifest.json b/manifest.json index da51998..07e7cac 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": "15.0.7~ynh1", + "version": "15.0.9~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 b576bdc..f0da93d 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="15.0.7" +next_version="15.0.9" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="3e6158951fa72010ccd50dbeac05d8df162183f7bbc62a1c6c89ed7081fa9d49" +nextcloud_source_sha256="7b33e210f64fb94c9a92aa31f087136db73bdacd1aaa7df2905bc7c0887edd5c" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () { diff --git a/sources/patches_last_version/app-00-add-logout_url-conf.patch b/sources/patches_last_version/app-00-add-logout_url-conf.patch index 2e70ba7..07a9531 100644 --- a/sources/patches_last_version/app-00-add-logout_url-conf.patch +++ b/sources/patches_last_version/app-00-add-logout_url-conf.patch @@ -1,62 +1,16 @@ - core/Controller/LoginController.php | 25 ++++++++++++++----------- - 1 file changed, 14 insertions(+), 11 deletions(-) - diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php -index 182d2bc106..82523e306e 100644 +index f83b03bc90..568e20dcd7 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php -@@ -95,13 +95,13 @@ class LoginController extends Controller { - * @param Throttler $throttler - */ - public function __construct($appName, -- IRequest $request, -- IUserManager $userManager, -- IConfig $config, -- ISession $session, -- IUserSession $userSession, -- IURLGenerator $urlGenerator, -- ILogger $logger, -+ IRequest $request, -+ IUserManager $userManager, -+ IConfig $config, -+ ISession $session, -+ IUserSession $userSession, -+ IURLGenerator $urlGenerator, -+ ILogger $logger, - Manager $twoFactorManager, - Defaults $defaults, - Throttler $throttler) { @@ -130,7 +130,10 @@ class LoginController extends Controller { } $this->userSession->logout(); - + - $response = new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); + $redirectUrl = $this->config->getSystemValue('logout_url', -+ $this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm') -+ ); ++ $this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); ++ + $response = new RedirectResponse($redirectUrl); + $this->session->set('clearingExecutionContexts', '1'); + $this->session->close(); $response->addHeader('Clear-Site-Data', '"cache", "storage", "executionContexts"'); - return $response; - } -@@ -303,10 +306,10 @@ class LoginController extends Controller { - $previousUser = $user; - $user = $users[0]->getUID(); - if($user !== $previousUser) { -- $loginResult = $this->userManager->checkPassword($user, $password); -- } -+ $loginResult = $this->userManager->checkPassword($user, $password); - } - } -+ } - - if ($loginResult === false) { - $this->logger->warning('Login failed: \''. $user . -@@ -314,7 +317,7 @@ class LoginController extends Controller { - ['app' => 'core']); - return $this->createLoginFailedResponse($user, $originalUser, - $redirect_url, self::LOGIN_MSG_INVALIDPASSWORD); -- } -+ } - - // TODO: remove password checks from above and let the user session handle failures - // requires https://github.com/owncloud/core/pull/24616 From c21f0ef3fc9f378e9daa23694b8f16df8ab729ba Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 20 Jul 2019 14:44:07 +0200 Subject: [PATCH 10/16] Upgrade to upstream version 15.0.10 --- README.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2ee59a9..5d39562 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 own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 15.0.9 +**Shipped version:** 15.0.10 ## Screenshots diff --git a/manifest.json b/manifest.json index 07e7cac..8230b77 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": "15.0.9~ynh1", + "version": "15.0.10~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 f0da93d..6df5d10 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="15.0.9" +next_version="15.0.10" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="7b33e210f64fb94c9a92aa31f087136db73bdacd1aaa7df2905bc7c0887edd5c" +nextcloud_source_sha256="494511fcda6e823e8dfb571fcf3b9ddc433148449acb080104f4165d2f2f4d43" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () { From b60691e6f30382c288606f8859b1ccd7eefa8f81 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 10 Aug 2019 14:46:34 +0200 Subject: [PATCH 11/16] Fix scope of exec_occ function --- scripts/upgrade | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8e75255..320381e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -176,16 +176,16 @@ ynh_install_app_dependencies $pkg_dependencies # VERSION TO THE NEXT ONE #================================================= +# Define a function to execute commands with `occ` +exec_occ() { +(cd "$final_path" && exec_as "$app" \ + php occ --no-interaction --no-ansi "$@") +} + if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading nextcloud..." --weight=3 - # Define a function to execute commands with `occ` - exec_occ() { - (cd "$final_path" && exec_as "$app" \ - php occ --no-interaction --no-ansi "$@") - } - # Load the last available version source upgrade.d/upgrade.last.sh last_version=$next_version From 8482d00f1a43aed960a4e5a91ebb889c4d182b67 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 10 Aug 2019 17:20:47 +0200 Subject: [PATCH 12/16] Change scope of create_external_storage as well --- scripts/upgrade | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 320381e..f6bdc01 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -182,6 +182,18 @@ exec_occ() { php occ --no-interaction --no-ansi "$@") } +# Define a function to add an external storage +# Create the external storage for the given folders and enable sharing +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` +! [[ $mount_id =~ ^[0-9]+$ ]] \ + && ynh_print_warn --message="Unable to create external storage" \ + || exec_occ files_external:option "$mount_id" enable_sharing true +} + if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading nextcloud..." --weight=3 @@ -323,18 +335,6 @@ then # MOUNT HOME FOLDERS AS EXTERNAL STORAGE #================================================= - # Define a function to add an external storage - # Create the external storage for the given folders and enable sharing - 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` - ! [[ $mount_id =~ ^[0-9]+$ ]] \ - && ynh_print_warn --message="Unable to create external storage" \ - || exec_occ files_external:option "$mount_id" enable_sharing true - } - # Enable External Storage and create local mount to home folder as needed if [ $user_home -eq 1 ]; then exec_occ app:enable files_external From b9d8e09fee2538e76b93e86b2829dcd51c7df867 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 10 Aug 2019 19:28:43 +0200 Subject: [PATCH 13/16] Change also datadir's scope --- scripts/upgrade | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index f6bdc01..2e3f7ec 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -193,6 +193,8 @@ local mount_id=`exec_occ files_external:create --output=json \ && ynh_print_warn --message="Unable to create external storage" \ || exec_occ files_external:option "$mount_id" enable_sharing true } +# Define app's data directory +datadir="/home/yunohost.app/$app/data" if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -202,9 +204,6 @@ then source upgrade.d/upgrade.last.sh last_version=$next_version - # Define app's data directory - datadir="/home/yunohost.app/$app/data" - # Set write access for the following commands chown -R $app: "$final_path" "$datadir" From a870ce02377788333914baea21face817ac25a06 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 11 Aug 2019 14:11:28 +0200 Subject: [PATCH 14/16] Avoid OPcache errors (fixes #209) --- conf/php-fpm.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index f13ed6d..31d62f2 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -433,7 +433,10 @@ env[PATH] = $PATH php_value[upload_max_filesize] = 10G php_value[post_max_size] = 10G php_value[default_charset] = UTF-8 -php_value[opcache.enable]=1 +; OPcache is already activated by default +; php_value[opcache.enable]=1 +; The following parameters are nevertheless recommended for Nextcloud +; see here: https://docs.nextcloud.com/server/15/admin_manual/installation/server_tuning.html#enable-php-opcache php_value[opcache.enable_cli]=1 php_value[opcache.interned_strings_buffer]=8 php_value[opcache.max_accelerated_files]=10000 From ed94f7a3a3d63180e07960c937886aba87f17754 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 13 Aug 2019 18:37:19 +0200 Subject: [PATCH 15/16] Fix typo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 7556b9d..a9152cd 100755 --- a/scripts/install +++ b/scripts/install @@ -69,7 +69,7 @@ ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..."5 +ynh_script_progression --message="Setting up source files..." # Load the last available version source upgrade.d/upgrade.last.sh From 4318322f6304161f7ba212e9160d6348f66875dd Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 17 Aug 2019 09:06:49 +0200 Subject: [PATCH 16/16] Upgrade to upstream version 15.0.11 --- README.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5d39562..86e1b19 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 own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 15.0.10 +**Shipped version:** 15.0.11 ## Screenshots diff --git a/manifest.json b/manifest.json index 8230b77..a774500 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": "15.0.10~ynh1", + "version": "15.0.11~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 6df5d10..2c20cb6 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="15.0.10" +next_version="15.0.11" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="494511fcda6e823e8dfb571fcf3b9ddc433148449acb080104f4165d2f2f4d43" +nextcloud_source_sha256="59cdde8e7a4a15606efc246e37adf6401b0b4a60f33289be8725d675b9c2ae26" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () {