diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-11-13 17:07:25 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2023-11-20 11:36:42 +0100 |
commit | 0107c7ea24a28779dad09117d8dc5a4a49b95dc5 (patch) | |
tree | bf287152cf5a5076288a2b7a2fb822ba882ad8da /core | |
parent | 0da05fc73b720702b76d8838228f3ce648793482 (diff) | |
download | nextcloud-server-0107c7ea24a28779dad09117d8dc5a4a49b95dc5.tar.gz nextcloud-server-0107c7ea24a28779dad09117d8dc5a4a49b95dc5.zip |
Migrate Forwarded For Headers check to new API
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/js/setupchecks.js | 8 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 70 |
2 files changed, 0 insertions, 78 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 86d84719d4a..1d64acf01ea 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -222,14 +222,6 @@ type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } - if(!data.forwardedForHeadersWorking) { - messages.push({ - msg: t('core', 'The reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If not, this is a security issue and can allow an attacker to spoof their IP address as visible to the Nextcloud. Further information can be found in the {linkstart}documentation ↗{linkend}.') - .replace('{linkstart}', '<a target="_blank" rel="noreferrer noopener" class="external" href="' + data.reverseProxyDocs + '">') - .replace('{linkend}', '</a>'), - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }); - } if(!data.isCorrectMemcachedPHPModuleInstalled) { messages.push({ msg: t('core', 'Memcached is configured as distributed cache, but the wrong PHP module "memcache" is installed. \\OC\\Memcache\\Memcached only supports "memcached" and not "memcache". See the {linkstart}memcached wiki about both modules ↗{linkend}.') diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 7fee0ed0fae..d9124cfc84d 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -225,7 +225,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -279,7 +278,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -333,7 +331,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -387,7 +384,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: false, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -439,7 +435,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -482,59 +477,6 @@ describe('OC.SetupChecks tests', function() { }); }); - it('should return an error if the forwarded for headers are not working', function(done) { - var async = OC.SetupChecks.checkSetup(); - - suite.server.requests[0].respond( - 200, - { - 'Content-Type': 'application/json', - }, - JSON.stringify({ - suggestedOverwriteCliURL: '', - isFairUseOfFreePushService: true, - forwardedForHeadersWorking: false, - reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', - isCorrectMemcachedPHPModuleInstalled: true, - hasPassedCodeIntegrityCheck: true, - OpcacheSetupRecommendations: [], - isSettimelimitAvailable: true, - missingIndexes: [], - missingPrimaryKeys: [], - missingColumns: [], - cronErrors: [], - cronInfo: { - diffInSeconds: 0 - }, - appDirsWithDifferentOwner: [], - isImagickEnabled: true, - areWebauthnExtensionsEnabled: 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 reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If not, this is a security issue and can allow an attacker to spoof their IP address as visible to the Nextcloud. Further information can be found in the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.nextcloud.com/foo/bar.html">documentation ↗</a>.', - type: OC.SetupChecks.MESSAGE_TYPE_WARNING - }]); - done(); - }); - }); - it('should return an error if set_time_limit is unavailable', function(done) { var async = OC.SetupChecks.checkSetup(); @@ -546,7 +488,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, @@ -599,7 +540,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, reverseProxyDocs: 'https://docs.nextcloud.com/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, @@ -684,7 +624,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -743,7 +682,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: ['recommendation1', 'recommendation2'], @@ -795,7 +733,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -851,7 +788,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -904,7 +840,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -954,7 +889,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -1007,7 +941,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -1060,7 +993,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -1112,7 +1044,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], @@ -1171,7 +1102,6 @@ describe('OC.SetupChecks tests', function() { JSON.stringify({ suggestedOverwriteCliURL: '', isFairUseOfFreePushService: true, - forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], |