From 260614d225ad68cf4bb1bc31c2480b2ccd169d56 Mon Sep 17 00:00:00 2001 From: James Hogarth Date: Tue, 21 Feb 2017 14:30:00 +0000 Subject: import of srpm from review --- .gitignore | 1 + nextcloud-10.0.3-dont-check-php-version.patch | 69 ++ nextcloud-463e2ea-php71-backport.patch | 22 + nextcloud-9.1.0-amazon-autoloader.patch | 15 + ...ud-9.1.0-default_integrity_check_disabled.patch | 13 + nextcloud-9.1.0-dont_update_htacess.patch | 106 +++ nextcloud-9.1.0-dropbox-autoloader.patch | 25 + nextcloud-9.1.0-google-autoloader.patch | 37 + nextcloud-README.fedora | 116 +++ nextcloud-access-httpd.conf.avail | 24 + nextcloud-auth-any.inc | 12 + nextcloud-auth-local.inc | 14 + nextcloud-auth-none.inc | 12 + nextcloud-b129d5d-php71-backport.patch | 13 + nextcloud-conf-nginx.conf | 4 + nextcloud-config.php | 26 + nextcloud-default-nginx.conf | 81 ++ nextcloud-defaults.inc | 60 ++ nextcloud-el7-php-fpm.conf | 24 + nextcloud-fedora-autoloader.php | 68 ++ nextcloud-httpd.conf | 50 ++ nextcloud-mysql.txt | 28 + nextcloud-php-fpm.conf | 25 + nextcloud-postgresql.txt | 43 ++ nextcloud.spec | 827 +++++++++++++++++++++ sources | 1 + 26 files changed, 1716 insertions(+) create mode 100644 nextcloud-10.0.3-dont-check-php-version.patch create mode 100644 nextcloud-463e2ea-php71-backport.patch create mode 100644 nextcloud-9.1.0-amazon-autoloader.patch create mode 100644 nextcloud-9.1.0-default_integrity_check_disabled.patch create mode 100644 nextcloud-9.1.0-dont_update_htacess.patch create mode 100644 nextcloud-9.1.0-dropbox-autoloader.patch create mode 100644 nextcloud-9.1.0-google-autoloader.patch create mode 100644 nextcloud-README.fedora create mode 100644 nextcloud-access-httpd.conf.avail create mode 100644 nextcloud-auth-any.inc create mode 100644 nextcloud-auth-local.inc create mode 100644 nextcloud-auth-none.inc create mode 100644 nextcloud-b129d5d-php71-backport.patch create mode 100644 nextcloud-conf-nginx.conf create mode 100644 nextcloud-config.php create mode 100644 nextcloud-default-nginx.conf create mode 100644 nextcloud-defaults.inc create mode 100644 nextcloud-el7-php-fpm.conf create mode 100644 nextcloud-fedora-autoloader.php create mode 100644 nextcloud-httpd.conf create mode 100644 nextcloud-mysql.txt create mode 100644 nextcloud-php-fpm.conf create mode 100644 nextcloud-postgresql.txt create mode 100644 nextcloud.spec diff --git a/.gitignore b/.gitignore index e69de29..8d226a7 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/nextcloud-10.0.3.tar.bz2 diff --git a/nextcloud-10.0.3-dont-check-php-version.patch b/nextcloud-10.0.3-dont-check-php-version.patch new file mode 100644 index 0000000..a0dbb17 --- /dev/null +++ b/nextcloud-10.0.3-dont-check-php-version.patch @@ -0,0 +1,69 @@ +diff --git a/console.php b/console.php +index b2724db..149c265 100644 +--- a/console.php ++++ b/console.php +@@ -31,22 +31,6 @@ use Symfony\Component\Console\Output\ConsoleOutput; + + define('OC_CONSOLE', 1); + +-// Show warning if a PHP version below 5.4.0 is used, this has to happen here +-// because base.php will already use 5.4 syntax. +-if (version_compare(PHP_VERSION, '5.4.0') === -1) { +- echo 'This version of Nextcloud requires at least PHP 5.4.0'.PHP_EOL; +- echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.'.PHP_EOL; +- return; +-} +- +-// Show warning if PHP 7.1 is used as Nextcloud is not compatible with PHP 7.1 for now +-// @see https://github.com/nextcloud/docker-ci/issues/10 +-if (version_compare(PHP_VERSION, '7.1.0') !== -1) { +- echo 'This version of Nextcloud is not compatible with PHP 7.1.
'; +- echo 'You are currently running ' . PHP_VERSION . '.'; +- return; +-} +- + function exceptionHandler($exception) { + echo "An unhandled exception has been thrown:" . PHP_EOL; + echo $exception; +diff --git a/index.php b/index.php +index e72d38c..29920d7 100644 +--- a/index.php ++++ b/index.php +@@ -25,22 +25,6 @@ + * + */ + +-// Show warning if a PHP version below 5.4.0 is used, this has to happen here +-// because base.php will already use 5.4 syntax. +-if (version_compare(PHP_VERSION, '5.4.0') === -1) { +- echo 'This version of Nextcloud requires at least PHP 5.4.0
'; +- echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.'; +- return; +-} +- +-// Show warning if PHP 7.1 is used as Nextcloud is not compatible with PHP 7.1 for now +-// @see https://github.com/nextcloud/docker-ci/issues/10 +-if (version_compare(PHP_VERSION, '7.1.0') !== -1) { +- echo 'This version of Nextcloud is not compatible with PHP 7.1.
'; +- echo 'You are currently running ' . PHP_VERSION . '.'; +- return; +-} +- + try { + + require_once __DIR__ . '/lib/base.php'; +diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php +index 86b9b76..ac42177 100644 +--- a/settings/Controller/CheckSetupController.php ++++ b/settings/Controller/CheckSetupController.php +@@ -212,9 +212,7 @@ class CheckSetupController extends Controller { + * @return bool + */ + protected function isPhpOutdated() { +- if (version_compare(PHP_VERSION, '5.5.0') === -1) { +- return true; +- } ++ // PHP supported in distribution + return false; + } + diff --git a/nextcloud-463e2ea-php71-backport.patch b/nextcloud-463e2ea-php71-backport.patch new file mode 100644 index 0000000..1a24d73 --- /dev/null +++ b/nextcloud-463e2ea-php71-backport.patch @@ -0,0 +1,22 @@ +From 463e2ea15d6fb71b96363d60c7e4bdc2c020eddf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20M=C3=BCller?= +Date: Mon, 4 Jul 2016 13:47:03 +0200 +Subject: [PATCH] Initialize array elements properly + +--- + lib/private/App/InfoParser.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php +index c158e5c..843ed02 100644 +--- a/lib/private/App/InfoParser.php ++++ b/lib/private/App/InfoParser.php +@@ -141,7 +141,7 @@ function xmlToArray($xml) { + $totalElement = count($xml->{$element}); + + if (!isset($array[$element])) { +- $array[$element] = ""; ++ $array[$element] = $totalElement > 1 ? [] : ""; + } + /** @var \SimpleXMLElement $node */ + // Has attributes diff --git a/nextcloud-9.1.0-amazon-autoloader.patch b/nextcloud-9.1.0-amazon-autoloader.patch new file mode 100644 index 0000000..d30bf1b --- /dev/null +++ b/nextcloud-9.1.0-amazon-autoloader.patch @@ -0,0 +1,15 @@ +diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php +index 4bb4312..85e04a3 100644 +--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php ++++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php +@@ -35,10 +35,6 @@ + + namespace OCA\Files_External\Lib\Storage; + +-set_include_path(get_include_path() . PATH_SEPARATOR . +- \OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php'); +-require 'aws-autoloader.php'; +- + use Aws\S3\S3Client; + use Aws\S3\Exception\S3Exception; + use Icewind\Streams\IteratorDirectory; diff --git a/nextcloud-9.1.0-default_integrity_check_disabled.patch b/nextcloud-9.1.0-default_integrity_check_disabled.patch new file mode 100644 index 0000000..03834da --- /dev/null +++ b/nextcloud-9.1.0-default_integrity_check_disabled.patch @@ -0,0 +1,13 @@ +diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php +index d4038f8..7901a2c 100644 +--- a/lib/private/IntegrityCheck/Checker.php ++++ b/lib/private/IntegrityCheck/Checker.php +@@ -109,7 +109,7 @@ class Checker { + * too prominent. So please do not add it to config.sample.php. + */ + if ($this->config !== null) { +- $isIntegrityCheckDisabled = $this->config->getSystemValue('integrity.check.disabled', false); ++ $isIntegrityCheckDisabled = $this->config->getSystemValue('integrity.check.disabled', true); + } else { + $isIntegrityCheckDisabled = false; + } diff --git a/nextcloud-9.1.0-dont_update_htacess.patch b/nextcloud-9.1.0-dont_update_htacess.patch new file mode 100644 index 0000000..c23e530 --- /dev/null +++ b/nextcloud-9.1.0-dont_update_htacess.patch @@ -0,0 +1,106 @@ +diff --git a/core/Command/Maintenance/UpdateHtaccess.php b/core/Command/Maintenance/UpdateHtaccess.php +deleted file mode 100644 +index 2185078..0000000 +--- a/core/Command/Maintenance/UpdateHtaccess.php ++++ /dev/null +@@ -1,45 +0,0 @@ +- +- * +- * @license AGPL-3.0 +- * +- * This code is free software: you can redistribute it and/or modify +- * it under the terms of the GNU Affero General Public License, version 3, +- * as published by the Free Software Foundation. +- * +- * 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, version 3, +- * along with this program. If not, see +- * +- */ +-namespace OC\Core\Command\Maintenance; +- +-use InvalidArgumentException; +-use OC\Setup; +-use OCP\IConfig; +-use Symfony\Component\Console\Command\Command; +-use Symfony\Component\Console\Input\InputInterface; +-use Symfony\Component\Console\Input\InputOption; +-use Symfony\Component\Console\Output\OutputInterface; +- +-class UpdateHtaccess extends Command { +- +- protected function configure() { +- $this +- ->setName('maintenance:update:htaccess') +- ->setDescription('Updates the .htaccess file'); +- } +- +- protected function execute(InputInterface $input, OutputInterface $output) { +- \OC\Setup::updateHtaccess(); +- $output->writeln('.htaccess has been updated'); +- return 0; +- } +-} +diff --git a/core/register_command.php b/core/register_command.php +index 6f20769..09535fe 100644 +--- a/core/register_command.php ++++ b/core/register_command.php +@@ -60,7 +60,7 @@ if (\OC::$server->getConfig()->getSystemValue('installed', false)) { + $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager())); + $application->add(new OC\Core\Command\App\GetPath()); + $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager())); +- ++ + $application->add(new OC\Core\Command\TwoFactorAuth\Enable( + \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager() + )); +@@ -126,7 +126,6 @@ if (\OC::$server->getConfig()->getSystemValue('installed', false)) { + new \OC\Repair(\OC\Repair::getRepairSteps(), \OC::$server->getEventDispatcher()), \OC::$server->getConfig(), + \OC::$server->getEventDispatcher())); + $application->add(new OC\Core\Command\Maintenance\SingleUser(\OC::$server->getConfig())); +- $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess()); + + $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger())); + +diff --git a/lib/private/Setup.php b/lib/private/Setup.php +index 3b3a57c..cd56795 100644 +--- a/lib/private/Setup.php ++++ b/lib/private/Setup.php +@@ -379,10 +379,6 @@ class Setup { + // out that this is indeed an ownCloud data directory + file_put_contents($config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/.ocdata', ''); + +- // Update .htaccess files +- Setup::updateHtaccess(); +- Setup::protectDataDirectory(); +- + //try to write logtimezone + if (date_default_timezone_get()) { + $config->setSystemValue('logtimezone', date_default_timezone_get()); +diff --git a/lib/private/Updater.php b/lib/private/Updater.php +index 609e965..85d4869 100644 +--- a/lib/private/Updater.php ++++ b/lib/private/Updater.php +@@ -237,14 +237,6 @@ class Updater extends BasicEmitter { + throw new \Exception('Updates between multiple major versions and downgrades are unsupported.'); + } + +- // Update .htaccess files +- try { +- Setup::updateHtaccess(); +- Setup::protectDataDirectory(); +- } catch (\Exception $e) { +- throw new \Exception($e->getMessage()); +- } +- + // create empty file in data dir, so we can later find + // out that this is indeed an ownCloud data directory + // (in case it didn't exist before) diff --git a/nextcloud-9.1.0-dropbox-autoloader.patch b/nextcloud-9.1.0-dropbox-autoloader.patch new file mode 100644 index 0000000..58ae094 --- /dev/null +++ b/nextcloud-9.1.0-dropbox-autoloader.patch @@ -0,0 +1,25 @@ +diff --git a/apps/files_external/ajax/oauth1.php b/apps/files_external/ajax/oauth1.php +index e363e6c..d2aefbc 100644 +--- a/apps/files_external/ajax/oauth1.php ++++ b/apps/files_external/ajax/oauth1.php +@@ -23,7 +23,6 @@ + * along with this program. If not, see + * + */ +-require_once __DIR__ . '/../3rdparty/Dropbox/autoload.php'; + + OCP\JSON::checkAppEnabled('files_external'); + OCP\JSON::checkLoggedIn(); +diff --git a/apps/files_external/lib/Lib/Storage/Dropbox.php b/apps/files_external/lib/Lib/Storage/Dropbox.php +index f0f62f9..1b20a62 100644 +--- a/apps/files_external/lib/Lib/Storage/Dropbox.php ++++ b/apps/files_external/lib/Lib/Storage/Dropbox.php +@@ -34,8 +34,6 @@ use Icewind\Streams\IteratorDirectory; + use Icewind\Streams\RetryWrapper; + use OCP\Files\StorageNotAvailableException; + +-require_once __DIR__ . '/../../../3rdparty/Dropbox/autoload.php'; +- + class Dropbox extends \OC\Files\Storage\Common { + + private $dropbox; diff --git a/nextcloud-9.1.0-google-autoloader.patch b/nextcloud-9.1.0-google-autoloader.patch new file mode 100644 index 0000000..db2ad48 --- /dev/null +++ b/nextcloud-9.1.0-google-autoloader.patch @@ -0,0 +1,37 @@ +diff --git a/apps/files_external/ajax/oauth2.php b/apps/files_external/ajax/oauth2.php +index 2d1fae2..d8dac91 100644 +--- a/apps/files_external/ajax/oauth2.php ++++ b/apps/files_external/ajax/oauth2.php +@@ -26,9 +26,6 @@ + * along with this program. If not, see + * + */ +-set_include_path(get_include_path().PATH_SEPARATOR. +- \OC_App::getAppPath('files_external').'/3rdparty/google-api-php-client/src'); +-require_once 'Google/autoload.php'; + + OCP\JSON::checkAppEnabled('files_external'); + OCP\JSON::checkLoggedIn(); +diff --git a/apps/files_external/lib/Lib/Storage/Google.php b/apps/files_external/lib/Lib/Storage/Google.php +index 0b617aa..d40ac36 100644 +--- a/apps/files_external/lib/Lib/Storage/Google.php ++++ b/apps/files_external/lib/Lib/Storage/Google.php +@@ -38,10 +38,6 @@ use GuzzleHttp\Exception\RequestException; + use Icewind\Streams\IteratorDirectory; + use Icewind\Streams\RetryWrapper; + +-set_include_path(get_include_path().PATH_SEPARATOR. +- \OC_App::getAppPath('files_external').'/3rdparty/google-api-php-client/src'); +-require_once 'Google/autoload.php'; +- + class Google extends \OC\Files\Storage\Common { + + private $client; +@@ -462,7 +458,6 @@ class Google extends \OC\Files\Storage\Common { + $response = $client->get($downloadUrl, [ + 'headers' => $httpRequest->getRequestHeaders(), + 'stream' => true, +- 'verify' => realpath(__DIR__ . '/../../../3rdparty/google-api-php-client/src/Google/IO/cacerts.pem'), + ]); + } catch (RequestException $e) { + if(!is_null($e->getResponse())) { diff --git a/nextcloud-README.fedora b/nextcloud-README.fedora new file mode 100644 index 0000000..ec62043 --- /dev/null +++ b/nextcloud-README.fedora @@ -0,0 +1,116 @@ +ownCloud packaging notes +======================== + +Start +------ +After installation you should be able to access the login/configuration page +at the following URL: + +http://localhost/owncloud/ or http://localhost/ + +If not, make sure your webserver is running properly. + +Webserver +--------- +Currently ownCloud in Fedora supports httpd (Apache) and nginx. You must install +at least one webserver subpackage (owncloud-). These packages +include additional configuration files for the webservers. Remote access is +disabled by default. To enable access from any host for Apache **AFTER** you +complete the initial setup process, do this: + +ln -s /etc/httpd/conf.d/owncloud-access.conf.avail /etc/httpd/conf.d/z-owncloud-access.conf + +If you wish to adjust any of the settings it is recommended that you create +a new configuration file that will override owncloud.conf, rather than editing +it, so future changes to the packaged file will be respected on your server. +If you do not do this, please be careful to check for changes in the packaged +configuration file (especially on major ownCloud upgrades) and merge into +your modified configuration as appropriate. + +Database +-------- +You can choose between three databases: MySQL, PostgreSQL and SQLite. +For each of them there is an ownCloud subpackage (owncloud-). +You are required to install at least one of them. The packages only ensure +the necessary requirements to communicate with a database server of that type +are installed, they do not require the database server package itself, as +you may wish to use a remote database server. If you wish to use a local one, +you must ensure it is installed and configured. + +For larger installs you should use MySQL or PostgreSQL. + +If you choose MySQL or PostgreSQL, keep in mind that you must create a database +and user for ownCloud manually, before you can finish the setup process. The +README.postgresql and README.mysql files provide more details and help with +this. + +In addition if using a remote database then then selinux must be configured to +allow the webserver to connect to it - see the selinux section further down. + +Configuration +------------- +You can find the main configuration file at '/etc/owncloud/config.php'. Until +you first access the server it will be just a small stub containing settings +that differ in this package from the upstream defaults. After you first access +ownCloud, the initial setup process will populate it with some more settings. +Other settings that can be provided in this file are documented at: +https://doc.owncloud.org/server/8.2/admin_manual/configuration_server/config_sample_php_parameters.html + +User Data +--------- +The default data directory is '/var/lib/owncloud/data'. Every file that is +uploaded by your users to ownCloud gets saved into this folder. Consider doing +a backup of this directory, together with the database and the main +configuration. Note that if you change this location, you must set appropriate +ownership and SELinux context attributes. + +Logging +------- +As specified by the configuration file, ownCloud sends messages to the system +logger, which means in a standard Fedora configuration it will log to the +systemd journal: try "journalctl -b -t ownCloud". You can also change the +loglevel or switch to the built-in log mechanism of ownCloud. + +App Store +--------- +If you install additional third party apps using the built-in app store, you +can find them in the directory '/var/lib/owncloud/apps'. This functionality is +enabled by default. If this is moved then it's important to configure httpd/nginx +appropriately for the correct /owncloud/apps-appstore path to alias to the new location. + +The app store URL is coded into the core php and does not need to be listed in config.php + +If there are any empty proxy entries in config.php this will prevent connectivity to the store. +If not using a proxy it is important to remove any proxy entries from config.php, not just be "" + +Selinux Booleans +---------------- +If you want to use external files (eg remote smb/cifs server) the httpd_can_network_connect +selinux boolean should be toggled on. If you want to use libreoffice document conversion +then the httpd_execmem should be toggled on and the unoconv package should be installed. + +If not using an external file source but still using an external database then the boolean +httpd_can_network_connect_db should be toggled on for access to regular DB ports. The general +network connect can alternatiely be used for non-standard ports or for a broader permission +in case of future external files requirements. + +Memory caching +-------------- +For performance reasons a memory cache should be configured. In larger installs redis +may be required but as a basic lightweight alternative edit config.php as per upstream +documentation and install ACPu via: + +dnf install 'php-pecl(apcu)' + +For further information see http://owncloud.org/ and http://doc.owncloud.org/ + +PHP Curl NSS Issue +------------------ +There is currently an issue with NSS which is improperly reusing SSL session cache. +There is both a fix for NSS and a workaround for cURL however neither of these will +arrive before the EL7.3 milestone. The relevant bug to track for updates on this is: +https://bugzilla.redhat.com/show_bug.cgi?id=1241172 + +The discussion in the upstream ownCloud issue tracker can be found here: +https://github.com/owncloud/core/issues/16255 + diff --git a/nextcloud-access-httpd.conf.avail b/nextcloud-access-httpd.conf.avail new file mode 100644 index 0000000..1caf642 --- /dev/null +++ b/nextcloud-access-httpd.conf.avail @@ -0,0 +1,24 @@ +# If symlinked or copied to /etc/httpd/conf.d/z-nextcloud-access.conf +# (or any other name that is alphabetically later than +# 'nextcloud.conf'), this file will permit access to the ownCloud +# installation from any client. Ensure your deployment is correctly +# configured and secured before doing this! +# +# If you SYMLINK this file, you can rely on the ownCloud package to +# handle any future changes in the directory or URL hierarchy; this +# file will always achieve the high-level goal 'allow access to the +# ownCloud installation from any client'. If you COPY this file, you +# will have to check for changes to the original in future ownCloud +# package updates, and make any appropriate adjustments to your copy. + + + Include conf.d/nextcloud-auth-any.inc + + + + Include conf.d/nextcloud-auth-any.inc + + + + Include conf.d/nextcloud-auth-any.inc + diff --git a/nextcloud-auth-any.inc b/nextcloud-auth-any.inc new file mode 100644 index 0000000..4744713 --- /dev/null +++ b/nextcloud-auth-any.inc @@ -0,0 +1,12 @@ +# Apache config snippet. To be used by /etc/httpd/conf.d/*.conf files +# with Include. Allows access from any system. + + +# Apache 2.4 +Require all granted + + +# Apache 2.2 +Order Deny,Allow +Allow from all + diff --git a/nextcloud-auth-local.inc b/nextcloud-auth-local.inc new file mode 100644 index 0000000..69cfd00 --- /dev/null +++ b/nextcloud-auth-local.inc @@ -0,0 +1,14 @@ +# Apache config snippet. To be used by /etc/httpd/conf.d/*.conf files +# with Include. Allows access only from local system. + + +# Apache 2.4 +Require local + + +# Apache 2.2 +Order Deny,Allow +Deny from all +Allow from 127.0.0.1 +Allow from ::1 + diff --git a/nextcloud-auth-none.inc b/nextcloud-auth-none.inc new file mode 100644 index 0000000..212315e --- /dev/null +++ b/nextcloud-auth-none.inc @@ -0,0 +1,12 @@ +# Apache config snippet. To be used by /etc/httpd/conf.d/*.conf files +# with Include. Denies all access. + + +# Apache 2.4 +Require all denied + + +# Apache 2.2 +Order Deny,Allow +Deny from all + diff --git a/nextcloud-b129d5d-php71-backport.patch b/nextcloud-b129d5d-php71-backport.patch new file mode 100644 index 0000000..734b51c --- /dev/null +++ b/nextcloud-b129d5d-php71-backport.patch @@ -0,0 +1,13 @@ +diff --git a/settings/Controller/SecuritySettingsController.php b/settings/Controller/SecuritySettingsController.php +index 88b2803..5c6f174 100644 +--- a/settings/Controller/SecuritySettingsController.php ++++ b/settings/Controller/SecuritySettingsController.php +@@ -60,7 +60,7 @@ protected function returnSuccess() { + * @return array + */ + public function trustedDomains($newTrustedDomain) { +- $trustedDomains = $this->config->getSystemValue('trusted_domains'); ++ $trustedDomains = $this->config->getSystemValue('trusted_domains', []); + $trustedDomains[] = $newTrustedDomain; + $this->config->setSystemValue('trusted_domains', $trustedDomains); + diff --git a/nextcloud-conf-nginx.conf b/nextcloud-conf-nginx.conf new file mode 100644 index 0000000..85dfd8c --- /dev/null +++ b/nextcloud-conf-nginx.conf @@ -0,0 +1,4 @@ +upstream php-nextcloud { + server unix:/run/php-fpm/nextcloud.sock; +} + diff --git a/nextcloud-config.php b/nextcloud-config.php new file mode 100644 index 0000000..96aa36e --- /dev/null +++ b/nextcloud-config.php @@ -0,0 +1,26 @@ + "syslog", + "datadirectory" => "/var/lib/nextcloud/data", + "updatechecker" => false, + "check_for_working_htaccess" => false, + "asset-pipeline.enabled" => false, + "assetdirectory" => '/var/lib/nextcloud', + "preview_libreoffice_path" => '/usr/bin/libreoffice', + + + "apps_paths" => array( + 0 => + array ( + 'path'=> '/usr/share/nextcloud/apps', + 'url' => '/apps', + 'writable' => false, + ), + 1 => + array ( + 'path' => '/var/lib/nextcloud/apps', + 'url' => '/apps-appstore', + 'writable' => true, + ), + ), +); diff --git a/nextcloud-default-nginx.conf b/nextcloud-default-nginx.conf new file mode 100644 index 0000000..77d3efe --- /dev/null +++ b/nextcloud-default-nginx.conf @@ -0,0 +1,81 @@ + rewrite ^/nextcloud$ /nextcloud/ redirect; + + location /nextcloud/ { + root /usr/share/; + + # Add headers to serve security related headers + # Before enabling Strict-Transport-Security headers please read into this topic first. + # add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Robots-Tag none; + add_header X-Download-Options noopen; + add_header X-Permitted-Cross-Domain-Policies none; + + + # set max upload size + client_max_body_size 10G; + fastcgi_buffers 64 4K; + + # Disable gzip to avoid the removal of the ETag header + gzip off; + + # Uncomment if your server is build with the ngx_pagespeed module + # This module is currently not supported. + #pagespeed off; + + index index.php; + + error_page 403 /nextcloud/core/templates/403.php; + error_page 404 /nextcloud/core/templates/404.php; + + location ~ ^/nextcloud/apps-appstore/(.*)$ { + alias /var/lib/nextcloud/apps/$1; + } + + location ~ ^/nextcloud/assets/(.*)$ { + alias /var/lib/nextcloud/assets/$1; + } + + location ~ ^/nextcloud/(build|tests|config|lib|3rdparty|templates|data)/ { + deny all; + } + + location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) { + deny all; + } + + rewrite ^/nextcloud/remote/(.*) /nextcloud/remote.php last; + rewrite ^/nextcloud/core/doc/([^\/]+)(?:$|/) /nextcloud/core/doc/$1/index.html; + + try_files $uri $uri/ =404; + + location ~ \.php(?:$|/) { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + # fastcgi_param HTTPS on; + fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice + fastcgi_pass php-nextcloud; + fastcgi_intercept_errors on; + } + + # Adding the cache control header for js and css files + # Make sure it is BELOW the location ~ \.php(?:$|/) { block + location ~* \.(?:css|js)$ { + add_header Cache-Control "public, max-age=7200"; + # Optional: Don't log access to assets + access_log off; + } + + # Optional: Don't log access to other assets + location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|swf)$ { + access_log off; + } + + } + + + diff --git a/nextcloud-defaults.inc b/nextcloud-defaults.inc new file mode 100644 index 0000000..06f088f --- /dev/null +++ b/nextcloud-defaults.inc @@ -0,0 +1,60 @@ +# These are based on the .htaccess file shipped by ownCloud, with +# appropriate adjustments for distribution packaging. Some directives +# that are irrelevant to the Fedora/EPEL ecosystem are omitted. This +# file contains directives that should be applied within the /nextcloud +# filesystem; directives that should be applied site-wide when +# ownCloud is installed are placed directly in nextcloud.conf. +# +# DO NOT EDIT THIS FILE DIRECTLY. To override any element of the +# packaged ownCloud configuration, create a new /etc/httpd/conf.d/ +# file which will be read later than 'nextcloud.conf'. + +AllowOverride None + +ErrorDocument 403 /nextcloud/core/templates/403.php +ErrorDocument 404 /nextcloud/core/templates/404.php + + + + + SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1 + RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION + + + + + + php_value upload_max_filesize 10G + php_value post_max_size 10G + php_value memory_limit 512M + php_value mbstring.func_overload 0 + php_value always_populate_raw_post_data -1 + php_value default_charset 'UTF-8' + php_value output_buffering off + + SetEnv htaccessWorking true + + + +# The rewrites for legacy caldav and carddav URLs are omitted here +# because they do not work with Fedora's ownCloud directory layout. +# See https://github.com/nextcloud/core/issues/243#issuecomment-75426453 + + RewriteEngine on + RewriteBase /nextcloud/ + RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + RewriteRule ^remote/(.*) remote.php [QSA,L] + + +AddDefaultCharset utf-8 +Options -Indexes + + + ModPagespeed Off + + + + + Header set Cache-Control "max-age=7200, public" + + diff --git a/nextcloud-el7-php-fpm.conf b/nextcloud-el7-php-fpm.conf new file mode 100644 index 0000000..54473ec --- /dev/null +++ b/nextcloud-el7-php-fpm.conf @@ -0,0 +1,24 @@ +[nextcloud] +user = apache +group = apache +listen = /run/php-fpm/nextcloud.sock +listen.allowed_clients = 127.0.0.1 +pm = dynamic +pm.max_children = 50 +pm.start_servers = 5 +pm.min_spare_servers = 5 +pm.max_spare_servers = 35 +slowlog = /var/log/php-fpm/nextcloud-slow.log +php_admin_value[error_log] = /var/log/php-fpm/nextcloud-error.log +php_admin_flag[log_errors] = on +php_value[session.save_handler] = files +php_value[session.save_path] = /var/lib/php/session +php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache +php_value[upload_max_filesize] = 10G +php_value[post_max_size] = 10G +env[HOSTNAME] = $HOSTNAME +env[PATH] = /usr/local/bin:/usr/bin:/bin +env[TMP] = /tmp +env[TMPDIR] = /tmp +env[TEMP] = /tmp + diff --git a/nextcloud-fedora-autoloader.php b/nextcloud-fedora-autoloader.php new file mode 100644 index 0000000..84f8c1b --- /dev/null +++ b/nextcloud-fedora-autoloader.php @@ -0,0 +1,68 @@ +register(); +} + +// For PEAR components +$fedoraClassLoader->setUseIncludePath(true); + +// Dependencies from 3rdparty composer.json +// "guzzlehttp/guzzle" +require_once $vendor . '/GuzzleHttp/autoload.php'; +// "sabre/dav" +require_once $vendor . '/Sabre/DAV/autoload.php'; +// "doctrine/dbal" +require_once $vendor . '/Doctrine/DBAL/autoload.php'; +// mcnetic/zipstreamer" +require_once $vendor . '/ZipStreamer/autoload.php'; +// "phpeclib/phpseclib" +require_once $vendor . '/phpseclib/autoload.php'; +// "rackspace/php-opencloud" +require_once $vendor . '/OpenCloud/autoload.php'; +// "jeremeamia/superclosure" +require_once $vendor . '/SuperClosure/autoload.php'; +// "bantu/ini-get-wrapper" +require_once $vendor . '/bantu/IniGetWrapper/IniGetWrapper.php'; +// "natxet/CssMin" +require_once $vendor . '/natxet/CssMin/autoload.php'; +// "punic/punic" +require_once $vendor . '/Punic/autoload.php'; +// "patchwork/utf8" +require_once $vendor . '/Patchwork/autoload.php'; +// "symfony/console" +require_once $vendor . '/Symfony/Component/Console/autoload.php'; +// "symfony/event-dispatcher" +require_once $vendor . '/Symfony/Component/EventDispatcher/autoload.php'; +// "symfony/routing" +require_once $vendor . '/Symfony/Component/Routing/autoload.php'; +// "symfony/process" +require_once $vendor . '/Symfony/Component/Process/autoload.php'; +// "pimple/pimple" +require_once $vendor . '/Pimple/autoload.php'; +// "ircmaxell/password-compat" +require_once $vendor . '/password_compat/password.php'; +// "nikic/php-parser" +require_once $vendor . '/PhpParser/autoload.php'; +// "icewind/Streams" +require_once $vendor . '/Icewind/Streams/autoload.php'; +// "swiftmailer/swiftmailer +require_once $vendor . '/Swift/swift_required.php'; +// "league/flysystem" +require_once $vendor . '/League/Flysystem/autoload.php'; +// "interfasys/lognormalizer" +require_once $vendor . '/InterfaSys/LogNormalizer/autoload.php'; +// "deepdiver1975/TarSTreamer" +require_once $vendor . '/ownCloud/TarStreamer/autoload.php'; +// "patchwork/jsqueeze" +require_once $vendor . '/Patchwork/JSqueeze.php'; +// "symfony/polyfill-php{55,56,70}" +require_once $vendor . '/Symfony/Polyfill/autoload.php'; +// "lukasreschke/id3parser": "^0.0.1" +require_once $vendor . '/ID3Parser/autoload.php'; diff --git a/nextcloud-httpd.conf b/nextcloud-httpd.conf new file mode 100644 index 0000000..5a4ce55 --- /dev/null +++ b/nextcloud-httpd.conf @@ -0,0 +1,50 @@ +# DO NOT EDIT THIS FILE DIRECTLY. To override any element of the +# packaged ownCloud configuration, create a new /etc/httpd/conf.d/ +# file which will be read later than 'nextcloud.conf'. +# +# As the initial setup wizard is active upon installation, access is +# initially allowed only from localhost. *AFTER* configuring the +# installation correctly and creating the admin account, to allow +# access from any host, do this: +# +# ln -s /etc/httpd/conf.d/nextcloud-access.conf.avail /etc/httpd/conf.d/z-nextcloud-access.conf + +Alias /nextcloud/apps-appstore /var/lib/nextcloud/apps +Alias /nextcloud/assets /var/lib/nextcloud/assets +Alias /nextcloud /usr/share/nextcloud + +# Allows compliant CalDAV / CardDAV clients to be configured using only +# the domain name. For more details see # http://tools.ietf.org/html/rfc6764 + +Redirect 301 /.well-known/carddav /nextcloud/remote.php/carddav +Redirect 301 /.well-known/caldav /nextcloud/remote.php/caldav +Redirect 301 /.well-known/webdav /nextcloud/remote.php/webdav + + + Include conf.d/nextcloud-auth-local.inc + Include conf.d/nextcloud-defaults.inc + + Include conf.d/nextcloud-auth-none.inc + + + + + Include conf.d/nextcloud-auth-local.inc + Include conf.d/nextcloud-defaults.inc + + + + Include conf.d/nextcloud-auth-local.inc + Include conf.d/nextcloud-defaults.inc + + +# For safety, explicitly deny any access to these locations. +# Upstream's .htaccess does something similar with mod_rewrite. + + + Include conf.d/nextcloud-auth-none.inc + + + + Include conf.d/nextcloud-auth-none.inc + diff --git a/nextcloud-mysql.txt b/nextcloud-mysql.txt new file mode 100644 index 0000000..1284442 --- /dev/null +++ b/nextcloud-mysql.txt @@ -0,0 +1,28 @@ +Configure MariaDB / MySQL for ownCloud +====================================== + +To use MariaDB / MySQL as database backend, you need to do the following: + +1. Make sure that your mysql service is configured and running properly. If this + is a fresh install, you will need to run "systemctl enable mysqld.service; + systemctl start mysqld.service" (or mariadb.service) as root. It's also + strongly advised to run "mysql_secure_installation" after starting the + database for the first time. + +2. Log in to the database as privileged user to create the database and a + dedicated user account for ownCloud: + $ mysql -u root -p + CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; + CREATE DATABASE IF NOT EXISTS nextcloud; + GRANT ALL PRIVILEGES ON nextcloud.* TO 'username'@'localhost' IDENTIFIED BY 'password'; + Choose identifier and password accordingly. + +Now you can launch the ownCloud setup screen, select MySQL in the advanced +settings and fill in your credentials. + +References +========== + +https://fedoraproject.org/wiki/MariaDB +https://mariadb.com/kb/en/mariadb/documentation/ +http://doc.nextcloud.org/server/7.0/admin_manual/configuration/configuration_database.html diff --git a/nextcloud-php-fpm.conf b/nextcloud-php-fpm.conf new file mode 100644 index 0000000..8314e6c --- /dev/null +++ b/nextcloud-php-fpm.conf @@ -0,0 +1,25 @@ +[nextcloud] +user = apache +group = apache +listen = /run/php-fpm/nextcloud.sock +listen.acl_users = apache,nginx +listen.allowed_clients = 127.0.0.1 +pm = dynamic +pm.max_children = 50 +pm.start_servers = 5 +pm.min_spare_servers = 5 +pm.max_spare_servers = 35 +slowlog = /var/log/php-fpm/nextcloud-slow.log +php_admin_value[error_log] = /var/log/php-fpm/nextcloud-error.log +php_admin_flag[log_errors] = on +php_value[session.save_handler] = files +php_value[session.save_path] = /var/lib/php/session +php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache +php_value[upload_max_filesize] = 10G +php_value[post_max_size] = 10G +env[HOSTNAME] = $HOSTNAME +env[PATH] = /usr/local/bin:/usr/bin:/bin +env[TMP] = /tmp +env[TMPDIR] = /tmp +env[TEMP] = /tmp + diff --git a/nextcloud-postgresql.txt b/nextcloud-postgresql.txt new file mode 100644 index 0000000..15e7ad9 --- /dev/null +++ b/nextcloud-postgresql.txt @@ -0,0 +1,43 @@ +Configure PostgreSQL for ownCloud +================================= + +To use PostgreSQL as database backend, you need to do the following: + +1. Make sure that your PostgreSQL service is configured and running properly. + If this is a fresh install, you will need to run "postgresql-setup initdb" + as root, then "systemctl enable postgresql.service; systemctl start + postgresql.service". For more details on initial configuration of PostgreSQL + in Fedora, see https://fedoraproject.org/wiki/PostgreSQL + +2. Log in to PostgreSQL as system user to create the database and a dedicated + user account for ownCloud: + # su - -c "psql" postgres + CREATE USER username WITH PASSWORD 'password'; + CREATE DATABASE nextcloud TEMPLATE template0 ENCODING 'UNICODE'; + ALTER DATABASE nextcloud OWNER TO username; + GRANT ALL PRIVILEGES ON DATABASE nextcloud TO username; + Choose identifier and password accordingly. + +3. ownCloud talks to PostgreSQL via TCP/IP, so you need to configure an + appropriate authentication mechanism in /var/lib/pgsql/data/pg_hba.conf. + For a simple configuration with ownCloud and PostgreSQL on the same host, + set the METHOD for the lines that apply to localhost TCP/IP connections + to "password". ownCloud does *not* use a socket to communicate with the + database, so the 'local' line in pg_hba.conf does *not* apply to it. + Note that this will result in the password being sent unencrypted from + ownCloud to the PostgreSQL server. For more details, see + http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html. + +4. You also need to allow the web server to communicate with the database by + TCP/IP: SELinux disallows this by default. Run: + # setsebool -P httpd_can_network_connect_db on + +Now you can launch the ownCloud setup screen, select PostgreSQL in the advanced +settings and fill in your credentials. + +References +========== + +https://fedoraproject.org/wiki/PostgreSQL +http://www.postgresql.org/docs +http://doc.nextcloud.org/server/7.0/admin_manual/configuration/configuration_database.html diff --git a/nextcloud.spec b/nextcloud.spec new file mode 100644 index 0000000..da80b1b --- /dev/null +++ b/nextcloud.spec @@ -0,0 +1,827 @@ +Name: nextcloud +Version: 10.0.3 +Release: 1%{?dist} +Summary: Private file sync and share server + +License: AGPLv3+ and MIT and BSD and ASL 2.0 and WTFPL and CC-BY-SA and GPLv3+ and Adobe +URL: http://nextcloud.com + +Source0: https://download.nextcloud.com/server/releases/%{name}-%{version}.tar.bz2 + +Source1: %{name}-httpd.conf +Source2: %{name}-access-httpd.conf.avail + +Source200: %{name}-default-nginx.conf +Source201: %{name}-conf-nginx.conf +Source202: %{name}-php-fpm.conf +Source203: %{name}-el7-php-fpm.conf + +# Config snippets +Source100: %{name}-auth-any.inc +Source101: %{name}-auth-local.inc +Source102: %{name}-auth-none.inc +Source103: %{name}-defaults.inc +# packaging notes and doc +Source3: %{name}-README.fedora +Source4: %{name}-mysql.txt +Source5: %{name}-postgresql.txt +# config.php containing just settings we want to specify, nextcloud's +# initial setup will fill out other settings appropriately +Source7: %{name}-config.php + +# Our autoloader for core +Source8: %{name}-fedora-autoloader.php + +# Stop OC from trying to do stuff to .htaccess files. Just calm down, OC. +# Distributors are on the case. +Patch1: %{name}-9.1.0-dont_update_htacess.patch + +# Remove explicit load of dropbox +Patch2: %{name}-9.1.0-dropbox-autoloader.patch + +# Remove explicit load of google +Patch3: %{name}-9.1.0-google-autoloader.patch + +# Remove explicit load of aws +Patch4: %{name}-9.1.0-amazon-autoloader.patch + +# Disable the integrity checking whilst a better way to deal with it is found +Patch5: %{name}-9.1.0-default_integrity_check_disabled.patch + +# Apply the backport patches to support PHP7.1 and don't complain +Patch6: %{name}-463e2ea-php71-backport.patch +Patch7: %{name}-b129d5d-php71-backport.patch +Patch8: %{name}-10.0.3-dont-check-php-version.patch + +BuildArch: noarch + + +# expand pear macros on install +BuildRequires: php-pear + +# For sanity %%check +BuildRequires: php-cli +BuildRequires: php-composer(sabre/dav) >= 3.0.9 +BuildRequires: php-composer(sabre/dav) < 4.0 +BuildRequires: php-composer(doctrine/dbal) >= 2.5.4 +BuildRequires: php-composer(doctrine/dbal) < 2.6 +BuildRequires: php-composer(mcnetic/zipstreamer) >= 1.0 +BuildRequires: php-composer(mcnetic/zipstreamer) < 2.0 +BuildRequires: php-composer(phpseclib/phpseclib) >= 2.0 +BuildRequires: php-composer(phpseclib/phpseclib) < 3.0 +BuildRequires: php-opencloud >= 1.9.2 +BuildRequires: php-composer(jeremeamia/superclosure) >= 2.1.0 +BuildRequires: php-composer(bantu/ini-get-wrapper) >= 1.0.1 +BuildRequires: php-composer(natxet/CssMin) >= 3.0.4 +BuildRequires: php-composer(punic/punic) >= 1.6.3 +%if 0%{?el7} +BuildRequires: php-pear(Archive_Tar) >= 1.3 +BuildRequires: php-pear(Archive_Tar) < 2.0 +%else +BuildRequires: php-composer(pear/archive_tar) >= 1.4.1 +BuildRequires: php-composer(pear/archive_tar) < 2.0 +%endif +BuildRequires: php-composer(patchwork/utf8) >= 1.2.6 +BuildRequires: php-composer(patchwork/utf8) < 2.0 +BuildRequires: php-composer(symfony/console) >= 2.8.3 +BuildRequires: php-composer(symfony/console) < 3.0.0 +BuildRequires: php-composer(symfony/event-dispatcher) >= 2.8.3 +BuildRequires: php-composer(symfony/event-dispatcher) < 3.0.0 +BuildRequires: php-composer(symfony/routing) >= 2.8.1 +BuildRequires: php-composer(symfony/routing) < 3.0.0 +BuildRequires: php-composer(symfony/process) >= 2.8.1 +BuildRequires: php-composer(symfony/process) < 3.0.0 +BuildRequires: php-composer(pimple/pimple) >= 3.0.2 +BuildRequires: php-composer(pimple/pimple) < 4.0 +BuildRequires: php-composer(ircmaxell/password-compat) >= 1.0.0 +BuildRequires: php-composer(nikic/php-parser) >= 1.4.1 +BuildRequires: php-composer(nikic/php-parser) < 2.0 +BuildRequires: php-composer(icewind/streams) >= 0.4.1 +BuildRequires: php-composer(swiftmailer/swiftmailer) >= 5.4.1 +BuildRequires: php-composer(guzzlehttp/guzzle) >= 5.3.0 +BuildRequires: php-composer(guzzlehttp/guzzle) < 6.0 +BuildRequires: php-composer(league/flysystem) >= 1.0.20 +%if 0%{?el7} +BuildRequires: php-pear(Console_Getopt) > 1.3 +BuildRequires: php-pear(PEAR) > 1.9 +%else +BuildRequires: php-composer(pear/pear-core-minimal) >= 1.10.1 +%endif +BuildRequires: php-composer(interfasys/lognormalizer) >= 1.0 +BuildRequires: php-composer(owncloud/tarstreamer) >= 0.1 +BuildRequires: php-composer(patchwork/jsqueeze) >= 2.0 +BuildRequires: php-composer(patchwork/jsqueeze) < 3.0 +BuildRequires: php-composer(symfony/polyfill-php70) >= 1.0 +BuildRequires: php-composer(symfony/polyfill-php70) < 2.0 +BuildRequires: php-composer(symfony/polyfill-php55) >= 1.0 +BuildRequires: php-composer(symfony/polyfill-php55) < 2.0 +BuildRequires: php-composer(symfony/polyfill-php56) >= 1.0 +BuildRequires: php-composer(symfony/polyfill-php56) < 2.0 +BuildRequires: php-composer(lukasreschke/id3parser) >= 0.0.1 +BuildRequires: php-composer(lukasreschke/id3parser) < 1.0.0 +BuildRequires: php-composer(icewind/smb) >= 1.1.0 +BuildRequires: php-pecl(smbclient) >= 0.8.0 +BuildRequires: php-composer(google/apiclient) >= 1.1.7 +BuildRequires: php-composer(google/apiclient) < 2.0.0 +BuildRequires: php-composer(aws/aws-sdk-php) >= 2.7.5 +BuildRequires: php-composer(aws/aws-sdk-php) < 3.0.0 +BuildRequires: php-composer(symfony/yaml) >= 2.6.0 +BuildRequires: php-composer(symfony/yaml) < 3.0.0 +BuildRequires: php-pear(pear.dropbox-php.com/Dropbox) +BuildRequires: php-composer(onelogin/php-saml) >= 2.9.0 + +Requires: %{name}-webserver = %{version}-%{release} +Requires: %{name}-database = %{version}-%{release} + +# Core PHP libs/extensions required by OC core +Requires: php-curl +Requires: php-dom +Requires: php-exif +Requires: php-fileinfo +Requires: php-gd +Requires: php-iconv +Requires: php-json +Requires: php-ldap +Requires: php-mbstring +Requires: php-openssl +Requires: php-pcre +Requires: php-pdo +Requires: php-session +Requires: php-simplexml +Requires: php-xmlwriter +Requires: php-spl +Requires: php-zip +Requires: php-filter + +### External PHP libs required by OC core + + +# "doctrine/dbal": "2.5.4" +# pulls in doctrine/common as a strict requires +# which pulls in doctrine/{annotations,inflector,cache,collections,lexer} as strict requires +Requires: php-composer(doctrine/dbal) >= 2.5.4 +Requires: php-composer(doctrine/dbal) < 2.6 + +#"mcnetic/zipstreamer": "^1.0" +Requires: php-composer(mcnetic/zipstreamer) >= 1.0 +Requires: php-composer(mcnetic/zipstreamer) < 2.0 + +# "phpseclib/phpseclib": "2.0.0" +Requires: php-composer(phpseclib/phpseclib) >= 2.0 +Requires: php-composer(phpseclib/phpseclib) < 3.0 + +#Requires: php-composer(rackspace/php-opencloud) >= 1.9.2 +# pulls in guzzle/http as a strict requires +# guzzle/http package include common, parser and stream too +Requires: php-opencloud >= 1.9.2 + +# "jeremeamia/superclosure": "2.1.0" +Requires: php-composer(jeremeamia/superclosure) >= 2.1.0 + +# "bantu/ini-get-wrapper": "v1.0.1" +Requires: php-composer(bantu/ini-get-wrapper) >= 1.0.1 + +# "natxet/CssMin": "dev-master" +Requires: php-composer(natxet/CssMin) >= 3.0.4 + +# "punic/punic": "1.6.3" +Requires: php-composer(punic/punic) >= 1.6.3 + +# "pear/archive_tar": "1.4.1" +# archive_tar is in base el7 and doesn't have the fedora php-composer provides +%if 0%{?el7} +Requires: php-pear(Archive_Tar) >= 1.3 +Requires: php-pear(Archive_Tar) < 2.0 +%else +Requires: php-composer(pear/archive_tar) >= 1.4.1 +Requires: php-composer(pear/archive_tar) < 2.0 +%endif + +# "patchwork/utf8": "1.2.6" +Requires: php-composer(patchwork/utf8) >= 1.2.6 +Requires: php-composer(patchwork/utf8) < 2.0 + +# "symfony/console": "2.8.3" +Requires: php-composer(symfony/console) >= 2.8.3 +Requires: php-composer(symfony/console) < 3.0.0. +# "symfony/event-dispatcher": "2.8.3" +Requires: php-composer(symfony/event-dispatcher) >= 2.8.3 +Requires: php-composer(symfony/event-dispatcher) < 3.0.0 +# "symfony/routing": "2.8.1" +Requires: php-composer(symfony/routing) >= 2.8.1 +Requires: php-composer(symfony/routing) < 3.0.0 +# "symfony/process": "2.8.1" +Requires: php-composer(symfony/process) >= 2.8.1 +Requires: php-composer(symfony/process) < 3.0.0 + +# "pimple/pimple": "3.0.2" +Requires: php-composer(pimple/pimple) >= 3.0.2 +Requires: php-composer(pimple/pimple) < 4.0 + +# "ircmaxell/password-compat": "1.0.*" +Requires: php-composer(ircmaxell/password-compat) >= 1.0.0 + +# "nikic/php-parser": "1.4.1" +Requires: php-composer(nikic/php-parser) >= 1.4.1 +Requires: php-composer(nikic/php-parser) < 2.0 + +# "icewind/Streams": "0.4.1" +Requires: php-composer(icewind/streams) >= 0.4.1 + +# "swiftmailer/swiftmailer": "@stable" +# Version 5.4.1 for autoloader in /usr/share/php +Requires: php-composer(swiftmailer/swiftmailer) >= 5.4.1 + +# "guzzlehttp/guzzle": "5.3.0" +# pulls in guzzlehttp/ringphp as strict requires +# ringphp pulls in guzzlehttp/streams and react/promise as strict requires +Requires: php-composer(guzzlehttp/guzzle) >= 5.3.0 +Requires: php-composer(guzzlehttp/guzzle) < 6.0 + +# "league/flysystem": "1.0.20" +Requires: php-composer(league/flysystem) >= 1.0.20 + + +# "pear/pear-core-minimal": "v1.10.1" +# this includes pear/console_getopt and pear/PEAR +%if 0%{?el7} +Requires: php-pear(Console_Getopt) > 1.3 +Requires: php-pear(PEAR) > 1.9 +%else +Requires: php-composer(pear/pear-core-minimal) >= 1.10.1 +%endif + +# "interfasys/lognormalizer": "v1.0" +Requires: php-composer(interfasys/lognormalizer) >= 1.0 + +# "deepdiver1975/TarStreamer": "v0.1.0" +# Despite the difference in name this is correct +# https://github.com/owncloud/3rdparty/tree/master/deepdiver1975/tarstreamer +Requires: php-composer(owncloud/tarstreamer) >= 0.1 + +# "patchwork/jsqueeze": "^2.0" +Requires: php-composer(patchwork/jsqueeze) >= 2.0 +Requires: php-composer(patchwork/jsqueeze) < 3.0 + +# "sabre/dav" : "3.0.9" +# pulls in sabre event, http and vobject, xml, uri as strict requires +Requires: php-composer(sabre/dav) >= 3.0.9 +Requires: php-composer(sabre/dav) < 4.0 + +# symfony/polyfill-mbstring is not in composer.json but is in the 3rdparty folder +# we don't need it though as we ship mbstring itself + +# "symfony/polyfill-php70": "^1.0", +# pulls in s strict requires of paragonie/random_compat +Requires: php-composer(symfony/polyfill-php70) >= 1.0 +Requires: php-composer(symfony/polyfill-php70) < 2.0 +# "symfony/polyfill-php55": "^1.0", +Requires: php-composer(symfony/polyfill-php55) >= 1.0 +Requires: php-composer(symfony/polyfill-php55) < 2.0 +# "symfony/polyfill-php56": "^1.0" +Requires: php-composer(symfony/polyfill-php56) >= 1.0 +Requires: php-composer(symfony/polyfill-php56) < 2.0 + +# "lukasreschke/id3parser": "^0.0.1" +Requires: php-composer(lukasreschke/id3parser) >= 0.0.1 +Requires: php-composer(lukasreschke/id3parser) < 1.0.0 + +### For dependencies of apps/files_external + +## SMB/CIFS external storage stuff + +#"icewind/smb": "1.1.0" +# note that streams is a dep but already required by core anyway +Requires: php-composer(icewind/smb) >= 1.1.0 +# This makes smb external storage usable in performance +# and doesn't break things like encryption due to timeouts +Requires: php-pecl(smbclient) >= 0.8.0 + + +# Requiring so that the shipped external smb storage works +# The net command is needed and enabling smb tests for smbclient command +Requires: samba-common-tools +Requires: samba-client + +## Note these next bits are not listed in composer but manually dropped in place + +## Dropbox external storage +Requires: php-pear(pear.dropbox-php.com/Dropbox) + +## Google Drive external storage +Requires: php-composer(google/apiclient) >= 1.1.7 +Requires: php-composer(google/apiclient) < 2.0.0 + +## AWS S3 external storage +Requires: php-composer(aws/aws-sdk-php) >= 2.7.0 +Requires: php-composer(aws/aws-sdk-php) < 3.0.0 + +## For dependency of apps/gallery +# "symfony/yaml": "~2.6" +Requires: php-composer(symfony/yaml) >= 2.6.0 +Requires: php-composer(symfony/yaml) < 3.0.0 + +## For dependency of app/user_saml +# "onelogin/php-saml": "^2.9" +Requires: php-composer(onelogin/php-saml) >= 2.9.0 +Requires: php-composer(onelogin/php-saml) < 3.0.0 + +# Need to label the httpd rw stuff correctly until base selinux policy updated +Requires(post): %{_sbindir}/semanage +Requires(postun): %{_sbindir}/semanage + +# Bundled javascript libraries in core vendor +# State of javascript in fedora right now is too painful to unbundle +Provides: bundled(js-base64) = 0.3.0 +Provides: bundled(js-blueimp-md5) = 1.1.0 +Provides: bundled(js-bootstrap/tooltip) = 3.3.6 +Provides: bundled(js-clipboard) = 1.5.12 +Provides: bundled(js-davclient) +Provides: bundled(js-es6-promise) = 2.3.0 +Provides: bundled(js-handlebars) = 1.3.0 +Provides: bundled(js-jcrop) = 0.9.12 +Provides: bundled(js-jquery-ui) = 1.10 +Provides: bundled(js-jsTimezoneDetect) = 1.0.6 +Provides: bundled(js-moment) = 2.10.3 +Provides: bundled(js-select2) = 3.4.8 +Provides: bundled(js-snapjs) = 2.0.0 +Provides: bundled(js-strengthify) = 0.5.1 +Provides: bundled(js-zxcvbn) = gitf2a8cda13d +Provides: bundled(js-jquery) = 2.1.4 +Provides: bundled(js-jquery-migrate) = 1.4.0 +Provides: bundled(js-backbone) = 1.2.3 +Provides: bundled(js-underscore) = 1.8.3 +# bundled from files_pdfviewer +Provides: bundled(js-pdfjs) = 1.1.469 +# bundled from files_theming +Provides: bundled(js-jscolor) = 2.0.4 +# bundled from federatedfilesharing +Provides: bundled(js-gs-share) +# bundled from files_texteditor +Provides: bundled(js-ace) +# bundled from user_ldap +Provides: bundled(js-jquery-multiselect) = 1.13 +# bundled from gallery +Provides: bundled(js-bigshot) +Provides: bundled(js-commonmark) = 0.22.0 +Provides: bundled(js-dompurify) = 0.7.0 +Provides: bundled(js-eventsource-polyfill) = 0.9.7 +Provides: bundled(js-jquery-touchevents) = 1.0.1 +Provides: bundled(js-jqueryui-touch-punch) = 0.2.3 + +%description +NextCloud gives you universal access to your files through a web interface or +WebDAV. It also provides a platform to easily view & sync your contacts, +calendars and bookmarks across all your devices and enables basic editing right +on the web. NextCloud is extendable via a simple but powerful API for +applications and plugins. + + +%package httpd +Summary: Httpd integration for NextCloud + +Provides: %{name}-webserver = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + +# PHP dependencies +Requires: php + +%description httpd +%{summary}. + + +%package nginx +Summary: Nginx integration for NextCloud + +Provides: %{name}-webserver = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + +# PHP dependencies +Requires: php-fpm nginx + +%description nginx +%{summary}. + + +%package mysql +Summary: MySQL database support for NextCloud + +Provides: %{name}-database = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + +# From getSupportedDatabases, mysql => pdo, mysql +Requires: php-pdo_mysql + +%description mysql +This package ensures the necessary dependencies are in place for NextCloud to +work with MySQL / MariaDB databases. It does not require a MySQL / MariaDB +server to be installed, as you may well wish to use a remote database +server. + +If you want the database to be on the same system as NextCloud itself, you must +also install and enable a MySQL / MariaDB server package. See README.mysql for +more details. + +%package postgresql +Summary: PostgreSQL database support for NextCloud + +Provides: %{name}-database = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + +# From getSupportedDatabases, pgsql => function, pg_connect +Requires: php-pgsql + +%description postgresql +This package ensures the necessary dependencies are in place for NextCloud to +work with a PostgreSQL database. It does not require the PostgreSQL server +package to be installed, as you may well wish to use a remote database +server. + +If you want the database to be on the same system as NextCloud itself, you must +also install and enable the PostgreSQL server package. See README.postgresql +for more details. + + +%package sqlite +Summary: SQLite 3 database support for NextCloud + +Provides: %{name}-database = %{version}-%{release} +Requires: %{name} = %{version}-%{release} +# From getSupportedDatabases, pgsql => class, SQLite3 +Requires: php-sqlite3 php-pcre + +%description sqlite +This package ensures the necessary dependencies are in place for NextCloud to +work with an SQLite 3 database stored on the local system. + + +%prep +%autosetup -n %{name} -p1 + +# patch backup files and .git stuff +find . -name \*.orig -type f -exec rm {} \; -print +find . -name .gitignore -type f -exec rm {} \; -print +find . -name .github -type d -prune -exec rm -r {} \; -print + +# prepare package doc +cp %{SOURCE3} README.fedora +cp %{SOURCE4} README.mysql +cp %{SOURCE5} README.postgresql + +mv 3rdparty/composer.json 3rdparty_composer.json +mv apps/files_external/3rdparty/composer.json files_external_composer.json +mv apps/gallery/composer.json gallery_composer.json +mv apps/user_saml/3rdparty/composer.json user_saml_composer.json + +# Explicitly remove the bundled libraries we're aware of +pushd 3rdparty +rm -r doctrine/{annotations,cache,collections,common,dbal,inflector,lexer} +rm -r mcnetic/zipstreamer +rm -r phpseclib/phpseclib +rm -r rackspace/php-opencloud guzzle/{http,common,parser,stream} +rm -r jeremeamia/SuperClosure +rm -r bantu/ini-get-wrapper +rm -r natxet/CssMin +rm -r punic/punic +rm -r pear/archive_tar +rm -r patchwork/utf8 +rm -r symfony/console +rm -r symfony/event-dispatcher +rm -r symfony/routing +rm -r symfony/process +rm -r pimple/pimple +rm -r ircmaxell/password-compat +rm -r nikic/php-parser +rm -r icewind/streams +rm -r swiftmailer/swiftmailer +rm -r guzzlehttp/{guzzle,ringphp,streams} react/promise +rm -r league/flysystem +rm -r pear/{pear-core-minimal,console_getopt,pear_exception} +rm -r interfasys/lognormalizer +rm -r deepdiver1975/tarstreamer +rm -r patchwork/jsqueeze +rm -r sabre/{dav,event,http,vobject,uri,xml} +rm -r symfony/polyfill-{php55,php56,php70,mbstring,util} +rm -r paragonie/random_compat +rm -r lukasreschke/id3parser +rm README.md + +# remove composer stuff +rm -r composer* + +# clean up any empty directories +find -type d -empty -delete + +# remove extraneous files now we've cleaned up +rm "LICENSE INFO" patches.txt + +# add our Fedora autoloader +cp %{SOURCE8} ./autoload.php + +# Set the vendor directory to macro based datadir in our autoloader +sed -i "s,##DATADIR##,%{_datadir}," autoload.php +popd + + +# remove files_external bundled libraries +rm -r apps/files_external/3rdparty/{icewind,Dropbox,google-api-php-client,aws-sdk-php,composer*} + +# create autoloader, from composer.json, "require": { +# "icewind/smb": "1.0.4", +# "icewind/streams": "0.2" +# include stuff required directly but not in composer too +cat << 'EOF' | tee apps/files_external/3rdparty/autoload.php + /dev/null 2>&1 || : + +%postun httpd +if [ $1 -eq 0 ]; then + /usr/bin/systemctl reload httpd.service > /dev/null 2>&1 || : +fi + +%post nginx +%if 0%{?el7} + # Work around missing php session directory for php-fpm in el7 bz#1338444 + if [ ! -d /var/lib/php/session ] + then + mkdir /var/lib/php/session + fi + /usr/bin/chown apache /var/lib/php/session +%endif + /usr/bin/systemctl reload nginx.service > /dev/null 2>&1 || : + /usr/bin/systemctl reload php-fpm.service > /dev/null 2>&1 || : + +%postun nginx +if [ $1 -eq 0 ]; then + /usr/bin/systemctl reload nginx.service > /dev/null 2>&1 || : + /usr/bin/systemctl reload php-fpm.service > /dev/null 2>&1 || : +fi + +# the selinux policies only cover owncloud right now +# once this package is accepted pull request for selinux-policy to add +# these will be made +%post +semanage fcontext -a -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}/config.php' 2>/dev/null || : +semanage fcontext -a -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}' 2>/dev/null || : +semanage fcontext -a -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}(/.*)?' 2>/dev/null || : +restorecon -R %{_sysconfdir}/%{name} || : +restorecon -R %{_localstatedir}/lib/%{name} || : + +%postun +if [ $1 -eq 0 ] ; then +semanage fcontext -d -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}/config.php' 2>/dev/null || : +semanage fcontext -d -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}' 2>/dev/null || : +semanage fcontext -d -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}(/.*)?' 2>/dev/null || : +fi + +%files +%doc AUTHORS README.fedora config/config.sample.php +%doc *_composer.json + +%license *-LICENSE + +%dir %attr(-,apache,apache) %{_sysconfdir}/%{name} +# contains sensitive data (dbpassword, passwordsalt) +%config(noreplace) %attr(0600,apache,apache) %{_sysconfdir}/%{name}/config.php +# need the symlink in confdir but it's not config +%{_sysconfdir}/%{name}/ca-bundle.crt + +%{_datadir}/%{name} +%dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name} +# user data must not be world readable +%dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/data +%attr(-,apache,apache) %{_localstatedir}/lib/%{name}/apps + + +%files httpd +%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf +%{_sysconfdir}/httpd/conf.d/%{name}-access.conf.avail +%{_sysconfdir}/httpd/conf.d/*.inc + +%files nginx +%config(noreplace) %{_sysconfdir}/nginx/default.d/%{name}.conf +%config(noreplace) %{_sysconfdir}/nginx/conf.d/%{name}.conf +%config(noreplace) %{_sysconfdir}/php-fpm.d/%{name}.conf + +%files mysql +%doc README.mysql +%files postgresql +%doc README.postgresql +%files sqlite + + +%changelog +* Wed Feb 08 2017 James Hogarth - 10.0.3-1 +- update to 10.0.3 + +* Thu Oct 06 2016 James Hogarth - 10.0.1-1 +- update to 10.0.1 + +* Mon Aug 01 2016 James Hogarth - 9.0.53-5 +- Use lua to have a common srpm between epel7 and fedora + +* Fri Jul 29 2016 James Hogarth - 9.0.53-4 +- Don't unbundle javascript on EPEL7 due to versioning issues + +* Fri Jul 29 2016 James Hogarth - 9.0.53-3 +- Unbundle javascript libraries from core where possible + +* Tue Jul 26 2016 James Hogarth - 9.0.53-2 +- Update the autoloader to use the path from the approved package + +* Tue Jul 19 2016 James Hogarth - 9.0.53-1 +- New release 9.0.53 + +* Thu Jul 14 2016 James Hogarth - 9.0.52-1 +- Initial nextcloud build + diff --git a/sources b/sources index e69de29..93efd48 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (nextcloud-10.0.3.tar.bz2) = 5bab4cf226555c90b379829b287869092d65576cdf6f0cf8de9ed6b5ded799e0bf235b7086c734ac777007c53b35a9eabb71b184f679a7098afda9a5afa78971 -- cgit