From 53c4fb686b427fd72fa5686e80efd786b49ac1c4 Mon Sep 17 00:00:00 2001 From: Nathanael Date: Sat, 15 Dec 2018 12:04:09 +0100 Subject: [PATCH 1/8] Upgrade to upstream version 15.0.0 Upgrade to upstream version 15.0.0 --- README.md | 2 +- scripts/upgrade.d/upgrade.14.sh | 10 ++++++++++ scripts/upgrade.d/upgrade.last.sh | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100755 scripts/upgrade.d/upgrade.14.sh diff --git a/README.md b/README.md index 97d1435..8bc16ea 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Nextcloud for YunoHost own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 14.0.4 +**Shipped version:** 15.0.0 [![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) ![](https://github.com/nextcloud/screenshots/blob/master/files/filelist.png) diff --git a/scripts/upgrade.d/upgrade.14.sh b/scripts/upgrade.d/upgrade.14.sh new file mode 100755 index 0000000..55c0f06 --- /dev/null +++ b/scripts/upgrade.d/upgrade.14.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Last available nextcloud version +next_version="14.0.4" + +# Nextcloud tarball checksum sha256 +nextcloud_source_sha256="4f5dd15a71694bd2f15fba0d2f942e5a5b1f5aba13511c507a23324d746b40e8" + +# Patch nextcloud files only for the last version +cp -a ../sources/patches_last_version/* ../sources/patches diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 55c0f06..62e17eb 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="14.0.4" +next_version="15.0.0" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="4f5dd15a71694bd2f15fba0d2f942e5a5b1f5aba13511c507a23324d746b40e8" +nextcloud_source_sha256="5bb0c58171353da844019b64080c21078002a59ab956ab72adb958844a98eb78" # Patch nextcloud files only for the last version cp -a ../sources/patches_last_version/* ../sources/patches From a5d7aac75d181883abd49ca51961c698cbc05e65 Mon Sep 17 00:00:00 2001 From: Nathanael Date: Sat, 15 Dec 2018 18:16:30 +0100 Subject: [PATCH 2/8] Upgrade to upstream version 15.0.0 (fix) Upgrade to upstream version 15.0.0 (fix) --- scripts/upgrade.d/upgrade.14.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade.d/upgrade.14.sh b/scripts/upgrade.d/upgrade.14.sh index 55c0f06..8c5e80c 100755 --- a/scripts/upgrade.d/upgrade.14.sh +++ b/scripts/upgrade.d/upgrade.14.sh @@ -1,10 +1,7 @@ #!/bin/bash # Last available nextcloud version -next_version="14.0.4" +next_version="15.0.0" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="4f5dd15a71694bd2f15fba0d2f942e5a5b1f5aba13511c507a23324d746b40e8" - -# Patch nextcloud files only for the last version -cp -a ../sources/patches_last_version/* ../sources/patches +nextcloud_source_sha256="5bb0c58171353da844019b64080c21078002a59ab956ab72adb958844a98eb78" \ No newline at end of file From f1f95274a283206f1cb9bfcc5c11ddbc3273c34c Mon Sep 17 00:00:00 2001 From: Nathanael Date: Sun, 16 Dec 2018 20:49:31 +0100 Subject: [PATCH 3/8] Version 15 : add occ commands to improve db performances --- scripts/upgrade | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 6c54ca5..355cff6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -223,6 +223,8 @@ do # Print the current version number of nextcloud exec_occ -V + exec_occ db:add-missing-indices + exec_occ db:convert-filecache-bigint done #================================================= From 134a44cc3fee83bdce40caab2518c89bd30fd0cc Mon Sep 17 00:00:00 2001 From: Nathanael Date: Sun, 16 Dec 2018 21:29:45 +0100 Subject: [PATCH 4/8] Revert "Version 15 : add occ commands to improve db performances" Because of https://github.com/YunoHost-Apps/nextcloud_ynh/pull/149 This reverts commit f1f95274a283206f1cb9bfcc5c11ddbc3273c34c. --- scripts/upgrade | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 355cff6..6c54ca5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -223,8 +223,6 @@ do # Print the current version number of nextcloud exec_occ -V - exec_occ db:add-missing-indices - exec_occ db:convert-filecache-bigint done #================================================= From 33c3ecb3dcfd61340a6aed15f1569288e189c58f Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Fri, 21 Dec 2018 00:09:01 +0100 Subject: [PATCH 5/8] Adapt CSPv3 disabling patch and add a patch to allow eval in JS scripts for YunoHost tile --- ...isable-CSPv3-nonce_and_allow-YNH-fonts.patch | 14 +++++++------- ...r-eval-in-JS-scripts-for-YunoHost-tile.patch | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 sources/patches_last_version/app-02-Allow-for-eval-in-JS-scripts-for-YunoHost-tile.patch diff --git a/sources/patches_last_version/app-01-disable-CSPv3-nonce_and_allow-YNH-fonts.patch b/sources/patches_last_version/app-01-disable-CSPv3-nonce_and_allow-YNH-fonts.patch index 42d6d99..d5a609a 100644 --- a/sources/patches_last_version/app-01-disable-CSPv3-nonce_and_allow-YNH-fonts.patch +++ b/sources/patches_last_version/app-01-disable-CSPv3-nonce_and_allow-YNH-fonts.patch @@ -1,9 +1,9 @@ - lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php | 4 ++++ - lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php | 3 ++- + .../Security/CSP/ContentSecurityPolicyNonceManager.php | 4 ++++ + lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php -index 088fb2d859..15b05b75d1 100644 +index 795d8cc864..5f3c961445 100644 --- a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php +++ b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php @@ -70,6 +70,10 @@ class ContentSecurityPolicyNonceManager { @@ -18,16 +18,16 @@ index 088fb2d859..15b05b75d1 100644 Request::USER_AGENT_CHROME, // Firefox 45+ diff --git a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php -index 6397d32cb9..32281a1734 100644 +index 3fcef1d0ef..7ce01a68fc 100644 --- a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php +++ b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php -@@ -406,7 +406,8 @@ class EmptyContentSecurityPolicy { - +@@ -449,7 +449,8 @@ class EmptyContentSecurityPolicy { + if(!empty($this->allowedFontDomains)) { $policy .= 'font-src ' . implode(' ', $this->allowedFontDomains); - $policy .= ';'; + // YunoHost patch: extend font-src to load data fonts embedded in YunoHost tile script + $policy .= ' data:;'; } - + if(!empty($this->allowedConnectDomains)) { diff --git a/sources/patches_last_version/app-02-Allow-for-eval-in-JS-scripts-for-YunoHost-tile.patch b/sources/patches_last_version/app-02-Allow-for-eval-in-JS-scripts-for-YunoHost-tile.patch new file mode 100644 index 0000000..38f37f9 --- /dev/null +++ b/sources/patches_last_version/app-02-Allow-for-eval-in-JS-scripts-for-YunoHost-tile.patch @@ -0,0 +1,17 @@ + lib/public/AppFramework/Http/ContentSecurityPolicy.php | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/public/AppFramework/Http/ContentSecurityPolicy.php b/lib/public/AppFramework/Http/ContentSecurityPolicy.php +index e9ecf00036..8e69c8d2dc 100644 +--- a/lib/public/AppFramework/Http/ContentSecurityPolicy.php ++++ b/lib/public/AppFramework/Http/ContentSecurityPolicy.php +@@ -44,7 +44,8 @@ class ContentSecurityPolicy extends EmptyContentSecurityPolicy { + /** @var bool Whether inline JS snippets are allowed */ + protected $inlineScriptAllowed = false; + /** @var bool Whether eval in JS scripts is allowed */ +- protected $evalScriptAllowed = false; ++ // YunoHost patch: allow for eval in JS scripts for YunoHost tile ++ protected $evalScriptAllowed = true; + /** @var array Domains from which scripts can get loaded */ + protected $allowedScriptDomains = [ + '\'self\'', From c3d725c45bc14c110419924d5a8c544c15527b7e Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Fri, 21 Dec 2018 19:40:20 +0100 Subject: [PATCH 6/8] Fix README screenshot URL (fixes #153) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bc16ea..278dc05 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ you can synchronize your files over your devices. **Shipped version:** 15.0.0 [![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) -![](https://github.com/nextcloud/screenshots/blob/master/files/filelist.png) +![](https://raw.githubusercontent.com/nextcloud/screenshots/master/files/Files%20Overview.png) ## Features From d62e8c411c25d114235c29ed6ae67452364f1d76 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 22 Dec 2018 09:26:05 +0100 Subject: [PATCH 7/8] Limit upgrade operations (patches, maintenance, etc.) to the last upgrade --- scripts/upgrade | 2 ++ scripts/upgrade.d/upgrade.last.sh | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6c54ca5..d0c6329 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -176,6 +176,8 @@ do # then it's the last upgrade to do if [ "$major_version" -eq "$current_major_version" ]; then current_major_version=last + # Execute the commands dedicated to the last upgrade + last_upgrade_operations fi # Load the value for this version diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 2bed20b..e061d31 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -6,8 +6,11 @@ next_version="15.0.0" # Nextcloud tarball checksum sha256 nextcloud_source_sha256="5bb0c58171353da844019b64080c21078002a59ab956ab72adb958844a98eb78" -# Patch nextcloud files only for the last version -cp -a ../sources/patches_last_version/* ../sources/patches +# This function will only be executed upon applying the last upgrade referenced above +last_upgrade_operations () { + # Patch nextcloud files only for the last version + cp -a ../sources/patches_last_version/* ../sources/patches -# Execute post-upgrade operations later on -(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u nextcloud php occ db:add-missing-indices ; sudo -u nextcloud php occ db:convert-filecache-bigint -n) > /tmp/nextcloud_maintenance.log") + # Execute post-upgrade operations later on + (cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u nextcloud php occ db:add-missing-indices ; sudo -u nextcloud php occ db:convert-filecache-bigint -n) > /tmp/nextcloud_maintenance.log") +} From 0857601c4fc5e183c7bdc289f7773c91b9129b2e Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 30 Dec 2018 20:05:20 +0100 Subject: [PATCH 8/8] Change version in manifest as well --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index d5924da..9b9f080 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": "14.0.4~ynh1", + "version": "15.0.0~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": {