Issue 16719: CheckSetupController.php now checks configured temporary directory for existence and if it's writable

Signed-off-by: Stefan <Stefan.Schilling@EXXETA.com>
pull/28838/head
Stefan 5 years ago
parent a6ef9dfe47
commit 8758b36ebb
  1. 11
      apps/settings/lib/Controller/CheckSetupController.php
  2. 9
      core/js/setupchecks.js
  3. 72
      core/js/tests/specs/setupchecksSpec.js

@ -554,6 +554,16 @@ Raw output
return extension_loaded('Zend OPcache');
}
private function isTemporaryDirectoryWritable(): bool {
try {
if (!empty(OC::$server->getTempManager()->getTempBaseDir())) {
return true;
}
} catch (\Exception $e) {
}
return false;
}
/**
* Iterates through the configured app roots and
* tests if the subdirectories are owned by the same user than the current user.
@ -779,6 +789,7 @@ Raw output
CheckUserCertificates::class => ['pass' => $checkUserCertificates->run(), 'description' => $checkUserCertificates->description(), 'severity' => $checkUserCertificates->severity(), 'elements' => $checkUserCertificates->elements()],
'isDefaultPhoneRegionSet' => $this->config->getSystemValueString('default_phone_region', '') !== '',
SupportedDatabase::class => ['pass' => $supportedDatabases->run(), 'description' => $supportedDatabases->description(), 'severity' => $supportedDatabases->severity()],
'temporaryDirectoryWritable' => $this->isTemporaryDirectoryWritable(),
]
);
}

@ -487,6 +487,15 @@
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
})
}
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:') {
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}.')

@ -254,6 +254,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -310,6 +311,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -367,6 +369,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -422,6 +425,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -475,6 +479,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -530,6 +535,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -583,6 +589,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -636,6 +643,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -689,6 +697,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -763,6 +772,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -817,6 +827,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -871,6 +882,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -925,6 +937,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -978,6 +991,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -1036,6 +1050,7 @@ describe('OC.SetupChecks tests', function() {
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html',
reverseProxyGeneratedURL: 'http://server',
temporaryDirectoryWritable: true,
})
);
@ -1090,6 +1105,7 @@ describe('OC.SetupChecks tests', function() {
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html',
reverseProxyGeneratedURL: 'http://server',
temporaryDirectoryWritable: true,
})
);
@ -1140,6 +1156,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: true,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: false,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -1193,6 +1210,7 @@ describe('OC.SetupChecks tests', function() {
isDefaultPhoneRegionSet: false,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: true,
})
);
@ -1204,6 +1222,60 @@ describe('OC.SetupChecks tests', function() {
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({
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
isRandomnessSecure: true,
securityDocs: 'https://docs.nextcloud.com/myDocs.html',
serverHasInternetConnectionProblems: false,
isMemcacheConfigured: true,
forwardedForHeadersWorking: true,
isCorrectMemcachedPHPModuleInstalled: true,
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
hasOpcacheLoaded: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true,
missingIndexes: [],
missingPrimaryKeys: [],
missingColumns: [],
cronErrors: [],
cronInfo: {
diffInSeconds: 0
},
isMemoryLimitSufficient: true,
appDirsWithDifferentOwner: [],
recommendedPHPModules: [],
pendingBigIntConversionColumns: [],
isMysqlUsedWithoutUTF8MB4: false,
isDefaultPhoneRegionSet: false,
isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true,
reverseProxyGeneratedURL: 'https://server',
temporaryDirectoryWritable: false,
})
);
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() {

Loading…
Cancel
Save