aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2021-09-17 18:19:22 +0200
committerGitHub <noreply@github.com>2021-09-17 18:19:22 +0200
commit3eb1d23720768d7df5f9340330d9ec76f6e96a51 (patch)
tree08d8e55c29c7e7cbbb8f8aa76488f92d1d0e8b99 /core
parent62a814f4fbdec485e97e6b55a8320a02ced488bb (diff)
parentd4cc22daadb1f9d2bbf21830c321bed2eb6b0d88 (diff)
downloadnextcloud-server-3eb1d23720768d7df5f9340330d9ec76f6e96a51.tar.gz
nextcloud-server-3eb1d23720768d7df5f9340330d9ec76f6e96a51.zip
Merge pull request #28838 from stefan-schilling/enh/16719-integrity-check-temp-dir
Issue 16719: CheckSetupController.php now checks configured temporary directory for existence and if it's writable
Diffstat (limited to 'core')
-rw-r--r--core/js/setupchecks.js9
-rw-r--r--core/js/tests/specs/setupchecksSpec.js72
2 files changed, 81 insertions, 0 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index fc25f499020..8debb0f6528 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -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}.')
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index 79fdc12887e..a05c77f59bf 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -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: true,
+ 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() {