diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2017-12-05 09:23:28 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2017-12-05 09:23:40 +0000 |
commit | a3ab3a5186575f9ccb06789a864452359e0e5b22 (patch) | |
tree | c1f40fd19e515c3e0e9834b8ed48db419668cda7 /community | |
parent | 3ca3c57110e6e52c5b5c7828f2a934d2101ed4ee (diff) | |
download | aports-a3ab3a5186575f9ccb06789a864452359e0e5b22.tar.bz2 aports-a3ab3a5186575f9ccb06789a864452359e0e5b22.tar.xz |
community/nextcloud: upgrade to 12.0.4
Diffstat (limited to 'community')
4 files changed, 3 insertions, 434 deletions
diff --git a/community/nextcloud/0001-CSSResourceLocator-account-for-symlinks-in-app-path.patch b/community/nextcloud/0001-CSSResourceLocator-account-for-symlinks-in-app-path.patch deleted file mode 100644 index b6355b0d7f..0000000000 --- a/community/nextcloud/0001-CSSResourceLocator-account-for-symlinks-in-app-path.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b0d296639cfc5d0460987787cc9869c5e5473d85 Mon Sep 17 00:00:00 2001 -From: Kyle Fazzari <kyrofa@ubuntu.com> -Date: Fri, 3 Nov 2017 23:03:34 -0700 -Subject: [PATCH] CSSResourceLocator: account for symlinks in app path - -Currently, if the app path includes a symlink, the calculated webDir -will be incorrect when generating CSS and URLs will be pointing to the -wrong place, breaking CSS. - -Use realpath when retrieving app path, and these issues go away. - -Fix #6028 - -Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com> ---- - lib/private/Template/CSSResourceLocator.php | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php -index 1028f31a5ea..bd5b9a34477 100644 ---- a/lib/private/Template/CSSResourceLocator.php -+++ b/lib/private/Template/CSSResourceLocator.php -@@ -71,6 +71,11 @@ public function doFind($style) { - return; - } - -+ // Account for the possibility of having symlinks in app path. Doing -+ // this here instead of above as an empty argument to realpath gets -+ // turned into cwd. -+ $app_path = realpath($app_path); -+ - if(!$this->cacheAndAppendScssIfExist($app_path, $style.'.scss', $app)) { - $this->append($app_path, $style.'.css', $app_url); - } diff --git a/community/nextcloud/0002-JSResourceLocator-account-for-symlinks-in-app-path.patch b/community/nextcloud/0002-JSResourceLocator-account-for-symlinks-in-app-path.patch deleted file mode 100644 index 6d51f3ea37..0000000000 --- a/community/nextcloud/0002-JSResourceLocator-account-for-symlinks-in-app-path.patch +++ /dev/null @@ -1,344 +0,0 @@ -From 06ba1a8a02f08e066ad97cdd192534c296f3a640 Mon Sep 17 00:00:00 2001 -From: Kyle Fazzari <kyrofa@ubuntu.com> -Date: Tue, 7 Nov 2017 14:54:21 -0800 -Subject: [PATCH] JSResourceLocator: account for symlinks in app path - -Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com> ---- - lib/private/Template/JSResourceLocator.php | 11 +- - tests/lib/Template/CSSResourceLocatorTest.php | 148 ++++++++++++++++++++++++++ - tests/lib/Template/JSResourceLocatorTest.php | 139 ++++++++++++++++++++++++ - 3 files changed, 295 insertions(+), 3 deletions(-) - create mode 100644 tests/lib/Template/CSSResourceLocatorTest.php - create mode 100644 tests/lib/Template/JSResourceLocatorTest.php - -diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php -index 97a9eacedf5..228fa09e821 100644 ---- a/lib/private/Template/JSResourceLocator.php -+++ b/lib/private/Template/JSResourceLocator.php -@@ -75,9 +75,14 @@ public function doFind($script) { - $app_path = \OC_App::getAppPath($app); - $app_url = \OC_App::getAppWebPath($app); - -+ // Account for the possibility of having symlinks in app path. Doing -+ // this in a separate variable, because an empty argument to realpath -+ // gets turned into cwd, which makes it hard to see if app_path got set. -+ $real_app_path = realpath($app_path); -+ - // missing translations files fill be ignored - if (strpos($script, 'l10n/') === 0) { -- $this->appendIfExist($app_path, $script . '.js', $app_url); -+ $this->appendIfExist($real_app_path, $script . '.js', $app_url); - return; - } - -@@ -89,8 +94,8 @@ public function doFind($script) { - return; - } - -- if (!$this->cacheAndAppendCombineJsonIfExist($app_path, $script.'.json', $app)) { -- $this->append($app_path, $script . '.js', $app_url); -+ if (!$this->cacheAndAppendCombineJsonIfExist($real_app_path, $script.'.json', $app)) { -+ $this->append($real_app_path, $script . '.js', $app_url); - } - } - -diff --git a/tests/lib/Template/CSSResourceLocatorTest.php b/tests/lib/Template/CSSResourceLocatorTest.php -new file mode 100644 -index 00000000000..bd13487282e ---- /dev/null -+++ b/tests/lib/Template/CSSResourceLocatorTest.php -@@ -0,0 +1,148 @@ -+<?php -+/** -+ * @copyright Copyright (c) 2017 Kyle Fazzari <kyrofa@ubuntu.com> -+ * -+ * @author Kyle Fazzari <kyrofa@ubuntu.com> -+ * -+ * @license GNU AGPL version 3 or any later version -+ * -+ * This program is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Affero General Public License as -+ * published by the Free Software Foundation, either version 3 of the -+ * License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Affero General Public License for more details. -+ * -+ * You should have received a copy of the GNU Affero General Public License -+ * along with this program. If not, see <http://www.gnu.org/licenses/>. -+ * -+ */ -+ -+namespace Test\Template; -+ -+use OC\Files\AppData\Factory; -+use OCP\ILogger; -+use OCP\IURLGenerator; -+use OCP\IConfig; -+use OCA\Theming\ThemingDefaults; -+use OCP\ICache; -+use OC\Template\SCSSCacher; -+use OC\Template\CSSResourceLocator; -+ -+function rrmdir($directory) { -+ $files = array_diff(scandir($directory), array('.','..')); -+ foreach ($files as $file) { -+ if (is_dir($directory . '/' . $file)) { -+ rrmdir($directory . '/' . $file); -+ } else { -+ unlink($directory . '/' . $file); -+ } -+ } -+ return rmdir($directory); -+} -+ -+function randomString() { -+ return sha1(uniqid(mt_rand(), true)); -+} -+ -+class CSSResourceLocatorTest extends \Test\TestCase { -+ /** @var IAppData|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $appData; -+ /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $urlGenerator; -+ /** @var SystemConfig|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $config; -+ /** @var ThemingDefaults|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $themingDefaults; -+ /** @var ICache|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $depsCache; -+ /** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $logger; -+ -+ protected function setUp() { -+ parent::setUp(); -+ -+ $this->logger = $this->createMock(ILogger::class); -+ $this->appData = $this->createMock(IAppData::class); -+ $this->urlGenerator = $this->createMock(IURLGenerator::class); -+ $this->config = $this->createMock(IConfig::class); -+ $this->depsCache = $this->createMock(ICache::class); -+ $this->themingDefaults = $this->createMock(ThemingDefaults::class); -+ } -+ -+ private function cssResourceLocator() { -+ /** @var Factory|\PHPUnit_Framework_MockObject_MockObject $factory */ -+ $factory = $this->createMock(Factory::class); -+ $factory->method('get')->with('css')->willReturn($this->appData); -+ $scssCacher = new SCSSCacher( -+ $this->logger, -+ $factory, -+ $this->urlGenerator, -+ $this->config, -+ $this->themingDefaults, -+ \OC::$SERVERROOT, -+ $this->depsCache -+ ); -+ return new CSSResourceLocator( -+ $this->logger, -+ 'theme', -+ array('core'=>'map'), -+ array('3rd'=>'party'), -+ $scssCacher -+ ); -+ } -+ -+ public function testConstructor() { -+ $locator = $this->cssResourceLocator(); -+ $this->assertAttributeEquals('theme', 'theme', $locator); -+ $this->assertAttributeEquals('core', 'serverroot', $locator); -+ $this->assertAttributeEquals(array('core'=>'map','3rd'=>'party'), 'mapping', $locator); -+ $this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator); -+ $this->assertAttributeEquals('map', 'webroot', $locator); -+ $this->assertAttributeEquals(array(), 'resources', $locator); -+ } -+ -+ public function testFindWithAppPathSymlink() { -+ // First create new apps path, and a symlink to it -+ $apps_dirname = randomString(); -+ $new_apps_path = sys_get_temp_dir() . '/' . $apps_dirname; -+ $new_apps_path_symlink = $new_apps_path . '_link'; -+ mkdir($new_apps_path); -+ symlink($apps_dirname, $new_apps_path_symlink); -+ -+ // Create an app within that path -+ mkdir($new_apps_path . '/' . 'test-app'); -+ -+ // Use the symlink as the app path -+ \OC::$APPSROOTS[] = [ -+ 'path' => $new_apps_path_symlink, -+ 'url' => '/apps-test', -+ 'writable' => false, -+ ]; -+ -+ $locator = $this->cssResourceLocator(); -+ $locator->find(array('test-app/test-file')); -+ -+ $resources = $locator->getResources(); -+ $this->assertCount(1, $resources); -+ $resource = $resources[0]; -+ $this->assertCount(3, $resource); -+ $root = $resource[0]; -+ $webRoot = $resource[1]; -+ $file = $resource[2]; -+ -+ $expectedRoot = $new_apps_path . '/test-app'; -+ $expectedWebRoot = '/apps-test/test-app'; -+ $expectedFile = 'test-file.css'; -+ -+ $this->assertEquals($expectedRoot, $root, -+ 'Ensure the app path symlink is resolved into the real path'); -+ $this->assertEquals($expectedWebRoot, $webRoot); -+ $this->assertEquals($expectedFile, $file); -+ -+ rrmdir($new_apps_path); -+ } -+} -diff --git a/tests/lib/Template/JSResourceLocatorTest.php b/tests/lib/Template/JSResourceLocatorTest.php -new file mode 100644 -index 00000000000..49f0fb67f48 ---- /dev/null -+++ b/tests/lib/Template/JSResourceLocatorTest.php -@@ -0,0 +1,139 @@ -+<?php -+/** -+ * @copyright Copyright (c) 2017 Kyle Fazzari <kyrofa@ubuntu.com> -+ * -+ * @author Kyle Fazzari <kyrofa@ubuntu.com> -+ * -+ * @license GNU AGPL version 3 or any later version -+ * -+ * This program is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Affero General Public License as -+ * published by the Free Software Foundation, either version 3 of the -+ * License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Affero General Public License for more details. -+ * -+ * You should have received a copy of the GNU Affero General Public License -+ * along with this program. If not, see <http://www.gnu.org/licenses/>. -+ * -+ */ -+ -+namespace Test\Template; -+ -+use OC\Template\JSCombiner; -+use OCP\Files\IAppData; -+use OCP\IURLGenerator; -+use OCP\ICache; -+use OC\SystemConfig; -+use OCP\ILogger; -+use OC\Template\JSResourceLocator; -+ -+function rrmdir($directory) { -+ $files = array_diff(scandir($directory), array('.','..')); -+ foreach ($files as $file) { -+ if (is_dir($directory . '/' . $file)) { -+ rrmdir($directory . '/' . $file); -+ } else { -+ unlink($directory . '/' . $file); -+ } -+ } -+ return rmdir($directory); -+} -+ -+function randomString() { -+ return sha1(uniqid(mt_rand(), true)); -+} -+ -+class JSResourceLocatorTest extends \Test\TestCase { -+ /** @var IAppData|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $appData; -+ /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $urlGenerator; -+ /** @var SystemConfig|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $config; -+ /** @var ICache|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $depsCache; -+ /** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */ -+ protected $logger; -+ -+ protected function setUp() { -+ parent::setUp(); -+ -+ $this->appData = $this->createMock(IAppData::class); -+ $this->urlGenerator = $this->createMock(IURLGenerator::class); -+ $this->config = $this->createMock(SystemConfig::class); -+ $this->depsCache = $this->createMock(ICache::class); -+ $this->logger = $this->createMock(ILogger::class); -+ } -+ -+ private function jsResourceLocator() { -+ $jsCombiner = new JSCombiner( -+ $this->appData, -+ $this->urlGenerator, -+ $this->depsCache, -+ $this->config, -+ $this->logger -+ ); -+ return new JSResourceLocator( -+ $this->logger, -+ 'theme', -+ array('core'=>'map'), -+ array('3rd'=>'party'), -+ $jsCombiner -+ ); -+ } -+ -+ public function testConstructor() { -+ $locator = $this->jsResourceLocator(); -+ $this->assertAttributeEquals('theme', 'theme', $locator); -+ $this->assertAttributeEquals('core', 'serverroot', $locator); -+ $this->assertAttributeEquals(array('core'=>'map','3rd'=>'party'), 'mapping', $locator); -+ $this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator); -+ $this->assertAttributeEquals('map', 'webroot', $locator); -+ $this->assertAttributeEquals(array(), 'resources', $locator); -+ } -+ -+ public function testFindWithAppPathSymlink() { -+ // First create new apps path, and a symlink to it -+ $apps_dirname = randomString(); -+ $new_apps_path = sys_get_temp_dir() . '/' . $apps_dirname; -+ $new_apps_path_symlink = $new_apps_path . '_link'; -+ mkdir($new_apps_path); -+ symlink($apps_dirname, $new_apps_path_symlink); -+ -+ // Create an app within that path -+ mkdir($new_apps_path . '/' . 'test-app'); -+ -+ // Use the symlink as the app path -+ \OC::$APPSROOTS[] = [ -+ 'path' => $new_apps_path_symlink, -+ 'url' => '/apps-test', -+ 'writable' => false, -+ ]; -+ -+ $locator = $this->jsResourceLocator(); -+ $locator->find(array('test-app/test-file')); -+ -+ $resources = $locator->getResources(); -+ $this->assertCount(1, $resources); -+ $resource = $resources[0]; -+ $this->assertCount(3, $resource); -+ $root = $resource[0]; -+ $webRoot = $resource[1]; -+ $file = $resource[2]; -+ -+ $expectedRoot = $new_apps_path . '/test-app'; -+ $expectedWebRoot = '/apps-test/test-app'; -+ $expectedFile = 'test-file.js'; -+ -+ $this->assertEquals($expectedRoot, $root, -+ 'Ensure the app path symlink is resolved into the real path'); -+ $this->assertEquals($expectedWebRoot, $webRoot); -+ $this->assertEquals($expectedFile, $file); -+ -+ rrmdir($new_apps_path); -+ } -+} diff --git a/community/nextcloud/0003-JSResourceLocator-re-use-app_path.patch b/community/nextcloud/0003-JSResourceLocator-re-use-app_path.patch deleted file mode 100644 index c32d48b3d5..0000000000 --- a/community/nextcloud/0003-JSResourceLocator-re-use-app_path.patch +++ /dev/null @@ -1,47 +0,0 @@ -From d2a2793073929194cdb2de31cfb331fc5e95346e Mon Sep 17 00:00:00 2001 -From: Kyle Fazzari <kyrofa@ubuntu.com> -Date: Sun, 12 Nov 2017 08:08:38 -0800 -Subject: [PATCH] JSResourceLocator: re-use $app_path - -Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com> ---- - lib/private/Template/JSResourceLocator.php | 16 +++++++++------- - 1 file changed, 9 insertions(+), 7 deletions(-) - -diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php -index 228fa09e821..93a737b66cc 100644 ---- a/lib/private/Template/JSResourceLocator.php -+++ b/lib/private/Template/JSResourceLocator.php -@@ -75,14 +75,16 @@ public function doFind($script) { - $app_path = \OC_App::getAppPath($app); - $app_url = \OC_App::getAppWebPath($app); - -- // Account for the possibility of having symlinks in app path. Doing -- // this in a separate variable, because an empty argument to realpath -- // gets turned into cwd, which makes it hard to see if app_path got set. -- $real_app_path = realpath($app_path); -+ if ($app_path !== false) { -+ // Account for the possibility of having symlinks in app path. Only -+ // do this if $app_path is set, because an empty argument to realpath -+ // gets turned into cwd. -+ $app_path = realpath($app_path); -+ } - - // missing translations files fill be ignored - if (strpos($script, 'l10n/') === 0) { -- $this->appendIfExist($real_app_path, $script . '.js', $app_url); -+ $this->appendIfExist($app_path, $script . '.js', $app_url); - return; - } - -@@ -94,8 +96,8 @@ public function doFind($script) { - return; - } - -- if (!$this->cacheAndAppendCombineJsonIfExist($real_app_path, $script.'.json', $app)) { -- $this->append($real_app_path, $script . '.js', $app_url); -+ if (!$this->cacheAndAppendCombineJsonIfExist($app_path, $script.'.json', $app)) { -+ $this->append($app_path, $script . '.js', $app_url); - } - } - diff --git a/community/nextcloud/APKBUILD b/community/nextcloud/APKBUILD index 0113e9a2c1..0d0c87da91 100644 --- a/community/nextcloud/APKBUILD +++ b/community/nextcloud/APKBUILD @@ -1,8 +1,8 @@ # Maintainer: Leonardo Arena <rnalrd@alpinelinux.org> # Contributor: Jakub Jirutka <jakub@jirutka.cz> pkgname=nextcloud -pkgver=12.0.3 -pkgrel=1 +pkgver=12.0.4 +pkgrel=0 pkgdesc="A safe home for all your data" url="http://nextcloud.com" arch="noarch" @@ -25,9 +25,6 @@ source="https://download.nextcloud.com/server/releases/$pkgname-$pkgver.zip app-encryption-info-add-mcrypt.patch iconv-ascii-translit-not-supported.patch use-external-docs-if-local-not-avail.patch - 0001-CSSResourceLocator-account-for-symlinks-in-app-path.patch - 0002-JSResourceLocator-account-for-symlinks-in-app-path.patch - 0003-JSResourceLocator-re-use-app_path.patch $pkgname-config.php $pkgname.logrotate @@ -224,16 +221,13 @@ _package_app() { mv "$pkgdir"/$_appsdir/$appname "$subpkgdir"/$_appsdir/ } -sha512sums="f13f0810b1755abdcac8c72e69417baeebd759943afb6743530a136b440ac9bebded8dae282450056c0613f5982b15f41aefba3b766ebb5eaea3d3a0e82710cc nextcloud-12.0.3.zip +sha512sums="723f373b8be2fb4c44fdc90f1f357db36c56ea4740597983e2684872ce068e4c12028c3c8584ab1a71ba6df20285db4d15c82c2d22bea8eeaacc061a74c2375c nextcloud-12.0.4.zip 9c20237c4952ff543171768160c17c3608cc43ad9592fecccaeb337787d566f039f27f30f118359dfff7db58cd12d811c05be15e5994efee57a9ed75787d71f5 nextcloud10-dont-chmod.patch ec3921d4d463ed82be0be073af8064048a20f638424d1d39ab46db4252036e87ef2614570be91a5cef0c25c6bcaaf1a2725d2468bdb4a0fbee2b504a4dd0fbc8 dont-update-htaccess.patch 04783385ca35be9e8b895e91294b082cd2a1f50c4e17dc195901885ecd421db9a6fe45360d7eac623873ae4efad80b92f31ebde59f4ed76d832c8cac450dac85 disable-integrity-check-as-default.patch 8d3cb1436aa79f1ac0a7b4b3370fcfb5c50dbe811e631cabcb8170fb80da5967a88a15bc39cd04eaccffb3177bdf90fcba2a512e28e034e16d6bc9b445d2d137 app-encryption-info-add-mcrypt.patch 9bd1cdb73928d8e746286a8ededf79262835caee8fdb4a18e117535ed95784b5a0b04fad55c720084dd8ae1ed4fe123be55b41d3100c9bb0333af485084bc4b1 iconv-ascii-translit-not-supported.patch 478f5cd7c5d30380ea619d3e8ec623217a06a09b27534266f00297545c7d276b068c5d984673eebc5676e8bac7f45112549498944ce3fa678ac8a69541d7c430 use-external-docs-if-local-not-avail.patch -391cc43f224239ab6113ab193ae6738eaf42dc0f4dfbfa1a401e833983b789c4eb552288dec82b8c9bbf0349596bbc8ff8481244b5aa171ed609a44393e33518 0001-CSSResourceLocator-account-for-symlinks-in-app-path.patch -004213fdc96a0d66364916475d7d5019ffce79aed941d79e9bd013a2d9aee7091ee04750fbd97919a6b03b14c3a898f46618cd612c0bcae386c5bc90a110b031 0002-JSResourceLocator-account-for-symlinks-in-app-path.patch -4e571b1a3fcfc8ad8b7bb87987b1d60fecb0603e23dccd3fbffc2e3e085bb2c726ca78b6c813ccb083760dccd8f8382e6dfe0ea3f1f46b6689e7c19c8754dde6 0003-JSResourceLocator-re-use-app_path.patch 89c941e2719629ee633421c4c75b55026c1a0a6b255e7f1f2c14612c10325045051b16dc5f17975af4a2a34ec187008de2eb15a53ac4cd06d26a5cbbd79fb73a nextcloud-config.php f224d72799ee5819979089eb58978225454223bee597c938681a4f6279eb49297fe9250ac54ccf8bcb33ae262bce43d085affb77723492ee662263710d4008c9 nextcloud.logrotate 35cf156839215113b5d8fb8842b4c1e19a50be3c16be7048879fdd808674e4875dbacf3e2dd884fd182258595b7a137d7d3c2dc602a7ff5613c8b65fae0abe67 nextcloud.confd |