It will now show available space and path of both PHP and Nextcloud temporary directories if they differ. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>tags/v29.0.0beta1
'OCA\\Settings\\SetupChecks\\ReadOnlyConfig' => $baseDir . '/../lib/SetupChecks/ReadOnlyConfig.php', | 'OCA\\Settings\\SetupChecks\\ReadOnlyConfig' => $baseDir . '/../lib/SetupChecks/ReadOnlyConfig.php', | ||||
'OCA\\Settings\\SetupChecks\\SupportedDatabase' => $baseDir . '/../lib/SetupChecks/SupportedDatabase.php', | 'OCA\\Settings\\SetupChecks\\SupportedDatabase' => $baseDir . '/../lib/SetupChecks/SupportedDatabase.php', | ||||
'OCA\\Settings\\SetupChecks\\SystemIs64bit' => $baseDir . '/../lib/SetupChecks/SystemIs64bit.php', | 'OCA\\Settings\\SetupChecks\\SystemIs64bit' => $baseDir . '/../lib/SetupChecks/SystemIs64bit.php', | ||||
'OCA\\Settings\\SetupChecks\\TempSpaceAvailableIfS3PrimaryStorage' => $baseDir . '/../lib/SetupChecks/TempSpaceAvailableIfS3PrimaryStorage.php', | |||||
'OCA\\Settings\\SetupChecks\\TempSpaceAvailable' => $baseDir . '/../lib/SetupChecks/TempSpaceAvailable.php', | |||||
'OCA\\Settings\\SetupChecks\\TransactionIsolation' => $baseDir . '/../lib/SetupChecks/TransactionIsolation.php', | 'OCA\\Settings\\SetupChecks\\TransactionIsolation' => $baseDir . '/../lib/SetupChecks/TransactionIsolation.php', | ||||
'OCA\\Settings\\UserMigration\\AccountMigrator' => $baseDir . '/../lib/UserMigration/AccountMigrator.php', | 'OCA\\Settings\\UserMigration\\AccountMigrator' => $baseDir . '/../lib/UserMigration/AccountMigrator.php', | ||||
'OCA\\Settings\\UserMigration\\AccountMigratorException' => $baseDir . '/../lib/UserMigration/AccountMigratorException.php', | 'OCA\\Settings\\UserMigration\\AccountMigratorException' => $baseDir . '/../lib/UserMigration/AccountMigratorException.php', |
'OCA\\Settings\\SetupChecks\\ReadOnlyConfig' => __DIR__ . '/..' . '/../lib/SetupChecks/ReadOnlyConfig.php', | 'OCA\\Settings\\SetupChecks\\ReadOnlyConfig' => __DIR__ . '/..' . '/../lib/SetupChecks/ReadOnlyConfig.php', | ||||
'OCA\\Settings\\SetupChecks\\SupportedDatabase' => __DIR__ . '/..' . '/../lib/SetupChecks/SupportedDatabase.php', | 'OCA\\Settings\\SetupChecks\\SupportedDatabase' => __DIR__ . '/..' . '/../lib/SetupChecks/SupportedDatabase.php', | ||||
'OCA\\Settings\\SetupChecks\\SystemIs64bit' => __DIR__ . '/..' . '/../lib/SetupChecks/SystemIs64bit.php', | 'OCA\\Settings\\SetupChecks\\SystemIs64bit' => __DIR__ . '/..' . '/../lib/SetupChecks/SystemIs64bit.php', | ||||
'OCA\\Settings\\SetupChecks\\TempSpaceAvailableIfS3PrimaryStorage' => __DIR__ . '/..' . '/../lib/SetupChecks/TempSpaceAvailableIfS3PrimaryStorage.php', | |||||
'OCA\\Settings\\SetupChecks\\TempSpaceAvailable' => __DIR__ . '/..' . '/../lib/SetupChecks/TempSpaceAvailable.php', | |||||
'OCA\\Settings\\SetupChecks\\TransactionIsolation' => __DIR__ . '/..' . '/../lib/SetupChecks/TransactionIsolation.php', | 'OCA\\Settings\\SetupChecks\\TransactionIsolation' => __DIR__ . '/..' . '/../lib/SetupChecks/TransactionIsolation.php', | ||||
'OCA\\Settings\\UserMigration\\AccountMigrator' => __DIR__ . '/..' . '/../lib/UserMigration/AccountMigrator.php', | 'OCA\\Settings\\UserMigration\\AccountMigrator' => __DIR__ . '/..' . '/../lib/UserMigration/AccountMigrator.php', | ||||
'OCA\\Settings\\UserMigration\\AccountMigratorException' => __DIR__ . '/..' . '/../lib/UserMigration/AccountMigratorException.php', | 'OCA\\Settings\\UserMigration\\AccountMigratorException' => __DIR__ . '/..' . '/../lib/UserMigration/AccountMigratorException.php', |
use OCA\Settings\SetupChecks\ReadOnlyConfig; | use OCA\Settings\SetupChecks\ReadOnlyConfig; | ||||
use OCA\Settings\SetupChecks\SupportedDatabase; | use OCA\Settings\SetupChecks\SupportedDatabase; | ||||
use OCA\Settings\SetupChecks\SystemIs64bit; | use OCA\Settings\SetupChecks\SystemIs64bit; | ||||
use OCA\Settings\SetupChecks\TempSpaceAvailableIfS3PrimaryStorage; | |||||
use OCA\Settings\SetupChecks\TempSpaceAvailable; | |||||
use OCA\Settings\SetupChecks\TransactionIsolation; | use OCA\Settings\SetupChecks\TransactionIsolation; | ||||
use OCA\Settings\UserMigration\AccountMigrator; | use OCA\Settings\UserMigration\AccountMigrator; | ||||
use OCA\Settings\WellKnown\ChangePasswordHandler; | use OCA\Settings\WellKnown\ChangePasswordHandler; | ||||
$context->registerSetupCheck(ReadOnlyConfig::class); | $context->registerSetupCheck(ReadOnlyConfig::class); | ||||
$context->registerSetupCheck(SupportedDatabase::class); | $context->registerSetupCheck(SupportedDatabase::class); | ||||
$context->registerSetupCheck(SystemIs64bit::class); | $context->registerSetupCheck(SystemIs64bit::class); | ||||
$context->registerSetupCheck(TempSpaceAvailableIfS3PrimaryStorage::class); | |||||
$context->registerSetupCheck(TempSpaceAvailable::class); | |||||
$context->registerSetupCheck(TransactionIsolation::class); | $context->registerSetupCheck(TransactionIsolation::class); | ||||
$context->registerUserMigrator(AccountMigrator::class); | $context->registerUserMigrator(AccountMigrator::class); |
use OCP\IConfig; | use OCP\IConfig; | ||||
use OCP\IL10N; | use OCP\IL10N; | ||||
use OCP\IRequest; | use OCP\IRequest; | ||||
use OCP\ITempManager; | |||||
use OCP\IURLGenerator; | use OCP\IURLGenerator; | ||||
use OCP\Notification\IManager; | use OCP\Notification\IManager; | ||||
use OCP\SetupCheck\ISetupCheckManager; | use OCP\SetupCheck\ISetupCheckManager; | ||||
private $checker; | private $checker; | ||||
/** @var LoggerInterface */ | /** @var LoggerInterface */ | ||||
private $logger; | private $logger; | ||||
/** @var ITempManager */ | |||||
private $tempManager; | |||||
/** @var IManager */ | /** @var IManager */ | ||||
private $manager; | private $manager; | ||||
private ISetupCheckManager $setupCheckManager; | private ISetupCheckManager $setupCheckManager; | ||||
IL10N $l10n, | IL10N $l10n, | ||||
Checker $checker, | Checker $checker, | ||||
LoggerInterface $logger, | LoggerInterface $logger, | ||||
ITempManager $tempManager, | |||||
IManager $manager, | IManager $manager, | ||||
ISetupCheckManager $setupCheckManager, | ISetupCheckManager $setupCheckManager, | ||||
) { | ) { | ||||
$this->l10n = $l10n; | $this->l10n = $l10n; | ||||
$this->checker = $checker; | $this->checker = $checker; | ||||
$this->logger = $logger; | $this->logger = $logger; | ||||
$this->tempManager = $tempManager; | |||||
$this->manager = $manager; | $this->manager = $manager; | ||||
$this->setupCheckManager = $setupCheckManager; | $this->setupCheckManager = $setupCheckManager; | ||||
} | } | ||||
); | ); | ||||
} | } | ||||
private function isTemporaryDirectoryWritable(): bool { | |||||
try { | |||||
if (!empty($this->tempManager->getTempBaseDir())) { | |||||
return true; | |||||
} | |||||
} catch (\Exception $e) { | |||||
} | |||||
return false; | |||||
} | |||||
/** | /** | ||||
* @return DataResponse | * @return DataResponse | ||||
* @AuthorizedAdminSetting(settings=OCA\Settings\Settings\Admin\Overview) | * @AuthorizedAdminSetting(settings=OCA\Settings\Settings\Admin\Overview) | ||||
'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(), | 'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(), | ||||
'reverseProxyDocs' => $this->urlGenerator->linkToDocs('admin-reverse-proxy'), | 'reverseProxyDocs' => $this->urlGenerator->linkToDocs('admin-reverse-proxy'), | ||||
'reverseProxyGeneratedURL' => $this->urlGenerator->getAbsoluteURL('index.php'), | 'reverseProxyGeneratedURL' => $this->urlGenerator->getAbsoluteURL('index.php'), | ||||
'temporaryDirectoryWritable' => $this->isTemporaryDirectoryWritable(), | |||||
'generic' => $this->setupCheckManager->runAll(), | 'generic' => $this->setupCheckManager->runAll(), | ||||
] | ] | ||||
); | ); |
use OCP\IConfig; | use OCP\IConfig; | ||||
use OCP\IL10N; | use OCP\IL10N; | ||||
use OCP\ITempManager; | |||||
use OCP\IURLGenerator; | use OCP\IURLGenerator; | ||||
use OCP\SetupCheck\ISetupCheck; | use OCP\SetupCheck\ISetupCheck; | ||||
use OCP\SetupCheck\SetupResult; | use OCP\SetupCheck\SetupResult; | ||||
class TempSpaceAvailableIfS3PrimaryStorage implements ISetupCheck { | |||||
class TempSpaceAvailable implements ISetupCheck { | |||||
public function __construct( | public function __construct( | ||||
private IL10N $l10n, | private IL10N $l10n, | ||||
private IConfig $config, | private IConfig $config, | ||||
private IURLGenerator $urlGenerator, | private IURLGenerator $urlGenerator, | ||||
private ITempManager $tempManager, | |||||
) { | ) { | ||||
} | } | ||||
return 'system'; | return 'system'; | ||||
} | } | ||||
public function run(): SetupResult { | |||||
private function isPrimaryStorageS3(): bool { | |||||
$objectStore = $this->config->getSystemValue('objectstore', null); | $objectStore = $this->config->getSystemValue('objectstore', null); | ||||
$objectStoreMultibucket = $this->config->getSystemValue('objectstore_multibucket', null); | $objectStoreMultibucket = $this->config->getSystemValue('objectstore_multibucket', null); | ||||
// TODO we should check and display temp space available even if not s3 | |||||
if (!isset($objectStoreMultibucket) && !isset($objectStore)) { | if (!isset($objectStoreMultibucket) && !isset($objectStore)) { | ||||
return SetupResult::success($this->l10n->t('This instance does not use an S3 based object store as primary storage')); | |||||
return false; | |||||
} | } | ||||
if (isset($objectStoreMultibucket['class']) && $objectStoreMultibucket['class'] !== 'OC\\Files\\ObjectStore\\S3') { | if (isset($objectStoreMultibucket['class']) && $objectStoreMultibucket['class'] !== 'OC\\Files\\ObjectStore\\S3') { | ||||
return SetupResult::success($this->l10n->t('This instance does not use an S3 based object store as primary storage')); | |||||
return false; | |||||
} | } | ||||
if (isset($objectStore['class']) && $objectStore['class'] !== 'OC\\Files\\ObjectStore\\S3') { | if (isset($objectStore['class']) && $objectStore['class'] !== 'OC\\Files\\ObjectStore\\S3') { | ||||
return SetupResult::success($this->l10n->t('This instance does not use an S3 based object store as primary storage')); | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
public function run(): SetupResult { | |||||
$phpTempPath = sys_get_temp_dir(); | |||||
$nextcloudTempPath = ''; | |||||
try { | |||||
$nextcloudTempPath = $this->tempManager->getTempBaseDir(); | |||||
} catch (\Exception $e) { | |||||
} | |||||
if (empty($nextcloudTempPath)) { | |||||
return SetupResult::error('The temporary directory of this instance points to an either non-existing or non-writable directory.'); | |||||
} | } | ||||
$tempPath = sys_get_temp_dir(); | |||||
if (!is_dir($tempPath)) { | |||||
return SetupResult::error($this->l10n->t('Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: %s', [$tempPath])); | |||||
if (!is_dir($phpTempPath)) { | |||||
return SetupResult::error($this->l10n->t('Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: %s', [$phpTempPath])); | |||||
} | } | ||||
$freeSpaceInTemp = function_exists('disk_free_space') ? disk_free_space($tempPath) : false; | |||||
$freeSpaceInTemp = function_exists('disk_free_space') ? disk_free_space($phpTempPath) : false; | |||||
if ($freeSpaceInTemp === false) { | if ($freeSpaceInTemp === false) { | ||||
return SetupResult::error($this->l10n->t('Error while checking the available disk space of temporary PHP path or no free disk space returned. Temporary path: %s', [$tempPath])); | |||||
return SetupResult::error($this->l10n->t('Error while checking the available disk space of temporary PHP path or no free disk space returned. Temporary path: %s', [$phpTempPath])); | |||||
} | } | ||||
/** Build details data about temporary directory, either one or two of them */ | |||||
$freeSpaceInTempInGB = $freeSpaceInTemp / 1024 / 1024 / 1024; | $freeSpaceInTempInGB = $freeSpaceInTemp / 1024 / 1024 / 1024; | ||||
$spaceDetail = $this->l10n->t('- %.1f GiB available in %s (PHP temporary directory)', [round($freeSpaceInTempInGB, 1),$phpTempPath]); | |||||
if ($nextcloudTempPath !== $phpTempPath) { | |||||
$freeSpaceInNextcloudTemp = function_exists('disk_free_space') ? disk_free_space($nextcloudTempPath) : false; | |||||
if ($freeSpaceInNextcloudTemp === false) { | |||||
return SetupResult::error($this->l10n->t('Error while checking the available disk space of temporary PHP path or no free disk space returned. Temporary path: %s', [$nextcloudTempPath])); | |||||
} | |||||
$freeSpaceInNextcloudTempInGB = $freeSpaceInNextcloudTemp / 1024 / 1024 / 1024; | |||||
$spaceDetail .= "\n".$this->l10n->t('- %.1f GiB available in %s (Nextcloud temporary directory)', [round($freeSpaceInNextcloudTempInGB, 1),$nextcloudTempPath]); | |||||
} | |||||
if (!$this->isPrimaryStorageS3()) { | |||||
return SetupResult::success( | |||||
$this->l10n->t("Temporary directory is correctly configured:\n%s", [$spaceDetail]) | |||||
); | |||||
} | |||||
if ($freeSpaceInTempInGB > 50) { | if ($freeSpaceInTempInGB > 50) { | ||||
return SetupResult::success( | return SetupResult::success( | ||||
$this->l10n->t( | $this->l10n->t( | ||||
"This instance uses an S3 based object store as primary storage, and has enough space in the temporary directory.\nAvailable: %.1f GiB\nPath: %s", | |||||
[round($freeSpaceInTempInGB, 1),$tempPath] | |||||
"This instance uses an S3 based object store as primary storage, and has enough space in the temporary directory.\n%s", | |||||
[$spaceDetail] | |||||
) | ) | ||||
); | ); | ||||
} | } | ||||
return SetupResult::warning( | return SetupResult::warning( | ||||
$this->l10n->t( | $this->l10n->t( | ||||
"This instance uses an S3 based object store as primary storage. The uploaded files are stored temporarily on the server and thus it is recommended to have 50 GiB of free space available in the temp directory of PHP. To improve this please change the temporary directory in the php.ini or make more space available in that path. \nChecking the available space in the temporary path resulted in %.1f GiB instead of the recommended 50 GiB. Path: %s", | "This instance uses an S3 based object store as primary storage. The uploaded files are stored temporarily on the server and thus it is recommended to have 50 GiB of free space available in the temp directory of PHP. To improve this please change the temporary directory in the php.ini or make more space available in that path. \nChecking the available space in the temporary path resulted in %.1f GiB instead of the recommended 50 GiB. Path: %s", | ||||
[round($freeSpaceInTempInGB, 1),$tempPath] | |||||
[round($freeSpaceInTempInGB, 1),$phpTempPath] | |||||
) | ) | ||||
); | ); | ||||
} | } |
use OCP\IConfig; | use OCP\IConfig; | ||||
use OCP\IL10N; | use OCP\IL10N; | ||||
use OCP\IRequest; | use OCP\IRequest; | ||||
use OCP\ITempManager; | |||||
use OCP\IURLGenerator; | use OCP\IURLGenerator; | ||||
use OCP\Notification\IManager; | use OCP\Notification\IManager; | ||||
use OCP\SetupCheck\ISetupCheckManager; | use OCP\SetupCheck\ISetupCheckManager; | ||||
private $logger; | private $logger; | ||||
/** @var Checker|\PHPUnit\Framework\MockObject\MockObject */ | /** @var Checker|\PHPUnit\Framework\MockObject\MockObject */ | ||||
private $checker; | private $checker; | ||||
/** @var ITempManager|\PHPUnit\Framework\MockObject\MockObject */ | |||||
private $tempManager; | |||||
/** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ | /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ | ||||
private $notificationManager; | private $notificationManager; | ||||
/** @var ISetupCheckManager|MockObject */ | /** @var ISetupCheckManager|MockObject */ | ||||
$this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker') | $this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker') | ||||
->disableOriginalConstructor()->getMock(); | ->disableOriginalConstructor()->getMock(); | ||||
$this->logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); | $this->logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); | ||||
$this->tempManager = $this->getMockBuilder(ITempManager::class)->getMock(); | |||||
$this->notificationManager = $this->getMockBuilder(IManager::class)->getMock(); | $this->notificationManager = $this->getMockBuilder(IManager::class)->getMock(); | ||||
$this->setupCheckManager = $this->createMock(ISetupCheckManager::class); | $this->setupCheckManager = $this->createMock(ISetupCheckManager::class); | ||||
$this->checkSetupController = $this->getMockBuilder(CheckSetupController::class) | $this->checkSetupController = $this->getMockBuilder(CheckSetupController::class) | ||||
$this->l10n, | $this->l10n, | ||||
$this->checker, | $this->checker, | ||||
$this->logger, | $this->logger, | ||||
$this->tempManager, | |||||
$this->notificationManager, | $this->notificationManager, | ||||
$this->setupCheckManager, | $this->setupCheckManager, | ||||
]) | ]) | ||||
'reverseProxyDocs' => 'reverse-proxy-doc-link', | 'reverseProxyDocs' => 'reverse-proxy-doc-link', | ||||
'reverseProxyGeneratedURL' => 'https://server/index.php', | 'reverseProxyGeneratedURL' => 'https://server/index.php', | ||||
'isFairUseOfFreePushService' => false, | 'isFairUseOfFreePushService' => false, | ||||
'temporaryDirectoryWritable' => false, | |||||
'generic' => [], | 'generic' => [], | ||||
] | ] | ||||
); | ); |
}); | }); | ||||
} | } | ||||
if (!data.temporaryDirectoryWritable) { | |||||
messages.push({ | |||||
msg: t('core', 'The temporary directory of this instance points to an either non-existing or non-writable directory.'), | |||||
type: OC.SetupChecks.MESSAGE_TYPE_WARNING | |||||
}) | |||||
} | |||||
if (window.location.protocol === 'https:' && data.reverseProxyGeneratedURL.split('/')[0] !== 'https:') { | if (window.location.protocol === 'https:' && data.reverseProxyGeneratedURL.split('/')[0] !== 'https:') { | ||||
messages.push({ | messages.push({ | ||||
msg: t('core', 'You are accessing your instance over a secure connection, however your instance is generating insecure URLs. This most likely means that you are behind a reverse proxy and the overwrite config variables are not set correctly. Please read {linkstart}the documentation page about this ↗{linkend}.') | msg: t('core', 'You are accessing your instance over a secure connection, however your instance is generating insecure URLs. This most likely means that you are behind a reverse proxy and the overwrite config variables are not set correctly. Please read {linkstart}the documentation page about this ↗{linkend}.') |
JSON.stringify({ | JSON.stringify({ | ||||
isFairUseOfFreePushService: true, | isFairUseOfFreePushService: true, | ||||
reverseProxyGeneratedURL: 'https://server', | reverseProxyGeneratedURL: 'https://server', | ||||
temporaryDirectoryWritable: true, | |||||
generic: { | generic: { | ||||
network: { | network: { | ||||
"Internet connectivity": { | "Internet connectivity": { | ||||
JSON.stringify({ | JSON.stringify({ | ||||
isFairUseOfFreePushService: true, | isFairUseOfFreePushService: true, | ||||
reverseProxyGeneratedURL: 'https://server', | reverseProxyGeneratedURL: 'https://server', | ||||
temporaryDirectoryWritable: true, | |||||
generic: { | generic: { | ||||
network: { | network: { | ||||
"Internet connectivity": { | "Internet connectivity": { | ||||
JSON.stringify({ | JSON.stringify({ | ||||
isFairUseOfFreePushService: true, | isFairUseOfFreePushService: true, | ||||
reverseProxyGeneratedURL: 'https://server', | reverseProxyGeneratedURL: 'https://server', | ||||
temporaryDirectoryWritable: true, | |||||
generic: { | generic: { | ||||
network: { | network: { | ||||
"Internet connectivity": { | "Internet connectivity": { | ||||
isFairUseOfFreePushService: true, | isFairUseOfFreePushService: true, | ||||
reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', | reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', | ||||
reverseProxyGeneratedURL: 'https://server', | reverseProxyGeneratedURL: 'https://server', | ||||
temporaryDirectoryWritable: true, | |||||
generic: { | generic: { | ||||
network: { | network: { | ||||
"Internet connectivity": { | "Internet connectivity": { | ||||
JSON.stringify({ | JSON.stringify({ | ||||
isFairUseOfFreePushService: true, | isFairUseOfFreePushService: true, | ||||
reverseProxyGeneratedURL: 'https://server', | reverseProxyGeneratedURL: 'https://server', | ||||
temporaryDirectoryWritable: true, | |||||
generic: { | generic: { | ||||
network: { | network: { | ||||
"Internet connectivity": { | "Internet connectivity": { | ||||
isFairUseOfFreePushService: true, | isFairUseOfFreePushService: true, | ||||
reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', | reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', | ||||
reverseProxyGeneratedURL: 'http://server', | reverseProxyGeneratedURL: 'http://server', | ||||
temporaryDirectoryWritable: true, | |||||
generic: { | generic: { | ||||
network: { | network: { | ||||
"Internet connectivity": { | "Internet connectivity": { | ||||
isFairUseOfFreePushService: true, | isFairUseOfFreePushService: true, | ||||
reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', | reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', | ||||
reverseProxyGeneratedURL: 'http://server', | reverseProxyGeneratedURL: 'http://server', | ||||
temporaryDirectoryWritable: true, | |||||
generic: { | generic: { | ||||
network: { | network: { | ||||
"Internet connectivity": { | "Internet connectivity": { | ||||
JSON.stringify({ | JSON.stringify({ | ||||
isFairUseOfFreePushService: true, | isFairUseOfFreePushService: true, | ||||
reverseProxyGeneratedURL: 'https://server', | reverseProxyGeneratedURL: 'https://server', | ||||
temporaryDirectoryWritable: true, | |||||
generic: { | generic: { | ||||
network: { | network: { | ||||
"Internet connectivity": { | "Internet connectivity": { | ||||
done(); | done(); | ||||
}); | }); | ||||
}); | }); | ||||
it('should return an info if the temporary directory is either non-existent or non-writable', function(done) { | |||||
var async = OC.SetupChecks.checkSetup(); | |||||
suite.server.requests[0].respond( | |||||
200, | |||||
{ | |||||
'Content-Type': 'application/json', | |||||
}, | |||||
JSON.stringify({ | |||||
isFairUseOfFreePushService: true, | |||||
reverseProxyGeneratedURL: 'https://server', | |||||
temporaryDirectoryWritable: false, | |||||
generic: { | |||||
network: { | |||||
"Internet connectivity": { | |||||
severity: "success", | |||||
description: null, | |||||
linkToDoc: null | |||||
} | |||||
}, | |||||
}, | |||||
}) | |||||
); | |||||
async.done(function( data, s, x ){ | |||||
expect(data).toEqual([{ | |||||
msg: 'The temporary directory of this instance points to an either non-existing or non-writable directory.', | |||||
type: OC.SetupChecks.MESSAGE_TYPE_WARNING | |||||
}]); | |||||
done(); | |||||
}); | |||||
}); | |||||
}); | }); | ||||
describe('checkGeneric', function() { | describe('checkGeneric', function() { |