diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-10-26 15:16:28 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-11-07 12:14:03 +0100 |
commit | 6911dc30e6032d11dda3a45a679aec9cf5cf0ccf (patch) | |
tree | aaf739245b2df6e19af1cdfe9a7d528f37d79748 /core/js | |
parent | f9770b8ef27cfa503e06708e127a014c3c08828b (diff) | |
download | nextcloud-server-6911dc30e6032d11dda3a45a679aec9cf5cf0ccf.tar.gz nextcloud-server-6911dc30e6032d11dda3a45a679aec9cf5cf0ccf.zip |
Migrated both file locking checks to SetupCheck API
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/setupchecks.js | 28 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 164 |
2 files changed, 0 insertions, 192 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 04eed184c90..ba83ff93812 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -180,18 +180,6 @@ var afterCall = function(data, statusText, xhr) { var messages = []; if (xhr.status === 200 && data) { - if (!data.hasValidTransactionIsolationLevel) { - messages.push({ - msg: t('core', 'Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.'), - type: OC.SetupChecks.MESSAGE_TYPE_ERROR - }); - } - if(!data.hasFileinfoInstalled) { - messages.push({ - msg: t('core', 'The PHP module "fileinfo" is missing. It is strongly recommended to enable this module to get the best results with MIME type detection.'), - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }); - } if (data.isBruteforceThrottled) { messages.push({ msg: t('core', 'Your remote address was identified as "{remoteAddress}" and is bruteforce throttled at the moment slowing down the performance of various requests. If the remote address is not your address this can be an indication that a proxy is not configured correctly. Further information can be found in the {linkstart}documentation ↗{linkend}.', { remoteAddress: data.bruteforceRemoteAddress }) @@ -200,22 +188,6 @@ type: OC.SetupChecks.MESSAGE_TYPE_ERROR }); } - if(!data.hasWorkingFileLocking) { - messages.push({ - msg: t('core', 'Transactional file locking is disabled, this might lead to issues with race conditions. Enable "filelocking.enabled" in config.php to avoid these problems. See the {linkstart}documentation ↗{linkend} for more information.') - .replace('{linkstart}', '<a target="_blank" rel="noreferrer noopener" class="external" href="' + OC.theme.docPlaceholderUrl.replace('PLACEHOLDER', 'admin-transactional-locking') + '">') - .replace('{linkend}', '</a>'), - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }); - } - if(data.hasDBFileLocking) { - messages.push({ - msg: t('core', 'The database is used for transactional file locking. To enhance performance, please configure memcache, if available. See the {linkstart}documentation ↗{linkend} for more information.') - .replace('{linkstart}', '<a target="_blank" rel="noreferrer noopener" class="external" href="' + OC.theme.docPlaceholderUrl.replace('PLACEHOLDER', 'admin-transactional-locking') + '">') - .replace('{linkend}', '</a>'), - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }); - } if (data.suggestedOverwriteCliURL !== '') { messages.push({ msg: t('core', 'Please make sure to set the "overwrite.cli.url" option in your config.php file to the URL that your users mainly use to access this Nextcloud. Suggestion: "{suggestedOverwriteCliURL}". Otherwise there might be problems with the URL generation via cron. (It is possible though that the suggested URL is not the URL that your users mainly use to access this Nextcloud. Best is to double check this in any case.)', {suggestedOverwriteCliURL: data.suggestedOverwriteCliURL}), diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 357e111e3ee..89d3cdfc926 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -223,8 +223,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json' }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, isFairUseOfFreePushService: true, @@ -288,8 +286,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json' }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, isFairUseOfFreePushService: true, @@ -353,8 +349,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, isFairUseOfFreePushService: true, @@ -414,8 +408,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: false, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -474,8 +466,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -525,126 +515,6 @@ describe('OC.SetupChecks tests', function() { }); }); - it('should return an info if transactional file locking is not set up', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json' - }, - JSON.stringify({ - hasWorkingFileLocking: false, - hasDBFileLocking: false, - suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', - isFairUseOfFreePushService: true, - isMemcacheConfigured: true, - forwardedForHeadersWorking: true, - isCorrectMemcachedPHPModuleInstalled: true, - hasPassedCodeIntegrityCheck: true, - OpcacheSetupRecommendations: [], - isSettimelimitAvailable: true, - hasFreeTypeSupport: true, - missingIndexes: [], - missingPrimaryKeys: [], - missingColumns: [], - cronErrors: [], - cronInfo: { - diffInSeconds: 0 - }, - isMemoryLimitSufficient: true, - appDirsWithDifferentOwner: [], - isImagickEnabled: true, - areWebauthnExtensionsEnabled: true, - is64bit: true, - pendingBigIntConversionColumns: [], - isMysqlUsedWithoutUTF8MB4: false, - isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, - reverseProxyGeneratedURL: 'https://server', - temporaryDirectoryWritable: true, - generic: { - network: { - "Internet connectivity": { - severity: "success", - description: null, - linkToDoc: null - } - }, - }, - }) - ); - - async.done(function( data, s, x ){ - expect(data).toEqual([{ - msg: 'Transactional file locking is disabled, this might lead to issues with race conditions. Enable "filelocking.enabled" in config.php to avoid these problems. See the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.example.org/admin-transactional-locking">documentation ↗</a> for more information.', - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }]); - done(); - }); - }); - - it('should return an info if database file locking is used', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json' - }, - JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: true, - suggestedOverwriteCliURL: '', - isRandomnessSecure: true, - securityDocs: 'https://docs.nextcloud.com/myDocs.html', - isFairUseOfFreePushService: true, - isMemcacheConfigured: true, - forwardedForHeadersWorking: true, - isCorrectMemcachedPHPModuleInstalled: true, - hasPassedCodeIntegrityCheck: true, - OpcacheSetupRecommendations: [], - isSettimelimitAvailable: true, - hasFreeTypeSupport: true, - missingIndexes: [], - missingPrimaryKeys: [], - missingColumns: [], - cronErrors: [], - cronInfo: { - diffInSeconds: 0 - }, - isMemoryLimitSufficient: true, - appDirsWithDifferentOwner: [], - isImagickEnabled: true, - areWebauthnExtensionsEnabled: true, - is64bit: true, - pendingBigIntConversionColumns: [], - isMysqlUsedWithoutUTF8MB4: false, - isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed: true, - reverseProxyGeneratedURL: 'https://server', - temporaryDirectoryWritable: true, - generic: { - network: { - "Internet connectivity": { - severity: "success", - description: null, - linkToDoc: null - } - }, - }, - }) - ); - - async.done(function( data, s, x ){ - expect(data).toEqual([{ - msg: 'The database is used for transactional file locking. To enhance performance, please configure memcache, if available. See the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.example.org/admin-transactional-locking">documentation ↗</a> for more information.', - type: OC.SetupChecks.MESSAGE_TYPE_INFO - }]); - done(); - }); - }); - it('should return a warning if there are app directories with wrong permissions', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -654,8 +524,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -716,8 +584,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, isFairUseOfFreePushService: true, @@ -776,8 +642,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, isFairUseOfFreePushService: true, @@ -838,8 +702,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, isFairUseOfFreePushService: true, @@ -898,8 +760,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, isFairUseOfFreePushService: true, @@ -978,8 +838,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1045,8 +903,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json' }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1105,8 +961,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json' }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1165,8 +1019,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1229,8 +1081,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1290,8 +1140,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1348,8 +1196,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1409,8 +1255,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1470,8 +1314,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1530,8 +1372,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1590,8 +1430,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', @@ -1657,8 +1495,6 @@ describe('OC.SetupChecks tests', function() { 'Content-Type': 'application/json', }, JSON.stringify({ - hasWorkingFileLocking: true, - hasDBFileLocking: false, suggestedOverwriteCliURL: '', isRandomnessSecure: true, securityDocs: 'https://docs.nextcloud.com/myDocs.html', |